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

Function consoleRoutes

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

Source from the content-addressed store, hash-verified

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

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