@iterable/mcp 1.0.0
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/LICENSE +21 -0
- package/README.md +318 -0
- package/TOOLS.md +133 -0
- package/dist/client-detection.d.ts +7 -0
- package/dist/client-detection.d.ts.map +1 -0
- package/dist/client-detection.js +22 -0
- package/dist/client-detection.js.map +1 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +74 -0
- package/dist/config.js.map +1 -0
- package/dist/http-headers.d.ts +5 -0
- package/dist/http-headers.d.ts.map +1 -0
- package/dist/http-headers.js +5 -0
- package/dist/http-headers.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +41 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +725 -0
- package/dist/install.js.map +1 -0
- package/dist/key-manager.d.ts +236 -0
- package/dist/key-manager.d.ts.map +1 -0
- package/dist/key-manager.js +776 -0
- package/dist/key-manager.js.map +1 -0
- package/dist/keys-cli.d.ts +8 -0
- package/dist/keys-cli.d.ts.map +1 -0
- package/dist/keys-cli.js +487 -0
- package/dist/keys-cli.js.map +1 -0
- package/dist/prompts.d.ts +15 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +66 -0
- package/dist/prompts.js.map +1 -0
- package/dist/schema-utils.d.ts +22 -0
- package/dist/schema-utils.d.ts.map +1 -0
- package/dist/schema-utils.js +65 -0
- package/dist/schema-utils.js.map +1 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +172 -0
- package/dist/server.js.map +1 -0
- package/dist/shutdown.d.ts +5 -0
- package/dist/shutdown.d.ts.map +1 -0
- package/dist/shutdown.js +68 -0
- package/dist/shutdown.js.map +1 -0
- package/dist/tool-filter.d.ts +19 -0
- package/dist/tool-filter.d.ts.map +1 -0
- package/dist/tool-filter.js +144 -0
- package/dist/tool-filter.js.map +1 -0
- package/dist/tools/campaigns.d.ts +7 -0
- package/dist/tools/campaigns.d.ts.map +1 -0
- package/dist/tools/campaigns.js +88 -0
- package/dist/tools/campaigns.js.map +1 -0
- package/dist/tools/catalogs.d.ts +7 -0
- package/dist/tools/catalogs.d.ts.map +1 -0
- package/dist/tools/catalogs.js +85 -0
- package/dist/tools/catalogs.js.map +1 -0
- package/dist/tools/events.d.ts +7 -0
- package/dist/tools/events.d.ts.map +1 -0
- package/dist/tools/events.js +34 -0
- package/dist/tools/events.js.map +1 -0
- package/dist/tools/experiments.d.ts +7 -0
- package/dist/tools/experiments.d.ts.map +1 -0
- package/dist/tools/experiments.js +16 -0
- package/dist/tools/experiments.js.map +1 -0
- package/dist/tools/export.d.ts +7 -0
- package/dist/tools/export.d.ts.map +1 -0
- package/dist/tools/export.js +41 -0
- package/dist/tools/export.js.map +1 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +44 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/journeys.d.ts +10 -0
- package/dist/tools/journeys.d.ts.map +1 -0
- package/dist/tools/journeys.js +25 -0
- package/dist/tools/journeys.js.map +1 -0
- package/dist/tools/lists.d.ts +7 -0
- package/dist/tools/lists.d.ts.map +1 -0
- package/dist/tools/lists.js +58 -0
- package/dist/tools/lists.js.map +1 -0
- package/dist/tools/messaging.d.ts +11 -0
- package/dist/tools/messaging.d.ts.map +1 -0
- package/dist/tools/messaging.js +103 -0
- package/dist/tools/messaging.js.map +1 -0
- package/dist/tools/snippets.d.ts +7 -0
- package/dist/tools/snippets.d.ts.map +1 -0
- package/dist/tools/snippets.js +46 -0
- package/dist/tools/snippets.js.map +1 -0
- package/dist/tools/subscriptions.d.ts +4 -0
- package/dist/tools/subscriptions.d.ts.map +1 -0
- package/dist/tools/subscriptions.js +37 -0
- package/dist/tools/subscriptions.js.map +1 -0
- package/dist/tools/templates.d.ts +7 -0
- package/dist/tools/templates.d.ts.map +1 -0
- package/dist/tools/templates.js +118 -0
- package/dist/tools/templates.js.map +1 -0
- package/dist/tools/users.d.ts +10 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +74 -0
- package/dist/tools/users.js.map +1 -0
- package/dist/tools/webhooks.d.ts +7 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +22 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/utils/cli-env.d.ts +11 -0
- package/dist/utils/cli-env.d.ts.map +1 -0
- package/dist/utils/cli-env.js +32 -0
- package/dist/utils/cli-env.js.map +1 -0
- package/dist/utils/endpoint-prompt.d.ts +14 -0
- package/dist/utils/endpoint-prompt.d.ts.map +1 -0
- package/dist/utils/endpoint-prompt.js +73 -0
- package/dist/utils/endpoint-prompt.js.map +1 -0
- package/dist/utils/formatting.d.ts +10 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +12 -0
- package/dist/utils/formatting.js.map +1 -0
- package/dist/utils/password-prompt.d.ts +19 -0
- package/dist/utils/password-prompt.d.ts.map +1 -0
- package/dist/utils/password-prompt.js +37 -0
- package/dist/utils/password-prompt.js.map +1 -0
- package/dist/utils/sanitize.d.ts +13 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/sanitize.js +23 -0
- package/dist/utils/sanitize.js.map +1 -0
- package/dist/utils/tool-config.d.ts +13 -0
- package/dist/utils/tool-config.d.ts.map +1 -0
- package/dist/utils/tool-config.js +45 -0
- package/dist/utils/tool-config.js.map +1 -0
- package/dist/utils/ui.d.ts +90 -0
- package/dist/utils/ui.d.ts.map +1 -0
- package/dist/utils/ui.js +298 -0
- package/dist/utils/ui.js.map +1 -0
- package/dist/utils/url.d.ts +20 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +53 -0
- package/dist/utils/url.js.map +1 -0
- package/package.json +105 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { isHttpsOrLocalhost, isLocalhostHost } from "./url.js";
|
|
2
|
+
/**
|
|
3
|
+
* Prompt user to select Iterable region or provide a custom endpoint.
|
|
4
|
+
* Returns the validated base URL string.
|
|
5
|
+
*/
|
|
6
|
+
export async function promptForIterableBaseUrl(deps) {
|
|
7
|
+
const { inquirer, icons, chalk, showError } = deps;
|
|
8
|
+
const { endpointChoice } = await inquirer.prompt([
|
|
9
|
+
{
|
|
10
|
+
type: "list",
|
|
11
|
+
name: "endpointChoice",
|
|
12
|
+
message: "Select your Iterable region:",
|
|
13
|
+
choices: [
|
|
14
|
+
{ name: `🇺🇸 US (api.iterable.com)`, value: "us", short: "US" },
|
|
15
|
+
{ name: `🇪🇺 EU (api.eu.iterable.com)`, value: "eu", short: "EU" },
|
|
16
|
+
{ name: `${icons.globe || "🌍"} Custom endpoint`, value: "custom", short: "Custom" },
|
|
17
|
+
],
|
|
18
|
+
default: "us",
|
|
19
|
+
},
|
|
20
|
+
]);
|
|
21
|
+
if (endpointChoice === "us")
|
|
22
|
+
return "https://api.iterable.com";
|
|
23
|
+
if (endpointChoice === "eu")
|
|
24
|
+
return "https://api.eu.iterable.com";
|
|
25
|
+
// Custom endpoint
|
|
26
|
+
const { customUrl } = await inquirer.prompt([
|
|
27
|
+
{
|
|
28
|
+
type: "input",
|
|
29
|
+
name: "customUrl",
|
|
30
|
+
message: "Enter custom API endpoint URL:",
|
|
31
|
+
validate: (input) => {
|
|
32
|
+
if (!input)
|
|
33
|
+
return "URL is required";
|
|
34
|
+
try {
|
|
35
|
+
new URL(input);
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return "Invalid URL format";
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
]);
|
|
44
|
+
try {
|
|
45
|
+
const url = new URL(customUrl);
|
|
46
|
+
const isIterableDomain = url.hostname === "iterable.com" || url.hostname.endsWith(".iterable.com");
|
|
47
|
+
const isLocalhost = isLocalhostHost(url.hostname);
|
|
48
|
+
if (!isHttpsOrLocalhost(url)) {
|
|
49
|
+
showError("HTTP is not allowed for non-local endpoints. Please use HTTPS.");
|
|
50
|
+
throw new Error("insecure-nonlocal");
|
|
51
|
+
}
|
|
52
|
+
if (!isIterableDomain && !isLocalhost) {
|
|
53
|
+
console.log();
|
|
54
|
+
console.log(chalk.yellow("You selected a non-Iterable domain. This reduces security assurances and may not be supported."));
|
|
55
|
+
const { confirmCustom } = await inquirer.prompt([
|
|
56
|
+
{ type: "confirm", name: "confirmCustom", message: `Proceed with endpoint ${customUrl}?`, default: false },
|
|
57
|
+
]);
|
|
58
|
+
if (!confirmCustom) {
|
|
59
|
+
showError("Custom endpoint not confirmed.");
|
|
60
|
+
throw new Error("custom-cancelled");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
if (e.message === "insecure-nonlocal" || e.message === "custom-cancelled") {
|
|
66
|
+
// Already reported to user by showError; rethrow to let caller decide (likely exit)
|
|
67
|
+
throw e;
|
|
68
|
+
}
|
|
69
|
+
// Should not happen due to validation above
|
|
70
|
+
}
|
|
71
|
+
return customUrl;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=endpoint-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint-prompt.js","sourceRoot":"","sources":["../../src/utils/endpoint-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAS/D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,IAAwB;IACrE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAEnD,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QAC/C;YACE,IA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Ae,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAElD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,SAAS,CAAC,gEAAgE,CAAC,CAAC;YAC5E,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,gBAAgB,IAAI,CAAC,WAAW,EAAE,CAAC;YACtC,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,gGAAgG,CACjG,CACF,CAAC;YACF,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;gBAC9C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,yBAAyB,SAAS,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE;aAC3G,CAAC,CAAC;YACH,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,SAAS,CAAC,gCAAgC,CAAC,CAAC;gBAC5C,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAK,CAAW,CAAC,OAAO,KAAK,mBAAmB,IAAK,CAAW,CAAC,OAAO,KAAK,kBAAkB,EAAE,CAAC;YAChG,oFAAoF;YACpF,MAAM,CAAC,CAAC;QACV,CAAC;QACD,4CAA4C;IAC9C,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-friendly, chalk-free formatter for Keychain choice labels.
|
|
3
|
+
* Production coloring/wrapping is applied in ui.ts.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatKeychainChoiceLabelPlain(name: string, endpoint: string, isActive: boolean, env?: {
|
|
6
|
+
ITERABLE_USER_PII?: string;
|
|
7
|
+
ITERABLE_ENABLE_WRITES?: string;
|
|
8
|
+
ITERABLE_ENABLE_SENDS?: string;
|
|
9
|
+
}): string;
|
|
10
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/utils/formatting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EACjB,GAAG,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAAC,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAAE,GACpG,MAAM,CAMR"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-friendly, chalk-free formatter for Keychain choice labels.
|
|
3
|
+
* Production coloring/wrapping is applied in ui.ts.
|
|
4
|
+
*/
|
|
5
|
+
export function formatKeychainChoiceLabelPlain(name, endpoint, isActive, env) {
|
|
6
|
+
const activeBadge = isActive ? "[ACTIVE] " : " ";
|
|
7
|
+
const flags = env
|
|
8
|
+
? ` PII: ${(env.ITERABLE_USER_PII === "true" ? "On" : "Off")} • Writes: ${(env.ITERABLE_ENABLE_WRITES === "true" ? "On" : "Off")} • Sends: ${(env.ITERABLE_ENABLE_SENDS === "true" ? "On" : "Off")}`
|
|
9
|
+
: "";
|
|
10
|
+
return `${activeBadge}${name} ${endpoint}${flags}`;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=formatting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../../src/utils/formatting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC5C,IAAY,EACZ,QAAgB,EAChB,QAAiB,EACjB,GAAqG;IAErG,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAClD,MAAM,KAAK,GAAG,GAAG;QACf,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,sBAAsB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;QACrM,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,GAAG,WAAW,GAAG,IAAI,KAAK,QAAQ,GAAG,KAAK,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key input utility (masked)
|
|
3
|
+
*
|
|
4
|
+
* Prompts for API key input using inquirer with masking and validation.
|
|
5
|
+
* Input is not echoed and won't be saved to shell history since it's
|
|
6
|
+
* prompted interactively rather than passed as a command-line argument.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Prompt for API key input
|
|
10
|
+
*
|
|
11
|
+
* Uses readline to prompt for input. The key will be visible when typed/pasted,
|
|
12
|
+
* but won't be saved to shell history since it's prompted interactively rather
|
|
13
|
+
* than passed as a command-line argument.
|
|
14
|
+
*
|
|
15
|
+
* @param promptText - The text to display before the input
|
|
16
|
+
* @returns The user's input (trimmed)
|
|
17
|
+
*/
|
|
18
|
+
export declare function promptForApiKey(promptText: string): Promise<string>;
|
|
19
|
+
//# sourceMappingURL=password-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-prompt.d.ts","sourceRoot":"","sources":["../../src/utils/password-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBzE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key input utility (masked)
|
|
3
|
+
*
|
|
4
|
+
* Prompts for API key input using inquirer with masking and validation.
|
|
5
|
+
* Input is not echoed and won't be saved to shell history since it's
|
|
6
|
+
* prompted interactively rather than passed as a command-line argument.
|
|
7
|
+
*/
|
|
8
|
+
import inquirer from "inquirer";
|
|
9
|
+
/**
|
|
10
|
+
* Prompt for API key input
|
|
11
|
+
*
|
|
12
|
+
* Uses readline to prompt for input. The key will be visible when typed/pasted,
|
|
13
|
+
* but won't be saved to shell history since it's prompted interactively rather
|
|
14
|
+
* than passed as a command-line argument.
|
|
15
|
+
*
|
|
16
|
+
* @param promptText - The text to display before the input
|
|
17
|
+
* @returns The user's input (trimmed)
|
|
18
|
+
*/
|
|
19
|
+
export async function promptForApiKey(promptText) {
|
|
20
|
+
const { apiKey } = await inquirer.prompt([
|
|
21
|
+
{
|
|
22
|
+
type: "password",
|
|
23
|
+
name: "apiKey",
|
|
24
|
+
message: promptText,
|
|
25
|
+
mask: "*",
|
|
26
|
+
validate: (input) => {
|
|
27
|
+
if (!input)
|
|
28
|
+
return "API key is required";
|
|
29
|
+
if (!/^[a-f0-9]{32}$/.test(input))
|
|
30
|
+
return "API key must be a 32-character lowercase hexadecimal string";
|
|
31
|
+
return true;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
]);
|
|
35
|
+
return apiKey.trim();
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=password-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-prompt.js","sourceRoot":"","sources":["../../src/utils/password-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,UAAkB;IACtD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAErC;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,UAAU;YACnB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;gBAC1B,IAAI,CAAC,KAAK;oBAAE,OAAO,qBAAqB,CAAC;gBACzC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;oBAC/B,OAAO,6DAA6D,CAAC;gBACvE,OAAO,IAAI,CAAC;YACd,CAAC;SACF;KACF,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitization utilities for logging
|
|
3
|
+
*
|
|
4
|
+
* Prevents accidental exposure of Iterable API keys in logs and error messages.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Sanitize a string by replacing Iterable API keys with [REDACTED]
|
|
8
|
+
*
|
|
9
|
+
* @param text - The text to sanitize
|
|
10
|
+
* @returns Sanitized text with API keys replaced
|
|
11
|
+
*/
|
|
12
|
+
export declare function sanitizeString(text: string): string;
|
|
13
|
+
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/utils/sanitize.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKnD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitization utilities for logging
|
|
3
|
+
*
|
|
4
|
+
* Prevents accidental exposure of Iterable API keys in logs and error messages.
|
|
5
|
+
*/
|
|
6
|
+
// Pattern to match Iterable API keys (32-character lowercase hexadecimal)
|
|
7
|
+
const ITERABLE_API_KEY_PATTERN = /\b[a-f0-9]{32}\b/gi;
|
|
8
|
+
// Pattern to match emails (basic heuristic)
|
|
9
|
+
const EMAIL_PATTERN = /\b[\w.+-]+@[\w.-]+\.[A-Za-z]{2,}\b/g;
|
|
10
|
+
/**
|
|
11
|
+
* Sanitize a string by replacing Iterable API keys with [REDACTED]
|
|
12
|
+
*
|
|
13
|
+
* @param text - The text to sanitize
|
|
14
|
+
* @returns Sanitized text with API keys replaced
|
|
15
|
+
*/
|
|
16
|
+
export function sanitizeString(text) {
|
|
17
|
+
if (!text)
|
|
18
|
+
return text;
|
|
19
|
+
return text
|
|
20
|
+
.replace(ITERABLE_API_KEY_PATTERN, "[REDACTED]")
|
|
21
|
+
.replace(EMAIL_PATTERN, "[REDACTED_EMAIL]");
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=sanitize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize.js","sourceRoot":"","sources":["../../src/utils/sanitize.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0EAA0E;AAC1E,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AACtD,4CAA4C;AAC5C,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,IAAI;SACR,OAAO,CAAC,wBAAwB,EAAE,YAAY,CAAC;SAC/C,OAAO,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function getCursorConfigPath(): string;
|
|
2
|
+
export declare function getClaudeDesktopConfigPath(): string;
|
|
3
|
+
export type IterableMcpConfig = {
|
|
4
|
+
type: "stdio";
|
|
5
|
+
command: string;
|
|
6
|
+
args: string[];
|
|
7
|
+
env: Record<string, string>;
|
|
8
|
+
};
|
|
9
|
+
export declare function ensureDir(filePath: string): Promise<void>;
|
|
10
|
+
export declare function readJson(filePath: string): Promise<any>;
|
|
11
|
+
export declare function writeJsonSecure(filePath: string, data: any): Promise<void>;
|
|
12
|
+
export declare function updateToolConfig(filePath: string, iterableConfig: IterableMcpConfig): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=tool-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-config.d.ts","sourceRoot":"","sources":["../../src/utils/tool-config.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAuBnD;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/D;AAED,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAO7D;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhF;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAWzG"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { promises as fs } from "fs";
|
|
2
|
+
import os from "os";
|
|
3
|
+
import path from "path";
|
|
4
|
+
export function getCursorConfigPath() {
|
|
5
|
+
return path.join(os.homedir(), ".cursor", "mcp.json");
|
|
6
|
+
}
|
|
7
|
+
export function getClaudeDesktopConfigPath() {
|
|
8
|
+
switch (process.platform) {
|
|
9
|
+
case "darwin":
|
|
10
|
+
return path.join(os.homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
11
|
+
case "win32":
|
|
12
|
+
return path.join(process.env.APPDATA || "", "Claude", "claude_desktop_config.json");
|
|
13
|
+
default:
|
|
14
|
+
return path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), ".config"), "Claude", "claude_desktop_config.json");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export async function ensureDir(filePath) {
|
|
18
|
+
const dir = path.dirname(filePath);
|
|
19
|
+
await fs.mkdir(dir, { recursive: true }).catch(() => { });
|
|
20
|
+
}
|
|
21
|
+
export async function readJson(filePath) {
|
|
22
|
+
try {
|
|
23
|
+
const raw = await fs.readFile(filePath, "utf8");
|
|
24
|
+
return JSON.parse(raw || "{}");
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export async function writeJsonSecure(filePath, data) {
|
|
31
|
+
await fs.writeFile(filePath, JSON.stringify(data, null, 2), { mode: 0o600 });
|
|
32
|
+
}
|
|
33
|
+
export async function updateToolConfig(filePath, iterableConfig) {
|
|
34
|
+
await ensureDir(filePath);
|
|
35
|
+
const existing = await readJson(filePath);
|
|
36
|
+
const updated = {
|
|
37
|
+
...existing,
|
|
38
|
+
mcpServers: {
|
|
39
|
+
...existing.mcpServers,
|
|
40
|
+
iterable: iterableConfig,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
await writeJsonSecure(filePath, updated);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=tool-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../src/utils/tool-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EA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AK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,IAAS;IAC/D,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB,EAAE,cAAiC;IACxF,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG;QACd,GAAG,QAAQ;QACX,UAAU,EAAE;YACV,GAAG,QAAQ,CAAC,UAAU;YACtB,QAAQ,EAAE,cAAc;SACzB;KACF,CAAC;IACF,MAAM,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Beautiful CLI UI utilities with modern styling
|
|
3
|
+
*/
|
|
4
|
+
import Table from "cli-table3";
|
|
5
|
+
export declare const icons: {
|
|
6
|
+
rocket: string;
|
|
7
|
+
key: string;
|
|
8
|
+
check: string;
|
|
9
|
+
cross: string;
|
|
10
|
+
warning: string;
|
|
11
|
+
info: string;
|
|
12
|
+
sparkles: string;
|
|
13
|
+
lock: string;
|
|
14
|
+
globe: string;
|
|
15
|
+
zap: string;
|
|
16
|
+
party: string;
|
|
17
|
+
target: string;
|
|
18
|
+
bulb: string;
|
|
19
|
+
fire: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function showIterableLogo(version: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Display a beautiful header with bold ASCII art and gorgeous gradient
|
|
24
|
+
*/
|
|
25
|
+
export declare function showHeader(text: string, subtitle?: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Display a beautiful box with content
|
|
28
|
+
*/
|
|
29
|
+
export declare function showBox(title: string, content: string | string[], options?: {
|
|
30
|
+
icon?: string;
|
|
31
|
+
theme?: "primary" | "success" | "warning" | "error" | "info";
|
|
32
|
+
padding?: number;
|
|
33
|
+
}): void;
|
|
34
|
+
/**
|
|
35
|
+
* Display a success message
|
|
36
|
+
*/
|
|
37
|
+
export declare function showSuccess(message: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Display an error message
|
|
40
|
+
*/
|
|
41
|
+
export declare function showError(message: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Display a warning message
|
|
44
|
+
*/
|
|
45
|
+
export declare function showWarning(message: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Display an info message
|
|
48
|
+
*/
|
|
49
|
+
export declare function showInfo(message: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Display a tip message
|
|
52
|
+
*/
|
|
53
|
+
export declare function showTip(message: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Create a beautiful table
|
|
56
|
+
*/
|
|
57
|
+
export declare function createTable(options: {
|
|
58
|
+
head: string[];
|
|
59
|
+
colWidths?: (number | null)[];
|
|
60
|
+
style?: "compact" | "normal" | "spacious";
|
|
61
|
+
}): Table.Table;
|
|
62
|
+
/**
|
|
63
|
+
* Display a section header
|
|
64
|
+
*/
|
|
65
|
+
export declare function showSection(title: string, icon?: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Display a completion message with celebration
|
|
68
|
+
*/
|
|
69
|
+
export declare function showCompletion(title: string, nextSteps?: string[], tips?: string[]): void;
|
|
70
|
+
/**
|
|
71
|
+
* Format a key-value pair for display
|
|
72
|
+
*/
|
|
73
|
+
export declare function formatKeyValue(key: string, value: string, color?: import("chalk").ChalkInstance): string;
|
|
74
|
+
/**
|
|
75
|
+
* Create a beautiful divider
|
|
76
|
+
*/
|
|
77
|
+
export declare function showDivider(style?: "light" | "heavy"): void;
|
|
78
|
+
/**
|
|
79
|
+
* Display a progress indicator
|
|
80
|
+
*/
|
|
81
|
+
export declare function showProgress(message: string, done?: boolean): void;
|
|
82
|
+
/**
|
|
83
|
+
* Format a macOS Keychain entry label for selection lists
|
|
84
|
+
*/
|
|
85
|
+
export declare function formatKeychainChoiceLabel(name: string, endpoint: string, isActive: boolean, env?: {
|
|
86
|
+
ITERABLE_USER_PII?: string;
|
|
87
|
+
ITERABLE_ENABLE_WRITES?: string;
|
|
88
|
+
ITERABLE_ENABLE_SENDS?: string;
|
|
89
|
+
}): string;
|
|
90
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/utils/ui.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,MAAM,YAAY,CAAC;AA0C/B,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;CAejB,CAAC;AAeF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAqCtD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAoBhE;AAWD;;GAEG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,GAAE;IACP,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CACb,GACL,IAAI,CAkBN;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED;;GAEG;AACH,wBAAgB,SAAS,CA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