@solvapay/mcp-core 0.2.7 → 0.3.0-preview-e2cd9bda9dee33e68f6bba7098f7d683e6f1b742
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/dist/index.cjs +40 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +41 -0
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -93,6 +93,7 @@ var MCP_TOOL_NAMES = {
|
|
|
93
93
|
activatePlan: "activate_plan",
|
|
94
94
|
createCheckoutSession: "create_checkout_session",
|
|
95
95
|
createCustomerSession: "create_customer_session",
|
|
96
|
+
attachBusinessDetails: "attach_business_details",
|
|
96
97
|
upgrade: "upgrade",
|
|
97
98
|
manageAccount: "manage_account",
|
|
98
99
|
topup: "topup"
|
|
@@ -1027,6 +1028,45 @@ function buildSolvaPayDescriptors(options) {
|
|
|
1027
1028
|
return toolResult(result);
|
|
1028
1029
|
})
|
|
1029
1030
|
});
|
|
1031
|
+
pushTool({
|
|
1032
|
+
name: MCP_TOOL_NAMES.attachBusinessDetails,
|
|
1033
|
+
description: UI_ONLY_PREFIX + "Attach business purchase details to a payment intent and retrieve the computed tax breakdown.",
|
|
1034
|
+
inputSchema: {
|
|
1035
|
+
paymentIntentId: import_zod.z.string(),
|
|
1036
|
+
isBusiness: import_zod.z.boolean(),
|
|
1037
|
+
businessName: import_zod.z.string().optional(),
|
|
1038
|
+
country: import_zod.z.string().optional(),
|
|
1039
|
+
taxId: import_zod.z.string().optional(),
|
|
1040
|
+
taxIdType: import_zod.z.enum(["eu_vat", "gb_vat", "us_ein"]).optional()
|
|
1041
|
+
},
|
|
1042
|
+
meta: uiToolMeta,
|
|
1043
|
+
annotations: solvapayTool({}),
|
|
1044
|
+
handler: async (args, extra) => trace(MCP_TOOL_NAMES.attachBusinessDetails, args, extra, async () => {
|
|
1045
|
+
const auth = requireCustomerRef(extra);
|
|
1046
|
+
if (typeof auth !== "string") return auth;
|
|
1047
|
+
const paymentIntentId = typeof args.paymentIntentId === "string" ? args.paymentIntentId : "";
|
|
1048
|
+
const isBusiness = args.isBusiness === true;
|
|
1049
|
+
const businessName = typeof args.businessName === "string" ? args.businessName : void 0;
|
|
1050
|
+
const country = typeof args.country === "string" ? args.country : void 0;
|
|
1051
|
+
const taxId = typeof args.taxId === "string" ? args.taxId : void 0;
|
|
1052
|
+
const taxIdType = args.taxIdType === "eu_vat" || args.taxIdType === "gb_vat" || args.taxIdType === "us_ein" ? args.taxIdType : void 0;
|
|
1053
|
+
const result = await (0, import_server3.attachBusinessDetailsCore)(
|
|
1054
|
+
buildRequest(extra, { method: "POST" }),
|
|
1055
|
+
{
|
|
1056
|
+
paymentIntentId,
|
|
1057
|
+
customerRef: auth,
|
|
1058
|
+
isBusiness,
|
|
1059
|
+
...businessName !== void 0 && { businessName },
|
|
1060
|
+
...country !== void 0 && { country },
|
|
1061
|
+
...taxId !== void 0 && { taxId },
|
|
1062
|
+
...taxIdType !== void 0 && { taxIdType }
|
|
1063
|
+
},
|
|
1064
|
+
{ solvaPay }
|
|
1065
|
+
);
|
|
1066
|
+
if ((0, import_server3.isErrorResult)(result)) return toolErrorResult(result);
|
|
1067
|
+
return toolResult(result);
|
|
1068
|
+
})
|
|
1069
|
+
});
|
|
1030
1070
|
pushTool({
|
|
1031
1071
|
name: MCP_TOOL_NAMES.cancelRenewal,
|
|
1032
1072
|
description: UI_ONLY_PREFIX + "Cancel the auto-renewal on an active purchase. Backend keeps access until the current period ends.",
|
package/dist/index.d.cts
CHANGED
|
@@ -18,6 +18,7 @@ declare const MCP_TOOL_NAMES: {
|
|
|
18
18
|
readonly activatePlan: "activate_plan";
|
|
19
19
|
readonly createCheckoutSession: "create_checkout_session";
|
|
20
20
|
readonly createCustomerSession: "create_customer_session";
|
|
21
|
+
readonly attachBusinessDetails: "attach_business_details";
|
|
21
22
|
readonly upgrade: "upgrade";
|
|
22
23
|
readonly manageAccount: "manage_account";
|
|
23
24
|
readonly topup: "topup";
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare const MCP_TOOL_NAMES: {
|
|
|
18
18
|
readonly activatePlan: "activate_plan";
|
|
19
19
|
readonly createCheckoutSession: "create_checkout_session";
|
|
20
20
|
readonly createCustomerSession: "create_customer_session";
|
|
21
|
+
readonly attachBusinessDetails: "attach_business_details";
|
|
21
22
|
readonly upgrade: "upgrade";
|
|
22
23
|
readonly manageAccount: "manage_account";
|
|
23
24
|
readonly topup: "topup";
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ var MCP_TOOL_NAMES = {
|
|
|
8
8
|
activatePlan: "activate_plan",
|
|
9
9
|
createCheckoutSession: "create_checkout_session",
|
|
10
10
|
createCustomerSession: "create_customer_session",
|
|
11
|
+
attachBusinessDetails: "attach_business_details",
|
|
11
12
|
upgrade: "upgrade",
|
|
12
13
|
manageAccount: "manage_account",
|
|
13
14
|
topup: "topup"
|
|
@@ -536,6 +537,7 @@ import {
|
|
|
536
537
|
createCustomerSessionCore,
|
|
537
538
|
createPaymentIntentCore,
|
|
538
539
|
createTopupPaymentIntentCore,
|
|
540
|
+
attachBusinessDetailsCore,
|
|
539
541
|
isErrorResult as isErrorResult2,
|
|
540
542
|
processPaymentIntentCore,
|
|
541
543
|
reactivatePurchaseCore
|
|
@@ -965,6 +967,45 @@ function buildSolvaPayDescriptors(options) {
|
|
|
965
967
|
return toolResult(result);
|
|
966
968
|
})
|
|
967
969
|
});
|
|
970
|
+
pushTool({
|
|
971
|
+
name: MCP_TOOL_NAMES.attachBusinessDetails,
|
|
972
|
+
description: UI_ONLY_PREFIX + "Attach business purchase details to a payment intent and retrieve the computed tax breakdown.",
|
|
973
|
+
inputSchema: {
|
|
974
|
+
paymentIntentId: z.string(),
|
|
975
|
+
isBusiness: z.boolean(),
|
|
976
|
+
businessName: z.string().optional(),
|
|
977
|
+
country: z.string().optional(),
|
|
978
|
+
taxId: z.string().optional(),
|
|
979
|
+
taxIdType: z.enum(["eu_vat", "gb_vat", "us_ein"]).optional()
|
|
980
|
+
},
|
|
981
|
+
meta: uiToolMeta,
|
|
982
|
+
annotations: solvapayTool({}),
|
|
983
|
+
handler: async (args, extra) => trace(MCP_TOOL_NAMES.attachBusinessDetails, args, extra, async () => {
|
|
984
|
+
const auth = requireCustomerRef(extra);
|
|
985
|
+
if (typeof auth !== "string") return auth;
|
|
986
|
+
const paymentIntentId = typeof args.paymentIntentId === "string" ? args.paymentIntentId : "";
|
|
987
|
+
const isBusiness = args.isBusiness === true;
|
|
988
|
+
const businessName = typeof args.businessName === "string" ? args.businessName : void 0;
|
|
989
|
+
const country = typeof args.country === "string" ? args.country : void 0;
|
|
990
|
+
const taxId = typeof args.taxId === "string" ? args.taxId : void 0;
|
|
991
|
+
const taxIdType = args.taxIdType === "eu_vat" || args.taxIdType === "gb_vat" || args.taxIdType === "us_ein" ? args.taxIdType : void 0;
|
|
992
|
+
const result = await attachBusinessDetailsCore(
|
|
993
|
+
buildRequest(extra, { method: "POST" }),
|
|
994
|
+
{
|
|
995
|
+
paymentIntentId,
|
|
996
|
+
customerRef: auth,
|
|
997
|
+
isBusiness,
|
|
998
|
+
...businessName !== void 0 && { businessName },
|
|
999
|
+
...country !== void 0 && { country },
|
|
1000
|
+
...taxId !== void 0 && { taxId },
|
|
1001
|
+
...taxIdType !== void 0 && { taxIdType }
|
|
1002
|
+
},
|
|
1003
|
+
{ solvaPay }
|
|
1004
|
+
);
|
|
1005
|
+
if (isErrorResult2(result)) return toolErrorResult(result);
|
|
1006
|
+
return toolResult(result);
|
|
1007
|
+
})
|
|
1008
|
+
});
|
|
968
1009
|
pushTool({
|
|
969
1010
|
name: MCP_TOOL_NAMES.cancelRenewal,
|
|
970
1011
|
description: UI_ONLY_PREFIX + "Cancel the auto-renewal on an active purchase. Backend keeps access until the current period ends.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solvapay/mcp-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-preview-e2cd9bda9dee33e68f6bba7098f7d683e6f1b742",
|
|
4
4
|
"description": "Framework-neutral MCP contracts for the SolvaPay SDK (tool names, descriptors, payable handler, paywall meta, CSP, bootstrap payload, OAuth discovery JSON builders, bearer/JWT helpers).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
},
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@solvapay/core": "1.
|
|
33
|
+
"@solvapay/core": "1.2.0-preview-e2cd9bda9dee33e68f6bba7098f7d683e6f1b742"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"zod": "^3.25.0 || ^4.0.0",
|
|
37
|
-
"@solvapay/server": "^1.
|
|
37
|
+
"@solvapay/server": "^1.4.0-preview-e2cd9bda9dee33e68f6bba7098f7d683e6f1b742"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"tsup": "^8.5.1",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
42
|
"vitest": "^4.1.2",
|
|
43
43
|
"zod": "^4.3.6",
|
|
44
|
-
"@solvapay/server": "1.
|
|
44
|
+
"@solvapay/server": "1.4.0-preview-e2cd9bda9dee33e68f6bba7098f7d683e6f1b742",
|
|
45
45
|
"@solvapay/test-utils": "^0.0.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|