@hasna/connectors 1.3.13 → 1.3.15
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/bin/index.js +1 -1
- package/bin/mcp.js +62 -17
- package/connectors/connect-cloudflare/bun.lock +32 -0
- package/connectors/connect-gmail/bin/index.js +7027 -0
- package/connectors/connect-gmail/dist/cli/index.js +7035 -0
- package/connectors/connect-gmail/dist/index.js +2174 -0
- package/connectors/connect-gmail/package.json +1 -1
- package/connectors/connect-gmail/src/api/client.ts +13 -3
- package/connectors/connect-gmail/src/api/index.ts +98 -3
- package/connectors/connect-gmail/src/cli/index.ts +13 -8
- package/connectors/connect-gmail/src/index.ts +4 -0
- package/connectors/connect-gmail/src/utils/auth.ts +31 -18
- package/connectors/connect-stripe/package.json +1 -1
- package/connectors/connect-stripe/src/api/index.ts +9 -2
- package/connectors/connect-stripe/src/index.ts +1 -1
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -23169,7 +23169,7 @@ var {
|
|
|
23169
23169
|
// package.json
|
|
23170
23170
|
var package_default = {
|
|
23171
23171
|
name: "@hasna/connectors",
|
|
23172
|
-
version: "1.3.
|
|
23172
|
+
version: "1.3.15",
|
|
23173
23173
|
description: "Open source connector library - Install API connectors with a single command",
|
|
23174
23174
|
type: "module",
|
|
23175
23175
|
bin: {
|
package/bin/mcp.js
CHANGED
|
@@ -37281,7 +37281,7 @@ init_dist();
|
|
|
37281
37281
|
// package.json
|
|
37282
37282
|
var package_default = {
|
|
37283
37283
|
name: "@hasna/connectors",
|
|
37284
|
-
version: "1.3.
|
|
37284
|
+
version: "1.3.15",
|
|
37285
37285
|
description: "Open source connector library - Install API connectors with a single command",
|
|
37286
37286
|
type: "module",
|
|
37287
37287
|
bin: {
|
|
@@ -37567,35 +37567,79 @@ server.registerTool("connector_auth_status", {
|
|
|
37567
37567
|
});
|
|
37568
37568
|
server.registerTool("configure_auth", {
|
|
37569
37569
|
title: "Configure Auth",
|
|
37570
|
-
description: "Save an API key or token for a connector.",
|
|
37570
|
+
description: "Save an API key or token for a connector. Use 'fields' to save multiple credentials at once (e.g. OAuth clientId + clientSecret).",
|
|
37571
37571
|
inputSchema: {
|
|
37572
37572
|
name: exports_external.string(),
|
|
37573
|
-
key: exports_external.string().describe("The API key or token VALUE to save"),
|
|
37574
|
-
field: exports_external.string().optional().describe("Config field name to save as (e.g. apiKey, clientId, clientSecret). Defaults to auto-detected field.")
|
|
37573
|
+
key: exports_external.string().optional().describe("The API key or token VALUE to save (for single-field auth)"),
|
|
37574
|
+
field: exports_external.string().optional().describe("Config field name to save as (e.g. apiKey, clientId, clientSecret). Defaults to auto-detected field."),
|
|
37575
|
+
fields: exports_external.record(exports_external.string()).optional().describe("Multiple credentials to save at once, e.g. { clientId: '...', clientSecret: '...' }")
|
|
37575
37576
|
}
|
|
37576
|
-
}, async ({ name, key, field }) => {
|
|
37577
|
+
}, async ({ name, key, field, fields }) => {
|
|
37577
37578
|
try {
|
|
37579
|
+
if (fields && Object.keys(fields).length > 0) {
|
|
37580
|
+
for (const [f, v] of Object.entries(fields)) {
|
|
37581
|
+
await saveApiKey(name, v, f);
|
|
37582
|
+
}
|
|
37583
|
+
if (key)
|
|
37584
|
+
await saveApiKey(name, key, field);
|
|
37585
|
+
return {
|
|
37586
|
+
content: [{
|
|
37587
|
+
type: "text",
|
|
37588
|
+
text: JSON.stringify({ success: true, connector: name, fields: Object.keys(fields) }, null, 2)
|
|
37589
|
+
}]
|
|
37590
|
+
};
|
|
37591
|
+
}
|
|
37592
|
+
if (!key) {
|
|
37593
|
+
return {
|
|
37594
|
+
content: [{ type: "text", text: "Provide either 'key' or 'fields'" }],
|
|
37595
|
+
isError: true
|
|
37596
|
+
};
|
|
37597
|
+
}
|
|
37578
37598
|
await saveApiKey(name, key, field);
|
|
37579
37599
|
return {
|
|
37580
|
-
content: [
|
|
37581
|
-
|
|
37582
|
-
|
|
37583
|
-
|
|
37584
|
-
}
|
|
37585
|
-
]
|
|
37600
|
+
content: [{
|
|
37601
|
+
type: "text",
|
|
37602
|
+
text: JSON.stringify({ success: true, connector: name, field: field || "apiKey" }, null, 2)
|
|
37603
|
+
}]
|
|
37586
37604
|
};
|
|
37587
37605
|
} catch (error2) {
|
|
37588
37606
|
return {
|
|
37589
|
-
content: [
|
|
37590
|
-
|
|
37591
|
-
|
|
37592
|
-
|
|
37593
|
-
}
|
|
37594
|
-
],
|
|
37607
|
+
content: [{
|
|
37608
|
+
type: "text",
|
|
37609
|
+
text: `Failed to save key for '${name}': ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
37610
|
+
}],
|
|
37595
37611
|
isError: true
|
|
37596
37612
|
};
|
|
37597
37613
|
}
|
|
37598
37614
|
});
|
|
37615
|
+
server.registerTool("update_connector", {
|
|
37616
|
+
title: "Update Connector",
|
|
37617
|
+
description: "Reinstall a connector to get the latest version from the package. Preserves existing auth credentials.",
|
|
37618
|
+
inputSchema: {
|
|
37619
|
+
name: exports_external.string().describe("Connector name to update (e.g. stripe, gmail)")
|
|
37620
|
+
}
|
|
37621
|
+
}, async ({ name }) => {
|
|
37622
|
+
const meta = getConnector(name);
|
|
37623
|
+
if (!meta) {
|
|
37624
|
+
return {
|
|
37625
|
+
content: [{ type: "text", text: `Connector '${name}' not found.` }],
|
|
37626
|
+
isError: true
|
|
37627
|
+
};
|
|
37628
|
+
}
|
|
37629
|
+
const result = installConnector(name, { overwrite: true });
|
|
37630
|
+
if (!result.success) {
|
|
37631
|
+
return {
|
|
37632
|
+
content: [{ type: "text", text: JSON.stringify({ success: false, connector: name, error: result.error }, null, 2) }],
|
|
37633
|
+
isError: true
|
|
37634
|
+
};
|
|
37635
|
+
}
|
|
37636
|
+
return {
|
|
37637
|
+
content: [{
|
|
37638
|
+
type: "text",
|
|
37639
|
+
text: JSON.stringify({ success: true, connector: name, path: result.path, message: `Updated to latest version` }, null, 2)
|
|
37640
|
+
}]
|
|
37641
|
+
};
|
|
37642
|
+
});
|
|
37599
37643
|
server.registerTool("list_categories", {
|
|
37600
37644
|
title: "List Categories",
|
|
37601
37645
|
description: "List connector categories with counts.",
|
|
@@ -37817,6 +37861,7 @@ server.registerTool("search_tools", {
|
|
|
37817
37861
|
"connector_docs",
|
|
37818
37862
|
"install_connector",
|
|
37819
37863
|
"remove_connector",
|
|
37864
|
+
"update_connector",
|
|
37820
37865
|
"list_installed",
|
|
37821
37866
|
"connector_info",
|
|
37822
37867
|
"connector_auth_status",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 1,
|
|
4
|
+
"workspaces": {
|
|
5
|
+
"": {
|
|
6
|
+
"name": "@hasna/connect-cloudflare",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"chalk": "^5.3.0",
|
|
9
|
+
"commander": "^12.1.0",
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@types/bun": "latest",
|
|
13
|
+
"typescript": "^5",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
"packages": {
|
|
18
|
+
"@types/bun": ["@types/bun@1.3.11", "", { "dependencies": { "bun-types": "1.3.11" } }, "sha512-5vPne5QvtpjGpsGYXiFyycfpDF2ECyPcTSsFBMa0fraoxiQyMJ3SmuQIGhzPg2WJuWxVBoxWJ2kClYTcw/4fAg=="],
|
|
19
|
+
|
|
20
|
+
"@types/node": ["@types/node@25.5.0", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw=="],
|
|
21
|
+
|
|
22
|
+
"bun-types": ["bun-types@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-1KGPpoxQWl9f6wcZh57LvrPIInQMn2TQ7jsgxqpRzg+l0QPOFvJVH7HmvHo/AiPgwXy+/Thf6Ov3EdVn1vOabg=="],
|
|
23
|
+
|
|
24
|
+
"chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],
|
|
25
|
+
|
|
26
|
+
"commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="],
|
|
27
|
+
|
|
28
|
+
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
|
29
|
+
|
|
30
|
+
"undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
|
|
31
|
+
}
|
|
32
|
+
}
|