(options: ConsoleRoutesOptions)
| 58 | } |
| 59 | |
| 60 | export const consoleRoutes = (options: ConsoleRoutesOptions): Array<VirtualRouteNode> => { |
| 61 | const excluded = new Set(options.exclude ?? []); |
| 62 | const file = (name: string): string => `${options.dir}/${name}`; |
| 63 | const entries: ReadonlyArray<readonly [ConsoleRoutePath, VirtualRouteNode]> = [ |
| 64 | ["/", index(file("index.tsx"))], |
| 65 | [ |
| 66 | "/integrations/$namespace", |
| 67 | route("/integrations/$namespace", file("integrations.$namespace.tsx")), |
| 68 | ], |
| 69 | [ |
| 70 | "/integrations/add/$pluginKey", |
| 71 | route("/integrations/add/$pluginKey", file("integrations.add.$pluginKey.tsx")), |
| 72 | ], |
| 73 | ["/policies", route("/policies", file("policies.tsx"))], |
| 74 | ["/secrets", route("/secrets", file("secrets.tsx"))], |
| 75 | ["/tools", route("/tools", file("tools.tsx"))], |
| 76 | ["/toolkits", route("/toolkits", file("toolkits.tsx"))], |
| 77 | ["/toolkits/$toolkitSlug", route("/toolkits/$toolkitSlug", file("toolkits.$toolkitSlug.tsx"))], |
| 78 | ["/resume/$executionId", route("/resume/$executionId", file("resume.$executionId.tsx"))], |
| 79 | ["/plugins/$pluginId/$", route("/plugins/$pluginId/$", file("plugins.$pluginId.$.tsx"))], |
| 80 | ]; |
| 81 | const shared = entries.filter(([path]) => !excluded.has(path)).map(([, node]) => node); |
| 82 | return [route(`/${ORG_SLUG_SEGMENT}`, [...shared, ...(options.orgScoped ?? [])])]; |
| 83 | }; |
no test coverage detected