{"version":3,"sources":["../../../src/common/auth/auth.ts"],"names":[],"mappings":"AA+BO,MAAM,IAAsB,CAAA;AAAA;AAAA;AAAA;AAAA,EAIjC,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,cAAA;AAAA;AAAA;AAAA;AAAA,EAKA,qBAAA;AAAA;AAAA;AAAA;AAAA,EAKA,OAAA;AAAA,EAEA,WAAA,CAAY,OAAiB,GAAA,EAAI,EAAA;AAC/B,IAAO,MAAA,CAAA,MAAA,CAAO,MAAM,OAAO,CAAA;AAAA;AAC7B,EAEA,SAAS,KAAe,EAAA;AACtB,IAAA,IAAA,CAAK,IAAO,GAAA,KAAA;AACZ,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,mBAAmB,KAAe,EAAA;AAChC,IAAA,IAAA,CAAK,cAAiB,GAAA,KAAA;AACtB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,0BAA0B,KAA+B,EAAA;AACvD,IAAA,IAAA,CAAK,qBAAwB,GAAA,KAAA;AAC7B,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,cAAc,KAA0B,EAAA;AACtC,IAAI,IAAA,CAAC,KAAK,OAAS,EAAA;AACjB,MAAA,IAAA,CAAK,UAAU,EAAC;AAAA;AAGlB,IAAK,IAAA,CAAA,OAAA,CAAQ,IAAK,CAAA,GAAG,KAAK,CAAA;AAC1B,IAAO,OAAA,IAAA;AAAA;AAEX","file":"auth.mjs","sourcesContent":["import { IAuthCardButton } from './auth-card-button';\nimport { ITokenExchangeResource } from './token-exchange-resource';\n\n/**\n * Defines authentication information associated with a card. This maps to the OAuthCard type defined by the Bot Framework (https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard)\n */\nexport interface IAuth {\n  /**\n   * Text that can be displayed to the end user when prompting them to authenticate.\n   */\n  text?: string;\n\n  /**\n   * The identifier for registered OAuth connection setting information.\n   */\n  connectionName?: string;\n\n  /**\n   * Provides information required to enable on-behalf-of single sign-on user authentication.\n   */\n  tokenExchangeResource?: ITokenExchangeResource;\n\n  /**\n   * Buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported.\n   */\n  buttons?: IAuthCardButton[];\n}\n\n/**\n * Defines authentication information associated with a card. This maps to the OAuthCard type defined by the Bot Framework (https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard)\n */\nexport class Auth implements IAuth {\n  /**\n   * Text that can be displayed to the end user when prompting them to authenticate.\n   */\n  text?: string;\n\n  /**\n   * The identifier for registered OAuth connection setting information.\n   */\n  connectionName?: string;\n\n  /**\n   * Provides information required to enable on-behalf-of single sign-on user authentication.\n   */\n  tokenExchangeResource?: ITokenExchangeResource;\n\n  /**\n   * Buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported.\n   */\n  buttons?: IAuthCardButton[];\n\n  constructor(options: IAuth = {}) {\n    Object.assign(this, options);\n  }\n\n  withText(value: string) {\n    this.text = value;\n    return this;\n  }\n\n  withConnectionName(value: string) {\n    this.connectionName = value;\n    return this;\n  }\n\n  withTokenExchangeResource(value: ITokenExchangeResource) {\n    this.tokenExchangeResource = value;\n    return this;\n  }\n\n  addButtons(...value: IAuthCardButton[]) {\n    if (!this.buttons) {\n      this.buttons = [];\n    }\n\n    this.buttons.push(...value);\n    return this;\n  }\n}\n"]}