// @generated by protoc-gen-es v2.13.0 with parameter "target=ts,import_extension=js"
// @generated from file soulfire/mc-auth.proto (package soulfire.v1, syntax proto3)
/* eslint-disable */

import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
import type { AccountTypeCredentials, AccountTypeDeviceCode, MinecraftAccountProto } from "./common_pb.js";
import { file_soulfire_common } from "./common_pb.js";
import { file_soulfire_api_docs } from "./api_docs_pb.js";
import { file_google_api_annotations } from "../google/api/annotations_pb.js";
import { file_google_api_field_behavior } from "../google/api/field_behavior_pb.js";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file soulfire/mc-auth.proto.
 */
export const file_soulfire_mc_auth: GenFile = /*@__PURE__*/
  fileDesc("ChZzb3VsZmlyZS9tYy1hdXRoLnByb3RvEgtzb3VsZmlyZS52MSKNAQoWQ3JlZGVudGlhbHNBdXRoUmVxdWVzdBIiCgtpbnN0YW5jZV9pZBgBIAEoCUIN4EEC0vMYBgoEdXVpZBI5CgdzZXJ2aWNlGAIgASgOMiMuc291bGZpcmUudjEuQWNjb3VudFR5cGVDcmVkZW50aWFsc0ID4EECEhQKB3BheWxvYWQYAyADKAlCA+BBAiJVChlDcmVkZW50aWFsc0F1dGhPbmVTdWNjZXNzEjgKB2FjY291bnQYASABKAsyIi5zb3VsZmlyZS52MS5NaW5lY3JhZnRBY2NvdW50UHJvdG9CA+BBAiIbChlDcmVkZW50aWFsc0F1dGhPbmVGYWlsdXJlIhQKEkNyZWRlbnRpYWxzQXV0aEVuZCLPAQoXQ3JlZGVudGlhbHNBdXRoUmVzcG9uc2USPQoLb25lX3N1Y2Nlc3MYAiABKAsyJi5zb3VsZmlyZS52MS5DcmVkZW50aWFsc0F1dGhPbmVTdWNjZXNzSAASPQoLb25lX2ZhaWx1cmUYAyABKAsyJi5zb3VsZmlyZS52MS5DcmVkZW50aWFsc0F1dGhPbmVGYWlsdXJlSAASLgoDZW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RFX01DX0FDQ09VTlQiCGluc3RhbmNlMhBTZXJ2ZXIgc3RyZWFtaW5nOjxTdHJlYW1zIHBlci1hY2NvdW50IGF1dGhlbnRpY2F0aW9uIHJlc3VsdHMgYXMgdGhleSBjb21wbGV0ZS4wARKEAgoPTG9naW5EZXZpY2VDb2RlEiIuc291bGZpcmUudjEuRGV2aWNlQ29kZUF1dGhSZXF1ZXN0GiMuc291bGZpcmUudjEuRGV2aWNlQ29kZUF1dGhSZXNwb25zZSKlAcrzGKABCiBTdGFydCBkZXZpY2UtY29kZSBNaW5lY3JhZnQgYXV0aBoXQVVUSEVOVElDQVRFX01DX0FDQ09VTlQiCGluc3RhbmNlMhBTZXJ2ZXIgc3RyZWFtaW5nOkdTdHJlYW1zIGRldmljZS1jb2RlIGluc3RydWN0aW9ucyBmb2xsb3dlZCBieSB0aGUgYXV0aGVudGljYXRlZCBhY2NvdW50LjABEu8BCgdSZWZyZXNoEhsuc291bGZpcmUudjEuUmVmcmVzaFJlcXVlc3QaHC5zb3VsZmlyZS52MS5SZWZyZXNoUmVzcG9uc2UiqAHK8xhuChlSZWZyZXNoIE1pbmVjcmFmdCBhY2NvdW50GhdBVVRIRU5USUNBVEVfTUNfQUNDT1VOVCIIaW5zdGFuY2U6LlJlZnJlc2hlcyB0aGUgYWNjb3VudCdzIGF1dGhlbnRpY2F0aW9uIHRva2Vucy6C0+STAjA6ASoiKy92MS9pbnN0YW5jZXMve2luc3RhbmNlX2lkfS9tYy1hdXRoOnJlZnJlc2hCIQodY29tLnNvdWxmaXJlbWMuZ3JwYy5nZW5lcmF0ZWRQAWIGcHJvdG8z", [file_soulfire_common, file_soulfire_api_docs, file_google_api_annotations, file_google_api_field_behavior]);

