// @generated by protoc-gen-es v2.10.1 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("ChlhcGkvdjEvYXV0aF9zZXJ2aWNlLnByb3RvEgxtZW1vcy5hcGkudjEiGgoYR2V0Q3VycmVudFNlc3Npb25SZXF1ZXN0InMKGUdldEN1cnJlbnRTZXNzaW9uUmVzcG9uc2USIAoEdXNlchgBIAEoCzISLm1lbW9zLmFwaS52MS5Vc2VyEjQKEGxhc3RfYWNjZXNzZWRfYXQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIoEDChRDcmVhdGVTZXNzaW9uUmVxdWVzdBJWChRwYXNzd29yZF9jcmVkZW50aWFscxgBIAEoCzI2Lm1lbW9zLmFwaS52MS5DcmVhdGVTZXNzaW9uUmVxdWVzdC5QYXNzd29yZENyZWRlbnRpYWxzSAASTAoPc3NvX2NyZWRlbnRpYWxzGAIgASgLMjEubWVtb3MuYXBpLnYxLkNyZWF0ZVNlc3Npb25SZXF1ZXN0LlNTT0NyZWRlbnRpYWxzSAAaQwoTUGFzc3dvcmRDcmVkZW50aWFscxIVCgh1c2VybmFtZRgBIAEoCUID4EECEhUKCHBhc3N3b3JkGAIgASgJQgPgQQIabwoOU1NPQ3JlZGVudGlhbHMSEwoGaWR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waTo6VjFiBnByb3RvMw", [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.GetCurrentSessionRequest
 */
export type GetCurrentSessionRequest = Message<"memos.api.v1.GetCurrentSessionRequest"> & {
};

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

/**
 * @generated from message memos.api.v1.GetCurrentSessionResponse
 */
export type GetCurrentSessionResponse = Message<"memos.api.v1.GetCurrentSessionResponse"> & {
  /**
   * @generated from field: memos.api.v1.User user = 1;
   */
  user?: User;

  /**
   * Last time the session was accessed.
   * Used for sliding expiration calculation (last_accessed_time + 2 weeks).
   *
   * @generated from field: google.protobuf.Timestamp last_accessed_at = 2;
   */
  lastAccessedAt?: Timestamp;
};

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

/**
 * @generated from message memos.api.v1.CreateSessionRequest
 */
export type CreateSessionRequest = Message<"memos.api.v1.CreateSessionRequest"> & {
  /**
   * Provide one authentication method (username/password or SSO).
   * Required field to specify the authentication method.
   *
   * @generated from oneof memos.api.v1.CreateSessionRequest.credentials
   */
  credentials: {
    /**
     * Username and password authentication method.
     *
     * @generated from field: memos.api.v1.CreateSessionRequest.PasswordCredentials password_credentials = 1;
     */
    value: CreateSessionRequest_PasswordCredentials;
    case: "passwordCredentials";
  } | {
    /**
     * SSO provider authentication method.
     *
     * @generated from field: memos.api.v1.CreateSessionRequest.SSOCredentials sso_credentials = 2;
     */
    value: CreateSessionRequest_SSOCredentials;
    case: "ssoCredentials";
  } | { case: undefined; value?: undefined };
};

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

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

  /**
   * The password to sign in with.
   * Required field for password-based authentication.
   *
   * @generated from field: string password = 2;
   */
  password: string;
};

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

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

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

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

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

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

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

  /**
   * Last time the session was accessed.
   * Used for sliding expiration calculation (last_accessed_time + 2 weeks).
   *
   * @generated from field: google.protobuf.Timestamp last_accessed_at = 2;
   */
  lastAccessedAt?: Timestamp;
};

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

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

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

/**
 * @generated from service memos.api.v1.AuthService
 */
export const AuthService: GenService<{
  /**
   * GetCurrentSession returns the current active session information.
   * This method is idempotent and safe, suitable for checking current session state.
   *
   * @generated from rpc memos.api.v1.AuthService.GetCurrentSession
   */
  getCurrentSession: {
    methodKind: "unary";
    input: typeof GetCurrentSessionRequestSchema;
    output: typeof GetCurrentSessionResponseSchema;
  },
  /**
   * CreateSession authenticates a user and creates a new session.
   * Returns the authenticated user information upon successful authentication.
   *
   * @generated from rpc memos.api.v1.AuthService.CreateSession
   */
  createSession: {
    methodKind: "unary";
    input: typeof CreateSessionRequestSchema;
    output: typeof CreateSessionResponseSchema;
  },
  /**
   * DeleteSession terminates the current user session.
   * This is an idempotent operation that invalidates the user's authentication.
   *
   * @generated from rpc memos.api.v1.AuthService.DeleteSession
   */
  deleteSession: {
    methodKind: "unary";
    input: typeof DeleteSessionRequestSchema;
    output: typeof EmptySchema;
  },
}> = /*@__PURE__*/
  serviceDesc(file_api_v1_auth_service, 0);

