@anker-in/shopify-sdk 0.1.1-beta.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client/client.ts","../src/fragments/image.ts","../src/fragments/seo.ts","../src/fragments/metafield.ts","../src/fragments/variant.ts","../src/fragments/product.ts","../src/fragments/cart.ts","../src/fragments/collection.ts","../src/fragments/page-info.ts","../src/fragments/blog.ts","../src/queries/product/get-product.ts","../src/queries/product/get-products.ts","../src/queries/product/get-products-by-handles.ts","../src/queries/product/get-all-products-paths.ts","../src/queries/cart/get-cart.ts","../src/mutations/cart/create-cart.ts","../src/mutations/cart/add-cart-items.ts","../src/mutations/cart/update-cart-items.ts","../src/mutations/cart/remove-cart-items.ts","../src/mutations/cart/update-cart-discount-code.ts","../src/mutations/cart/update-cart-attributes.ts","../src/utils.ts","../src/api/product/normalize.ts","../src/api/product/get-product.ts","../src/api/product/get-all-products.ts","../src/api/product/get-products-by-handles.ts","../src/api/cart/normalize.ts","../src/api/cart/get-cart.ts","../src/api/cart/create-cart.ts","../src/api/cart/add-cart-lines.ts","../src/api/cart/update-cart-lines.ts","../src/api/cart/remove-cart-lines.ts","../src/api/cart/update-cart-codes.ts","../src/api/cart/update-cart-attributes.ts","../src/api/collection/normalize.ts","../src/api/collection/get-collection.ts","../src/api/collection/get-all-collections.ts","../src/api/blog/normalize.ts","../src/api/blog/get-blog.ts","../src/api/blog/get-all-blogs.ts","../src/api/blog/get-article.ts","../src/api/blog/get-articles.ts","../src/api/blog/get-articles-in-blog.ts"],"names":["metafieldIdentifiers","getProductQuery","fetchAllPages","normalizeMetafields"],"mappings":";;;AAOO,IAAM,aAAA,GAAN,MAAM,cAAA,CAAc;AAAA,EACjB,MAAA;AAAA,EACA,MAAA;AAAA,EAER,WAAA,CAAY,QAAuB,MAAA,EAAgB;AACjD,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAA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O,CAAC,GAAG,QAAA,EAAU,GAAG,YAAY,CAAA;AAAA,EACtC;AAEA,EAAA,OAAO,QAAA;AACT;AAEA,eAAsB,iBAAA,CACpB,QACA,OAAA,EAC8B;AAC9B,EAAA,OAAOA,cAAAA,CAAc,QAAQ,OAAO,CAAA;AACtC","file":"index.mjs","sourcesContent":["import type { ShopifyConfig } from '@anker-in/shopify-core'\nimport type { GraphQLResponse, GraphQLRequest, FetchOptions } from './types'\n\n/**\n * Shopify GraphQL Client\n * Handles all GraphQL communication with Shopify Storefront API\n */\nexport class ShopifyClient {\n private config: ShopifyConfig\n private locale: string\n\n constructor(config: ShopifyConfig, locale: string) {\n this.config = config\n this.locale = locale\n }\n\n /**\n * Execute a GraphQL request\n */\n async request<T = any>(\n request: GraphQLRequest,\n options: FetchOptions = {}\n ): Promise<GraphQLResponse<T>> {\n const { query, variables, operationName } = request\n const { tags = [], ...fetchOptions } = options\n\n const apiUrl = this.config.getApiUrl(this.locale)\n const token = this.config.getStorefrontToken(this.locale)\n\n const headers: HeadersInit = {\n 'Content-Type': 'application/json',\n 'X-Shopify-Storefront-Access-Token': token,\n ...(fetchOptions.headers || {}),\n }\n\n const body = JSON.stringify({\n query,\n variables,\n operationName,\n })\n\n try {\n const response = await fetch(apiUrl, {\n method: 'POST',\n headers,\n body,\n ...fetchOptions,\n ...(tags.length > 0 && { next: { tags } }),\n })\n\n if (!response.ok) {\n throw new Error(\n `HTTP ${response.status}: ${response.statusText}`\n )\n }\n\n const json: GraphQLResponse<T> = await response.json()\n\n if (json.errors && json.errors.length > 0) {\n console.error('GraphQL Errors:', json.errors)\n }\n\n return json\n } catch (error) {\n console.error('Shopify API Request Failed:', error)\n throw error\n }\n }\n\n /**\n * Convenience method for simple queries\n */\n async query<T = any>(\n query: string,\n variables?: Record<string, any>,\n options?: FetchOptions\n ): Promise<T | undefined> {\n const response = await this.request<T>(\n { query, variables },\n options\n )\n return response.data\n }\n\n /**\n * Get current locale\n */\n getLocale(): string {\n return this.locale\n }\n\n /**\n * Get config\n */\n getConfig(): ShopifyConfig {\n return this.config\n }\n\n /**\n * Get API URL\n */\n getApiUrl(): string {\n return this.config.getApiUrl(this.locale)\n }\n\n /**\n * Create a new client with different locale\n */\n withLocale(locale: string): ShopifyClient {\n return new ShopifyClient(this.config, locale)\n }\n}\n\n/**\n * Factory function to create a Shopify client\n */\nexport function createShopifyClient(\n config: ShopifyConfig,\n locale: string\n): ShopifyClient {\n return new ShopifyClient(config, locale)\n}\n","export const imageFragment = /* GraphQL */ `\n fragment image on Image {\n url\n altText\n width\n height\n }\n`\n","export const seoFragment = /* GraphQL */ `\n fragment seo on SEO {\n description\n title\n }\n`\n","export const metafieldFragment = /* GraphQL */ `\n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n`\n\nexport const metafieldFragmentStr = `\n value\n type\n description\n namespace\n key\n`\n","export const variantFragment = /* GraphQL */ `\n fragment variant on ProductVariant {\n id\n sku\n title\n requiresShipping\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n sellingPlanAllocations(first: 10) {\n edges {\n node {\n sellingPlan {\n id\n name\n options {\n name\n value\n }\n }\n priceAdjustments {\n compareAtPrice {\n amount\n currencyCode\n }\n perDeliveryPrice {\n amount\n currencyCode\n }\n price {\n amount\n currencyCode\n }\n }\n }\n }\n }\n }\n`\n","/**\n * Product GraphQL Fragment\n */\nexport const productFragment = /* GraphQL */ `\n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n`\n","import { imageFragment } from './image'\nimport { metafieldFragment } from './metafield'\nimport { productFragment } from './product'\nimport { seoFragment } from './seo'\n\nexport const cartFragment = /* GraphQL */ `\n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n ${productFragment}\n ${imageFragment}\n ${seoFragment}\n ${metafieldFragment}\n`\n","/**\n * Collection GraphQL Fragment\n */\n\nimport { imageFragment } from './image'\nimport { seoFragment } from './seo'\n\nexport const collectionFragment = /* GraphQL */ `\n fragment collection on Collection {\n id\n handle\n title\n description\n descriptionHtml\n image {\n ...image\n }\n seo {\n ...seo\n }\n updatedAt\n }\n`\n","export const pageInfoFragment = /* GraphQL */ `\n fragment pageInfo on PageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n`\n","/**\n * Blog GraphQL Fragments\n */\n\nimport { imageFragment } from './image'\nimport { seoFragment } from './seo'\nimport { metafieldFragment } from './metafield'\n\nexport const articleFragment = /* GraphQL */ `\n fragment article on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n image {\n ...image\n }\n seo {\n ...seo\n }\n tags\n author {\n name\n }\n }\n ${imageFragment}\n ${seoFragment}\n`\n\nexport const articleWithMetafieldsFragment = /* GraphQL */ `\n fragment articleWithMetafields on Article {\n id\n handle\n title\n content\n contentHtml\n excerpt\n excerptHtml\n publishedAt\n image {\n ...image\n }\n seo {\n ...seo\n }\n tags\n author {\n name\n }\n metafields(identifiers: $articleMetafieldIdentifiers) {\n ...metafield\n }\n }\n ${imageFragment}\n ${seoFragment}\n ${metafieldFragment}\n`\n\nexport const blogFragment = /* GraphQL */ `\n fragment blog on Blog {\n id\n handle\n title\n seo {\n ...seo\n }\n }\n ${seoFragment}\n`\n\nexport const blogWithMetafieldsFragment = /* GraphQL */ `\n fragment blogWithMetafields on Blog {\n id\n handle\n title\n seo {\n ...seo\n }\n metafields(identifiers: $blogMetafieldIdentifiers) {\n ...metafield\n }\n }\n ${seoFragment}\n ${metafieldFragment}\n`\n","import {\n metafieldFragment,\n productFragment,\n variantFragment,\n imageFragment,\n seoFragment,\n} from '../../fragments'\n\nexport const getProductQuery = /* GraphQL */ `\n query getProductByHandle(\n $handle: String!\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n product(handle: $handle) {\n ...product\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n variants(first: 250) {\n nodes {\n ...variant\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n }\n }\n }\n }\n ${productFragment}\n ${variantFragment}\n ${metafieldFragment}\n ${imageFragment}\n ${seoFragment}\n`\n","import {\n metafieldFragment,\n pageInfoFragment,\n productFragment,\n variantFragment,\n imageFragment,\n seoFragment,\n} from '../../fragments'\n\nexport const getProductsQuery = /* GraphQL */ `\n query getProducts(\n $first: Int = 10\n $after: String\n $query: String = \"\"\n $sortKey: ProductSortKeys = RELEVANCE\n $reverse: Boolean = false\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n products(first: $first, after: $after, sortKey: $sortKey, reverse: $reverse, query: $query) {\n pageInfo {\n ...pageInfo\n }\n nodes {\n ...product\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n variants(first: 250) {\n nodes {\n ...variant\n product {\n ...product\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n }\n }\n }\n }\n }\n ${productFragment}\n ${variantFragment}\n ${pageInfoFragment}\n ${metafieldFragment}\n ${imageFragment}\n ${seoFragment}\n`\n","import {\n metafieldFragment,\n productFragment,\n variantFragment,\n imageFragment,\n seoFragment,\n} from '../../fragments'\n\nexport const getProductsByHandlesQuery = (handles: string[]) => /* GraphQL */ `\nquery GetProductByHandles(\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n) {\n ${handles.map(\n (handle, index: number) => /* GraphQL */ `\n product${index}: product(handle: \"${handle}\") {\n ...product\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n variants(first: 250) {\n nodes {\n ...variant\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n }\n }\n }\n `\n )}\n}\n${productFragment}\n${variantFragment}\n${metafieldFragment}\n ${imageFragment}\n ${seoFragment}\n`\n","import { metafieldFragment } from '../../fragments'\n\nexport const getAllProductsPathsQuery = /* GraphQL */ `\n query getAllProductPaths(\n $first: Int = 250\n $cursor: String\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n products(first: $first, after: $cursor) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n }\n nodes {\n handle\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n }\n }\n }\n ${metafieldFragment}\n`\n","import { cartFragment } from '../../fragments'\n\nexport const getCartQuery = /* GraphQL */ `\n query getCart(\n $cartId: ID!\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!]!\n ) {\n cart(id: $cartId) {\n ...cart\n }\n }\n ${cartFragment}\n`\n","import { cartFragment } from '../../fragments'\n\nexport const createCartMutation = /* GraphQL */ `\n mutation createCart(\n $lines: [CartLineInput!]\n $discountCodes: [String!]\n $attributes: [AttributeInput!] = []\n $buyerIdentity: CartBuyerIdentityInput\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartCreate(\n input: {\n lines: $lines\n discountCodes: $discountCodes\n attributes: $attributes\n buyerIdentity: $buyerIdentity\n }\n ) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n ${cartFragment}\n`\n","import { cartFragment } from '../../fragments'\n\nexport const addCartItemsMutation = /* GraphQL */ `\n mutation addToCart(\n $cartId: ID!\n $lines: [CartLineInput!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n ${cartFragment}\n`\n","import { cartFragment } from '../../fragments'\n\nexport const updateCartItemsMutation = /* GraphQL */ `\n mutation editCartItems(\n $cartId: ID!\n $lines: [CartLineUpdateInput!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n ${cartFragment}\n`\n","import { cartFragment } from '../../fragments'\n\nexport const removeCartItemsMutation = /* GraphQL */ `\n mutation removeFromCart(\n $cartId: ID!\n $lineIds: [ID!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n ${cartFragment}\n`\n","import { cartFragment } from '../../fragments'\n\nexport const updateCartDiscountCodeMutation = /* GraphQL */ `\n mutation cartDiscountCodesUpdate(\n $cartId: ID!\n $discountCodes: [String!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n ${cartFragment}\n`\n","import { cartFragment } from '../../fragments'\n\nexport const updateCartAttributesMutation = /* GraphQL */ `\n mutation cartAttributesUpdate(\n $attributes: [AttributeInput!]!\n $cartId: ID!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n ${cartFragment}\n`\n","import { HasMetafieldsIdentifier, Maybe, Metafield } from './shopify-types'\n\nexport type PartialRecord<K extends string | number | symbol, T> = Partial<Record<K, T>>\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type Replace<T, K extends keyof T, V> = Omit<T, K> & { [P in K]: V }\n\nexport enum HasMetafieldQueryRoot {\n Product = 'product',\n Variant = 'variant',\n Page = 'page',\n Article = 'article',\n Blog = 'blog',\n Collection = 'collection',\n Shop = 'shop',\n Cart = 'cart',\n Customer = 'customer',\n Location = 'location',\n Market = 'market',\n Order = 'order',\n}\n\n/**\n * 生成 metafieldIdentifiers 查询参数\n */\nexport function constructMetafieldIdentifiersQueryParams<T extends HasMetafieldQueryRoot>(\n metafieldIdentifiers: PartialRecord<T, HasMetafieldsIdentifier[]> = {},\n metafieldNamespacePrefix: string\n): PartialRecord<`${T}MetafieldIdentifiers`, HasMetafieldsIdentifier[]> {\n const identifiers = Object.entries(metafieldIdentifiers).reduce(\n (queryInput, [key, value]) => {\n const metafieldIdentifiers = value as HasMetafieldsIdentifier[]\n queryInput[`${key}MetafieldIdentifiers` as `${T}MetafieldIdentifiers`] =\n metafieldIdentifiers.map((item) => ({\n namespace: `${metafieldNamespacePrefix}combo`,\n key: item.namespace,\n })) as HasMetafieldsIdentifier[]\n return queryInput\n },\n {} as PartialRecord<`${T}MetafieldIdentifiers`, HasMetafieldsIdentifier[]>\n )\n return identifiers\n}\n\nexport const parseMetafield = (item: Metafield, previewData?: any, resource_type?: string) => {\n const type = item?.type && item?.type.toLowerCase()\n if (\n item &&\n previewData &&\n previewData?.__preview_type === resource_type &&\n previewData[`${item?.namespace}${item?.key}`] !== undefined &&\n previewData[`${item?.namespace}${item?.key}`] !== null\n ) {\n return previewData[`${item.namespace}${item.key}`]\n }\n switch (type) {\n case 'json':\n case 'json_string':\n case 'rating':\n case 'volume':\n case 'weight':\n case 'dimension':\n return JSON.parse(item.value)\n default:\n return item?.value || item\n }\n}\n\nexport const normalizeMetafields = (metafields: Array<Maybe<Metafield>>): Record<string, any> => {\n return metafields?.reduce(\n (prev, cur) => {\n if (cur) {\n const namespace = cur.key\n prev[namespace] = prev[namespace] || {}\n const parsedMetafields: {\n [key: string]: Metafield\n } = parseMetafield(cur)\n if (parsedMetafields) {\n Object.entries(parsedMetafields).forEach(([key, innerMetafields]) => {\n prev[namespace][key] =\n prev[namespace][key] ?? (innerMetafields ? parseMetafield(innerMetafields) : null)\n })\n }\n }\n return prev\n },\n {} as Record<string, any>\n )\n}\n","/**\n * Product Normalization Functions\n *\n * Normalizes Shopify API product responses to a consistent format\n */\n\nimport { normalizeMetafields } from '../../utils'\nimport type {\n NormalizedProduct,\n NormalizedProductVariant,\n NormalizedSellingPlanGroup,\n} from './types'\nimport {\n Image,\n Media,\n MoneyV2,\n Product,\n SellingPlanAllocationConnection,\n SellingPlanConnection,\n SellingPlanGroupConnection,\n} from '../../shopify-types'\n\nconst normalizeSellingPlan = ({ edges }: SellingPlanConnection) => {\n return edges?.map(({ node }) => node)\n}\n\nconst normalizeSellingPlanGroups = ({\n edges,\n}: SellingPlanGroupConnection): NormalizedSellingPlanGroup[] => {\n return edges?.map(({ node }) => {\n const { sellingPlans, ...rest } = node\n return {\n ...rest,\n sellingPlans: normalizeSellingPlan(sellingPlans),\n }\n })\n}\n\nconst normalizeSellingPlanAllocation = (sellingPlanAllocations: SellingPlanAllocationConnection) =>\n sellingPlanAllocations?.edges?.map(({ node }) => ({ ...node })) || []\n\n/**\n * Normalize product variant\n */\nfunction normalizeVariant(variant: any): NormalizedProductVariant {\n const price: MoneyV2 = {\n amount: variant.price?.amount || variant.priceV2?.amount || '0',\n currencyCode: variant.price?.currencyCode || variant.priceV2?.currencyCode || 'USD',\n }\n\n const compareAtPrice: MoneyV2 | undefined = variant.compareAtPrice?.amount\n ? {\n amount: variant.compareAtPrice.amount,\n currencyCode: variant.compareAtPrice.currencyCode,\n }\n : variant.compareAtPriceV2?.amount\n ? {\n amount: variant.compareAtPriceV2.amount,\n currencyCode: variant.compareAtPriceV2.currencyCode,\n }\n : undefined\n\n // Normalize metafields\n const metafields = normalizeMetafields(variant.metafields || [])\n return {\n id: variant.id,\n title: variant.title,\n sku: variant.sku || '',\n availableForSale: variant.availableForSale || false,\n quantityAvailable: variant.quantityAvailable,\n selectedOptions: variant.selectedOptions || [],\n price,\n compareAtPrice,\n image: variant.image ? variant.image : undefined,\n weight: variant.weight,\n weightUnit: variant.weightUnit,\n metafields,\n sellingPlanAllocations: normalizeSellingPlanAllocation(variant.sellingPlanAllocations),\n }\n}\n\n/**\n * Normalize a Shopify Product to NormalizedProduct\n */\nexport function normalizeProduct(product: Product): NormalizedProduct {\n // Extract images\n const images: Image[] = product.images?.edges?.map((edge) => edge.node) || []\n\n // Extract media\n const media: Media[] = product.media?.edges?.map((edge) => edge.node) || []\n\n // Extract variants\n const variants: NormalizedProductVariant[] =\n product.variants?.edges?.map((edge) => normalizeVariant(edge.node)) || []\n\n // Extract price from priceRange\n const price: MoneyV2 = {\n amount: product.priceRange?.minVariantPrice?.amount || '0',\n currencyCode: (product.priceRange?.minVariantPrice?.currencyCode as any) || 'USD',\n }\n\n const compareAtPrice: MoneyV2 | undefined = product.compareAtPriceRange?.minVariantPrice?.amount\n ? {\n amount: product.compareAtPriceRange.minVariantPrice.amount,\n currencyCode: product.compareAtPriceRange.minVariantPrice.currencyCode as any,\n }\n : undefined\n\n // Normalize metafields\n const metafields = normalizeMetafields(product.metafields || [])\n return {\n id: product.id,\n handle: product.handle,\n title: product.title,\n description: product.description,\n descriptionHtml: product.descriptionHtml,\n availableForSale: product.availableForSale,\n tags: product.tags,\n productType: product.productType,\n vendor: product.vendor,\n price,\n compareAtPrice,\n images,\n media,\n featuredImage: product.featuredImage ? product.featuredImage : undefined,\n variants,\n options: product.options,\n seo: product.seo,\n createdAt: product.createdAt,\n updatedAt: product.updatedAt,\n publishedAt: product.publishedAt,\n metafields,\n sellingPlanGroups: product.sellingPlanGroups\n ? normalizeSellingPlanGroups(product.sellingPlanGroups)\n : [],\n }\n}\n","/**\n * Get Product API\n *\n * Fetches a single product by handle\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { productFragment } from '../../fragments/product'\nimport { variantFragment } from '../../fragments/variant'\nimport { metafieldFragment } from '../../fragments/metafield'\nimport { seoFragment } from '../../fragments/seo'\nimport { imageFragment } from '../../fragments/image'\nimport { normalizeProduct } from './normalize'\nimport type { GetProductOptions, NormalizedProduct } from './types'\n\nconst getProductQuery = /* GraphQL */ `\n query getProductByHandle(\n $handle: String!\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n product(handle: $handle) {\n ...product\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n variants(first: 250) {\n edges {\n node {\n ...variant\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n }\n }\n }\n }\n }\n ${productFragment}\n ${variantFragment}\n ${metafieldFragment}\n ${seoFragment}\n ${imageFragment}\n`\n\n/**\n * Get a single product by handle\n *\n * @param client - Shopify GraphQL client\n * @param options - Get product options\n * @returns Normalized product or undefined if not found\n *\n * @example\n * ```typescript\n * const product = await getProduct(client, {\n * handle: 'my-product',\n * locale: 'us'\n * })\n * ```\n */\nexport async function getProduct(\n client: ShopifyClient,\n options: GetProductOptions\n): Promise<NormalizedProduct | undefined> {\n const { handle, metafieldIdentifiers } = options\n\n // Build metafield identifiers if provided\n const variables: any = { handle }\n\n if (metafieldIdentifiers) {\n variables.productMetafieldIdentifiers = metafieldIdentifiers\n variables.variantMetafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ product: any }>(getProductQuery, variables)\n\n if (!data?.product) {\n return undefined\n }\n\n return normalizeProduct(data.product)\n}\n","/**\n * Get All Products API\n *\n * Fetches all products with pagination support\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { productFragment } from '../../fragments/product'\nimport { variantFragment } from '../../fragments/variant'\nimport { metafieldFragment } from '../../fragments/metafield'\nimport { seoFragment } from '../../fragments/seo'\nimport { imageFragment } from '../../fragments/image'\nimport { normalizeProduct } from './normalize'\nimport type {\n GetAllProductsOptions,\n NormalizedProduct,\n NormalizedProductsConnection,\n} from './types'\n\nconst getAllProductsQuery = /* GraphQL */ `\n query getAllProducts(\n $first: Int = 250\n $after: String\n $query: String\n $sortKey: ProductSortKeys\n $reverse: Boolean\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n products(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n node {\n ...product\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n variants(first: 250) {\n edges {\n node {\n ...variant\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n }\n }\n }\n }\n }\n }\n }\n ${productFragment}\n ${variantFragment}\n ${metafieldFragment}\n ${seoFragment}\n ${imageFragment}\n`\n\n/**\n * Recursive helper to fetch all pages of products\n */\nasync function fetchAllPages(\n client: ShopifyClient,\n options: GetAllProductsOptions,\n afterCursor?: string\n): Promise<NormalizedProduct[]> {\n const { first = 250, query, sortKey, reverse, metafieldIdentifiers } = options\n\n const variables: any = {\n first,\n after: afterCursor,\n query,\n sortKey,\n reverse,\n }\n\n if (metafieldIdentifiers) {\n variables.productMetafieldIdentifiers = metafieldIdentifiers\n variables.variantMetafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ products: any }>(getAllProductsQuery, variables)\n\n if (!data || !data.products) {\n return []\n }\n\n const products = data.products.edges.map((edge: any) => normalizeProduct(edge.node))\n\n // If there are more pages, recursively fetch them\n if (data.products.pageInfo.hasNextPage) {\n const nextProducts = await fetchAllPages(client, options, data.products.pageInfo.endCursor)\n return [...products, ...nextProducts]\n }\n\n return products\n}\n\n/**\n * Get all products\n *\n * This function automatically handles pagination and fetches all products\n *\n * @param client - Shopify GraphQL client\n * @param options - Get all products options\n * @returns Array of normalized products\n *\n * @example\n * ```typescript\n * const products = await getAllProducts(client, {\n * locale: 'us',\n * sortKey: 'TITLE',\n * reverse: false\n * })\n * ```\n */\nexport async function getAllProducts(\n client: ShopifyClient,\n options: GetAllProductsOptions\n): Promise<NormalizedProduct[]> {\n return fetchAllPages(client, options)\n}\n\n/**\n * Get products with pagination info (for manual pagination)\n *\n * This function returns a single page of products with pagination metadata\n *\n * @param client - Shopify GraphQL client\n * @param options - Get all products options\n * @returns Products connection with pagination info\n *\n * @example\n * ```typescript\n * const result = await getProducts(client, {\n * locale: 'us',\n * first: 20\n * })\n *\n * console.log(result.products) // First 20 products\n * console.log(result.pageInfo.hasNextPage) // true if more pages exist\n *\n * // Fetch next page\n * const nextPage = await getProducts(client, {\n * locale: 'us',\n * first: 20,\n * after: result.pageInfo.endCursor\n * })\n * ```\n */\nexport async function getProducts(\n client: ShopifyClient,\n options: GetAllProductsOptions\n): Promise<NormalizedProductsConnection> {\n const { first = 250, after, query, sortKey, reverse, metafieldIdentifiers } = options\n\n const variables: any = {\n first,\n after,\n query,\n sortKey,\n reverse,\n }\n\n if (metafieldIdentifiers) {\n variables.productMetafieldIdentifiers = metafieldIdentifiers\n variables.variantMetafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ products: any }>(getAllProductsQuery, variables)\n\n if (!data || !data.products) {\n return {\n products: [],\n pageInfo: {\n hasNextPage: false,\n hasPreviousPage: false,\n },\n }\n }\n\n const products = data.products.edges.map((edge: any) => normalizeProduct(edge.node))\n\n return {\n products,\n pageInfo: data.products.pageInfo,\n }\n}\n","/**\n * Get Products By Handles API\n *\n * Fetches multiple products by their handles\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { productFragment } from '../../fragments/product'\nimport { variantFragment } from '../../fragments/variant'\nimport { metafieldFragment } from '../../fragments/metafield'\nimport { seoFragment } from '../../fragments/seo'\nimport { imageFragment } from '../../fragments/image'\nimport { normalizeProduct } from './normalize'\nimport type { GetProductsByHandlesOptions, NormalizedProduct } from './types'\nimport { constructMetafieldIdentifiersQueryParams } from '../../utils'\n\n/**\n * Build a GraphQL query for multiple products by handles\n * Uses GraphQL aliases to fetch multiple products in a single request\n */\nfunction buildProductsByHandlesQuery(handles: string[]): string {\n return /* GraphQL */ `\n query GetProductByHandles($productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = [], $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []) {\n ${handles.map(\n (handle, index) => /* GraphQL */ `\n product_${index}: product(handle: \"${handle}\") {\n ...product\n variants(first: 250) {\n edges {\n node {\n ...variant\n }\n }\n }\n }\n `\n )}\n }\n ${productFragment}\n ${variantFragment}\n ${metafieldFragment}\n ${seoFragment}\n ${imageFragment}\n`\n}\n\n/**\n * Get multiple products by their handles\n *\n * @param client - Shopify GraphQL client\n * @param options - Get products by handles options\n * @returns Array of normalized products (in same order as handles)\n *\n * @example\n * ```typescript\n * const products = await getProductsByHandles(client, {\n * handles: ['product-1', 'product-2', 'product-3'],\n * locale: 'us'\n * })\n * ```\n */\nexport async function getProductsByHandles(\n client: ShopifyClient,\n options: GetProductsByHandlesOptions\n): Promise<NormalizedProduct[]> {\n const { handles, metafieldIdentifiers } = options\n\n if (!handles || handles.length === 0) {\n return []\n }\n\n // Build query with aliases\n const query = buildProductsByHandlesQuery(handles)\n\n const data = await client.query<Record<string, any>>(query, {\n handles, // 请勿删除,这个参数虽然没有在 query 中使用,但方便在 chrome dev tools 中查看请求参数\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n if (!data) {\n return []\n }\n\n return Object.keys(data).map((key) => normalizeProduct(data[key]))\n}\n","/**\n * Cart normalization utilities\n * Transforms Shopify Cart API responses into a consistent format\n */\n\nimport type { CartFragment } from '../../shopify-types'\nimport { normalizeMetafields } from '../../utils'\nimport { normalizeProduct } from '../product'\nimport { NormalizedCart, NormalizedLineItem } from './types'\n\n/**\n * Check if variant is available for purchase\n */\nfunction isVariantAvailable(variant: any): boolean {\n // Not available for sale\n if (!variant.availableForSale) return false\n\n // No stock and can't oversell\n if (!variant.quantityAvailable && !variant.currentlyNotInStock) return false\n\n // Price too high (likely hidden/unavailable)\n if (variant.price?.amount >= 9999999.99) return false\n\n return true\n}\n\n/**\n * Normalize a single cart line item\n */\nexport function normalizeLineItem(line: any): NormalizedLineItem {\n const { id, merchandise: variant, quantity, discountAllocations, attributes, cost } = line\n\n const price = variant?.price?.amount || 0\n const name = variant?.product?.title || ''\n\n return {\n id,\n name,\n quantity,\n variantId: String(variant?.id || ''),\n productId: String(variant?.product?.id || ''),\n totalAmount: cost?.totalAmount?.amount || 0,\n subtotalAmount: cost?.subtotalAmount?.amount || 0,\n discountAllocations:\n discountAllocations?.map((item: any) => ({\n code: item?.code || item?.title || '',\n amount: item?.discountedAmount?.amount || 0,\n })) || [],\n customAttributes: attributes,\n variant: {\n id: String(variant?.id || ''),\n price,\n listPrice: variant?.compareAtPrice?.amount || 0,\n sku: variant?.sku ?? '',\n name: variant?.title || '',\n image: variant?.image\n ? {\n url: variant.image.url,\n altText: variant.image.altText,\n }\n : undefined,\n requiresShipping: variant?.requiresShipping ?? false,\n availableForSale: isVariantAvailable(variant as any),\n quantityAvailable: variant?.quantityAvailable || 0,\n currentlyNotInStock: variant?.currentlyNotInStock || false,\n weight: variant?.weight || 0,\n metafields: normalizeMetafields(variant?.metafields),\n },\n product: normalizeProduct(variant?.product),\n path: `/${variant?.product?.handle || ''}`,\n discounts: [],\n options: variant?.title === 'Default Title' ? [] : variant?.selectedOptions || [],\n }\n}\n\n/**\n * Normalize Shopify Cart to a consistent format\n */\nexport function normalizeCart(cart: CartFragment): NormalizedCart {\n // CartFragment always has edges format\n const linesArray = cart.lines.edges.map((edge) => edge.node)\n const lineItems = linesArray.map(normalizeLineItem)\n\n const orderDiscounts =\n cart?.discountAllocations?.reduce((total: number, discount) => {\n return Number(discount?.discountedAmount?.amount || 0) + total\n }, 0) || 0\n\n const [totallineItemsDiscount, lineItemsSubtotalPrice] = lineItems.reduce(\n ([discountTotal, subtotal]: [number, number], item) => {\n const itemDiscount =\n item.discountAllocations?.reduce(\n (sum: number, allocation) => Number(allocation.amount) + sum,\n 0\n ) || 0\n return [itemDiscount + discountTotal, Number(item.subtotalAmount) + subtotal]\n },\n [0, 0] as [number, number]\n )\n\n return {\n id: cart.id,\n url: cart.checkoutUrl,\n ready: true,\n customerId: cart?.buyerIdentity?.customer?.id || '',\n email: cart?.buyerIdentity?.email || '',\n createdAt: cart.createdAt,\n currency: {\n code: cart.cost?.subtotalAmount?.currencyCode || 'USD',\n },\n customAttributes: cart.attributes || [],\n taxesIncluded: false, // This field is not available in Cart API\n lineItems,\n subtotalPrice: Number(cart.cost?.subtotalAmount?.amount || 0),\n // 有时候totalPrice包含了totalTaxAmount,这里先减去totalTaxAmount\n totalPrice:\n Number(cart?.cost?.totalAmount?.amount || 0) -\n Number(cart?.cost?.totalTaxAmount?.amount || 0),\n totalTaxAmount: 0, // Tax estimation logic to be clarified\n lineItemsSubtotalPrice,\n totallineItemsDiscount: orderDiscounts + totallineItemsDiscount,\n orderDiscounts,\n discountCodes: cart.discountCodes || [],\n discountAllocations:\n cart?.discountAllocations?.map((item: any) => ({\n code: item?.code || item?.title || '',\n amount: Number(item?.discountedAmount?.amount || 0),\n })) || [],\n }\n}\n","/**\n * Get Cart API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { getCartQuery } from '../../queries/cart/get-cart'\nimport type { HasMetafieldsIdentifier } from '../../shopify-types'\nimport type { CartFragment } from '../../shopify-types'\nimport { normalizeCart } from './normalize'\nimport type { CartCookieAdapter, NormalizedCart } from './types'\nimport { constructMetafieldIdentifiersQueryParams } from '../../utils'\n\nexport interface GetCartOptions {\n /** Explicit cart ID (optional, will use cookie if not provided) */\n id?: string\n /** Cookie adapter for retrieving cart ID from cookies */\n cookieAdapter?: CartCookieAdapter\n /** Metafield identifiers */\n metafieldIdentifiers?: {\n product: HasMetafieldsIdentifier[]\n variant: HasMetafieldsIdentifier[]\n }\n}\n\n/**\n * Get cart by ID\n *\n * @param client - Shopify GraphQL client\n * @param options - Get cart options\n * @returns Normalized cart or undefined if not found\n *\n * @example\n * ```ts\n * const cart = await getCart(client, {\n * locale: 'us',\n * cookieAdapter: myCookieAdapter,\n * metafieldIdentifiers: {\n * product: [{ namespace: 'product', key: 'img' }],\n * variant: [{ namespace: 'variant', key: 'img' }]\n * }\n * })\n * ```\n */\nexport async function getCart(\n client: ShopifyClient,\n options: GetCartOptions\n): Promise<NormalizedCart | undefined> {\n const { id, cookieAdapter, metafieldIdentifiers } = options\n\n const locale = client.getLocale()\n\n // Get cart ID from explicit option or cookie\n const cartId = id || cookieAdapter?.getCartId(locale)\n\n console.log('cartId', cartId)\n\n if (!cartId) {\n return undefined\n }\n\n console.log(\n 'metafieldIdentifiers',\n constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n )\n )\n\n try {\n const data = await client.query<{ cart: CartFragment }>(getCartQuery, {\n cartId,\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n if (!data?.cart) {\n // Cart not found, clear invalid cookie\n if (cookieAdapter && !id) {\n cookieAdapter.removeCartId(locale)\n }\n return undefined\n }\n\n const normalizedCart = normalizeCart(data.cart)\n\n // Update cookie with cart ID (in case it was provided explicitly)\n if (cookieAdapter && normalizedCart.id) {\n cookieAdapter.setCartId(locale, normalizedCart.id)\n }\n\n return normalizedCart\n } catch (error) {\n console.error('[getCart] Error fetching cart:', error)\n // Clear invalid cart ID from cookie\n if (cookieAdapter && !id) {\n cookieAdapter.removeCartId(locale)\n }\n return undefined\n }\n}\n","/**\n * Create Cart API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { createCartMutation } from '../../mutations/cart/create-cart'\nimport type { CartFragment, CartLineInput, HasMetafieldsIdentifier } from '../../shopify-types'\nimport { normalizeCart } from './normalize'\nimport type { CartCookieAdapter, NormalizedCart } from './types'\nimport { constructMetafieldIdentifiersQueryParams } from '../../utils'\n\nexport interface CreateCartOptions {\n /** Lines to add to the cart */\n lines?: CartLineInput[]\n /** Cookie adapter for managing cart ID */\n cookieAdapter?: CartCookieAdapter\n /** Buyer identity for cart creation */\n buyerIdentity?: {\n email?: string\n countryCode?: string\n }\n /** Discount codes */\n discountCodes?: string[]\n /** Custom attributes */\n customAttributes?: Array<{ key: string; value: string }>\n /** Metafield identifiers */\n metafieldIdentifiers?: {\n variant: HasMetafieldsIdentifier[]\n product: HasMetafieldsIdentifier[]\n }\n}\n\n/**\n * Create a new cart\n *\n * @param client - Shopify GraphQL client\n * @param options - Create cart options\n * @returns Normalized cart or undefined if operation failed\n *\n * @example\n * ```ts\n * // Create empty cart\n * const cart = await createCart(client, {\n * cookieAdapter: myCookieAdapter\n * })\n *\n * // Create cart with items\n * const cart = await createCart(client, {\n * lines: [{\n * merchandiseId: 'gid://shopify/ProductVariant/123',\n * quantity: 1\n * }],\n * buyerIdentity: {\n * email: 'customer@example.com',\n * countryCode: 'US'\n * },\n * discountCodes: ['SUMMER2024'],\n * cookieAdapter: myCookieAdapter\n * })\n * ```\n */\nexport async function createCart(\n client: ShopifyClient,\n options: CreateCartOptions = {}\n): Promise<NormalizedCart | undefined> {\n const {\n lines,\n cookieAdapter,\n buyerIdentity,\n discountCodes,\n customAttributes,\n metafieldIdentifiers,\n } = options\n\n const locale = client.getLocale()\n\n try {\n // Create new cart\n const data = await client.query<{\n cartCreate: {\n cart: CartFragment\n userErrors?: Array<{ field?: string[]; message: string }>\n }\n }>(createCartMutation, {\n lines,\n buyerIdentity,\n discountCodes,\n attributes: customAttributes,\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n if (data?.cartCreate?.userErrors?.length) {\n console.error('[createCart] User errors:', data.cartCreate.userErrors)\n }\n\n const cart = data?.cartCreate?.cart\n\n if (!cart) {\n return undefined\n }\n\n // normalizeCart handles the GraphQL response format transformation\n const normalizedCart = normalizeCart(cart)\n\n // Update cookie with cart ID\n if (cookieAdapter && normalizedCart.id) {\n cookieAdapter.setCartId(locale, normalizedCart.id)\n }\n\n return normalizedCart\n } catch (error) {\n console.error('[createCart] Error:', error)\n return undefined\n }\n}\n","/**\n * Add Cart Lines API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { addCartItemsMutation } from '../../mutations/cart/add-cart-items'\nimport { createCartMutation } from '../../mutations/cart/create-cart'\nimport type { CartFragment, CartLineInput, HasMetafieldsIdentifier } from '../../shopify-types'\nimport { normalizeCart } from './normalize'\nimport type { CartCookieAdapter, NormalizedCart } from './types'\nimport { constructMetafieldIdentifiersQueryParams } from '../../utils'\n\nexport interface AddCartLinesOptions {\n /** Cart ID (optional, will create new cart if not provided) */\n cartId?: string\n /** Lines to add */\n lines: CartLineInput[]\n /** Cookie adapter for managing cart ID */\n cookieAdapter?: CartCookieAdapter\n /** Current locale */\n /** Buyer identity for cart creation */\n buyerIdentity?: {\n email?: string\n countryCode?: string\n }\n /** Discount codes (only used when creating new cart) */\n discountCodes?: string[]\n /** Custom attributes (only used when creating new cart) */\n customAttributes?: Array<{ key: string; value: string }>\n /** Metafield identifiers */\n metafieldIdentifiers?: {\n variant: HasMetafieldsIdentifier[]\n product: HasMetafieldsIdentifier[]\n }\n}\n\n/**\n * Add lines to cart (creates new cart if needed)\n *\n * @param client - Shopify GraphQL client\n * @param options - Add cart lines options\n * @returns Normalized cart or undefined if operation failed\n *\n * @example\n * ```ts\n * const cart = await addCartLines(client, {\n * locale: 'us',\n * lines: [{\n * merchandiseId: 'gid://shopify/ProductVariant/123',\n * quantity: 1\n * }],\n * cookieAdapter: myCookieAdapter\n * })\n * ```\n */\nexport async function addCartLines(\n client: ShopifyClient,\n options: AddCartLinesOptions\n): Promise<NormalizedCart | undefined> {\n const {\n cartId: providedCartId,\n lines,\n cookieAdapter,\n buyerIdentity,\n discountCodes,\n customAttributes,\n metafieldIdentifiers,\n } = options\n\n const locale = client.getLocale()\n\n console.log(\n 'metafieldIdentifiers',\n client.getConfig().getMetafieldNamespacePrefix(),\n constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n )\n )\n\n // Get cart ID from options or cookie\n const cartId = providedCartId || cookieAdapter?.getCartId(locale)\n\n try {\n let cart: CartFragment | undefined\n\n if (cartId) {\n // Add to existing cart\n const data = await client.query<{\n cartLinesAdd: {\n cart: CartFragment\n userErrors?: Array<{ field?: string[]; message: string }>\n }\n }>(addCartItemsMutation, {\n cartId,\n lines,\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n if (data?.cartLinesAdd?.userErrors?.length) {\n console.error('[addCartLines] User errors:', data.cartLinesAdd.userErrors)\n }\n\n cart = data?.cartLinesAdd?.cart\n } else {\n // Create new cart with lines\n const data = await client.query<{\n cartCreate: {\n cart: CartFragment\n userErrors?: Array<{ field?: string[]; message: string }>\n }\n }>(createCartMutation, {\n lines,\n buyerIdentity,\n discountCodes,\n attributes: customAttributes,\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n if (data?.cartCreate?.userErrors?.length) {\n console.error('[addCartLines] User errors:', data.cartCreate.userErrors)\n }\n\n cart = data?.cartCreate?.cart\n }\n\n if (!cart) {\n return undefined\n }\n\n // normalizeCart handles the GraphQL response format transformation\n const normalizedCart = normalizeCart(cart)\n\n // Update cookie with cart ID\n if (cookieAdapter && normalizedCart.id) {\n cookieAdapter.setCartId(locale, normalizedCart.id)\n }\n\n return normalizedCart\n } catch (error) {\n console.error('[addCartLines] Error:', error)\n return undefined\n }\n}\n","/**\n * Update Cart Lines API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { updateCartItemsMutation } from '../../mutations/cart/update-cart-items'\nimport type { CartLineUpdateInput, HasMetafieldsIdentifier } from '../../shopify-types'\nimport type { CartFragment } from '../../shopify-types'\nimport { normalizeCart } from './normalize'\nimport type { CartCookieAdapter, NormalizedCart } from './types'\nimport { constructMetafieldIdentifiersQueryParams } from '../../utils'\n\nexport interface UpdateCartLinesOptions {\n /** Cart ID (optional, will use cookie if not provided) */\n cartId?: string\n /** Lines to update */\n lines: CartLineUpdateInput[]\n /** Cookie adapter for managing cart ID */\n cookieAdapter?: CartCookieAdapter\n /** Current locale */\n metafieldIdentifiers?: {\n variant: HasMetafieldsIdentifier[]\n product: HasMetafieldsIdentifier[]\n }\n}\n\n/**\n * Update cart line items\n *\n * @param client - Shopify GraphQL client\n * @param options - Update cart lines options\n * @returns Normalized cart with maxNum if quantity error occurred\n *\n * @example\n * ```ts\n * const cart = await updateCartLines(client, {\n * locale: 'us',\n * lines: [{\n * id: 'gid://shopify/CartLine/123',\n * quantity: 2\n * }],\n * cookieAdapter: myCookieAdapter\n * })\n * ```\n */\nexport async function updateCartLines(\n client: ShopifyClient,\n options: UpdateCartLinesOptions\n): Promise<NormalizedCart | undefined> {\n const { cartId: providedCartId, lines, cookieAdapter, metafieldIdentifiers } = options\n\n const locale = client.getLocale()\n\n const cartId = providedCartId || cookieAdapter?.getCartId(locale)\n\n if (!cartId) {\n throw new Error('Invalid input used for this operation: Miss cartId')\n }\n\n try {\n const data = await client.query<{\n cartLinesUpdate: {\n cart: CartFragment\n userErrors?: Array<{ field?: string[]; message: string }>\n }\n }>(updateCartItemsMutation, {\n cartId,\n lines,\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n // Handle quantity errors\n let maxNum: number | undefined\n if (data?.cartLinesUpdate?.userErrors?.length) {\n const errors = data.cartLinesUpdate.userErrors\n const quantityError = errors.find((error) => error.field?.includes('quantity'))\n\n if (quantityError && quantityError.field && quantityError.field[1] !== undefined) {\n const lineIndex = Number(quantityError.field[1])\n const cart = data.cartLinesUpdate.cart\n maxNum = cart?.lines?.edges?.[lineIndex]?.node?.quantity\n }\n }\n\n if (!data?.cartLinesUpdate?.cart) {\n return undefined\n }\n\n const normalizedCart = normalizeCart(data.cartLinesUpdate.cart)\n\n // Add maxNum if quantity error occurred\n if (maxNum !== undefined) {\n normalizedCart.maxNum = maxNum\n }\n\n // Update cookie\n if (cookieAdapter && normalizedCart.id) {\n cookieAdapter.setCartId(locale, normalizedCart.id)\n }\n\n return normalizedCart\n } catch (error) {\n console.error('[updateCartLines] Error:', error)\n throw error\n }\n}\n","/**\n * Remove Cart Lines API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { removeCartItemsMutation } from '../../mutations/cart/remove-cart-items'\nimport type { HasMetafieldsIdentifier } from '../../shopify-types'\nimport type { CartFragment } from '../../shopify-types'\nimport { normalizeCart } from './normalize'\nimport type { CartCookieAdapter, NormalizedCart } from './types'\nimport { constructMetafieldIdentifiersQueryParams } from '../../utils'\n\nexport interface RemoveCartLinesOptions {\n /** Cart ID (optional, will use cookie if not provided) */\n cartId?: string\n /** Line IDs to remove */\n lineIds: string[]\n /** Cookie adapter for managing cart ID */\n cookieAdapter?: CartCookieAdapter\n /** Current locale */\n metafieldIdentifiers?: {\n variant: HasMetafieldsIdentifier[]\n product: HasMetafieldsIdentifier[]\n }\n}\n\n/**\n * Remove lines from cart\n *\n * @param client - Shopify GraphQL client\n * @param options - Remove cart lines options\n * @returns Normalized cart or undefined if operation failed\n *\n * @example\n * ```ts\n * const cart = await removeCartLines(client, {\n * locale: 'us',\n * lineIds: ['gid://shopify/CartLine/123'],\n * cookieAdapter: myCookieAdapter\n * })\n * ```\n */\nexport async function removeCartLines(\n client: ShopifyClient,\n options: RemoveCartLinesOptions\n): Promise<NormalizedCart | undefined> {\n const { cartId: providedCartId, lineIds, cookieAdapter, metafieldIdentifiers } = options\n\n const locale = client.getLocale()\n\n const cartId = providedCartId || cookieAdapter?.getCartId(locale)\n\n if (!cartId) {\n throw new Error('Invalid input used for this operation: Miss cartId')\n }\n\n try {\n const data = await client.query<{\n cartLinesRemove: {\n cart: CartFragment\n userErrors?: Array<{ field?: string[]; message: string }>\n }\n }>(removeCartItemsMutation, {\n cartId,\n lineIds,\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n if (data?.cartLinesRemove?.userErrors?.length) {\n console.error('[removeCartLines] User errors:', data.cartLinesRemove.userErrors)\n }\n\n if (!data?.cartLinesRemove?.cart) {\n return undefined\n }\n\n const normalizedCart = normalizeCart(data.cartLinesRemove.cart)\n\n // Update cookie\n if (cookieAdapter && normalizedCart.id) {\n cookieAdapter.setCartId(locale, normalizedCart.id)\n }\n\n return normalizedCart\n } catch (error) {\n console.error('[removeCartLines] Error:', error)\n throw error\n }\n}\n","/**\n * Update Cart Discount Codes API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { updateCartDiscountCodeMutation } from '../../mutations/cart/update-cart-discount-code'\nimport type { HasMetafieldsIdentifier } from '../../shopify-types'\nimport type { CartFragment } from '../../shopify-types'\nimport { normalizeCart } from './normalize'\nimport type { CartCookieAdapter, NormalizedCart } from './types'\nimport { constructMetafieldIdentifiersQueryParams } from '../../utils'\n\nexport interface UpdateCartCodesOptions {\n /** Cart ID (optional, will use cookie if not provided) */\n cartId?: string\n /** Discount codes to apply (replaces existing codes) */\n discountCodes: string[]\n /** Cookie adapter for managing cart ID */\n cookieAdapter?: CartCookieAdapter\n /** Current locale */\n metafieldIdentifiers?: {\n variant: HasMetafieldsIdentifier[]\n product: HasMetafieldsIdentifier[]\n }\n}\n\n/**\n * Update cart discount codes (replaces all existing codes)\n *\n * @param client - Shopify GraphQL client\n * @param options - Update cart codes options\n * @returns Normalized cart or undefined if operation failed\n *\n * @example\n * ```ts\n * const cart = await updateCartCodes(client, {\n * discountCodes: ['SUMMER2024'],\n * cookieAdapter: myCookieAdapter\n * })\n * ```\n */\nexport async function updateCartCodes(\n client: ShopifyClient,\n options: UpdateCartCodesOptions\n): Promise<NormalizedCart | undefined> {\n const { cartId: providedCartId, discountCodes, cookieAdapter, metafieldIdentifiers } = options\n\n const locale = client.getLocale()\n\n const cartId = providedCartId || cookieAdapter?.getCartId(locale)\n\n if (!cartId) {\n throw new Error('Invalid input used for this operation: Miss cartId')\n }\n\n try {\n const data = await client.query<{\n cartDiscountCodesUpdate: {\n cart: CartFragment\n userErrors?: Array<{ field?: string[]; message: string }>\n }\n }>(updateCartDiscountCodeMutation, {\n cartId,\n discountCodes,\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n if (data?.cartDiscountCodesUpdate?.userErrors?.length) {\n console.error('[updateCartCodes] User errors:', data.cartDiscountCodesUpdate.userErrors)\n }\n\n if (!data?.cartDiscountCodesUpdate?.cart) {\n return undefined\n }\n\n const normalizedCart = normalizeCart(data.cartDiscountCodesUpdate.cart)\n\n return normalizedCart\n } catch (error) {\n console.error('[updateCartCodes] Error:', error)\n throw error\n }\n}\n","/**\n * Update Cart Attributes API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { updateCartAttributesMutation } from '../../mutations/cart/update-cart-attributes'\nimport type { HasMetafieldsIdentifier } from '../../shopify-types'\nimport type { CartFragment } from '../../shopify-types'\nimport { normalizeCart } from './normalize'\nimport type { CartCookieAdapter, NormalizedCart } from './types'\nimport { constructMetafieldIdentifiersQueryParams } from '../../utils'\n\nexport interface UpdateCartAttributesOptions {\n /** Cart ID (optional, will use cookie if not provided) */\n cartId?: string\n /** Attributes to set on the cart */\n attributes: Array<{ key: string; value: string }>\n /** Cookie adapter for managing cart ID */\n cookieAdapter?: CartCookieAdapter\n /** Current locale */\n metafieldIdentifiers?: {\n variant: HasMetafieldsIdentifier[]\n product: HasMetafieldsIdentifier[]\n }\n}\n\n/**\n * Update cart attributes (custom key-value pairs)\n *\n * @param client - Shopify GraphQL client\n * @param options - Update cart attributes options\n * @returns Normalized cart or undefined if operation failed\n *\n * @example\n * ```ts\n * const cart = await updateCartAttributes(client, {\n * locale: 'us',\n * attributes: [{ key: 'gift_message', value: 'Happy Birthday!' }],\n * cookieAdapter: myCookieAdapter\n * })\n * ```\n */\nexport async function updateCartAttributes(\n client: ShopifyClient,\n options: UpdateCartAttributesOptions\n): Promise<NormalizedCart | undefined> {\n const { cartId: providedCartId, attributes, cookieAdapter, metafieldIdentifiers } = options\n\n const locale = client.getLocale()\n\n const cartId = providedCartId || cookieAdapter?.getCartId(locale)\n\n if (!cartId) {\n throw new Error('Invalid input used for this operation: Miss cartId')\n }\n\n try {\n const data = await client.query<{\n cartAttributesUpdate: {\n cart: CartFragment\n userErrors?: Array<{ field?: string[]; message: string }>\n }\n }>(updateCartAttributesMutation, {\n cartId,\n attributes,\n ...constructMetafieldIdentifiersQueryParams(\n metafieldIdentifiers,\n client.getConfig().getMetafieldNamespacePrefix()\n ),\n })\n\n if (data?.cartAttributesUpdate?.userErrors?.length) {\n console.error('[updateCartAttributes] User errors:', data.cartAttributesUpdate.userErrors)\n }\n\n if (!data?.cartAttributesUpdate?.cart) {\n return undefined\n }\n\n const normalizedCart = normalizeCart(data.cartAttributesUpdate.cart)\n\n // Update cookie\n if (cookieAdapter && normalizedCart.id) {\n cookieAdapter.setCartId(locale, normalizedCart.id)\n }\n\n return normalizedCart\n } catch (error) {\n console.error('[updateCartAttributes] Error:', error)\n throw error\n }\n}\n","/**\n * Collection Normalization Functions\n */\n\nimport type { NormalizedCollection } from './types'\nimport { normalizeProduct } from '../product/normalize'\n\n/**\n * Normalize a Shopify Collection to NormalizedCollection\n */\nexport function normalizeCollection(collection: any): NormalizedCollection {\n // Normalize products if present\n const products = collection.products?.edges?.map((edge: any) => normalizeProduct(edge.node))\n\n // Normalize metafields\n const metafields: Record<string, any> = {}\n if (collection.metafields?.edges) {\n collection.metafields.edges.forEach((edge: any) => {\n const key = edge.node.key\n metafields[key] = edge.node.value\n })\n }\n\n return {\n id: collection.id,\n handle: collection.handle,\n title: collection.title,\n description: collection.description,\n descriptionHtml: collection.descriptionHtml,\n image: collection.image,\n products,\n seo: collection.seo,\n updatedAt: collection.updatedAt,\n metafields: Object.keys(metafields).length > 0 ? metafields : undefined,\n }\n}\n","/**\n * Get Collection API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { collectionFragment } from '../../fragments/collection'\nimport { metafieldFragment } from '../../fragments/metafield'\nimport { seoFragment } from '../../fragments/seo'\nimport { imageFragment } from '../../fragments/image'\nimport { normalizeCollection } from './normalize'\nimport type { GetCollectionOptions, NormalizedCollection } from './types'\n\nconst getCollectionQuery = /* GraphQL */ `\n query getCollectionByHandle(\n $handle: String!\n $metafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n collection(handle: $handle) {\n ...collection\n metafields(identifiers: $metafieldIdentifiers) {\n ...metafield\n }\n }\n }\n ${collectionFragment}\n ${metafieldFragment}\n ${seoFragment}\n ${imageFragment}\n`\n\nexport async function getCollection(\n client: ShopifyClient,\n options: GetCollectionOptions\n): Promise<NormalizedCollection | undefined> {\n const { handle, metafieldIdentifiers } = options\n\n const variables: any = { handle }\n if (metafieldIdentifiers) {\n variables.metafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ collection: any }>(getCollectionQuery, variables)\n\n if (!data?.collection) {\n return undefined\n }\n\n return normalizeCollection(data.collection)\n}\n","/**\n * Get All Collections API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { collectionFragment } from '../../fragments/collection'\nimport { metafieldFragment } from '../../fragments/metafield'\nimport { seoFragment } from '../../fragments/seo'\nimport { imageFragment } from '../../fragments/image'\nimport { normalizeCollection } from './normalize'\nimport type { GetCollectionsOptions, NormalizedCollection, CollectionsConnection } from './types'\n\nconst getAllCollectionsQuery = /* GraphQL */ `\n query getAllCollections(\n $first: Int = 250\n $after: String\n $query: String\n $sortKey: CollectionSortKeys\n $reverse: Boolean\n $metafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n collections(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n node {\n ...collection\n metafields(identifiers: $metafieldIdentifiers) {\n ...metafield\n }\n }\n }\n }\n }\n ${collectionFragment}\n ${metafieldFragment}\n ${seoFragment}\n ${imageFragment}\n`\n\nasync function fetchAllPages(\n client: ShopifyClient,\n options: GetCollectionsOptions,\n afterCursor?: string\n): Promise<NormalizedCollection[]> {\n const { first = 250, query, sortKey, reverse, metafieldIdentifiers } = options\n\n const variables: any = {\n first,\n after: afterCursor,\n query,\n sortKey,\n reverse,\n }\n\n if (metafieldIdentifiers) {\n variables.metafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ collections: any }>(getAllCollectionsQuery, variables)\n\n if (!data || !data.collections) {\n return []\n }\n\n const collections = data.collections.edges.map((edge: any) => normalizeCollection(edge.node))\n\n if (data.collections.pageInfo.hasNextPage) {\n const nextCollections = await fetchAllPages(client, options, data.collections.pageInfo.endCursor)\n return [...collections, ...nextCollections]\n }\n\n return collections\n}\n\nexport async function getAllCollections(\n client: ShopifyClient,\n options: GetCollectionsOptions\n): Promise<NormalizedCollection[]> {\n return fetchAllPages(client, options)\n}\n\nexport async function getCollections(\n client: ShopifyClient,\n options: GetCollectionsOptions\n): Promise<CollectionsConnection> {\n const { first = 250, after, query, sortKey, reverse, metafieldIdentifiers } = options\n\n const variables: any = {\n first,\n after,\n query,\n sortKey,\n reverse,\n }\n\n if (metafieldIdentifiers) {\n variables.metafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ collections: any }>(getAllCollectionsQuery, variables)\n\n if (!data || !data.collections) {\n return {\n collections: [],\n pageInfo: {\n hasNextPage: false,\n hasPreviousPage: false,\n },\n }\n }\n\n const collections = data.collections.edges.map((edge: any) => normalizeCollection(edge.node))\n\n return {\n collections,\n pageInfo: data.collections.pageInfo,\n }\n}\n","/**\n * Blog Normalization Functions\n */\n\nimport type { NormalizedBlog, NormalizedArticle } from './types'\n\nexport function normalizeBlog(blog: any): NormalizedBlog {\n return {\n id: blog.id,\n handle: blog.handle,\n title: blog.title,\n seo: blog.seo,\n metafields: normalizeMetafields(blog.metafields),\n articles: blog.articles?.edges?.map((edge: any) => normalizeArticle(edge.node)) || [],\n }\n}\n\nexport function normalizeArticle(article: any): NormalizedArticle {\n return {\n id: article.id,\n handle: article.handle,\n title: article.title,\n content: article.content,\n contentHtml: article.contentHtml,\n excerpt: article.excerpt,\n excerptHtml: article.excerptHtml,\n publishedAt: article.publishedAt,\n updatedAt: article.updatedAt,\n image: article.image,\n seo: article.seo,\n tags: article.tags || [],\n author: article.author,\n blog: article.blog,\n metafields: normalizeMetafields(article.metafields),\n }\n}\n\nfunction normalizeMetafields(metafields: any): Record<string, any> | undefined {\n if (!metafields || metafields.length === 0) {\n return undefined\n }\n\n return metafields.reduce((acc: Record<string, any>, metafield: any) => {\n if (metafield && metafield.key) {\n acc[metafield.key] = metafield.value\n }\n return acc\n }, {})\n}\n","/**\n * Get Blog API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { blogFragment, blogWithMetafieldsFragment } from '../../fragments/blog'\nimport { normalizeBlog } from './normalize'\nimport type { GetBlogOptions, NormalizedBlog } from './types'\n\nexport async function getBlog(\n client: ShopifyClient,\n options: GetBlogOptions\n): Promise<NormalizedBlog | undefined> {\n const { handle, metafieldIdentifiers } = options\n\n const hasMetafields = metafieldIdentifiers && metafieldIdentifiers.length > 0\n const fragment = hasMetafields ? blogWithMetafieldsFragment : blogFragment\n\n const query = /* GraphQL */ `\n query getBlog(\n $handle: String!\n ${hasMetafields ? '$blogMetafieldIdentifiers: [HasMetafieldsIdentifier!]!' : ''}\n ) @inContext(language: $language) {\n blog(handle: $handle) {\n ...${hasMetafields ? 'blogWithMetafields' : 'blog'}\n }\n }\n ${fragment}\n `\n\n const variables: any = { handle }\n if (hasMetafields) {\n variables.blogMetafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ blog: any }>(query, variables)\n\n if (!data || !data.blog) {\n return undefined\n }\n\n return normalizeBlog(data.blog)\n}\n","/**\n * Get All Blogs API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { blogFragment, blogWithMetafieldsFragment } from '../../fragments/blog'\nimport { pageInfoFragment } from '../../fragments/page-info'\nimport { normalizeBlog } from './normalize'\nimport type { GetAllBlogsOptions, NormalizedBlog } from './types'\n\nasync function fetchAllPages(\n client: ShopifyClient,\n options: GetAllBlogsOptions,\n afterCursor?: string\n): Promise<NormalizedBlog[]> {\n const { first = 250, query, metafieldIdentifiers } = options\n\n const hasMetafields = metafieldIdentifiers && metafieldIdentifiers.length > 0\n const fragment = hasMetafields ? blogWithMetafieldsFragment : blogFragment\n\n const queryString = /* GraphQL */ `\n query getAllBlogs(\n $first: Int!\n $after: String\n ${query ? '$query: String!' : ''}\n ${hasMetafields ? '$blogMetafieldIdentifiers: [HasMetafieldsIdentifier!]!' : ''}\n ) @inContext(language: $language) {\n blogs(\n first: $first\n after: $after\n ${query ? 'query: $query' : ''}\n ) {\n edges {\n node {\n ...${hasMetafields ? 'blogWithMetafields' : 'blog'}\n }\n }\n pageInfo {\n ...pageInfo\n }\n }\n }\n ${fragment}\n ${pageInfoFragment}\n `\n\n const variables: any = { first, after: afterCursor }\n if (query) {\n variables.query = query\n }\n if (hasMetafields) {\n variables.blogMetafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ blogs: any }>(queryString, variables)\n\n if (!data || !data.blogs) {\n return []\n }\n\n const blogs: NormalizedBlog[] = data.blogs.edges?.map((edge: any) => normalizeBlog(edge.node)) || []\n\n if (data.blogs.pageInfo.hasNextPage) {\n const nextBlogs = await fetchAllPages(client, options, data.blogs.pageInfo.endCursor)\n return [...blogs, ...nextBlogs]\n }\n\n return blogs\n}\n\nexport async function getAllBlogs(\n client: ShopifyClient,\n options: GetAllBlogsOptions\n): Promise<NormalizedBlog[]> {\n return fetchAllPages(client, options)\n}\n","/**\n * Get Article API\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { articleFragment, articleWithMetafieldsFragment, blogFragment, blogWithMetafieldsFragment } from '../../fragments/blog'\nimport { normalizeArticle } from './normalize'\nimport type { GetArticleOptions, NormalizedArticle } from './types'\n\nexport async function getArticle(\n client: ShopifyClient,\n options: GetArticleOptions\n): Promise<NormalizedArticle | undefined> {\n const { blogHandle, articleHandle, metafieldIdentifiers } = options\n\n const hasMetafields = metafieldIdentifiers && metafieldIdentifiers.length > 0\n const articleFrag = hasMetafields ? articleWithMetafieldsFragment : articleFragment\n const blogFrag = hasMetafields ? blogWithMetafieldsFragment : blogFragment\n\n const query = /* GraphQL */ `\n query getArticle(\n $blogHandle: String!\n $articleHandle: String!\n ${hasMetafields ? '$blogMetafieldIdentifiers: [HasMetafieldsIdentifier!]!' : ''}\n ${hasMetafields ? '$articleMetafieldIdentifiers: [HasMetafieldsIdentifier!]!' : ''}\n ) @inContext(language: $language) {\n blog(handle: $blogHandle) {\n ...${hasMetafields ? 'blogWithMetafields' : 'blog'}\n articleByHandle(handle: $articleHandle) {\n ...${hasMetafields ? 'articleWithMetafields' : 'article'}\n blog {\n ...${hasMetafields ? 'blogWithMetafields' : 'blog'}\n }\n }\n }\n }\n ${articleFrag}\n ${blogFrag}\n `\n\n const variables: any = { blogHandle, articleHandle }\n if (hasMetafields) {\n variables.blogMetafieldIdentifiers = metafieldIdentifiers\n variables.articleMetafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ blog: any }>(query, variables)\n\n if (!data || !data.blog || !data.blog.articleByHandle) {\n return undefined\n }\n\n return normalizeArticle(data.blog.articleByHandle)\n}\n","/**\n * Get Articles API (all articles across all blogs)\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { articleFragment, articleWithMetafieldsFragment } from '../../fragments/blog'\nimport { pageInfoFragment } from '../../fragments/page-info'\nimport { normalizeArticle } from './normalize'\nimport type { GetArticlesOptions, NormalizedArticle } from './types'\n\nasync function fetchAllPages(\n client: ShopifyClient,\n options: GetArticlesOptions,\n afterCursor?: string\n): Promise<NormalizedArticle[]> {\n const { first = 250, query, sortKey = 'PUBLISHED_AT', reverse = false, metafieldIdentifiers } = options\n\n const hasMetafields = metafieldIdentifiers && metafieldIdentifiers.length > 0\n const fragment = hasMetafields ? articleWithMetafieldsFragment : articleFragment\n\n const queryString = /* GraphQL */ `\n query getArticles(\n $first: Int!\n $after: String\n ${query ? '$query: String!' : ''}\n $sortKey: ArticleSortKeys!\n $reverse: Boolean!\n ${hasMetafields ? '$articleMetafieldIdentifiers: [HasMetafieldsIdentifier!]!' : ''}\n ) @inContext(language: $language) {\n articles(\n first: $first\n after: $after\n ${query ? 'query: $query' : ''}\n sortKey: $sortKey\n reverse: $reverse\n ) {\n edges {\n node {\n ...${hasMetafields ? 'articleWithMetafields' : 'article'}\n }\n }\n pageInfo {\n ...pageInfo\n }\n }\n }\n ${fragment}\n ${pageInfoFragment}\n `\n\n const variables: any = {\n first,\n after: afterCursor,\n sortKey,\n reverse,\n }\n if (query) {\n variables.query = query\n }\n if (hasMetafields) {\n variables.articleMetafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ articles: any }>(queryString, variables)\n\n if (!data || !data.articles) {\n return []\n }\n\n const articles: NormalizedArticle[] = data.articles.edges?.map((edge: any) => normalizeArticle(edge.node)) || []\n\n if (data.articles.pageInfo.hasNextPage) {\n const nextArticles = await fetchAllPages(client, options, data.articles.pageInfo.endCursor)\n return [...articles, ...nextArticles]\n }\n\n return articles\n}\n\nexport async function getArticles(\n client: ShopifyClient,\n options: GetArticlesOptions\n): Promise<NormalizedArticle[]> {\n return fetchAllPages(client, options)\n}\n","/**\n * Get Articles In Blog API (articles from a specific blog)\n */\n\nimport type { ShopifyClient } from '../../client'\nimport { articleFragment, articleWithMetafieldsFragment, blogFragment, blogWithMetafieldsFragment } from '../../fragments/blog'\nimport { pageInfoFragment } from '../../fragments/page-info'\nimport { normalizeArticle } from './normalize'\nimport type { GetArticlesInBlogOptions, NormalizedArticle } from './types'\n\nasync function fetchAllPages(\n client: ShopifyClient,\n options: GetArticlesInBlogOptions,\n afterCursor?: string\n): Promise<NormalizedArticle[]> {\n const { blogHandle, first = 250, sortKey = 'PUBLISHED_AT', reverse = false, metafieldIdentifiers } = options\n\n const hasMetafields = metafieldIdentifiers && metafieldIdentifiers.length > 0\n const articleFrag = hasMetafields ? articleWithMetafieldsFragment : articleFragment\n const blogFrag = hasMetafields ? blogWithMetafieldsFragment : blogFragment\n\n const query = /* GraphQL */ `\n query getArticlesInBlog(\n $blogHandle: String!\n $first: Int!\n $after: String\n $sortKey: ArticleSortKeys!\n $reverse: Boolean!\n ${hasMetafields ? '$blogMetafieldIdentifiers: [HasMetafieldsIdentifier!]!' : ''}\n ${hasMetafields ? '$articleMetafieldIdentifiers: [HasMetafieldsIdentifier!]!' : ''}\n ) @inContext(language: $language) {\n blog(handle: $blogHandle) {\n ...${hasMetafields ? 'blogWithMetafields' : 'blog'}\n articles(\n first: $first\n after: $after\n sortKey: $sortKey\n reverse: $reverse\n ) {\n edges {\n node {\n ...${hasMetafields ? 'articleWithMetafields' : 'article'}\n }\n }\n pageInfo {\n ...pageInfo\n }\n }\n }\n }\n ${articleFrag}\n ${blogFrag}\n ${pageInfoFragment}\n `\n\n const variables: any = {\n blogHandle,\n first,\n after: afterCursor,\n sortKey,\n reverse,\n }\n if (hasMetafields) {\n variables.blogMetafieldIdentifiers = metafieldIdentifiers\n variables.articleMetafieldIdentifiers = metafieldIdentifiers\n }\n\n const data = await client.query<{ blog: any }>(query, variables)\n\n if (!data || !data.blog || !data.blog.articles) {\n return []\n }\n\n const articles: NormalizedArticle[] = data.blog.articles.edges?.map((edge: any) => normalizeArticle(edge.node)) || []\n\n if (data.blog.articles.pageInfo.hasNextPage) {\n const nextArticles = await fetchAllPages(client, options, data.blog.articles.pageInfo.endCursor)\n return [...articles, ...nextArticles]\n }\n\n return articles\n}\n\nexport async function getArticlesInBlog(\n client: ShopifyClient,\n options: GetArticlesInBlogOptions\n): Promise<NormalizedArticle[]> {\n return fetchAllPages(client, options)\n}\n"]}
@@ -0,0 +1,13 @@
1
+ declare const createCartMutation = "\n mutation createCart(\n $lines: [CartLineInput!]\n $discountCodes: [String!]\n $attributes: [AttributeInput!] = []\n $buyerIdentity: CartBuyerIdentityInput\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartCreate(\n input: {\n lines: $lines\n discountCodes: $discountCodes\n attributes: $attributes\n buyerIdentity: $buyerIdentity\n }\n ) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
2
+
3
+ declare const addCartItemsMutation = "\n mutation addToCart(\n $cartId: ID!\n $lines: [CartLineInput!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
4
+
5
+ declare const updateCartItemsMutation = "\n mutation editCartItems(\n $cartId: ID!\n $lines: [CartLineUpdateInput!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
6
+
7
+ declare const removeCartItemsMutation = "\n mutation removeFromCart(\n $cartId: ID!\n $lineIds: [ID!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
8
+
9
+ declare const updateCartDiscountCodeMutation = "\n mutation cartDiscountCodesUpdate(\n $cartId: ID!\n $discountCodes: [String!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
10
+
11
+ declare const updateCartAttributesMutation = "\n mutation cartAttributesUpdate(\n $attributes: [AttributeInput!]!\n $cartId: ID!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
12
+
13
+ export { addCartItemsMutation, createCartMutation, removeCartItemsMutation, updateCartAttributesMutation, updateCartDiscountCodeMutation, updateCartItemsMutation };
@@ -0,0 +1,13 @@
1
+ declare const createCartMutation = "\n mutation createCart(\n $lines: [CartLineInput!]\n $discountCodes: [String!]\n $attributes: [AttributeInput!] = []\n $buyerIdentity: CartBuyerIdentityInput\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartCreate(\n input: {\n lines: $lines\n discountCodes: $discountCodes\n attributes: $attributes\n buyerIdentity: $buyerIdentity\n }\n ) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
2
+
3
+ declare const addCartItemsMutation = "\n mutation addToCart(\n $cartId: ID!\n $lines: [CartLineInput!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
4
+
5
+ declare const updateCartItemsMutation = "\n mutation editCartItems(\n $cartId: ID!\n $lines: [CartLineUpdateInput!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
6
+
7
+ declare const removeCartItemsMutation = "\n mutation removeFromCart(\n $cartId: ID!\n $lineIds: [ID!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
8
+
9
+ declare const updateCartDiscountCodeMutation = "\n mutation cartDiscountCodesUpdate(\n $cartId: ID!\n $discountCodes: [String!]!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
10
+
11
+ declare const updateCartAttributesMutation = "\n mutation cartAttributesUpdate(\n $attributes: [AttributeInput!]!\n $cartId: ID!\n $variantMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n $productMetafieldIdentifiers: [HasMetafieldsIdentifier!] = []\n ) {\n cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {\n cart {\n ...cart\n }\n userErrors {\n field\n message\n }\n }\n }\n \n fragment cart on Cart {\n id\n totalQuantity\n updatedAt\n createdAt\n checkoutUrl\n note\n attributes {\n key\n value\n }\n cost {\n checkoutChargeAmount {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n totalTaxAmount {\n amount\n currencyCode\n }\n totalDutyAmount {\n amount\n currencyCode\n }\n totalAmountEstimated\n totalTaxAmountEstimated\n totalDutyAmountEstimated\n subtotalAmountEstimated\n }\n buyerIdentity {\n email\n customer {\n email\n id\n }\n deliveryAddressPreferences {\n ... on MailingAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n discountCodes {\n applicable\n code\n }\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n deliveryGroups(first: 10) {\n nodes {\n deliveryAddress {\n address1\n address2\n city\n country\n zip\n }\n }\n }\n lines(first: 100) {\n edges {\n node {\n id\n quantity\n discountAllocations {\n ... on CartCodeDiscountAllocation {\n code\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartAutomaticDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n ... on CartCustomDiscountAllocation {\n title\n discountedAmount {\n amount\n currencyCode\n }\n }\n }\n attributes {\n key\n value\n }\n cost {\n amountPerQuantity {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n subtotalAmount {\n amount\n currencyCode\n }\n totalAmount {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n sku\n title\n quantityAvailable\n currentlyNotInStock\n availableForSale\n barcode\n weight\n selectedOptions {\n name\n value\n }\n image {\n ...image\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n metafields(identifiers: $variantMetafieldIdentifiers) {\n ...metafield\n }\n product {\n ...product\n }\n }\n }\n }\n }\n }\n totalQuantity\n }\n \n fragment product on Product {\n id\n handle\n availableForSale\n title\n description\n descriptionHtml\n options {\n id\n name\n values\n }\n productType\n vendor\n priceRange {\n maxVariantPrice {\n amount\n currencyCode\n }\n minVariantPrice {\n amount\n currencyCode\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n amount\n currencyCode\n }\n }\n featuredImage {\n ...image\n }\n images(first: 250) {\n edges {\n node {\n ...image\n }\n }\n }\n metafields(identifiers: $productMetafieldIdentifiers) {\n ...metafield\n }\n media(first: 250) {\n edges {\n node {\n id\n mediaContentType\n ... on Video {\n id\n sources {\n format\n height\n mimeType\n url\n width\n }\n }\n ... on MediaImage {\n id\n image {\n altText\n url\n }\n }\n }\n }\n }\n seo {\n ...seo\n }\n tags\n createdAt\n updatedAt\n publishedAt\n requiresSellingPlan\n sellingPlanGroups(first: 250) {\n edges {\n node {\n name\n sellingPlans(first: 250) {\n edges {\n node {\n id\n name\n priceAdjustments {\n adjustmentValue {\n ... on SellingPlanFixedAmountPriceAdjustment {\n __typename\n adjustmentAmount {\n amount\n currencyCode\n }\n }\n ... on SellingPlanFixedPriceAdjustment {\n __typename\n price {\n amount\n currencyCode\n }\n }\n ... on SellingPlanPercentagePriceAdjustment {\n __typename\n adjustmentPercentage\n }\n }\n }\n options {\n name\n value\n }\n }\n }\n }\n }\n }\n }\n }\n\n \n fragment image on Image {\n url\n altText\n width\n height\n }\n\n \n fragment seo on SEO {\n description\n title\n }\n\n \n fragment metafield on Metafield {\n value\n type\n description\n namespace\n key\n }\n\n\n";
12
+
13
+ export { addCartItemsMutation, createCartMutation, removeCartItemsMutation, updateCartAttributesMutation, updateCartDiscountCodeMutation, updateCartItemsMutation };