// @generated by protoc-gen-es v2.10.2 with parameter "target=ts"
// @generated from file api/v1/auth_service.proto (package memos.api.v1, syntax proto3)
/* eslint-disable */

import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
import type { User } from "./user_service_pb";
import { file_api_v1_user_service } from "./user_service_pb";
import { file_google_api_annotations } from "../../google/api/annotations_pb";
import { file_google_api_field_behavior } from "../../google/api/field_behavior_pb";
import type { EmptySchema, Timestamp } from "@bufbuild/protobuf/wkt";
import { file_google_protobuf_empty, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file api/v1/auth_service.proto.
 */
export const file_api_v1_auth_service: GenFile = /*@__PURE__*/
  fileDesc("ChlhcGkvdjEvYXV0aF9zZXJ2aWNlLnByb3RvEgxtZW1vcy5hcGkudjEiFwoVR2V0Q3VycmVudFVzZXJSZXF1ZXN0IjoKFkdldEN1cnJlbnRVc2VyUmVzcG9uc2USIAoEdXNlchgBIAEoCzISLm1lbW9zLmFwaS52MS5Vc2VyIuwCCg1TaWduSW5SZXF1ZXN0Ek8KFHBhc3N3b3JkX2NyZWRlbnRpYWxzGAEgASgLMi8ubWVtb3MuYXBpLnYxLlNpZ25JblJlcXVlc3QuUGFzc3dvcmRDcmVkZW50aWFsc0gAEkUKD3Nzb19jcmVkZW50aWFscxgCIAEoCzIqLm1lbW9zLmFwaS52MS5TaWduSW5SZXF1ZXN0LlNTT0NyZWRlbnRpYWxzSAAaQwoTUGFzc3dvcmRDcmVkZW50aWFscxIVCgh1c2VybmFtZRgBIAEoCUID4EECEhUKCHBhc3N3b3JkGAIgASgJQgPgQQIabwoOU1NPQ3JlZGVudGlhbHMSEwoGaWRwX2lkGAEgASgFQgPgQQISEQoEY29kZRgCIAEoCUID4EECEhkKDHJlZGlyZWN0X3VyaRgDIAEoCUID4EECEhoKDWNvZGVfdmVyaWZpZXI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ZW1vcy9tZW1vcy9wcm90by9nZW4vYXBpL3YxO2FwaXYxogIDTUFYqgIMTWVtb3MuQXBpLlYxygIMTWVtb3NcQXBpXFYx4gIYTWVtb3NcQXBpXFYxXEdQQk1ldGFkYXRh6gIOTWVtb3M6OkFwaTo6VjFiBnByb3RvMw", [file_api_v1_user_service, file_google_api_annotations, file_google_api_field_behavior, file_google_protobuf_empty, file_google_protobuf_timestamp]);

/**
 * @generated from message memos.api.v1.GetCurrentUserRequest
 */
export type GetCurrentUserRequest = Message<"memos.api.v1.GetCurrentUserRequest"> & {
};

/**
 * Describes the message memos.api.v1.GetCurrentUserRequest.
 * Use `create(GetCurrentUserRequestSchema)` to create a new message.
 */
export const GetCurrentUserRequestSchema: GenMessage<GetCurrentUserRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 0);

/**
 * @generated from message memos.api.v1.GetCurrentUserResponse
 */
export type GetCurrentUserResponse = Message<"memos.api.v1.GetCurrentUserResponse"> & {
  /**
   * The authenticated user's information.
   *
   * @generated from field: memos.api.v1.User user = 1;
   */
  user?: User;
};

/**
 * Describes the message memos.api.v1.GetCurrentUserResponse.
 * Use `create(GetCurrentUserResponseSchema)` to create a new message.
 */
export const GetCurrentUserResponseSchema: GenMessage<GetCurrentUserResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 1);

/**
 * @generated from message memos.api.v1.SignInRequest
 */
export type SignInRequest = Message<"memos.api.v1.SignInRequest"> & {
  /**
   * Authentication credentials. Provide one method.
   *
   * @generated from oneof memos.api.v1.SignInRequest.credentials
   */
  credentials: {
    /**
     * Username and password authentication.
     *
     * @generated from field: memos.api.v1.SignInRequest.PasswordCredentials password_credentials = 1;
     */
    value: SignInRequest_PasswordCredentials;
    case: "passwordCredentials";
  } | {
    /**
     * SSO provider authentication.
     *
     * @generated from field: memos.api.v1.SignInRequest.SSOCredentials sso_credentials = 2;
     */
    value: SignInRequest_SSOCredentials;
    case: "ssoCredentials";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message memos.api.v1.SignInRequest.
 * Use `create(SignInRequestSchema)` to create a new message.
 */
export const SignInRequestSchema: GenMessage<SignInRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 2);

/**
 * Nested message for password-based authentication credentials.
 *
 * @generated from message memos.api.v1.SignInRequest.PasswordCredentials
 */
export type SignInRequest_PasswordCredentials = Message<"memos.api.v1.SignInRequest.PasswordCredentials"> & {
  /**
   * The username to sign in with.
   *
   * @generated from field: string username = 1;
   */
  username: string;

  /**
   * The password to sign in with.
   *
   * @generated from field: string password = 2;
   */
  password: string;
};

/**
 * Describes the message memos.api.v1.SignInRequest.PasswordCredentials.
 * Use `create(SignInRequest_PasswordCredentialsSchema)` to create a new message.
 */
export const SignInRequest_PasswordCredentialsSchema: GenMessage<SignInRequest_PasswordCredentials> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 2, 0);

