cron: separate webhook POST delivery from announce (#17901)

* cron: split webhook delivery from announce mode

* cron: validate webhook delivery target

* cron: remove legacy webhook fallback config

* fix: finalize cron webhook delivery prep (#17901) (thanks @advaitpaliwal)

---------

Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM>
This commit is contained in:
Advait Paliwal
2026-02-16 02:36:00 -08:00
committed by GitHub
parent d841c9b26b
commit bc67af6ad8
33 changed files with 698 additions and 236 deletions

View File

@@ -5,16 +5,28 @@ import { MACOS_APP_SOURCES_DIR } from "../compat/legacy-names.js";
import { CronDeliverySchema } from "../gateway/protocol/schema.js";
type SchemaLike = {
anyOf?: Array<{ properties?: Record<string, unknown>; const?: unknown }>;
anyOf?: Array<SchemaLike>;
properties?: Record<string, unknown>;
const?: unknown;
};
function extractDeliveryModes(schema: SchemaLike): string[] {
const modeSchema = schema.properties?.mode as SchemaLike | undefined;
return (modeSchema?.anyOf ?? [])
const directModes = (modeSchema?.anyOf ?? [])
.map((entry) => entry?.const)
.filter((value): value is string => typeof value === "string");
if (directModes.length > 0) {
return directModes;
}
const unionModes = (schema.anyOf ?? [])
.map((entry) => {
const mode = entry.properties?.mode as SchemaLike | undefined;
return mode?.const;
})
.filter((value): value is string => typeof value === "string");
return Array.from(new Set(unionModes));
}
const UI_FILES = ["ui/src/ui/types.ts", "ui/src/ui/ui-types.ts", "ui/src/ui/views/cron.ts"];