/**
 * Request message for credentials-based Minecraft account authentication.
 * Supports bulk authentication of multiple accounts in a single request.
 *
 * @generated from message soulfire.v1.CredentialsAuthRequest
 */
export type CredentialsAuthRequest = Message<"soulfire.v1.CredentialsAuthRequest"> & {
  /**
   * The UUID of the SoulFire instance to authenticate accounts for.
   * Must be a valid UUID string. The instance must exist and the caller
   * must have AUTHENTICATE_MC_ACCOUNT permission for this instance.
   *
   * @generated from field: string instance_id = 1;
   */
  instanceId: string;

  /**
   * The authentication service type to use.
   * Determines how the payload strings are interpreted:
   * - MICROSOFT_JAVA_CREDENTIALS: Payload format is "email:password"
   * - MICROSOFT_BEDROCK_CREDENTIALS: Payload format is "email:password"
   * - OFFLINE: Payload is the username to use (no authentication performed)
   * - MICROSOFT_JAVA_REFRESH_TOKEN: Payload is a Microsoft refresh token
   * - THE_ALTENING: Payload is a TheAltening account token
   *
   * @generated from field: soulfire.v1.AccountTypeCredentials service = 2;
   */
  service: AccountTypeCredentials;

  /**
   * List of authentication credentials/data strings.
   * Each string is processed according to the service type.
   * Multiple payloads are authenticated concurrently (controlled by
   * ACCOUNT_IMPORT_CONCURRENCY instance setting).
   *
   * @generated from field: repeated string payload = 3;
   */
  payload: string[];
};

/**
 * Describes the message soulfire.v1.CredentialsAuthRequest.
 * Use `create(CredentialsAuthRequestSchema)` to create a new message.
 */
export const CredentialsAuthRequestSchema: GenMessage<CredentialsAuthRequest> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 0);

/**
 * Result of a single account authentication attempt.
 * Includes the authenticated account data on success.
 *
 * @generated from message soulfire.v1.CredentialsAuthOneSuccess
 */
export type CredentialsAuthOneSuccess = Message<"soulfire.v1.CredentialsAuthOneSuccess"> & {
  /**
   * The successfully authenticated Minecraft account.
   *
   * @generated from field: soulfire.v1.MinecraftAccountProto account = 1;
   */
  account?: MinecraftAccountProto | undefined;
};

/**
 * Describes the message soulfire.v1.CredentialsAuthOneSuccess.
 * Use `create(CredentialsAuthOneSuccessSchema)` to create a new message.
 */
export const CredentialsAuthOneSuccessSchema: GenMessage<CredentialsAuthOneSuccess> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 1);

/**
 * Result sent when an individual account authentication fails.
 * The failure is logged server-side with detailed error info.
 *
 * @generated from message soulfire.v1.CredentialsAuthOneFailure
 */
export type CredentialsAuthOneFailure = Message<"soulfire.v1.CredentialsAuthOneFailure"> & {
};

/**
 * Describes the message soulfire.v1.CredentialsAuthOneFailure.
 * Use `create(CredentialsAuthOneFailureSchema)` to create a new message.
 */
export const CredentialsAuthOneFailureSchema: GenMessage<CredentialsAuthOneFailure> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 2);

/**
 * Sentinel message indicating that all account authentications have completed.
 * This is the final message sent in the response stream, signaling
 * that no more result messages will follow.
 *
 * @generated from message soulfire.v1.CredentialsAuthEnd
 */
