patchwork-os 0.2.0-beta.10 → 0.2.0-beta.10.canary.100

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.
Files changed (133) hide show
  1. package/dist/bridge.js +17 -10
  2. package/dist/bridge.js.map +1 -1
  3. package/dist/commands/connect.d.ts +47 -0
  4. package/dist/commands/connect.js +419 -0
  5. package/dist/commands/connect.js.map +1 -0
  6. package/dist/commands/recipe.d.ts +45 -4
  7. package/dist/commands/recipe.js +141 -4
  8. package/dist/commands/recipe.js.map +1 -1
  9. package/dist/commands/task.d.ts +25 -0
  10. package/dist/commands/task.js +61 -41
  11. package/dist/commands/task.js.map +1 -1
  12. package/dist/commands/tracesExport.d.ts +15 -1
  13. package/dist/commands/tracesExport.js +39 -5
  14. package/dist/commands/tracesExport.js.map +1 -1
  15. package/dist/connectorRoutes.js +556 -0
  16. package/dist/connectorRoutes.js.map +1 -1
  17. package/dist/connectors/connectorRegistry.d.ts +0 -3
  18. package/dist/connectors/connectorRegistry.js +8 -8
  19. package/dist/connectors/connectorRegistry.js.map +1 -1
  20. package/dist/connectors/datadog.js +8 -1
  21. package/dist/connectors/datadog.js.map +1 -1
  22. package/dist/connectors/jira.js +7 -2
  23. package/dist/connectors/jira.js.map +1 -1
  24. package/dist/connectors/mcpClient.js +37 -23
  25. package/dist/connectors/mcpClient.js.map +1 -1
  26. package/dist/connectors/notion.d.ts +1 -1
  27. package/dist/connectors/notion.js +13 -4
  28. package/dist/connectors/notion.js.map +1 -1
  29. package/dist/connectors/redis.js +10 -2
  30. package/dist/connectors/redis.js.map +1 -1
  31. package/dist/connectors/snowflake.js +18 -0
  32. package/dist/connectors/snowflake.js.map +1 -1
  33. package/dist/decisionReplay.d.ts +8 -6
  34. package/dist/decisionReplay.js +35 -11
  35. package/dist/decisionReplay.js.map +1 -1
  36. package/dist/drivers/claude/api.js +28 -5
  37. package/dist/drivers/claude/api.js.map +1 -1
  38. package/dist/drivers/claude/subprocess.js +47 -13
  39. package/dist/drivers/claude/subprocess.js.map +1 -1
  40. package/dist/drivers/local/index.d.ts +2 -17
  41. package/dist/drivers/local/index.js +5 -92
  42. package/dist/drivers/local/index.js.map +1 -1
  43. package/dist/fp/automationInterpreter.js +57 -12
  44. package/dist/fp/automationInterpreter.js.map +1 -1
  45. package/dist/fp/policyParser.js +5 -1
  46. package/dist/fp/policyParser.js.map +1 -1
  47. package/dist/index.js +154 -83
  48. package/dist/index.js.map +1 -1
  49. package/dist/localEndpointGuard.d.ts +25 -0
  50. package/dist/localEndpointGuard.js +101 -0
  51. package/dist/localEndpointGuard.js.map +1 -0
  52. package/dist/orchestrator/childBridgeClient.d.ts +5 -0
  53. package/dist/orchestrator/childBridgeClient.js +28 -1
  54. package/dist/orchestrator/childBridgeClient.js.map +1 -1
  55. package/dist/orchestrator/orchestratorBridge.d.ts +33 -0
  56. package/dist/orchestrator/orchestratorBridge.js +70 -9
  57. package/dist/orchestrator/orchestratorBridge.js.map +1 -1
  58. package/dist/recipes/chainedRunner.js +14 -4
  59. package/dist/recipes/chainedRunner.js.map +1 -1
  60. package/dist/recipes/compiler.js +9 -5
  61. package/dist/recipes/compiler.js.map +1 -1
  62. package/dist/recipes/dependencyGraph.d.ts +9 -0
  63. package/dist/recipes/dependencyGraph.js +19 -2
  64. package/dist/recipes/dependencyGraph.js.map +1 -1
  65. package/dist/recipes/githubInstallSource.d.ts +9 -2
  66. package/dist/recipes/githubInstallSource.js +36 -6
  67. package/dist/recipes/githubInstallSource.js.map +1 -1
  68. package/dist/recipes/idempotencyKey.d.ts +23 -3
  69. package/dist/recipes/idempotencyKey.js +57 -4
  70. package/dist/recipes/idempotencyKey.js.map +1 -1
  71. package/dist/recipes/installer.js +10 -1
  72. package/dist/recipes/installer.js.map +1 -1
  73. package/dist/recipes/parser.js +28 -1
  74. package/dist/recipes/parser.js.map +1 -1
  75. package/dist/recipes/schema.d.ts +29 -2
  76. package/dist/recipes/schemaGenerator.js +16 -2
  77. package/dist/recipes/schemaGenerator.js.map +1 -1
  78. package/dist/recipes/toolRegistry.js +13 -4
  79. package/dist/recipes/toolRegistry.js.map +1 -1
  80. package/dist/recipes/tools/airtable.d.ts +15 -0
  81. package/dist/recipes/tools/airtable.js +239 -0
  82. package/dist/recipes/tools/airtable.js.map +1 -0
  83. package/dist/recipes/tools/index.d.ts +5 -0
  84. package/dist/recipes/tools/index.js +5 -0
  85. package/dist/recipes/tools/index.js.map +1 -1
  86. package/dist/recipes/tools/resend.d.ts +8 -0
  87. package/dist/recipes/tools/resend.js +152 -0
  88. package/dist/recipes/tools/resend.js.map +1 -0
  89. package/dist/recipes/tools/sendgrid.d.ts +9 -0
  90. package/dist/recipes/tools/sendgrid.js +174 -0
  91. package/dist/recipes/tools/sendgrid.js.map +1 -0
  92. package/dist/recipes/tools/twilio.d.ts +11 -0
  93. package/dist/recipes/tools/twilio.js +179 -0
  94. package/dist/recipes/tools/twilio.js.map +1 -0
  95. package/dist/recipes/tools/vercel.d.ts +9 -0
  96. package/dist/recipes/tools/vercel.js +145 -0
  97. package/dist/recipes/tools/vercel.js.map +1 -0
  98. package/dist/recipes/validation.js +112 -0
  99. package/dist/recipes/validation.js.map +1 -1
  100. package/dist/recipes/yamlRunner.d.ts +3 -0
  101. package/dist/recipes/yamlRunner.js +112 -29
  102. package/dist/recipes/yamlRunner.js.map +1 -1
  103. package/dist/schemas/recipe.v1.json +2 -2
  104. package/dist/telemetry.js +20 -9
  105. package/dist/telemetry.js.map +1 -1
  106. package/dist/tools/getGitStatus.js +6 -1
  107. package/dist/tools/getGitStatus.js.map +1 -1
  108. package/dist/tools/getToolCapabilities.js +39 -4
  109. package/dist/tools/getToolCapabilities.js.map +1 -1
  110. package/dist/tools/github/composite.d.ts +1 -1
  111. package/dist/tools/github/composite.js +7 -7
  112. package/dist/tools/github/composite.js.map +1 -1
  113. package/dist/tools/github/pr.d.ts +6 -6
  114. package/dist/tools/github/pr.js +18 -11
  115. package/dist/tools/github/pr.js.map +1 -1
  116. package/dist/tools/index.js +14 -10
  117. package/dist/tools/index.js.map +1 -1
  118. package/dist/tools/previewEdit.js +16 -1
  119. package/dist/tools/previewEdit.js.map +1 -1
  120. package/dist/tools/searchAndReplace.js +4 -5
  121. package/dist/tools/searchAndReplace.js.map +1 -1
  122. package/dist/tools/searchTools.d.ts +26 -0
  123. package/dist/tools/searchTools.js +42 -2
  124. package/dist/tools/searchTools.js.map +1 -1
  125. package/dist/tools/transaction.d.ts +9 -1
  126. package/dist/tools/transaction.js +59 -4
  127. package/dist/tools/transaction.js.map +1 -1
  128. package/dist/tools/utils.d.ts +15 -0
  129. package/dist/tools/utils.js +19 -0
  130. package/dist/tools/utils.js.map +1 -1
  131. package/dist/transport.js +23 -0
  132. package/dist/transport.js.map +1 -1
  133. package/package.json +1 -1