/**
 * Nested message for SSO authentication credentials.
 *
 * @generated from message memos.api.v1.SignInRequest.SSOCredentials
 */
export type SignInRequest_SSOCredentials = Message<"memos.api.v1.SignInRequest.SSOCredentials"> & {
  /**
   * The ID of the SSO provider.
   *
   * @generated from field: int32 idp_id = 1;
   */
  idpId: number;

  /**
   * The authorization code from the SSO provider.
   *
   * @generated from field: string code = 2;
   */
  code: string;

  /**
   * The redirect URI used in the SSO flow.
   *
   * @generated from field: string redirect_uri = 3;
   */
  redirectUri: string;

  /**
   * The PKCE code verifier for enhanced security (RFC 7636).
   * Optional - enables PKCE flow protection against authorization code interception.
   *
   * @generated from field: string code_verifier = 4;
   */
  codeVerifier: string;
};

/**
 * Describes the message memos.api.v1.SignInRequest.SSOCredentials.
 * Use `create(SignInRequest_SSOCredentialsSchema)` to create a new message.
 */
export const SignInRequest_SSOCredentialsSchema: GenMessage<SignInRequest_SSOCredentials> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 2, 1);

/**
 * @generated from message memos.api.v1.SignInResponse
 */
export type SignInResponse = Message<"memos.api.v1.SignInResponse"> & {
  /**
   * The authenticated user's information.
   *
   * @generated from field: memos.api.v1.User user = 1;
   */
  user?: User;

  /**
   * The short-lived access token for API requests.
   * Store in memory only, not in localStorage.
   *
   * @generated from field: string access_token = 2;
   */
  accessToken: string;

  /**
   * When the access token expires.
   * Client should call RefreshToken before this time.
   *
   * @generated from field: google.protobuf.Timestamp access_token_expires_at = 3;
   */
  accessTokenExpiresAt?: Timestamp;
};

/**
 * Describes the message memos.api.v1.SignInResponse.
 * Use `create(SignInResponseSchema)` to create a new message.
 */
export const SignInResponseSchema: GenMessage<SignInResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 3);

/**
 * @generated from message memos.api.v1.SignOutRequest
 */
export type SignOutRequest = Message<"memos.api.v1.SignOutRequest"> & {
};

/**
 * Describes the message memos.api.v1.SignOutRequest.
 * Use `create(SignOutRequestSchema)` to create a new message.
 */
export const SignOutRequestSchema: GenMessage<SignOutRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 4);

/**
 * @generated from message memos.api.v1.RefreshTokenRequest
 */
export type RefreshTokenRequest = Message<"memos.api.v1.RefreshTokenRequest"> & {
};

/**
 * Describes the message memos.api.v1.RefreshTokenRequest.
 * Use `create(RefreshTokenRequestSchema)` to create a new message.
 */
export const RefreshTokenRequestSchema: GenMessage<RefreshTokenRequest> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 5);

/**
 * @generated from message memos.api.v1.RefreshTokenResponse
 */
export type RefreshTokenResponse = Message<"memos.api.v1.RefreshTokenResponse"> & {
  /**
   * The new short-lived access token.
   *
   * @generated from field: string access_token = 1;
   */
  accessToken: string;

  /**
   * When the access token expires.
   *
   * @generated from field: google.protobuf.Timestamp expires_at = 2;
   */
  expiresAt?: Timestamp;
};

/**
 * Describes the message memos.api.v1.RefreshTokenResponse.
 * Use `create(RefreshTokenResponseSchema)` to create a new message.
 */
export const RefreshTokenResponseSchema: GenMessage<RefreshTokenResponse> = /*@__PURE__*/
  messageDesc(file_api_v1_auth_service, 6);

/**
 * @generated from service memos.api.v1.AuthService
 */
export const AuthService: GenService<{
  /**
   * GetCurrentUser returns the authenticated user's information.
   * Validates the access token and returns user details.
   * Similar to OIDC's /userinfo endpoint.
   *
   * @generated from rpc memos.api.v1.AuthService.GetCurrentUser
   */
  getCurrentUser: {
    methodKind: "unary";
    input: typeof GetCurrentUserRequestSchema;
    output: typeof GetCurrentUserResponseSchema;
  },
  /**
   * SignIn authenticates a user with credentials and returns tokens.
   * On success, returns an access token and sets a refresh token cookie.
   * Supports password-based and SSO authentication methods.
   *
   * @generated from rpc memos.api.v1.AuthService.SignIn
   */
  signIn: {
    methodKind: "unary";
    input: typeof SignInRequestSchema;
    output: typeof SignInResponseSchema;
  },
  /**
   * SignOut terminates the user's authentication.
   * Revokes the refresh token and clears the authentication cookie.
   *
   * @generated from rpc memos.api.v1.AuthService.SignOut
   */
  signOut: {
    methodKind: "unary";
    input: typeof SignOutRequestSchema;
    output: typeof EmptySchema;
  },
  /**
   * RefreshToken exchanges a valid refresh token for a new access token.
   * The refresh token is read from the HttpOnly cookie.
   * Returns a new short-lived access token.
   *
   * @generated from rpc memos.api.v1.AuthService.RefreshToken
   */
  refreshToken: {
    methodKind: "unary";
    input: typeof RefreshTokenRequestSchema;
    output: typeof RefreshTokenResponseSchema;
  },
}> = /*@__PURE__*/
  serviceDesc(file_api_v1_auth_service, 0);

