@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/serve.js
CHANGED
|
@@ -6433,7 +6433,7 @@ var package_default;
|
|
|
6433
6433
|
var init_package = __esm(() => {
|
|
6434
6434
|
package_default = {
|
|
6435
6435
|
name: "@hasna/connectors",
|
|
6436
|
-
version: "1.4.
|
|
6436
|
+
version: "1.4.4",
|
|
6437
6437
|
description: "Open source connector library - Install API connectors with a single command",
|
|
6438
6438
|
type: "module",
|
|
6439
6439
|
bin: {
|
|
@@ -16720,7 +16720,7 @@ var init_powershell_utils = __esm(() => {
|
|
|
16720
16720
|
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
16721
16721
|
});
|
|
16722
16722
|
|
|
16723
|
-
// ../../node_modules/.bun/wsl-utils@0.
|
|
16723
|
+
// ../../node_modules/.bun/wsl-utils@1.0.0/node_modules/wsl-utils/utilities.js
|
|
16724
16724
|
function parseMountPointFromConfig(content) {
|
|
16725
16725
|
for (const line of content.split(`
|
|
16726
16726
|
`)) {
|
|
@@ -16735,7 +16735,8 @@ function parseMountPointFromConfig(content) {
|
|
|
16735
16735
|
}
|
|
16736
16736
|
}
|
|
16737
16737
|
|
|
16738
|
-
// ../../node_modules/.bun/wsl-utils@0.
|
|
16738
|
+
// ../../node_modules/.bun/wsl-utils@1.0.0/node_modules/wsl-utils/index.js
|
|
16739
|
+
import path from "path";
|
|
16739
16740
|
import { promisify as promisify2 } from "util";
|
|
16740
16741
|
import childProcess2 from "child_process";
|
|
16741
16742
|
import fs4, { constants as fsConstants } from "fs/promises";
|
|
@@ -16756,18 +16757,33 @@ var execFile2, wslDrivesMountPoint, powerShellPathFromWsl = async () => {
|
|
|
16756
16757
|
}, wslDefaultBrowser = async () => {
|
|
16757
16758
|
const psPath = await powerShellPath2();
|
|
16758
16759
|
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
16759
|
-
const { stdout } = await executePowerShell(command, {
|
|
16760
|
+
const { stdout } = await executePowerShell(command, {
|
|
16761
|
+
powerShellPath: psPath,
|
|
16762
|
+
cwd: path.dirname(psPath)
|
|
16763
|
+
});
|
|
16760
16764
|
return stdout.trim();
|
|
16761
|
-
}, convertWslPathToWindows = async (
|
|
16762
|
-
|
|
16763
|
-
|
|
16764
|
-
|
|
16765
|
-
|
|
16766
|
-
|
|
16767
|
-
|
|
16768
|
-
|
|
16769
|
-
|
|
16765
|
+
}, isUrl = (path2) => /^[a-z]+:\/\//i.test(path2), convertWslPathToWindows = async (paths) => {
|
|
16766
|
+
const isBatch = Array.isArray(paths);
|
|
16767
|
+
const pathArray = isBatch ? paths : [paths];
|
|
16768
|
+
const indicesToConvert = [];
|
|
16769
|
+
const pathsToConvert = [];
|
|
16770
|
+
for (const [index, path2] of pathArray.entries()) {
|
|
16771
|
+
if (!isUrl(path2)) {
|
|
16772
|
+
indicesToConvert.push(index);
|
|
16773
|
+
pathsToConvert.push(path2);
|
|
16774
|
+
}
|
|
16775
|
+
}
|
|
16776
|
+
const results = [...pathArray];
|
|
16777
|
+
if (pathsToConvert.length > 0) {
|
|
16778
|
+
try {
|
|
16779
|
+
const { stdout } = await execFile2("wslpath", ["-aw", ...pathsToConvert], { encoding: "utf8" });
|
|
16780
|
+
const convertedPaths = stdout.split(/\r?\n/).filter(Boolean);
|
|
16781
|
+
for (const [index, originalIndex] of indicesToConvert.entries()) {
|
|
16782
|
+
results[originalIndex] = convertedPaths[index] ?? pathArray[originalIndex];
|
|
16783
|
+
}
|
|
16784
|
+
} catch {}
|
|
16770
16785
|
}
|
|
16786
|
+
return isBatch ? results : results[0];
|
|
16771
16787
|
};
|
|
16772
16788
|
var init_wsl_utils = __esm(() => {
|
|
16773
16789
|
init_is_wsl();
|
|
@@ -16803,6 +16819,36 @@ var init_wsl_utils = __esm(() => {
|
|
|
16803
16819
|
powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
|
|
16804
16820
|
});
|
|
16805
16821
|
|
|
16822
|
+
// ../../node_modules/.bun/powershell-utils@0.2.0/node_modules/powershell-utils/index.js
|
|
16823
|
+
import process4 from "process";
|
|
16824
|
+
import { Buffer as Buffer4 } from "buffer";
|
|
16825
|
+
import { promisify as promisify3 } from "util";
|
|
16826
|
+
import childProcess3 from "child_process";
|
|
16827
|
+
var execFile3, powerShellPath3 = () => `${process4.env.SYSTEMROOT || process4.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 = {}) => {
|
|
16828
|
+
const {
|
|
16829
|
+
powerShellPath: psPath,
|
|
16830
|
+
...execFileOptions
|
|
16831
|
+
} = options;
|
|
16832
|
+
return execFile3(psPath ?? powerShellPath3(), createArguments(command), {
|
|
16833
|
+
encoding: "utf8",
|
|
16834
|
+
...execFileOptions
|
|
16835
|
+
});
|
|
16836
|
+
};
|
|
16837
|
+
var init_powershell_utils2 = __esm(() => {
|
|
16838
|
+
execFile3 = promisify3(childProcess3.execFile);
|
|
16839
|
+
argumentsPrefix = [
|
|
16840
|
+
"-NoProfile",
|
|
16841
|
+
"-NonInteractive",
|
|
16842
|
+
"-ExecutionPolicy",
|
|
16843
|
+
"Bypass",
|
|
16844
|
+
"-EncodedCommand"
|
|
16845
|
+
];
|
|
16846
|
+
executePowerShell2.argumentsPrefix = argumentsPrefix;
|
|
16847
|
+
executePowerShell2.encodeCommand = encodeCommand;
|
|
16848
|
+
executePowerShell2.escapeArgument = escapeArgument;
|
|
16849
|
+
executePowerShell2.createArguments = createArguments;
|
|
16850
|
+
});
|
|
16851
|
+
|
|
16806
16852
|
// ../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
|
|
16807
16853
|
function defineLazyProperty(object4, propertyName, valueGetter) {
|
|
16808
16854
|
const define = (value) => Object.defineProperty(object4, propertyName, { value, enumerable: true, writable: true });
|
|
@@ -16822,11 +16868,11 @@ function defineLazyProperty(object4, propertyName, valueGetter) {
|
|
|
16822
16868
|
}
|
|
16823
16869
|
|
|
16824
16870
|
// ../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
16825
|
-
import { promisify as
|
|
16826
|
-
import
|
|
16827
|
-
import { execFile as
|
|
16871
|
+
import { promisify as promisify4 } from "util";
|
|
16872
|
+
import process5 from "process";
|
|
16873
|
+
import { execFile as execFile4 } from "child_process";
|
|
16828
16874
|
async function defaultBrowserId() {
|
|
16829
|
-
if (
|
|
16875
|
+
if (process5.platform !== "darwin") {
|
|
16830
16876
|
throw new Error("macOS only");
|
|
16831
16877
|
}
|
|
16832
16878
|
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
@@ -16839,15 +16885,15 @@ async function defaultBrowserId() {
|
|
|
16839
16885
|
}
|
|
16840
16886
|
var execFileAsync;
|
|
16841
16887
|
var init_default_browser_id = __esm(() => {
|
|
16842
|
-
execFileAsync =
|
|
16888
|
+
execFileAsync = promisify4(execFile4);
|
|
16843
16889
|
});
|
|
16844
16890
|
|
|
16845
16891
|
// ../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
16846
|
-
import
|
|
16847
|
-
import { promisify as
|
|
16848
|
-
import { execFile as
|
|
16892
|
+
import process6 from "process";
|
|
16893
|
+
import { promisify as promisify5 } from "util";
|
|
16894
|
+
import { execFile as execFile5, execFileSync } from "child_process";
|
|
16849
16895
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
16850
|
-
if (
|
|
16896
|
+
if (process6.platform !== "darwin") {
|
|
16851
16897
|
throw new Error("macOS only");
|
|
16852
16898
|
}
|
|
16853
16899
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
@@ -16860,7 +16906,7 @@ async function runAppleScript(script, { humanReadableOutput = true, signal } = {
|
|
|
16860
16906
|
}
|
|
16861
16907
|
var execFileAsync2;
|
|
16862
16908
|
var init_run_applescript = __esm(() => {
|
|
16863
|
-
execFileAsync2 =
|
|
16909
|
+
execFileAsync2 = promisify5(execFile5);
|
|
16864
16910
|
});
|
|
16865
16911
|
|
|
16866
16912
|
// ../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js
|
|
@@ -16872,11 +16918,13 @@ var init_bundle_name = __esm(() => {
|
|
|
16872
16918
|
init_run_applescript();
|
|
16873
16919
|
});
|
|
16874
16920
|
|
|
16875
|
-
// ../../node_modules/.bun/default-browser@5.5.
|
|
16876
|
-
import
|
|
16877
|
-
import {
|
|
16921
|
+
// ../../node_modules/.bun/default-browser@5.5.1/node_modules/default-browser/windows.js
|
|
16922
|
+
import process7 from "process";
|
|
16923
|
+
import { promisify as promisify6 } from "util";
|
|
16924
|
+
import { execFile as execFile6 } from "child_process";
|
|
16878
16925
|
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
16879
|
-
const {
|
|
16926
|
+
const regPath = `${process7.env.SYSTEMROOT ?? process7.env.windir ?? "C:\\Windows"}\\System32\\reg.exe`;
|
|
16927
|
+
const { stdout } = await _execFileAsync(regPath, [
|
|
16880
16928
|
"QUERY",
|
|
16881
16929
|
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
16882
16930
|
"/v",
|
|
@@ -16895,7 +16943,7 @@ async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
|
16895
16943
|
}
|
|
16896
16944
|
var execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError;
|
|
16897
16945
|
var init_windows = __esm(() => {
|
|
16898
|
-
execFileAsync3 =
|
|
16946
|
+
execFileAsync3 = promisify6(execFile6);
|
|
16899
16947
|
windowsBrowserProgIds = {
|
|
16900
16948
|
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
16901
16949
|
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
@@ -16919,23 +16967,23 @@ var init_windows = __esm(() => {
|
|
|
16919
16967
|
};
|
|
16920
16968
|
});
|
|
16921
16969
|
|
|
16922
|
-
// ../../node_modules/.bun/default-browser@5.5.
|
|
16923
|
-
import { promisify as
|
|
16924
|
-
import
|
|
16925
|
-
import { execFile as
|
|
16970
|
+
// ../../node_modules/.bun/default-browser@5.5.1/node_modules/default-browser/index.js
|
|
16971
|
+
import { promisify as promisify7 } from "util";
|
|
16972
|
+
import process8 from "process";
|
|
16973
|
+
import { execFile as execFile7 } from "child_process";
|
|
16926
16974
|
async function defaultBrowser2() {
|
|
16927
|
-
if (
|
|
16975
|
+
if (process8.platform === "darwin") {
|
|
16928
16976
|
const id = await defaultBrowserId();
|
|
16929
16977
|
const name = await bundleName(id);
|
|
16930
16978
|
return { name, id };
|
|
16931
16979
|
}
|
|
16932
|
-
if (
|
|
16980
|
+
if (process8.platform === "linux") {
|
|
16933
16981
|
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
16934
16982
|
const id = stdout.trim();
|
|
16935
16983
|
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
16936
16984
|
return { name, id };
|
|
16937
16985
|
}
|
|
16938
|
-
if (
|
|
16986
|
+
if (process8.platform === "win32") {
|
|
16939
16987
|
return defaultBrowser();
|
|
16940
16988
|
}
|
|
16941
16989
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
@@ -16946,22 +16994,22 @@ var init_default_browser = __esm(() => {
|
|
|
16946
16994
|
init_bundle_name();
|
|
16947
16995
|
init_windows();
|
|
16948
16996
|
init_windows();
|
|
16949
|
-
execFileAsync4 =
|
|
16997
|
+
execFileAsync4 = promisify7(execFile7);
|
|
16950
16998
|
});
|
|
16951
16999
|
|
|
16952
17000
|
// ../../node_modules/.bun/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
16953
|
-
import
|
|
17001
|
+
import process9 from "process";
|
|
16954
17002
|
var isInSsh, is_in_ssh_default;
|
|
16955
17003
|
var init_is_in_ssh = __esm(() => {
|
|
16956
|
-
isInSsh = Boolean(
|
|
17004
|
+
isInSsh = Boolean(process9.env.SSH_CONNECTION || process9.env.SSH_CLIENT || process9.env.SSH_TTY);
|
|
16957
17005
|
is_in_ssh_default = isInSsh;
|
|
16958
17006
|
});
|
|
16959
17007
|
|
|
16960
|
-
// ../../node_modules/.bun/open@11.0.
|
|
16961
|
-
import
|
|
16962
|
-
import
|
|
17008
|
+
// ../../node_modules/.bun/open@11.0.1/node_modules/open/index.js
|
|
17009
|
+
import process10 from "process";
|
|
17010
|
+
import path2 from "path";
|
|
16963
17011
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
16964
|
-
import
|
|
17012
|
+
import childProcess4 from "child_process";
|
|
16965
17013
|
import fs5, { constants as fsConstants2 } from "fs/promises";
|
|
16966
17014
|
function detectArchBinary(binary) {
|
|
16967
17015
|
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
@@ -17092,7 +17140,7 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
17092
17140
|
}
|
|
17093
17141
|
} else if (platform === "win32" || shouldUseWindowsInWsl) {
|
|
17094
17142
|
command = await powerShellPath2();
|
|
17095
|
-
cliArguments.push(...
|
|
17143
|
+
cliArguments.push(...executePowerShell2.argumentsPrefix);
|
|
17096
17144
|
if (!is_wsl_default) {
|
|
17097
17145
|
childProcessOptions.windowsVerbatimArguments = true;
|
|
17098
17146
|
}
|
|
@@ -17104,21 +17152,24 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
17104
17152
|
encodedArguments.push("-Wait");
|
|
17105
17153
|
}
|
|
17106
17154
|
if (app) {
|
|
17107
|
-
encodedArguments.push(
|
|
17155
|
+
encodedArguments.push(executePowerShell2.escapeArgument(app));
|
|
17108
17156
|
if (options.target) {
|
|
17109
17157
|
appArguments.push(options.target);
|
|
17110
17158
|
}
|
|
17111
17159
|
} else if (options.target) {
|
|
17112
|
-
encodedArguments.push(
|
|
17160
|
+
encodedArguments.push(executePowerShell2.escapeArgument(options.target));
|
|
17113
17161
|
}
|
|
17114
17162
|
if (appArguments.length > 0) {
|
|
17115
|
-
appArguments = appArguments.map((argument) =>
|
|
17163
|
+
appArguments = appArguments.map((argument) => executePowerShell2.escapeArgument(argument));
|
|
17116
17164
|
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
17117
17165
|
}
|
|
17118
|
-
options.target =
|
|
17166
|
+
options.target = executePowerShell2.encodeCommand(encodedArguments.join(" "));
|
|
17119
17167
|
if (!options.wait) {
|
|
17120
17168
|
childProcessOptions.stdio = "ignore";
|
|
17121
17169
|
}
|
|
17170
|
+
if (is_wsl_default) {
|
|
17171
|
+
childProcessOptions.cwd = path2.dirname(command);
|
|
17172
|
+
}
|
|
17122
17173
|
} else {
|
|
17123
17174
|
if (app) {
|
|
17124
17175
|
command = app;
|
|
@@ -17129,7 +17180,7 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
17129
17180
|
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
17130
17181
|
exeLocalXdgOpen = true;
|
|
17131
17182
|
} catch {}
|
|
17132
|
-
const useSystemXdgOpen =
|
|
17183
|
+
const useSystemXdgOpen = process10.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
17133
17184
|
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
17134
17185
|
}
|
|
17135
17186
|
if (appArguments.length > 0) {
|
|
@@ -17146,7 +17197,7 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
17146
17197
|
if (options.target) {
|
|
17147
17198
|
cliArguments.push(options.target);
|
|
17148
17199
|
}
|
|
17149
|
-
const subprocess =
|
|
17200
|
+
const subprocess = childProcess4.spawn(command, cliArguments, childProcessOptions);
|
|
17150
17201
|
if (options.wait) {
|
|
17151
17202
|
return new Promise((resolve, reject) => {
|
|
17152
17203
|
subprocess.once("error", reject);
|
|
@@ -17194,14 +17245,14 @@ var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEach
|
|
|
17194
17245
|
}, apps, open_default;
|
|
17195
17246
|
var init_open = __esm(() => {
|
|
17196
17247
|
init_wsl_utils();
|
|
17197
|
-
|
|
17248
|
+
init_powershell_utils2();
|
|
17198
17249
|
init_default_browser();
|
|
17199
17250
|
init_is_inside_container();
|
|
17200
17251
|
init_is_in_ssh();
|
|
17201
17252
|
fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
17202
|
-
__dirname6 = import.meta.url ?
|
|
17203
|
-
localXdgOpenPath =
|
|
17204
|
-
({ platform, arch } =
|
|
17253
|
+
__dirname6 = import.meta.url ? path2.dirname(fileURLToPath6(import.meta.url)) : "";
|
|
17254
|
+
localXdgOpenPath = path2.join(__dirname6, "xdg-open");
|
|
17255
|
+
({ platform, arch } = process10);
|
|
17205
17256
|
apps = {
|
|
17206
17257
|
browser: "browser",
|
|
17207
17258
|
browserPrivate: "browserPrivate"
|
|
@@ -37155,12 +37206,12 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37155
37206
|
port,
|
|
37156
37207
|
async fetch(req) {
|
|
37157
37208
|
const url2 = new URL(req.url);
|
|
37158
|
-
const
|
|
37209
|
+
const path3 = url2.pathname;
|
|
37159
37210
|
const method = req.method;
|
|
37160
37211
|
const mcpResponse = await handleMcpHttpRequest(req);
|
|
37161
37212
|
if (mcpResponse)
|
|
37162
37213
|
return mcpResponse;
|
|
37163
|
-
if (
|
|
37214
|
+
if (path3 === "/api/connectors" && method === "GET") {
|
|
37164
37215
|
const compact = url2.searchParams.get("compact") === "true";
|
|
37165
37216
|
const fieldsParam = url2.searchParams.get("fields");
|
|
37166
37217
|
const fields = fieldsParam ? new Set(fieldsParam.split(",").map((f) => f.trim())) : null;
|
|
@@ -37180,7 +37231,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37180
37231
|
}
|
|
37181
37232
|
return jsonStripped(data, 200, port);
|
|
37182
37233
|
}
|
|
37183
|
-
if (
|
|
37234
|
+
if (path3 === "/api/connectors/manifest" && method === "GET") {
|
|
37184
37235
|
const connectorNames = url2.searchParams.get("connectors")?.split(",").map((name) => name.trim()).filter(Boolean);
|
|
37185
37236
|
const includeOperations = url2.searchParams.get("includeOperations") === "true";
|
|
37186
37237
|
const manifest = await getConnectorCapabilityManifest({
|
|
@@ -37189,7 +37240,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37189
37240
|
});
|
|
37190
37241
|
return json(manifest, 200, port);
|
|
37191
37242
|
}
|
|
37192
|
-
const singleMatch =
|
|
37243
|
+
const singleMatch = path3.match(/^\/api\/connectors\/([^/]+)$/);
|
|
37193
37244
|
if (singleMatch && method === "GET") {
|
|
37194
37245
|
const name = singleMatch[1];
|
|
37195
37246
|
if (!isValidConnectorName(name))
|
|
@@ -37209,7 +37260,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37209
37260
|
overview: docs?.overview || null
|
|
37210
37261
|
}, 200, port);
|
|
37211
37262
|
}
|
|
37212
|
-
const operationsMatch =
|
|
37263
|
+
const operationsMatch = path3.match(/^\/api\/connectors\/([^/]+)\/operations$/);
|
|
37213
37264
|
if (operationsMatch && method === "GET") {
|
|
37214
37265
|
const name = operationsMatch[1];
|
|
37215
37266
|
if (!isValidConnectorName(name))
|
|
@@ -37230,7 +37281,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37230
37281
|
helpText: ops.helpText
|
|
37231
37282
|
}, 200, port);
|
|
37232
37283
|
}
|
|
37233
|
-
const operationHelpMatch =
|
|
37284
|
+
const operationHelpMatch = path3.match(/^\/api\/connectors\/([^/]+)\/operations\/([^/]+)$/);
|
|
37234
37285
|
if (operationHelpMatch && method === "GET") {
|
|
37235
37286
|
const name = operationHelpMatch[1];
|
|
37236
37287
|
const command = decodeURIComponent(operationHelpMatch[2]);
|
|
@@ -37245,7 +37296,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37245
37296
|
const help = await getConnectorCommandHelp(name, command);
|
|
37246
37297
|
return json({ connector: name, displayName: meta.displayName, command, help }, 200, port);
|
|
37247
37298
|
}
|
|
37248
|
-
const operationRunMatch =
|
|
37299
|
+
const operationRunMatch = path3.match(/^\/api\/connectors\/([^/]+)\/operations\/run$/);
|
|
37249
37300
|
if (operationRunMatch && method === "POST") {
|
|
37250
37301
|
const name = operationRunMatch[1];
|
|
37251
37302
|
if (!isValidConnectorName(name))
|
|
@@ -37309,7 +37360,7 @@ ${result.stderr}`;
|
|
|
37309
37360
|
}, 500, port);
|
|
37310
37361
|
}
|
|
37311
37362
|
}
|
|
37312
|
-
const keyMatch =
|
|
37363
|
+
const keyMatch = path3.match(/^\/api\/connectors\/([^/]+)\/key$/);
|
|
37313
37364
|
if (keyMatch && method === "POST") {
|
|
37314
37365
|
const name = keyMatch[1];
|
|
37315
37366
|
if (!isValidConnectorName(name))
|
|
@@ -37328,7 +37379,7 @@ ${result.stderr}`;
|
|
|
37328
37379
|
return json({ error: e instanceof Error ? e.message : "Failed to save key" }, 500, port);
|
|
37329
37380
|
}
|
|
37330
37381
|
}
|
|
37331
|
-
const refreshMatch =
|
|
37382
|
+
const refreshMatch = path3.match(/^\/api\/connectors\/([^/]+)\/refresh$/);
|
|
37332
37383
|
if (refreshMatch && method === "POST") {
|
|
37333
37384
|
const name = refreshMatch[1];
|
|
37334
37385
|
if (!isValidConnectorName(name))
|
|
@@ -37341,7 +37392,7 @@ ${result.stderr}`;
|
|
|
37341
37392
|
return json({ success: false, error: e instanceof Error ? e.message : "Failed to refresh" }, 500, port);
|
|
37342
37393
|
}
|
|
37343
37394
|
}
|
|
37344
|
-
const installMatch =
|
|
37395
|
+
const installMatch = path3.match(/^\/api\/connectors\/([^/]+)\/install$/);
|
|
37345
37396
|
if (installMatch && method === "POST") {
|
|
37346
37397
|
const name = installMatch[1];
|
|
37347
37398
|
if (!isValidConnectorName(name))
|
|
@@ -37360,7 +37411,7 @@ ${result.stderr}`;
|
|
|
37360
37411
|
return json({ error: e instanceof Error ? e.message : "Failed to install connector" }, 500, port);
|
|
37361
37412
|
}
|
|
37362
37413
|
}
|
|
37363
|
-
const uninstallMatch =
|
|
37414
|
+
const uninstallMatch = path3.match(/^\/api\/connectors\/([^/]+)\/uninstall$/);
|
|
37364
37415
|
if (uninstallMatch && method === "POST") {
|
|
37365
37416
|
const name = uninstallMatch[1];
|
|
37366
37417
|
if (!isValidConnectorName(name))
|
|
@@ -37376,7 +37427,7 @@ ${result.stderr}`;
|
|
|
37376
37427
|
return json({ error: e instanceof Error ? e.message : "Failed to uninstall connector" }, 500, port);
|
|
37377
37428
|
}
|
|
37378
37429
|
}
|
|
37379
|
-
if (
|
|
37430
|
+
if (path3 === "/api/update" && method === "POST") {
|
|
37380
37431
|
try {
|
|
37381
37432
|
const installed = getInstalledConnectors();
|
|
37382
37433
|
if (installed.length === 0) {
|
|
@@ -37392,10 +37443,10 @@ ${result.stderr}`;
|
|
|
37392
37443
|
return json({ error: e instanceof Error ? e.message : "Failed to update" }, 500, port);
|
|
37393
37444
|
}
|
|
37394
37445
|
}
|
|
37395
|
-
if (
|
|
37446
|
+
if (path3 === "/api/activity" && method === "GET") {
|
|
37396
37447
|
return json(activityLog, 200, port);
|
|
37397
37448
|
}
|
|
37398
|
-
if (
|
|
37449
|
+
if (path3 === "/api/hot" && method === "GET") {
|
|
37399
37450
|
const { getTopConnectors: getTopConnectors2 } = await Promise.resolve().then(() => (init_usage(), exports_usage));
|
|
37400
37451
|
const { getPromotedConnectors: getPromotedConnectors2 } = await Promise.resolve().then(() => (init_promotions(), exports_promotions));
|
|
37401
37452
|
const limit = parseInt(url2.searchParams.get("limit") || "10", 10);
|
|
@@ -37405,7 +37456,7 @@ ${result.stderr}`;
|
|
|
37405
37456
|
const promoted = new Set(getPromotedConnectors2(db));
|
|
37406
37457
|
return json(top.map((t) => ({ ...t, promoted: promoted.has(t.connector) })), 200, port);
|
|
37407
37458
|
}
|
|
37408
|
-
const promoteMatch =
|
|
37459
|
+
const promoteMatch = path3.match(/^\/api\/connectors\/([^/]+)\/promote$/);
|
|
37409
37460
|
if (promoteMatch && method === "POST") {
|
|
37410
37461
|
const name = promoteMatch[1];
|
|
37411
37462
|
if (!getConnector(name))
|
|
@@ -37419,13 +37470,13 @@ ${result.stderr}`;
|
|
|
37419
37470
|
const removed = demoteConnector2(promoteMatch[1], getDatabase3());
|
|
37420
37471
|
return json({ success: removed, connector: promoteMatch[1] }, 200, port);
|
|
37421
37472
|
}
|
|
37422
|
-
if (
|
|
37473
|
+
if (path3 === "/api/llm" && method === "GET") {
|
|
37423
37474
|
const config2 = getLlmConfig();
|
|
37424
37475
|
if (!config2)
|
|
37425
37476
|
return json({ configured: false }, 200, port);
|
|
37426
37477
|
return json({ configured: true, provider: config2.provider, model: config2.model, key: maskKey(config2.api_key), strip: config2.strip }, 200, port);
|
|
37427
37478
|
}
|
|
37428
|
-
if (
|
|
37479
|
+
if (path3 === "/api/llm" && method === "POST") {
|
|
37429
37480
|
const body = await req.json().catch(() => ({}));
|
|
37430
37481
|
const validProviders = ["cerebras", "groq", "openai", "anthropic"];
|
|
37431
37482
|
const provider = body.provider;
|
|
@@ -37439,7 +37490,7 @@ ${result.stderr}`;
|
|
|
37439
37490
|
saveLlmConfig({ provider, model, api_key, strip });
|
|
37440
37491
|
return json({ success: true, provider, model, strip }, 200, port);
|
|
37441
37492
|
}
|
|
37442
|
-
if (
|
|
37493
|
+
if (path3 === "/api/llm/test" && method === "POST") {
|
|
37443
37494
|
const config2 = getLlmConfig();
|
|
37444
37495
|
if (!config2)
|
|
37445
37496
|
return json({ error: "No LLM configured" }, 400, port);
|
|
@@ -37451,17 +37502,17 @@ ${result.stderr}`;
|
|
|
37451
37502
|
return json({ success: false, error: e instanceof Error ? e.message : String(e) }, 500, port);
|
|
37452
37503
|
}
|
|
37453
37504
|
}
|
|
37454
|
-
if (
|
|
37505
|
+
if (path3 === "/api/jobs" && method === "GET") {
|
|
37455
37506
|
return json(listJobs(getDatabase3()), 200, port);
|
|
37456
37507
|
}
|
|
37457
|
-
if (
|
|
37508
|
+
if (path3 === "/api/jobs" && method === "POST") {
|
|
37458
37509
|
const body = await req.json().catch(() => ({}));
|
|
37459
37510
|
if (!body.name || !body.connector || !body.command || !body.cron)
|
|
37460
37511
|
return json({ error: "name, connector, command, cron required" }, 400, port);
|
|
37461
37512
|
const job = createJob({ name: body.name, connector: body.connector, command: body.command, args: body.args ?? [], cron: body.cron, strip: !!body.strip }, getDatabase3());
|
|
37462
37513
|
return json(job, 201, port);
|
|
37463
37514
|
}
|
|
37464
|
-
const jobMatch =
|
|
37515
|
+
const jobMatch = path3.match(/^\/api\/jobs\/([^/]+)$/);
|
|
37465
37516
|
if (jobMatch) {
|
|
37466
37517
|
const db = getDatabase3();
|
|
37467
37518
|
const job = getJobByName(jobMatch[1]) ?? getDatabase3().query("SELECT * FROM connector_jobs WHERE id = ?").get(jobMatch[1]);
|
|
@@ -37483,7 +37534,7 @@ ${result.stderr}`;
|
|
|
37483
37534
|
return json(updated, 200, port);
|
|
37484
37535
|
}
|
|
37485
37536
|
}
|
|
37486
|
-
const jobRunMatch =
|
|
37537
|
+
const jobRunMatch = path3.match(/^\/api\/jobs\/([^/]+)\/run$/);
|
|
37487
37538
|
if (jobRunMatch && method === "POST") {
|
|
37488
37539
|
const db = getDatabase3();
|
|
37489
37540
|
const job = getJobByName(jobRunMatch[1], db);
|
|
@@ -37492,17 +37543,17 @@ ${result.stderr}`;
|
|
|
37492
37543
|
const result = await triggerJob(job, db);
|
|
37493
37544
|
return json(result, 200, port);
|
|
37494
37545
|
}
|
|
37495
|
-
if (
|
|
37546
|
+
if (path3 === "/api/workflows" && method === "GET") {
|
|
37496
37547
|
return json(listWorkflows(getDatabase3()), 200, port);
|
|
37497
37548
|
}
|
|
37498
|
-
if (
|
|
37549
|
+
if (path3 === "/api/workflows" && method === "POST") {
|
|
37499
37550
|
const body = await req.json().catch(() => ({}));
|
|
37500
37551
|
if (!body.name || !body.steps)
|
|
37501
37552
|
return json({ error: "name and steps required" }, 400, port);
|
|
37502
37553
|
const wf = createWorkflow({ name: body.name, steps: body.steps }, getDatabase3());
|
|
37503
37554
|
return json(wf, 201, port);
|
|
37504
37555
|
}
|
|
37505
|
-
const wfMatch =
|
|
37556
|
+
const wfMatch = path3.match(/^\/api\/workflows\/([^/]+)$/);
|
|
37506
37557
|
if (wfMatch) {
|
|
37507
37558
|
const db = getDatabase3();
|
|
37508
37559
|
const wf = getWorkflowByName(wfMatch[1], db);
|
|
@@ -37515,7 +37566,7 @@ ${result.stderr}`;
|
|
|
37515
37566
|
return json({ success: true }, 200, port);
|
|
37516
37567
|
}
|
|
37517
37568
|
}
|
|
37518
|
-
const wfRunMatch =
|
|
37569
|
+
const wfRunMatch = path3.match(/^\/api\/workflows\/([^/]+)\/run$/);
|
|
37519
37570
|
if (wfRunMatch && method === "POST") {
|
|
37520
37571
|
const wf = getWorkflowByName(wfRunMatch[1], getDatabase3());
|
|
37521
37572
|
if (!wf)
|
|
@@ -37523,10 +37574,10 @@ ${result.stderr}`;
|
|
|
37523
37574
|
const result = await runWorkflow(wf);
|
|
37524
37575
|
return json(result, 200, port);
|
|
37525
37576
|
}
|
|
37526
|
-
if (
|
|
37577
|
+
if (path3 === "/api/agents" && method === "GET") {
|
|
37527
37578
|
return json(listAgents(), 200, port);
|
|
37528
37579
|
}
|
|
37529
|
-
if (
|
|
37580
|
+
if (path3 === "/api/agents/register" && method === "POST") {
|
|
37530
37581
|
const body = await req.json().catch(() => ({}));
|
|
37531
37582
|
const name = typeof body.name === "string" ? body.name : null;
|
|
37532
37583
|
if (!name)
|
|
@@ -37540,15 +37591,15 @@ ${result.stderr}`;
|
|
|
37540
37591
|
return json(result, 409, port);
|
|
37541
37592
|
return json(result, 200, port);
|
|
37542
37593
|
}
|
|
37543
|
-
if (
|
|
37544
|
-
const agentName =
|
|
37594
|
+
if (path3.startsWith("/api/agents/") && method === "DELETE") {
|
|
37595
|
+
const agentName = path3.slice("/api/agents/".length);
|
|
37545
37596
|
const agent = getAgentByName(agentName);
|
|
37546
37597
|
if (!agent)
|
|
37547
37598
|
return json({ error: "Agent not found" }, 404, port);
|
|
37548
37599
|
deleteAgent(agent.id);
|
|
37549
37600
|
return json({ success: true }, 200, port);
|
|
37550
37601
|
}
|
|
37551
|
-
const rateMatch =
|
|
37602
|
+
const rateMatch = path3.match(/^\/api\/rate\/([^/]+)\/([^/]+)$/);
|
|
37552
37603
|
if (rateMatch && method === "GET") {
|
|
37553
37604
|
const [, agentId, connector] = rateMatch;
|
|
37554
37605
|
const limit = parseInt(url2.searchParams.get("limit") || "60", 10);
|
|
@@ -37556,7 +37607,7 @@ ${result.stderr}`;
|
|
|
37556
37607
|
const result = consume ? checkRateBudget(agentId, connector, limit) : getRateBudget(agentId, connector, limit);
|
|
37557
37608
|
return json(result, 200, port);
|
|
37558
37609
|
}
|
|
37559
|
-
const profilesMatch =
|
|
37610
|
+
const profilesMatch = path3.match(/^\/api\/connectors\/([^/]+)\/profiles$/);
|
|
37560
37611
|
if (profilesMatch && method === "GET") {
|
|
37561
37612
|
const name = profilesMatch[1];
|
|
37562
37613
|
if (!isValidConnectorName(name))
|
|
@@ -37578,7 +37629,7 @@ ${result.stderr}`;
|
|
|
37578
37629
|
return json({ error: e instanceof Error ? e.message : "Failed to list profiles" }, 500, port);
|
|
37579
37630
|
}
|
|
37580
37631
|
}
|
|
37581
|
-
const profileSwitchMatch =
|
|
37632
|
+
const profileSwitchMatch = path3.match(/^\/api\/connectors\/([^/]+)\/profiles\/switch$/);
|
|
37582
37633
|
if (profileSwitchMatch && method === "POST") {
|
|
37583
37634
|
const name = profileSwitchMatch[1];
|
|
37584
37635
|
if (!isValidConnectorName(name))
|
|
@@ -37597,7 +37648,7 @@ ${result.stderr}`;
|
|
|
37597
37648
|
return json({ error: e instanceof Error ? e.message : "Failed to switch profile" }, 500, port);
|
|
37598
37649
|
}
|
|
37599
37650
|
}
|
|
37600
|
-
const profileDeleteMatch =
|
|
37651
|
+
const profileDeleteMatch = path3.match(/^\/api\/connectors\/([^/]+)\/profiles\/([^/]+)$/);
|
|
37601
37652
|
if (profileDeleteMatch && method === "DELETE") {
|
|
37602
37653
|
const name = profileDeleteMatch[1];
|
|
37603
37654
|
const profile = profileDeleteMatch[2];
|
|
@@ -37615,7 +37666,7 @@ ${result.stderr}`;
|
|
|
37615
37666
|
return json({ error: e instanceof Error ? e.message : "Failed to delete profile" }, 500, port);
|
|
37616
37667
|
}
|
|
37617
37668
|
}
|
|
37618
|
-
if (
|
|
37669
|
+
if (path3 === "/api/export" && method === "GET") {
|
|
37619
37670
|
try {
|
|
37620
37671
|
const connectDir = getConnectorsHome();
|
|
37621
37672
|
const result = {};
|
|
@@ -37665,7 +37716,7 @@ ${result.stderr}`;
|
|
|
37665
37716
|
return json({ error: e instanceof Error ? e.message : "Failed to export credentials" }, 500, port);
|
|
37666
37717
|
}
|
|
37667
37718
|
}
|
|
37668
|
-
if (
|
|
37719
|
+
if (path3 === "/api/import" && method === "POST") {
|
|
37669
37720
|
try {
|
|
37670
37721
|
const contentLength = parseInt(req.headers.get("content-length") || "0", 10);
|
|
37671
37722
|
if (contentLength > MAX_BODY_SIZE)
|
|
@@ -37698,7 +37749,7 @@ ${result.stderr}`;
|
|
|
37698
37749
|
return json({ error: e instanceof Error ? e.message : "Failed to import credentials" }, 500, port);
|
|
37699
37750
|
}
|
|
37700
37751
|
}
|
|
37701
|
-
const oauthStartMatch =
|
|
37752
|
+
const oauthStartMatch = path3.match(/^\/oauth\/([^/]+)\/start$/);
|
|
37702
37753
|
if (oauthStartMatch && method === "GET") {
|
|
37703
37754
|
const name = oauthStartMatch[1];
|
|
37704
37755
|
const redirectUri = `http://localhost:${port}/oauth/${name}/callback`;
|
|
@@ -37708,7 +37759,7 @@ ${result.stderr}`;
|
|
|
37708
37759
|
}
|
|
37709
37760
|
return Response.redirect(authUrl, 302);
|
|
37710
37761
|
}
|
|
37711
|
-
const oauthCallbackMatch =
|
|
37762
|
+
const oauthCallbackMatch = path3.match(/^\/oauth\/([^/]+)\/callback$/);
|
|
37712
37763
|
if (oauthCallbackMatch && method === "GET") {
|
|
37713
37764
|
const name = oauthCallbackMatch[1];
|
|
37714
37765
|
const code = url2.searchParams.get("code");
|
|
@@ -37742,8 +37793,8 @@ ${result.stderr}`;
|
|
|
37742
37793
|
});
|
|
37743
37794
|
}
|
|
37744
37795
|
if (dashboardExists && (method === "GET" || method === "HEAD")) {
|
|
37745
|
-
if (
|
|
37746
|
-
const filePath = join14(dashboardDir,
|
|
37796
|
+
if (path3 !== "/") {
|
|
37797
|
+
const filePath = join14(dashboardDir, path3);
|
|
37747
37798
|
const rel = relative(dashboardDir, resolve(filePath));
|
|
37748
37799
|
if (!rel.startsWith("..") && !rel.includes(`..${sep}`) && rel !== "") {
|
|
37749
37800
|
const res2 = serveStaticFile(filePath);
|
|
@@ -29,7 +29,7 @@ bun add connect-clickbank
|
|
|
29
29
|
connect-clickbank config set-key YOUR_API_KEY
|
|
30
30
|
|
|
31
31
|
# Or use environment variable
|
|
32
|
-
export CLICKBANK_API_KEY
|
|
32
|
+
export CLICKBANK_API_KEY=<your-api-key>
|
|
33
33
|
|
|
34
34
|
# View today's stats
|
|
35
35
|
connect-clickbank stats today
|
|
@@ -288,4 +288,4 @@ MIT
|
|
|
288
288
|
|
|
289
289
|
- [ClickBank API Documentation](https://support.clickbank.com/hc/en-us/articles/220376527-ClickBank-APIs)
|
|
290
290
|
- [ClickBank API Specifications](https://support.clickbank.com/en/articles/10535397-clickbank-api-specifications)
|
|
291
|
-
- [How to Create ClickBank API Keys](https://support.clickbank.com/hc/en-us
|
|
291
|
+
- [How to Create ClickBank API Keys](https://support.clickbank.com/hc/en-us)
|
|
@@ -18,7 +18,7 @@ bun test
|
|
|
18
18
|
|
|
19
19
|
## API Details
|
|
20
20
|
|
|
21
|
-
- **Base URL**:
|
|
21
|
+
- **Base URL**: no default (must be configured) (override via profile or `SPLIT_IN_BATCHES_BASE_URL`)
|
|
22
22
|
- **Auth**: Bearer token via `Authorization: Bearer <API_KEY>`
|
|
23
23
|
|
|
24
24
|
## API Resources
|