alibi-plugins 0.7.0

Built-in authentication plugins and API metadata for Alibi
Documentation
//! Source-backed Better Auth 1.7.7 declarations.
//! Author-time port: tests/compat/reference-server/port-openapi-annotations.ts.
//! Conversion helpers SHA256: ecbb352aeae990043fa25e1a5c42413aa433f33f015110d85c2bfecff74d67c5.
//! No generated document or fixture response was captured.
use super::OpenApiEndpoint;
use serde_json::json;

pub(super) fn endpoint(plugin: &str, path: &str) -> Option<OpenApiEndpoint> {
    Some(match(plugin,path){
("admin","/admin/set-role")=>OpenApiEndpoint{operation_id:Some("setUserRole".into()),description:Some("Set the role of a user".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"},"role":{"anyOf":[{"type":"string","description":"The role to set. `admin` or `user` by default"},{"type":"array","items":{"type":"string","description":"The roles to set. `admin` or `user` by default"}}],"description":"The role to set, this can be a string or an array of strings. Eg: `admin` or `[admin, user]`"}},"required":["userId","role"]}}}})),responses:[("200".into(),json!({"description":"User role updated","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/get-user")=>OpenApiEndpoint{operation_id:Some("getUser".into()),description:Some("Get an existing user".into()),tags:None,parameters:vec![json!({"name":"id","in":"query","schema":{"type":"string","description":"The id of the User"}})],request_body:None,responses:[("200".into(),json!({"description":"User","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/create-user")=>OpenApiEndpoint{operation_id:Some("createUser".into()),description:Some("Create a new user".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"The email of the user"},"password":{"type":"string"},"name":{"type":"string","description":"The name of the user"},"role":{"anyOf":[{"type":"string","description":"The role of the user"},{"type":"array","items":{"type":"string","description":"The roles of user"}}]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["email","name"]}}}})),responses:[("200".into(),json!({"description":"User created","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/update-user")=>OpenApiEndpoint{operation_id:Some("adminUpdateUser".into()),description:Some("Update a user's details".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"},"data":{"type":"object","propertyNames":{},"additionalProperties":{},"description":"The user data to update"}},"required":["userId","data"]}}}})),responses:[("200".into(),json!({"description":"User updated","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/list-users")=>OpenApiEndpoint{operation_id:Some("listUsers".into()),description:Some("List users".into()),tags:None,parameters:vec![json!({"name":"searchValue","in":"query","schema":{"type":"string"}}),json!({"name":"searchField","in":"query","schema":{"type":"string","enum":["email","name"],"description":"The field to search in, defaults to email. Can be `email` or `name`. Eg: \"name\""}}),json!({"name":"searchOperator","in":"query","schema":{"type":"string","enum":["contains","starts_with","ends_with"],"description":"The operator to use for the search. Can be `contains`, `starts_with` or `ends_with`. Eg: \"contains\""}}),json!({"name":"limit","in":"query","schema":{"anyOf":[{"type":"string","description":"The number of users to return"},{"type":"number"}]}}),json!({"name":"offset","in":"query","schema":{"anyOf":[{"type":"string","description":"The offset to start from"},{"type":"number"}]}}),json!({"name":"sortBy","in":"query","schema":{"type":"string","description":"The field to sort by"}}),json!({"name":"sortDirection","in":"query","schema":{"type":"string","enum":["asc","desc"],"description":"The direction to sort by"}}),json!({"name":"filterField","in":"query","schema":{"type":"string","description":"The field to filter by"}}),json!({"name":"filterValue","in":"query","schema":{"anyOf":[{"anyOf":[{"anyOf":[{"anyOf":[{"type":"string","description":"The value to filter by"},{"type":"number"}]},{"type":"boolean"}]},{"type":"array","items":{"type":"string"}}]},{"type":"array","items":{"type":"number"}}]}}),json!({"name":"filterOperator","in":"query","schema":{"type":"string","enum":["eq","ne","lt","lte","gt","gte","in","not_in","contains","starts_with","ends_with"],"description":"The operator to use for the filter"}})],request_body:None,responses:[("200".into(),json!({"description":"List of users","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"}},"required":["users","total"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/list-user-sessions")=>OpenApiEndpoint{operation_id:Some("adminListUserSessions".into()),description:Some("List user sessions".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}})),responses:[("200".into(),json!({"description":"List of user sessions","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/unban-user")=>OpenApiEndpoint{operation_id:Some("unbanUser".into()),description:Some("Unban a user".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}})),responses:[("200".into(),json!({"description":"User unbanned","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/ban-user")=>OpenApiEndpoint{operation_id:Some("banUser".into()),description:Some("Ban a user".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"},"banReason":{"type":"string","description":"The reason for the ban"},"banExpiresIn":{"type":"number","description":"The number of seconds until the ban expires"}},"required":["userId"]}}}})),responses:[("200".into(),json!({"description":"User banned","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/impersonate-user")=>OpenApiEndpoint{operation_id:Some("impersonateUser".into()),description:Some("Impersonate a user".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}})),responses:[("200".into(),json!({"description":"Impersonation session created","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/stop-impersonating")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:None,responses:[].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/revoke-user-session")=>OpenApiEndpoint{operation_id:Some("revokeUserSession".into()),description:Some("Revoke a user session".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionToken":{"type":"string","description":"The session token"}},"required":["sessionToken"]}}}})),responses:[("200".into(),json!({"description":"Session revoked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/revoke-user-sessions")=>OpenApiEndpoint{operation_id:Some("revokeUserSessions".into()),description:Some("Revoke all user sessions".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}})),responses:[("200".into(),json!({"description":"Sessions revoked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/remove-user")=>OpenApiEndpoint{operation_id:Some("removeUser".into()),description:Some("Delete a user and all their sessions and accounts. Cannot be undone.".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id"}},"required":["userId"]}}}})),responses:[("200".into(),json!({"description":"User removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/set-user-password")=>OpenApiEndpoint{operation_id:Some("setUserPassword".into()),description:Some("Set a user's password".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newPassword":{"type":"string","minLength":1,"description":"The new password"},"userId":{"type":"string","minLength":1,"description":"The user id"}},"required":["newPassword","userId"]}}}})),responses:[("200".into(),json!({"description":"Password set","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("admin","/admin/has-permission")=>OpenApiEndpoint{operation_id:None,description:Some("Check if the user has permission".into()),tags:None,parameters:vec![],request_body:Some(json!({"content":{"application/json":{"schema":{"type":"object","properties":{"permissions":{"type":"object","description":"The permission to check"}},"required":["permissions"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"success":{"type":"boolean"}},"required":["success"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("multi-session","/multi-session/list-device-sessions")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:None,responses:[].into_iter().collect(),server_only:false,..Default::default()},
("multi-session","/multi-session/set-active")=>OpenApiEndpoint{operation_id:None,description:Some("Set the active session".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionToken":{"type":"string","description":"The session token to set as active"}},"required":["sessionToken"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("multi-session","/multi-session/revoke")=>OpenApiEndpoint{operation_id:None,description:Some("Revoke a device session".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sessionToken":{"type":"string","description":"The session token to revoke"}},"required":["sessionToken"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/create")=>OpenApiEndpoint{operation_id:None,description:Some("Create an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name of the organization"},"slug":{"type":"string","minLength":1,"description":"The slug of the organization"},"userId":{"type":"string","description":"The user id of the organization creator. If not provided, the current user will be used. Should only be used by admins or when called by the server. server-only. Eg: \"user-id\""},"logo":{"type":["string","null"],"description":"The logo of the organization"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The metadata of the organization"},"keepCurrentActiveOrganization":{"type":"boolean","description":"Whether to keep the current active organization active after creating a new one. Eg: true"}},"required":["name","slug"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The organization that was created","$ref":"#/components/schemas/Organization"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/update")=>OpenApiEndpoint{operation_id:None,description:Some("Update an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"The name of the organization"},"slug":{"type":"string","minLength":1,"description":"The slug of the organization"},"logo":{"type":["string","null"],"description":"The logo of the organization"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The metadata of the organization"}}},"organizationId":{"type":"string","description":"The organization ID. Eg: \"org-id\""}},"required":["data"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The updated organization","$ref":"#/components/schemas/Organization"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/delete")=>OpenApiEndpoint{operation_id:None,description:Some("Delete an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"The organization id to delete"}},"required":["organizationId"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"string","description":"The organization id that was deleted"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/set-active")=>OpenApiEndpoint{operation_id:Some("setActiveOrganization".into()),description:Some("Set the active organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":["string","null"],"description":"The organization id to set as active. It can be null to unset the active organization. Eg: \"org-id\""},"organizationSlug":{"type":"string","description":"The organization slug to set as active. It can be null to unset the active organization if organizationId is not provided. Eg: \"org-slug\""}}}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The organization","$ref":"#/components/schemas/Organization"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/get-organization")=>OpenApiEndpoint{operation_id:Some("getOrganization".into()),description:Some("Get the organization metadata".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The organization","$ref":"#/components/schemas/Organization"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/get-full-organization")=>OpenApiEndpoint{operation_id:Some("getFullOrganization".into()),description:Some("Get the full organization".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The organization","$ref":"#/components/schemas/Organization"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/list")=>OpenApiEndpoint{operation_id:None,description:Some("List all organizations".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/invite-member")=>OpenApiEndpoint{operation_id:Some("createOrganizationInvitation".into()),description:Some("Create an invitation to an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"The email address of the user to invite"},"role":{"anyOf":[{"type":"string","description":"The role to assign to the user"},{"type":"array","items":{"type":"string","description":"The roles to assign to the user"}}],"description":"The role(s) to assign to the user. It can be `admin`, `member`, owner. Eg: \"member\""},"organizationId":{"type":"string","description":"The organization ID to invite the user to"},"resend":{"type":"boolean","description":"Resend the invitation email, if the user is already invited. Eg: true"},"teamId":{"anyOf":[{"type":"string","description":"The team ID to invite the user to"},{"type":"array","items":{"type":"string"},"description":"The team IDs to invite the user to"}]}},"required":["email","role"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"organizationId":{"type":"string"},"inviterId":{"type":"string"},"status":{"type":"string"},"expiresAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","email","role","organizationId","inviterId","status","expiresAt","createdAt"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/cancel-invitation")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":"string","description":"The ID of the invitation to cancel"}},"required":["invitationId"]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/accept-invitation")=>OpenApiEndpoint{operation_id:None,description:Some("Accept an invitation to an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":"string","description":"The ID of the invitation to accept"}},"required":["invitationId"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"object"},"member":{"type":"object"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/get-invitation")=>OpenApiEndpoint{operation_id:None,description:Some("Get an invitation by ID".into()),tags:None,parameters:vec![json!({"name":"id","in":"query","schema":{"type":"string","description":"The ID of the invitation to get"}})],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"organizationId":{"type":"string"},"inviterId":{"type":"string"},"status":{"type":"string"},"expiresAt":{"type":"string"},"organizationName":{"type":"string"},"organizationSlug":{"type":"string"},"inviterEmail":{"type":"string"}},"required":["id","email","role","organizationId","inviterId","status","expiresAt","organizationName","organizationSlug","inviterEmail"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/reject-invitation")=>OpenApiEndpoint{operation_id:None,description:Some("Reject an invitation to an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":"string","description":"The ID of the invitation to reject"}},"required":["invitationId"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"invitation":{"type":"object"},"member":{"type":"object","nullable":true}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/list-invitations")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:None,responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/get-active-member")=>OpenApiEndpoint{operation_id:None,description:Some("Get the member details of the active organization".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string"}},"required":["id","userId","organizationId","role"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/check-slug")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","description":"The organization slug to check. Eg: \"my-org\""}},"required":["slug"]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/remove-member")=>OpenApiEndpoint{operation_id:None,description:Some("Remove a member from an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memberIdOrEmail":{"type":"string","description":"The ID or email of the member to remove"},"organizationId":{"type":"string","description":"The ID of the organization to remove the member from. If not provided, the active organization will be used. Eg: \"org-id\""}},"required":["memberIdOrEmail"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string"}},"required":["id","userId","organizationId","role"]}},"required":["member"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/update-member-role")=>OpenApiEndpoint{operation_id:Some("updateOrganizationMemberRole".into()),description:Some("Update the role of a member in an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The new role to be applied. This can be a string or array of strings representing the roles. Eg: [\"admin\", \"sale\"]"},"memberId":{"type":"string","description":"The member id to apply the role update to. Eg: \"member-id\""},"organizationId":{"type":"string","description":"An optional organization ID which the member is a part of to apply the role update. If not provided, you must provide session headers to get the active organization. Eg: \"organization-id\""}},"required":["role","memberId"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"role":{"type":"string"}},"required":["id","userId","organizationId","role"]}},"required":["member"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/leave")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","description":"The organization Id for the member to leave. Eg: \"organization-id\""}},"required":["organizationId"]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/list-user-invitations")=>OpenApiEndpoint{operation_id:None,description:Some("List all invitations a user has received".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"organizationId":{"type":"string"},"organizationName":{"type":"string"},"inviterId":{"type":"string","description":"The ID of the user who created the invitation"},"teamId":{"type":"string","description":"The ID of the team associated with the invitation","nullable":true},"status":{"type":"string"},"expiresAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","email","role","organizationId","organizationName","inviterId","status","expiresAt","createdAt"]}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/list-members")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:None,responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/get-active-member-role")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:None,responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/create-team")=>OpenApiEndpoint{operation_id:None,description:Some("Create a new team within an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the team. Eg: \"my-team\""},"organizationId":{"type":"string","description":"The organization ID which the team will be created in. Defaults to the active organization. Eg: \"organization-id\""}},"required":["name"]}}}})),responses:[("200".into(),json!({"description":"Team created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the created team"},"name":{"type":"string","description":"Name of the team"},"organizationId":{"type":"string","description":"ID of the organization the team belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the team was last updated"}},"required":["id","name","organizationId","createdAt","updatedAt"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/list-teams")=>OpenApiEndpoint{operation_id:None,description:Some("List all teams in an organization".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Teams retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the team"},"name":{"type":"string","description":"Name of the team"},"organizationId":{"type":"string","description":"ID of the organization the team belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the team was last updated"}},"required":["id","name","organizationId","createdAt","updatedAt"]},"description":"Array of team objects within the organization"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/remove-team")=>OpenApiEndpoint{operation_id:None,description:Some("Remove a team from an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The team ID of the team to remove. Eg: \"team-id\""},"organizationId":{"type":"string","description":"The organization ID which the team falls under. If not provided, it will default to the user's active organization. Eg: \"organization-id\""}},"required":["teamId"]}}}})),responses:[("200".into(),json!({"description":"Team removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Confirmation message indicating successful removal","enum":["Team removed successfully."]}},"required":["message"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/update-team")=>OpenApiEndpoint{operation_id:None,description:Some("Update an existing team in an organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to be updated. Eg: \"team-id\""},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"organizationId":{"type":"string"}}}},"required":["teamId","data"]}}}})),responses:[("200".into(),json!({"description":"Team updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the updated team"},"name":{"type":"string","description":"Updated name of the team"},"organizationId":{"type":"string","description":"ID of the organization the team belongs to"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the team was last updated"}},"required":["id","name","organizationId","createdAt","updatedAt"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/set-active-team")=>OpenApiEndpoint{operation_id:None,description:Some("Set the active team for the current active organization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":["string","null"],"description":"The team id to set as active. It can be null to unset the active team"}}}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","description":"The team","$ref":"#/components/schemas/Team"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/list-user-teams")=>OpenApiEndpoint{operation_id:None,description:Some("List teams for a user. Without parameters, returns teams for the current user across every organization they belong to. Pass `organizationId` to scope the result to a specific organization. Pass `userId` to list teams for another member; this requires `member:update` permission in the target organization (the explicit `organizationId` if provided, otherwise the session's active organization).".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Teams retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"The team","$ref":"#/components/schemas/Team"},"description":"Array of team objects within the organization"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/list-team-members")=>OpenApiEndpoint{operation_id:None,description:Some("List the members of the given team.".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Teams retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","description":"The team member","properties":{"id":{"type":"string","description":"Unique identifier of the team member"},"userId":{"type":"string","description":"The user ID of the team member"},"teamId":{"type":"string","description":"The team ID of the team the team member is in"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team member was created"}},"required":["id","userId","teamId","createdAt"]},"description":"Array of team member objects within the team"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/add-team-member")=>OpenApiEndpoint{operation_id:None,description:Some("The newly created member".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The team the user should be a member of."},"userId":{"type":"string","description":"The user Id which represents the user to be added as a member."},"organizationId":{"type":"string","description":"The organization ID which the team falls under. If not provided, it will default to the user's active organization."}},"required":["teamId","userId"]}}}})),responses:[("200".into(),json!({"description":"Team member created successfully","content":{"application/json":{"schema":{"type":"object","description":"The team member","properties":{"id":{"type":"string","description":"Unique identifier of the team member"},"userId":{"type":"string","description":"The user ID of the team member"},"teamId":{"type":"string","description":"The team ID of the team the team member is in"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the team member was created"}},"required":["id","userId","teamId","createdAt"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/remove-team-member")=>OpenApiEndpoint{operation_id:None,description:Some("Remove a member from a team".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","description":"The team the user should be removed from."},"userId":{"type":"string","description":"The user which should be removed from the team."},"organizationId":{"type":"string","description":"The organization ID which the team falls under. If not provided, it will default to the user's active organization."}},"required":["teamId","userId"]}}}})),responses:[("200".into(),json!({"description":"Team member removed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Confirmation message indicating successful removal","enum":["Team member removed successfully."]}},"required":["message"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/create-role")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"role":{"type":"string","description":"The name of the role to create"},"permission":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"The permission to assign to the role"},"additionalFields":{"type":"object","properties":{}}},"required":["role","permission"]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/delete-role")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"organizationId":{"type":"string"}}},{"anyOf":[{"type":"object","properties":{"roleName":{"type":"string","minLength":1,"description":"The name of the role to delete"}},"required":["roleName"]},{"type":"object","properties":{"roleId":{"type":"string","minLength":1,"description":"The id of the role to delete"}},"required":["roleId"]}]}]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/list-roles")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:None,responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/get-role")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:None,responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/update-role")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"organizationId":{"type":"string"},"data":{"type":"object","properties":{"permission":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"roleName":{"type":"string"}}}},"required":["data"]},{"anyOf":[{"type":"object","properties":{"roleName":{"type":"string","minLength":1,"description":"The name of the role to update"}},"required":["roleName"]},{"type":"object","properties":{"roleId":{"type":"string","minLength":1,"description":"The id of the role to update"}},"required":["roleId"]}]}]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("organization","/organization/has-permission")=>OpenApiEndpoint{operation_id:None,description:Some("Check if the user has permission".into()),tags:None,parameters:vec![],request_body:Some(json!({"content":{"application/json":{"schema":{"type":"object","properties":{"permission":{"type":"object","description":"The permission to check","deprecated":true},"permissions":{"type":"object","description":"The permission to check"}},"required":["permissions"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"success":{"type":"boolean"}},"required":["success"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("username","/sign-in/username")=>OpenApiEndpoint{operation_id:None,description:Some("Sign in with username".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"The username of the user"},"password":{"type":"string","description":"The password of the user"},"rememberMe":{"type":"boolean","description":"Remember the user session"},"callbackURL":{"type":"string","description":"URL to redirect to after sign in (also used as the redirect target for email verification when required)"}},"required":["username","password"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"redirect":{"type":"boolean","description":"Whether the client should follow the Location header. True when callbackURL was provided."},"token":{"type":"string","description":"Session token for the authenticated session"},"url":{"type":"string","nullable":true,"description":"The callbackURL echoed back so the client can redirect."},"user":{"$ref":"#/components/schemas/User"}},"required":["redirect","token","user"]}}}})),("422".into(),json!({"description":"Unprocessable Entity. Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("username","/is-username-available")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","description":"The username to check"}},"required":["username"]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("two-factor","/two-factor/get-totp-uri")=>OpenApiEndpoint{operation_id:None,description:Some("Use this endpoint to get the TOTP URI".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"User password"}},"required":["password"]}}}})),responses:[("200".into(),json!({"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"totpURI":{"type":"string"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("two-factor","/two-factor/verify-totp")=>OpenApiEndpoint{operation_id:None,description:Some("Verify two factor TOTP".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The otp code to verify. Eg: \"012345\""},"trustDevice":{"type":"boolean","description":"If true, the device will be trusted for 30 days. It'll be refreshed on every sign in request within this time. Eg: true"}},"required":["code"]}}}})),responses:[("200".into(),json!({"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("two-factor","/two-factor/send-otp")=>OpenApiEndpoint{operation_id:None,description:Some("Send two factor OTP to the user".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"trustDevice":{"type":"boolean"}}}}}})),responses:[("200".into(),json!({"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("two-factor","/two-factor/verify-otp")=>OpenApiEndpoint{operation_id:None,description:Some("Verify two factor OTP".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"The otp code to verify. Eg: \"012345\""},"trustDevice":{"type":"boolean"}},"required":["code"]}}}})),responses:[("200".into(),json!({"description":"Two-factor OTP verified successfully","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"Session token for the authenticated session"},"user":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the user"},"email":{"type":"string","format":"email","nullable":true,"description":"User's email address"},"emailVerified":{"type":"boolean","nullable":true,"description":"Whether the email is verified"},"name":{"type":"string","nullable":true,"description":"User's name"},"image":{"type":"string","format":"uri","nullable":true,"description":"User's profile image URL"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the user was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the user was last updated"}},"required":["id","createdAt","updatedAt"],"description":"The authenticated user object"}},"required":["token","user"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("two-factor","/two-factor/verify-backup-code")=>OpenApiEndpoint{operation_id:None,description:Some("Verify a backup code for two-factor authentication".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"A backup code to verify. Eg: \"123456\""},"disableSession":{"type":"boolean","description":"If true, the session cookie will not be set."},"trustDevice":{"type":"boolean","description":"If true, the device will be trusted for 30 days. It'll be refreshed on every sign in request within this time. Eg: true"}},"required":["code"]}}}})),responses:[("200".into(),json!({"description":"Backup code verified successfully","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the user"},"email":{"type":"string","format":"email","nullable":true,"description":"User's email address"},"emailVerified":{"type":"boolean","nullable":true,"description":"Whether the email is verified"},"name":{"type":"string","nullable":true,"description":"User's name"},"image":{"type":"string","format":"uri","nullable":true,"description":"User's profile image URL"},"twoFactorEnabled":{"type":"boolean","description":"Whether two-factor authentication is enabled for the user"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the user was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the user was last updated"}},"required":["id","twoFactorEnabled","createdAt","updatedAt"],"description":"The authenticated user object with two-factor details"},"session":{"type":"object","properties":{"token":{"type":"string","description":"Session token"},"userId":{"type":"string","description":"ID of the user associated with the session"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the session was created"},"expiresAt":{"type":"string","format":"date-time","description":"Timestamp when the session expires"}},"required":["token","userId","createdAt","expiresAt"],"description":"The current session object, included unless disableSession is true"}},"required":["user","session"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("two-factor","/two-factor/generate-backup-codes")=>OpenApiEndpoint{operation_id:None,description:Some("Generate new backup codes for two-factor authentication".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"The users password."}},"required":["password"]}}}})),responses:[("200".into(),json!({"description":"Backup codes generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if the backup codes were generated successfully","enum":[true]},"backupCodes":{"type":"array","items":{"type":"string"},"description":"Array of generated backup codes in plain text"}},"required":["status","backupCodes"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("two-factor","/two-factor/enable")=>OpenApiEndpoint{operation_id:None,description:Some("Enable two factor authentication. Pass method 'totp' (default) to set up an authenticator app (returns TOTP URI and backup codes), or 'otp' to enable email/SMS-based codes immediately.".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"User password"},"method":{"type":"string","enum":["otp","totp"]},"issuer":{"type":"string","description":"Custom issuer for the TOTP URI"}},"required":["password"]}}}})),responses:[("200".into(),json!({"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["otp","totp"],"description":"The 2FA method that was enabled."},"totpURI":{"type":"string","description":"TOTP URI for authenticator app setup. Only present when method is 'totp'."},"backupCodes":{"type":"array","items":{"type":"string"},"description":"Recovery backup codes. Only present when method is 'totp'."}},"required":["method"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("two-factor","/two-factor/disable")=>OpenApiEndpoint{operation_id:None,description:Some("Use this endpoint to disable two factor authentication.".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"User password"}},"required":["password"]}}}})),responses:[("200".into(),json!({"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("anonymous","/sign-in/anonymous")=>OpenApiEndpoint{operation_id:None,description:Some("Sign in anonymously".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Sign in anonymously","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"session":{"$ref":"#/components/schemas/Session"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("anonymous","/delete-anonymous-user")=>OpenApiEndpoint{operation_id:None,description:Some("Delete an anonymous user".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Anonymous user deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}})),("400".into(),json!({"description":"Anonymous user deletion is disabled","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"required":["message"]}}})),("500".into(),json!({"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("jwt","/jwks")=>OpenApiEndpoint{operation_id:Some("getJSONWebKeySet".into()),description:Some("Get the JSON Web Key Set".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"JSON Web Key Set retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","description":"Array of public JSON Web Keys","items":{"type":"object","properties":{"kid":{"type":"string","description":"Key ID uniquely identifying the key, corresponds to the 'id' from the stored Jwk"},"kty":{"type":"string","description":"Key type (e.g., 'RSA', 'EC', 'OKP')"},"alg":{"type":"string","description":"Algorithm intended for use with the key (e.g., 'EdDSA', 'RS256')"},"use":{"type":"string","description":"Intended use of the public key (e.g., 'sig' for signature)","enum":["sig"],"nullable":true},"n":{"type":"string","description":"Modulus for RSA keys (base64url-encoded)","nullable":true},"e":{"type":"string","description":"Exponent for RSA keys (base64url-encoded)","nullable":true},"crv":{"type":"string","description":"Curve name for elliptic curve keys (e.g., 'Ed25519', 'P-256')","nullable":true},"x":{"type":"string","description":"X coordinate for elliptic curve keys (base64url-encoded)","nullable":true},"y":{"type":"string","description":"Y coordinate for elliptic curve keys (base64url-encoded)","nullable":true}},"required":["kid","kty","alg"]}}},"required":["keys"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("jwt","/token")=>OpenApiEndpoint{operation_id:Some("getJSONWebToken".into()),description:Some("Get a JWT token".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("one-time-token","/one-time-token/generate")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:None,responses:[].into_iter().collect(),server_only:false,..Default::default()},
("one-time-token","/one-time-token/verify")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The token to verify. Eg: \"some-token\""}},"required":["token"]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("one-tap","/one-tap/callback")=>OpenApiEndpoint{operation_id:None,description:Some("Use this endpoint to authenticate with Google One Tap".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"idToken":{"type":"string","description":"Google ID token, which the client obtains from the One Tap API"},"callbackURL":{"type":"string","description":"URL to redirect to after a successful sign-in"}},"required":["idToken"]}}}})),responses:[("200".into(),json!({"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}}}})),("400".into(),json!({"description":"Invalid token"}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/email-otp/send-verification-otp")=>OpenApiEndpoint{operation_id:Some("sendEmailVerificationOTP".into()),description:Some("Send a verification OTP to an email".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address to send the OTP"},"type":{"type":"string","enum":["email-verification","sign-in","forget-password","change-email"],"description":"Type of the OTP"}},"required":["email","type"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/email-otp/check-verification-otp")=>OpenApiEndpoint{operation_id:Some("verifyEmailWithOTP".into()),description:Some("Verify an email with an OTP".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address the OTP was sent to"},"type":{"type":"string","enum":["email-verification","sign-in","forget-password","change-email"],"description":"Type of the OTP"},"otp":{"type":"string","description":"OTP to verify"}},"required":["email","type","otp"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/email-otp/verify-email")=>OpenApiEndpoint{operation_id:None,description:Some("Verify email with OTP".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address to verify"},"otp":{"type":"string","description":"OTP to verify"}},"required":["email","otp"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if the verification was successful","enum":[true]},"token":{"type":"string","nullable":true,"description":"Session token if autoSignInAfterVerification is enabled, otherwise null"},"user":{"$ref":"#/components/schemas/User"}},"required":["status","token","user"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/sign-in/email-otp")=>OpenApiEndpoint{operation_id:Some("signInWithEmailOTP".into()),description:Some("Sign in with email and OTP".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address to sign in"},"otp":{"type":"string","description":"OTP sent to the email"},"name":{"type":"string","description":"User display name. Only used if the user is registering for the first time. Eg: \"my-name\""},"image":{"type":"string","description":"User profile image URL. Only used if the user is registering for the first time."}},"required":["email","otp"],"additionalProperties":{},"propertyNames":{"type":"string"}}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"Session token for the authenticated session"},"user":{"$ref":"#/components/schemas/User"}},"required":["token","user"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/email-otp/request-password-reset")=>OpenApiEndpoint{operation_id:Some("requestPasswordResetWithEmailOTP".into()),description:Some("Request password reset with email and OTP".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address to send the OTP"}},"required":["email"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the OTP was sent successfully"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/forget-password/email-otp")=>OpenApiEndpoint{operation_id:Some("forgetPasswordWithEmailOTP".into()),description:Some("Deprecated: Use /email-otp/request-password-reset instead.".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address to send the OTP"}},"required":["email"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the OTP was sent successfully"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/email-otp/reset-password")=>OpenApiEndpoint{operation_id:Some("resetPasswordWithEmailOTP".into()),description:Some("Reset password with email and OTP".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address to reset the password"},"otp":{"type":"string","description":"OTP sent to the email"},"password":{"type":"string","description":"New password"}},"required":["email","otp","password"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/email-otp/request-email-change")=>OpenApiEndpoint{operation_id:Some("requestEmailChangeWithEmailOTP".into()),description:Some("Request email change with verification OTP sent to the new email".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newEmail":{"type":"string","description":"New email address to send the OTP"},"otp":{"type":"string"}},"required":["newEmail"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("email-otp","/email-otp/change-email")=>OpenApiEndpoint{operation_id:Some("changeEmailWithEmailOTP".into()),description:Some("Verify new email with OTP and change the email if verification is successful".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newEmail":{"type":"string","description":"New email address to verify and change to"},"otp":{"type":"string","description":"OTP sent to the new email"}},"required":["newEmail","otp"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("magic-link","/sign-in/magic-link")=>OpenApiEndpoint{operation_id:Some("signInWithMagicLink".into()),description:Some("Sign in with magic link".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address to send the magic link"},"name":{"type":"string","description":"User display name. Only used if the user is registering for the first time. Eg: \"my-name\""},"callbackURL":{"type":"string","description":"URL to redirect after magic link verification"},"newUserCallbackURL":{"type":"string","description":"URL to redirect after new user signup. Only used if the user is registering for the first time."},"errorCallbackURL":{"type":"string","description":"URL to redirect after error."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Additional metadata to pass to sendMagicLink."}},"required":["email"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("magic-link","/magic-link/verify")=>OpenApiEndpoint{operation_id:Some("verifyMagicLink".into()),description:Some("Verify magic link".into()),tags:None,parameters:vec![json!({"name":"token","in":"query","schema":{"type":"string","description":"Verification token"}}),json!({"name":"callbackURL","in":"query","schema":{"type":"string","description":"URL to redirect after magic link verification, if not provided the user will be redirected to the root URL. Eg: \"/dashboard\""}}),json!({"name":"errorCallbackURL","in":"query","schema":{"type":"string","description":"URL to redirect after error."}}),json!({"name":"newUserCallbackURL","in":"query","schema":{"type":"string","description":"URL to redirect after new user signup. Only used if the user is registering for the first time."}})],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("phone-number","/sign-in/phone-number")=>OpenApiEndpoint{operation_id:None,description:Some("Use this endpoint to sign in with phone number".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"Phone number to sign in. Eg: \"+1234567890\""},"password":{"type":"string","description":"Password to use for sign in."},"rememberMe":{"type":"boolean","description":"Remember the session. Eg: true"}},"required":["phoneNumber","password"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"session":{"$ref":"#/components/schemas/Session"}}}}}})),("400".into(),json!({"description":"Invalid phone number or password"}))].into_iter().collect(),server_only:false,..Default::default()},
("phone-number","/phone-number/send-otp")=>OpenApiEndpoint{operation_id:None,description:Some("Use this endpoint to send OTP to phone number".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"Phone number to send OTP. Eg: \"+1234567890\""}},"required":["phoneNumber"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("phone-number","/phone-number/verify")=>OpenApiEndpoint{operation_id:None,description:Some("Use this endpoint to verify phone number".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneNumber":{"type":"string","description":"Phone number to verify. Eg: \"+1234567890\""},"code":{"type":"string","description":"OTP code. Eg: \"123456\""},"disableSession":{"type":"boolean","description":"Disable session creation after verification. Eg: false"},"updatePhoneNumber":{"type":"boolean","description":"Check if there is a session and update the phone number. Eg: true"}},"required":["phoneNumber","code"],"additionalProperties":{},"propertyNames":{"type":"string"}}}}})),responses:[("200".into(),json!({"description":"Phone number verified successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if the verification was successful","enum":[true]},"token":{"type":"string","nullable":true,"description":"Session token if session is created, null if disableSession is true or no session is created"},"user":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"Unique identifier of the user"},"email":{"type":"string","format":"email","nullable":true,"description":"User's email address"},"emailVerified":{"type":"boolean","nullable":true,"description":"Whether the email is verified"},"name":{"type":"string","nullable":true,"description":"User's name"},"image":{"type":"string","format":"uri","nullable":true,"description":"User's profile image URL"},"phoneNumber":{"type":"string","description":"User's phone number"},"phoneNumberVerified":{"type":"boolean","description":"Whether the phone number is verified"},"createdAt":{"type":"string","format":"date-time","description":"Timestamp when the user was created"},"updatedAt":{"type":"string","format":"date-time","description":"Timestamp when the user was last updated"}},"required":["id","phoneNumber","phoneNumberVerified","createdAt","updatedAt"],"description":"User object with phone number details, null if no user is created or found"}},"required":["status"]}}}})),("400".into(),json!({"description":"Invalid OTP"}))].into_iter().collect(),server_only:false,..Default::default()},
("phone-number","/phone-number/request-password-reset")=>OpenApiEndpoint{operation_id:None,description:Some("Request OTP for password reset via phone number".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"phoneNumber":{"type":"string"}},"required":["phoneNumber"]}}}})),responses:[("200".into(),json!({"description":"OTP sent successfully for password reset","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if the OTP was sent successfully","enum":[true]}},"required":["status"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("phone-number","/phone-number/reset-password")=>OpenApiEndpoint{operation_id:None,description:Some("Reset password using phone number OTP".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"otp":{"type":"string","description":"The one time password to reset the password. Eg: \"123456\""},"phoneNumber":{"type":"string","description":"The phone number to the account which intends to reset the password for. Eg: \"+1234567890\""},"newPassword":{"type":"string","description":"The new password. Eg: \"new-and-secure-password\""}},"required":["otp","phoneNumber","newPassword"]}}}})),responses:[("200".into(),json!({"description":"Password reset successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates if the password was reset successfully","enum":[true]}},"required":["status"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("device-authorization","/device/code")=>OpenApiEndpoint{operation_id:None,description:Some("Request a device and user code\n\nFollow [rfc8628#section-3.2](https://datatracker.ietf.org/doc/html/rfc8628#section-3.2)".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","description":"The client ID of the application"},"user_id":{"type":"string","description":"The user ID to which the device code should be pre-bound."},"scope":{"type":"string","description":"Space-separated list of scopes"}},"required":["client_id"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"device_code":{"type":"string","description":"The device verification code"},"user_code":{"type":"string","description":"The user code to display"},"verification_uri":{"type":"string","format":"uri","description":"The URL for user verification. Defaults to /device if not configured."},"verification_uri_complete":{"type":"string","format":"uri","description":"The complete URL with user code as query parameter."},"expires_in":{"type":"number","description":"Lifetime in seconds of the device code"},"interval":{"type":"number","description":"Minimum polling interval in seconds"}}}}}})),("400".into(),json!({"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["invalid_request","invalid_client","unauthorized_client","invalid_scope"]},"error_description":{"type":"string"}}}}}})),("500".into(),json!({"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["server_error"]},"error_description":{"type":"string"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("device-authorization","/device/token")=>OpenApiEndpoint{operation_id:None,description:Some("Exchange device code for access token\n\nFollow [rfc8628#section-3.4](https://datatracker.ietf.org/doc/html/rfc8628#section-3.4)".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grant_type":{"enum":["urn:ietf:params:oauth:grant-type:device_code"],"description":"The grant type for device flow"},"device_code":{"type":"string","description":"The device verification code"},"client_id":{"type":"string","description":"The client ID of the application"}},"required":["grant_type","device_code","client_id"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}}}})),("400".into(),json!({"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["authorization_pending","slow_down","expired_token","access_denied","invalid_request","invalid_grant"]},"error_description":{"type":"string"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("device-authorization","/device")=>OpenApiEndpoint{operation_id:None,description:Some("Verify user code and get device authorization status".into()),tags:None,parameters:vec![json!({"name":"user_code","in":"query","schema":{"type":"string","description":"The user code to verify"}})],request_body:None,responses:[("200".into(),json!({"description":"Device authorization status","content":{"application/json":{"schema":{"type":"object","properties":{"user_code":{"type":"string","description":"The user code to verify"},"status":{"type":"string","enum":["pending","approved","denied"],"description":"Current status of the device authorization"},"client_id":{"type":"string","description":"The client requesting authorization, returned only to the authenticated user who owns this request"},"scope":{"type":"string","description":"The requested scopes, returned only to the authenticated user who owns this request"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("device-authorization","/device/approve")=>OpenApiEndpoint{operation_id:None,description:Some("Approve device authorization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userCode":{"type":"string","description":"The user code to approve"}},"required":["userCode"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("device-authorization","/device/deny")=>OpenApiEndpoint{operation_id:None,description:Some("Deny device authorization".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userCode":{"type":"string","description":"The user code to deny"}},"required":["userCode"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("siwe","/siwe/nonce")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("siwe","/siwe/get-nonce")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("siwe","/siwe/verify")=>OpenApiEndpoint{operation_id:None,description:None,tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1},"signature":{"type":"string","minLength":1},"email":{"type":"string"}},"required":["message","signature"]}}}})),responses:[].into_iter().collect(),server_only:false,..Default::default()},
("api-key","/api-key/create")=>OpenApiEndpoint{operation_id:None,description:Some("Create a new API key for a user".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"configId":{"type":"string","description":"The configuration ID to use for the API key. If not provided, the default configuration will be used."},"name":{"type":"string","description":"Name of the Api Key"},"expiresIn":{"type":["number","null"],"description":"Expiration time of the Api Key in seconds"},"prefix":{"type":"string","description":"Prefix of the Api Key"},"remaining":{"type":["number","null"],"description":"Remaining number of requests. Server side only"},"metadata":{},"refillAmount":{"type":"number","description":"Amount to refill the remaining count of the Api Key. server-only. Eg: 100"},"refillInterval":{"type":"number","description":"Interval to refill the Api Key in milliseconds. server-only. Eg: 1000"},"rateLimitTimeWindow":{"type":"number","description":"The duration in milliseconds where each request is counted. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 1000"},"rateLimitMax":{"type":"number","description":"Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled. server-only. Eg: true"},"permissions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Permissions of the Api Key."},"userId":{"type":"string","description":"User Id of the user that the Api Key belongs to. server-only. Eg: \"user-id\""},"organizationId":{"type":"string","description":"Organization Id of the organization that the Api Key belongs to. Eg: 'org-id'"}}}}}})),responses:[("200".into(),json!({"description":"API key created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the API key"},"createdAt":{"type":"string","format":"date-time","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"date-time","description":"Last update timestamp"},"name":{"type":"string","nullable":true,"description":"Name of the API key"},"prefix":{"type":"string","nullable":true,"description":"Prefix of the API key"},"start":{"type":"string","nullable":true,"description":"Starting characters of the key (if configured)"},"key":{"type":"string","description":"The full API key (only returned on creation)"},"enabled":{"type":"boolean","description":"Whether the key is enabled"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Expiration timestamp"},"referenceId":{"type":"string","description":"ID of the reference owning the key"},"lastRefillAt":{"type":"string","format":"date-time","nullable":true,"description":"Last refill timestamp"},"lastRequest":{"type":"string","format":"date-time","nullable":true,"description":"Last request timestamp"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"description":"Metadata associated with the key"},"rateLimitMax":{"type":"number","nullable":true,"description":"Maximum requests in time window"},"rateLimitTimeWindow":{"type":"number","nullable":true,"description":"Rate limit time window in milliseconds"},"remaining":{"type":"number","nullable":true,"description":"Remaining requests"},"refillAmount":{"type":"number","nullable":true,"description":"Amount to refill"},"refillInterval":{"type":"number","nullable":true,"description":"Refill interval in milliseconds"},"rateLimitEnabled":{"type":"boolean","description":"Whether rate limiting is enabled"},"requestCount":{"type":"number","description":"Current request count in window"},"permissions":{"type":"object","nullable":true,"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Permissions associated with the key"}},"required":["id","createdAt","updatedAt","key","enabled","referenceId","rateLimitEnabled","requestCount"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("api-key","/api-key/get")=>OpenApiEndpoint{operation_id:None,description:Some("Retrieve an existing API key by ID".into()),tags:None,parameters:vec![json!({"name":"configId","in":"query","schema":{"type":"string","description":"The configuration ID to use for the API key lookup. If not provided, the default configuration will be used."}}),json!({"name":"id","in":"query","schema":{"type":"string","description":"The id of the Api Key"}})],request_body:None,responses:[("200".into(),json!({"description":"API key retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID"},"name":{"type":"string","nullable":true,"description":"The name of the key"},"start":{"type":"string","nullable":true,"description":"Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."},"prefix":{"type":"string","nullable":true,"description":"The API Key prefix. Stored as plain text."},"userId":{"type":"string","description":"The owner of the user id"},"refillInterval":{"type":"number","nullable":true,"description":"The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"},"refillAmount":{"type":"number","nullable":true,"description":"The amount to refill"},"lastRefillAt":{"type":"string","format":"date-time","nullable":true,"description":"The last refill date"},"enabled":{"type":"boolean","description":"Sets if key is enabled or disabled","default":true},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled"},"rateLimitTimeWindow":{"type":"number","nullable":true,"description":"The duration in milliseconds"},"rateLimitMax":{"type":"number","nullable":true,"description":"Maximum amount of requests allowed within a window"},"requestCount":{"type":"number","description":"The number of requests made within the rate limit time window"},"remaining":{"type":"number","nullable":true,"description":"Remaining requests (every time api key is used this should updated and should be updated on refill as well)"},"lastRequest":{"type":"string","format":"date-time","nullable":true,"description":"When last request occurred"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Expiry date of a key"},"createdAt":{"type":"string","format":"date-time","description":"created at"},"updatedAt":{"type":"string","format":"date-time","description":"updated at"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"description":"Extra metadata about the apiKey"},"permissions":{"type":"string","nullable":true,"description":"Permissions for the api key (stored as JSON string)"}},"required":["id","userId","enabled","rateLimitEnabled","requestCount","createdAt","updatedAt"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("api-key","/api-key/update")=>OpenApiEndpoint{operation_id:None,description:Some("Update an existing API key by ID".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"configId":{"type":"string","description":"The configuration ID to use for the API key lookup. If not provided, the default configuration will be used."},"keyId":{"type":"string","description":"The id of the Api Key"},"userId":{"type":"string","description":"The id of the user which the api key belongs to. server-only. Eg: \"some-user-id\""},"name":{"type":"string","description":"The name of the key"},"enabled":{"type":"boolean","description":"Whether the Api Key is enabled or not"},"remaining":{"type":"number","description":"The number of remaining requests"},"refillAmount":{"type":"number","description":"The refill amount"},"refillInterval":{"type":"number","description":"The refill interval"},"metadata":{},"expiresIn":{"type":["number","null"],"description":"Expiration time of the Api Key in seconds"},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled."},"rateLimitTimeWindow":{"type":"number","description":"The duration in milliseconds where each request is counted. server-only. Eg: 1000"},"rateLimitMax":{"type":"number","description":"Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. server-only. Eg: 100"},"permissions":{"type":["object","null"],"propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Update the permissions on the API Key. server-only."}},"required":["keyId"]}}}})),responses:[("200".into(),json!({"description":"API key updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"ID"},"name":{"type":"string","nullable":true,"description":"The name of the key"},"start":{"type":"string","nullable":true,"description":"Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."},"prefix":{"type":"string","nullable":true,"description":"The API Key prefix. Stored as plain text."},"userId":{"type":"string","description":"The owner of the user id"},"refillInterval":{"type":"number","nullable":true,"description":"The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"},"refillAmount":{"type":"number","nullable":true,"description":"The amount to refill"},"lastRefillAt":{"type":"string","format":"date-time","nullable":true,"description":"The last refill date"},"enabled":{"type":"boolean","description":"Sets if key is enabled or disabled","default":true},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled"},"rateLimitTimeWindow":{"type":"number","nullable":true,"description":"The duration in milliseconds"},"rateLimitMax":{"type":"number","nullable":true,"description":"Maximum amount of requests allowed within a window"},"requestCount":{"type":"number","description":"The number of requests made within the rate limit time window"},"remaining":{"type":"number","nullable":true,"description":"Remaining requests (every time api key is used this should updated and should be updated on refill as well)"},"lastRequest":{"type":"string","format":"date-time","nullable":true,"description":"When last request occurred"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Expiry date of a key"},"createdAt":{"type":"string","format":"date-time","description":"created at"},"updatedAt":{"type":"string","format":"date-time","description":"updated at"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"description":"Extra metadata about the apiKey"},"permissions":{"type":"string","nullable":true,"description":"Permissions for the api key (stored as JSON string)"}},"required":["id","userId","enabled","rateLimitEnabled","requestCount","createdAt","updatedAt"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("api-key","/api-key/delete")=>OpenApiEndpoint{operation_id:None,description:Some("Delete an existing API key".into()),tags:None,parameters:vec![],request_body:Some(json!({"content":{"application/json":{"schema":{"type":"object","properties":{"keyId":{"type":"string","description":"The id of the API key to delete"}},"required":["keyId"]}}}})),responses:[("200".into(),json!({"description":"API key deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the API key was successfully deleted"}},"required":["success"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("api-key","/api-key/list")=>OpenApiEndpoint{operation_id:None,description:Some("List all API keys for the authenticated user or for a specific organization".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"API keys retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"ID"},"name":{"type":"string","nullable":true,"description":"The name of the key"},"start":{"type":"string","nullable":true,"description":"Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key."},"prefix":{"type":"string","nullable":true,"description":"The API Key prefix. Stored as plain text."},"userId":{"type":"string","description":"The owner of the user id"},"refillInterval":{"type":"number","nullable":true,"description":"The interval in milliseconds between refills of the `remaining` count. Example: 3600000 // refill every hour (3600000ms = 1h)"},"refillAmount":{"type":"number","nullable":true,"description":"The amount to refill"},"lastRefillAt":{"type":"string","format":"date-time","nullable":true,"description":"The last refill date"},"enabled":{"type":"boolean","description":"Sets if key is enabled or disabled","default":true},"rateLimitEnabled":{"type":"boolean","description":"Whether the key has rate limiting enabled"},"rateLimitTimeWindow":{"type":"number","nullable":true,"description":"The duration in milliseconds"},"rateLimitMax":{"type":"number","nullable":true,"description":"Maximum amount of requests allowed within a window"},"requestCount":{"type":"number","description":"The number of requests made within the rate limit time window"},"remaining":{"type":"number","nullable":true,"description":"Remaining requests (every time api key is used this should updated and should be updated on refill as well)"},"lastRequest":{"type":"string","format":"date-time","nullable":true,"description":"When last request occurred"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Expiry date of a key"},"createdAt":{"type":"string","format":"date-time","description":"created at"},"updatedAt":{"type":"string","format":"date-time","description":"updated at"},"metadata":{"type":"object","nullable":true,"additionalProperties":true,"description":"Extra metadata about the apiKey"},"permissions":{"type":"string","nullable":true,"description":"Permissions for the api key (stored as JSON string)"}},"required":["id","userId","enabled","rateLimitEnabled","requestCount","createdAt","updatedAt"]}},"total":{"type":"number","description":"Total number of API keys"},"limit":{"type":"number","nullable":true,"description":"The limit used for pagination"},"offset":{"type":"number","nullable":true,"description":"The offset used for pagination"}},"required":["apiKeys","total"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("passkey","/passkey/generate-register-options")=>OpenApiEndpoint{operation_id:Some("generatePasskeyRegistrationOptions".into()),description:Some("Generate registration options for a new passkey".into()),tags:None,parameters:vec![json!({"name":"authenticatorAttachment","in":"query","required":false,"description":"Type of authenticator to use for registration.\n                          \"platform\" for device-specific authenticators,\n                          \"cross-platform\" for authenticators that can be used across devices.","schema":{"type":"string","enum":["platform","cross-platform"]}}),json!({"name":"name","in":"query","required":false,"description":"Optional custom name for the passkey.\n                          This can help identify the passkey when managing multiple credentials.","schema":{"type":"string"}}),json!({"name":"context","in":"query","required":false,"description":"Optional context for passkey-first registration flows.","schema":{"type":"string"}})],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string"},"rp":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"}}},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"displayName":{"type":"string"}}},"pubKeyCredParams":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"alg":{"type":"number"}}}},"timeout":{"type":"number"},"excludeCredentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"transports":{"type":"array","items":{"type":"string"}}}}},"authenticatorSelection":{"type":"object","properties":{"authenticatorAttachment":{"type":"string"},"requireResidentKey":{"type":"boolean"},"userVerification":{"type":"string"}}},"attestation":{"type":"string"},"extensions":{"type":"object"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("passkey","/passkey/generate-authenticate-options")=>OpenApiEndpoint{operation_id:Some("passkeyGenerateAuthenticateOptions".into()),description:Some("Generate authentication options for a passkey".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string"},"rp":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"}}},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"displayName":{"type":"string"}}},"timeout":{"type":"number"},"allowCredentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"transports":{"type":"array","items":{"type":"string"}}}}},"userVerification":{"type":"string"},"authenticatorSelection":{"type":"object","properties":{"authenticatorAttachment":{"type":"string"},"requireResidentKey":{"type":"boolean"},"userVerification":{"type":"string"}}},"extensions":{"type":"object"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("passkey","/passkey/verify-registration")=>OpenApiEndpoint{operation_id:Some("passkeyVerifyRegistration".into()),description:Some("Verify registration of a new passkey".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response":{},"name":{"type":"string","description":"Name of the passkey"},"createSession":{"type":"boolean","description":"Create a session after registering the passkey"}},"required":["response"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","allOf":[{"$ref":"#/components/schemas/Passkey"},{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}]}}}})),("400".into(),json!({"description":"Bad request"}))].into_iter().collect(),server_only:false,..Default::default()},
("passkey","/passkey/verify-authentication")=>OpenApiEndpoint{operation_id:Some("passkeyVerifyAuthentication".into()),description:Some("Verify authentication of a passkey".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"object","propertyNames":{},"additionalProperties":{}}},"required":["response"]}}}})),responses:[("200".into(),json!({"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/Session"},"user":{"$ref":"#/components/schemas/User"}}}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("passkey","/passkey/list-user-passkeys")=>OpenApiEndpoint{operation_id:None,description:Some("List all passkeys for the authenticated user".into()),tags:None,parameters:vec![],request_body:None,responses:[("200".into(),json!({"description":"Passkeys retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Passkey","required":["id","userId","publicKey","createdAt","updatedAt"]},"description":"Array of passkey objects associated with the user"}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("passkey","/passkey/delete-passkey")=>OpenApiEndpoint{operation_id:None,description:Some("Delete a specific passkey".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the passkey to delete. Eg: \"some-passkey-id\""}},"required":["id"]}}}})),responses:[("200".into(),json!({"description":"Passkey deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"boolean","description":"Indicates whether the deletion was successful"}},"required":["status"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
("passkey","/passkey/update-passkey")=>OpenApiEndpoint{operation_id:None,description:Some("Update a specific passkey's name".into()),tags:None,parameters:vec![],request_body:Some(json!({"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the passkey which will be updated. Eg: \"passkey-id\""},"name":{"type":"string","minLength":1,"description":"The new name which the passkey will be updated to. Eg: \"my-new-passkey-name\""}},"required":["id","name"]}}}})),responses:[("200".into(),json!({"description":"Passkey updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"passkey":{"$ref":"#/components/schemas/Passkey"}},"required":["passkey"]}}}}))].into_iter().collect(),server_only:false,..Default::default()},
_=>return None,})
}