{"version":3,"sources":["../../src/models/account.ts"],"names":[],"mappings":"AAsFO,SAAS,mBAAmB,IAAA,EAAgC;AACjE,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,WAAA,EAAa,IAAA,CAAK,WAAA,IAAe,IAAA,CAAK;AAAA,GACxC;AACF","file":"account.mjs","sourcesContent":["import { MembershipSource } from './membership-source';\nimport { Role } from './role';\n\nexport type Account<P = any> = {\n  readonly id: string;\n  readonly aadObjectId?: string;\n  readonly role: Role;\n  readonly name: string;\n  readonly properties?: P;\n  readonly membershipSources?: MembershipSource[];\n\n  /**\n   * Indicates if this account is the target of a targeted message.\n   *\n   * @experimental This API is in preview and may change in the future.\n   * Diagnostic: ExperimentalTeamsTargeted\n   */\n  isTargeted?: boolean;\n};\n\n/**\n * Represents a Teams channel account, extending the basic channel account with Teams-specific properties.\n * This is used to represent a user or bot in Microsoft Teams conversations.\n * @see https://learn.microsoft.com/en-us/dotnet/api/microsoft.bot.schema.teams.teamschannelaccount\n */\nexport type TeamsChannelAccount<P = any> = {\n  /**\n   * @member {string} [id] Unique identifier for the user or bot in the channel.\n   */\n  readonly id: string;\n\n  /**\n   * @member {string} [name] Display-friendly name of the user or bot.\n   */\n  readonly name: string;\n\n  /**\n   * @member {string} [aadObjectId] The user's Object ID in Azure Active Directory (AAD).\n   */\n  readonly aadObjectId?: string;\n\n  /**\n   * @member {string} [userRole] Role of the user in the conversation.\n   */\n  readonly userRole?: string;\n\n  /**\n   * @member {string} [givenName] Given name (first name) of the user.\n   */\n  readonly givenName?: string;\n\n  /**\n   * @member {string} [surname] Surname (last name) of the user.\n   */\n  readonly surname?: string;\n\n  /**\n   * @member {string} [email] Email address of the user.\n   */\n  readonly email?: string;\n\n  /**\n   * @member {string} [userPrincipalName] Unique User Principal Name (UPN) for the user in AAD.\n   */\n  readonly userPrincipalName?: string;\n\n  /**\n   * @member {string} [tenantId] Unique identifier for the user's Azure AD tenant.\n   */\n  readonly tenantId?: string;\n\n  /**\n   * @member {P} [properties] Custom properties associated with the account.\n   */\n  readonly properties?: P;\n};\n\n/**\n * The backend inconsistently populates either `objectId` or `aadObjectId` depending on the endpoint:\n * - `GET /v3/conversations/{id}/members` (non-paginated) → `objectId`\n * - `GET /v3/conversations/{id}/members/{memberId}`       → `aadObjectId`\n * - `GET /v3/conversations/{id}/pagedMembers`             → `aadObjectId`\n * - `GET /v3/conversations/{id}/activities/{id}/members`  → `objectId`\n *\n * This function normalizes both into `aadObjectId`.\n */\nexport function resolveAadObjectId(data: any): TeamsChannelAccount {\n  return {\n    ...data,\n    aadObjectId: data.aadObjectId ?? data.objectId,\n  };\n}\n\nexport type ConversationAccount = {\n  readonly id: string;\n  readonly tenantId?: string;\n  readonly conversationType: 'personal' | 'groupChat' | Omit<string, 'personal' | 'groupChat'>;\n  readonly name?: string;\n  readonly isGroup?: boolean;\n};\n"]}