export type CredentialsAuthEnd = Message<"soulfire.v1.CredentialsAuthEnd"> & {
};

/**
 * Describes the message soulfire.v1.CredentialsAuthEnd.
 * Use `create(CredentialsAuthEndSchema)` to create a new message.
 */
export const CredentialsAuthEndSchema: GenMessage<CredentialsAuthEnd> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 3);

/**
 * Streaming response message for credentials-based authentication.
 * Each message contains either a single authentication result or an end marker.
 *
 * @generated from message soulfire.v1.CredentialsAuthResponse
 */
export type CredentialsAuthResponse = Message<"soulfire.v1.CredentialsAuthResponse"> & {
  /**
   * @generated from oneof soulfire.v1.CredentialsAuthResponse.data
   */
  data: {
    /**
     * A single successful authentication result. Multiple of these will be
     * streamed as each account authentication completes, allowing the client
     * to process results incrementally.
     *
     * @generated from field: soulfire.v1.CredentialsAuthOneSuccess one_success = 2;
     */
    value: CredentialsAuthOneSuccess;
    case: "oneSuccess";
  } | {
    /**
     * A single failed authentication result. Streamed as each failed
     * authentication completes. Errors are logged server-side
     * (e.g., invalid credentials, network issues).
     *
     * @generated from field: soulfire.v1.CredentialsAuthOneFailure one_failure = 3;
     */
    value: CredentialsAuthOneFailure;
    case: "oneFailure";
  } | {
    /**
     * End-of-stream marker indicating all authentications are complete.
     * This is always the last message in the stream before it closes.
     *
     * @generated from field: soulfire.v1.CredentialsAuthEnd end = 4;
     */
    value: CredentialsAuthEnd;
    case: "end";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message soulfire.v1.CredentialsAuthResponse.
 * Use `create(CredentialsAuthResponseSchema)` to create a new message.
 */
export const CredentialsAuthResponseSchema: GenMessage<CredentialsAuthResponse> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 4);

/**
 * Request message for Microsoft OAuth device code authentication flow.
 * This flow is interactive and requires user action in a web browser.
 *
 * @generated from message soulfire.v1.DeviceCodeAuthRequest
 */
export type DeviceCodeAuthRequest = Message<"soulfire.v1.DeviceCodeAuthRequest"> & {
  /**
   * The UUID of the SoulFire instance to authenticate the account for.
   * Must be a valid UUID string. The instance must exist and the caller
   * must have AUTHENTICATE_MC_ACCOUNT permission for this instance.
   *
   * @generated from field: string instance_id = 1;
   */
  instanceId: string;

  /**
   * The device code authentication service type to use:
   * - MICROSOFT_JAVA_DEVICE_CODE: Microsoft Java Edition account
   * - MICROSOFT_BEDROCK_DEVICE_CODE: Microsoft Bedrock Edition account
   *
   * @generated from field: soulfire.v1.AccountTypeDeviceCode service = 2;
   */
  service: AccountTypeDeviceCode;
};

/**
 * Describes the message soulfire.v1.DeviceCodeAuthRequest.
 * Use `create(DeviceCodeAuthRequestSchema)` to create a new message.
 */
export const DeviceCodeAuthRequestSchema: GenMessage<DeviceCodeAuthRequest> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 5);

/**
 * Microsoft OAuth device code information for user authentication.
 * The user must visit the verification URI and enter the user code
 * to authorize the application.
 *
 * @generated from message soulfire.v1.DeviceCode
 */
