// @generated by protoc-gen-es v2.11.0 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("ChlhcGkvdjEvYXV0aF9zZXJ2aWNlLnByb3RvEgxtZW1vcy5hcGkudjEiFwoVR2V0Q3VycmVudFVzZXJSZXF1ZXN0IjoKFkdldEN1cnJlbnRVc2VyUmVzcG9uc2USIAoEdXNlchgBIAEoCzISLm1lbW9zLmFwaS52MS5Vc2VyIu4CCg1TaWduSW5SZXF1ZXN0Ek8KFHBhc3N3b3JkX2NyZWRlbnRpYWxzGAEgASgLMi8ubWVtb3MuYXBpLnYxLlNpZ25JblJlcXVlc3QuUGFzc3dvcmRDcmVkZW50aWFsc0gAEkUKD3Nzb19jcmVkZW50aWFscxgCIAEoCzIqLm1lbW9zLmFwaS52MS5TaWduSW5SZXF1ZXN0LlNTT0NyZWRlbnRpYWxzSAAaQwoTUGFzc3dvcmRDcmVkZW50aWFscxIVCgh1c2VybmFtZRgBIAEoCUID4EECEhUKCHBhc3N3b3JkGAIgASgJQgPgQQIacQoOU1NPQ3JlZGVudGlhbHMSFQoIaWRwX25hbWUYASABKAlCA+BBAhIRCgRjb2RlGAIgASgJQgPgQQISGQoMcmVkaXJlY3RfdXJpGAMgASgJQgPgQQISGgoNY29kZV92ZXJpZmllch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3VzZW1lbW9zL21lbW9zL3Byb3RvL2dlbi9hcGkvdjE7YXBpdjGiAgNNQViqAgxNZW1vcy5BcGkuVjHKAgxNZW1vc1xBcGlcVjHiAhhNZW1vc1xBcGlcVjFcR1BCTWV0YWRhdGHqAg5NZW1vczo6QXBpOjpWMWIGcHJvdG8z", [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 resource name of the SSO provider.
   * Format: identity-providers/{uid}
   *
   * @generated from field: string idp_name = 1;
   */
  idpName: string;

  /**
   * 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);

