@ikas/code-components-mcp 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/storefront-api.json +166 -1
- package/data/storefront-types.json +8 -1
- package/package.json +1 -1
package/data/storefront-api.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-10-
|
|
2
|
+
"generatedAt": "2026-10-14T08:11:46.617Z",
|
|
3
3
|
"functions": [
|
|
4
4
|
{
|
|
5
5
|
"name": "apiListProductBrand",
|
|
@@ -13507,6 +13507,171 @@
|
|
|
13507
13507
|
"IkasCustomerStore"
|
|
13508
13508
|
]
|
|
13509
13509
|
},
|
|
13510
|
+
{
|
|
13511
|
+
"name": "milesSmilesBind",
|
|
13512
|
+
"signature": "async function milesSmilesBind(customerStore: IkasCustomerStore, redirect?: string | null): Promise<MilesSmilesBindResult>",
|
|
13513
|
+
"description": "Start the Turkish Airlines Miles&Smiles account bind flow for the logged-in customer.\nOpens the THY login page in a popup; once THY confirms, the browser is sent to the\nikas bind callback and lands back on `redirect` with `milesSmilesStatus` query params\n(see handleMilesSmilesBind). Binding is required before miles can be spent at checkout.",
|
|
13514
|
+
"params": [
|
|
13515
|
+
{
|
|
13516
|
+
"name": "customerStore",
|
|
13517
|
+
"description": "- The customer store instance (customer must be logged in)"
|
|
13518
|
+
},
|
|
13519
|
+
{
|
|
13520
|
+
"name": "redirect",
|
|
13521
|
+
"description": "- Relative store path to land on after bind, e.g. \"/account\" or \"/checkout?id=...&step=payment\""
|
|
13522
|
+
}
|
|
13523
|
+
],
|
|
13524
|
+
"returns": "`isSuccess: true` when the bind hand-off started; otherwise an `errorCode`\nsuch as \"AUTHORIZATION_REQUIRED\" or \"MILES_SMILES_LOGIN_CANCELLED_OR_FAILED\"",
|
|
13525
|
+
"returnType": "Promise<MilesSmilesBindResult>",
|
|
13526
|
+
"example": "```typescript\nimport { customerStore, milesSmilesBind } from \"@ikas/bp-storefront\";\n\nasync function onLinkClick() {\n const result = await milesSmilesBind(customerStore, \"/account\");\n if (!result.isSuccess) showToast(result.errorCode || \"UNEXPECTED_ERROR\");\n}\n```",
|
|
13527
|
+
"categories": [
|
|
13528
|
+
"Customer",
|
|
13529
|
+
"Miles&Smiles"
|
|
13530
|
+
],
|
|
13531
|
+
"related": [
|
|
13532
|
+
"handleMilesSmilesBind",
|
|
13533
|
+
"getMilesSmilesLink",
|
|
13534
|
+
"unlinkMilesSmiles",
|
|
13535
|
+
"getMilesSmilesDetails"
|
|
13536
|
+
],
|
|
13537
|
+
"isAsync": true,
|
|
13538
|
+
"isClass": false,
|
|
13539
|
+
"parameterTypes": [
|
|
13540
|
+
"IkasCustomerStore"
|
|
13541
|
+
]
|
|
13542
|
+
},
|
|
13543
|
+
{
|
|
13544
|
+
"name": "handleMilesSmilesBind",
|
|
13545
|
+
"signature": "function handleMilesSmilesBind(clear: boolean = true): HandleMilesSmilesBindReturnType | null",
|
|
13546
|
+
"description": "Read the Miles&Smiles bind result from the current URL after THY redirects back\n(`?milesSmilesStatus=success` or `?milesSmilesStatus=fail&milesSmilesError=CODE`).\nCall this on the landing page (account or checkout). The params are removed from the\nURL so a refresh does not repeat the same message.",
|
|
13547
|
+
"params": [
|
|
13548
|
+
{
|
|
13549
|
+
"name": "clear",
|
|
13550
|
+
"description": "- Remove the params from the URL with history.replaceState (default: true)"
|
|
13551
|
+
}
|
|
13552
|
+
],
|
|
13553
|
+
"returns": "The landing result, or null when the URL carries no bind result",
|
|
13554
|
+
"returnType": "HandleMilesSmilesBindReturnType | null",
|
|
13555
|
+
"example": "```typescript\nimport { handleMilesSmilesBind } from \"@ikas/bp-storefront\";\n\nuseEffect(() => {\n const result = handleMilesSmilesBind();\n if (result?.status === \"success\") showToast(\"Miles&Smiles account linked\");\n if (result?.status === \"fail\") showToast(result.errorCode || \"Bind failed\");\n}, []);\n```",
|
|
13556
|
+
"categories": [
|
|
13557
|
+
"Customer",
|
|
13558
|
+
"Miles&Smiles"
|
|
13559
|
+
],
|
|
13560
|
+
"related": [
|
|
13561
|
+
"milesSmilesBind",
|
|
13562
|
+
"getMilesSmilesLink"
|
|
13563
|
+
],
|
|
13564
|
+
"isAsync": false,
|
|
13565
|
+
"isClass": false
|
|
13566
|
+
},
|
|
13567
|
+
{
|
|
13568
|
+
"name": "getMilesSmilesLink",
|
|
13569
|
+
"signature": "async function getMilesSmilesLink(customerStore: IkasCustomerStore): Promise<APIResponse<ExternalAccountLink | null>>",
|
|
13570
|
+
"description": "Get the customer's durable Miles&Smiles link (TK membership number and link date).\nA link does not guarantee a live checkout session; when getMilesSmilesDetails returns\nMILES_SMILES_LOGIN_REQUIRED, run milesSmilesBind again.",
|
|
13571
|
+
"params": [
|
|
13572
|
+
{
|
|
13573
|
+
"name": "customerStore",
|
|
13574
|
+
"description": "- The customer store instance"
|
|
13575
|
+
}
|
|
13576
|
+
],
|
|
13577
|
+
"returns": "API response whose data is the link, or null when not linked",
|
|
13578
|
+
"returnType": "Promise<APIResponse<ExternalAccountLink | null>>",
|
|
13579
|
+
"example": "```typescript\nimport { customerStore, getMilesSmilesLink } from \"@ikas/bp-storefront\";\n\nconst response = await getMilesSmilesLink(customerStore);\nconst tkNumber = response.data?.externalId;\n```",
|
|
13580
|
+
"categories": [
|
|
13581
|
+
"Customer",
|
|
13582
|
+
"Miles&Smiles"
|
|
13583
|
+
],
|
|
13584
|
+
"related": [
|
|
13585
|
+
"milesSmilesBind",
|
|
13586
|
+
"unlinkMilesSmiles"
|
|
13587
|
+
],
|
|
13588
|
+
"isAsync": true,
|
|
13589
|
+
"isClass": false,
|
|
13590
|
+
"parameterTypes": [
|
|
13591
|
+
"IkasCustomerStore"
|
|
13592
|
+
]
|
|
13593
|
+
},
|
|
13594
|
+
{
|
|
13595
|
+
"name": "unlinkMilesSmiles",
|
|
13596
|
+
"signature": "async function unlinkMilesSmiles(customerStore: IkasCustomerStore): Promise<APIResponse<boolean>>",
|
|
13597
|
+
"description": "Remove the customer's Miles&Smiles link. Also clears the server-side checkout\nsession token, so miles cannot be spent until the customer binds again.",
|
|
13598
|
+
"params": [
|
|
13599
|
+
{
|
|
13600
|
+
"name": "customerStore",
|
|
13601
|
+
"description": "- The customer store instance"
|
|
13602
|
+
}
|
|
13603
|
+
],
|
|
13604
|
+
"returns": "API response whose data is true on success",
|
|
13605
|
+
"returnType": "Promise<APIResponse<boolean>>",
|
|
13606
|
+
"example": "```typescript\nimport { customerStore, unlinkMilesSmiles } from \"@ikas/bp-storefront\";\n\nconst response = await unlinkMilesSmiles(customerStore);\nif (response.isSuccess) showToast(\"Miles&Smiles link removed\");\n```",
|
|
13607
|
+
"categories": [
|
|
13608
|
+
"Customer",
|
|
13609
|
+
"Miles&Smiles"
|
|
13610
|
+
],
|
|
13611
|
+
"related": [
|
|
13612
|
+
"milesSmilesBind",
|
|
13613
|
+
"getMilesSmilesLink"
|
|
13614
|
+
],
|
|
13615
|
+
"isAsync": true,
|
|
13616
|
+
"isClass": false,
|
|
13617
|
+
"parameterTypes": [
|
|
13618
|
+
"IkasCustomerStore"
|
|
13619
|
+
]
|
|
13620
|
+
},
|
|
13621
|
+
{
|
|
13622
|
+
"name": "getMilesSmilesDetails",
|
|
13623
|
+
"signature": "async function getMilesSmilesDetails(customerStore: IkasCustomerStore): Promise<APIResponse<MilesSmilesDetailsResponse | undefined>>",
|
|
13624
|
+
"description": "Get the Miles&Smiles balance and member details for the payment step.\nRequires a recent bind; MILES_SMILES_LOGIN_REQUIRED means the short-lived session\nexpired and milesSmilesBind should be run again. MILES_SMILES_NOT_ENABLED and\nPAYMENT_GATEWAY_NOT_FOUND mean the Miles UI should be hidden.",
|
|
13625
|
+
"params": [
|
|
13626
|
+
{
|
|
13627
|
+
"name": "customerStore",
|
|
13628
|
+
"description": "- The customer store instance"
|
|
13629
|
+
}
|
|
13630
|
+
],
|
|
13631
|
+
"returns": "API response whose data holds availableMiles, memberId, firstName and lastName",
|
|
13632
|
+
"returnType": "Promise<APIResponse<MilesSmilesDetailsResponse | undefined>>",
|
|
13633
|
+
"example": "```typescript\nimport { customerStore, getMilesSmilesDetails } from \"@ikas/bp-storefront\";\n\nconst response = await getMilesSmilesDetails(customerStore);\nif (response.errorCodes.includes(\"MILES_SMILES_LOGIN_REQUIRED\")) {\n await milesSmilesBind(customerStore, window.location.pathname + window.location.search);\n} else if (response.data) {\n console.log(\"Available miles:\", response.data.availableMiles);\n}\n```",
|
|
13634
|
+
"categories": [
|
|
13635
|
+
"Customer",
|
|
13636
|
+
"Miles&Smiles"
|
|
13637
|
+
],
|
|
13638
|
+
"related": [
|
|
13639
|
+
"milesSmilesBind",
|
|
13640
|
+
"getMilesSmilesLink"
|
|
13641
|
+
],
|
|
13642
|
+
"isAsync": true,
|
|
13643
|
+
"isClass": false,
|
|
13644
|
+
"parameterTypes": [
|
|
13645
|
+
"IkasCustomerStore"
|
|
13646
|
+
]
|
|
13647
|
+
},
|
|
13648
|
+
{
|
|
13649
|
+
"name": "isMilesSmilesTransaction",
|
|
13650
|
+
"signature": "function isMilesSmilesTransaction(transaction: IkasOrderTransaction): boolean",
|
|
13651
|
+
"description": "Check whether an order transaction is the Miles&Smiles leg of a multi-tender payment.\nSuch rows are written on the synthetic MILES_SMILES gateway and are not refundable from the storefront.",
|
|
13652
|
+
"params": [
|
|
13653
|
+
{
|
|
13654
|
+
"name": "transaction",
|
|
13655
|
+
"description": "- The order transaction to check"
|
|
13656
|
+
}
|
|
13657
|
+
],
|
|
13658
|
+
"returns": "True when the transaction is a Miles&Smiles SALE",
|
|
13659
|
+
"returnType": "boolean",
|
|
13660
|
+
"example": "```typescript\nimport { isMilesSmilesTransaction } from \"@ikas/bp-storefront\";\n\nconst label = isMilesSmilesTransaction(tx) ? \"Miles&Smiles\" : tx.paymentGatewayName;\n```",
|
|
13661
|
+
"categories": [
|
|
13662
|
+
"Customer",
|
|
13663
|
+
"Orders",
|
|
13664
|
+
"Miles&Smiles"
|
|
13665
|
+
],
|
|
13666
|
+
"related": [
|
|
13667
|
+
"getOrderTransactions"
|
|
13668
|
+
],
|
|
13669
|
+
"isAsync": false,
|
|
13670
|
+
"isClass": false,
|
|
13671
|
+
"parameterTypes": [
|
|
13672
|
+
"IkasOrderTransaction"
|
|
13673
|
+
]
|
|
13674
|
+
},
|
|
13510
13675
|
{
|
|
13511
13676
|
"name": "deleteCustomerAddress",
|
|
13512
13677
|
"signature": "async function deleteCustomerAddress(customerStore: IkasCustomerStore, address: IkasCustomerAddress): Promise<boolean>",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-10-
|
|
2
|
+
"generatedAt": "2026-10-14T08:11:46.690Z",
|
|
3
3
|
"types": [
|
|
4
4
|
{
|
|
5
5
|
"name": "TextElementTagTypes",
|
|
@@ -8078,6 +8078,7 @@
|
|
|
8078
8078
|
"relatedFunctions": [
|
|
8079
8079
|
"getOrderTransactionFormattedAmount",
|
|
8080
8080
|
"getOrderTransactionPaymentMethodTranslation",
|
|
8081
|
+
"isMilesSmilesTransaction",
|
|
8081
8082
|
"getOrderTransactions"
|
|
8082
8083
|
]
|
|
8083
8084
|
},
|
|
@@ -8319,6 +8320,12 @@
|
|
|
8319
8320
|
"type": "string | null",
|
|
8320
8321
|
"optional": false
|
|
8321
8322
|
},
|
|
8323
|
+
{
|
|
8324
|
+
"name": "milesSmilesEnabled",
|
|
8325
|
+
"type": "boolean | null",
|
|
8326
|
+
"optional": true,
|
|
8327
|
+
"description": "True when Miles&Smiles can be redeemed on this (TK_PAY) gateway."
|
|
8328
|
+
},
|
|
8322
8329
|
{
|
|
8323
8330
|
"name": "name",
|
|
8324
8331
|
"type": "string",
|