@getcheddar/cheddar-mcp 1.0.5 → 2.0.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/README.md +49 -337
- package/bin/cheddar-mcp.mjs +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -52
- package/dist/index.js.map +1 -1
- package/dist/lib/legacy-client.d.ts +44 -0
- package/dist/lib/legacy-client.d.ts.map +1 -0
- package/dist/lib/legacy-client.js +149 -0
- package/dist/lib/legacy-client.js.map +1 -0
- package/dist/tools/customers.d.ts +2 -2
- package/dist/tools/customers.d.ts.map +1 -1
- package/dist/tools/customers.js +103 -103
- package/dist/tools/customers.js.map +1 -1
- package/dist/tools/plans.d.ts +10 -0
- package/dist/tools/plans.d.ts.map +1 -0
- package/dist/tools/plans.js +26 -0
- package/dist/tools/plans.js.map +1 -0
- package/package.json +8 -7
- package/dist/lib/cheddar-client.d.ts +0 -111
- package/dist/lib/cheddar-client.d.ts.map +0 -1
- package/dist/lib/cheddar-client.js +0 -101
- package/dist/lib/cheddar-client.js.map +0 -1
- package/dist/tools/checkout.d.ts +0 -10
- package/dist/tools/checkout.d.ts.map +0 -1
- package/dist/tools/checkout.js +0 -641
- package/dist/tools/checkout.js.map +0 -1
- package/dist/tools/payment-methods.d.ts +0 -10
- package/dist/tools/payment-methods.d.ts.map +0 -1
- package/dist/tools/payment-methods.js +0 -162
- package/dist/tools/payment-methods.js.map +0 -1
- package/dist/tools/subscriptions.d.ts +0 -10
- package/dist/tools/subscriptions.d.ts.map +0 -1
- package/dist/tools/subscriptions.js +0 -191
- package/dist/tools/subscriptions.js.map +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { XMLParser } from "fast-xml-parser";
|
|
2
|
+
function trimSlash(s) {
|
|
3
|
+
return s.replace(/\/+$/, "");
|
|
4
|
+
}
|
|
5
|
+
function basicAuthHeader(username, password) {
|
|
6
|
+
const token = Buffer.from(`${username}:${password}`, "utf8").toString("base64");
|
|
7
|
+
return `Basic ${token}`;
|
|
8
|
+
}
|
|
9
|
+
const xmlParser = new XMLParser({
|
|
10
|
+
ignoreAttributes: false,
|
|
11
|
+
attributeNamePrefix: "@_",
|
|
12
|
+
});
|
|
13
|
+
export class LegacyCheddarClient {
|
|
14
|
+
base;
|
|
15
|
+
productCode;
|
|
16
|
+
auth;
|
|
17
|
+
constructor(cfg) {
|
|
18
|
+
this.base = trimSlash(cfg.baseUrl);
|
|
19
|
+
this.productCode = encodeURIComponent(cfg.productCode);
|
|
20
|
+
this.auth = basicAuthHeader(cfg.username, cfg.password);
|
|
21
|
+
}
|
|
22
|
+
async parseBody(res) {
|
|
23
|
+
const text = await res.text();
|
|
24
|
+
const ct = res.headers.get("content-type") || "";
|
|
25
|
+
if (ct.includes("json") || (text.startsWith("{") && text.endsWith("}"))) {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(text);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
/* fall through */
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
return xmlParser.parse(text);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return { _raw: text };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* GET legacy XML (or JSON if the endpoint supports `format=json`).
|
|
42
|
+
*/
|
|
43
|
+
async get(pathWithLeadingSlash, query) {
|
|
44
|
+
const q = new URLSearchParams(query);
|
|
45
|
+
const qs = q.toString();
|
|
46
|
+
const url = `${this.base}${pathWithLeadingSlash}${qs ? `?${qs}` : ""}`;
|
|
47
|
+
const res = await fetch(url, {
|
|
48
|
+
method: "GET",
|
|
49
|
+
headers: {
|
|
50
|
+
Authorization: this.auth,
|
|
51
|
+
Accept: "application/xml, application/json;q=0.9, text/xml;q=0.8, */*;q=0.1",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
const body = await this.parseBody(res);
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
throw new LegacyApiError(res.status, body);
|
|
57
|
+
}
|
|
58
|
+
return body;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* POST `application/x-www-form-urlencoded` (legacy API style).
|
|
62
|
+
*/
|
|
63
|
+
async postForm(pathWithLeadingSlash, fields) {
|
|
64
|
+
const url = `${this.base}${pathWithLeadingSlash}`;
|
|
65
|
+
const body = new URLSearchParams(fields);
|
|
66
|
+
const res = await fetch(url, {
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers: {
|
|
69
|
+
Authorization: this.auth,
|
|
70
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
71
|
+
Accept: "application/xml, application/json;q=0.9, text/xml;q=0.8, */*;q=0.1",
|
|
72
|
+
},
|
|
73
|
+
body,
|
|
74
|
+
});
|
|
75
|
+
const parsed = await this.parseBody(res);
|
|
76
|
+
if (!res.ok) {
|
|
77
|
+
throw new LegacyApiError(res.status, parsed);
|
|
78
|
+
}
|
|
79
|
+
return parsed;
|
|
80
|
+
}
|
|
81
|
+
async ping() {
|
|
82
|
+
return this.get(`/xml/plans/get/productCode/${this.productCode}`);
|
|
83
|
+
}
|
|
84
|
+
async getCustomer(by, value) {
|
|
85
|
+
const v = encodeURIComponent(value);
|
|
86
|
+
return this.get(`/xml/customers/get/productCode/${this.productCode}/${by}/${v}`);
|
|
87
|
+
}
|
|
88
|
+
async searchCustomers(params) {
|
|
89
|
+
return this.get(`/xml/customers/search/productCode/${this.productCode}`, {
|
|
90
|
+
...params,
|
|
91
|
+
format: "json",
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async getPlans(planCode) {
|
|
95
|
+
if (planCode) {
|
|
96
|
+
return this.get(`/xml/plans/get/productCode/${this.productCode}/code/${encodeURIComponent(planCode)}`);
|
|
97
|
+
}
|
|
98
|
+
return this.get(`/xml/plans/get/productCode/${this.productCode}`);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Flat object keys become form keys; nested objects use bracket notation (subscription[planCode]).
|
|
102
|
+
*/
|
|
103
|
+
async createCustomer(fields) {
|
|
104
|
+
const flat = flattenFormFields(fields);
|
|
105
|
+
return this.postForm(`/xml/customers/new/productCode/${this.productCode}`, flat);
|
|
106
|
+
}
|
|
107
|
+
async updateCustomer(customerCode, fields) {
|
|
108
|
+
const flat = flattenFormFields(fields);
|
|
109
|
+
return this.postForm(`/xml/customers/edit/productCode/${this.productCode}/code/${encodeURIComponent(customerCode)}`, flat);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export class LegacyApiError extends Error {
|
|
113
|
+
status;
|
|
114
|
+
body;
|
|
115
|
+
constructor(status, body) {
|
|
116
|
+
super(`Cheddar legacy API request failed (HTTP ${status}).`);
|
|
117
|
+
this.name = "LegacyApiError";
|
|
118
|
+
this.status = status;
|
|
119
|
+
this.body = body;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Flattens `{ firstName: "a", subscription: { planCode: "FREE" } }` into
|
|
124
|
+
* `firstName`, `subscription[planCode]` for legacy form posts.
|
|
125
|
+
*/
|
|
126
|
+
export function flattenFormFields(obj, prefix = "") {
|
|
127
|
+
const out = {};
|
|
128
|
+
for (const [k, val] of Object.entries(obj)) {
|
|
129
|
+
if (val === undefined || val === null)
|
|
130
|
+
continue;
|
|
131
|
+
const key = prefix ? `${prefix}[${k}]` : k;
|
|
132
|
+
if (typeof val === "object" && !Array.isArray(val)) {
|
|
133
|
+
Object.assign(out, flattenFormFields(val, key));
|
|
134
|
+
}
|
|
135
|
+
else if (Array.isArray(val)) {
|
|
136
|
+
val.forEach((item, i) => {
|
|
137
|
+
out[`${key}[${i}]`] = String(item);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
else if (typeof val === "boolean") {
|
|
141
|
+
out[key] = val ? "1" : "0";
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
out[key] = String(val);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=legacy-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-client.js","sourceRoot":"","sources":["../../src/lib/legacy-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5C,SAAS,SAAS,CAAC,CAAS;IAC1B,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,eAAe,CAAC,QAAgB,EAAE,QAAgB;IACzD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAChF,OAAO,SAAS,KAAK,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC;IAC9B,gBAAgB,EAAE,KAAK;IACvB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAC;AAEH,MAAM,OAAO,mBAAmB;IACb,IAAI,CAAS;IACb,WAAW,CAAS;IACpB,IAAI,CAAS;IAE9B,YAAY,GAAwB;QAClC,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAEO,KAAK,CAAC,SAAS,CAAC,GAAa;QACnC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,I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K,SAAS,IAAI,GAAG,KAAK,IAAI;YAAE,SAAS;QAChD,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,iBAAiB,CAAC,GAA8B,EAAE,GAAG,CAAC,CAAC,CAAC;QAC7E,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;gBACtB,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE,CAAC;YACpC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import {
|
|
2
|
+
import { LegacyCheddarClient } from "../lib/legacy-client.js";
|
|
3
3
|
export declare const customerTools: Tool[];
|
|
4
|
-
export declare function handleCustomerTool(client:
|
|
4
|
+
export declare function handleCustomerTool(client: LegacyCheddarClient, name: string, args: Record<string, unknown> | undefined): Promise<{
|
|
5
5
|
content: Array<{
|
|
6
6
|
type: string;
|
|
7
7
|
text: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/tools/customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/tools/customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,aAAa,EAAE,IAAI,EAkG/B,CAAC;AAQF,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACxC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA6C7D"}
|
package/dist/tools/customers.js
CHANGED
|
@@ -1,59 +1,67 @@
|
|
|
1
1
|
export const customerTools = [
|
|
2
2
|
{
|
|
3
3
|
name: "cheddar_customer_get",
|
|
4
|
-
description: "
|
|
4
|
+
description: "Fetch one customer via the legacy Cheddar API (HTTP Basic). Use customer code or CG customer id.",
|
|
5
5
|
inputSchema: {
|
|
6
6
|
type: "object",
|
|
7
7
|
properties: {
|
|
8
|
-
|
|
8
|
+
lookup: {
|
|
9
9
|
type: "string",
|
|
10
|
-
|
|
10
|
+
enum: ["code", "id"],
|
|
11
|
+
description: "Whether `value` is the customer code or internal id",
|
|
12
|
+
},
|
|
13
|
+
value: {
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "Customer code or id",
|
|
11
16
|
},
|
|
12
17
|
},
|
|
13
|
-
required: ["
|
|
18
|
+
required: ["lookup", "value"],
|
|
14
19
|
},
|
|
15
20
|
},
|
|
16
21
|
{
|
|
17
|
-
name: "
|
|
18
|
-
description: "
|
|
22
|
+
name: "cheddar_customers_search",
|
|
23
|
+
description: "Search customers (legacy API). Supports text search and common filters; see GetCheddar docs for query parameters.",
|
|
19
24
|
inputSchema: {
|
|
20
25
|
type: "object",
|
|
21
26
|
properties: {
|
|
22
|
-
|
|
27
|
+
search: { type: "string", description: "Free-text search" },
|
|
28
|
+
subscriptionStatus: {
|
|
23
29
|
type: "string",
|
|
24
|
-
|
|
30
|
+
enum: ["activeOnly", "canceledOnly"],
|
|
25
31
|
},
|
|
26
|
-
|
|
32
|
+
orderBy: {
|
|
27
33
|
type: "string",
|
|
28
|
-
|
|
34
|
+
enum: ["name", "company", "plan", "billingDatetime", "createdDatetime"],
|
|
29
35
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type: "string",
|
|
36
|
-
description: "
|
|
36
|
+
orderByDirection: { type: "string", enum: ["asc", "desc"] },
|
|
37
|
+
createdAfterDate: { type: "string", description: "YYYY-MM-DD" },
|
|
38
|
+
createdBeforeDate: { type: "string", description: "YYYY-MM-DD" },
|
|
39
|
+
planCode: {
|
|
40
|
+
type: "array",
|
|
41
|
+
items: { type: "string" },
|
|
42
|
+
description: "Filter by one or more plan codes",
|
|
37
43
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "cheddar_customer_create",
|
|
49
|
+
description: "Create a customer (legacy POST). Pass top-level fields and optional `subscription` per [GetCheddar docs](https://docs.getcheddar.com/). Prefer hosted checkout or `gatewayToken` flows for card data—do not send raw PAN/CVV through this tool.",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
code: { type: "string", description: "Required unique customer code" },
|
|
54
|
+
firstName: { type: "string" },
|
|
55
|
+
lastName: { type: "string" },
|
|
56
|
+
email: { type: "string" },
|
|
57
|
+
company: { type: "string" },
|
|
58
|
+
notes: { type: "string" },
|
|
59
|
+
taxRate: { type: "string" },
|
|
60
|
+
isTaxExempt: { type: "boolean" },
|
|
61
|
+
taxNumber: { type: "string" },
|
|
62
|
+
subscription: {
|
|
63
|
+
type: "object",
|
|
64
|
+
description: "Nested subscription fields allowed by the legacy API (e.g. planCode). Avoid raw card numbers; use processor tokenization or hosted collection.",
|
|
57
65
|
},
|
|
58
66
|
},
|
|
59
67
|
required: ["code"],
|
|
@@ -61,90 +69,82 @@ export const customerTools = [
|
|
|
61
69
|
},
|
|
62
70
|
{
|
|
63
71
|
name: "cheddar_customer_update",
|
|
64
|
-
description: "Update
|
|
72
|
+
description: "Update customer + subscription (legacy POST /customers/edit). Provide customer `code` and fields to change. Prefer token/hosted flows over raw card data.",
|
|
65
73
|
inputSchema: {
|
|
66
74
|
type: "object",
|
|
67
75
|
properties: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
email: {
|
|
81
|
-
type: "string",
|
|
82
|
-
description: "Customer's email address",
|
|
83
|
-
},
|
|
84
|
-
company: {
|
|
85
|
-
type: "string",
|
|
86
|
-
description: "Customer's company name",
|
|
87
|
-
},
|
|
88
|
-
notes: {
|
|
89
|
-
type: "string",
|
|
90
|
-
description: "Internal notes about the customer",
|
|
91
|
-
},
|
|
92
|
-
taxRate: {
|
|
93
|
-
type: "string",
|
|
94
|
-
description: "Tax rate to apply to this customer",
|
|
95
|
-
},
|
|
96
|
-
isTaxExempt: {
|
|
97
|
-
type: "boolean",
|
|
98
|
-
description: "Whether the customer is tax exempt",
|
|
99
|
-
},
|
|
100
|
-
taxNumber: {
|
|
101
|
-
type: "string",
|
|
102
|
-
description: "Tax/VAT number for the customer",
|
|
76
|
+
code: { type: "string", description: "Customer code to edit" },
|
|
77
|
+
firstName: { type: "string" },
|
|
78
|
+
lastName: { type: "string" },
|
|
79
|
+
email: { type: "string" },
|
|
80
|
+
company: { type: "string" },
|
|
81
|
+
notes: { type: "string" },
|
|
82
|
+
taxRate: { type: "string" },
|
|
83
|
+
isTaxExempt: { type: "boolean" },
|
|
84
|
+
taxNumber: { type: "string" },
|
|
85
|
+
subscription: {
|
|
86
|
+
type: "object",
|
|
87
|
+
description: "Subscription fields per legacy API docs; avoid sending full card numbers through the MCP.",
|
|
103
88
|
},
|
|
104
89
|
},
|
|
105
|
-
required: ["
|
|
90
|
+
required: ["code"],
|
|
106
91
|
},
|
|
107
92
|
},
|
|
108
93
|
];
|
|
94
|
+
function jsonResult(data) {
|
|
95
|
+
return {
|
|
96
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
109
99
|
export async function handleCustomerTool(client, name, args) {
|
|
100
|
+
const a = args || {};
|
|
110
101
|
switch (name) {
|
|
111
102
|
case "cheddar_customer_get": {
|
|
112
|
-
const {
|
|
113
|
-
const
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
103
|
+
const { lookup, value } = a;
|
|
104
|
+
const data = await client.getCustomer(lookup, value);
|
|
105
|
+
return jsonResult(data);
|
|
106
|
+
}
|
|
107
|
+
case "cheddar_customers_search": {
|
|
108
|
+
const params = {};
|
|
109
|
+
if (a.search)
|
|
110
|
+
params.search = String(a.search);
|
|
111
|
+
if (a.subscriptionStatus)
|
|
112
|
+
params.subscriptionStatus = String(a.subscriptionStatus);
|
|
113
|
+
if (a.orderBy)
|
|
114
|
+
params.orderBy = String(a.orderBy);
|
|
115
|
+
if (a.orderByDirection)
|
|
116
|
+
params.orderByDirection = String(a.orderByDirection);
|
|
117
|
+
if (a.createdAfterDate)
|
|
118
|
+
params.createdAfterDate = String(a.createdAfterDate);
|
|
119
|
+
if (a.createdBeforeDate)
|
|
120
|
+
params.createdBeforeDate = String(a.createdBeforeDate);
|
|
121
|
+
if (Array.isArray(a.planCode)) {
|
|
122
|
+
a.planCode.forEach((c, i) => {
|
|
123
|
+
params[`planCode[${i}]`] = c;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const data = await client.searchCustomers(params);
|
|
127
|
+
return jsonResult(data);
|
|
122
128
|
}
|
|
123
129
|
case "cheddar_customer_create": {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
};
|
|
130
|
+
const { code, subscription, ...rest } = a;
|
|
131
|
+
const fields = { code, ...rest };
|
|
132
|
+
if (subscription)
|
|
133
|
+
fields.subscription = subscription;
|
|
134
|
+
const data = await client.createCustomer(fields);
|
|
135
|
+
return jsonResult(data);
|
|
133
136
|
}
|
|
134
137
|
case "cheddar_customer_update": {
|
|
135
|
-
const {
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
};
|
|
138
|
+
const { code, ...updates } = a;
|
|
139
|
+
const { subscription, ...rest } = updates;
|
|
140
|
+
const fields = { ...rest };
|
|
141
|
+
if (subscription)
|
|
142
|
+
fields.subscription = subscription;
|
|
143
|
+
const data = await client.updateCustomer(code, fields);
|
|
144
|
+
return jsonResult(data);
|
|
145
145
|
}
|
|
146
146
|
default:
|
|
147
|
-
throw new Error(`Unknown
|
|
147
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
//# sourceMappingURL=customers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customers.js","sourceRoot":"","sources":["../../src/tools/customers.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,
|
|
1
|
+
{"version":3,"file":"customers.js","sourceRoot":"","sources":["../../src/tools/customers.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EACT,kGAAkG;QACpG,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC;oBACpB,WAAW,EAAE,qDAAqD;iBACnE;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qBAAqB;iBACnC;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;SAC9B;KACF;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,mHAAmH;QACrH,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE;gBAC3D,kBAAkB,EAAE;oBAClB,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;iBACrC;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;iBACxE;gBACD,g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CAAC;YACF,MAAM,MAAM,GAA4B,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;YAC1D,IAAI,YAAY;gBAAE,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;YACrD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACjD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,KAAK,yBAAyB,CAAC,CAAC,CAAC;YAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,CAA+C,CAAC;YAC7E,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;YAC1C,MAAM,MAAM,GAA4B,EAAE,GAAG,IAAI,EAAE,CAAC;YACpD,IAAI,YAAY;gBAAE,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;YACrD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACvD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { LegacyCheddarClient } from "../lib/legacy-client.js";
|
|
3
|
+
export declare const planTools: Tool[];
|
|
4
|
+
export declare function handlePlanTool(client: LegacyCheddarClient, name: string, args: Record<string, unknown> | undefined): Promise<{
|
|
5
|
+
content: Array<{
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/tools/plans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,eAAO,MAAM,SAAS,EAAE,IAAI,EAe3B,CAAC;AAEF,wBAAsB,cAAc,CAClC,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACxC,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAS7D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const planTools = [
|
|
2
|
+
{
|
|
3
|
+
name: "cheddar_plans_get",
|
|
4
|
+
description: "List all pricing plans for the product, or fetch one plan by code (legacy /xml/plans/get).",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
planCode: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "If set, return a single plan with this code; otherwise return all plans",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
export async function handlePlanTool(client, name, args) {
|
|
17
|
+
if (name !== "cheddar_plans_get") {
|
|
18
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
19
|
+
}
|
|
20
|
+
const planCode = args?.planCode != null ? String(args.planCode) : undefined;
|
|
21
|
+
const data = await client.getPlans(planCode);
|
|
22
|
+
return {
|
|
23
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=plans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/tools/plans.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,SAAS,GAAW;IAC/B;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,4FAA4F;QAC9F,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yEAAyE;iBACvF;aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA2B,EAC3B,IAAY,EACZ,IAAyC;IAEzC,IAAI,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5E,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC7C,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACjE,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getcheddar/cheddar-mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Model Context Protocol server for Cheddar Payment Platform integration",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": {
|
|
10
|
-
"cheddar-mcp": "
|
|
10
|
+
"cheddar-mcp": "bin/cheddar-mcp.mjs"
|
|
11
11
|
},
|
|
12
12
|
"main": "./dist/index.js",
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"files": [
|
|
15
|
+
"bin/cheddar-mcp.mjs",
|
|
15
16
|
"dist/**/*",
|
|
16
17
|
"README.md",
|
|
17
18
|
"LICENSE"
|
|
@@ -39,15 +40,15 @@
|
|
|
39
40
|
"license": "MIT",
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
43
|
+
"dotenv": "^16.3.1",
|
|
44
|
+
"fast-xml-parser": "^4.5.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@types/node": "^20.10.0",
|
|
47
|
-
"typescript": "^5.3.0",
|
|
48
|
-
"vitest": "^1.0.0",
|
|
49
48
|
"eslint": "^8.55.0",
|
|
50
|
-
"prettier": "^3.1.0"
|
|
49
|
+
"prettier": "^3.1.0",
|
|
50
|
+
"typescript": "^5.3.0",
|
|
51
|
+
"vitest": "^1.0.0"
|
|
51
52
|
},
|
|
52
53
|
"engines": {
|
|
53
54
|
"node": ">=18.0.0"
|