@@ -2104,6 +2104,562 @@ export function tryHandleConnectorRoute(req, res, parsedUrl) {
2104
2104
  })();
2105
2105
  return true;
2106
2106
  }
2107
+ // ── Resend routes ───────────────────────────────────────────────
2108
+ if (parsedUrl.pathname === "/connections/resend/connect" &&
2109
+ req.method === "POST") {
2110
+ void dispatchConnectorConnect(req, res, async () => {
2111
+ const m = await import("./connectors/resend.js");
2112
+ return m.handleResendConnect;
2113
+ });
2114
+ return true;
2115
+ }
2116
+ if (parsedUrl.pathname === "/connections/resend/test" &&
2117
+ req.method === "POST") {
2118
+ void (async () => {
2119
+ try {
2120
+ const { handleResendTest } = await import("./connectors/resend.js");
2121
+ const result = await handleResendTest();
2122
+ res.writeHead(result.status, {
2123
+ "Content-Type": result.contentType ?? "application/json",
2124
+ });
2125
+ res.end(result.body);
2126
+ }
2127
+ catch (err) {
2128
+ respond500(res, err);
2129
+ }
2130
+ })();
2131
+ return true;
2132
+ }
2133
+ if (parsedUrl.pathname === "/connections/resend" && req.method === "DELETE") {
2134
+ void (async () => {
2135
+ try {
2136
+ const { handleResendDisconnect } = await import("./connectors/resend.js");
2137
+ const result = handleResendDisconnect();
2138
+ res.writeHead(result.status, {
2139
+ "Content-Type": result.contentType ?? "application/json",
2140
+ });
2141
+ res.end(result.body);
2142
+ }
2143
+ catch (err) {
2144
+ respond500(res, err);
2145
+ }
2146
+ })();
2147
+ return true;
2148
+ }
2149
+ // ── Obsidian routes ─────────────────────────────────────────────
2150
+ if (parsedUrl.pathname === "/connections/obsidian/connect" &&
2151
+ req.method === "POST") {
2152
+ void dispatchConnectorConnect(req, res, async () => {
2153
+ const m = await import("./connectors/obsidian.js");
2154
+ return m.handleObsidianConnect;
2155
+ });
2156
+ return true;
2157
+ }
2158
+ if (parsedUrl.pathname === "/connections/obsidian/test" &&
2159
+ req.method === "POST") {
2160
+ void (async () => {
2161
+ try {
2162
+ const { handleObsidianTest } = await import("./connectors/obsidian.js");
2163
+ const result = await handleObsidianTest();
2164
+ res.writeHead(result.status, {
2165
+ "Content-Type": result.contentType ?? "application/json",
2166
+ });
2167
+ res.end(result.body);
2168
+ }
2169
+ catch (err) {
2170
+ respond500(res, err);
2171
+ }
2172
+ })();
2173
+ return true;
2174
+ }
2175
+ if (parsedUrl.pathname === "/connections/obsidian" &&
2176
+ req.method === "DELETE") {
2177
+ void (async () => {
2178
+ try {
2179
+ const { handleObsidianDisconnect } = await import("./connectors/obsidian.js");
2180
+ const result = handleObsidianDisconnect();
2181
+ res.writeHead(result.status, {
2182
+ "Content-Type": result.contentType ?? "application/json",
2183
+ });
2184
+ res.end(result.body);
2185
+ }
2186
+ catch (err) {
2187
+ respond500(res, err);
2188
+ }
2189
+ })();
2190
+ return true;
2191
+ }
2192
+ // ── Todoist routes ──────────────────────────────────────────────
2193
+ if (parsedUrl.pathname === "/connections/todoist/connect" &&
2194
+ req.method === "POST") {
2195
+ void dispatchConnectorConnect(req, res, async () => {
2196
+ const m = await import("./connectors/todoist.js");
2197
+ return m.handleTodoistConnect;
2198
+ });
2199
+ return true;
2200
+ }
2201
+ if (parsedUrl.pathname === "/connections/todoist/test" &&
2202
+ req.method === "POST") {
2203
+ void (async () => {
2204
+ try {
2205
+ const { handleTodoistTest } = await import("./connectors/todoist.js");
2206
+ const result = await handleTodoistTest();
2207
+ res.writeHead(result.status, {
2208
+ "Content-Type": result.contentType ?? "application/json",
2209
+ });
2210
+ res.end(result.body);
2211
+ }
2212
+ catch (err) {
2213
+ respond500(res, err);
2214
+ }
2215
+ })();
2216
+ return true;
2217
+ }
2218
+ if (parsedUrl.pathname === "/connections/todoist" &&
2219
+ req.method === "DELETE") {
2220
+ void (async () => {
2221
+ try {
2222
+ const { handleTodoistDisconnect } = await import("./connectors/todoist.js");
2223
+ const result = handleTodoistDisconnect();
2224
+ res.writeHead(result.status, {
2225
+ "Content-Type": result.contentType ?? "application/json",
2226
+ });
2227
+ res.end(result.body);
2228
+ }
2229
+ catch (err) {
2230
+ respond500(res, err);
2231
+ }
2232
+ })();
2233
+ return true;
2234
+ }
2235
+ // ── Vercel routes ───────────────────────────────────────────────
2236
+ if (parsedUrl.pathname === "/connections/vercel/connect" &&
2237
+ req.method === "POST") {
2238
+ void dispatchConnectorConnect(req, res, async () => {
2239
+ const m = await import("./connectors/vercel.js");
2240
+ return m.handleVercelConnect;
2241
+ });
2242
+ return true;
2243
+ }
2244
+ if (parsedUrl.pathname === "/connections/vercel/test" &&
2245
+ req.method === "POST") {
2246
+ void (async () => {
2247
+ try {
2248
+ const { handleVercelTest } = await import("./connectors/vercel.js");
2249
+ const result = await handleVercelTest();
2250
+ res.writeHead(result.status, {
2251
+ "Content-Type": result.contentType ?? "application/json",
2252
+ });
2253
+ res.end(result.body);
2254
+ }
2255
+ catch (err) {
2256
+ respond500(res, err);
2257
+ }
2258
+ })();
2259
+ return true;
2260
+ }
2261
+ if (parsedUrl.pathname === "/connections/vercel" && req.method === "DELETE") {
2262
+ void (async () => {
2263
+ try {
2264
+ const { handleVercelDisconnect } = await import("./connectors/vercel.js");
2265
+ const result = handleVercelDisconnect();
2266
+ res.writeHead(result.status, {
2267
+ "Content-Type": result.contentType ?? "application/json",
2268
+ });
2269
+ res.end(result.body);
2270
+ }
2271
+ catch (err) {
2272
+ respond500(res, err);
2273
+ }
2274
+ })();
2275
+ return true;
2276
+ }
2277
+ // ── Paystack routes ─────────────────────────────────────────────
2278
+ if (parsedUrl.pathname === "/connections/paystack/connect" &&
2279
+ req.method === "POST") {
2280
+ void dispatchConnectorConnect(req, res, async () => {
2281
+ const m = await import("./connectors/paystack.js");
2282
+ return m.handlePaystackConnect;
2283
+ });
2284
+ return true;
2285
+ }
2286
+ if (parsedUrl.pathname === "/connections/paystack/test" &&
2287
+ req.method === "POST") {
2288
+ void (async () => {
2289
+ try {
2290
+ const { handlePaystackTest } = await import("./connectors/paystack.js");
2291
+ const result = await handlePaystackTest();
2292
+ res.writeHead(result.status, {
2293
+ "Content-Type": result.contentType ?? "application/json",
2294
+ });
2295
+ res.end(result.body);
2296
+ }
2297
+ catch (err) {
2298
+ respond500(res, err);
2299
+ }
2300
+ })();
2301
+ return true;
2302
+ }
2303
+ if (parsedUrl.pathname === "/connections/paystack" &&
2304
+ req.method === "DELETE") {
2305
+ void (async () => {
2306
+ try {
2307
+ const { handlePaystackDisconnect } = await import("./connectors/paystack.js");
2308
+ const result = handlePaystackDisconnect();
2309
+ res.writeHead(result.status, {
2310
+ "Content-Type": result.contentType ?? "application/json",
2311
+ });
2312
+ res.end(result.body);
2313
+ }
2314
+ catch (err) {
2315
+ respond500(res, err);
2316
+ }
2317
+ })();
2318
+ return true;
2319
+ }
2320
+ // ── Pipedrive routes ────────────────────────────────────────────
2321
+ if (parsedUrl.pathname === "/connections/pipedrive/connect" &&
2322
+ req.method === "POST") {
2323
+ void dispatchConnectorConnect(req, res, async () => {
2324
+ const m = await import("./connectors/pipedrive.js");
2325
+ return m.handlePipedriveConnect;
2326
+ });
2327
+ return true;
2328
+ }
2329
+ if (parsedUrl.pathname === "/connections/pipedrive/test" &&
2330
+ req.method === "POST") {
2331
+ void (async () => {
2332
+ try {
2333
+ const { handlePipedriveTest } = await import("./connectors/pipedrive.js");
2334
+ const result = await handlePipedriveTest();
2335
+ res.writeHead(result.status, {
2336
+ "Content-Type": result.contentType ?? "application/json",
2337
+ });
2338
+ res.end(result.body);
2339
+ }
2340
+ catch (err) {
2341
+ respond500(res, err);
2342
+ }
2343
+ })();
2344
+ return true;
2345
+ }
2346
+ if (parsedUrl.pathname === "/connections/pipedrive" &&
2347
+ req.method === "DELETE") {
2348
+ void (async () => {
2349
+ try {
2350
+ const { handlePipedriveDisconnect } = await import("./connectors/pipedrive.js");
2351
+ const result = handlePipedriveDisconnect();
2352
+ res.writeHead(result.status, {
2353
+ "Content-Type": result.contentType ?? "application/json",
2354
+ });
2355
+ res.end(result.body);
2356
+ }
2357
+ catch (err) {
2358
+ respond500(res, err);
2359
+ }
2360
+ })();
2361
+ return true;
2362
+ }
2363
+ // ── Cal.diy routes ──────────────────────────────────────────────
2364
+ if (parsedUrl.pathname === "/connections/caldiy/connect" &&
2365
+ req.method === "POST") {
2366
+ void dispatchConnectorConnect(req, res, async () => {
2367
+ const m = await import("./connectors/caldiy.js");
2368
+ return m.handleCalDiyConnect;
2369
+ });
2370
+ return true;
2371
+ }
2372
+ if (parsedUrl.pathname === "/connections/caldiy/test" &&
2373
+ req.method === "POST") {
2374
+ void (async () => {
2375
+ try {
2376
+ const { handleCalDiyTest } = await import("./connectors/caldiy.js");
2377
+ const result = await handleCalDiyTest();
2378
+ res.writeHead(result.status, {
2379
+ "Content-Type": result.contentType ?? "application/json",
2380
+ });
2381
+ res.end(result.body);
2382
+ }
2383
+ catch (err) {
2384
+ respond500(res, err);
2385
+ }
2386
+ })();
2387
+ return true;
2388
+ }
2389
+ if (parsedUrl.pathname === "/connections/caldiy" && req.method === "DELETE") {
2390
+ void (async () => {
2391
+ try {
2392
+ const { handleCalDiyDisconnect } = await import("./connectors/caldiy.js");
2393
+ const result = handleCalDiyDisconnect();
2394
+ res.writeHead(result.status, {
2395
+ "Content-Type": result.contentType ?? "application/json",
2396
+ });
2397
+ res.end(result.body);
2398
+ }
2399
+ catch (err) {
2400
+ respond500(res, err);
2401
+ }
2402
+ })();
2403
+ return true;
2404
+ }
2405
+ // ── Grafana routes ──────────────────────────────────────────────
2406
+ if (parsedUrl.pathname === "/connections/grafana/connect" &&
2407
+ req.method === "POST") {
2408
+ void dispatchConnectorConnect(req, res, async () => {
2409
+ const m = await import("./connectors/grafana.js");
2410
+ return m.handleGrafanaConnect;
2411
+ });
2412
+ return true;
2413
+ }
2414
+ if (parsedUrl.pathname === "/connections/grafana/test" &&
2415
+ req.method === "POST") {
2416
+ void (async () => {
2417
+ try {
2418
+ const { handleGrafanaTest } = await import("./connectors/grafana.js");
2419
+ const result = await handleGrafanaTest();
2420
+ res.writeHead(result.status, {
2421
+ "Content-Type": result.contentType ?? "application/json",
2422
+ });
2423
+ res.end(result.body);
2424
+ }
2425
+ catch (err) {
2426
+ respond500(res, err);
2427
+ }
2428
+ })();
2429
+ return true;
2430
+ }
2431
+ if (parsedUrl.pathname === "/connections/grafana" &&
2432
+ req.method === "DELETE") {
2433
+ void (async () => {
2434
+ try {
2435
+ const { handleGrafanaDisconnect } = await import("./connectors/grafana.js");
2436
+ const result = handleGrafanaDisconnect();
2437
+ res.writeHead(result.status, {
2438
+ "Content-Type": result.contentType ?? "application/json",
2439
+ });
2440
+ res.end(result.body);
2441
+ }
2442
+ catch (err) {
2443
+ respond500(res, err);
2444
+ }
2445
+ })();
2446
+ return true;
2447
+ }
2448
+ // ── PostHog routes ──────────────────────────────────────────────
2449
+ if (parsedUrl.pathname === "/connections/posthog/connect" &&
2450
+ req.method === "POST") {
2451
+ void dispatchConnectorConnect(req, res, async () => {
2452
+ const m = await import("./connectors/posthog.js");
2453
+ return m.handlePostHogConnect;
2454
+ });
2455
+ return true;
2456
+ }
2457
+ if (parsedUrl.pathname === "/connections/posthog/test" &&
2458
+ req.method === "POST") {
2459
+ void (async () => {
2460
+ try {
2461
+ const { handlePostHogTest } = await import("./connectors/posthog.js");
2462
+ const result = await handlePostHogTest();
2463
+ res.writeHead(result.status, {
2464
+ "Content-Type": result.contentType ?? "application/json",
2465
+ });
2466
+ res.end(result.body);
2467
+ }
2468
+ catch (err) {
2469
+ respond500(res, err);
2470
+ }
2471
+ })();
2472
+ return true;
2473
+ }
2474
+ if (parsedUrl.pathname === "/connections/posthog" &&
2475
+ req.method === "DELETE") {
2476
+ void (async () => {
2477
+ try {
2478
+ const { handlePostHogDisconnect } = await import("./connectors/posthog.js");
2479
+ const result = handlePostHogDisconnect();
2480
+ res.writeHead(result.status, {
2481
+ "Content-Type": result.contentType ?? "application/json",
2482
+ });
2483
+ res.end(result.body);
2484
+ }
2485
+ catch (err) {
2486
+ respond500(res, err);
2487
+ }
2488
+ })();
2489
+ return true;
2490
+ }
2491
+ // ── Cloudflare routes ───────────────────────────────────────────
2492
+ if (parsedUrl.pathname === "/connections/cloudflare/connect" &&
2493
+ req.method === "POST") {
2494
+ void dispatchConnectorConnect(req, res, async () => {
2495
+ const m = await import("./connectors/cloudflare.js");
2496
+ return m.handleCloudflareConnect;
2497
+ });
2498
+ return true;
2499
+ }
2500
+ if (parsedUrl.pathname === "/connections/cloudflare/test" &&
2501
+ req.method === "POST") {
2502
+ void (async () => {
2503
+ try {
2504
+ const { handleCloudflareTest } = await import("./connectors/cloudflare.js");
2505
+ const result = await handleCloudflareTest();
2506
+ res.writeHead(result.status, {
2507
+ "Content-Type": result.contentType ?? "application/json",
2508
+ });
2509
+ res.end(result.body);
2510
+ }
2511
+ catch (err) {
2512
+ respond500(res, err);
2513
+ }
2514
+ })();
2515
+ return true;
2516
+ }
2517
+ if (parsedUrl.pathname === "/connections/cloudflare" &&
2518
+ req.method === "DELETE") {
2519
+ void (async () => {
2520
+ try {
2521
+ const { handleCloudflareDisconnect } = await import("./connectors/cloudflare.js");
2522
+ const result = handleCloudflareDisconnect();
2523
+ res.writeHead(result.status, {
2524
+ "Content-Type": result.contentType ?? "application/json",
2525
+ });
2526
+ res.end(result.body);
2527
+ }
2528
+ catch (err) {
2529
+ respond500(res, err);
2530
+ }
2531
+ })();
2532
+ return true;
2533
+ }
2534
+ // ── CircleCI routes ─────────────────────────────────────────────
2535
+ if (parsedUrl.pathname === "/connections/circleci/connect" &&
2536
+ req.method === "POST") {
2537
+ void dispatchConnectorConnect(req, res, async () => {
2538
+ const m = await import("./connectors/circleci.js");
2539
+ return m.handleCircleCIConnect;
2540
+ });
2541
+ return true;
2542
+ }
2543
+ if (parsedUrl.pathname === "/connections/circleci/test" &&
2544
+ req.method === "POST") {
2545
+ void (async () => {
2546
+ try {
2547
+ const { handleCircleCITest } = await import("./connectors/circleci.js");
2548
+ const result = await handleCircleCITest();
2549
+ res.writeHead(result.status, {
2550
+ "Content-Type": result.contentType ?? "application/json",
2551
+ });
2552
+ res.end(result.body);
2553
+ }
2554
+ catch (err) {
2555
+ respond500(res, err);
2556
+ }
2557
+ })();
2558
+ return true;
2559
+ }
2560
+ if (parsedUrl.pathname === "/connections/circleci" &&
2561
+ req.method === "DELETE") {
2562
+ void (async () => {
2563
+ try {
2564
+ const { handleCircleCIDisconnect } = await import("./connectors/circleci.js");
2565
+ const result = handleCircleCIDisconnect();
2566
+ res.writeHead(result.status, {
2567
+ "Content-Type": result.contentType ?? "application/json",
2568
+ });
2569
+ res.end(result.body);
2570
+ }
2571
+ catch (err) {
2572
+ respond500(res, err);
2573
+ }
2574
+ })();
2575
+ return true;
2576
+ }
2577
+ // ── WooCommerce routes ──────────────────────────────────────────
2578
+ if (parsedUrl.pathname === "/connections/woocommerce/connect" &&
2579
+ req.method === "POST") {
2580
+ void dispatchConnectorConnect(req, res, async () => {
2581
+ const m = await import("./connectors/woocommerce.js");
2582
+ return m.handleWooCommerceConnect;
2583
+ });
2584
+ return true;
2585
+ }
2586
+ if (parsedUrl.pathname === "/connections/woocommerce/test" &&
2587
+ req.method === "POST") {
2588
+ void (async () => {
2589
+ try {
2590
+ const { handleWooCommerceTest } = await import("./connectors/woocommerce.js");
2591
+ const result = await handleWooCommerceTest();
2592
+ res.writeHead(result.status, {
2593
+ "Content-Type": result.contentType ?? "application/json",
2594
+ });
2595
+ res.end(result.body);
2596
+ }
2597
+ catch (err) {
2598
+ respond500(res, err);
2599
+ }
2600
+ })();
2601
+ return true;
2602
+ }
2603
+ if (parsedUrl.pathname === "/connections/woocommerce" &&
2604
+ req.method === "DELETE") {
2605
+ void (async () => {
2606
+ try {
2607
+ const { handleWooCommerceDisconnect } = await import("./connectors/woocommerce.js");
2608
+ const result = handleWooCommerceDisconnect();
2609
+ res.writeHead(result.status, {
2610
+ "Content-Type": result.contentType ?? "application/json",
2611
+ });
2612
+ res.end(result.body);
2613
+ }
2614
+ catch (err) {
2615
+ respond500(res, err);
2616
+ }
2617
+ })();
2618
+ return true;
2619
+ }
2620
+ // ── Supabase routes ─────────────────────────────────────────────
2621
+ if (parsedUrl.pathname === "/connections/supabase/connect" &&
2622
+ req.method === "POST") {
2623
+ void dispatchConnectorConnect(req, res, async () => {
2624
+ const m = await import("./connectors/supabase.js");
2625
+ return m.handleSupabaseConnect;
2626
+ });
2627
+ return true;
2628
+ }
2629
+ if (parsedUrl.pathname === "/connections/supabase/test" &&
2630
+ req.method === "POST") {
2631
+ void (async () => {
2632
+ try {
2633
+ const { handleSupabaseTest } = await import("./connectors/supabase.js");
2634
+ const result = await handleSupabaseTest();
2635
+ res.writeHead(result.status, {
2636
+ "Content-Type": result.contentType ?? "application/json",
2637
+ });
2638
+ res.end(result.body);
2639
+ }
2640
+ catch (err) {
2641
+ respond500(res, err);
2642
+ }
2643
+ })();
2644
+ return true;
2645
+ }
2646
+ if (parsedUrl.pathname === "/connections/supabase" &&
2647
+ req.method === "DELETE") {
2648
+ void (async () => {
2649
+ try {
2650
+ const { handleSupabaseDisconnect } = await import("./connectors/supabase.js");
2651
+ const result = handleSupabaseDisconnect();
2652
+ res.writeHead(result.status, {
2653
+ "Content-Type": result.contentType ?? "application/json",
2654
+ });
2655
+ res.end(result.body);
2656
+ }
2657
+ catch (err) {
2658
+ respond500(res, err);
2659
+ }
2660
+ })();
2661
+ return true;
2662
+ }
2107
2663
  return false;
2108
2664
  }
2109
2665
  //# sourceMappingURL=connectorRoutes.js.map