@hasna/connectors 1.4.2 → 1.4.4
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 +145 -98
- package/bin/mcp.js +1 -1
- package/bin/serve.js +144 -93
- package/connectors/clickbank/README.md +2 -2
- package/connectors/split-in-batches/CLAUDE.md +1 -1
- package/connectors/split-in-batches/README.md +1 -1
- package/connectors/split-in-batches/src/api/client.test.ts +16 -17
- package/connectors/split-in-batches/src/api/client.ts +4 -3
- package/connectors/split-in-batches/src/cli/index.ts +1 -1
- package/connectors/spreadsheet-file/.env.example +1 -1
- package/connectors/spreadsheet-file/CLAUDE.md +2 -2
- package/connectors/spreadsheet-file/README.md +3 -3
- package/connectors/spreadsheet-file/src/api/client.test.ts +8 -9
- package/connectors/spreadsheet-file/src/api/client.ts +4 -3
- package/connectors/spreadsheet-file/src/cli/index.ts +1 -1
- package/connectors/sse-trigger/.env.example +1 -1
- package/connectors/sse-trigger/CLAUDE.md +2 -2
- package/connectors/sse-trigger/README.md +1 -1
- package/connectors/sse-trigger/src/api/client.test.ts +12 -8
- package/connectors/sse-trigger/src/api/client.ts +4 -3
- package/connectors/sse-trigger/src/api/index.ts +1 -1
- package/connectors/sse-trigger/src/cli/index.ts +1 -1
- package/connectors/sse-trigger/src/index.ts +1 -1
- package/connectors/stability-api-platform/AGENTS.md +1 -1
- package/connectors/stability-api-platform/CLAUDE.md +1 -1
- package/connectors/stability-api-platform/README.md +2 -2
- package/connectors/stability-api-platform/src/api/client.test.ts +17 -12
- package/connectors/stability-api-platform/src/api/client.ts +4 -3
- package/connectors/stability-api-platform/src/api/index.ts +0 -1
- package/connectors/stability-api-platform/src/cli/index.ts +1 -1
- package/connectors/stability-api-platform/src/index.ts +0 -1
- package/connectors/stop-and-error/.env.example +1 -1
- package/connectors/stop-and-error/CLAUDE.md +1 -1
- package/connectors/stop-and-error/README.md +1 -1
- package/connectors/stop-and-error/src/api/client.test.ts +12 -8
- package/connectors/stop-and-error/src/api/client.ts +4 -3
- package/connectors/stop-and-error/src/cli/index.ts +2 -2
- package/connectors/stripe-financial-connections/.env.example +1 -1
- package/connectors/stripe-financial-connections/CLAUDE.md +2 -2
- package/connectors/stripe-financial-connections/src/api/client.test.ts +34 -0
- package/connectors/stripe-financial-connections/src/api/client.ts +4 -3
- package/connectors/stripe-financial-connections/src/cli/index.ts +1 -1
- package/connectors/sucuri-api-platform/.env.example +1 -1
- package/connectors/sucuri-api-platform/CLAUDE.md +1 -1
- package/connectors/sucuri-api-platform/README.md +2 -2
- package/connectors/sucuri-api-platform/src/api/client.test.ts +9 -7
- package/connectors/sucuri-api-platform/src/api/client.ts +4 -3
- package/connectors/sucuri-api-platform/src/api/index.ts +1 -1
- package/connectors/sucuri-api-platform/src/cli/index.ts +1 -1
- package/connectors/sucuri-api-platform/src/index.ts +1 -1
- package/connectors/tettra-api-platform/CLAUDE.md +1 -1
- package/connectors/tettra-api-platform/README.md +2 -2
- package/connectors/tettra-api-platform/src/api/client.test.ts +7 -8
- package/connectors/tettra-api-platform/src/api/client.ts +4 -3
- package/connectors/tettra-api-platform/src/api/index.ts +1 -1
- package/connectors/tettra-api-platform/src/cli/index.ts +1 -1
- package/connectors/tettra-api-platform/src/index.ts +1 -1
- package/connectors/together-api-platform/.env.example +1 -1
- package/connectors/together-api-platform/CLAUDE.md +1 -1
- package/connectors/together-api-platform/README.md +1 -1
- package/connectors/together-api-platform/src/api/client.test.ts +11 -7
- package/connectors/together-api-platform/src/api/client.ts +4 -4
- package/connectors/together-api-platform/src/api/index.ts +1 -1
- package/connectors/together-api-platform/src/cli/index.ts +1 -1
- package/connectors/together-api-platform/src/index.ts +1 -1
- package/connectors/travo-real-estate/CLAUDE.md +1 -1
- package/connectors/travo-real-estate/README.md +1 -1
- package/connectors/travo-real-estate/src/api/client.test.ts +20 -16
- package/connectors/travo-real-estate/src/api/client.ts +4 -3
- package/connectors/travo-real-estate/src/utils/config.ts +2 -4
- package/connectors/tray-api-platform/CLAUDE.md +1 -1
- package/connectors/tray-api-platform/src/api/client.test.ts +17 -13
- package/connectors/tray-api-platform/src/api/client.ts +4 -3
- package/connectors/tray-api-platform/src/api/index.ts +1 -1
- package/connectors/tray-api-platform/src/cli/index.ts +1 -1
- package/connectors/tray-api-platform/src/index.ts +0 -1
- package/connectors/turso-api-platform/CLAUDE.md +1 -1
- package/connectors/turso-api-platform/README.md +2 -2
- package/connectors/turso-api-platform/src/api/client.test.ts +17 -13
- package/connectors/turso-api-platform/src/api/client.ts +4 -3
- package/connectors/turso-api-platform/src/cli/index.ts +2 -2
- package/connectors/twilio-api-platform/CLAUDE.md +1 -1
- package/connectors/twilio-api-platform/src/api/client.test.ts +11 -11
- package/connectors/twilio-api-platform/src/api/client.ts +4 -3
- package/connectors/twilio-api-platform/src/api/index.ts +1 -1
- package/connectors/twilio-api-platform/src/cli/index.ts +1 -1
- package/connectors/twilio-api-platform/src/index.ts +1 -1
- package/connectors/tyk-api-platform/.env.example +1 -1
- package/connectors/tyk-api-platform/CLAUDE.md +2 -2
- package/connectors/tyk-api-platform/README.md +1 -1
- package/connectors/tyk-api-platform/src/api/client.test.ts +14 -15
- package/connectors/tyk-api-platform/src/api/client.ts +4 -3
- package/connectors/tyk-api-platform/src/api/index.ts +1 -1
- package/connectors/tyk-api-platform/src/cli/index.ts +1 -1
- package/connectors/tyk-api-platform/src/index.ts +1 -1
- package/connectors/vector-legal/.env.example +1 -1
- package/connectors/vector-legal/AGENTS.md +1 -1
- package/connectors/vector-legal/CLAUDE.md +1 -1
- package/connectors/vector-legal/README.md +1 -1
- package/connectors/vector-legal/src/api/client.test.ts +9 -5
- package/connectors/vector-legal/src/api/client.ts +4 -3
- package/connectors/vector-legal/src/api/index.ts +1 -1
- package/connectors/vector-legal/src/cli/index.ts +2 -2
- package/connectors/vector-legal/src/index.ts +0 -1
- package/connectors/vector-legal-api/CLAUDE.md +1 -1
- package/connectors/vector-legal-api/README.md +2 -2
- package/connectors/vector-legal-api/src/api/client.test.ts +12 -7
- package/connectors/vector-legal-api/src/api/client.ts +4 -3
- package/connectors/vector-legal-api/src/api/index.ts +1 -1
- package/connectors/vector-legal-api/src/cli/index.ts +1 -1
- package/connectors/vector-legal-api/src/index.ts +1 -2
- package/connectors/velum-data-quality/.env.example +1 -1
- package/connectors/velum-data-quality/CLAUDE.md +1 -1
- package/connectors/velum-data-quality/src/api/client.test.ts +15 -16
- package/connectors/velum-data-quality/src/api/client.ts +4 -3
- package/connectors/velum-data-quality/src/api/index.ts +1 -1
- package/connectors/velum-data-quality/src/cli/index.ts +1 -1
- package/connectors/velum-data-quality/src/index.ts +0 -1
- package/connectors/vercel-api-platform/.env.example +1 -1
- package/connectors/vercel-api-platform/CLAUDE.md +2 -2
- package/connectors/vercel-api-platform/README.md +2 -2
- package/connectors/vercel-api-platform/src/api/client.test.ts +27 -6
- package/connectors/vercel-api-platform/src/api/client.ts +4 -3
- package/connectors/vercel-api-platform/src/api/index.ts +1 -1
- package/connectors/vercel-api-platform/src/cli/index.ts +2 -2
- package/connectors/vercel-api-platform/src/index.ts +0 -1
- package/connectors/veriphone/README.md +2 -2
- package/connectors/wave-accounting/CLAUDE.md +1 -1
- package/connectors/wave-accounting/src/utils/auth.ts +1 -1
- package/connectors/weaviate-api-platform/CLAUDE.md +1 -1
- package/connectors/weaviate-api-platform/src/api/client.test.ts +32 -7
- package/connectors/weaviate-api-platform/src/api/client.ts +4 -3
- package/connectors/weaviate-api-platform/src/api/index.ts +1 -1
- package/connectors/weaviate-api-platform/src/cli/index.ts +1 -1
- package/connectors/weaviate-api-platform/src/index.ts +1 -1
- package/connectors/workflow-trigger/.env.example +1 -1
- package/connectors/workflow-trigger/CLAUDE.md +1 -1
- package/connectors/workflow-trigger/README.md +1 -1
- package/connectors/workflow-trigger/src/api/client.test.ts +10 -6
- package/connectors/workflow-trigger/src/api/client.ts +4 -3
- package/connectors/workflow-trigger/src/cli/index.ts +1 -1
- package/connectors/write-binary-file/CLAUDE.md +1 -1
- package/connectors/write-binary-file/README.md +1 -1
- package/connectors/write-binary-file/src/api/client.test.ts +16 -12
- package/connectors/write-binary-file/src/api/client.ts +4 -3
- package/connectors/write-binary-file/src/api/index.ts +1 -1
- package/connectors/write-binary-file/src/index.ts +1 -1
- package/connectors/wubookratechecker/src/api/client.test.ts +34 -0
- package/connectors/wubookratechecker/src/api/client.ts +3 -1
- package/connectors/wubookratechecker/src/api/index.ts +1 -1
- package/connectors/wubookratechecker/src/types/index.ts +1 -1
- package/connectors/xai-api-platform/.env.example +1 -1
- package/connectors/xai-api-platform/CLAUDE.md +1 -1
- package/connectors/xai-api-platform/README.md +1 -1
- package/connectors/xai-api-platform/src/api/client.test.ts +33 -8
- package/connectors/xai-api-platform/src/api/client.ts +4 -3
- package/connectors/xai-api-platform/src/api/index.ts +1 -1
- package/connectors/xai-api-platform/src/index.ts +1 -1
- package/connectors/xai-api-platform/src/utils/config.ts +2 -3
- package/connectors/zapier-api-platform/CLAUDE.md +1 -1
- package/connectors/zapier-api-platform/README.md +1 -1
- package/connectors/zapier-api-platform/src/api/client.test.ts +19 -14
- package/connectors/zapier-api-platform/src/api/client.ts +4 -3
- package/connectors/zapier-api-platform/src/api/index.ts +1 -1
- package/connectors/zapier-api-platform/src/cli/index.ts +1 -1
- package/connectors/zapier-api-platform/src/index.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -1909,7 +1909,7 @@ var package_default;
|
|
|
1909
1909
|
var init_package = __esm(() => {
|
|
1910
1910
|
package_default = {
|
|
1911
1911
|
name: "@hasna/connectors",
|
|
1912
|
-
version: "1.4.
|
|
1912
|
+
version: "1.4.4",
|
|
1913
1913
|
description: "Open source connector library - Install API connectors with a single command",
|
|
1914
1914
|
type: "module",
|
|
1915
1915
|
bin: {
|
|
@@ -40436,7 +40436,7 @@ var init_powershell_utils = __esm(() => {
|
|
|
40436
40436
|
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
40437
40437
|
});
|
|
40438
40438
|
|
|
40439
|
-
// ../../node_modules/.bun/wsl-utils@0.
|
|
40439
|
+
// ../../node_modules/.bun/wsl-utils@1.0.0/node_modules/wsl-utils/utilities.js
|
|
40440
40440
|
function parseMountPointFromConfig(content) {
|
|
40441
40441
|
for (const line of content.split(`
|
|
40442
40442
|
`)) {
|
|
@@ -40451,7 +40451,8 @@ function parseMountPointFromConfig(content) {
|
|
|
40451
40451
|
}
|
|
40452
40452
|
}
|
|
40453
40453
|
|
|
40454
|
-
// ../../node_modules/.bun/wsl-utils@0.
|
|
40454
|
+
// ../../node_modules/.bun/wsl-utils@1.0.0/node_modules/wsl-utils/index.js
|
|
40455
|
+
import path from "path";
|
|
40455
40456
|
import { promisify as promisify2 } from "util";
|
|
40456
40457
|
import childProcess2 from "child_process";
|
|
40457
40458
|
import fs4, { constants as fsConstants } from "fs/promises";
|
|
@@ -40472,18 +40473,33 @@ var execFile2, wslDrivesMountPoint, powerShellPathFromWsl = async () => {
|
|
|
40472
40473
|
}, wslDefaultBrowser = async () => {
|
|
40473
40474
|
const psPath = await powerShellPath2();
|
|
40474
40475
|
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
40475
|
-
const { stdout } = await executePowerShell(command, {
|
|
40476
|
+
const { stdout } = await executePowerShell(command, {
|
|
40477
|
+
powerShellPath: psPath,
|
|
40478
|
+
cwd: path.dirname(psPath)
|
|
40479
|
+
});
|
|
40476
40480
|
return stdout.trim();
|
|
40477
|
-
}, convertWslPathToWindows = async (
|
|
40478
|
-
|
|
40479
|
-
|
|
40480
|
-
|
|
40481
|
-
|
|
40482
|
-
|
|
40483
|
-
|
|
40484
|
-
|
|
40485
|
-
|
|
40481
|
+
}, isUrl = (path2) => /^[a-z]+:\/\//i.test(path2), convertWslPathToWindows = async (paths) => {
|
|
40482
|
+
const isBatch = Array.isArray(paths);
|
|
40483
|
+
const pathArray = isBatch ? paths : [paths];
|
|
40484
|
+
const indicesToConvert = [];
|
|
40485
|
+
const pathsToConvert = [];
|
|
40486
|
+
for (const [index, path2] of pathArray.entries()) {
|
|
40487
|
+
if (!isUrl(path2)) {
|
|
40488
|
+
indicesToConvert.push(index);
|
|
40489
|
+
pathsToConvert.push(path2);
|
|
40490
|
+
}
|
|
40491
|
+
}
|
|
40492
|
+
const results = [...pathArray];
|
|
40493
|
+
if (pathsToConvert.length > 0) {
|
|
40494
|
+
try {
|
|
40495
|
+
const { stdout } = await execFile2("wslpath", ["-aw", ...pathsToConvert], { encoding: "utf8" });
|
|
40496
|
+
const convertedPaths = stdout.split(/\r?\n/).filter(Boolean);
|
|
40497
|
+
for (const [index, originalIndex] of indicesToConvert.entries()) {
|
|
40498
|
+
results[originalIndex] = convertedPaths[index] ?? pathArray[originalIndex];
|
|
40499
|
+
}
|
|
40500
|
+
} catch {}
|
|
40486
40501
|
}
|
|
40502
|
+
return isBatch ? results : results[0];
|
|
40487
40503
|
};
|
|
40488
40504
|
var init_wsl_utils = __esm(() => {
|
|
40489
40505
|
init_is_wsl();
|
|
@@ -40519,6 +40535,36 @@ var init_wsl_utils = __esm(() => {
|
|
|
40519
40535
|
powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
|
|
40520
40536
|
});
|
|
40521
40537
|
|
|
40538
|
+
// ../../node_modules/.bun/powershell-utils@0.2.0/node_modules/powershell-utils/index.js
|
|
40539
|
+
import process5 from "process";
|
|
40540
|
+
import { Buffer as Buffer4 } from "buffer";
|
|
40541
|
+
import { promisify as promisify3 } from "util";
|
|
40542
|
+
import childProcess3 from "child_process";
|
|
40543
|
+
var execFile3, powerShellPath3 = () => `${process5.env.SYSTEMROOT || process5.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, argumentsPrefix, encodeCommand = (command) => Buffer4.from(command, "utf16le").toString("base64"), escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`, createArguments = (command) => [...argumentsPrefix, encodeCommand(command)], executePowerShell2 = async (command, options = {}) => {
|
|
40544
|
+
const {
|
|
40545
|
+
powerShellPath: psPath,
|
|
40546
|
+
...execFileOptions
|
|
40547
|
+
} = options;
|
|
40548
|
+
return execFile3(psPath ?? powerShellPath3(), createArguments(command), {
|
|
40549
|
+
encoding: "utf8",
|
|
40550
|
+
...execFileOptions
|
|
40551
|
+
});
|
|
40552
|
+
};
|
|
40553
|
+
var init_powershell_utils2 = __esm(() => {
|
|
40554
|
+
execFile3 = promisify3(childProcess3.execFile);
|
|
40555
|
+
argumentsPrefix = [
|
|
40556
|
+
"-NoProfile",
|
|
40557
|
+
"-NonInteractive",
|
|
40558
|
+
"-ExecutionPolicy",
|
|
40559
|
+
"Bypass",
|
|
40560
|
+
"-EncodedCommand"
|
|
40561
|
+
];
|
|
40562
|
+
executePowerShell2.argumentsPrefix = argumentsPrefix;
|
|
40563
|
+
executePowerShell2.encodeCommand = encodeCommand;
|
|
40564
|
+
executePowerShell2.escapeArgument = escapeArgument;
|
|
40565
|
+
executePowerShell2.createArguments = createArguments;
|
|
40566
|
+
});
|
|
40567
|
+
|
|
40522
40568
|
// ../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
|
|
40523
40569
|
function defineLazyProperty(object4, propertyName, valueGetter) {
|
|
40524
40570
|
const define = (value) => Object.defineProperty(object4, propertyName, { value, enumerable: true, writable: true });
|
|
@@ -40538,11 +40584,11 @@ function defineLazyProperty(object4, propertyName, valueGetter) {
|
|
|
40538
40584
|
}
|
|
40539
40585
|
|
|
40540
40586
|
// ../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
40541
|
-
import { promisify as
|
|
40542
|
-
import
|
|
40543
|
-
import { execFile as
|
|
40587
|
+
import { promisify as promisify4 } from "util";
|
|
40588
|
+
import process6 from "process";
|
|
40589
|
+
import { execFile as execFile4 } from "child_process";
|
|
40544
40590
|
async function defaultBrowserId() {
|
|
40545
|
-
if (
|
|
40591
|
+
if (process6.platform !== "darwin") {
|
|
40546
40592
|
throw new Error("macOS only");
|
|
40547
40593
|
}
|
|
40548
40594
|
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
@@ -40555,15 +40601,15 @@ async function defaultBrowserId() {
|
|
|
40555
40601
|
}
|
|
40556
40602
|
var execFileAsync;
|
|
40557
40603
|
var init_default_browser_id = __esm(() => {
|
|
40558
|
-
execFileAsync =
|
|
40604
|
+
execFileAsync = promisify4(execFile4);
|
|
40559
40605
|
});
|
|
40560
40606
|
|
|
40561
40607
|
// ../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
40562
|
-
import
|
|
40563
|
-
import { promisify as
|
|
40564
|
-
import { execFile as
|
|
40608
|
+
import process7 from "process";
|
|
40609
|
+
import { promisify as promisify5 } from "util";
|
|
40610
|
+
import { execFile as execFile5, execFileSync } from "child_process";
|
|
40565
40611
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
40566
|
-
if (
|
|
40612
|
+
if (process7.platform !== "darwin") {
|
|
40567
40613
|
throw new Error("macOS only");
|
|
40568
40614
|
}
|
|
40569
40615
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
@@ -40576,7 +40622,7 @@ async function runAppleScript(script, { humanReadableOutput = true, signal } = {
|
|
|
40576
40622
|
}
|
|
40577
40623
|
var execFileAsync2;
|
|
40578
40624
|
var init_run_applescript = __esm(() => {
|
|
40579
|
-
execFileAsync2 =
|
|
40625
|
+
execFileAsync2 = promisify5(execFile5);
|
|
40580
40626
|
});
|
|
40581
40627
|
|
|
40582
40628
|
// ../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js
|
|
@@ -40588,11 +40634,13 @@ var init_bundle_name = __esm(() => {
|
|
|
40588
40634
|
init_run_applescript();
|
|
40589
40635
|
});
|
|
40590
40636
|
|
|
40591
|
-
// ../../node_modules/.bun/default-browser@5.5.
|
|
40592
|
-
import
|
|
40593
|
-
import {
|
|
40637
|
+
// ../../node_modules/.bun/default-browser@5.5.1/node_modules/default-browser/windows.js
|
|
40638
|
+
import process8 from "process";
|
|
40639
|
+
import { promisify as promisify6 } from "util";
|
|
40640
|
+
import { execFile as execFile6 } from "child_process";
|
|
40594
40641
|
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
40595
|
-
const {
|
|
40642
|
+
const regPath = `${process8.env.SYSTEMROOT ?? process8.env.windir ?? "C:\\Windows"}\\System32\\reg.exe`;
|
|
40643
|
+
const { stdout } = await _execFileAsync(regPath, [
|
|
40596
40644
|
"QUERY",
|
|
40597
40645
|
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
40598
40646
|
"/v",
|
|
@@ -40611,7 +40659,7 @@ async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
|
40611
40659
|
}
|
|
40612
40660
|
var execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError;
|
|
40613
40661
|
var init_windows = __esm(() => {
|
|
40614
|
-
execFileAsync3 =
|
|
40662
|
+
execFileAsync3 = promisify6(execFile6);
|
|
40615
40663
|
windowsBrowserProgIds = {
|
|
40616
40664
|
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
40617
40665
|
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
@@ -40635,23 +40683,23 @@ var init_windows = __esm(() => {
|
|
|
40635
40683
|
};
|
|
40636
40684
|
});
|
|
40637
40685
|
|
|
40638
|
-
// ../../node_modules/.bun/default-browser@5.5.
|
|
40639
|
-
import { promisify as
|
|
40640
|
-
import
|
|
40641
|
-
import { execFile as
|
|
40686
|
+
// ../../node_modules/.bun/default-browser@5.5.1/node_modules/default-browser/index.js
|
|
40687
|
+
import { promisify as promisify7 } from "util";
|
|
40688
|
+
import process9 from "process";
|
|
40689
|
+
import { execFile as execFile7 } from "child_process";
|
|
40642
40690
|
async function defaultBrowser2() {
|
|
40643
|
-
if (
|
|
40691
|
+
if (process9.platform === "darwin") {
|
|
40644
40692
|
const id = await defaultBrowserId();
|
|
40645
40693
|
const name = await bundleName(id);
|
|
40646
40694
|
return { name, id };
|
|
40647
40695
|
}
|
|
40648
|
-
if (
|
|
40696
|
+
if (process9.platform === "linux") {
|
|
40649
40697
|
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
40650
40698
|
const id = stdout.trim();
|
|
40651
40699
|
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
40652
40700
|
return { name, id };
|
|
40653
40701
|
}
|
|
40654
|
-
if (
|
|
40702
|
+
if (process9.platform === "win32") {
|
|
40655
40703
|
return defaultBrowser();
|
|
40656
40704
|
}
|
|
40657
40705
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
@@ -40662,22 +40710,22 @@ var init_default_browser = __esm(() => {
|
|
|
40662
40710
|
init_bundle_name();
|
|
40663
40711
|
init_windows();
|
|
40664
40712
|
init_windows();
|
|
40665
|
-
execFileAsync4 =
|
|
40713
|
+
execFileAsync4 = promisify7(execFile7);
|
|
40666
40714
|
});
|
|
40667
40715
|
|
|
40668
40716
|
// ../../node_modules/.bun/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
40669
|
-
import
|
|
40717
|
+
import process10 from "process";
|
|
40670
40718
|
var isInSsh, is_in_ssh_default;
|
|
40671
40719
|
var init_is_in_ssh = __esm(() => {
|
|
40672
|
-
isInSsh = Boolean(
|
|
40720
|
+
isInSsh = Boolean(process10.env.SSH_CONNECTION || process10.env.SSH_CLIENT || process10.env.SSH_TTY);
|
|
40673
40721
|
is_in_ssh_default = isInSsh;
|
|
40674
40722
|
});
|
|
40675
40723
|
|
|
40676
|
-
// ../../node_modules/.bun/open@11.0.
|
|
40677
|
-
import
|
|
40678
|
-
import
|
|
40724
|
+
// ../../node_modules/.bun/open@11.0.1/node_modules/open/index.js
|
|
40725
|
+
import process11 from "process";
|
|
40726
|
+
import path2 from "path";
|
|
40679
40727
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
40680
|
-
import
|
|
40728
|
+
import childProcess4 from "child_process";
|
|
40681
40729
|
import fs5, { constants as fsConstants2 } from "fs/promises";
|
|
40682
40730
|
function detectArchBinary(binary) {
|
|
40683
40731
|
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
@@ -40808,7 +40856,7 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
40808
40856
|
}
|
|
40809
40857
|
} else if (platform === "win32" || shouldUseWindowsInWsl) {
|
|
40810
40858
|
command = await powerShellPath2();
|
|
40811
|
-
cliArguments.push(...
|
|
40859
|
+
cliArguments.push(...executePowerShell2.argumentsPrefix);
|
|
40812
40860
|
if (!is_wsl_default) {
|
|
40813
40861
|
childProcessOptions.windowsVerbatimArguments = true;
|
|
40814
40862
|
}
|
|
@@ -40820,21 +40868,24 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
40820
40868
|
encodedArguments.push("-Wait");
|
|
40821
40869
|
}
|
|
40822
40870
|
if (app) {
|
|
40823
|
-
encodedArguments.push(
|
|
40871
|
+
encodedArguments.push(executePowerShell2.escapeArgument(app));
|
|
40824
40872
|
if (options.target) {
|
|
40825
40873
|
appArguments.push(options.target);
|
|
40826
40874
|
}
|
|
40827
40875
|
} else if (options.target) {
|
|
40828
|
-
encodedArguments.push(
|
|
40876
|
+
encodedArguments.push(executePowerShell2.escapeArgument(options.target));
|
|
40829
40877
|
}
|
|
40830
40878
|
if (appArguments.length > 0) {
|
|
40831
|
-
appArguments = appArguments.map((argument) =>
|
|
40879
|
+
appArguments = appArguments.map((argument) => executePowerShell2.escapeArgument(argument));
|
|
40832
40880
|
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
40833
40881
|
}
|
|
40834
|
-
options.target =
|
|
40882
|
+
options.target = executePowerShell2.encodeCommand(encodedArguments.join(" "));
|
|
40835
40883
|
if (!options.wait) {
|
|
40836
40884
|
childProcessOptions.stdio = "ignore";
|
|
40837
40885
|
}
|
|
40886
|
+
if (is_wsl_default) {
|
|
40887
|
+
childProcessOptions.cwd = path2.dirname(command);
|
|
40888
|
+
}
|
|
40838
40889
|
} else {
|
|
40839
40890
|
if (app) {
|
|
40840
40891
|
command = app;
|
|
@@ -40845,7 +40896,7 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
40845
40896
|
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
40846
40897
|
exeLocalXdgOpen = true;
|
|
40847
40898
|
} catch {}
|
|
40848
|
-
const useSystemXdgOpen =
|
|
40899
|
+
const useSystemXdgOpen = process11.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
40849
40900
|
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
40850
40901
|
}
|
|
40851
40902
|
if (appArguments.length > 0) {
|
|
@@ -40862,7 +40913,7 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
40862
40913
|
if (options.target) {
|
|
40863
40914
|
cliArguments.push(options.target);
|
|
40864
40915
|
}
|
|
40865
|
-
const subprocess =
|
|
40916
|
+
const subprocess = childProcess4.spawn(command, cliArguments, childProcessOptions);
|
|
40866
40917
|
if (options.wait) {
|
|
40867
40918
|
return new Promise((resolve, reject) => {
|
|
40868
40919
|
subprocess.once("error", reject);
|
|
@@ -40910,14 +40961,14 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
40910
40961
|
}, apps, open_default;
|
|
40911
40962
|
var init_open = __esm(() => {
|
|
40912
40963
|
init_wsl_utils();
|
|
40913
|
-
|
|
40964
|
+
init_powershell_utils2();
|
|
40914
40965
|
init_default_browser();
|
|
40915
40966
|
init_is_inside_container();
|
|
40916
40967
|
init_is_in_ssh();
|
|
40917
40968
|
fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
40918
|
-
__dirname6 = import.meta.url ?
|
|
40919
|
-
localXdgOpenPath =
|
|
40920
|
-
({ platform, arch } =
|
|
40969
|
+
__dirname6 = import.meta.url ? path2.dirname(fileURLToPath6(import.meta.url)) : "";
|
|
40970
|
+
localXdgOpenPath = path2.join(__dirname6, "xdg-open");
|
|
40971
|
+
({ platform, arch } = process11);
|
|
40921
40972
|
apps = {
|
|
40922
40973
|
browser: "browser",
|
|
40923
40974
|
browserPrivate: "browserPrivate"
|
|
@@ -41150,12 +41201,12 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
41150
41201
|
port,
|
|
41151
41202
|
async fetch(req) {
|
|
41152
41203
|
const url2 = new URL(req.url);
|
|
41153
|
-
const
|
|
41204
|
+
const path3 = url2.pathname;
|
|
41154
41205
|
const method = req.method;
|
|
41155
41206
|
const mcpResponse = await handleMcpHttpRequest(req);
|
|
41156
41207
|
if (mcpResponse)
|
|
41157
41208
|
return mcpResponse;
|
|
41158
|
-
if (
|
|
41209
|
+
if (path3 === "/api/connectors" && method === "GET") {
|
|
41159
41210
|
const compact = url2.searchParams.get("compact") === "true";
|
|
41160
41211
|
const fieldsParam = url2.searchParams.get("fields");
|
|
41161
41212
|
const fields = fieldsParam ? new Set(fieldsParam.split(",").map((f) => f.trim())) : null;
|
|
@@ -41175,7 +41226,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
41175
41226
|
}
|
|
41176
41227
|
return jsonStripped(data, 200, port);
|
|
41177
41228
|
}
|
|
41178
|
-
if (
|
|
41229
|
+
if (path3 === "/api/connectors/manifest" && method === "GET") {
|
|
41179
41230
|
const connectorNames = url2.searchParams.get("connectors")?.split(",").map((name) => name.trim()).filter(Boolean);
|
|
41180
41231
|
const includeOperations = url2.searchParams.get("includeOperations") === "true";
|
|
41181
41232
|
const manifest = await getConnectorCapabilityManifest({
|
|
@@ -41184,7 +41235,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
41184
41235
|
});
|
|
41185
41236
|
return json(manifest, 200, port);
|
|
41186
41237
|
}
|
|
41187
|
-
const singleMatch =
|
|
41238
|
+
const singleMatch = path3.match(/^\/api\/connectors\/([^/]+)$/);
|
|
41188
41239
|
if (singleMatch && method === "GET") {
|
|
41189
41240
|
const name = singleMatch[1];
|
|
41190
41241
|
if (!isValidConnectorName(name))
|
|
@@ -41204,7 +41255,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
41204
41255
|
overview: docs?.overview || null
|
|
41205
41256
|
}, 200, port);
|
|
41206
41257
|
}
|
|
41207
|
-
const operationsMatch =
|
|
41258
|
+
const operationsMatch = path3.match(/^\/api\/connectors\/([^/]+)\/operations$/);
|
|
41208
41259
|
if (operationsMatch && method === "GET") {
|
|
41209
41260
|
const name = operationsMatch[1];
|
|
41210
41261
|
if (!isValidConnectorName(name))
|
|
@@ -41225,7 +41276,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
41225
41276
|
helpText: ops.helpText
|
|
41226
41277
|
}, 200, port);
|
|
41227
41278
|
}
|
|
41228
|
-
const operationHelpMatch =
|
|
41279
|
+
const operationHelpMatch = path3.match(/^\/api\/connectors\/([^/]+)\/operations\/([^/]+)$/);
|
|
41229
41280
|
if (operationHelpMatch && method === "GET") {
|
|
41230
41281
|
const name = operationHelpMatch[1];
|
|
41231
41282
|
const command = decodeURIComponent(operationHelpMatch[2]);
|
|
@@ -41240,7 +41291,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
41240
41291
|
const help = await getConnectorCommandHelp(name, command);
|
|
41241
41292
|
return json({ connector: name, displayName: meta.displayName, command, help }, 200, port);
|
|
41242
41293
|
}
|
|
41243
|
-
const operationRunMatch =
|
|
41294
|
+
const operationRunMatch = path3.match(/^\/api\/connectors\/([^/]+)\/operations\/run$/);
|
|
41244
41295
|
if (operationRunMatch && method === "POST") {
|
|
41245
41296
|
const name = operationRunMatch[1];
|
|
41246
41297
|
if (!isValidConnectorName(name))
|
|
@@ -41304,7 +41355,7 @@ ${result.stderr}`;
|
|
|
41304
41355
|
}, 500, port);
|
|
41305
41356
|
}
|
|
41306
41357
|
}
|
|
41307
|
-
const keyMatch =
|
|
41358
|
+
const keyMatch = path3.match(/^\/api\/connectors\/([^/]+)\/key$/);
|
|
41308
41359
|
if (keyMatch && method === "POST") {
|
|
41309
41360
|
const name = keyMatch[1];
|
|
41310
41361
|
if (!isValidConnectorName(name))
|
|
@@ -41323,7 +41374,7 @@ ${result.stderr}`;
|
|
|
41323
41374
|
return json({ error: e instanceof Error ? e.message : "Failed to save key" }, 500, port);
|
|
41324
41375
|
}
|
|
41325
41376
|
}
|
|
41326
|
-
const refreshMatch =
|
|
41377
|
+
const refreshMatch = path3.match(/^\/api\/connectors\/([^/]+)\/refresh$/);
|
|
41327
41378
|
if (refreshMatch && method === "POST") {
|
|
41328
41379
|
const name = refreshMatch[1];
|
|
41329
41380
|
if (!isValidConnectorName(name))
|
|
@@ -41336,7 +41387,7 @@ ${result.stderr}`;
|
|
|
41336
41387
|
return json({ success: false, error: e instanceof Error ? e.message : "Failed to refresh" }, 500, port);
|
|
41337
41388
|
}
|
|
41338
41389
|
}
|
|
41339
|
-
const installMatch =
|
|
41390
|
+
const installMatch = path3.match(/^\/api\/connectors\/([^/]+)\/install$/);
|
|
41340
41391
|
if (installMatch && method === "POST") {
|
|
41341
41392
|
const name = installMatch[1];
|
|
41342
41393
|
if (!isValidConnectorName(name))
|
|
@@ -41355,7 +41406,7 @@ ${result.stderr}`;
|
|
|
41355
41406
|
return json({ error: e instanceof Error ? e.message : "Failed to install connector" }, 500, port);
|
|
41356
41407
|
}
|
|
41357
41408
|
}
|
|
41358
|
-
const uninstallMatch =
|
|
41409
|
+
const uninstallMatch = path3.match(/^\/api\/connectors\/([^/]+)\/uninstall$/);
|
|
41359
41410
|
if (uninstallMatch && method === "POST") {
|
|
41360
41411
|
const name = uninstallMatch[1];
|
|
41361
41412
|
if (!isValidConnectorName(name))
|
|
@@ -41371,7 +41422,7 @@ ${result.stderr}`;
|
|
|
41371
41422
|
return json({ error: e instanceof Error ? e.message : "Failed to uninstall connector" }, 500, port);
|
|
41372
41423
|
}
|
|
41373
41424
|
}
|
|
41374
|
-
if (
|
|
41425
|
+
if (path3 === "/api/update" && method === "POST") {
|
|
41375
41426
|
try {
|
|
41376
41427
|
const installed = getInstalledConnectors();
|
|
41377
41428
|
if (installed.length === 0) {
|
|
@@ -41387,10 +41438,10 @@ ${result.stderr}`;
|
|
|
41387
41438
|
return json({ error: e instanceof Error ? e.message : "Failed to update" }, 500, port);
|
|
41388
41439
|
}
|
|
41389
41440
|
}
|
|
41390
|
-
if (
|
|
41441
|
+
if (path3 === "/api/activity" && method === "GET") {
|
|
41391
41442
|
return json(activityLog, 200, port);
|
|
41392
41443
|
}
|
|
41393
|
-
if (
|
|
41444
|
+
if (path3 === "/api/hot" && method === "GET") {
|
|
41394
41445
|
const { getTopConnectors: getTopConnectors2 } = await Promise.resolve().then(() => (init_usage(), exports_usage));
|
|
41395
41446
|
const { getPromotedConnectors: getPromotedConnectors2 } = await Promise.resolve().then(() => (init_promotions(), exports_promotions));
|
|
41396
41447
|
const limit = parseInt(url2.searchParams.get("limit") || "10", 10);
|
|
@@ -41400,7 +41451,7 @@ ${result.stderr}`;
|
|
|
41400
41451
|
const promoted = new Set(getPromotedConnectors2(db));
|
|
41401
41452
|
return json(top.map((t) => ({ ...t, promoted: promoted.has(t.connector) })), 200, port);
|
|
41402
41453
|
}
|
|
41403
|
-
const promoteMatch =
|
|
41454
|
+
const promoteMatch = path3.match(/^\/api\/connectors\/([^/]+)\/promote$/);
|
|
41404
41455
|
if (promoteMatch && method === "POST") {
|
|
41405
41456
|
const name = promoteMatch[1];
|
|
41406
41457
|
if (!getConnector(name))
|
|
@@ -41414,13 +41465,13 @@ ${result.stderr}`;
|
|
|
41414
41465
|
const removed = demoteConnector2(promoteMatch[1], getDatabase3());
|
|
41415
41466
|
return json({ success: removed, connector: promoteMatch[1] }, 200, port);
|
|
41416
41467
|
}
|
|
41417
|
-
if (
|
|
41468
|
+
if (path3 === "/api/llm" && method === "GET") {
|
|
41418
41469
|
const config2 = getLlmConfig();
|
|
41419
41470
|
if (!config2)
|
|
41420
41471
|
return json({ configured: false }, 200, port);
|
|
41421
41472
|
return json({ configured: true, provider: config2.provider, model: config2.model, key: maskKey(config2.api_key), strip: config2.strip }, 200, port);
|
|
41422
41473
|
}
|
|
41423
|
-
if (
|
|
41474
|
+
if (path3 === "/api/llm" && method === "POST") {
|
|
41424
41475
|
const body = await req.json().catch(() => ({}));
|
|
41425
41476
|
const validProviders = ["cerebras", "groq", "openai", "anthropic"];
|
|
41426
41477
|
const provider = body.provider;
|
|
@@ -41434,7 +41485,7 @@ ${result.stderr}`;
|
|
|
41434
41485
|
saveLlmConfig({ provider, model, api_key, strip });
|
|
41435
41486
|
return json({ success: true, provider, model, strip }, 200, port);
|
|
41436
41487
|
}
|
|
41437
|
-
if (
|
|
41488
|
+
if (path3 === "/api/llm/test" && method === "POST") {
|
|
41438
41489
|
const config2 = getLlmConfig();
|
|
41439
41490
|
if (!config2)
|
|
41440
41491
|
return json({ error: "No LLM configured" }, 400, port);
|
|
@@ -41446,17 +41497,17 @@ ${result.stderr}`;
|
|
|
41446
41497
|
return json({ success: false, error: e instanceof Error ? e.message : String(e) }, 500, port);
|
|
41447
41498
|
}
|
|
41448
41499
|
}
|
|
41449
|
-
if (
|
|
41500
|
+
if (path3 === "/api/jobs" && method === "GET") {
|
|
41450
41501
|
return json(listJobs(getDatabase3()), 200, port);
|
|
41451
41502
|
}
|
|
41452
|
-
if (
|
|
41503
|
+
if (path3 === "/api/jobs" && method === "POST") {
|
|
41453
41504
|
const body = await req.json().catch(() => ({}));
|
|
41454
41505
|
if (!body.name || !body.connector || !body.command || !body.cron)
|
|
41455
41506
|
return json({ error: "name, connector, command, cron required" }, 400, port);
|
|
41456
41507
|
const job = createJob({ name: body.name, connector: body.connector, command: body.command, args: body.args ?? [], cron: body.cron, strip: !!body.strip }, getDatabase3());
|
|
41457
41508
|
return json(job, 201, port);
|
|
41458
41509
|
}
|
|
41459
|
-
const jobMatch =
|
|
41510
|
+
const jobMatch = path3.match(/^\/api\/jobs\/([^/]+)$/);
|
|
41460
41511
|
if (jobMatch) {
|
|
41461
41512
|
const db = getDatabase3();
|
|
41462
41513
|
const job = getJobByName(jobMatch[1]) ?? getDatabase3().query("SELECT * FROM connector_jobs WHERE id = ?").get(jobMatch[1]);
|
|
@@ -41478,7 +41529,7 @@ ${result.stderr}`;
|
|
|
41478
41529
|
return json(updated, 200, port);
|
|
41479
41530
|
}
|
|
41480
41531
|
}
|
|
41481
|
-
const jobRunMatch =
|
|
41532
|
+
const jobRunMatch = path3.match(/^\/api\/jobs\/([^/]+)\/run$/);
|
|
41482
41533
|
if (jobRunMatch && method === "POST") {
|
|
41483
41534
|
const db = getDatabase3();
|
|
41484
41535
|
const job = getJobByName(jobRunMatch[1], db);
|
|
@@ -41487,17 +41538,17 @@ ${result.stderr}`;
|
|
|
41487
41538
|
const result = await triggerJob(job, db);
|
|
41488
41539
|
return json(result, 200, port);
|
|
41489
41540
|
}
|
|
41490
|
-
if (
|
|
41541
|
+
if (path3 === "/api/workflows" && method === "GET") {
|
|
41491
41542
|
return json(listWorkflows(getDatabase3()), 200, port);
|
|
41492
41543
|
}
|
|
41493
|
-
if (
|
|
41544
|
+
if (path3 === "/api/workflows" && method === "POST") {
|
|
41494
41545
|
const body = await req.json().catch(() => ({}));
|
|
41495
41546
|
if (!body.name || !body.steps)
|
|
41496
41547
|
return json({ error: "name and steps required" }, 400, port);
|
|
41497
41548
|
const wf = createWorkflow({ name: body.name, steps: body.steps }, getDatabase3());
|
|
41498
41549
|
return json(wf, 201, port);
|
|
41499
41550
|
}
|
|
41500
|
-
const wfMatch =
|
|
41551
|
+
const wfMatch = path3.match(/^\/api\/workflows\/([^/]+)$/);
|
|
41501
41552
|
if (wfMatch) {
|
|
41502
41553
|
const db = getDatabase3();
|
|
41503
41554
|
const wf = getWorkflowByName(wfMatch[1], db);
|
|
@@ -41510,7 +41561,7 @@ ${result.stderr}`;
|
|
|
41510
41561
|
return json({ success: true }, 200, port);
|
|
41511
41562
|
}
|
|
41512
41563
|
}
|
|
41513
|
-
const wfRunMatch =
|
|
41564
|
+
const wfRunMatch = path3.match(/^\/api\/workflows\/([^/]+)\/run$/);
|
|
41514
41565
|
if (wfRunMatch && method === "POST") {
|
|
41515
41566
|
const wf = getWorkflowByName(wfRunMatch[1], getDatabase3());
|
|
41516
41567
|
if (!wf)
|
|
@@ -41518,10 +41569,10 @@ ${result.stderr}`;
|
|
|
41518
41569
|
const result = await runWorkflow(wf);
|
|
41519
41570
|
return json(result, 200, port);
|
|
41520
41571
|
}
|
|
41521
|
-
if (
|
|
41572
|
+
if (path3 === "/api/agents" && method === "GET") {
|
|
41522
41573
|
return json(listAgents(), 200, port);
|
|
41523
41574
|
}
|
|
41524
|
-
if (
|
|
41575
|
+
if (path3 === "/api/agents/register" && method === "POST") {
|
|
41525
41576
|
const body = await req.json().catch(() => ({}));
|
|
41526
41577
|
const name = typeof body.name === "string" ? body.name : null;
|
|
41527
41578
|
if (!name)
|
|
@@ -41535,15 +41586,15 @@ ${result.stderr}`;
|
|
|
41535
41586
|
return json(result, 409, port);
|
|
41536
41587
|
return json(result, 200, port);
|
|
41537
41588
|
}
|
|
41538
|
-
if (
|
|
41539
|
-
const agentName =
|
|
41589
|
+
if (path3.startsWith("/api/agents/") && method === "DELETE") {
|
|
41590
|
+
const agentName = path3.slice("/api/agents/".length);
|
|
41540
41591
|
const agent = getAgentByName(agentName);
|
|
41541
41592
|
if (!agent)
|
|
41542
41593
|
return json({ error: "Agent not found" }, 404, port);
|
|
41543
41594
|
deleteAgent(agent.id);
|
|
41544
41595
|
return json({ success: true }, 200, port);
|
|
41545
41596
|
}
|
|
41546
|
-
const rateMatch =
|
|
41597
|
+
const rateMatch = path3.match(/^\/api\/rate\/([^/]+)\/([^/]+)$/);
|
|
41547
41598
|
if (rateMatch && method === "GET") {
|
|
41548
41599
|
const [, agentId, connector] = rateMatch;
|
|
41549
41600
|
const limit = parseInt(url2.searchParams.get("limit") || "60", 10);
|
|
@@ -41551,7 +41602,7 @@ ${result.stderr}`;
|
|
|
41551
41602
|
const result = consume ? checkRateBudget(agentId, connector, limit) : getRateBudget(agentId, connector, limit);
|
|
41552
41603
|
return json(result, 200, port);
|
|
41553
41604
|
}
|
|
41554
|
-
const profilesMatch =
|
|
41605
|
+
const profilesMatch = path3.match(/^\/api\/connectors\/([^/]+)\/profiles$/);
|
|
41555
41606
|
if (profilesMatch && method === "GET") {
|
|
41556
41607
|
const name = profilesMatch[1];
|
|
41557
41608
|
if (!isValidConnectorName(name))
|
|
@@ -41573,7 +41624,7 @@ ${result.stderr}`;
|
|
|
41573
41624
|
return json({ error: e instanceof Error ? e.message : "Failed to list profiles" }, 500, port);
|
|
41574
41625
|
}
|
|
41575
41626
|
}
|
|
41576
|
-
const profileSwitchMatch =
|
|
41627
|
+
const profileSwitchMatch = path3.match(/^\/api\/connectors\/([^/]+)\/profiles\/switch$/);
|
|
41577
41628
|
if (profileSwitchMatch && method === "POST") {
|
|
41578
41629
|
const name = profileSwitchMatch[1];
|
|
41579
41630
|
if (!isValidConnectorName(name))
|
|
@@ -41592,7 +41643,7 @@ ${result.stderr}`;
|
|
|
41592
41643
|
return json({ error: e instanceof Error ? e.message : "Failed to switch profile" }, 500, port);
|
|
41593
41644
|
}
|
|
41594
41645
|
}
|
|
41595
|
-
const profileDeleteMatch =
|
|
41646
|
+
const profileDeleteMatch = path3.match(/^\/api\/connectors\/([^/]+)\/profiles\/([^/]+)$/);
|
|
41596
41647
|
if (profileDeleteMatch && method === "DELETE") {
|
|
41597
41648
|
const name = profileDeleteMatch[1];
|
|
41598
41649
|
const profile = profileDeleteMatch[2];
|
|
@@ -41610,7 +41661,7 @@ ${result.stderr}`;
|
|
|
41610
41661
|
return json({ error: e instanceof Error ? e.message : "Failed to delete profile" }, 500, port);
|
|
41611
41662
|
}
|
|
41612
41663
|
}
|
|
41613
|
-
if (
|
|
41664
|
+
if (path3 === "/api/export" && method === "GET") {
|
|
41614
41665
|
try {
|
|
41615
41666
|
const connectDir = getConnectorsHome();
|
|
41616
41667
|
const result = {};
|
|
@@ -41660,7 +41711,7 @@ ${result.stderr}`;
|
|
|
41660
41711
|
return json({ error: e instanceof Error ? e.message : "Failed to export credentials" }, 500, port);
|
|
41661
41712
|
}
|
|
41662
41713
|
}
|
|
41663
|
-
if (
|
|
41714
|
+
if (path3 === "/api/import" && method === "POST") {
|
|
41664
41715
|
try {
|
|
41665
41716
|
const contentLength = parseInt(req.headers.get("content-length") || "0", 10);
|
|
41666
41717
|
if (contentLength > MAX_BODY_SIZE)
|
|
@@ -41693,7 +41744,7 @@ ${result.stderr}`;
|
|
|
41693
41744
|
return json({ error: e instanceof Error ? e.message : "Failed to import credentials" }, 500, port);
|
|
41694
41745
|
}
|
|
41695
41746
|
}
|
|
41696
|
-
const oauthStartMatch =
|
|
41747
|
+
const oauthStartMatch = path3.match(/^\/oauth\/([^/]+)\/start$/);
|
|
41697
41748
|
if (oauthStartMatch && method === "GET") {
|
|
41698
41749
|
const name = oauthStartMatch[1];
|
|
41699
41750
|
const redirectUri = `http://localhost:${port}/oauth/${name}/callback`;
|
|
@@ -41703,7 +41754,7 @@ ${result.stderr}`;
|
|
|
41703
41754
|
}
|
|
41704
41755
|
return Response.redirect(authUrl, 302);
|
|
41705
41756
|
}
|
|
41706
|
-
const oauthCallbackMatch =
|
|
41757
|
+
const oauthCallbackMatch = path3.match(/^\/oauth\/([^/]+)\/callback$/);
|
|
41707
41758
|
if (oauthCallbackMatch && method === "GET") {
|
|
41708
41759
|
const name = oauthCallbackMatch[1];
|
|
41709
41760
|
const code = url2.searchParams.get("code");
|
|
@@ -41737,8 +41788,8 @@ ${result.stderr}`;
|
|
|
41737
41788
|
});
|
|
41738
41789
|
}
|
|
41739
41790
|
if (dashboardExists && (method === "GET" || method === "HEAD")) {
|
|
41740
|
-
if (
|
|
41741
|
-
const filePath = join15(dashboardDir,
|
|
41791
|
+
if (path3 !== "/") {
|
|
41792
|
+
const filePath = join15(dashboardDir, path3);
|
|
41742
41793
|
const rel = relative2(dashboardDir, resolve(filePath));
|
|
41743
41794
|
if (!rel.startsWith("..") && !rel.includes(`..${sep}`) && rel !== "") {
|
|
41744
41795
|
const res2 = serveStaticFile(filePath);
|
|
@@ -45115,10 +45166,6 @@ var TEST_ENDPOINTS = {
|
|
|
45115
45166
|
url: "https://api.x.ai/v1/models",
|
|
45116
45167
|
headers: (key) => ({ Authorization: `Bearer ${key}` })
|
|
45117
45168
|
},
|
|
45118
|
-
["xai" + "-api-platform"]: {
|
|
45119
|
-
url: "https://api.xaiapiplatform.com/v1/items",
|
|
45120
|
-
headers: (key) => ({ Authorization: `Bearer ${key}` })
|
|
45121
|
-
},
|
|
45122
45169
|
mistral: {
|
|
45123
45170
|
url: "https://api.mistral.ai/v1/models",
|
|
45124
45171
|
headers: (key) => ({ Authorization: `Bearer ${key}` })
|
|
@@ -45750,7 +45797,7 @@ Testing connector credentials...
|
|
|
45750
45797
|
break;
|
|
45751
45798
|
}
|
|
45752
45799
|
}
|
|
45753
|
-
const tokensFile = connectorConfigDirs.map((dir) => join18(dir, "profiles", currentProfile, "tokens.json")).find((
|
|
45800
|
+
const tokensFile = connectorConfigDirs.map((dir) => join18(dir, "profiles", currentProfile, "tokens.json")).find((path3) => existsSync18(path3));
|
|
45754
45801
|
if (tokensFile) {
|
|
45755
45802
|
try {
|
|
45756
45803
|
const tokens = JSON.parse(readFileSync12(tokensFile, "utf-8"));
|
package/bin/mcp.js
CHANGED
|
@@ -5804,7 +5804,7 @@ var package_default;
|
|
|
5804
5804
|
var init_package = __esm(() => {
|
|
5805
5805
|
package_default = {
|
|
5806
5806
|
name: "@hasna/connectors",
|
|
5807
|
-
version: "1.4.
|
|
5807
|
+
version: "1.4.4",
|
|
5808
5808
|
description: "Open source connector library - Install API connectors with a single command",
|
|
5809
5809
|
type: "module",
|
|
5810
5810
|
bin: {
|