patchwork-os 1.2.0-beta.3.canary.915 → 1.2.0-beta.3.canary.918
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/connectorRoutes.js +144 -143
- package/dist/connectorRoutes.js.map +1 -1
- package/dist/connectors/asana.js +24 -1
- package/dist/connectors/asana.js.map +1 -1
- package/dist/connectors/connectionChecks.d.ts +139 -0
- package/dist/connectors/connectionChecks.js +313 -0
- package/dist/connectors/connectionChecks.js.map +1 -0
- package/dist/connectors/discord.js +10 -9
- package/dist/connectors/discord.js.map +1 -1
- package/dist/connectors/github.js +3 -2
- package/dist/connectors/github.js.map +1 -1
- package/dist/connectors/gitlab.js +10 -9
- package/dist/connectors/gitlab.js.map +1 -1
- package/dist/connectors/gmail.d.ts +10 -0
- package/dist/connectors/gmail.js +62 -13
- package/dist/connectors/gmail.js.map +1 -1
- package/dist/connectors/googleCalendar.js +4 -4
- package/dist/connectors/googleCalendar.js.map +1 -1
- package/dist/connectors/googleDocs.js +6 -4
- package/dist/connectors/googleDocs.js.map +1 -1
- package/dist/connectors/googleDrive.js +4 -4
- package/dist/connectors/googleDrive.js.map +1 -1
- package/dist/connectors/linear.js +3 -2
- package/dist/connectors/linear.js.map +1 -1
- package/dist/connectors/mcpOAuth.d.ts +19 -1
- package/dist/connectors/mcpOAuth.js +35 -6
- package/dist/connectors/mcpOAuth.js.map +1 -1
- package/dist/connectors/monday.js +5 -4
- package/dist/connectors/monday.js.map +1 -1
- package/dist/connectors/salesforce.d.ts +1 -1
- package/dist/connectors/salesforce.js +14 -9
- package/dist/connectors/salesforce.js.map +1 -1
- package/dist/connectors/secrets.d.ts +14 -7
- package/dist/connectors/secrets.js +63 -30
- package/dist/connectors/secrets.js.map +1 -1
- package/dist/connectors/sentry.js +3 -2
- package/dist/connectors/sentry.js.map +1 -1
- package/dist/connectors/slack.js +19 -12
- package/dist/connectors/slack.js.map +1 -1
- package/package.json +1 -1
package/dist/connectorRoutes.js
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* - Pre-extraction grep confirmed zero `this.` references in either
|
|
25
25
|
* block, so no dependency injection was needed.
|
|
26
26
|
*/
|
|
27
|
+
import { afterCredentialChange, disconnectResponse, recordTestOutcome, } from "./connectors/connectionChecks.js";
|
|
27
28
|
import { oauthConnectorIds } from "./connectors/connectorRegistry.js";
|
|
28
29
|
import { respond500 } from "./httpErrorResponse.js";
|
|
29
30
|
import { readBodyWithCap, respond413 } from "./recipeRoutes.js";
|
|
@@ -64,7 +65,7 @@ function invalidateConnectionsCache() {
|
|
|
64
65
|
* so each call site preserves the lazy `await import()` of the connector
|
|
65
66
|
* module (only loaded on first call, not at bridge startup).
|
|
66
67
|
*/
|
|
67
|
-
async function dispatchConnectorConnect(req, res, loadHandler) {
|
|
68
|
+
async function dispatchConnectorConnect(req, res, pathname, loadHandler) {
|
|
68
69
|
const read = await readBodyWithCap(req, CONNECTOR_BODY_CAP);
|
|
69
70
|
if (!read.ok) {
|
|
70
71
|
respond413(res, CONNECTOR_BODY_CAP);
|
|
@@ -72,7 +73,7 @@ async function dispatchConnectorConnect(req, res, loadHandler) {
|
|
|
72
73
|
}
|
|
73
74
|
try {
|
|
74
75
|
const handler = await loadHandler();
|
|
75
|
-
const result = await handler(read.body);
|
|
76
|
+
const result = afterCredentialChange(pathname, await handler(read.body));
|
|
76
77
|
res.writeHead(result.status, {
|
|
77
78
|
"Content-Type": result.contentType ?? "application/json",
|
|
78
79
|
});
|
|
@@ -102,7 +103,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
102
103
|
const code = parsedUrl.searchParams.get("code");
|
|
103
104
|
const state = parsedUrl.searchParams.get("state");
|
|
104
105
|
const error = parsedUrl.searchParams.get("error");
|
|
105
|
-
const result = await handleGithubCallback(code, state, error);
|
|
106
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleGithubCallback(code, state, error));
|
|
106
107
|
res.writeHead(result.status, {
|
|
107
108
|
"Content-Type": result.contentType ?? "application/json",
|
|
108
109
|
});
|
|
@@ -122,7 +123,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
122
123
|
const code = parsedUrl.searchParams.get("code");
|
|
123
124
|
const state = parsedUrl.searchParams.get("state");
|
|
124
125
|
const error = parsedUrl.searchParams.get("error");
|
|
125
|
-
const result = await handleLinearCallback(code, state, error);
|
|
126
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleLinearCallback(code, state, error));
|
|
126
127
|
res.writeHead(result.status, {
|
|
127
128
|
"Content-Type": result.contentType ?? "application/json",
|
|
128
129
|
});
|
|
@@ -142,7 +143,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
142
143
|
const code = parsedUrl.searchParams.get("code");
|
|
143
144
|
const state = parsedUrl.searchParams.get("state");
|
|
144
145
|
const error = parsedUrl.searchParams.get("error");
|
|
145
|
-
const result = await handleSentryCallback(code, state, error);
|
|
146
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleSentryCallback(code, state, error));
|
|
146
147
|
res.writeHead(result.status, {
|
|
147
148
|
"Content-Type": result.contentType ?? "application/json",
|
|
148
149
|
});
|
|
@@ -162,7 +163,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
162
163
|
const code = parsedUrl.searchParams.get("code");
|
|
163
164
|
const state = parsedUrl.searchParams.get("state");
|
|
164
165
|
const error = parsedUrl.searchParams.get("error");
|
|
165
|
-
const result = await handleCalendarCallback(code, state, error);
|
|
166
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleCalendarCallback(code, state, error));
|
|
166
167
|
res.writeHead(result.status, {
|
|
167
168
|
"Content-Type": result.contentType ?? "application/json",
|
|
168
169
|
});
|
|
@@ -182,7 +183,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
182
183
|
const code = parsedUrl.searchParams.get("code");
|
|
183
184
|
const state = parsedUrl.searchParams.get("state");
|
|
184
185
|
const error = parsedUrl.searchParams.get("error");
|
|
185
|
-
const result = await handleDriveCallback(code, state, error);
|
|
186
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleDriveCallback(code, state, error));
|
|
186
187
|
res.writeHead(result.status, {
|
|
187
188
|
"Content-Type": result.contentType ?? "application/json",
|
|
188
189
|
});
|
|
@@ -202,7 +203,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
202
203
|
const code = parsedUrl.searchParams.get("code");
|
|
203
204
|
const state = parsedUrl.searchParams.get("state");
|
|
204
205
|
const error = parsedUrl.searchParams.get("error");
|
|
205
|
-
const result = await handleDocsCallback(code, state, error);
|
|
206
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleDocsCallback(code, state, error));
|
|
206
207
|
res.writeHead(result.status, {
|
|
207
208
|
"Content-Type": result.contentType ?? "application/json",
|
|
208
209
|
});
|
|
@@ -222,7 +223,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
222
223
|
const code = parsedUrl.searchParams.get("code");
|
|
223
224
|
const state = parsedUrl.searchParams.get("state");
|
|
224
225
|
const error = parsedUrl.searchParams.get("error");
|
|
225
|
-
const result = await handleMondayCallback(code, state, error);
|
|
226
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleMondayCallback(code, state, error));
|
|
226
227
|
res.writeHead(result.status, {
|
|
227
228
|
"Content-Type": result.contentType ?? "application/json",
|
|
228
229
|
});
|
|
@@ -242,7 +243,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
242
243
|
const code = parsedUrl.searchParams.get("code");
|
|
243
244
|
const state = parsedUrl.searchParams.get("state");
|
|
244
245
|
const error = parsedUrl.searchParams.get("error");
|
|
245
|
-
const result = await handleSalesforceCallback(code, state, error);
|
|
246
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleSalesforceCallback(code, state, error));
|
|
246
247
|
res.writeHead(result.status, {
|
|
247
248
|
"Content-Type": result.contentType ?? "application/json",
|
|
248
249
|
});
|
|
@@ -262,7 +263,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
262
263
|
const code = parsedUrl.searchParams.get("code");
|
|
263
264
|
const state = parsedUrl.searchParams.get("state");
|
|
264
265
|
const error = parsedUrl.searchParams.get("error");
|
|
265
|
-
const result = await handleSlackCallback(code, state, error);
|
|
266
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleSlackCallback(code, state, error));
|
|
266
267
|
res.writeHead(result.status, {
|
|
267
268
|
"Content-Type": result.contentType ?? "application/json",
|
|
268
269
|
});
|
|
@@ -282,7 +283,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
282
283
|
const code = parsedUrl.searchParams.get("code");
|
|
283
284
|
const state = parsedUrl.searchParams.get("state");
|
|
284
285
|
const error = parsedUrl.searchParams.get("error");
|
|
285
|
-
const result = await handleGmailCallback(code, state, error);
|
|
286
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleGmailCallback(code, state, error));
|
|
286
287
|
res.writeHead(result.status, {
|
|
287
288
|
"Content-Type": result.contentType ?? "text/html",
|
|
288
289
|
});
|
|
@@ -306,7 +307,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
306
307
|
const code = parsedUrl.searchParams.get("code");
|
|
307
308
|
const state = parsedUrl.searchParams.get("state");
|
|
308
309
|
const error = parsedUrl.searchParams.get("error");
|
|
309
|
-
const result = await handleDiscordCallback(code, state, error);
|
|
310
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleDiscordCallback(code, state, error));
|
|
310
311
|
res.writeHead(result.status, {
|
|
311
312
|
"Content-Type": result.contentType ?? "text/html",
|
|
312
313
|
});
|
|
@@ -326,7 +327,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
326
327
|
const code = parsedUrl.searchParams.get("code");
|
|
327
328
|
const state = parsedUrl.searchParams.get("state");
|
|
328
329
|
const error = parsedUrl.searchParams.get("error");
|
|
329
|
-
const result = await handleAsanaCallback(code, state, error);
|
|
330
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleAsanaCallback(code, state, error));
|
|
330
331
|
res.writeHead(result.status, {
|
|
331
332
|
"Content-Type": result.contentType ?? "text/html",
|
|
332
333
|
});
|
|
@@ -346,7 +347,7 @@ export function tryHandlePublicConnectorRoute(req, res, parsedUrl) {
|
|
|
346
347
|
const code = parsedUrl.searchParams.get("code");
|
|
347
348
|
const state = parsedUrl.searchParams.get("state");
|
|
348
349
|
const error = parsedUrl.searchParams.get("error");
|
|
349
|
-
const result = await handleGitLabCallback(code, state, error);
|
|
350
|
+
const result = afterCredentialChange(parsedUrl.pathname, await handleGitLabCallback(code, state, error));
|
|
350
351
|
res.writeHead(result.status, {
|
|
351
352
|
"Content-Type": result.contentType ?? "text/html",
|
|
352
353
|
});
|
|
@@ -474,7 +475,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
474
475
|
void (async () => {
|
|
475
476
|
try {
|
|
476
477
|
const { handleGmailDisconnect } = await import("./connectors/gmail.js");
|
|
477
|
-
const result = await handleGmailDisconnect();
|
|
478
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleGmailDisconnect());
|
|
478
479
|
res.writeHead(result.status, {
|
|
479
480
|
"Content-Type": result.contentType ?? "application/json",
|
|
480
481
|
});
|
|
@@ -491,7 +492,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
491
492
|
void (async () => {
|
|
492
493
|
try {
|
|
493
494
|
const { handleGmailTest } = await import("./connectors/gmail.js");
|
|
494
|
-
const result = await handleGmailTest();
|
|
495
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleGmailTest());
|
|
495
496
|
res.writeHead(result.status, {
|
|
496
497
|
"Content-Type": result.contentType ?? "application/json",
|
|
497
498
|
});
|
|
@@ -532,7 +533,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
532
533
|
void (async () => {
|
|
533
534
|
try {
|
|
534
535
|
const { handleGithubTest } = await import("./connectors/github.js");
|
|
535
|
-
const result = await handleGithubTest();
|
|
536
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleGithubTest());
|
|
536
537
|
res.writeHead(result.status, {
|
|
537
538
|
"Content-Type": result.contentType ?? "application/json",
|
|
538
539
|
});
|
|
@@ -548,7 +549,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
548
549
|
void (async () => {
|
|
549
550
|
try {
|
|
550
551
|
const { handleGithubDisconnect } = await import("./connectors/github.js");
|
|
551
|
-
const result = await handleGithubDisconnect();
|
|
552
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleGithubDisconnect());
|
|
552
553
|
res.writeHead(result.status, {
|
|
553
554
|
"Content-Type": result.contentType ?? "application/json",
|
|
554
555
|
});
|
|
@@ -592,7 +593,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
592
593
|
void (async () => {
|
|
593
594
|
try {
|
|
594
595
|
const { handleSentryTest } = await import("./connectors/sentry.js");
|
|
595
|
-
const result = await handleSentryTest();
|
|
596
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleSentryTest());
|
|
596
597
|
res.writeHead(result.status, {
|
|
597
598
|
"Content-Type": result.contentType ?? "application/json",
|
|
598
599
|
});
|
|
@@ -608,7 +609,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
608
609
|
void (async () => {
|
|
609
610
|
try {
|
|
610
611
|
const { handleSentryDisconnect } = await import("./connectors/sentry.js");
|
|
611
|
-
const result = await handleSentryDisconnect();
|
|
612
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleSentryDisconnect());
|
|
612
613
|
res.writeHead(result.status, {
|
|
613
614
|
"Content-Type": result.contentType ?? "application/json",
|
|
614
615
|
});
|
|
@@ -652,7 +653,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
652
653
|
void (async () => {
|
|
653
654
|
try {
|
|
654
655
|
const { handleLinearTest } = await import("./connectors/linear.js");
|
|
655
|
-
const result = await handleLinearTest();
|
|
656
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleLinearTest());
|
|
656
657
|
res.writeHead(result.status, {
|
|
657
658
|
"Content-Type": result.contentType ?? "application/json",
|
|
658
659
|
});
|
|
@@ -668,7 +669,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
668
669
|
void (async () => {
|
|
669
670
|
try {
|
|
670
671
|
const { handleLinearDisconnect } = await import("./connectors/linear.js");
|
|
671
|
-
const result = await handleLinearDisconnect();
|
|
672
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleLinearDisconnect());
|
|
672
673
|
res.writeHead(result.status, {
|
|
673
674
|
"Content-Type": result.contentType ?? "application/json",
|
|
674
675
|
});
|
|
@@ -710,7 +711,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
710
711
|
void (async () => {
|
|
711
712
|
try {
|
|
712
713
|
const { handleSlackTest } = await import("./connectors/slack.js");
|
|
713
|
-
const result = await handleSlackTest();
|
|
714
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleSlackTest());
|
|
714
715
|
res.writeHead(result.status, {
|
|
715
716
|
"Content-Type": result.contentType ?? "application/json",
|
|
716
717
|
});
|
|
@@ -726,7 +727,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
726
727
|
void (async () => {
|
|
727
728
|
try {
|
|
728
729
|
const { handleSlackDisconnect } = await import("./connectors/slack.js");
|
|
729
|
-
const result = await handleSlackDisconnect();
|
|
730
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleSlackDisconnect());
|
|
730
731
|
res.writeHead(result.status, {
|
|
731
732
|
"Content-Type": result.contentType ?? "application/json",
|
|
732
733
|
});
|
|
@@ -771,7 +772,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
771
772
|
void (async () => {
|
|
772
773
|
try {
|
|
773
774
|
const { handleDiscordTest } = await import("./connectors/discord.js");
|
|
774
|
-
const result = await handleDiscordTest();
|
|
775
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleDiscordTest());
|
|
775
776
|
res.writeHead(result.status, {
|
|
776
777
|
"Content-Type": result.contentType ?? "application/json",
|
|
777
778
|
});
|
|
@@ -788,7 +789,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
788
789
|
void (async () => {
|
|
789
790
|
try {
|
|
790
791
|
const { handleDiscordDisconnect } = await import("./connectors/discord.js");
|
|
791
|
-
const result = await handleDiscordDisconnect();
|
|
792
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleDiscordDisconnect());
|
|
792
793
|
res.writeHead(result.status, {
|
|
793
794
|
"Content-Type": result.contentType ?? "application/json",
|
|
794
795
|
});
|
|
@@ -833,7 +834,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
833
834
|
void (async () => {
|
|
834
835
|
try {
|
|
835
836
|
const { handleAsanaTest } = await import("./connectors/asana.js");
|
|
836
|
-
const result = await handleAsanaTest();
|
|
837
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleAsanaTest());
|
|
837
838
|
res.writeHead(result.status, {
|
|
838
839
|
"Content-Type": result.contentType ?? "application/json",
|
|
839
840
|
});
|
|
@@ -849,7 +850,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
849
850
|
void (async () => {
|
|
850
851
|
try {
|
|
851
852
|
const { handleAsanaDisconnect } = await import("./connectors/asana.js");
|
|
852
|
-
const result = await handleAsanaDisconnect();
|
|
853
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleAsanaDisconnect());
|
|
853
854
|
res.writeHead(result.status, {
|
|
854
855
|
"Content-Type": result.contentType ?? "application/json",
|
|
855
856
|
});
|
|
@@ -894,7 +895,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
894
895
|
void (async () => {
|
|
895
896
|
try {
|
|
896
897
|
const { handleGitLabTest } = await import("./connectors/gitlab.js");
|
|
897
|
-
const result = await handleGitLabTest();
|
|
898
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleGitLabTest());
|
|
898
899
|
res.writeHead(result.status, {
|
|
899
900
|
"Content-Type": result.contentType ?? "application/json",
|
|
900
901
|
});
|
|
@@ -910,7 +911,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
910
911
|
void (async () => {
|
|
911
912
|
try {
|
|
912
913
|
const { handleGitLabDisconnect } = await import("./connectors/gitlab.js");
|
|
913
|
-
const result = await handleGitLabDisconnect();
|
|
914
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleGitLabDisconnect());
|
|
914
915
|
res.writeHead(result.status, {
|
|
915
916
|
"Content-Type": result.contentType ?? "application/json",
|
|
916
917
|
});
|
|
@@ -925,7 +926,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
925
926
|
// ── Notion routes ──────────────────────────────────────────────
|
|
926
927
|
if (parsedUrl.pathname === "/connections/notion/connect" &&
|
|
927
928
|
req.method === "POST") {
|
|
928
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
929
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
929
930
|
const m = await import("./connectors/notion.js");
|
|
930
931
|
return m.handleNotionConnect;
|
|
931
932
|
});
|
|
@@ -936,7 +937,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
936
937
|
void (async () => {
|
|
937
938
|
try {
|
|
938
939
|
const { handleNotionTest } = await import("./connectors/notion.js");
|
|
939
|
-
const result = await handleNotionTest();
|
|
940
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleNotionTest());
|
|
940
941
|
res.writeHead(result.status, {
|
|
941
942
|
"Content-Type": result.contentType ?? "application/json",
|
|
942
943
|
});
|
|
@@ -952,7 +953,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
952
953
|
void (async () => {
|
|
953
954
|
try {
|
|
954
955
|
const { handleNotionDisconnect } = await import("./connectors/notion.js");
|
|
955
|
-
const result = handleNotionDisconnect();
|
|
956
|
+
const result = disconnectResponse(parsedUrl.pathname, handleNotionDisconnect());
|
|
956
957
|
res.writeHead(result.status, {
|
|
957
958
|
"Content-Type": result.contentType ?? "application/json",
|
|
958
959
|
});
|
|
@@ -967,7 +968,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
967
968
|
// ── Confluence routes ───────────────────────────────────────────
|
|
968
969
|
if (parsedUrl.pathname === "/connections/confluence/connect" &&
|
|
969
970
|
req.method === "POST") {
|
|
970
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
971
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
971
972
|
const m = await import("./connectors/confluence.js");
|
|
972
973
|
return m.handleConfluenceConnect;
|
|
973
974
|
});
|
|
@@ -978,7 +979,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
978
979
|
void (async () => {
|
|
979
980
|
try {
|
|
980
981
|
const { handleConfluenceTest } = await import("./connectors/confluence.js");
|
|
981
|
-
const result = await handleConfluenceTest();
|
|
982
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleConfluenceTest());
|
|
982
983
|
res.writeHead(result.status, {
|
|
983
984
|
"Content-Type": result.contentType ?? "application/json",
|
|
984
985
|
});
|
|
@@ -995,7 +996,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
995
996
|
void (async () => {
|
|
996
997
|
try {
|
|
997
998
|
const { handleConfluenceDisconnect } = await import("./connectors/confluence.js");
|
|
998
|
-
const result = handleConfluenceDisconnect();
|
|
999
|
+
const result = disconnectResponse(parsedUrl.pathname, handleConfluenceDisconnect());
|
|
999
1000
|
res.writeHead(result.status, {
|
|
1000
1001
|
"Content-Type": result.contentType ?? "application/json",
|
|
1001
1002
|
});
|
|
@@ -1010,7 +1011,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1010
1011
|
// ── Jira routes ─────────────────────────────────────────────────
|
|
1011
1012
|
if (parsedUrl.pathname === "/connections/jira/connect" &&
|
|
1012
1013
|
req.method === "POST") {
|
|
1013
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1014
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1014
1015
|
const m = await import("./connectors/jira.js");
|
|
1015
1016
|
return m.handleJiraConnect;
|
|
1016
1017
|
});
|
|
@@ -1021,7 +1022,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1021
1022
|
void (async () => {
|
|
1022
1023
|
try {
|
|
1023
1024
|
const { handleJiraTest } = await import("./connectors/jira.js");
|
|
1024
|
-
const result = await handleJiraTest();
|
|
1025
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleJiraTest());
|
|
1025
1026
|
res.writeHead(result.status, {
|
|
1026
1027
|
"Content-Type": result.contentType ?? "application/json",
|
|
1027
1028
|
});
|
|
@@ -1037,7 +1038,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1037
1038
|
void (async () => {
|
|
1038
1039
|
try {
|
|
1039
1040
|
const { handleJiraDisconnect } = await import("./connectors/jira.js");
|
|
1040
|
-
const result = handleJiraDisconnect();
|
|
1041
|
+
const result = disconnectResponse(parsedUrl.pathname, handleJiraDisconnect());
|
|
1041
1042
|
res.writeHead(result.status, {
|
|
1042
1043
|
"Content-Type": result.contentType ?? "application/json",
|
|
1043
1044
|
});
|
|
@@ -1052,7 +1053,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1052
1053
|
// ── Zendesk routes ──────────────────────────────────────────────
|
|
1053
1054
|
if (parsedUrl.pathname === "/connections/zendesk/connect" &&
|
|
1054
1055
|
req.method === "POST") {
|
|
1055
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1056
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1056
1057
|
const m = await import("./connectors/zendesk.js");
|
|
1057
1058
|
return m.handleZendeskConnect;
|
|
1058
1059
|
});
|
|
@@ -1063,7 +1064,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1063
1064
|
void (async () => {
|
|
1064
1065
|
try {
|
|
1065
1066
|
const { handleZendeskTest } = await import("./connectors/zendesk.js");
|
|
1066
|
-
const result = await handleZendeskTest();
|
|
1067
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleZendeskTest());
|
|
1067
1068
|
res.writeHead(result.status, {
|
|
1068
1069
|
"Content-Type": result.contentType ?? "application/json",
|
|
1069
1070
|
});
|
|
@@ -1080,7 +1081,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1080
1081
|
void (async () => {
|
|
1081
1082
|
try {
|
|
1082
1083
|
const { handleZendeskDisconnect } = await import("./connectors/zendesk.js");
|
|
1083
|
-
const result = handleZendeskDisconnect();
|
|
1084
|
+
const result = disconnectResponse(parsedUrl.pathname, handleZendeskDisconnect());
|
|
1084
1085
|
res.writeHead(result.status, {
|
|
1085
1086
|
"Content-Type": result.contentType ?? "application/json",
|
|
1086
1087
|
});
|
|
@@ -1095,7 +1096,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1095
1096
|
// ── Intercom routes ─────────────────────────────────────────────
|
|
1096
1097
|
if (parsedUrl.pathname === "/connections/intercom/connect" &&
|
|
1097
1098
|
req.method === "POST") {
|
|
1098
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1099
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1099
1100
|
const m = await import("./connectors/intercom.js");
|
|
1100
1101
|
return m.handleIntercomConnect;
|
|
1101
1102
|
});
|
|
@@ -1106,7 +1107,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1106
1107
|
void (async () => {
|
|
1107
1108
|
try {
|
|
1108
1109
|
const { handleIntercomTest } = await import("./connectors/intercom.js");
|
|
1109
|
-
const result = await handleIntercomTest();
|
|
1110
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleIntercomTest());
|
|
1110
1111
|
res.writeHead(result.status, {
|
|
1111
1112
|
"Content-Type": result.contentType ?? "application/json",
|
|
1112
1113
|
});
|
|
@@ -1123,7 +1124,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1123
1124
|
void (async () => {
|
|
1124
1125
|
try {
|
|
1125
1126
|
const { handleIntercomDisconnect } = await import("./connectors/intercom.js");
|
|
1126
|
-
const result = handleIntercomDisconnect();
|
|
1127
|
+
const result = disconnectResponse(parsedUrl.pathname, handleIntercomDisconnect());
|
|
1127
1128
|
res.writeHead(result.status, {
|
|
1128
1129
|
"Content-Type": result.contentType ?? "application/json",
|
|
1129
1130
|
});
|
|
@@ -1138,7 +1139,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1138
1139
|
// ── HubSpot routes ─────────────────────────────────────────────
|
|
1139
1140
|
if (parsedUrl.pathname === "/connections/hubspot/connect" &&
|
|
1140
1141
|
req.method === "POST") {
|
|
1141
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1142
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1142
1143
|
const m = await import("./connectors/hubspot.js");
|
|
1143
1144
|
return m.handleHubSpotConnect;
|
|
1144
1145
|
});
|
|
@@ -1149,7 +1150,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1149
1150
|
void (async () => {
|
|
1150
1151
|
try {
|
|
1151
1152
|
const { handleHubSpotTest } = await import("./connectors/hubspot.js");
|
|
1152
|
-
const result = await handleHubSpotTest();
|
|
1153
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleHubSpotTest());
|
|
1153
1154
|
res.writeHead(result.status, {
|
|
1154
1155
|
"Content-Type": result.contentType ?? "application/json",
|
|
1155
1156
|
});
|
|
@@ -1166,7 +1167,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1166
1167
|
void (async () => {
|
|
1167
1168
|
try {
|
|
1168
1169
|
const { handleHubSpotDisconnect } = await import("./connectors/hubspot.js");
|
|
1169
|
-
const result = handleHubSpotDisconnect();
|
|
1170
|
+
const result = disconnectResponse(parsedUrl.pathname, handleHubSpotDisconnect());
|
|
1170
1171
|
res.writeHead(result.status, {
|
|
1171
1172
|
"Content-Type": result.contentType ?? "application/json",
|
|
1172
1173
|
});
|
|
@@ -1181,7 +1182,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1181
1182
|
// ── Datadog routes ─────────────────────────────────────────────
|
|
1182
1183
|
if (parsedUrl.pathname === "/connections/datadog/connect" &&
|
|
1183
1184
|
req.method === "POST") {
|
|
1184
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1185
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1185
1186
|
const m = await import("./connectors/datadog.js");
|
|
1186
1187
|
return m.handleDatadogConnect;
|
|
1187
1188
|
});
|
|
@@ -1192,7 +1193,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1192
1193
|
void (async () => {
|
|
1193
1194
|
try {
|
|
1194
1195
|
const { handleDatadogTest } = await import("./connectors/datadog.js");
|
|
1195
|
-
const result = await handleDatadogTest();
|
|
1196
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleDatadogTest());
|
|
1196
1197
|
res.writeHead(result.status, {
|
|
1197
1198
|
"Content-Type": result.contentType ?? "application/json",
|
|
1198
1199
|
});
|
|
@@ -1209,7 +1210,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1209
1210
|
void (async () => {
|
|
1210
1211
|
try {
|
|
1211
1212
|
const { handleDatadogDisconnect } = await import("./connectors/datadog.js");
|
|
1212
|
-
const result = handleDatadogDisconnect();
|
|
1213
|
+
const result = disconnectResponse(parsedUrl.pathname, handleDatadogDisconnect());
|
|
1213
1214
|
res.writeHead(result.status, {
|
|
1214
1215
|
"Content-Type": result.contentType ?? "application/json",
|
|
1215
1216
|
});
|
|
@@ -1224,7 +1225,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1224
1225
|
// ── PagerDuty routes ───────────────────────────────────────────
|
|
1225
1226
|
if (parsedUrl.pathname === "/connections/pagerduty/connect" &&
|
|
1226
1227
|
req.method === "POST") {
|
|
1227
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1228
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1228
1229
|
const m = await import("./connectors/pagerduty.js");
|
|
1229
1230
|
return m.handlePagerDutyConnect;
|
|
1230
1231
|
});
|
|
@@ -1235,7 +1236,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1235
1236
|
void (async () => {
|
|
1236
1237
|
try {
|
|
1237
1238
|
const { handlePagerDutyTest } = await import("./connectors/pagerduty.js");
|
|
1238
|
-
const result = await handlePagerDutyTest();
|
|
1239
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handlePagerDutyTest());
|
|
1239
1240
|
res.writeHead(result.status, {
|
|
1240
1241
|
"Content-Type": result.contentType ?? "application/json",
|
|
1241
1242
|
});
|
|
@@ -1252,7 +1253,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1252
1253
|
void (async () => {
|
|
1253
1254
|
try {
|
|
1254
1255
|
const { handlePagerDutyDisconnect } = await import("./connectors/pagerduty.js");
|
|
1255
|
-
const result = handlePagerDutyDisconnect();
|
|
1256
|
+
const result = disconnectResponse(parsedUrl.pathname, handlePagerDutyDisconnect());
|
|
1256
1257
|
res.writeHead(result.status, {
|
|
1257
1258
|
"Content-Type": result.contentType ?? "application/json",
|
|
1258
1259
|
});
|
|
@@ -1267,7 +1268,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1267
1268
|
// ── Telegram routes ────────────────────────────────────────────
|
|
1268
1269
|
if (parsedUrl.pathname === "/connections/telegram/connect" &&
|
|
1269
1270
|
req.method === "POST") {
|
|
1270
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1271
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1271
1272
|
const m = await import("./connectors/telegram.js");
|
|
1272
1273
|
return m.handleTelegramConnect;
|
|
1273
1274
|
});
|
|
@@ -1278,7 +1279,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1278
1279
|
void (async () => {
|
|
1279
1280
|
try {
|
|
1280
1281
|
const { handleTelegramTest } = await import("./connectors/telegram.js");
|
|
1281
|
-
const result = await handleTelegramTest();
|
|
1282
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleTelegramTest());
|
|
1282
1283
|
res.writeHead(result.status, {
|
|
1283
1284
|
"Content-Type": result.contentType ?? "application/json",
|
|
1284
1285
|
});
|
|
@@ -1295,7 +1296,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1295
1296
|
void (async () => {
|
|
1296
1297
|
try {
|
|
1297
1298
|
const { handleTelegramDisconnect } = await import("./connectors/telegram.js");
|
|
1298
|
-
const result = handleTelegramDisconnect();
|
|
1299
|
+
const result = disconnectResponse(parsedUrl.pathname, handleTelegramDisconnect());
|
|
1299
1300
|
res.writeHead(result.status, {
|
|
1300
1301
|
"Content-Type": result.contentType ?? "application/json",
|
|
1301
1302
|
});
|
|
@@ -1310,7 +1311,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1310
1311
|
// ── Stripe routes ───────────────────────────────────────────────
|
|
1311
1312
|
if (parsedUrl.pathname === "/connections/stripe/connect" &&
|
|
1312
1313
|
req.method === "POST") {
|
|
1313
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1314
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1314
1315
|
const m = await import("./connectors/stripe.js");
|
|
1315
1316
|
return m.handleStripeConnect;
|
|
1316
1317
|
});
|
|
@@ -1321,7 +1322,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1321
1322
|
void (async () => {
|
|
1322
1323
|
try {
|
|
1323
1324
|
const { handleStripeTest } = await import("./connectors/stripe.js");
|
|
1324
|
-
const result = await handleStripeTest();
|
|
1325
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleStripeTest());
|
|
1325
1326
|
res.writeHead(result.status, {
|
|
1326
1327
|
"Content-Type": result.contentType ?? "application/json",
|
|
1327
1328
|
});
|
|
@@ -1337,7 +1338,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1337
1338
|
void (async () => {
|
|
1338
1339
|
try {
|
|
1339
1340
|
const { handleStripeDisconnect } = await import("./connectors/stripe.js");
|
|
1340
|
-
const result = handleStripeDisconnect();
|
|
1341
|
+
const result = disconnectResponse(parsedUrl.pathname, handleStripeDisconnect());
|
|
1341
1342
|
res.writeHead(result.status, {
|
|
1342
1343
|
"Content-Type": result.contentType ?? "application/json",
|
|
1343
1344
|
});
|
|
@@ -1352,7 +1353,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1352
1353
|
// ── Postgres routes ─────────────────────────────────────────────
|
|
1353
1354
|
if (parsedUrl.pathname === "/connections/postgres/connect" &&
|
|
1354
1355
|
req.method === "POST") {
|
|
1355
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1356
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1356
1357
|
const m = await import("./connectors/postgres.js");
|
|
1357
1358
|
return m.handlePostgresConnect;
|
|
1358
1359
|
});
|
|
@@ -1363,7 +1364,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1363
1364
|
void (async () => {
|
|
1364
1365
|
try {
|
|
1365
1366
|
const { handlePostgresTest } = await import("./connectors/postgres.js");
|
|
1366
|
-
const result = await handlePostgresTest();
|
|
1367
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handlePostgresTest());
|
|
1367
1368
|
res.writeHead(result.status, {
|
|
1368
1369
|
"Content-Type": result.contentType ?? "application/json",
|
|
1369
1370
|
});
|
|
@@ -1380,7 +1381,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1380
1381
|
void (async () => {
|
|
1381
1382
|
try {
|
|
1382
1383
|
const { handlePostgresDisconnect } = await import("./connectors/postgres.js");
|
|
1383
|
-
const result = await handlePostgresDisconnect();
|
|
1384
|
+
const result = disconnectResponse(parsedUrl.pathname, await handlePostgresDisconnect());
|
|
1384
1385
|
res.writeHead(result.status, {
|
|
1385
1386
|
"Content-Type": result.contentType ?? "application/json",
|
|
1386
1387
|
});
|
|
@@ -1395,7 +1396,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1395
1396
|
// ── MongoDB routes ──────────────────────────────────────────────
|
|
1396
1397
|
if (parsedUrl.pathname === "/connections/mongodb/connect" &&
|
|
1397
1398
|
req.method === "POST") {
|
|
1398
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1399
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1399
1400
|
const m = await import("./connectors/mongodb.js");
|
|
1400
1401
|
return m.handleMongoConnect;
|
|
1401
1402
|
});
|
|
@@ -1406,7 +1407,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1406
1407
|
void (async () => {
|
|
1407
1408
|
try {
|
|
1408
1409
|
const { handleMongoTest } = await import("./connectors/mongodb.js");
|
|
1409
|
-
const result = await handleMongoTest();
|
|
1410
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleMongoTest());
|
|
1410
1411
|
res.writeHead(result.status, {
|
|
1411
1412
|
"Content-Type": result.contentType ?? "application/json",
|
|
1412
1413
|
});
|
|
@@ -1423,7 +1424,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1423
1424
|
void (async () => {
|
|
1424
1425
|
try {
|
|
1425
1426
|
const { handleMongoDisconnect } = await import("./connectors/mongodb.js");
|
|
1426
|
-
const result = await handleMongoDisconnect();
|
|
1427
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleMongoDisconnect());
|
|
1427
1428
|
res.writeHead(result.status, {
|
|
1428
1429
|
"Content-Type": result.contentType ?? "application/json",
|
|
1429
1430
|
});
|
|
@@ -1438,7 +1439,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1438
1439
|
// ── Redis routes ────────────────────────────────────────────────
|
|
1439
1440
|
if (parsedUrl.pathname === "/connections/redis/connect" &&
|
|
1440
1441
|
req.method === "POST") {
|
|
1441
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1442
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1442
1443
|
const m = await import("./connectors/redis.js");
|
|
1443
1444
|
return m.handleRedisConnect;
|
|
1444
1445
|
});
|
|
@@ -1449,7 +1450,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1449
1450
|
void (async () => {
|
|
1450
1451
|
try {
|
|
1451
1452
|
const { handleRedisTest } = await import("./connectors/redis.js");
|
|
1452
|
-
const result = await handleRedisTest();
|
|
1453
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleRedisTest());
|
|
1453
1454
|
res.writeHead(result.status, {
|
|
1454
1455
|
"Content-Type": result.contentType ?? "application/json",
|
|
1455
1456
|
});
|
|
@@ -1465,7 +1466,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1465
1466
|
void (async () => {
|
|
1466
1467
|
try {
|
|
1467
1468
|
const { handleRedisDisconnect } = await import("./connectors/redis.js");
|
|
1468
|
-
const result = await handleRedisDisconnect();
|
|
1469
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleRedisDisconnect());
|
|
1469
1470
|
res.writeHead(result.status, {
|
|
1470
1471
|
"Content-Type": result.contentType ?? "application/json",
|
|
1471
1472
|
});
|
|
@@ -1480,7 +1481,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1480
1481
|
// ── Elasticsearch routes ────────────────────────────────────────
|
|
1481
1482
|
if (parsedUrl.pathname === "/connections/elasticsearch/connect" &&
|
|
1482
1483
|
req.method === "POST") {
|
|
1483
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1484
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1484
1485
|
const m = await import("./connectors/elasticsearch.js");
|
|
1485
1486
|
return m.handleElasticsearchConnect;
|
|
1486
1487
|
});
|
|
@@ -1491,7 +1492,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1491
1492
|
void (async () => {
|
|
1492
1493
|
try {
|
|
1493
1494
|
const { handleElasticsearchTest } = await import("./connectors/elasticsearch.js");
|
|
1494
|
-
const result = await handleElasticsearchTest();
|
|
1495
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleElasticsearchTest());
|
|
1495
1496
|
res.writeHead(result.status, {
|
|
1496
1497
|
"Content-Type": result.contentType ?? "application/json",
|
|
1497
1498
|
});
|
|
@@ -1508,7 +1509,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1508
1509
|
void (async () => {
|
|
1509
1510
|
try {
|
|
1510
1511
|
const { handleElasticsearchDisconnect } = await import("./connectors/elasticsearch.js");
|
|
1511
|
-
const result = await handleElasticsearchDisconnect();
|
|
1512
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleElasticsearchDisconnect());
|
|
1512
1513
|
res.writeHead(result.status, {
|
|
1513
1514
|
"Content-Type": result.contentType ?? "application/json",
|
|
1514
1515
|
});
|
|
@@ -1523,7 +1524,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1523
1524
|
// ── SendGrid routes ─────────────────────────────────────────────
|
|
1524
1525
|
if (parsedUrl.pathname === "/connections/sendgrid/connect" &&
|
|
1525
1526
|
req.method === "POST") {
|
|
1526
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1527
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1527
1528
|
const m = await import("./connectors/sendgrid.js");
|
|
1528
1529
|
return m.handleSendGridConnect;
|
|
1529
1530
|
});
|
|
@@ -1534,7 +1535,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1534
1535
|
void (async () => {
|
|
1535
1536
|
try {
|
|
1536
1537
|
const { handleSendGridTest } = await import("./connectors/sendgrid.js");
|
|
1537
|
-
const result = await handleSendGridTest();
|
|
1538
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleSendGridTest());
|
|
1538
1539
|
res.writeHead(result.status, {
|
|
1539
1540
|
"Content-Type": result.contentType ?? "application/json",
|
|
1540
1541
|
});
|
|
@@ -1551,7 +1552,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1551
1552
|
void (async () => {
|
|
1552
1553
|
try {
|
|
1553
1554
|
const { handleSendGridDisconnect } = await import("./connectors/sendgrid.js");
|
|
1554
|
-
const result = handleSendGridDisconnect();
|
|
1555
|
+
const result = disconnectResponse(parsedUrl.pathname, handleSendGridDisconnect());
|
|
1555
1556
|
res.writeHead(result.status, {
|
|
1556
1557
|
"Content-Type": result.contentType ?? "application/json",
|
|
1557
1558
|
});
|
|
@@ -1566,7 +1567,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1566
1567
|
// ── Twilio routes ───────────────────────────────────────────────
|
|
1567
1568
|
if (parsedUrl.pathname === "/connections/twilio/connect" &&
|
|
1568
1569
|
req.method === "POST") {
|
|
1569
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1570
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1570
1571
|
const m = await import("./connectors/twilio.js");
|
|
1571
1572
|
return m.handleTwilioConnect;
|
|
1572
1573
|
});
|
|
@@ -1577,7 +1578,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1577
1578
|
void (async () => {
|
|
1578
1579
|
try {
|
|
1579
1580
|
const { handleTwilioTest } = await import("./connectors/twilio.js");
|
|
1580
|
-
const result = await handleTwilioTest();
|
|
1581
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleTwilioTest());
|
|
1581
1582
|
res.writeHead(result.status, {
|
|
1582
1583
|
"Content-Type": result.contentType ?? "application/json",
|
|
1583
1584
|
});
|
|
@@ -1593,7 +1594,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1593
1594
|
void (async () => {
|
|
1594
1595
|
try {
|
|
1595
1596
|
const { handleTwilioDisconnect } = await import("./connectors/twilio.js");
|
|
1596
|
-
const result = handleTwilioDisconnect();
|
|
1597
|
+
const result = disconnectResponse(parsedUrl.pathname, handleTwilioDisconnect());
|
|
1597
1598
|
res.writeHead(result.status, {
|
|
1598
1599
|
"Content-Type": result.contentType ?? "application/json",
|
|
1599
1600
|
});
|
|
@@ -1608,7 +1609,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1608
1609
|
// ── Figma routes ────────────────────────────────────────────────
|
|
1609
1610
|
if (parsedUrl.pathname === "/connections/figma/connect" &&
|
|
1610
1611
|
req.method === "POST") {
|
|
1611
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1612
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1612
1613
|
const m = await import("./connectors/figma.js");
|
|
1613
1614
|
return m.handleFigmaConnect;
|
|
1614
1615
|
});
|
|
@@ -1619,7 +1620,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1619
1620
|
void (async () => {
|
|
1620
1621
|
try {
|
|
1621
1622
|
const { handleFigmaTest } = await import("./connectors/figma.js");
|
|
1622
|
-
const result = await handleFigmaTest();
|
|
1623
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleFigmaTest());
|
|
1623
1624
|
res.writeHead(result.status, {
|
|
1624
1625
|
"Content-Type": result.contentType ?? "application/json",
|
|
1625
1626
|
});
|
|
@@ -1635,7 +1636,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1635
1636
|
void (async () => {
|
|
1636
1637
|
try {
|
|
1637
1638
|
const { handleFigmaDisconnect } = await import("./connectors/figma.js");
|
|
1638
|
-
const result = handleFigmaDisconnect();
|
|
1639
|
+
const result = disconnectResponse(parsedUrl.pathname, handleFigmaDisconnect());
|
|
1639
1640
|
res.writeHead(result.status, {
|
|
1640
1641
|
"Content-Type": result.contentType ?? "application/json",
|
|
1641
1642
|
});
|
|
@@ -1650,7 +1651,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1650
1651
|
// ── Airtable routes ─────────────────────────────────────────────
|
|
1651
1652
|
if (parsedUrl.pathname === "/connections/airtable/connect" &&
|
|
1652
1653
|
req.method === "POST") {
|
|
1653
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1654
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1654
1655
|
const m = await import("./connectors/airtable.js");
|
|
1655
1656
|
return m.handleAirtableConnect;
|
|
1656
1657
|
});
|
|
@@ -1661,7 +1662,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1661
1662
|
void (async () => {
|
|
1662
1663
|
try {
|
|
1663
1664
|
const { handleAirtableTest } = await import("./connectors/airtable.js");
|
|
1664
|
-
const result = await handleAirtableTest();
|
|
1665
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleAirtableTest());
|
|
1665
1666
|
res.writeHead(result.status, {
|
|
1666
1667
|
"Content-Type": result.contentType ?? "application/json",
|
|
1667
1668
|
});
|
|
@@ -1678,7 +1679,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1678
1679
|
void (async () => {
|
|
1679
1680
|
try {
|
|
1680
1681
|
const { handleAirtableDisconnect } = await import("./connectors/airtable.js");
|
|
1681
|
-
const result = handleAirtableDisconnect();
|
|
1682
|
+
const result = disconnectResponse(parsedUrl.pathname, handleAirtableDisconnect());
|
|
1682
1683
|
res.writeHead(result.status, {
|
|
1683
1684
|
"Content-Type": result.contentType ?? "application/json",
|
|
1684
1685
|
});
|
|
@@ -1693,7 +1694,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1693
1694
|
// ── Webflow routes ──────────────────────────────────────────────
|
|
1694
1695
|
if (parsedUrl.pathname === "/connections/webflow/connect" &&
|
|
1695
1696
|
req.method === "POST") {
|
|
1696
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
1697
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
1697
1698
|
const m = await import("./connectors/webflow.js");
|
|
1698
1699
|
return m.handleWebflowConnect;
|
|
1699
1700
|
});
|
|
@@ -1704,7 +1705,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1704
1705
|
void (async () => {
|
|
1705
1706
|
try {
|
|
1706
1707
|
const { handleWebflowTest } = await import("./connectors/webflow.js");
|
|
1707
|
-
const result = await handleWebflowTest();
|
|
1708
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleWebflowTest());
|
|
1708
1709
|
res.writeHead(result.status, {
|
|
1709
1710
|
"Content-Type": result.contentType ?? "application/json",
|
|
1710
1711
|
});
|
|
@@ -1721,7 +1722,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1721
1722
|
void (async () => {
|
|
1722
1723
|
try {
|
|
1723
1724
|
const { handleWebflowDisconnect } = await import("./connectors/webflow.js");
|
|
1724
|
-
const result = handleWebflowDisconnect();
|
|
1725
|
+
const result = disconnectResponse(parsedUrl.pathname, handleWebflowDisconnect());
|
|
1725
1726
|
res.writeHead(result.status, {
|
|
1726
1727
|
"Content-Type": result.contentType ?? "application/json",
|
|
1727
1728
|
});
|
|
@@ -1765,7 +1766,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1765
1766
|
void (async () => {
|
|
1766
1767
|
try {
|
|
1767
1768
|
const { handleCalendarTest } = await import("./connectors/googleCalendar.js");
|
|
1768
|
-
const result = await handleCalendarTest();
|
|
1769
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleCalendarTest());
|
|
1769
1770
|
res.writeHead(result.status, {
|
|
1770
1771
|
"Content-Type": result.contentType ?? "application/json",
|
|
1771
1772
|
});
|
|
@@ -1782,7 +1783,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1782
1783
|
void (async () => {
|
|
1783
1784
|
try {
|
|
1784
1785
|
const { handleCalendarDisconnect } = await import("./connectors/googleCalendar.js");
|
|
1785
|
-
const result = await handleCalendarDisconnect();
|
|
1786
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleCalendarDisconnect());
|
|
1786
1787
|
res.writeHead(result.status, {
|
|
1787
1788
|
"Content-Type": result.contentType ?? "application/json",
|
|
1788
1789
|
});
|
|
@@ -1826,7 +1827,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1826
1827
|
void (async () => {
|
|
1827
1828
|
try {
|
|
1828
1829
|
const { handleDriveTest } = await import("./connectors/googleDrive.js");
|
|
1829
|
-
const result = await handleDriveTest();
|
|
1830
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleDriveTest());
|
|
1830
1831
|
res.writeHead(result.status, {
|
|
1831
1832
|
"Content-Type": result.contentType ?? "application/json",
|
|
1832
1833
|
});
|
|
@@ -1843,7 +1844,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1843
1844
|
void (async () => {
|
|
1844
1845
|
try {
|
|
1845
1846
|
const { handleDriveDisconnect } = await import("./connectors/googleDrive.js");
|
|
1846
|
-
const result = await handleDriveDisconnect();
|
|
1847
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleDriveDisconnect());
|
|
1847
1848
|
res.writeHead(result.status, {
|
|
1848
1849
|
"Content-Type": result.contentType ?? "application/json",
|
|
1849
1850
|
});
|
|
@@ -1884,7 +1885,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1884
1885
|
void (async () => {
|
|
1885
1886
|
try {
|
|
1886
1887
|
const { handleDocsTest } = await import("./connectors/googleDocs.js");
|
|
1887
|
-
const result = await handleDocsTest();
|
|
1888
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleDocsTest());
|
|
1888
1889
|
res.writeHead(result.status, {
|
|
1889
1890
|
"Content-Type": result.contentType ?? "application/json",
|
|
1890
1891
|
});
|
|
@@ -1901,7 +1902,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1901
1902
|
void (async () => {
|
|
1902
1903
|
try {
|
|
1903
1904
|
const { handleDocsDisconnect } = await import("./connectors/googleDocs.js");
|
|
1904
|
-
const result = await handleDocsDisconnect();
|
|
1905
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleDocsDisconnect());
|
|
1905
1906
|
res.writeHead(result.status, {
|
|
1906
1907
|
"Content-Type": result.contentType ?? "application/json",
|
|
1907
1908
|
});
|
|
@@ -1942,7 +1943,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1942
1943
|
void (async () => {
|
|
1943
1944
|
try {
|
|
1944
1945
|
const { handleMondayTest } = await import("./connectors/monday.js");
|
|
1945
|
-
const result = await handleMondayTest();
|
|
1946
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleMondayTest());
|
|
1946
1947
|
res.writeHead(result.status, {
|
|
1947
1948
|
"Content-Type": result.contentType ?? "application/json",
|
|
1948
1949
|
});
|
|
@@ -1958,7 +1959,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1958
1959
|
void (async () => {
|
|
1959
1960
|
try {
|
|
1960
1961
|
const { handleMondayDisconnect } = await import("./connectors/monday.js");
|
|
1961
|
-
const result = await handleMondayDisconnect();
|
|
1962
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleMondayDisconnect());
|
|
1962
1963
|
res.writeHead(result.status, {
|
|
1963
1964
|
"Content-Type": result.contentType ?? "application/json",
|
|
1964
1965
|
});
|
|
@@ -1999,7 +2000,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
1999
2000
|
void (async () => {
|
|
2000
2001
|
try {
|
|
2001
2002
|
const { handleSalesforceTest } = await import("./connectors/salesforce.js");
|
|
2002
|
-
const result = await handleSalesforceTest();
|
|
2003
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleSalesforceTest());
|
|
2003
2004
|
res.writeHead(result.status, {
|
|
2004
2005
|
"Content-Type": result.contentType ?? "application/json",
|
|
2005
2006
|
});
|
|
@@ -2016,7 +2017,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2016
2017
|
void (async () => {
|
|
2017
2018
|
try {
|
|
2018
2019
|
const { handleSalesforceDisconnect } = await import("./connectors/salesforce.js");
|
|
2019
|
-
const result = await handleSalesforceDisconnect();
|
|
2020
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleSalesforceDisconnect());
|
|
2020
2021
|
res.writeHead(result.status, {
|
|
2021
2022
|
"Content-Type": result.contentType ?? "application/json",
|
|
2022
2023
|
});
|
|
@@ -2031,7 +2032,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2031
2032
|
// ── Shopify routes ──────────────────────────────────────────────
|
|
2032
2033
|
if (parsedUrl.pathname === "/connections/shopify/connect" &&
|
|
2033
2034
|
req.method === "POST") {
|
|
2034
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2035
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2035
2036
|
const m = await import("./connectors/shopify.js");
|
|
2036
2037
|
return m.handleShopifyConnect;
|
|
2037
2038
|
});
|
|
@@ -2042,7 +2043,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2042
2043
|
void (async () => {
|
|
2043
2044
|
try {
|
|
2044
2045
|
const { handleShopifyTest } = await import("./connectors/shopify.js");
|
|
2045
|
-
const result = await handleShopifyTest();
|
|
2046
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleShopifyTest());
|
|
2046
2047
|
res.writeHead(result.status, {
|
|
2047
2048
|
"Content-Type": result.contentType ?? "application/json",
|
|
2048
2049
|
});
|
|
@@ -2059,7 +2060,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2059
2060
|
void (async () => {
|
|
2060
2061
|
try {
|
|
2061
2062
|
const { handleShopifyDisconnect } = await import("./connectors/shopify.js");
|
|
2062
|
-
const result = await handleShopifyDisconnect();
|
|
2063
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleShopifyDisconnect());
|
|
2063
2064
|
res.writeHead(result.status, {
|
|
2064
2065
|
"Content-Type": result.contentType ?? "application/json",
|
|
2065
2066
|
});
|
|
@@ -2074,7 +2075,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2074
2075
|
// ── Snowflake routes ────────────────────────────────────────────
|
|
2075
2076
|
if (parsedUrl.pathname === "/connections/snowflake/connect" &&
|
|
2076
2077
|
req.method === "POST") {
|
|
2077
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2078
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2078
2079
|
const m = await import("./connectors/snowflake.js");
|
|
2079
2080
|
return m.handleSnowflakeConnect;
|
|
2080
2081
|
});
|
|
@@ -2085,7 +2086,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2085
2086
|
void (async () => {
|
|
2086
2087
|
try {
|
|
2087
2088
|
const { handleSnowflakeTest } = await import("./connectors/snowflake.js");
|
|
2088
|
-
const result = await handleSnowflakeTest();
|
|
2089
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleSnowflakeTest());
|
|
2089
2090
|
res.writeHead(result.status, {
|
|
2090
2091
|
"Content-Type": result.contentType ?? "application/json",
|
|
2091
2092
|
});
|
|
@@ -2102,7 +2103,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2102
2103
|
void (async () => {
|
|
2103
2104
|
try {
|
|
2104
2105
|
const { handleSnowflakeDisconnect } = await import("./connectors/snowflake.js");
|
|
2105
|
-
const result = await handleSnowflakeDisconnect();
|
|
2106
|
+
const result = disconnectResponse(parsedUrl.pathname, await handleSnowflakeDisconnect());
|
|
2106
2107
|
res.writeHead(result.status, {
|
|
2107
2108
|
"Content-Type": result.contentType ?? "application/json",
|
|
2108
2109
|
});
|
|
@@ -2117,7 +2118,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2117
2118
|
// ── Resend routes ───────────────────────────────────────────────
|
|
2118
2119
|
if (parsedUrl.pathname === "/connections/resend/connect" &&
|
|
2119
2120
|
req.method === "POST") {
|
|
2120
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2121
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2121
2122
|
const m = await import("./connectors/resend.js");
|
|
2122
2123
|
return m.handleResendConnect;
|
|
2123
2124
|
});
|
|
@@ -2128,7 +2129,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2128
2129
|
void (async () => {
|
|
2129
2130
|
try {
|
|
2130
2131
|
const { handleResendTest } = await import("./connectors/resend.js");
|
|
2131
|
-
const result = await handleResendTest();
|
|
2132
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleResendTest());
|
|
2132
2133
|
res.writeHead(result.status, {
|
|
2133
2134
|
"Content-Type": result.contentType ?? "application/json",
|
|
2134
2135
|
});
|
|
@@ -2144,7 +2145,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2144
2145
|
void (async () => {
|
|
2145
2146
|
try {
|
|
2146
2147
|
const { handleResendDisconnect } = await import("./connectors/resend.js");
|
|
2147
|
-
const result = handleResendDisconnect();
|
|
2148
|
+
const result = disconnectResponse(parsedUrl.pathname, handleResendDisconnect());
|
|
2148
2149
|
res.writeHead(result.status, {
|
|
2149
2150
|
"Content-Type": result.contentType ?? "application/json",
|
|
2150
2151
|
});
|
|
@@ -2159,7 +2160,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2159
2160
|
// ── Obsidian routes ─────────────────────────────────────────────
|
|
2160
2161
|
if (parsedUrl.pathname === "/connections/obsidian/connect" &&
|
|
2161
2162
|
req.method === "POST") {
|
|
2162
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2163
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2163
2164
|
const m = await import("./connectors/obsidian.js");
|
|
2164
2165
|
return m.handleObsidianConnect;
|
|
2165
2166
|
});
|
|
@@ -2170,7 +2171,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2170
2171
|
void (async () => {
|
|
2171
2172
|
try {
|
|
2172
2173
|
const { handleObsidianTest } = await import("./connectors/obsidian.js");
|
|
2173
|
-
const result = await handleObsidianTest();
|
|
2174
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleObsidianTest());
|
|
2174
2175
|
res.writeHead(result.status, {
|
|
2175
2176
|
"Content-Type": result.contentType ?? "application/json",
|
|
2176
2177
|
});
|
|
@@ -2187,7 +2188,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2187
2188
|
void (async () => {
|
|
2188
2189
|
try {
|
|
2189
2190
|
const { handleObsidianDisconnect } = await import("./connectors/obsidian.js");
|
|
2190
|
-
const result = handleObsidianDisconnect();
|
|
2191
|
+
const result = disconnectResponse(parsedUrl.pathname, handleObsidianDisconnect());
|
|
2191
2192
|
res.writeHead(result.status, {
|
|
2192
2193
|
"Content-Type": result.contentType ?? "application/json",
|
|
2193
2194
|
});
|
|
@@ -2202,7 +2203,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2202
2203
|
// ── Todoist routes ──────────────────────────────────────────────
|
|
2203
2204
|
if (parsedUrl.pathname === "/connections/todoist/connect" &&
|
|
2204
2205
|
req.method === "POST") {
|
|
2205
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2206
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2206
2207
|
const m = await import("./connectors/todoist.js");
|
|
2207
2208
|
return m.handleTodoistConnect;
|
|
2208
2209
|
});
|
|
@@ -2213,7 +2214,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2213
2214
|
void (async () => {
|
|
2214
2215
|
try {
|
|
2215
2216
|
const { handleTodoistTest } = await import("./connectors/todoist.js");
|
|
2216
|
-
const result = await handleTodoistTest();
|
|
2217
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleTodoistTest());
|
|
2217
2218
|
res.writeHead(result.status, {
|
|
2218
2219
|
"Content-Type": result.contentType ?? "application/json",
|
|
2219
2220
|
});
|
|
@@ -2230,7 +2231,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2230
2231
|
void (async () => {
|
|
2231
2232
|
try {
|
|
2232
2233
|
const { handleTodoistDisconnect } = await import("./connectors/todoist.js");
|
|
2233
|
-
const result = handleTodoistDisconnect();
|
|
2234
|
+
const result = disconnectResponse(parsedUrl.pathname, handleTodoistDisconnect());
|
|
2234
2235
|
res.writeHead(result.status, {
|
|
2235
2236
|
"Content-Type": result.contentType ?? "application/json",
|
|
2236
2237
|
});
|
|
@@ -2245,7 +2246,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2245
2246
|
// ── Vercel routes ───────────────────────────────────────────────
|
|
2246
2247
|
if (parsedUrl.pathname === "/connections/vercel/connect" &&
|
|
2247
2248
|
req.method === "POST") {
|
|
2248
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2249
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2249
2250
|
const m = await import("./connectors/vercel.js");
|
|
2250
2251
|
return m.handleVercelConnect;
|
|
2251
2252
|
});
|
|
@@ -2256,7 +2257,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2256
2257
|
void (async () => {
|
|
2257
2258
|
try {
|
|
2258
2259
|
const { handleVercelTest } = await import("./connectors/vercel.js");
|
|
2259
|
-
const result = await handleVercelTest();
|
|
2260
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleVercelTest());
|
|
2260
2261
|
res.writeHead(result.status, {
|
|
2261
2262
|
"Content-Type": result.contentType ?? "application/json",
|
|
2262
2263
|
});
|
|
@@ -2272,7 +2273,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2272
2273
|
void (async () => {
|
|
2273
2274
|
try {
|
|
2274
2275
|
const { handleVercelDisconnect } = await import("./connectors/vercel.js");
|
|
2275
|
-
const result = handleVercelDisconnect();
|
|
2276
|
+
const result = disconnectResponse(parsedUrl.pathname, handleVercelDisconnect());
|
|
2276
2277
|
res.writeHead(result.status, {
|
|
2277
2278
|
"Content-Type": result.contentType ?? "application/json",
|
|
2278
2279
|
});
|
|
@@ -2287,7 +2288,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2287
2288
|
// ── Paystack routes ─────────────────────────────────────────────
|
|
2288
2289
|
if (parsedUrl.pathname === "/connections/paystack/connect" &&
|
|
2289
2290
|
req.method === "POST") {
|
|
2290
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2291
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2291
2292
|
const m = await import("./connectors/paystack.js");
|
|
2292
2293
|
return m.handlePaystackConnect;
|
|
2293
2294
|
});
|
|
@@ -2298,7 +2299,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2298
2299
|
void (async () => {
|
|
2299
2300
|
try {
|
|
2300
2301
|
const { handlePaystackTest } = await import("./connectors/paystack.js");
|
|
2301
|
-
const result = await handlePaystackTest();
|
|
2302
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handlePaystackTest());
|
|
2302
2303
|
res.writeHead(result.status, {
|
|
2303
2304
|
"Content-Type": result.contentType ?? "application/json",
|
|
2304
2305
|
});
|
|
@@ -2315,7 +2316,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2315
2316
|
void (async () => {
|
|
2316
2317
|
try {
|
|
2317
2318
|
const { handlePaystackDisconnect } = await import("./connectors/paystack.js");
|
|
2318
|
-
const result = handlePaystackDisconnect();
|
|
2319
|
+
const result = disconnectResponse(parsedUrl.pathname, handlePaystackDisconnect());
|
|
2319
2320
|
res.writeHead(result.status, {
|
|
2320
2321
|
"Content-Type": result.contentType ?? "application/json",
|
|
2321
2322
|
});
|
|
@@ -2330,7 +2331,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2330
2331
|
// ── Pipedrive routes ────────────────────────────────────────────
|
|
2331
2332
|
if (parsedUrl.pathname === "/connections/pipedrive/connect" &&
|
|
2332
2333
|
req.method === "POST") {
|
|
2333
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2334
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2334
2335
|
const m = await import("./connectors/pipedrive.js");
|
|
2335
2336
|
return m.handlePipedriveConnect;
|
|
2336
2337
|
});
|
|
@@ -2341,7 +2342,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2341
2342
|
void (async () => {
|
|
2342
2343
|
try {
|
|
2343
2344
|
const { handlePipedriveTest } = await import("./connectors/pipedrive.js");
|
|
2344
|
-
const result = await handlePipedriveTest();
|
|
2345
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handlePipedriveTest());
|
|
2345
2346
|
res.writeHead(result.status, {
|
|
2346
2347
|
"Content-Type": result.contentType ?? "application/json",
|
|
2347
2348
|
});
|
|
@@ -2358,7 +2359,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2358
2359
|
void (async () => {
|
|
2359
2360
|
try {
|
|
2360
2361
|
const { handlePipedriveDisconnect } = await import("./connectors/pipedrive.js");
|
|
2361
|
-
const result = handlePipedriveDisconnect();
|
|
2362
|
+
const result = disconnectResponse(parsedUrl.pathname, handlePipedriveDisconnect());
|
|
2362
2363
|
res.writeHead(result.status, {
|
|
2363
2364
|
"Content-Type": result.contentType ?? "application/json",
|
|
2364
2365
|
});
|
|
@@ -2373,7 +2374,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2373
2374
|
// ── Cal.diy routes ──────────────────────────────────────────────
|
|
2374
2375
|
if (parsedUrl.pathname === "/connections/caldiy/connect" &&
|
|
2375
2376
|
req.method === "POST") {
|
|
2376
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2377
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2377
2378
|
const m = await import("./connectors/caldiy.js");
|
|
2378
2379
|
return m.handleCalDiyConnect;
|
|
2379
2380
|
});
|
|
@@ -2384,7 +2385,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2384
2385
|
void (async () => {
|
|
2385
2386
|
try {
|
|
2386
2387
|
const { handleCalDiyTest } = await import("./connectors/caldiy.js");
|
|
2387
|
-
const result = await handleCalDiyTest();
|
|
2388
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleCalDiyTest());
|
|
2388
2389
|
res.writeHead(result.status, {
|
|
2389
2390
|
"Content-Type": result.contentType ?? "application/json",
|
|
2390
2391
|
});
|
|
@@ -2400,7 +2401,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2400
2401
|
void (async () => {
|
|
2401
2402
|
try {
|
|
2402
2403
|
const { handleCalDiyDisconnect } = await import("./connectors/caldiy.js");
|
|
2403
|
-
const result = handleCalDiyDisconnect();
|
|
2404
|
+
const result = disconnectResponse(parsedUrl.pathname, handleCalDiyDisconnect());
|
|
2404
2405
|
res.writeHead(result.status, {
|
|
2405
2406
|
"Content-Type": result.contentType ?? "application/json",
|
|
2406
2407
|
});
|
|
@@ -2415,7 +2416,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2415
2416
|
// ── Grafana routes ──────────────────────────────────────────────
|
|
2416
2417
|
if (parsedUrl.pathname === "/connections/grafana/connect" &&
|
|
2417
2418
|
req.method === "POST") {
|
|
2418
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2419
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2419
2420
|
const m = await import("./connectors/grafana.js");
|
|
2420
2421
|
return m.handleGrafanaConnect;
|
|
2421
2422
|
});
|
|
@@ -2426,7 +2427,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2426
2427
|
void (async () => {
|
|
2427
2428
|
try {
|
|
2428
2429
|
const { handleGrafanaTest } = await import("./connectors/grafana.js");
|
|
2429
|
-
const result = await handleGrafanaTest();
|
|
2430
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleGrafanaTest());
|
|
2430
2431
|
res.writeHead(result.status, {
|
|
2431
2432
|
"Content-Type": result.contentType ?? "application/json",
|
|
2432
2433
|
});
|
|
@@ -2443,7 +2444,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2443
2444
|
void (async () => {
|
|
2444
2445
|
try {
|
|
2445
2446
|
const { handleGrafanaDisconnect } = await import("./connectors/grafana.js");
|
|
2446
|
-
const result = handleGrafanaDisconnect();
|
|
2447
|
+
const result = disconnectResponse(parsedUrl.pathname, handleGrafanaDisconnect());
|
|
2447
2448
|
res.writeHead(result.status, {
|
|
2448
2449
|
"Content-Type": result.contentType ?? "application/json",
|
|
2449
2450
|
});
|
|
@@ -2458,7 +2459,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2458
2459
|
// ── PostHog routes ──────────────────────────────────────────────
|
|
2459
2460
|
if (parsedUrl.pathname === "/connections/posthog/connect" &&
|
|
2460
2461
|
req.method === "POST") {
|
|
2461
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2462
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2462
2463
|
const m = await import("./connectors/posthog.js");
|
|
2463
2464
|
return m.handlePostHogConnect;
|
|
2464
2465
|
});
|
|
@@ -2469,7 +2470,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2469
2470
|
void (async () => {
|
|
2470
2471
|
try {
|
|
2471
2472
|
const { handlePostHogTest } = await import("./connectors/posthog.js");
|
|
2472
|
-
const result = await handlePostHogTest();
|
|
2473
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handlePostHogTest());
|
|
2473
2474
|
res.writeHead(result.status, {
|
|
2474
2475
|
"Content-Type": result.contentType ?? "application/json",
|
|
2475
2476
|
});
|
|
@@ -2486,7 +2487,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2486
2487
|
void (async () => {
|
|
2487
2488
|
try {
|
|
2488
2489
|
const { handlePostHogDisconnect } = await import("./connectors/posthog.js");
|
|
2489
|
-
const result = handlePostHogDisconnect();
|
|
2490
|
+
const result = disconnectResponse(parsedUrl.pathname, handlePostHogDisconnect());
|
|
2490
2491
|
res.writeHead(result.status, {
|
|
2491
2492
|
"Content-Type": result.contentType ?? "application/json",
|
|
2492
2493
|
});
|
|
@@ -2501,7 +2502,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2501
2502
|
// ── Cloudflare routes ───────────────────────────────────────────
|
|
2502
2503
|
if (parsedUrl.pathname === "/connections/cloudflare/connect" &&
|
|
2503
2504
|
req.method === "POST") {
|
|
2504
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2505
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2505
2506
|
const m = await import("./connectors/cloudflare.js");
|
|
2506
2507
|
return m.handleCloudflareConnect;
|
|
2507
2508
|
});
|
|
@@ -2512,7 +2513,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2512
2513
|
void (async () => {
|
|
2513
2514
|
try {
|
|
2514
2515
|
const { handleCloudflareTest } = await import("./connectors/cloudflare.js");
|
|
2515
|
-
const result = await handleCloudflareTest();
|
|
2516
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleCloudflareTest());
|
|
2516
2517
|
res.writeHead(result.status, {
|
|
2517
2518
|
"Content-Type": result.contentType ?? "application/json",
|
|
2518
2519
|
});
|
|
@@ -2529,7 +2530,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2529
2530
|
void (async () => {
|
|
2530
2531
|
try {
|
|
2531
2532
|
const { handleCloudflareDisconnect } = await import("./connectors/cloudflare.js");
|
|
2532
|
-
const result = handleCloudflareDisconnect();
|
|
2533
|
+
const result = disconnectResponse(parsedUrl.pathname, handleCloudflareDisconnect());
|
|
2533
2534
|
res.writeHead(result.status, {
|
|
2534
2535
|
"Content-Type": result.contentType ?? "application/json",
|
|
2535
2536
|
});
|
|
@@ -2544,7 +2545,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2544
2545
|
// ── CircleCI routes ─────────────────────────────────────────────
|
|
2545
2546
|
if (parsedUrl.pathname === "/connections/circleci/connect" &&
|
|
2546
2547
|
req.method === "POST") {
|
|
2547
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2548
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2548
2549
|
const m = await import("./connectors/circleci.js");
|
|
2549
2550
|
return m.handleCircleCIConnect;
|
|
2550
2551
|
});
|
|
@@ -2555,7 +2556,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2555
2556
|
void (async () => {
|
|
2556
2557
|
try {
|
|
2557
2558
|
const { handleCircleCITest } = await import("./connectors/circleci.js");
|
|
2558
|
-
const result = await handleCircleCITest();
|
|
2559
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleCircleCITest());
|
|
2559
2560
|
res.writeHead(result.status, {
|
|
2560
2561
|
"Content-Type": result.contentType ?? "application/json",
|
|
2561
2562
|
});
|
|
@@ -2572,7 +2573,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2572
2573
|
void (async () => {
|
|
2573
2574
|
try {
|
|
2574
2575
|
const { handleCircleCIDisconnect } = await import("./connectors/circleci.js");
|
|
2575
|
-
const result = handleCircleCIDisconnect();
|
|
2576
|
+
const result = disconnectResponse(parsedUrl.pathname, handleCircleCIDisconnect());
|
|
2576
2577
|
res.writeHead(result.status, {
|
|
2577
2578
|
"Content-Type": result.contentType ?? "application/json",
|
|
2578
2579
|
});
|
|
@@ -2587,7 +2588,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2587
2588
|
// ── WooCommerce routes ──────────────────────────────────────────
|
|
2588
2589
|
if (parsedUrl.pathname === "/connections/woocommerce/connect" &&
|
|
2589
2590
|
req.method === "POST") {
|
|
2590
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2591
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2591
2592
|
const m = await import("./connectors/woocommerce.js");
|
|
2592
2593
|
return m.handleWooCommerceConnect;
|
|
2593
2594
|
});
|
|
@@ -2598,7 +2599,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2598
2599
|
void (async () => {
|
|
2599
2600
|
try {
|
|
2600
2601
|
const { handleWooCommerceTest } = await import("./connectors/woocommerce.js");
|
|
2601
|
-
const result = await handleWooCommerceTest();
|
|
2602
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleWooCommerceTest());
|
|
2602
2603
|
res.writeHead(result.status, {
|
|
2603
2604
|
"Content-Type": result.contentType ?? "application/json",
|
|
2604
2605
|
});
|
|
@@ -2615,7 +2616,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2615
2616
|
void (async () => {
|
|
2616
2617
|
try {
|
|
2617
2618
|
const { handleWooCommerceDisconnect } = await import("./connectors/woocommerce.js");
|
|
2618
|
-
const result = handleWooCommerceDisconnect();
|
|
2619
|
+
const result = disconnectResponse(parsedUrl.pathname, handleWooCommerceDisconnect());
|
|
2619
2620
|
res.writeHead(result.status, {
|
|
2620
2621
|
"Content-Type": result.contentType ?? "application/json",
|
|
2621
2622
|
});
|
|
@@ -2630,7 +2631,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2630
2631
|
// ── Supabase routes ─────────────────────────────────────────────
|
|
2631
2632
|
if (parsedUrl.pathname === "/connections/supabase/connect" &&
|
|
2632
2633
|
req.method === "POST") {
|
|
2633
|
-
void dispatchConnectorConnect(req, res, async () => {
|
|
2634
|
+
void dispatchConnectorConnect(req, res, parsedUrl.pathname, async () => {
|
|
2634
2635
|
const m = await import("./connectors/supabase.js");
|
|
2635
2636
|
return m.handleSupabaseConnect;
|
|
2636
2637
|
});
|
|
@@ -2641,7 +2642,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2641
2642
|
void (async () => {
|
|
2642
2643
|
try {
|
|
2643
2644
|
const { handleSupabaseTest } = await import("./connectors/supabase.js");
|
|
2644
|
-
const result = await handleSupabaseTest();
|
|
2645
|
+
const result = recordTestOutcome(parsedUrl.pathname, await handleSupabaseTest());
|
|
2645
2646
|
res.writeHead(result.status, {
|
|
2646
2647
|
"Content-Type": result.contentType ?? "application/json",
|
|
2647
2648
|
});
|
|
@@ -2658,7 +2659,7 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
|
|
|
2658
2659
|
void (async () => {
|
|
2659
2660
|
try {
|
|
2660
2661
|
const { handleSupabaseDisconnect } = await import("./connectors/supabase.js");
|
|
2661
|
-
const result = handleSupabaseDisconnect();
|
|
2662
|
+
const result = disconnectResponse(parsedUrl.pathname, handleSupabaseDisconnect());
|
|
2662
2663
|
res.writeHead(result.status, {
|
|
2663
2664
|
"Content-Type": result.contentType ?? "application/json",
|
|
2664
2665
|
});
|