@hasna/connectors 1.1.15 → 1.1.17

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 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 statSync2 } from "fs";
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 = statSync2(fullPath);
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,7 @@ var {
10855
10854
 
10856
10855
  // src/cli/index.tsx
10857
10856
  import chalk2 from "chalk";
10857
+ import { createRequire } from "module";
10858
10858
 
10859
10859
  // src/cli/components/App.tsx
10860
10860
  import { useState as useState7 } from "react";
@@ -12328,7 +12328,7 @@ function App({ initialConnectors, overwrite = false }) {
12328
12328
  init_registry();
12329
12329
  init_installer();
12330
12330
  init_auth();
12331
- import { readdirSync as readdirSync4, existsSync as existsSync7, statSync as statSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4, mkdirSync as mkdirSync6 } from "fs";
12331
+ import { readdirSync as readdirSync4, existsSync as existsSync7, statSync as statSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync4, mkdirSync as mkdirSync6 } from "fs";
12332
12332
  import { homedir as homedir6 } from "os";
12333
12333
  import { join as join8, relative } from "path";
12334
12334
 
@@ -12664,6 +12664,8 @@ async function getConnectorCommandHelp(name, command) {
12664
12664
 
12665
12665
  // src/cli/index.tsx
12666
12666
  import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
12667
+ var _require = createRequire(import.meta.url);
12668
+ var _pkg = _require("../package.json");
12667
12669
  loadConnectorVersions();
12668
12670
  var isTTY = process.stdout.isTTY ?? false;
12669
12671
  var PRESETS = {
@@ -12675,7 +12677,7 @@ var PRESETS = {
12675
12677
  commerce: { description: "Commerce and finance", connectors: ["stripe", "shopify", "revolut", "mercury", "pandadoc"] }
12676
12678
  };
12677
12679
  var program2 = new Command;
12678
- program2.name("connectors").description("Install API connectors for your project").version("1.1.6").enablePositionalOptions();
12680
+ program2.name("connectors").description("Install API connectors for your project").version(_pkg.version).enablePositionalOptions();
12679
12681
  program2.command("interactive", { isDefault: true }).alias("i").description("Interactive connector browser").action(() => {
12680
12682
  if (!isTTY) {
12681
12683
  console.log(`Non-interactive environment detected. Use a subcommand:
@@ -12697,7 +12699,7 @@ function listFilesRecursive(dir, base = dir) {
12697
12699
  const files = [];
12698
12700
  for (const entry of readdirSync4(dir)) {
12699
12701
  const fullPath = join8(dir, entry);
12700
- if (statSync3(fullPath).isDirectory()) {
12702
+ if (statSync4(fullPath).isDirectory()) {
12701
12703
  files.push(...listFilesRecursive(fullPath, base));
12702
12704
  } else {
12703
12705
  files.push(relative(base, fullPath));
@@ -13319,7 +13321,7 @@ program2.command("status").option("--json", "Output as JSON", false).description
13319
13321
  if (!f.startsWith("connect-"))
13320
13322
  return false;
13321
13323
  try {
13322
- return statSync3(join8(configDir, f)).isDirectory();
13324
+ return statSync4(join8(configDir, f)).isDirectory();
13323
13325
  } catch {
13324
13326
  return false;
13325
13327
  }
@@ -13689,7 +13691,7 @@ program2.command("init").option("--json", "Output presets and suggestions as JSO
13689
13691
  const configuredNames = [];
13690
13692
  try {
13691
13693
  if (existsSync7(connectorsHome)) {
13692
- const entries = readdirSync4(connectorsHome).filter((e) => e.startsWith("connect-") && statSync3(join8(connectorsHome, e)).isDirectory());
13694
+ const entries = readdirSync4(connectorsHome).filter((e) => e.startsWith("connect-") && statSync4(join8(connectorsHome, e)).isDirectory());
13693
13695
  for (const entry of entries) {
13694
13696
  const profilesDir = join8(connectorsHome, entry, "profiles");
13695
13697
  if (existsSync7(profilesDir)) {
@@ -13795,7 +13797,7 @@ program2.command("export").option("-o, --output <file>", "Write to file instead
13795
13797
  if (existsSync7(connectDir)) {
13796
13798
  for (const entry of readdirSync4(connectDir)) {
13797
13799
  const entryPath = join8(connectDir, entry);
13798
- if (!statSync3(entryPath).isDirectory() || !entry.startsWith("connect-"))
13800
+ if (!statSync4(entryPath).isDirectory() || !entry.startsWith("connect-"))
13799
13801
  continue;
13800
13802
  const connectorName = entry.replace(/^connect-/, "");
13801
13803
  let credentials = undefined;
@@ -13812,11 +13814,11 @@ program2.command("export").option("-o, --output <file>", "Write to file instead
13812
13814
  if (existsSync7(profilesDir)) {
13813
13815
  for (const pEntry of readdirSync4(profilesDir)) {
13814
13816
  const pPath = join8(profilesDir, pEntry);
13815
- if (statSync3(pPath).isFile() && pEntry.endsWith(".json")) {
13817
+ if (statSync4(pPath).isFile() && pEntry.endsWith(".json")) {
13816
13818
  try {
13817
13819
  profiles[pEntry.replace(/\.json$/, "")] = JSON.parse(readFileSync5(pPath, "utf-8"));
13818
13820
  } catch {}
13819
- } else if (statSync3(pPath).isDirectory()) {
13821
+ } else if (statSync4(pPath).isDirectory()) {
13820
13822
  const configPath = join8(pPath, "config.json");
13821
13823
  const tokensPath = join8(pPath, "tokens.json");
13822
13824
  let merged = {};
@@ -13937,7 +13939,7 @@ program2.command("auth-import").option("--json", "Output as JSON", false).option
13937
13939
  if (!name.startsWith("connect-"))
13938
13940
  return false;
13939
13941
  try {
13940
- return statSync3(join8(oldBase, name)).isDirectory();
13942
+ return statSync4(join8(oldBase, name)).isDirectory();
13941
13943
  } catch {
13942
13944
  return false;
13943
13945
  }
@@ -14278,7 +14280,7 @@ program2.command("whoami").option("--json", "Output as JSON", false).description
14278
14280
  if (!f.startsWith("connect-"))
14279
14281
  return false;
14280
14282
  try {
14281
- return statSync3(join8(configDir, f)).isDirectory();
14283
+ return statSync4(join8(configDir, f)).isDirectory();
14282
14284
  } catch {
14283
14285
  return false;
14284
14286
  }
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 statSync2 } from "fs";
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.14",
26159
+ version: "1.1.17",
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 statSync2 } from "fs";
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 = statSync2(fullPath);
6714
+ const stat = statSync3(fullPath);
6716
6715
  if (stat.isDirectory()) {
6717
6716
  seen.add(entry);
6718
6717
  } else if (entry.endsWith(".json")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/connectors",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "Open source connector library - Install API connectors with a single command",
5
5
  "type": "module",
6
6
  "bin": {