@hasna/connectors 1.1.16 → 1.1.18
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 +100 -14
- package/bin/mcp.js +3 -5
- package/bin/serve.js +3 -4
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -9632,7 +9632,7 @@ var init_installer = __esm(() => {
|
|
|
9632
9632
|
});
|
|
9633
9633
|
|
|
9634
9634
|
// src/lib/lock.ts
|
|
9635
|
-
import { openSync, closeSync, unlinkSync, existsSync as existsSync3 } from "fs";
|
|
9635
|
+
import { openSync, closeSync, unlinkSync, existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
9636
9636
|
import { join as join3 } from "path";
|
|
9637
9637
|
import { homedir as homedir2 } from "os";
|
|
9638
9638
|
import { mkdirSync as mkdirSync2 } from "fs";
|
|
@@ -9643,7 +9643,6 @@ function lockPath(connector) {
|
|
|
9643
9643
|
}
|
|
9644
9644
|
function isStale(path) {
|
|
9645
9645
|
try {
|
|
9646
|
-
const { statSync: statSync2 } = __require("fs");
|
|
9647
9646
|
const stat = statSync2(path);
|
|
9648
9647
|
return Date.now() - stat.mtimeMs > STALE_LOCK_MS;
|
|
9649
9648
|
} catch {
|
|
@@ -9699,7 +9698,7 @@ var init_lock = __esm(() => {
|
|
|
9699
9698
|
});
|
|
9700
9699
|
|
|
9701
9700
|
// src/server/auth.ts
|
|
9702
|
-
import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync2, rmSync as rmSync2, statSync as
|
|
9701
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync2, rmSync as rmSync2, statSync as statSync3 } from "fs";
|
|
9703
9702
|
import { randomBytes } from "crypto";
|
|
9704
9703
|
import { homedir as homedir3 } from "os";
|
|
9705
9704
|
import { join as join4 } from "path";
|
|
@@ -10004,7 +10003,7 @@ function listProfiles(name) {
|
|
|
10004
10003
|
const entries = readdirSync2(profilesDir);
|
|
10005
10004
|
for (const entry of entries) {
|
|
10006
10005
|
const fullPath = join4(profilesDir, entry);
|
|
10007
|
-
const stat =
|
|
10006
|
+
const stat = statSync3(fullPath);
|
|
10008
10007
|
if (stat.isDirectory()) {
|
|
10009
10008
|
seen.add(entry);
|
|
10010
10009
|
} else if (entry.endsWith(".json")) {
|
|
@@ -10855,6 +10854,93 @@ var {
|
|
|
10855
10854
|
|
|
10856
10855
|
// src/cli/index.tsx
|
|
10857
10856
|
import chalk2 from "chalk";
|
|
10857
|
+
// package.json
|
|
10858
|
+
var package_default = {
|
|
10859
|
+
name: "@hasna/connectors",
|
|
10860
|
+
version: "1.1.18",
|
|
10861
|
+
description: "Open source connector library - Install API connectors with a single command",
|
|
10862
|
+
type: "module",
|
|
10863
|
+
bin: {
|
|
10864
|
+
connectors: "./bin/index.js",
|
|
10865
|
+
"connectors-mcp": "./bin/mcp.js",
|
|
10866
|
+
"connectors-serve": "./bin/serve.js"
|
|
10867
|
+
},
|
|
10868
|
+
files: [
|
|
10869
|
+
"bin/",
|
|
10870
|
+
"dist/",
|
|
10871
|
+
"dashboard/dist/",
|
|
10872
|
+
"connectors/",
|
|
10873
|
+
"README.md"
|
|
10874
|
+
],
|
|
10875
|
+
exports: {
|
|
10876
|
+
".": {
|
|
10877
|
+
import: "./dist/index.js",
|
|
10878
|
+
types: "./dist/index.d.ts"
|
|
10879
|
+
}
|
|
10880
|
+
},
|
|
10881
|
+
main: "./dist/index.js",
|
|
10882
|
+
types: "./dist/index.d.ts",
|
|
10883
|
+
scripts: {
|
|
10884
|
+
build: "cd dashboard && bun run build && cd .. && bun build ./src/cli/index.tsx --outdir ./bin --target bun --external ink --external react --external chalk --external conf && bun build ./src/mcp/index.ts --outfile ./bin/mcp.js --target bun && bun build ./src/server/index.ts --outfile ./bin/serve.js --target bun && bun build ./src/index.ts --outdir ./dist --target bun && tsc --emitDeclarationOnly --outDir ./dist",
|
|
10885
|
+
"build:dashboard": "cd dashboard && bun run build",
|
|
10886
|
+
postinstall: '[ "$SKIP_DASHBOARD" = "1" ] || [ ! -f dashboard/package.json ] || [ -d dashboard/node_modules ] || (cd dashboard && bun install)',
|
|
10887
|
+
dev: "bun run ./src/cli/index.tsx",
|
|
10888
|
+
typecheck: "tsc --noEmit",
|
|
10889
|
+
test: "bun test",
|
|
10890
|
+
"sdk:build": "cd sdk && bun run build",
|
|
10891
|
+
prepublishOnly: "bun test && bun run build"
|
|
10892
|
+
},
|
|
10893
|
+
keywords: [
|
|
10894
|
+
"connectors",
|
|
10895
|
+
"api",
|
|
10896
|
+
"cli",
|
|
10897
|
+
"typescript",
|
|
10898
|
+
"bun",
|
|
10899
|
+
"figma",
|
|
10900
|
+
"stripe",
|
|
10901
|
+
"github",
|
|
10902
|
+
"openai",
|
|
10903
|
+
"mcp",
|
|
10904
|
+
"model-context-protocol"
|
|
10905
|
+
],
|
|
10906
|
+
author: "Hasna",
|
|
10907
|
+
license: "Apache-2.0",
|
|
10908
|
+
devDependencies: {
|
|
10909
|
+
"@types/bun": "latest",
|
|
10910
|
+
"@types/react": "^18.2.0",
|
|
10911
|
+
"ink-testing-library": "^4.0.0",
|
|
10912
|
+
typescript: "^5"
|
|
10913
|
+
},
|
|
10914
|
+
dependencies: {
|
|
10915
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
10916
|
+
chalk: "^5.3.0",
|
|
10917
|
+
commander: "^12.1.0",
|
|
10918
|
+
conf: "^13.0.1",
|
|
10919
|
+
"fast-xml-parser": "^5.5.3",
|
|
10920
|
+
ink: "^5.0.1",
|
|
10921
|
+
"ink-select-input": "^6.0.0",
|
|
10922
|
+
"ink-spinner": "^5.0.0",
|
|
10923
|
+
"ink-text-input": "^6.0.0",
|
|
10924
|
+
open: "^11.0.0",
|
|
10925
|
+
react: "^18.2.0",
|
|
10926
|
+
zod: "3"
|
|
10927
|
+
},
|
|
10928
|
+
engines: {
|
|
10929
|
+
bun: ">=1.0.0"
|
|
10930
|
+
},
|
|
10931
|
+
publishConfig: {
|
|
10932
|
+
registry: "https://registry.npmjs.org",
|
|
10933
|
+
access: "public"
|
|
10934
|
+
},
|
|
10935
|
+
repository: {
|
|
10936
|
+
type: "git",
|
|
10937
|
+
url: "git+https://github.com/hasna/connectors.git"
|
|
10938
|
+
},
|
|
10939
|
+
homepage: "https://github.com/hasna/connectors#readme",
|
|
10940
|
+
bugs: {
|
|
10941
|
+
url: "https://github.com/hasna/connectors/issues"
|
|
10942
|
+
}
|
|
10943
|
+
};
|
|
10858
10944
|
|
|
10859
10945
|
// src/cli/components/App.tsx
|
|
10860
10946
|
import { useState as useState7 } from "react";
|
|
@@ -12328,7 +12414,7 @@ function App({ initialConnectors, overwrite = false }) {
|
|
|
12328
12414
|
init_registry();
|
|
12329
12415
|
init_installer();
|
|
12330
12416
|
init_auth();
|
|
12331
|
-
import { readdirSync as readdirSync4, existsSync as existsSync7, statSync as
|
|
12417
|
+
import { readdirSync as readdirSync4, existsSync as existsSync7, statSync as statSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync4, mkdirSync as mkdirSync6 } from "fs";
|
|
12332
12418
|
import { homedir as homedir6 } from "os";
|
|
12333
12419
|
import { join as join8, relative } from "path";
|
|
12334
12420
|
|
|
@@ -12675,7 +12761,7 @@ var PRESETS = {
|
|
|
12675
12761
|
commerce: { description: "Commerce and finance", connectors: ["stripe", "shopify", "revolut", "mercury", "pandadoc"] }
|
|
12676
12762
|
};
|
|
12677
12763
|
var program2 = new Command;
|
|
12678
|
-
program2.name("connectors").description("Install API connectors for your project").version(
|
|
12764
|
+
program2.name("connectors").description("Install API connectors for your project").version(package_default.version).enablePositionalOptions();
|
|
12679
12765
|
program2.command("interactive", { isDefault: true }).alias("i").description("Interactive connector browser").action(() => {
|
|
12680
12766
|
if (!isTTY) {
|
|
12681
12767
|
console.log(`Non-interactive environment detected. Use a subcommand:
|
|
@@ -12697,7 +12783,7 @@ function listFilesRecursive(dir, base = dir) {
|
|
|
12697
12783
|
const files = [];
|
|
12698
12784
|
for (const entry of readdirSync4(dir)) {
|
|
12699
12785
|
const fullPath = join8(dir, entry);
|
|
12700
|
-
if (
|
|
12786
|
+
if (statSync4(fullPath).isDirectory()) {
|
|
12701
12787
|
files.push(...listFilesRecursive(fullPath, base));
|
|
12702
12788
|
} else {
|
|
12703
12789
|
files.push(relative(base, fullPath));
|
|
@@ -13319,7 +13405,7 @@ program2.command("status").option("--json", "Output as JSON", false).description
|
|
|
13319
13405
|
if (!f.startsWith("connect-"))
|
|
13320
13406
|
return false;
|
|
13321
13407
|
try {
|
|
13322
|
-
return
|
|
13408
|
+
return statSync4(join8(configDir, f)).isDirectory();
|
|
13323
13409
|
} catch {
|
|
13324
13410
|
return false;
|
|
13325
13411
|
}
|
|
@@ -13689,7 +13775,7 @@ program2.command("init").option("--json", "Output presets and suggestions as JSO
|
|
|
13689
13775
|
const configuredNames = [];
|
|
13690
13776
|
try {
|
|
13691
13777
|
if (existsSync7(connectorsHome)) {
|
|
13692
|
-
const entries = readdirSync4(connectorsHome).filter((e) => e.startsWith("connect-") &&
|
|
13778
|
+
const entries = readdirSync4(connectorsHome).filter((e) => e.startsWith("connect-") && statSync4(join8(connectorsHome, e)).isDirectory());
|
|
13693
13779
|
for (const entry of entries) {
|
|
13694
13780
|
const profilesDir = join8(connectorsHome, entry, "profiles");
|
|
13695
13781
|
if (existsSync7(profilesDir)) {
|
|
@@ -13795,7 +13881,7 @@ program2.command("export").option("-o, --output <file>", "Write to file instead
|
|
|
13795
13881
|
if (existsSync7(connectDir)) {
|
|
13796
13882
|
for (const entry of readdirSync4(connectDir)) {
|
|
13797
13883
|
const entryPath = join8(connectDir, entry);
|
|
13798
|
-
if (!
|
|
13884
|
+
if (!statSync4(entryPath).isDirectory() || !entry.startsWith("connect-"))
|
|
13799
13885
|
continue;
|
|
13800
13886
|
const connectorName = entry.replace(/^connect-/, "");
|
|
13801
13887
|
let credentials = undefined;
|
|
@@ -13812,11 +13898,11 @@ program2.command("export").option("-o, --output <file>", "Write to file instead
|
|
|
13812
13898
|
if (existsSync7(profilesDir)) {
|
|
13813
13899
|
for (const pEntry of readdirSync4(profilesDir)) {
|
|
13814
13900
|
const pPath = join8(profilesDir, pEntry);
|
|
13815
|
-
if (
|
|
13901
|
+
if (statSync4(pPath).isFile() && pEntry.endsWith(".json")) {
|
|
13816
13902
|
try {
|
|
13817
13903
|
profiles[pEntry.replace(/\.json$/, "")] = JSON.parse(readFileSync5(pPath, "utf-8"));
|
|
13818
13904
|
} catch {}
|
|
13819
|
-
} else if (
|
|
13905
|
+
} else if (statSync4(pPath).isDirectory()) {
|
|
13820
13906
|
const configPath = join8(pPath, "config.json");
|
|
13821
13907
|
const tokensPath = join8(pPath, "tokens.json");
|
|
13822
13908
|
let merged = {};
|
|
@@ -13937,7 +14023,7 @@ program2.command("auth-import").option("--json", "Output as JSON", false).option
|
|
|
13937
14023
|
if (!name.startsWith("connect-"))
|
|
13938
14024
|
return false;
|
|
13939
14025
|
try {
|
|
13940
|
-
return
|
|
14026
|
+
return statSync4(join8(oldBase, name)).isDirectory();
|
|
13941
14027
|
} catch {
|
|
13942
14028
|
return false;
|
|
13943
14029
|
}
|
|
@@ -14278,7 +14364,7 @@ program2.command("whoami").option("--json", "Output as JSON", false).description
|
|
|
14278
14364
|
if (!f.startsWith("connect-"))
|
|
14279
14365
|
return false;
|
|
14280
14366
|
try {
|
|
14281
|
-
return
|
|
14367
|
+
return statSync4(join8(configDir, f)).isDirectory();
|
|
14282
14368
|
} catch {
|
|
14283
14369
|
return false;
|
|
14284
14370
|
}
|
package/bin/mcp.js
CHANGED
|
@@ -26,7 +26,6 @@ var __export = (target, all) => {
|
|
|
26
26
|
set: (newValue) => all[name] = () => newValue
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
-
var __require = import.meta.require;
|
|
30
29
|
|
|
31
30
|
// node_modules/ajv/dist/compile/codegen/code.js
|
|
32
31
|
var require_code = __commonJS((exports) => {
|
|
@@ -25572,12 +25571,12 @@ function removeConnector(name, targetDir = process.cwd()) {
|
|
|
25572
25571
|
}
|
|
25573
25572
|
|
|
25574
25573
|
// src/server/auth.ts
|
|
25575
|
-
import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync2, rmSync as rmSync2, statSync as
|
|
25574
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync2, rmSync as rmSync2, statSync as statSync3 } from "fs";
|
|
25576
25575
|
import { homedir as homedir3 } from "os";
|
|
25577
25576
|
import { join as join4 } from "path";
|
|
25578
25577
|
|
|
25579
25578
|
// src/lib/lock.ts
|
|
25580
|
-
import { openSync, closeSync, unlinkSync, existsSync as existsSync3 } from "fs";
|
|
25579
|
+
import { openSync, closeSync, unlinkSync, existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
25581
25580
|
import { join as join3 } from "path";
|
|
25582
25581
|
import { homedir as homedir2 } from "os";
|
|
25583
25582
|
import { mkdirSync as mkdirSync2 } from "fs";
|
|
@@ -25600,7 +25599,6 @@ function lockPath(connector) {
|
|
|
25600
25599
|
}
|
|
25601
25600
|
function isStale(path) {
|
|
25602
25601
|
try {
|
|
25603
|
-
const { statSync: statSync2 } = __require("fs");
|
|
25604
25602
|
const stat = statSync2(path);
|
|
25605
25603
|
return Date.now() - stat.mtimeMs > STALE_LOCK_MS;
|
|
25606
25604
|
} catch {
|
|
@@ -26158,7 +26156,7 @@ function getRateBudget(agentId, connector, connectorLimit, db) {
|
|
|
26158
26156
|
// package.json
|
|
26159
26157
|
var package_default = {
|
|
26160
26158
|
name: "@hasna/connectors",
|
|
26161
|
-
version: "1.1.
|
|
26159
|
+
version: "1.1.18",
|
|
26162
26160
|
description: "Open source connector library - Install API connectors with a single command",
|
|
26163
26161
|
type: "module",
|
|
26164
26162
|
bin: {
|
package/bin/serve.js
CHANGED
|
@@ -6299,13 +6299,13 @@ function removeConnector(name, targetDir = process.cwd()) {
|
|
|
6299
6299
|
}
|
|
6300
6300
|
|
|
6301
6301
|
// src/server/auth.ts
|
|
6302
|
-
import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync4, readdirSync as readdirSync2, rmSync as rmSync2, statSync as
|
|
6302
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync4, readdirSync as readdirSync2, rmSync as rmSync2, statSync as statSync3 } from "fs";
|
|
6303
6303
|
import { randomBytes } from "crypto";
|
|
6304
6304
|
import { homedir as homedir4 } from "os";
|
|
6305
6305
|
import { join as join5 } from "path";
|
|
6306
6306
|
|
|
6307
6307
|
// src/lib/lock.ts
|
|
6308
|
-
import { openSync, closeSync, unlinkSync, existsSync as existsSync3 } from "fs";
|
|
6308
|
+
import { openSync, closeSync, unlinkSync, existsSync as existsSync3, statSync as statSync2 } from "fs";
|
|
6309
6309
|
import { join as join4 } from "path";
|
|
6310
6310
|
import { homedir as homedir3 } from "os";
|
|
6311
6311
|
import { mkdirSync as mkdirSync3 } from "fs";
|
|
@@ -6328,7 +6328,6 @@ function lockPath(connector) {
|
|
|
6328
6328
|
}
|
|
6329
6329
|
function isStale(path) {
|
|
6330
6330
|
try {
|
|
6331
|
-
const { statSync: statSync2 } = __require("fs");
|
|
6332
6331
|
const stat = statSync2(path);
|
|
6333
6332
|
return Date.now() - stat.mtimeMs > STALE_LOCK_MS;
|
|
6334
6333
|
} catch {
|
|
@@ -6712,7 +6711,7 @@ function listProfiles(name) {
|
|
|
6712
6711
|
const entries = readdirSync2(profilesDir);
|
|
6713
6712
|
for (const entry of entries) {
|
|
6714
6713
|
const fullPath = join5(profilesDir, entry);
|
|
6715
|
-
const stat =
|
|
6714
|
+
const stat = statSync3(fullPath);
|
|
6716
6715
|
if (stat.isDirectory()) {
|
|
6717
6716
|
seen.add(entry);
|
|
6718
6717
|
} else if (entry.endsWith(".json")) {
|