{"version":3,"file":"AuthHistoryApi.cjs","names":[],"sources":["../../../src/apis/authHistory/AuthHistoryApi.ts"],"sourcesContent":["import qs from 'qs'\nimport type { ApiClient } from '../../core/ApiClient'\nimport type { ListQuery, Paginated, HasGetMany, HasGetById } from '../../core/types'\nimport type { AuthHistory } from './types'\n\nexport class AuthHistoryApi implements HasGetMany<AuthHistory>, HasGetById<AuthHistory> {\n  private readonly client: ApiClient\n\n  constructor(client: ApiClient) {\n    this.client = client\n  }\n\n  /**\n   * Returns a paginated list of authentication events (auth, password_change, logout). Non-admin users can only see their own records.\n   * @permissions authHistory.view\n   */\n  getMany(\n    query: ListQuery<AuthHistory> & { paginate: false },\n    headers?: Record<string, string>,\n  ): Promise<AuthHistory[]>\n  getMany(\n    query?: ListQuery<AuthHistory> & { paginate?: true },\n    headers?: Record<string, string>,\n  ): Promise<Paginated<AuthHistory>>\n  getMany(\n    query?: ListQuery<AuthHistory>,\n    headers?: Record<string, string>,\n  ): Promise<Paginated<AuthHistory> | AuthHistory[]> {\n    const queryString = query ? `?${qs.stringify(query)}` : ''\n    return this.client.get<Paginated<AuthHistory> | AuthHistory[]>(\n      `/auth-history${queryString}`,\n      headers,\n    )\n  }\n\n  /**\n   * Returns a single authentication event by its ID. Non-admin users can only access their own records.\n   * @permissions authHistory.view\n   */\n  getById(id: string, headers?: Record<string, string>): Promise<AuthHistory> {\n    return this.client.get<AuthHistory>(`/auth-history/${id}`, headers)\n  }\n}\n"],"mappings":";;;;;;AAKA,IAAa,iBAAb,MAAwF;CACtF,AAAiB;CAEjB,YAAY,QAAmB;AAC7B,OAAK,SAAS;;CAehB,QACE,OACA,SACiD;EACjD,MAAM,cAAc,QAAQ,IAAI,WAAG,UAAU,MAAM,KAAK;AACxD,SAAO,KAAK,OAAO,IACjB,gBAAgB,eAChB,QACD;;;;;;CAOH,QAAQ,IAAY,SAAwD;AAC1E,SAAO,KAAK,OAAO,IAAiB,iBAAiB,MAAM,QAAQ"}