MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / consoleRoutes

Function consoleRoutes

packages/react/src/console-routes.ts:64–97  ·  view source on GitHub ↗
(options: ConsoleRoutesOptions)

Source from the content-addressed store, hash-verified

62}
63
64export const consoleRoutes = (options: ConsoleRoutesOptions): Array<VirtualRouteNode> => {
65 const excluded = new Set(options.exclude ?? []);
66 const file = (name: string): string => `${options.dir}/${name}`;
67 const entries: ReadonlyArray<readonly [ConsoleRoutePath, VirtualRouteNode]> = [
68 ["/", index(file("index.tsx"))],
69 [
70 "/connect/$integrationSlug",
71 route("/connect/$integrationSlug", file("connect.$integrationSlug.tsx")),
72 ],
73 [
74 "/integrations/$namespace",
75 route("/integrations/$namespace", file("integrations.$namespace.tsx")),
76 ],
77 [
78 "/integrations/add/$pluginKey",
79 route("/integrations/add/$pluginKey", file("integrations.add.$pluginKey.tsx")),
80 ],
81 ["/policies", route("/policies", file("policies.tsx"))],
82 ["/secrets", route("/secrets", file("secrets.tsx"))],
83 ["/tools", route("/tools", file("tools.tsx"))],
84 // The admin users view. Hosts that don't serve `/admin/users*` (local /
85 // desktop, cloudflare) exclude it — the page would only ever render its
86 // denied state there.
87 ["/users", route("/users", file("users.tsx"))],
88 ["/toolkits", route("/toolkits", file("toolkits.tsx"))],
89 ["/toolkits/$toolkitSlug", route("/toolkits/$toolkitSlug", file("toolkits.$toolkitSlug.tsx"))],
90 ["/artifacts", route("/artifacts", file("artifacts.tsx"))],
91 ["/artifacts/$artifactId", route("/artifacts/$artifactId", file("artifacts.$artifactId.tsx"))],
92 ["/resume/$executionId", route("/resume/$executionId", file("resume.$executionId.tsx"))],
93 ["/plugins/$pluginId/$", route("/plugins/$pluginId/$", file("plugins.$pluginId.$.tsx"))],
94 ];
95 const shared = entries.filter(([path]) => !excluded.has(path)).map(([, node]) => node);
96 return [route(`/${ORG_SLUG_SEGMENT}`, [...shared, ...(options.orgScoped ?? [])])];
97};

Callers 6

tsr.routes.tsFile · 0.90
tsr.routes.tsFile · 0.90
tsr.routes.tsFile · 0.90
tsr.routes.tsFile · 0.90
tsr.routes.tsFile · 0.90

Calls 1

fileFunction · 0.85

Tested by

no test coverage detected