patchwork-os 0.2.0-beta.10 → 0.2.0-beta.10.canary.96
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/bridge.js +17 -10
- package/dist/bridge.js.map +1 -1
- package/dist/commands/task.d.ts +25 -0
- package/dist/commands/task.js +61 -41
- package/dist/commands/task.js.map +1 -1
- package/dist/commands/tracesExport.d.ts +15 -1
- package/dist/commands/tracesExport.js +39 -5
- package/dist/commands/tracesExport.js.map +1 -1
- package/dist/connectorRoutes.js +556 -0
- package/dist/connectorRoutes.js.map +1 -1
- package/dist/connectors/connectorRegistry.d.ts +0 -3
- package/dist/connectors/connectorRegistry.js +8 -8
- package/dist/connectors/connectorRegistry.js.map +1 -1
- package/dist/connectors/jira.js +7 -2
- package/dist/connectors/jira.js.map +1 -1
- package/dist/connectors/notion.js +10 -1
- package/dist/connectors/notion.js.map +1 -1
- package/dist/drivers/local/index.d.ts +2 -17
- package/dist/drivers/local/index.js +5 -92
- package/dist/drivers/local/index.js.map +1 -1
- package/dist/index.js +59 -70
- package/dist/index.js.map +1 -1
- package/dist/localEndpointGuard.d.ts +25 -0
- package/dist/localEndpointGuard.js +101 -0
- package/dist/localEndpointGuard.js.map +1 -0
- package/dist/orchestrator/childBridgeClient.d.ts +5 -0
- package/dist/orchestrator/childBridgeClient.js +15 -0
- package/dist/orchestrator/childBridgeClient.js.map +1 -1
- package/dist/orchestrator/orchestratorBridge.d.ts +20 -0
- package/dist/orchestrator/orchestratorBridge.js +36 -0
- package/dist/orchestrator/orchestratorBridge.js.map +1 -1
- package/dist/recipes/chainedRunner.js +14 -4
- package/dist/recipes/chainedRunner.js.map +1 -1
- package/dist/recipes/compiler.js +9 -5
- package/dist/recipes/compiler.js.map +1 -1
- package/dist/recipes/dependencyGraph.d.ts +9 -0
- package/dist/recipes/dependencyGraph.js +19 -2
- package/dist/recipes/dependencyGraph.js.map +1 -1
- package/dist/recipes/idempotencyKey.d.ts +23 -3
- package/dist/recipes/idempotencyKey.js +57 -4
- package/dist/recipes/idempotencyKey.js.map +1 -1
- package/dist/recipes/installer.js +10 -1
- package/dist/recipes/installer.js.map +1 -1
- package/dist/recipes/parser.js +22 -0
- package/dist/recipes/parser.js.map +1 -1
- package/dist/recipes/schema.d.ts +29 -2
- package/dist/recipes/validation.js +112 -0
- package/dist/recipes/validation.js.map +1 -1
- package/dist/recipes/yamlRunner.d.ts +1 -0
- package/dist/recipes/yamlRunner.js +14 -1
- package/dist/recipes/yamlRunner.js.map +1 -1
- package/dist/tools/index.js +14 -10
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* Without this, every claim about "years of personal AI memory" is
|
|
25
25
|
* undercut by the existing 1 MB / 10 000-line silent rotation.
|
|
26
26
|
*/
|
|
27
|
-
import { createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, statSync, } from "node:fs";
|
|
27
|
+
import { createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, statSync, unlinkSync, writeFileSync, } from "node:fs";
|
|
28
28
|
import os from "node:os";
|
|
29
29
|
import path from "node:path";
|
|
30
30
|
import { createInterface } from "node:readline";
|
|
@@ -109,11 +109,20 @@ export async function runTracesExport(opts = {}) {
|
|
|
109
109
|
const exportedAt = new Date().toISOString();
|
|
110
110
|
const patchworkDir = opts.patchworkDir ?? defaultPatchworkDir();
|
|
111
111
|
const activityDir = opts.activityDir ?? defaultActivityDir();
|
|
112
|
-
|
|
113
|
-
//
|
|
112
|
+
const mode = opts.mode ?? "public";
|
|
113
|
+
// Reject keyed mode without a passphrase up-front — before we touch the
|
|
114
|
+
// filesystem — so the caller gets a clear, actionable error and no
|
|
115
|
+
// half-written intermediate file is left behind.
|
|
116
|
+
if (mode === "keyed" && !opts.passphrase) {
|
|
117
|
+
throw new Error("traces export: --mode keyed requires a --passphrase (none provided)");
|
|
118
|
+
}
|
|
119
|
+
// Default output: `<patchworkDir>/traces-export-<safeIso>.jsonl.gz` (or
|
|
120
|
+
// `.enc` for keyed mode). ISO colons are filename-hostile on Windows so
|
|
121
|
+
// swap them for hyphens.
|
|
114
122
|
const safeStamp = exportedAt.replace(/:/g, "-").replace(/\..+$/, "");
|
|
123
|
+
const defaultExt = mode === "keyed" ? "jsonl.gz.enc" : "jsonl.gz";
|
|
115
124
|
const outputPath = opts.output ??
|
|
116
|
-
path.join(patchworkDir, `traces-export-${safeStamp}
|
|
125
|
+
path.join(patchworkDir, `traces-export-${safeStamp}.${defaultExt}`);
|
|
117
126
|
// Discover sources.
|
|
118
127
|
const files = [];
|
|
119
128
|
for (const { source, filename } of SINGLE_FILE_SOURCES) {
|
|
@@ -161,6 +170,12 @@ export async function runTracesExport(opts = {}) {
|
|
|
161
170
|
// Use a Readable source so pipeline() owns backpressure end-to-end —
|
|
162
171
|
// writing directly to gzip outside the pipeline ignores the drain signal
|
|
163
172
|
// and silently buffers everything in memory on large exports.
|
|
173
|
+
//
|
|
174
|
+
// For keyed mode we first write the plain gzip to an intermediate path,
|
|
175
|
+
// then read it back, AES-256-GCM-wrap it, write the `.enc` to the real
|
|
176
|
+
// outputPath, and unlink the intermediate. The encryption helper operates
|
|
177
|
+
// on a whole Buffer, so the intermediate file is the streaming boundary.
|
|
178
|
+
const gzipTarget = mode === "keyed" ? `${outputPath}.plain.tmp` : outputPath;
|
|
164
179
|
const { Readable } = await import("node:stream");
|
|
165
180
|
const source = Readable.from((function* () {
|
|
166
181
|
yield `${JSON.stringify(manifest)}\n`;
|
|
@@ -173,8 +188,27 @@ export async function runTracesExport(opts = {}) {
|
|
|
173
188
|
}
|
|
174
189
|
}
|
|
175
190
|
})(), { objectMode: false });
|
|
176
|
-
const sink = createWriteStream(
|
|
191
|
+
const sink = createWriteStream(gzipTarget, { mode: 0o600 });
|
|
177
192
|
await pipeline(source, createGzip(), sink);
|
|
193
|
+
if (mode === "keyed") {
|
|
194
|
+
// opts.passphrase is guaranteed non-empty by the early guard above.
|
|
195
|
+
const passphrase = opts.passphrase;
|
|
196
|
+
const { encryptTraceBundle } = await import("../traceEncryption.js");
|
|
197
|
+
try {
|
|
198
|
+
const plain = readFileSync(gzipTarget);
|
|
199
|
+
const encrypted = encryptTraceBundle(plain, passphrase);
|
|
200
|
+
writeFileSync(outputPath, encrypted, { mode: 0o600 });
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
// Always remove the plaintext intermediate, even if encryption threw.
|
|
204
|
+
try {
|
|
205
|
+
unlinkSync(gzipTarget);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// Intermediate already gone or never created — nothing to clean.
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
178
212
|
return {
|
|
179
213
|
outputPath,
|
|
180
214
|
exportedAt,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracesExport.js","sourceRoot":"","sources":["../../src/commands/tracesExport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,WAAW,EACX,QAAQ,
|
|
1
|
+
{"version":3,"file":"tracesExport.js","sourceRoot":"","sources":["../../src/commands/tracesExport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,CAA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C,CAAC,KAAK;SACf,CAAC,CAAC;QACH,UAAU;QACV,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;KACvD,CAAC;AACJ,CAAC"}
|
package/dist/connectorRoutes.js
CHANGED
|
@@ -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
|