// src/lib/openapi-config.ts
var createOpenApiConfig = (config) => {
  const basePath = config.basePath || "";
  const servers = config.docs?.servers || [
    {
      url: "http://localhost:3000",
      description: "Development server"
    }
  ];
  const serversWithBasePath = servers.map((server) => ({
    ...server,
    url: `${server.url.replace(/\/$/, "")}${basePath}`
  }));
  return {
    openapi: "3.0.0",
    info: {
      title: config.docs?.title || "IAM API",
      version: config.docs?.version || "1.0.0",
      description: "Complete Identity and Access Management API"
    },
    servers: serversWithBasePath,
    tags: [
      { name: "Auth", description: "Authentication endpoints" },
      { name: "Profile", description: "User profile management" },
      { name: "Password", description: "Password management" },
      { name: "Email", description: "Email verification" },
      { name: "Phone", description: "Phone verification" },
      { name: "Users", description: "User management (IAM)" },
      { name: "Tenants", description: "Tenant management (IAM)" },
      { name: "Domains", description: "Domain management (IAM)" },
      { name: "Roles", description: "Role management (IAM)" },
      { name: "Permissions", description: "Permission management (IAM)" },
      {
        name: "Role Permissions",
        description: "Role-permission mapping (IAM)"
      },
      { name: "User Roles", description: "User-role assignment (IAM)" },
      { name: "Sessions", description: "Session management (IAM)" },
      { name: "Verifications", description: "Verification management (IAM)" },
      { name: "System", description: "System initialization" }
    ],
    "x-tagGroups": [
      {
        name: "Authentication",
        tags: ["Auth", "Profile", "Password", "Email", "Phone"]
      },
      {
        name: "System",
        tags: ["System"]
      },
      {
        name: "IAM Management",
        tags: [
          "Users",
          "Tenants",
          "Domains",
          "Roles",
          "Permissions",
          "Role Permissions",
          "User Roles",
          "Sessions",
          "Verifications"
        ]
      }
    ]
  };
};
export {
  createOpenApiConfig
};
//# sourceMappingURL=openapi-config.js.map