Capsium TypeScript API
    Preparing search index...

    Function parseRoutes

    • Parse routes.json, accepting the legacy object-keyed-by-path form and normalizing it to the canonical {index?, routes: [...]} array form.

      Parameters

      • input: unknown

      Returns {
          index?: string;
          routes: (
              | {
                  headers?: Record<string, string>;
                  headersFile?: string;
                  path: string;
                  remap?: string;
                  requestHeaders?: Record<string, string>;
                  resource: string;
                  responseHeaders?: Record<string, string>;
                  responseRewrite?: { body?: string; headers?: Record<string, string> };
                  visibility?: "exported" | "private";
              }
              | {
                  accessControl?: {
                      authenticationRequired?: boolean;
                      roles?: string[];
                      [key: string]: unknown;
                  };
                  dataset: string;
                  path: string;
              }
              | {
                  handler: string;
                  method: string;
                  path: string;
                  remap?: string;
                  requestHeaders?: Record<string, string>;
                  responseHeaders?: Record<string, string>;
                  responseRewrite?: { body?: string; headers?: Record<string, string> };
                  visibility?: "exported" | "private";
                  [key: string]: unknown;
              }
          )[];
      }