@rubytech/create-realagent 1.0.862 → 1.0.863
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/package.json +1 -1
- package/payload/server/server.js +17 -9
package/package.json
CHANGED
package/payload/server/server.js
CHANGED
|
@@ -9400,15 +9400,22 @@ ${result.stderr}` : ""}`;
|
|
|
9400
9400
|
return err("script", message, combined);
|
|
9401
9401
|
}
|
|
9402
9402
|
let tunnels;
|
|
9403
|
+
let nullNormalised = false;
|
|
9403
9404
|
try {
|
|
9404
9405
|
const parsed = JSON.parse(result.stdout.trim());
|
|
9405
|
-
if (
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9406
|
+
if (parsed === null) {
|
|
9407
|
+
tunnels = [];
|
|
9408
|
+
nullNormalised = true;
|
|
9409
|
+
} else if (!Array.isArray(parsed)) {
|
|
9410
|
+
throw new Error("cloudflared response is not an array");
|
|
9411
|
+
} else {
|
|
9412
|
+
tunnels = parsed.filter((t) => t.deleted_at == null).map((t) => {
|
|
9413
|
+
if (typeof t.id !== "string" || typeof t.name !== "string") {
|
|
9414
|
+
throw new Error("tunnel entry missing id or name");
|
|
9415
|
+
}
|
|
9416
|
+
return { id: t.id, name: t.name };
|
|
9417
|
+
});
|
|
9418
|
+
}
|
|
9412
9419
|
} catch (e) {
|
|
9413
9420
|
return err(
|
|
9414
9421
|
"script",
|
|
@@ -9417,11 +9424,12 @@ ${result.stderr}` : ""}`;
|
|
|
9417
9424
|
);
|
|
9418
9425
|
}
|
|
9419
9426
|
const total = Date.now() - started;
|
|
9420
|
-
|
|
9427
|
+
const nullTag = nullNormalised ? " null_normalised=true" : "";
|
|
9428
|
+
log(`phase=response-sent total_ms=${total} count=${tunnels.length}${nullTag}`);
|
|
9421
9429
|
writeRouteMilestone(
|
|
9422
9430
|
streamLogPath,
|
|
9423
9431
|
"cloudflare-tunnels",
|
|
9424
|
-
`phase=response-sent total_ms=${total} count=${tunnels.length} source=cloudflared`
|
|
9432
|
+
`phase=response-sent total_ms=${total} count=${tunnels.length} source=cloudflared${nullTag}`
|
|
9425
9433
|
);
|
|
9426
9434
|
const success = { ok: true, tunnels, defaultName, correlationId, streamLogPath };
|
|
9427
9435
|
return c.json(success, 200);
|