openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
22 lines (21 loc) • 898 B
JavaScript
import { F as getPluginHttpRouteCanonicalPath } from "./runtime-ezCEpumg.mjs";
import { t as prefixMatchPath } from "./http-path-prefix-Biip6S6q.mjs";
//#region src/plugins/http-route-overlap.ts
/** Detects conflicting plugin HTTP routes before Gateway registration accepts them. */
/** Resolves the collision classes shared by static and lifecycle route registration. */
function findPluginHttpRouteRegistrationConflicts(e, t) {
const n = getPluginHttpRouteCanonicalPath(t);
let r;
const i = [];
for (const a of e) {
const e = getPluginHttpRouteCanonicalPath(a);
if (!r && a.auth !== t.auth && (e === n || a.match === "prefix" && prefixMatchPath(n, e) || t.match === "prefix" && prefixMatchPath(e, n))) r = a;
if (a.match === t.match && e === n) i.push(a);
}
return {
authOverlap: r,
canonicalMatches: i
};
}
//#endregion
export { findPluginHttpRouteRegistrationConflicts as t };