diff --git a/.changeset/little-bottles-switch.md b/.changeset/little-bottles-switch.md deleted file mode 100644 index d3cb256cc..000000000 --- a/.changeset/little-bottles-switch.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@vue-storefront/magento-api": minor -"@vue-storefront/magento-sdk": minor ---- - -[ADDED] addBundleProductsToCart method to add one or more bundle products to the specified cart. -[ADDED] addConfigurableProductsToCart method to add one or more configurable products to the specified cart. - diff --git a/.changeset/random-name-tg.md b/.changeset/random-name-tg.md deleted file mode 100644 index 68ad0de78..000000000 --- a/.changeset/random-name-tg.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@vue-storefront/magento-api": patch ---- - -[CHANGED] `Context` from type to interface to allow declaration merging. \ No newline at end of file diff --git a/docs/content/5.api/magento-api.api.json b/docs/content/5.api/magento-api.api.json index ce052a521..ea830a286 100644 --- a/docs/content/5.api/magento-api.api.json +++ b/docs/content/5.api/magento-api.api.json @@ -185,7 +185,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -265,7 +265,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -380,7 +380,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -495,7 +495,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -614,7 +614,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -698,7 +698,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -778,7 +778,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -893,7 +893,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1012,7 +1012,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1083,7 +1083,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1201,7 +1201,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1263,7 +1263,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1378,7 +1378,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1497,7 +1497,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1568,7 +1568,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1682,7 +1682,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1796,7 +1796,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -1895,7 +1895,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2013,7 +2013,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2093,7 +2093,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2212,7 +2212,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2278,7 +2278,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2349,7 +2349,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2452,7 +2452,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2523,7 +2523,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2626,7 +2626,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2710,7 +2710,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2794,7 +2794,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2869,7 +2869,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -2931,7 +2931,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3033,7 +3033,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3108,7 +3108,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3170,7 +3170,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3269,7 +3269,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3371,7 +3371,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3451,7 +3451,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3554,7 +3554,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3625,7 +3625,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3724,7 +3724,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3843,7 +3843,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3927,7 +3927,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -3998,7 +3998,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4113,7 +4113,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4228,7 +4228,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4343,7 +4343,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4462,7 +4462,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4542,7 +4542,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4641,7 +4641,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4744,7 +4744,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4828,7 +4828,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -4890,7 +4890,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5017,7 +5017,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5097,7 +5097,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5212,7 +5212,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5327,7 +5327,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5442,7 +5442,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5557,7 +5557,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5656,7 +5656,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5755,7 +5755,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5874,7 +5874,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -5954,7 +5954,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -6073,7 +6073,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -6157,7 +6157,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -6237,7 +6237,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -6355,7 +6355,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", @@ -6439,7 +6439,7 @@ { "kind": "Reference", "text": "Context", - "canonicalReference": "@vue-storefront/magento-api!Context:type" + "canonicalReference": "@vue-storefront/magento-api!Context:interface" }, { "kind": "Content", diff --git a/docs/content/5.api/magento-sdk.api.json b/docs/content/5.api/magento-sdk.api.json index 5e734cf51..76b52c650 100644 --- a/docs/content/5.api/magento-sdk.api.json +++ b/docs/content/5.api/magento-sdk.api.json @@ -169,6 +169,422 @@ "canonicalReference": "@vue-storefront/magento-sdk!", "name": "", "members": [ + { + "kind": "Function", + "canonicalReference": "@vue-storefront/magento-sdk!addBundleProductsToCart:function(1)", + "docComment": "/**\n * Method to add bundle products to cart (returns cart)\n *\n * @remarks\n *\n * This method sends a POST request to the {@link https://docs.vuestorefront.io/integrations/magento/api/magento-api/addBundleProductsToCart | addBundleProductsToCart} endpoint of the Vue Storefront API Middleware. The default GraphQL query used by this method can be found {@link https://docs.vuestorefront.io/integrations/magento/api/magento-api/addBundleProductsToCart | here}.\n *\n * @param params - Parameter object which can be used with this method. Refer to its type definition to learn about possible properties.\n *\n * @param options - Options that can be passed to additionally configure the request or customize the logic in a plugin.\n *\n * @typeParam Res - Customizable response interface to be used with custom queries.\n *\n * @returns Returns a representation of the {@link https://docs.vuestorefront.io/integrations/magento/api/magento-api/AddProductsToCartResponse | AddProductsToCartResponse}.\n *\n * @example\n *\n * Adding bundle products to cart with default parameters.\n * ```ts\n * import { sdk } from '~/sdk.config.ts';\n *\n * const cart = await sdk.magento.addBundleProductsToCart(\n * {\n * cart_id: '123',\n * cart_items: [\n * {\n * data: {\n * quantity: 1,\n * sku: TEST_BUNDLE_SKU,\n * },\n * bundle_options: [\n * {\n * id: 1,\n * quantity: 1,\n * value: ['1'],\n * },\n * {\n * id: 2,\n * quantity: 1,\n * value: ['4'],\n * },\n * {\n * id: 3,\n * quantity: 1,\n * value: ['5'],\n * },\n * {\n * id: 4,\n * quantity: 1,\n * value: ['8'],\n * },\n * ]\n * }\n * );\n * ```\n *\n * @example\n *\n * Creating a custom GraphQL query for adding bundle products to cart\n * ```ts\n * module.exports = {\n * integrations: {\n * magento: {\n * customQueries: {\n * 'add-bundle-products-to-cart-custom-query': ({ variables, metadata }) => ({\n * variables,\n * query: `\n * mutation addBundleProductsToCart($input: AddBundleProductsToCartInput) {\n * addBundleProductsToCart(input: $input) {\n * cart {\n * ${metadata.fields}\n * }\n * }\n * }`,\n * }),\n * },\n * }\n * }\n * };\n * ```\n *\n * @example\n *\n * Using a custom GraphQL query to modify response containing the cart, which is sent as part of the adding product to cart mutation\n * ```ts\n * import { sdk } from '~/sdk.config.ts';\n * // reduce the amount of fields returned by the query, when compared to the default query\n * const customQuery = {\n * cart: 'add-bundle-products-to-cart-custom-query',\n * metadata: {\n * fields: 'id items { uid }'\n * }\n * };\n *\n *\n * const cart = await sdk.magento.addBundleProductsToCart(\n * {\n * // use the payload from the previous example\n * }, { customQuery }\n * );\n *\n * // Result will contain only the fields specified in the custom query.\n * ```\n *\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function addBundleProductsToCart(params: " + }, + { + "kind": "Reference", + "text": "AddBundleProductsToCartInput", + "canonicalReference": "@vue-storefront/magento-types!AddBundleProductsToCartInput:interface" + }, + { + "kind": "Content", + "text": ", options?: " + }, + { + "kind": "Reference", + "text": "MethodOptions", + "canonicalReference": "@vue-storefront/magento-sdk!MethodOptions:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "CustomQuery", + "canonicalReference": "@vue-storefront/magento-sdk!CustomQuery:type" + }, + { + "kind": "Content", + "text": "<'addBundleProductsToCart'>>" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 10, + "endIndex": 12 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "params", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + } + }, + { + "parameterName": "options", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 9 + } + } + ], + "typeParameters": [ + { + "typeParameterName": "RES", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "addBundleProductsToCart" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@vue-storefront/magento-sdk!AddBundleProductsToCart:type", + "docComment": "/**\n * mutation type for the {@link addBundleProductsToCart} method.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type AddBundleProductsToCart = " + }, + { + "kind": "Content", + "text": "{\n addBundleProductsToCart: " + }, + { + "kind": "Reference", + "text": "Mutation", + "canonicalReference": "@vue-storefront/magento-types!Mutation:interface" + }, + { + "kind": "Content", + "text": "['addBundleProductsToCart'];\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Public", + "name": "AddBundleProductsToCart", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 4 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@vue-storefront/magento-sdk!AddBundleProductsToCartResponse:type", + "docComment": "/**\n * Add bundle products to cart response type\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type AddBundleProductsToCartResponse " + }, + { + "kind": "Content", + "text": "= " + }, + { + "kind": "Reference", + "text": "AddBundleProductsToCart", + "canonicalReference": "@vue-storefront/magento-sdk!AddBundleProductsToCart:type" + }, + { + "kind": "Content", + "text": "> = " + }, + { + "kind": "Reference", + "text": "ApolloQueryResult", + "canonicalReference": "@apollo/client/core!ApolloQueryResult:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Public", + "name": "AddBundleProductsToCartResponse", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 5 + }, + "defaultTypeTokenRange": { + "startIndex": 6, + "endIndex": 7 + } + } + ], + "typeTokenRange": { + "startIndex": 8, + "endIndex": 10 + } + }, + { + "kind": "Function", + "canonicalReference": "@vue-storefront/magento-sdk!addConfigurableProductsToCart:function(1)", + "docComment": "/**\n * Method to add configurable products to cart (returns cart)\n *\n * @remarks\n *\n * This method sends a POST request to the {@link https://docs.vuestorefront.io/integrations/magento/api/magento-api/addConfigurableProductsToCart | addConfigurableProductsToCart} endpoint of the Vue Storefront API Middleware. The default GraphQL query used by this method can be found {@link https://docs.vuestorefront.io/integrations/magento/api/magento-api/addConfigurableProductsToCart | here}.\n *\n * @param params - Parameter object which can be used with this method. Refer to its type definition to learn about possible properties.\n *\n * @param options - Options that can be passed to additionally configure the request or customize the logic in a plugin.\n *\n * @typeParam Res - Customizable response interface to be used with custom queries.\n *\n * @returns Returns a representation of the {@link https://docs.vuestorefront.io/integrations/magento/api/magento-api/AddProductsToCartResponse | AddProductsToCartResponse}.\n *\n * @example\n *\n * Adding configurable products to cart with default parameters.\n * ```ts\n * import { sdk } from '~/sdk.config.ts';\n *\n * const cart = await sdk.magento.addConfigurableProductsToCart(\n * {\n * cart_id: '123',\n * cart_items: [\n * {\n * data: {\n * quantity: 1,\n * sku: 'MH01-XS-Black',\n * },\n * parent_sku: 'MH01',\n * customizable_options: [],\n * }\n * ]\n * }\n * );\n * ```\n *\n * @example\n *\n * Creating a custom GraphQL query for adding configurable products to cart\n * ```ts\n * module.exports = {\n * integrations: {\n * magento: {\n * customQueries: {\n * 'add-configurable-products-to-cart-custom-query': ({ variables, metadata }) => ({\n * variables,\n * query: `\n * mutation addConfigurableProductsToCart($input: AddConfigurableProductsToCartInput) {\n * addConfigurableProductsToCart(input: $input) {\n * cart {\n * ${metadata.fields}\n * }\n * }\n * }`,\n * }),\n * },\n * }\n * }\n * };\n * ```\n *\n * @example\n *\n * Using a custom GraphQL query to modify response containing the cart, which is sent as part of the adding product to cart mutation\n * ```ts\n * import { sdk } from '~/sdk.config.ts';\n * // reduce the amount of fields returned by the query, when compared to the default query\n * const customQuery = {\n * cart: 'add-configurable-products-to-cart-custom-query',\n * metadata: {\n * fields: 'id items { uid }'\n * }\n * };\n *\n *\n * const cart = await sdk.magento.addConfigurableProductsToCart(\n * {\n * cart_id: '123',\n * cart_items: [\n * {\n * data: {\n * quantity: 1,\n * sku: 'MH01-XS-Black',\n * },\n * parent_sku: 'MH01',\n * customizable_options: [],\n * }\n * ]\n * },\n * { customQuery }\n * );\n *\n * // Result will contain only the fields specified in the custom query.\n * ```\n *\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function addConfigurableProductsToCart(params: " + }, + { + "kind": "Reference", + "text": "AddConfigurableProductsToCartInput", + "canonicalReference": "@vue-storefront/magento-types!AddConfigurableProductsToCartInput:interface" + }, + { + "kind": "Content", + "text": ", options?: " + }, + { + "kind": "Reference", + "text": "MethodOptions", + "canonicalReference": "@vue-storefront/magento-sdk!MethodOptions:type" + }, + { + "kind": "Content", + "text": "<" + }, + { + "kind": "Reference", + "text": "CustomQuery", + "canonicalReference": "@vue-storefront/magento-sdk!CustomQuery:type" + }, + { + "kind": "Content", + "text": "<'addConfigurableProductsToCart'>>" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Reference", + "text": "Promise", + "canonicalReference": "!Promise:interface" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 10, + "endIndex": 12 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "params", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + } + }, + { + "parameterName": "options", + "parameterTypeTokenRange": { + "startIndex": 5, + "endIndex": 9 + } + } + ], + "typeParameters": [ + { + "typeParameterName": "RES", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 2 + }, + "defaultTypeTokenRange": { + "startIndex": 0, + "endIndex": 0 + } + } + ], + "name": "addConfigurableProductsToCart" + }, + { + "kind": "TypeAlias", + "canonicalReference": "@vue-storefront/magento-sdk!AddConfigurableProductsToCart:type", + "docComment": "/**\n * mutation type for the {@link addConfigurableProductsToCart} method.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type AddConfigurableProductsToCart = " + }, + { + "kind": "Content", + "text": "{\n addConfigurableProductsToCart: " + }, + { + "kind": "Reference", + "text": "Mutation", + "canonicalReference": "@vue-storefront/magento-types!Mutation:interface" + }, + { + "kind": "Content", + "text": "['addConfigurableProductsToCart'];\n}" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Public", + "name": "AddConfigurableProductsToCart", + "typeTokenRange": { + "startIndex": 1, + "endIndex": 4 + } + }, + { + "kind": "TypeAlias", + "canonicalReference": "@vue-storefront/magento-sdk!AddConfigurableProductsToCartResponse:type", + "docComment": "/**\n * Add products to cart response type\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export type AddConfigurableProductsToCartResponse " + }, + { + "kind": "Content", + "text": "= " + }, + { + "kind": "Reference", + "text": "AddConfigurableProductsToCart", + "canonicalReference": "@vue-storefront/magento-sdk!AddConfigurableProductsToCart:type" + }, + { + "kind": "Content", + "text": "> = " + }, + { + "kind": "Reference", + "text": "ApolloQueryResult", + "canonicalReference": "@apollo/client/core!ApolloQueryResult:type" + }, + { + "kind": "Content", + "text": "" + }, + { + "kind": "Content", + "text": ";" + } + ], + "releaseTag": "Public", + "name": "AddConfigurableProductsToCartResponse", + "typeParameters": [ + { + "typeParameterName": "T", + "constraintTokenRange": { + "startIndex": 1, + "endIndex": 5 + }, + "defaultTypeTokenRange": { + "startIndex": 6, + "endIndex": 7 + } + } + ], + "typeTokenRange": { + "startIndex": 8, + "endIndex": 10 + } + }, { "kind": "Function", "canonicalReference": "@vue-storefront/magento-sdk!addProductsToCart:function(1)", diff --git a/docs/content/6.reference/changelogs/vue-storefront-magento-api.md b/docs/content/6.reference/changelogs/vue-storefront-magento-api.md index 915416cba..c670178c3 100644 --- a/docs/content/6.reference/changelogs/vue-storefront-magento-api.md +++ b/docs/content/6.reference/changelogs/vue-storefront-magento-api.md @@ -1,5 +1,16 @@ # @vue-storefront/magento-api +## 2.5.0 + +### Minor Changes + +- eda02ee7: [ADDED] addBundleProductsToCart method to add one or more bundle products to the specified cart. + [ADDED] addConfigurableProductsToCart method to add one or more configurable products to the specified cart. + +### Patch Changes + +- 06362368: [CHANGED] `Context` from type to interface to allow declaration merging. + ## 2.4.3 ### Patch Changes diff --git a/docs/content/6.reference/changelogs/vue-storefront-magento-sdk.md b/docs/content/6.reference/changelogs/vue-storefront-magento-sdk.md index 43bfdb3be..8fe8e1185 100644 --- a/docs/content/6.reference/changelogs/vue-storefront-magento-sdk.md +++ b/docs/content/6.reference/changelogs/vue-storefront-magento-sdk.md @@ -1,5 +1,12 @@ # @vue-storefront/magento-sdk +## 2.2.0 + +### Minor Changes + +- eda02ee7: [ADDED] addBundleProductsToCart method to add one or more bundle products to the specified cart. + [ADDED] addConfigurableProductsToCart method to add one or more configurable products to the specified cart. + ## 2.1.1 ### Patch Changes diff --git a/packages/api-client/CHANGELOG.md b/packages/api-client/CHANGELOG.md index 915416cba..f221dcf6d 100644 --- a/packages/api-client/CHANGELOG.md +++ b/packages/api-client/CHANGELOG.md @@ -1,5 +1,15 @@ # @vue-storefront/magento-api +## 2.5.0 + +### Minor Changes + +- eda02ee7: [CHANGED] Update addConfigurableProductsToCart and addBundleProductsToCart methods to align with the rest of the API methods. It is an internal change that does not affect the public API. + +### Patch Changes + +- 06362368: [CHANGED] `Context` from type to interface to allow declaration merging. + ## 2.4.3 ### Patch Changes diff --git a/packages/api-client/package.json b/packages/api-client/package.json index 437b62846..f2df14f5e 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@vue-storefront/magento-api", - "version": "2.4.3", + "version": "2.5.0", "sideEffects": false, "homepage": "https://github.com/vuestorefront/magento2", "bugs": { diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 43bfdb3be..8fe8e1185 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,5 +1,12 @@ # @vue-storefront/magento-sdk +## 2.2.0 + +### Minor Changes + +- eda02ee7: [ADDED] addBundleProductsToCart method to add one or more bundle products to the specified cart. + [ADDED] addConfigurableProductsToCart method to add one or more configurable products to the specified cart. + ## 2.1.1 ### Patch Changes diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 76b8b09ea..45f77b11b 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@vue-storefront/magento-sdk", - "version": "2.1.1", + "version": "2.2.0", "main": "lib/index.cjs.js", "module": "lib/index.es.js", "types": "lib/index.d.ts", @@ -26,7 +26,7 @@ "@vue-storefront/magento-types": "^1.0.0" }, "devDependencies": { - "@vue-storefront/magento-api": "^2.4.0", + "@vue-storefront/magento-api": "^2.5.0", "nock": "^13.2.9", "@types/node": "^12.12.14" },