@syntica/mcp 2.5.0 → 2.6.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/dist/index.js
CHANGED
|
@@ -40684,9 +40684,9 @@ var require_connect = __commonJS({
|
|
|
40684
40684
|
if (config3 === void 0) {
|
|
40685
40685
|
config3 = DEFAULT_CONFIG;
|
|
40686
40686
|
}
|
|
40687
|
-
var
|
|
40687
|
+
var connector2 = config3.connector;
|
|
40688
40688
|
return lift_1.operate(function(source, subscriber) {
|
|
40689
|
-
var subject =
|
|
40689
|
+
var subject = connector2();
|
|
40690
40690
|
innerFrom_1.innerFrom(selector(fromSubscribable_1.fromSubscribable(subject))).subscribe(subscriber);
|
|
40691
40691
|
subscriber.add(source.subscribe(subject));
|
|
40692
40692
|
});
|
|
@@ -41574,13 +41574,13 @@ var require_groupBy = __commonJS({
|
|
|
41574
41574
|
var Subject_1 = require_Subject();
|
|
41575
41575
|
var lift_1 = require_lift();
|
|
41576
41576
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
41577
|
-
function groupBy(keySelector, elementOrOptions, duration3,
|
|
41577
|
+
function groupBy(keySelector, elementOrOptions, duration3, connector2) {
|
|
41578
41578
|
return lift_1.operate(function(source, subscriber) {
|
|
41579
41579
|
var element;
|
|
41580
41580
|
if (!elementOrOptions || typeof elementOrOptions === "function") {
|
|
41581
41581
|
element = elementOrOptions;
|
|
41582
41582
|
} else {
|
|
41583
|
-
duration3 = elementOrOptions.duration, element = elementOrOptions.element,
|
|
41583
|
+
duration3 = elementOrOptions.duration, element = elementOrOptions.element, connector2 = elementOrOptions.connector;
|
|
41584
41584
|
}
|
|
41585
41585
|
var groups = /* @__PURE__ */ new Map();
|
|
41586
41586
|
var notify = function(cb) {
|
|
@@ -41599,7 +41599,7 @@ var require_groupBy = __commonJS({
|
|
|
41599
41599
|
var key_1 = keySelector(value);
|
|
41600
41600
|
var group_1 = groups.get(key_1);
|
|
41601
41601
|
if (!group_1) {
|
|
41602
|
-
groups.set(key_1, group_1 =
|
|
41602
|
+
groups.set(key_1, group_1 = connector2 ? connector2() : new Subject_1.Subject());
|
|
41603
41603
|
var grouped = createGroupedObservable(key_1, group_1);
|
|
41604
41604
|
subscriber.next(grouped);
|
|
41605
41605
|
if (duration3) {
|
|
@@ -43132,7 +43132,7 @@ var require_share = __commonJS({
|
|
|
43132
43132
|
if (options === void 0) {
|
|
43133
43133
|
options = {};
|
|
43134
43134
|
}
|
|
43135
|
-
var _a = options.connector,
|
|
43135
|
+
var _a = options.connector, connector2 = _a === void 0 ? function() {
|
|
43136
43136
|
return new Subject_1.Subject();
|
|
43137
43137
|
} : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;
|
|
43138
43138
|
return function(wrapperSource) {
|
|
@@ -43161,7 +43161,7 @@ var require_share = __commonJS({
|
|
|
43161
43161
|
if (!hasErrored && !hasCompleted) {
|
|
43162
43162
|
cancelReset();
|
|
43163
43163
|
}
|
|
43164
|
-
var dest = subject = subject !== null && subject !== void 0 ? subject :
|
|
43164
|
+
var dest = subject = subject !== null && subject !== void 0 ? subject : connector2();
|
|
43165
43165
|
subscriber.add(function() {
|
|
43166
43166
|
refCount--;
|
|
43167
43167
|
if (refCount === 0 && !hasErrored && !hasCompleted) {
|
|
@@ -52660,9 +52660,9 @@ var require_FailoverDetector = __commonJS({
|
|
|
52660
52660
|
var CHANNEL_NAME = "+switch-master";
|
|
52661
52661
|
var FailoverDetector = class {
|
|
52662
52662
|
// sentinels can't be used for regular commands after this
|
|
52663
|
-
constructor(
|
|
52663
|
+
constructor(connector2, sentinels) {
|
|
52664
52664
|
this.isDisconnected = false;
|
|
52665
|
-
this.connector =
|
|
52665
|
+
this.connector = connector2;
|
|
52666
52666
|
this.sentinels = sentinels;
|
|
52667
52667
|
}
|
|
52668
52668
|
cleanup() {
|
|
@@ -68038,6 +68038,8 @@ var UpstreamRequestError = class extends Error {
|
|
|
68038
68038
|
};
|
|
68039
68039
|
|
|
68040
68040
|
// libs/shared/src/types/connector.ts
|
|
68041
|
+
var CONNECTOR_GATEWAY_HOST = "connectors.internal";
|
|
68042
|
+
var CONNECTOR_GATEWAY_ORIGIN = `http://${CONNECTOR_GATEWAY_HOST}:9480`;
|
|
68041
68043
|
var CONNECTORS = [
|
|
68042
68044
|
{
|
|
68043
68045
|
id: "microsoft-365",
|
|
@@ -68068,6 +68070,7 @@ var CONNECTORS = [
|
|
|
68068
68070
|
},
|
|
68069
68071
|
pitch: { title: "Let your apps send mail from your domain", examples: "Order confirmations, password resets, invoices. Sent from a mailbox your team already owns.", effort: "About 15 minutes. You need to be an Entra admin." },
|
|
68070
68072
|
docsUrl: "https://learn.microsoft.com/graph/api/user-sendmail",
|
|
68073
|
+
hosts: ["graph.microsoft.com", "login.microsoftonline.com"],
|
|
68071
68074
|
attestation: {
|
|
68072
68075
|
label: "An ApplicationAccessPolicy limits this registration to the one mailbox",
|
|
68073
68076
|
detail: "Without it, a registration holding Mail.Send can send as any mailbox in the tenant. The policy lives in your tenant, so the platform cannot create it or check that it exists."
|
|
@@ -68101,7 +68104,20 @@ var CONNECTORS = [
|
|
|
68101
68104
|
MAIL_FROM: "Sender address. Must be one this mailbox may send as"
|
|
68102
68105
|
},
|
|
68103
68106
|
pitch: { title: "Let your apps send mail", examples: "Order confirmations, password resets, contact forms. Through the mail account you already pay for.", effort: "About 5 minutes. You need the mailbox password." },
|
|
68104
|
-
docsUrl: "https://nodemailer.com/smtp"
|
|
68107
|
+
docsUrl: "https://nodemailer.com/smtp",
|
|
68108
|
+
hosts: [],
|
|
68109
|
+
// Granting SMTP is also its egress rule under enforce (#1474).
|
|
68110
|
+
tcp: [{ hostVar: "SMTP_HOST", portVar: "SMTP_PORT" }],
|
|
68111
|
+
// Gateway mode (#1583): the relay on the node logs in with the real account.
|
|
68112
|
+
gateway: {
|
|
68113
|
+
baseUrlVar: "SMTP_HOST",
|
|
68114
|
+
upstream: { fromVar: "SMTP_HOST" },
|
|
68115
|
+
credentialVars: ["SMTP_PASS"],
|
|
68116
|
+
auth: ["smtp"],
|
|
68117
|
+
basicUserVar: "SMTP_USER",
|
|
68118
|
+
credentialLocations: { headers: [], query: [], form: [] },
|
|
68119
|
+
smtp: { portVar: "SMTP_PORT", secureVar: "SMTP_SECURE" }
|
|
68120
|
+
}
|
|
68105
68121
|
},
|
|
68106
68122
|
{
|
|
68107
68123
|
id: "microsoft-entra-id",
|
|
@@ -68131,7 +68147,8 @@ var CONNECTORS = [
|
|
|
68131
68147
|
ENTRA_REDIRECT_URI: "Where Entra sends users back"
|
|
68132
68148
|
},
|
|
68133
68149
|
pitch: { title: "Let your users sign in with Microsoft", examples: "Work accounts, MFA and your password policy. Your app still needs an OIDC client to use them.", effort: "About 15 minutes. You need to be an Entra admin." },
|
|
68134
|
-
docsUrl: "https://learn.microsoft.com/entra/identity-platform/"
|
|
68150
|
+
docsUrl: "https://learn.microsoft.com/entra/identity-platform/",
|
|
68151
|
+
hosts: ["login.microsoftonline.com", "graph.microsoft.com"]
|
|
68135
68152
|
},
|
|
68136
68153
|
{
|
|
68137
68154
|
id: "sap-odata",
|
|
@@ -68161,7 +68178,17 @@ var CONNECTORS = [
|
|
|
68161
68178
|
SAP_PASSWORD: "Password, hidden after saving"
|
|
68162
68179
|
},
|
|
68163
68180
|
pitch: { title: "Let your apps work with SAP data", examples: "Sales orders, stock, customers. Read straight from the system your business runs on.", effort: "About 30 minutes. You need an SAP basis admin." },
|
|
68164
|
-
docsUrl: "https://help.sap.com/docs/SAP_NETWEAVER_750/68bf513362174d54b58cddec28794093/"
|
|
68181
|
+
docsUrl: "https://help.sap.com/docs/SAP_NETWEAVER_750/68bf513362174d54b58cddec28794093/",
|
|
68182
|
+
hosts: [],
|
|
68183
|
+
hostVars: ["SAP_ODATA_URL"],
|
|
68184
|
+
gateway: {
|
|
68185
|
+
baseUrlVar: "SAP_ODATA_URL",
|
|
68186
|
+
upstream: { fromVar: "SAP_ODATA_URL" },
|
|
68187
|
+
credentialVars: ["SAP_PASSWORD"],
|
|
68188
|
+
auth: ["basic"],
|
|
68189
|
+
basicUserVar: "SAP_USER",
|
|
68190
|
+
credentialLocations: { headers: ["authorization"], query: [], form: [] }
|
|
68191
|
+
}
|
|
68165
68192
|
},
|
|
68166
68193
|
{
|
|
68167
68194
|
id: "sharepoint",
|
|
@@ -68191,7 +68218,8 @@ var CONNECTORS = [
|
|
|
68191
68218
|
SHAREPOINT_SITE_ID: "The site to reach"
|
|
68192
68219
|
},
|
|
68193
68220
|
pitch: { title: "Let your apps use your SharePoint files", examples: "Read templates, store generated documents, share them with the team. In the site you already use.", effort: "About 15 minutes. You need to be a SharePoint admin." },
|
|
68194
|
-
docsUrl: "https://learn.microsoft.com/graph/api/resources/sharepoint"
|
|
68221
|
+
docsUrl: "https://learn.microsoft.com/graph/api/resources/sharepoint",
|
|
68222
|
+
hosts: ["graph.microsoft.com", "login.microsoftonline.com"]
|
|
68195
68223
|
},
|
|
68196
68224
|
{
|
|
68197
68225
|
id: "microsoft-teams",
|
|
@@ -68216,7 +68244,9 @@ var CONNECTORS = [
|
|
|
68216
68244
|
TEAMS_WEBHOOK_URL: "The channel webhook, hidden after saving"
|
|
68217
68245
|
},
|
|
68218
68246
|
pitch: { title: "Let your apps post to Teams", examples: "Order alerts, sign-ups, daily summaries. Straight into the channel your team already reads.", effort: "About 5 minutes. You need to own the channel." },
|
|
68219
|
-
docsUrl: "https://learn.microsoft.com/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook"
|
|
68247
|
+
docsUrl: "https://learn.microsoft.com/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook",
|
|
68248
|
+
hosts: [],
|
|
68249
|
+
hostVars: ["TEAMS_WEBHOOK_URL"]
|
|
68220
68250
|
},
|
|
68221
68251
|
{
|
|
68222
68252
|
id: "slack",
|
|
@@ -68245,7 +68275,8 @@ var CONNECTORS = [
|
|
|
68245
68275
|
SLACK_CHANNEL_ID: "The channel to post to"
|
|
68246
68276
|
},
|
|
68247
68277
|
pitch: { title: "Let your apps post to Slack", examples: "Order alerts, sign-ups, daily summaries. Straight into the channel your team already reads.", effort: "About 5 minutes. You need to be a Slack admin." },
|
|
68248
|
-
docsUrl: "https://api.slack.com/docs"
|
|
68278
|
+
docsUrl: "https://api.slack.com/docs",
|
|
68279
|
+
hosts: ["slack.com", "files.slack.com"]
|
|
68249
68280
|
},
|
|
68250
68281
|
{
|
|
68251
68282
|
id: "stripe",
|
|
@@ -68273,7 +68304,8 @@ var CONNECTORS = [
|
|
|
68273
68304
|
STRIPE_PUBLISHABLE_KEY: "Browser key, starts pk_"
|
|
68274
68305
|
},
|
|
68275
68306
|
pitch: { title: "Let your apps take payments", examples: "Checkouts, subscriptions, invoices. Paid out to your own Stripe account.", effort: "About 10 minutes. You need a Stripe admin login." },
|
|
68276
|
-
docsUrl: "https://docs.stripe.com/api"
|
|
68307
|
+
docsUrl: "https://docs.stripe.com/api",
|
|
68308
|
+
hosts: ["api.stripe.com", "files.stripe.com"]
|
|
68277
68309
|
},
|
|
68278
68310
|
{
|
|
68279
68311
|
id: "supabase",
|
|
@@ -68303,6 +68335,8 @@ var CONNECTORS = [
|
|
|
68303
68335
|
},
|
|
68304
68336
|
pitch: { title: "Let your apps use Supabase", examples: "A database, logins and file storage. In a project your company owns.", effort: "About 5 minutes. You need to own the project." },
|
|
68305
68337
|
docsUrl: "https://supabase.com/docs/guides/api",
|
|
68338
|
+
hosts: [],
|
|
68339
|
+
hostVars: ["SUPABASE_URL"],
|
|
68306
68340
|
attestation: {
|
|
68307
68341
|
label: "Row Level Security is enabled on every table the anon key can reach",
|
|
68308
68342
|
detail: "The anon key is designed to be public, so it is only as safe as the policies behind it: without RLS, anyone holding it can read and write every exposed table through the auto-generated API. RLS lives in the customer's Supabase project, so the platform cannot enable it or check that it is on."
|
|
@@ -68331,7 +68365,16 @@ var CONNECTORS = [
|
|
|
68331
68365
|
GEMINI_API_KEY: "API key, starts AIza"
|
|
68332
68366
|
},
|
|
68333
68367
|
pitch: { title: "Let your apps use Gemini", examples: "Summaries, extraction, chat. Billed to your own Google account.", effort: "About 5 minutes. You need a Google Cloud project." },
|
|
68334
|
-
docsUrl: "https://ai.google.dev/gemini-api/docs"
|
|
68368
|
+
docsUrl: "https://ai.google.dev/gemini-api/docs",
|
|
68369
|
+
hosts: ["generativelanguage.googleapis.com"],
|
|
68370
|
+
gateway: {
|
|
68371
|
+
baseUrlVar: "GOOGLE_GEMINI_BASE_URL",
|
|
68372
|
+
upstream: "https://generativelanguage.googleapis.com",
|
|
68373
|
+
credentialVars: ["GEMINI_API_KEY"],
|
|
68374
|
+
auth: ["x-goog-api-key"],
|
|
68375
|
+
ai: true,
|
|
68376
|
+
credentialLocations: { headers: ["x-goog-api-key", "authorization"], query: ["key"], form: [] }
|
|
68377
|
+
}
|
|
68335
68378
|
},
|
|
68336
68379
|
{
|
|
68337
68380
|
id: "openai",
|
|
@@ -68357,7 +68400,16 @@ var CONNECTORS = [
|
|
|
68357
68400
|
OPENAI_API_KEY: "API key, starts sk-"
|
|
68358
68401
|
},
|
|
68359
68402
|
pitch: { title: "Let your apps use OpenAI", examples: "Summaries, extraction, chat. Billed to your own OpenAI account.", effort: "About 5 minutes. You need an OpenAI admin login." },
|
|
68360
|
-
docsUrl: "https://platform.openai.com/docs/api-reference"
|
|
68403
|
+
docsUrl: "https://platform.openai.com/docs/api-reference",
|
|
68404
|
+
hosts: ["api.openai.com"],
|
|
68405
|
+
gateway: {
|
|
68406
|
+
baseUrlVar: "OPENAI_BASE_URL",
|
|
68407
|
+
upstream: "https://api.openai.com/v1",
|
|
68408
|
+
credentialVars: ["OPENAI_API_KEY"],
|
|
68409
|
+
auth: ["bearer"],
|
|
68410
|
+
ai: true,
|
|
68411
|
+
credentialLocations: { headers: ["authorization"], query: [], form: [] }
|
|
68412
|
+
}
|
|
68361
68413
|
},
|
|
68362
68414
|
{
|
|
68363
68415
|
id: "anthropic",
|
|
@@ -68382,10 +68434,94 @@ var CONNECTORS = [
|
|
|
68382
68434
|
ANTHROPIC_API_KEY: "API key, starts sk-ant-"
|
|
68383
68435
|
},
|
|
68384
68436
|
pitch: { title: "Let your apps use Claude", examples: "Summaries, extraction, chat. Billed to your own Anthropic account.", effort: "About 5 minutes. You need an Anthropic admin login." },
|
|
68385
|
-
docsUrl: "https://docs.claude.com/en/api/overview"
|
|
68437
|
+
docsUrl: "https://docs.claude.com/en/api/overview",
|
|
68438
|
+
hosts: ["api.anthropic.com"],
|
|
68439
|
+
gateway: {
|
|
68440
|
+
baseUrlVar: "ANTHROPIC_BASE_URL",
|
|
68441
|
+
upstream: "https://api.anthropic.com",
|
|
68442
|
+
credentialVars: ["ANTHROPIC_API_KEY"],
|
|
68443
|
+
auth: ["x-api-key", "bearer"],
|
|
68444
|
+
ai: true,
|
|
68445
|
+
credentialLocations: { headers: ["x-api-key", "authorization"], query: [], form: [] }
|
|
68446
|
+
}
|
|
68447
|
+
},
|
|
68448
|
+
// Internal: an https echo server, to test the connector gateway end to end (#1469).
|
|
68449
|
+
{
|
|
68450
|
+
id: "echo",
|
|
68451
|
+
name: "Echo",
|
|
68452
|
+
category: "Internal",
|
|
68453
|
+
tone: "blue",
|
|
68454
|
+
blurb: "An echo server for testing the connector gateway.",
|
|
68455
|
+
long: "Internal test fixture. Not offered to customers.",
|
|
68456
|
+
vars: ["ECHO_URL", "ECHO_API_KEY"],
|
|
68457
|
+
steps: ["Deploy an https echo server and note its URL."],
|
|
68458
|
+
tagline: "An echo server for testing the connector gateway.",
|
|
68459
|
+
points: [],
|
|
68460
|
+
varDescriptions: { ECHO_URL: "The echo server URL", ECHO_API_KEY: "Any key, echoed back" },
|
|
68461
|
+
pitch: { title: "Echo", examples: "Internal test fixture.", effort: "Internal only." },
|
|
68462
|
+
docsUrl: "https://syntica.io",
|
|
68463
|
+
hosts: [],
|
|
68464
|
+
hostVars: ["ECHO_URL"],
|
|
68465
|
+
gateway: {
|
|
68466
|
+
baseUrlVar: "ECHO_URL",
|
|
68467
|
+
upstream: { fromVar: "ECHO_URL" },
|
|
68468
|
+
credentialVars: ["ECHO_API_KEY"],
|
|
68469
|
+
auth: ["bearer"],
|
|
68470
|
+
credentialLocations: { headers: ["authorization"], query: [], form: [] }
|
|
68471
|
+
},
|
|
68472
|
+
hidden: true
|
|
68386
68473
|
}
|
|
68387
68474
|
];
|
|
68388
|
-
var CONNECTOR_CATEGORIES = Array.from(new Set(CONNECTORS.map((c) => c.category)));
|
|
68475
|
+
var CONNECTOR_CATEGORIES = Array.from(new Set(CONNECTORS.filter((c) => c.hidden !== true).map((c) => c.category)));
|
|
68476
|
+
function connector(id) {
|
|
68477
|
+
return CONNECTORS.find((c) => c.id === id);
|
|
68478
|
+
}
|
|
68479
|
+
|
|
68480
|
+
// libs/shared/src/types/custom-integration.ts
|
|
68481
|
+
var CUSTOM_CONNECTOR_ID = "custom";
|
|
68482
|
+
function customVars(def) {
|
|
68483
|
+
return { url: `${def.varPrefix}_URL`, token: `${def.varPrefix}_TOKEN`, user: `${def.varPrefix}_USER` };
|
|
68484
|
+
}
|
|
68485
|
+
function customConnector(name, def) {
|
|
68486
|
+
const v2 = customVars(def);
|
|
68487
|
+
const cred = def.credential;
|
|
68488
|
+
const basic = cred?.shape === "basic";
|
|
68489
|
+
const header = cred?.shape === "header" ? (cred.header ?? "").toLowerCase() : void 0;
|
|
68490
|
+
return {
|
|
68491
|
+
id: CUSTOM_CONNECTOR_ID,
|
|
68492
|
+
name,
|
|
68493
|
+
category: "Custom",
|
|
68494
|
+
tone: "blue",
|
|
68495
|
+
blurb: "An integration your organisation defined.",
|
|
68496
|
+
long: "",
|
|
68497
|
+
tagline: "An integration your organisation defined.",
|
|
68498
|
+
points: [],
|
|
68499
|
+
vars: cred === null ? [] : basic ? [v2.user, v2.token] : [v2.token],
|
|
68500
|
+
varDescriptions: cred === null ? {} : { ...basic ? { [v2.user]: "User name" } : {}, [v2.token]: "Credential, hidden after saving" },
|
|
68501
|
+
steps: [],
|
|
68502
|
+
pitch: { title: name, examples: "", effort: "" },
|
|
68503
|
+
docsUrl: "",
|
|
68504
|
+
hosts: def.hosts,
|
|
68505
|
+
tcp: def.tcp.map((t) => ({ host: t.host, port: t.port })),
|
|
68506
|
+
...cred !== null && def.baseUrl !== null ? {
|
|
68507
|
+
gateway: {
|
|
68508
|
+
baseUrlVar: v2.url,
|
|
68509
|
+
upstream: def.baseUrl,
|
|
68510
|
+
credentialVars: [v2.token],
|
|
68511
|
+
auth: [cred.shape],
|
|
68512
|
+
...basic ? { basicUserVar: v2.user } : {},
|
|
68513
|
+
...header !== void 0 ? { header } : {},
|
|
68514
|
+
credentialLocations: { headers: [header ?? "authorization"], query: [], form: [] }
|
|
68515
|
+
}
|
|
68516
|
+
} : {}
|
|
68517
|
+
};
|
|
68518
|
+
}
|
|
68519
|
+
function connectorOf(c) {
|
|
68520
|
+
if (c.connectorId === CUSTOM_CONNECTOR_ID) {
|
|
68521
|
+
return c.custom === null || c.custom === void 0 ? void 0 : customConnector(c.name, c.custom);
|
|
68522
|
+
}
|
|
68523
|
+
return connector(c.connectorId);
|
|
68524
|
+
}
|
|
68389
68525
|
|
|
68390
68526
|
// libs/shared/src/types/resource.ts
|
|
68391
68527
|
var MIN_BACKUP_RETENTION_DAYS = 1;
|
|
@@ -69457,6 +69593,33 @@ var AuthClient = class {
|
|
|
69457
69593
|
async revokeOrg(orgId, serviceKey) {
|
|
69458
69594
|
return this.postInternal("revoke-org", { orgId }, serviceKey);
|
|
69459
69595
|
}
|
|
69596
|
+
/** Email change step 1 (#1559): a code to the user's current address. */
|
|
69597
|
+
async sendCurrentEmailCode(userId, currentEmail, serviceKey) {
|
|
69598
|
+
return this.callInternal("email-change/start", { userId, email: currentEmail }, serviceKey);
|
|
69599
|
+
}
|
|
69600
|
+
/** Step 2: a code to the new address, refused unless the current-address code is right. */
|
|
69601
|
+
async sendEmailChangeCode(userId, email2, currentCode, serviceKey) {
|
|
69602
|
+
return this.callInternal("email-change/send", { userId, email: email2, currentCode }, serviceKey);
|
|
69603
|
+
}
|
|
69604
|
+
/** The address the user's code was sent to, when the code is right. Consumes the code. */
|
|
69605
|
+
async verifyEmailChangeCode(userId, code, serviceKey) {
|
|
69606
|
+
return this.callInternal("email-change/verify", { userId, code }, serviceKey);
|
|
69607
|
+
}
|
|
69608
|
+
/** Unlike postInternal, keeps the status and message so the caller can pass a 400 or 429 on. status 0: unreachable. */
|
|
69609
|
+
async callInternal(path, body, serviceKey) {
|
|
69610
|
+
try {
|
|
69611
|
+
const res = await fetch(`${this.baseUrl}/auth/${path}`, {
|
|
69612
|
+
method: "POST",
|
|
69613
|
+
headers: { "Content-Type": "application/json", "x-internal-secret": serviceKey },
|
|
69614
|
+
body: JSON.stringify(body)
|
|
69615
|
+
});
|
|
69616
|
+
const json = await res.json().catch(() => ({}));
|
|
69617
|
+
const message = Array.isArray(json.message) ? json.message.join(", ") : json.message;
|
|
69618
|
+
return { status: res.status, data: json.data ?? null, error: res.ok ? null : message ?? json.error ?? null };
|
|
69619
|
+
} catch {
|
|
69620
|
+
return { status: 0, data: null, error: null };
|
|
69621
|
+
}
|
|
69622
|
+
}
|
|
69460
69623
|
async postInternal(path, body, serviceKey) {
|
|
69461
69624
|
try {
|
|
69462
69625
|
const res = await fetch(`${this.baseUrl}/auth/${path}`, {
|
|
@@ -69813,6 +69976,27 @@ var DeployClient = class {
|
|
|
69813
69976
|
return { stopped: 0, failed: 0 };
|
|
69814
69977
|
}
|
|
69815
69978
|
}
|
|
69979
|
+
/**
|
|
69980
|
+
* Beta lapsed: stop the org's running nodes (EC2 stop, EBS kept). Throws on a
|
|
69981
|
+
* refusal or a transport error, unlike {@link suspendOrgInfra}: the caller
|
|
69982
|
+
* records the org as asleep only when this succeeds, and a swallowed refusal
|
|
69983
|
+
* once let a lapsed beta keep running while recorded asleep (#1067).
|
|
69984
|
+
*/
|
|
69985
|
+
async sleepBetaOrg(orgId) {
|
|
69986
|
+
const res = await fetch(`${this.baseUrl}/internal/beta/orgs/${encodeURIComponent(orgId)}/sleep`, {
|
|
69987
|
+
method: "POST",
|
|
69988
|
+
headers: this.internalHeaders,
|
|
69989
|
+
signal: AbortSignal.timeout(6e4)
|
|
69990
|
+
});
|
|
69991
|
+
if (!res.ok) {
|
|
69992
|
+
throw new Error(`deploy-service beta sleep(${orgId}) returned ${String(res.status)}`);
|
|
69993
|
+
}
|
|
69994
|
+
const json = await res.json();
|
|
69995
|
+
if (json.data === null) {
|
|
69996
|
+
throw new Error(`deploy-service beta sleep(${orgId}) returned no result`);
|
|
69997
|
+
}
|
|
69998
|
+
return json.data;
|
|
69999
|
+
}
|
|
69816
70000
|
/**
|
|
69817
70001
|
* GDPR person erasure: tombstone a deleted person's display name in build
|
|
69818
70002
|
* history (`Build.triggeredBy`) for the given apps. Best-effort / fail-soft —
|
|
@@ -70004,6 +70188,23 @@ var UserClient = class {
|
|
|
70004
70188
|
role
|
|
70005
70189
|
});
|
|
70006
70190
|
}
|
|
70191
|
+
/** Whether the actor may add someone to these groups now (an invite that carries groups). */
|
|
70192
|
+
canAddToGroups(orgId, actorUserId, groupIds) {
|
|
70193
|
+
return this.request("POST", "/access-control/internal/can-add-to-groups", {
|
|
70194
|
+
orgId,
|
|
70195
|
+
actorUserId,
|
|
70196
|
+
groupIds
|
|
70197
|
+
});
|
|
70198
|
+
}
|
|
70199
|
+
/** Adds a member who accepted an invite to its groups, as the inviter. Groups the inviter may no longer add to are skipped. */
|
|
70200
|
+
addInviteeToGroups(orgId, actorUserId, userId, groupIds) {
|
|
70201
|
+
return this.request("POST", "/access-control/internal/groups/add-invitee", {
|
|
70202
|
+
orgId,
|
|
70203
|
+
actorUserId,
|
|
70204
|
+
userId,
|
|
70205
|
+
groupIds
|
|
70206
|
+
});
|
|
70207
|
+
}
|
|
70007
70208
|
addMember(orgId, options) {
|
|
70008
70209
|
return this.request("POST", `/organisations/internal/${orgId}/members`, options);
|
|
70009
70210
|
}
|
|
@@ -71380,8 +71581,9 @@ var NOTIFICATION_TYPES = {
|
|
|
71380
71581
|
target: () => "cloud-accounts"
|
|
71381
71582
|
},
|
|
71382
71583
|
// Day 1 after the CloudFormation stack of an org cloud account was deleted
|
|
71383
|
-
// (RFC #1248). Apps keep running in
|
|
71384
|
-
// addresses stop working at the end of
|
|
71584
|
+
// (RFC #1248), or an admin left Syntica for it (#1476). Apps keep running in
|
|
71585
|
+
// the customer's account, but default addresses stop working at the end of
|
|
71586
|
+
// the grace period. `cause` says which, notices sent before it carry none.
|
|
71385
71587
|
"cloud_account.disconnected": {
|
|
71386
71588
|
key: "cloud_account.disconnected",
|
|
71387
71589
|
category: "connection",
|
|
@@ -71391,7 +71593,7 @@ var NOTIFICATION_TYPES = {
|
|
|
71391
71593
|
emailDefault: true,
|
|
71392
71594
|
emailTemplateId: "cloud-account-disconnected",
|
|
71393
71595
|
title: (x) => `Cloud account disconnected \xB7 ${v(x, "accountName")}`,
|
|
71394
|
-
body: (x) => `The Syntica stack in ${v(x, "accountName")} (${v(x, "region")}) was deleted
|
|
71596
|
+
body: (x) => `${v(x, "cause") || `The Syntica stack in ${v(x, "accountName")} (${v(x, "region")}) was deleted.`} Its apps keep running in your AWS account, but the default addresses of its ${environments(x)} stop working on ${v(x, "defaultAddressesUntil")}. Apps that already have their own domain keep working.`,
|
|
71395
71597
|
target: () => "cloud-accounts"
|
|
71396
71598
|
},
|
|
71397
71599
|
// Day 5 of the same grace period: the last reminder before the default addresses go.
|
|
@@ -71440,6 +71642,19 @@ var NOTIFICATION_TYPES = {
|
|
|
71440
71642
|
body: (x) => `No connection with the ${v(x, "environment")} node of ${v(x, "appName")} since ${v(x, "lastContact")}. The app keeps running on its last settings, but deploys and changes cannot reach it. ${v(x, "reason")}${v(x, "exitNote") !== "" ? ` ${v(x, "exitNote")}` : ""}`,
|
|
71441
71643
|
target: appTarget
|
|
71442
71644
|
},
|
|
71645
|
+
// Emitted by agent-gateway from the agent's connectors.gateway.report, once per crossing into down.
|
|
71646
|
+
"connectors.gateway.down": {
|
|
71647
|
+
key: "connectors.gateway.down",
|
|
71648
|
+
category: "connection",
|
|
71649
|
+
severity: "error",
|
|
71650
|
+
audience: "admins",
|
|
71651
|
+
inAppDefault: true,
|
|
71652
|
+
emailDefault: true,
|
|
71653
|
+
emailTemplateId: "connectors-gateway-down",
|
|
71654
|
+
title: (x) => `Connector gateway down \xB7 ${v(x, "appName")}`,
|
|
71655
|
+
body: (x) => `The connector gateway on the ${v(x, "environment")} node of ${v(x, "appName")} stopped answering. Connections in gateway mode fail until it is back.`,
|
|
71656
|
+
target: appTarget
|
|
71657
|
+
},
|
|
71443
71658
|
// Confirmation to the person that their account is scheduled for deletion (userId-targeted).
|
|
71444
71659
|
"user.erasure.scheduled": {
|
|
71445
71660
|
key: "user.erasure.scheduled",
|
|
@@ -72006,6 +72221,8 @@ async function handleOrgListCloudAccounts(args) {
|
|
|
72006
72221
|
namespace: a.namespace,
|
|
72007
72222
|
updateRequired: a.updateRequired,
|
|
72008
72223
|
placeable: a.placeable,
|
|
72224
|
+
egressIp: a.egressIp,
|
|
72225
|
+
fixedEgress: a.fixedEgress,
|
|
72009
72226
|
...updateFields(a),
|
|
72010
72227
|
...connectionFields(a)
|
|
72011
72228
|
}))
|
|
@@ -72670,7 +72887,7 @@ var tools6 = [
|
|
|
72670
72887
|
// apps/mcp-server/src/tools/connections.ts
|
|
72671
72888
|
var appDescribeConnectionsTool = {
|
|
72672
72889
|
name: "app_describe_connections",
|
|
72673
|
-
description:
|
|
72890
|
+
description: `Describe the platform connections granted to an application environment \u2014 mail, storage, databases, payments, AI and the rest of the connector catalogue. Returns each granted connection's connector, its name, and the environment variable NAMES the platform injects at deploy time. Never returns a credential. ALWAYS call this before writing or changing code that talks to an external system: write against the injected variables, never hardcode a credential or a vendor host (an AI SDK reads its base URL from OPENAI_BASE_URL, ANTHROPIC_BASE_URL or GOOGLE_GEMINI_BASE_URL), and never add a client library that contradicts the granted connector. If nothing is granted, say so and point the user at Connections rather than inventing a path of your own. A grant with connectorId "custom" is an integration the organisation defined itself: its custom object gives the hosts and TCP ports it may reach, its credential shape (bearer, basic or a named header) and its variable prefix, so the variables are <PREFIX>_URL, <PREFIX>_TOKEN and, for basic auth, <PREFIX>_USER. Where a connection carries baseUrl, call the vendor through baseUrl.variable, never through another URL variable: in gateway mode only that one reaches the gateway. Use the fallback only when the variable is unset.`,
|
|
72674
72891
|
annotations: { readOnlyHint: true, destructiveHint: false },
|
|
72675
72892
|
inputSchema: {
|
|
72676
72893
|
type: "object",
|
|
@@ -72700,14 +72917,31 @@ async function handleAppDescribeConnections(args) {
|
|
|
72700
72917
|
if (!res.ok) {
|
|
72701
72918
|
return { content: [{ type: "text", text: `Error: ${json.error ?? res.statusText}` }], isError: true };
|
|
72702
72919
|
}
|
|
72703
|
-
|
|
72920
|
+
const connections = Array.isArray(json.data) ? json.data.map(withBaseUrl) : json.data;
|
|
72921
|
+
return { content: [{ type: "text", text: JSON.stringify({ connections }, null, 2) }] };
|
|
72704
72922
|
} catch (err) {
|
|
72705
72923
|
return fromCatch(err);
|
|
72706
72924
|
}
|
|
72707
72925
|
}
|
|
72926
|
+
function withBaseUrl(c) {
|
|
72927
|
+
const def = typeof c.connectorId === "string" ? connectorOf({ connectorId: c.connectorId, name: typeof c.name === "string" ? c.name : "", custom: c.custom ?? null }) : void 0;
|
|
72928
|
+
if (def?.gateway === void 0 || def.vars.includes(def.gateway.baseUrlVar)) {
|
|
72929
|
+
return c;
|
|
72930
|
+
}
|
|
72931
|
+
const upstream = def.gateway.upstream;
|
|
72932
|
+
const fallback = typeof upstream === "string" ? { fallbackUrl: upstream } : { fallbackVariable: upstream.fromVar };
|
|
72933
|
+
return {
|
|
72934
|
+
...c,
|
|
72935
|
+
baseUrl: {
|
|
72936
|
+
variable: def.gateway.baseUrlVar,
|
|
72937
|
+
...fallback,
|
|
72938
|
+
note: "Call the vendor through this variable. Use the fallback only when it is unset, never ahead of it."
|
|
72939
|
+
}
|
|
72940
|
+
};
|
|
72941
|
+
}
|
|
72708
72942
|
var appRequestConnectionTool = {
|
|
72709
72943
|
name: "app_request_connection",
|
|
72710
|
-
description: 'Ask an organisation admin for a connection on one application environment. Use this when app_describe_connections returns nothing for the system you need \u2014 instead of asking the user for a credential or telling them to go and configure one. Names a connector from the catalogue (e.g. "smtp", "stripe", "slack")
|
|
72944
|
+
description: 'Ask an organisation admin for a connection on one application environment. Use this when app_describe_connections returns nothing for the system you need \u2014 instead of asking the user for a credential or telling them to go and configure one. Names a connector from the catalogue (e.g. "smtp", "stripe", "slack"), or "custom" for an API or TCP service outside the catalogue, with the exact hosts (and host:port for TCP) and what it is for in the note. The admin decides which of their connections satisfies it and is notified in the platform and by email. Repeating a request that is already pending returns the open one rather than queueing another, except for "custom", where each request stands alone. For "custom" the admin defines the integration when approving and sees only the purpose line, so put the host(s) and port(s), the credential shape (bearer, basic or which header) and whether a base URL is wanted in it.',
|
|
72711
72945
|
annotations: { readOnlyHint: false, destructiveHint: false },
|
|
72712
72946
|
inputSchema: {
|
|
72713
72947
|
type: "object",
|
|
@@ -72721,7 +72955,7 @@ var appRequestConnectionTool = {
|
|
|
72721
72955
|
},
|
|
72722
72956
|
connectorId: {
|
|
72723
72957
|
type: "string",
|
|
72724
|
-
description: 'A connector id as returned by app_describe_connections, e.g. "smtp" or "stripe"'
|
|
72958
|
+
description: 'A connector id as returned by app_describe_connections, e.g. "smtp" or "stripe", or "custom"'
|
|
72725
72959
|
},
|
|
72726
72960
|
note: {
|
|
72727
72961
|
type: "string",
|
|
@@ -73759,12 +73993,67 @@ async function handleAppReplaceInstance(args) {
|
|
|
73759
73993
|
{ confirm }
|
|
73760
73994
|
);
|
|
73761
73995
|
}
|
|
73996
|
+
var appSetSleepWhenIdleTool = {
|
|
73997
|
+
name: "app_set_sleep_when_idle",
|
|
73998
|
+
description: "Set sleep when idle for an environment. Only for environments in the customer's own cloud account (AWS). Stops the environment after that many minutes without visitors and wakes it again on the next visit. The saving lands on the customer's own AWS bill. Pass minutes 0 to turn it off.",
|
|
73999
|
+
annotations: { readOnlyHint: false, destructiveHint: false },
|
|
74000
|
+
inputSchema: {
|
|
74001
|
+
type: "object",
|
|
74002
|
+
properties: {
|
|
74003
|
+
...NODE_ACTION_SCHEMA.properties,
|
|
74004
|
+
minutes: { type: "number", enum: [0, 15, 30, 60, 120], description: "Minutes without visitors before it sleeps. 0 turns it off." }
|
|
74005
|
+
},
|
|
74006
|
+
required: [...NODE_ACTION_SCHEMA.required, "minutes"]
|
|
74007
|
+
}
|
|
74008
|
+
};
|
|
74009
|
+
async function handleAppSetSleepWhenIdle(args) {
|
|
74010
|
+
const token = args["token"];
|
|
74011
|
+
if (!token) {
|
|
74012
|
+
return notAuthenticatedResult();
|
|
74013
|
+
}
|
|
74014
|
+
const minutes = args["minutes"];
|
|
74015
|
+
const res = await fetch(`${config2.services.deployServiceUrl}/deploy/nodes/sleep-when-idle`, {
|
|
74016
|
+
method: "PATCH",
|
|
74017
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
|
|
74018
|
+
body: JSON.stringify({ applicationId: args["applicationId"], environment: args["environment"], minutes: minutes === 0 ? null : minutes })
|
|
74019
|
+
});
|
|
74020
|
+
if (!res.ok) {
|
|
74021
|
+
return failFromResponse(res, "Setting sleep when idle failed");
|
|
74022
|
+
}
|
|
74023
|
+
const text2 = minutes === 0 ? "Sleep when idle is off. The environment keeps running." : `Sleep when idle is on. The environment stops after ${String(minutes)} minutes without visitors and starts again on the next visit.`;
|
|
74024
|
+
return { content: [{ type: "text", text: text2 }] };
|
|
74025
|
+
}
|
|
74026
|
+
var appMoveNetworkTool = {
|
|
74027
|
+
name: "app_move_network",
|
|
74028
|
+
description: "Move an environment's machine into its cloud account's current outgoing network (the fixed address when it is on, an ephemeral one when it is off). Keeps the data volume and redeploys the current release. Takes the environment down for about as long as a first deploy.",
|
|
74029
|
+
annotations: { readOnlyHint: false, destructiveHint: false },
|
|
74030
|
+
inputSchema: NODE_ACTION_SCHEMA
|
|
74031
|
+
};
|
|
74032
|
+
async function handleAppMoveNetwork(args) {
|
|
74033
|
+
const token = args["token"];
|
|
74034
|
+
if (!token) {
|
|
74035
|
+
return notAuthenticatedResult();
|
|
74036
|
+
}
|
|
74037
|
+
const environment = args["environment"];
|
|
74038
|
+
const client2 = new DeployClient(config2.services.deployServiceUrl, token);
|
|
74039
|
+
try {
|
|
74040
|
+
const build = await client2.trigger({ applicationId: args["applicationId"], environment, networkMove: true });
|
|
74041
|
+
return ok({ buildId: build.id, message: `Moving the ${environment} environment. Follow it with org_deploy_status.` });
|
|
74042
|
+
} catch (err) {
|
|
74043
|
+
if (err instanceof UpstreamRequestError) {
|
|
74044
|
+
return fail({ ...err.status !== void 0 ? { status: err.status } : {}, code: err.code, message: err.message });
|
|
74045
|
+
}
|
|
74046
|
+
throw err;
|
|
74047
|
+
}
|
|
74048
|
+
}
|
|
73762
74049
|
var tools14 = [
|
|
73763
74050
|
{ definition: appRestartInstanceTool, handle: handleAppRestartInstance },
|
|
73764
74051
|
{ definition: appStopInstanceTool, handle: handleAppStopInstance },
|
|
73765
74052
|
{ definition: appStartInstanceTool, handle: handleAppStartInstance },
|
|
73766
74053
|
{ definition: appReprovisionInstanceTool, handle: handleAppReprovisionInstance },
|
|
73767
|
-
{ definition: appReplaceInstanceTool, handle: handleAppReplaceInstance }
|
|
74054
|
+
{ definition: appReplaceInstanceTool, handle: handleAppReplaceInstance },
|
|
74055
|
+
{ definition: appSetSleepWhenIdleTool, handle: handleAppSetSleepWhenIdle },
|
|
74056
|
+
{ definition: appMoveNetworkTool, handle: handleAppMoveNetwork }
|
|
73768
74057
|
];
|
|
73769
74058
|
|
|
73770
74059
|
// apps/mcp-server/src/tools/node-tiers.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntica/mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "MCP server and skills for deploying applications on Syntica from your coding agent (Claude Code, OpenCode, Codex CLI, Gemini CLI, Copilot CLI, Cursor)",
|
|
5
5
|
"mcpName": "io.syntica/mcp",
|
|
6
6
|
"bin": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syntica",
|
|
3
3
|
"description": "Deploy, run and debug your applications on Syntica from your coding agent — real infrastructure, a live URL, no DevOps required.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Syntica",
|
|
7
7
|
"email": "support@syntica.io",
|
|
@@ -34,6 +34,14 @@ Note the names carefully. A grant may carry a **prefix**, so a second mailbox
|
|
|
34
34
|
arrives as `SUPPORT_SMTP_HOST` rather than `SMTP_HOST`. Use exactly what the tool
|
|
35
35
|
returns.
|
|
36
36
|
|
|
37
|
+
A connection to an HTTP API, such as OpenAI or Anthropic, may also carry
|
|
38
|
+
`baseUrl`: the variable to call the vendor through, such as `OPENAI_BASE_URL`.
|
|
39
|
+
A grant with `connectorId: "custom"` is an integration the organisation defined
|
|
40
|
+
itself; its `custom` object says which hosts and ports it reaches and how it
|
|
41
|
+
authenticates (see "Custom integrations" below).
|
|
42
|
+
Its names are unprefixed like the others, so apply the grant's prefix to both
|
|
43
|
+
`baseUrl.variable` and `baseUrl.fallbackVariable`.
|
|
44
|
+
|
|
37
45
|
## Step 2 — If nothing is granted, stop and say so
|
|
38
46
|
|
|
39
47
|
An empty list is a real answer, not an error. Tell the user:
|
|
@@ -66,6 +74,17 @@ Read them from the environment. Use the ordinary library for the language and th
|
|
|
66
74
|
vendor — `stripe`, `@slack/web-api`, `nodemailer`, `smtplib` — except where the
|
|
67
75
|
connector's own notes say otherwise.
|
|
68
76
|
|
|
77
|
+
**Call the vendor through `baseUrl.variable`** when the connection has one. In
|
|
78
|
+
gateway mode the platform points it at its connector gateway, which holds the
|
|
79
|
+
real key, and the key variable holds only a placeholder. A call to any other URL
|
|
80
|
+
skips the gateway and fails. The variable may be unset in direct mode, so fall
|
|
81
|
+
back to `baseUrl.fallbackUrl`, or to the variable named in
|
|
82
|
+
`baseUrl.fallbackVariable`, only then:
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const baseUrl = process.env.OPENAI_BASE_URL ?? 'https://api.openai.com/v1';
|
|
86
|
+
```
|
|
87
|
+
|
|
69
88
|
Two that are worth knowing:
|
|
70
89
|
|
|
71
90
|
- **Microsoft 365 mail** is two HTTPS calls and needs no dependency at all: a
|
|
@@ -75,6 +94,22 @@ Two that are worth knowing:
|
|
|
75
94
|
on 465, STARTTLS otherwise. Unlike every other connector, SMTP code does not
|
|
76
95
|
work at all without the grant — the node drops the connection (see Step 2).
|
|
77
96
|
Do not write it until the environment holds an SMTP grant.
|
|
97
|
+
- **AI (OpenAI, Anthropic, Gemini)**: use the official SDK and let it read its
|
|
98
|
+
base URL from the environment: `OPENAI_BASE_URL`, `ANTHROPIC_BASE_URL` or
|
|
99
|
+
`GOOGLE_GEMINI_BASE_URL`. The platform injects it next to the key. **Never
|
|
100
|
+
hardcode a vendor host** (`api.openai.com`, `api.anthropic.com`,
|
|
101
|
+
`generativelanguage.googleapis.com`) or pass a fixed `baseURL` ahead of the
|
|
102
|
+
variable (a fallback for when it is unset is fine): in gateway mode
|
|
103
|
+
the key is a placeholder that only works through the injected base URL, so a
|
|
104
|
+
hardcoded host fails. For Gemini use `@google/genai` (Node) or `google-genai`
|
|
105
|
+
(Python), not the legacy SDK, which ignores the variable. An admin may limit an
|
|
106
|
+
AI connection to certain models and a monthly token budget. A refusal arrives in
|
|
107
|
+
the vendor's own error shape (403 for a model that is not allowed, 429 when the
|
|
108
|
+
budget is spent), so handle it as you would the vendor's. Under a model
|
|
109
|
+
allowlist every call must name its model, and under a budget only chat,
|
|
110
|
+
responses, messages, token counting and OpenAI embedding calls go through, as
|
|
111
|
+
plain JSON: no file uploads, batches, background responses, Gemini embeddings,
|
|
112
|
+
audio or realtime sessions.
|
|
78
113
|
|
|
79
114
|
Send, post or authenticate only as the identity the connection carries
|
|
80
115
|
(`MAIL_FROM`, the granted channel, the granted site). Pin it: read the identity
|
|
@@ -86,6 +121,51 @@ can send as any mailbox in the tenant unless the organisation has added an
|
|
|
86
121
|
the code you are writing needs to act as anything other than the injected
|
|
87
122
|
identity, stop and raise it with the user rather than implementing it.
|
|
88
123
|
|
|
124
|
+
## Custom integrations — a system the catalogue does not have
|
|
125
|
+
|
|
126
|
+
An organisation can define its own connector for any HTTP API or TCP service the
|
|
127
|
+
catalogue lacks — a partner's REST API, a licence server, a database that lives
|
|
128
|
+
elsewhere. An admin creates it once under Connections ("Add a custom
|
|
129
|
+
integration"): the **hosts** the app may reach, optional plain **TCP targets**
|
|
130
|
+
(host and port), an optional **credential** in one of three shapes (`bearer`,
|
|
131
|
+
`basic`, or a named `header`), an optional **base URL**, and a **variable
|
|
132
|
+
prefix**. It is then granted per environment like any other connector.
|
|
133
|
+
|
|
134
|
+
`app_describe_connections` returns such a grant with `connectorId: "custom"`, its
|
|
135
|
+
name, and its definition under `custom` (`hosts`, `tcp`, `credential`, `baseUrl`,
|
|
136
|
+
`varPrefix`). The variables follow the prefix:
|
|
137
|
+
|
|
138
|
+
| Variable | When | Holds |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| `<PREFIX>_URL` | the integration has a base URL and a credential | the URL to call through (gateway mode, see below) |
|
|
141
|
+
| `<PREFIX>_TOKEN` | the integration has a credential | the bearer token, the password, or the header value |
|
|
142
|
+
| `<PREFIX>_USER` | credential shape `basic` only | the user name |
|
|
143
|
+
|
|
144
|
+
Send the credential the way the shape says: `bearer` → `Authorization: Bearer
|
|
145
|
+
<TOKEN>`; `basic` → HTTP basic auth with `<USER>` and `<TOKEN>`; `header` → the
|
|
146
|
+
named header (`custom.credential.header`) set to `<TOKEN>`. With a base URL **and**
|
|
147
|
+
a credential the integration runs in gateway mode exactly like an AI connector:
|
|
148
|
+
`<PREFIX>_TOKEN` is a placeholder and every call must go through `<PREFIX>_URL`,
|
|
149
|
+
where the platform's gateway inserts the real credential — a call straight to the
|
|
150
|
+
vendor host fails. Without a base URL (a TCP target, or an API whose credential
|
|
151
|
+
goes in the request body) the app gets the real credential and calls the host
|
|
152
|
+
directly.
|
|
153
|
+
|
|
154
|
+
`hosts` and `tcp` are not just information: under egress control the node only
|
|
155
|
+
lets the app reach the hosts a granted connection declares, and a TCP target only
|
|
156
|
+
on its port. If the system you are about to call is not in any grant's `hosts`,
|
|
157
|
+
the call is blocked, not merely unconfigured — the same symptom as SMTP without
|
|
158
|
+
its grant.
|
|
159
|
+
|
|
160
|
+
When no connector fits and no custom integration is granted, request one with
|
|
161
|
+
`app_request_connection` and `connectorId: "custom"`. The request carries only
|
|
162
|
+
your purpose line, and the admin defines the integration when approving, so put
|
|
163
|
+
what they need to know in that line: the host(s) and port(s), the credential
|
|
164
|
+
shape, and whether a base URL is wanted. For example: "Call the itsme partner API
|
|
165
|
+
at api.partner.example (HTTPS, bearer token, base URL https://api.partner.example/v2)
|
|
166
|
+
to fetch order status". Then write the code against `<PREFIX>_URL` /
|
|
167
|
+
`<PREFIX>_TOKEN` with the prefix the admin confirms.
|
|
168
|
+
|
|
89
169
|
## Step 4 — Fail loudly when the variables are absent
|
|
90
170
|
|
|
91
171
|
Check for them at startup and fail with a clear message:
|
|
@@ -93,6 +173,9 @@ Check for them at startup and fail with a clear message:
|
|
|
93
173
|
> No `<system>` connection is injected here. Grant one for this environment, or
|
|
94
174
|
> run against the dev environment.
|
|
95
175
|
|
|
176
|
+
The `baseUrl` variable is the exception. It may be unset, so use its fallback
|
|
177
|
+
instead of failing.
|
|
178
|
+
|
|
96
179
|
This matters more than it looks. The variables are absent when running locally —
|
|
97
180
|
they exist only on the platform's instances, never on a laptop — and an
|
|
98
181
|
unexplained local failure is exactly what tempts someone into pasting a
|