export type DeviceCode = Message<"soulfire.v1.DeviceCode"> & {
  /**
   * The device code used internally for polling authentication status.
   * This is not shown to the user.
   *
   * @generated from field: string device_code = 1;
   */
  deviceCode: string;

  /**
   * The short alphanumeric code the user must enter at the verification URI.
   * Typically displayed to the user for manual entry.
   *
   * @generated from field: string user_code = 2;
   */
  userCode: string;

  /**
   * The URL where the user must go to enter the user_code.
   * Example: "https://microsoft.com/devicelogin"
   *
   * @generated from field: string verification_uri = 3;
   */
  verificationUri: string;

  /**
   * A URL that includes the user_code as a parameter for one-click verification.
   * Users can visit this URL directly without manually entering the code.
   * Example: "https://microsoft.com/devicelogin?otc=ABCD1234"
   *
   * @generated from field: string direct_verification_uri = 4;
   */
  directVerificationUri: string;
};

/**
 * Describes the message soulfire.v1.DeviceCode.
 * Use `create(DeviceCodeSchema)` to create a new message.
 */
export const DeviceCodeSchema: GenMessage<DeviceCode> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 6);

/**
 * Streaming response message for device code authentication.
 * First sends the device code for user interaction, then sends
 * the authenticated account once the user completes authorization.
 *
 * @generated from message soulfire.v1.DeviceCodeAuthResponse
 */
export type DeviceCodeAuthResponse = Message<"soulfire.v1.DeviceCodeAuthResponse"> & {
  /**
   * @generated from oneof soulfire.v1.DeviceCodeAuthResponse.data
   */
  data: {
    /**
     * The successfully authenticated Minecraft account.
     * Sent after the user completes the device code authorization flow.
     * This is the final message in the stream.
     *
     * @generated from field: soulfire.v1.MinecraftAccountProto account = 1;
     */
    value: MinecraftAccountProto;
    case: "account";
  } | {
    /**
     * The device code information for user authorization.
     * Sent first in the stream. The client should display this to the user
     * so they can complete authentication in their browser.
     * The stream will wait (up to 15 minutes) for the user to authorize.
     *
     * @generated from field: soulfire.v1.DeviceCode device_code = 2;
     */
    value: DeviceCode;
    case: "deviceCode";
  } | { case: undefined; value?: undefined };
};

/**
 * Describes the message soulfire.v1.DeviceCodeAuthResponse.
 * Use `create(DeviceCodeAuthResponseSchema)` to create a new message.
 */
export const DeviceCodeAuthResponseSchema: GenMessage<DeviceCodeAuthResponse> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 7);

/**
 * Request message for refreshing an existing Minecraft account's authentication tokens.
 * Used to renew expired tokens without requiring the user to re-authenticate.
 *
 * @generated from message soulfire.v1.RefreshRequest
 */
export type RefreshRequest = Message<"soulfire.v1.RefreshRequest"> & {
  /**
   * The UUID of the SoulFire instance context for the refresh operation.
   * Must be a valid UUID string. The instance must exist and the caller
   * must have AUTHENTICATE_MC_ACCOUNT permission for this instance.
   *
   * @generated from field: string instance_id = 1;
   */
  instanceId: string;

  /**
   * The existing Minecraft account to refresh.
   * Must include valid account data with refresh tokens.
   * The account type determines which refresh mechanism is used.
   * Offline accounts are returned unchanged (they never expire).
   *
   * @generated from field: soulfire.v1.MinecraftAccountProto account = 2;
   */
  account?: MinecraftAccountProto | undefined;
};

/**
 * Describes the message soulfire.v1.RefreshRequest.
 * Use `create(RefreshRequestSchema)` to create a new message.
 */
export const RefreshRequestSchema: GenMessage<RefreshRequest> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 8);

/**
 * Response message containing the refreshed Minecraft account.
 *
 * @generated from message soulfire.v1.RefreshResponse
 */
export type RefreshResponse = Message<"soulfire.v1.RefreshResponse"> & {
  /**
   * The refreshed Minecraft account with updated tokens.
   * Contains new access tokens and updated expiration times.
   * For offline accounts, returns the same account unchanged.
   *
   * @generated from field: soulfire.v1.MinecraftAccountProto account = 1;
   */
  account?: MinecraftAccountProto | undefined;
};

