@hasna/connectors 0.3.0 → 0.3.1
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 +21 -4
- package/bin/mcp.js +1 -1
- package/bin/serve.js +18 -1
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -4642,7 +4642,24 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
4642
4642
|
const path = url2.pathname;
|
|
4643
4643
|
const method = req.method;
|
|
4644
4644
|
if (path === "/api/connectors" && method === "GET") {
|
|
4645
|
-
|
|
4645
|
+
const compact = url2.searchParams.get("compact") === "true";
|
|
4646
|
+
const fieldsParam = url2.searchParams.get("fields");
|
|
4647
|
+
const fields = fieldsParam ? new Set(fieldsParam.split(",").map((f) => f.trim())) : null;
|
|
4648
|
+
const data = getAllConnectorsWithAuth();
|
|
4649
|
+
if (compact) {
|
|
4650
|
+
return json(data.map((c) => ({ name: c.name, category: c.category, installed: c.installed })), 200, port);
|
|
4651
|
+
}
|
|
4652
|
+
if (fields) {
|
|
4653
|
+
return json(data.map((c) => {
|
|
4654
|
+
const out = {};
|
|
4655
|
+
for (const f of fields) {
|
|
4656
|
+
if (f in c)
|
|
4657
|
+
out[f] = c[f];
|
|
4658
|
+
}
|
|
4659
|
+
return out;
|
|
4660
|
+
}), 200, port);
|
|
4661
|
+
}
|
|
4662
|
+
return json(data, 200, port);
|
|
4646
4663
|
}
|
|
4647
4664
|
const singleMatch = path.match(/^\/api\/connectors\/([^/]+)$/);
|
|
4648
4665
|
if (singleMatch && method === "GET") {
|
|
@@ -6583,7 +6600,7 @@ var PRESETS = {
|
|
|
6583
6600
|
commerce: { description: "Commerce and finance", connectors: ["stripe", "shopify", "revolut", "mercury", "pandadoc"] }
|
|
6584
6601
|
};
|
|
6585
6602
|
var program2 = new Command;
|
|
6586
|
-
program2.name("connectors").description("Install API connectors for your project").version("0.3.
|
|
6603
|
+
program2.name("connectors").description("Install API connectors for your project").version("0.3.1");
|
|
6587
6604
|
program2.command("interactive", { isDefault: true }).alias("i").description("Interactive connector browser").action(() => {
|
|
6588
6605
|
if (!isTTY) {
|
|
6589
6606
|
console.log(`Non-interactive environment detected. Use a subcommand:
|
|
@@ -7746,7 +7763,7 @@ program2.command("import").argument("<file>", "JSON backup file to import (use -
|
|
|
7746
7763
|
}
|
|
7747
7764
|
});
|
|
7748
7765
|
program2.command("upgrade").alias("self-update").option("--check", "Only check for updates, don't install", false).option("--json", "Output as JSON", false).description("Check for updates and upgrade to the latest version").action(async (options) => {
|
|
7749
|
-
const currentVersion = "0.3.
|
|
7766
|
+
const currentVersion = "0.3.1";
|
|
7750
7767
|
try {
|
|
7751
7768
|
const res = await fetch("https://registry.npmjs.org/@hasna/connectors/latest");
|
|
7752
7769
|
if (!res.ok)
|
|
@@ -7962,7 +7979,7 @@ Available presets:
|
|
|
7962
7979
|
program2.command("whoami").option("--json", "Output as JSON", false).description("Show current setup: config dir, installed connectors, auth status").action((options) => {
|
|
7963
7980
|
const configDir = join5(homedir3(), ".connectors");
|
|
7964
7981
|
const installed = getInstalledConnectors();
|
|
7965
|
-
const version = "0.3.
|
|
7982
|
+
const version = "0.3.1";
|
|
7966
7983
|
let configured = 0;
|
|
7967
7984
|
let unconfigured = 0;
|
|
7968
7985
|
const connectorDetails = [];
|
package/bin/mcp.js
CHANGED
|
@@ -20275,7 +20275,7 @@ function guessKeyField(name) {
|
|
|
20275
20275
|
loadConnectorVersions();
|
|
20276
20276
|
var server = new McpServer({
|
|
20277
20277
|
name: "connectors",
|
|
20278
|
-
version: "0.3.
|
|
20278
|
+
version: "0.3.1"
|
|
20279
20279
|
});
|
|
20280
20280
|
server.registerTool("search_connectors", {
|
|
20281
20281
|
title: "Search Connectors",
|
package/bin/serve.js
CHANGED
|
@@ -1136,7 +1136,24 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
1136
1136
|
const path = url2.pathname;
|
|
1137
1137
|
const method = req.method;
|
|
1138
1138
|
if (path === "/api/connectors" && method === "GET") {
|
|
1139
|
-
|
|
1139
|
+
const compact = url2.searchParams.get("compact") === "true";
|
|
1140
|
+
const fieldsParam = url2.searchParams.get("fields");
|
|
1141
|
+
const fields = fieldsParam ? new Set(fieldsParam.split(",").map((f) => f.trim())) : null;
|
|
1142
|
+
const data = getAllConnectorsWithAuth();
|
|
1143
|
+
if (compact) {
|
|
1144
|
+
return json(data.map((c) => ({ name: c.name, category: c.category, installed: c.installed })), 200, port);
|
|
1145
|
+
}
|
|
1146
|
+
if (fields) {
|
|
1147
|
+
return json(data.map((c) => {
|
|
1148
|
+
const out = {};
|
|
1149
|
+
for (const f of fields) {
|
|
1150
|
+
if (f in c)
|
|
1151
|
+
out[f] = c[f];
|
|
1152
|
+
}
|
|
1153
|
+
return out;
|
|
1154
|
+
}), 200, port);
|
|
1155
|
+
}
|
|
1156
|
+
return json(data, 200, port);
|
|
1140
1157
|
}
|
|
1141
1158
|
const singleMatch = path.match(/^\/api\/connectors\/([^/]+)$/);
|
|
1142
1159
|
if (singleMatch && method === "GET") {
|