@ikas/code-components-mcp 1.4.0-beta.127 → 1.4.0-beta.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/storefront-api.json +33 -3
- package/data/storefront-types.json +73 -1
- package/package.json +1 -1
package/data/storefront-api.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-07-
|
|
2
|
+
"generatedAt": "2026-07-21T10:59:47.347Z",
|
|
3
3
|
"functions": [
|
|
4
4
|
{
|
|
5
5
|
"name": "apiListProductBrand",
|
|
@@ -7597,14 +7597,14 @@
|
|
|
7597
7597
|
"name": "getProductVariantAppliedCampaignAmount",
|
|
7598
7598
|
"displayName": "getAppliedCampaignAmount",
|
|
7599
7599
|
"signature": "function getProductVariantAppliedCampaignAmount(variant: IkasProductVariant): IkasAppliedCampaignAmount | null",
|
|
7600
|
-
"description": "Get the applied campaign discount amount details for a product variant, including type and formatted value.",
|
|
7600
|
+
"description": "Get the applied campaign discount amount details for a product variant, including type and formatted value.\n\nHow the discount value is interpreted depends on `campaign.type`:\n- `\"FIXED_AMOUNT\"` → the value is an absolute money amount, returned in `formattedPrice` (e.g. \"$10.00\"); `discountPercentage` stays null.\n- `\"RATIO\"` → the value is a percentage, returned in `discountPercentage` (e.g. \"10\" for 10% off); `formattedPrice` stays null.\n\nBoth fixed and tiered campaigns are supported. For a tiered-discount campaign\n(`campaign.fixedDiscount` is null and the discount lives in `campaign.tieredDiscount.rules`),\nthe first tier's amount (`campaign.tieredDiscount.rules[0].amount`) is used, matching the storefront runtime.",
|
|
7601
7601
|
"params": [
|
|
7602
7602
|
{
|
|
7603
7603
|
"name": "variant",
|
|
7604
7604
|
"description": "- The product variant to check for applied campaigns"
|
|
7605
7605
|
}
|
|
7606
7606
|
],
|
|
7607
|
-
"returns": "An object
|
|
7607
|
+
"returns": "An object `{ type, formattedPrice, discountPercentage }` — `formattedPrice` is set for FIXED_AMOUNT campaigns, `discountPercentage` for RATIO campaigns (fixed and tiered alike); the other field stays null. Returns null if no campaign is applied.",
|
|
7608
7608
|
"returnType": "IkasAppliedCampaignAmount | null",
|
|
7609
7609
|
"example": "```typescript\nimport { getProductVariantAppliedCampaignAmount, getSelectedProductVariant } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction CampaignInfo({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const campaignAmount = getProductVariantAppliedCampaignAmount(variant);\n\n if (!campaignAmount) return null;\n\n return (\n <div>\n {campaignAmount.type === \"RATIO\"\n ? `${campaignAmount.discountPercentage}% off`\n : `${campaignAmount.formattedPrice} off`}\n </div>\n );\n}\n```",
|
|
7610
7610
|
"categories": [
|
|
@@ -7999,6 +7999,36 @@
|
|
|
7999
7999
|
"IkasProductVariant"
|
|
8000
8000
|
]
|
|
8001
8001
|
},
|
|
8002
|
+
{
|
|
8003
|
+
"name": "getProductVariantTieredDiscountProducts",
|
|
8004
|
+
"displayName": "getTieredDiscountProducts",
|
|
8005
|
+
"signature": "function getProductVariantTieredDiscountProducts(variant: IkasProductVariant): IkasTieredDiscountProduct[]",
|
|
8006
|
+
"description": "Get the tiered-discount breakdown for a product variant, one entry per discount tier.\n\nA tiered discount defines multiple quantity tiers (`campaign.tieredDiscount.rules`), each with its own\namount and quantity range. This resolves every tier against the variant's price and returns the\nper-tier sell/final prices (both raw numbers and formatted strings), matching the storefront runtime.\n\nThe discount `amount` is interpreted by `campaign.type`: `\"RATIO\"` treats it as a percentage,\n`\"FIXED_AMOUNT\"` as an absolute money amount subtracted from the tier total.\n\nReturns an empty array when the variant has no tiered-discount campaign, when a\n`PRODUCT_AND_VARIANT` filter excludes this variant, or when no tier defines a quantity range.",
|
|
8007
|
+
"params": [
|
|
8008
|
+
{
|
|
8009
|
+
"name": "variant",
|
|
8010
|
+
"description": "- The product variant to resolve tiered discounts for"
|
|
8011
|
+
}
|
|
8012
|
+
],
|
|
8013
|
+
"returns": "An array of tier objects (`amount`, `lineItemQuantityRange`, `type`, sell/final prices with their formatted variants, `salesChannelIds`), or an empty array if no tiered discount applies",
|
|
8014
|
+
"returnType": "IkasTieredDiscountProduct[]",
|
|
8015
|
+
"example": "```typescript\nimport { getProductVariantTieredDiscountProducts, getSelectedProductVariant } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction TieredDiscountTable({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const tiers = getProductVariantTieredDiscountProducts(variant);\n\n if (!tiers.length) return null;\n\n return (\n <ul>\n {tiers.map((tier, i) => (\n <li key={i}>\n Buy {tier.lineItemQuantityRange.min}+ → {tier.formattedFinalPriceWithQuantity}{\" \"}\n <s>{tier.formattedSellPriceWithQuantity}</s>\n </li>\n ))}\n </ul>\n );\n}\n```",
|
|
8016
|
+
"categories": [
|
|
8017
|
+
"Pricing",
|
|
8018
|
+
"ProductVariant"
|
|
8019
|
+
],
|
|
8020
|
+
"related": [
|
|
8021
|
+
"getProductVariantAppliedCampaignAmount",
|
|
8022
|
+
"getProductVariantCampaignOffersDiscountPercentage",
|
|
8023
|
+
"getProductVariantFinalPrice"
|
|
8024
|
+
],
|
|
8025
|
+
"isAsync": false,
|
|
8026
|
+
"isClass": false,
|
|
8027
|
+
"parameterTypes": [
|
|
8028
|
+
"IkasProductVariant",
|
|
8029
|
+
"IkasTieredDiscountProduct"
|
|
8030
|
+
]
|
|
8031
|
+
},
|
|
8002
8032
|
{
|
|
8003
8033
|
"name": "getProductVariantIsBackInStockEnabled",
|
|
8004
8034
|
"displayName": "isBackInStockEnabled",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-07-
|
|
2
|
+
"generatedAt": "2026-07-21T10:59:47.371Z",
|
|
3
3
|
"types": [
|
|
4
4
|
{
|
|
5
5
|
"name": "TextElementTagTypes",
|
|
@@ -10946,6 +10946,7 @@
|
|
|
10946
10946
|
"getProductVariantSellPriceWithCampaignOffers",
|
|
10947
10947
|
"getProductVariantFormattedSellPriceWithCampaignOffers",
|
|
10948
10948
|
"getProductVariantCampaignOffersDiscountPercentage",
|
|
10949
|
+
"getProductVariantTieredDiscountProducts",
|
|
10949
10950
|
"getProductVariantIsBackInStockEnabled",
|
|
10950
10951
|
"getProductVariantIsBackInStockCustomerLoginRequired",
|
|
10951
10952
|
"saveProductVariantBackInStockReminder",
|
|
@@ -10983,6 +10984,77 @@
|
|
|
10983
10984
|
"getProductVariantAppliedCampaignAmount"
|
|
10984
10985
|
]
|
|
10985
10986
|
},
|
|
10987
|
+
{
|
|
10988
|
+
"name": "IkasTieredDiscountProduct",
|
|
10989
|
+
"kind": "type",
|
|
10990
|
+
"domain": "product",
|
|
10991
|
+
"properties": [
|
|
10992
|
+
{
|
|
10993
|
+
"name": "amount",
|
|
10994
|
+
"type": "number | null",
|
|
10995
|
+
"optional": false
|
|
10996
|
+
},
|
|
10997
|
+
{
|
|
10998
|
+
"name": "lineItemQuantityRange",
|
|
10999
|
+
"type": "{ min: number; max: number }",
|
|
11000
|
+
"optional": false
|
|
11001
|
+
},
|
|
11002
|
+
{
|
|
11003
|
+
"name": "type",
|
|
11004
|
+
"type": "IkasCampaignType",
|
|
11005
|
+
"optional": false
|
|
11006
|
+
},
|
|
11007
|
+
{
|
|
11008
|
+
"name": "sellPrice",
|
|
11009
|
+
"type": "number",
|
|
11010
|
+
"optional": false
|
|
11011
|
+
},
|
|
11012
|
+
{
|
|
11013
|
+
"name": "finalPrice",
|
|
11014
|
+
"type": "number",
|
|
11015
|
+
"optional": false
|
|
11016
|
+
},
|
|
11017
|
+
{
|
|
11018
|
+
"name": "sellPriceWithQuantity",
|
|
11019
|
+
"type": "number",
|
|
11020
|
+
"optional": false
|
|
11021
|
+
},
|
|
11022
|
+
{
|
|
11023
|
+
"name": "finalPriceWithQuantity",
|
|
11024
|
+
"type": "number",
|
|
11025
|
+
"optional": false
|
|
11026
|
+
},
|
|
11027
|
+
{
|
|
11028
|
+
"name": "formattedSellPrice",
|
|
11029
|
+
"type": "string",
|
|
11030
|
+
"optional": false
|
|
11031
|
+
},
|
|
11032
|
+
{
|
|
11033
|
+
"name": "formattedSellPriceWithQuantity",
|
|
11034
|
+
"type": "string",
|
|
11035
|
+
"optional": false
|
|
11036
|
+
},
|
|
11037
|
+
{
|
|
11038
|
+
"name": "formattedFinalPrice",
|
|
11039
|
+
"type": "string",
|
|
11040
|
+
"optional": false
|
|
11041
|
+
},
|
|
11042
|
+
{
|
|
11043
|
+
"name": "formattedFinalPriceWithQuantity",
|
|
11044
|
+
"type": "string",
|
|
11045
|
+
"optional": false
|
|
11046
|
+
},
|
|
11047
|
+
{
|
|
11048
|
+
"name": "salesChannelIds",
|
|
11049
|
+
"type": "string[] | null",
|
|
11050
|
+
"optional": false
|
|
11051
|
+
}
|
|
11052
|
+
],
|
|
11053
|
+
"filePath": "product/variant/index.ts",
|
|
11054
|
+
"relatedFunctions": [
|
|
11055
|
+
"getProductVariantTieredDiscountProducts"
|
|
11056
|
+
]
|
|
11057
|
+
},
|
|
10986
11058
|
{
|
|
10987
11059
|
"name": "IkasProductPrice",
|
|
10988
11060
|
"kind": "type",
|