/**
 * Describes the message soulfire.v1.RefreshResponse.
 * Use `create(RefreshResponseSchema)` to create a new message.
 */
export const RefreshResponseSchema: GenMessage<RefreshResponse> = /*@__PURE__*/
  messageDesc(file_soulfire_mc_auth, 9);

/**
 * Service for authenticating Minecraft accounts for use with SoulFire bots.
 * Supports multiple authentication methods including Microsoft OAuth (credentials
 * and device code flows) and offline mode. All methods require the caller to
 * have AUTHENTICATE_MC_ACCOUNT permission for the target instance.
 *
 * Authentication may optionally use proxies if configured in instance settings
 * (USE_PROXIES_FOR_ACCOUNT_AUTH). All authentication operations have timeouts
 * to prevent indefinite hangs (2 minutes for credentials/refresh, 15 minutes
 * for device code flow).
 *
 * @generated from service soulfire.v1.MCAuthService
 */
export const MCAuthService: GenService<{
  /**
   * Authenticates one or more Minecraft accounts using credentials or tokens.
   * Supports bulk authentication with concurrent processing.
   *
   * Results are streamed back as each authentication completes:
   * 1. For each account, either a one_success (with account data) or
   *    one_failure message is sent
   * 2. A CredentialsAuthEnd message is sent when all checks are complete
   *
   * Concurrency is controlled by the instance's ACCOUNT_IMPORT_CONCURRENCY setting.
   *
   * Errors:
   * - NOT_FOUND: The specified instance does not exist
   * - PERMISSION_DENIED: Caller lacks AUTHENTICATE_MC_ACCOUNT permission
   * - INTERNAL: Authentication error (logged server-side with details)
   *
   * Timeout: 2 minutes per account
   *
   * @generated from rpc soulfire.v1.MCAuthService.LoginCredentials
   */
  loginCredentials: {
    methodKind: "server_streaming";
    input: typeof CredentialsAuthRequestSchema;
    output: typeof CredentialsAuthResponseSchema;
  },
  /**
   * Authenticates a Minecraft account using the Microsoft OAuth device code flow.
   * This is an interactive flow that requires user action in a web browser.
   *
   * The stream first sends a DeviceCode message containing the verification
   * URL and user code. The client should display this to the user. Once the
   * user completes authorization in their browser, the stream sends the
   * authenticated account and completes.
   *
   * Errors:
   * - NOT_FOUND: The specified instance does not exist
   * - PERMISSION_DENIED: Caller lacks AUTHENTICATE_MC_ACCOUNT permission
   * - INTERNAL: Authentication error (e.g., user denied access, timeout)
   *
   * Timeout: 15 minutes (Microsoft device codes typically expire after this)
   *
   * @generated from rpc soulfire.v1.MCAuthService.LoginDeviceCode
   */
  loginDeviceCode: {
    methodKind: "server_streaming";
    input: typeof DeviceCodeAuthRequestSchema;
    output: typeof DeviceCodeAuthResponseSchema;
  },
  /**
   * Refreshes the authentication tokens for an existing Minecraft account.
   * Used to renew expired access tokens using stored refresh tokens.
   *
   * For Microsoft accounts, this refreshes the Minecraft token, profile,
   * and player certificates. For offline accounts, returns the account
   * unchanged (offline accounts never expire).
   *
   * Errors:
   * - NOT_FOUND: The specified instance does not exist
   * - PERMISSION_DENIED: Caller lacks AUTHENTICATE_MC_ACCOUNT permission
   * - INTERNAL: Refresh error (e.g., refresh token expired or revoked)
   *
   * Timeout: 2 minutes
   *
   * @generated from rpc soulfire.v1.MCAuthService.Refresh
   */
  refresh: {
    methodKind: "unary";
    input: typeof RefreshRequestSchema;
    output: typeof RefreshResponseSchema;
  },
}> = /*@__PURE__*/
  serviceDesc(file_soulfire_mc_auth, 0);
