@yuno-payments/dashboard-api-mfe 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -187,7 +187,7 @@ export declare class Api extends HttpClient {
187
187
  postApiLogsList<T>(payload: Audit.ApiLogsListParams): Promise<AxiosResponse<T>>;
188
188
  getApiLogsV3ByPaymentCode<T>(paymentCode: string, createdAtFrom?: string): Promise<AxiosResponse<T>>;
189
189
  createAuditSubscription<T>(payload: Audit.CreateAuditSubscriptionPayload): Promise<AxiosResponse<T>>;
190
- listAuditSubscriptions<T>(params?: Audit.ListAuditSubscriptionsParams): Promise<AxiosResponse<T>>;
190
+ listAuditSubscriptions<T>(): Promise<AxiosResponse<T>>;
191
191
  deleteAuditSubscription<T>(code: string): Promise<AxiosResponse<T>>;
192
192
  useGetCountriesConfig<T>(): Promise<AxiosResponse<T, any>>;
193
193
  useGetCountriesConfigV2<T>(acceptLanguage?: string): Promise<AxiosResponse<T, any>>;
@@ -440,6 +440,19 @@ export declare class Api extends HttpClient {
440
440
  postAuditMonitors<T>(payload: Audit.AuditMonitorsParams): Promise<AxiosResponse<T, any>>;
441
441
  getAuditMonitorDetail<T>(id: number | null): Promise<AxiosResponse<T, any>>;
442
442
  getAuditEvents<T>(params: Audit.AuditEventsParams): Promise<AxiosResponse<T, any>>;
443
+ /**
444
+ * Fetches one audit event by its unique code. Powers the dashboard
445
+ * notification deep-link (DAS-15765): a bell card carries only the event
446
+ * code, and the audit-log list endpoint cannot filter by a unique code.
447
+ * The BFF resolves the organization from the session.
448
+ *
449
+ * Call is POST (not GET) because [account_codes] can carry ~800 UUIDs
450
+ * (the user's authorized accounts) which would overflow a GET query
451
+ * string. Same convention as the list endpoint. The BFF narrows
452
+ * `account_codes` against the user's permissions before scoping the
453
+ * SQL in audit-logs-ms.
454
+ */
455
+ getAuditEventByCode<T>(eventCode: string, accountCodes: string[]): Promise<AxiosResponse<T, any>>;
443
456
  getPaymentLinks<T>(params: any, account: any): Promise<AxiosResponse<T, any>>;
444
457
  getPaymentLinksByCode<T>(paymentLinkCode: any): Promise<AxiosResponse<T, any>>;
445
458
  postPaymentLinks<T>({ payload, accountCode, }: {
@@ -12,7 +12,7 @@ import { BFFErrorResponse } from '../smart-routing';
12
12
  */
13
13
  export type CreateAuditSubscriptionResult = {
14
14
  alreadyExists: false;
15
- subscription: Audit.AuditSubscription;
15
+ subscription: Audit.AuditSubscriptionGroup;
16
16
  } | {
17
17
  alreadyExists: true;
18
18
  };
@@ -2,10 +2,13 @@ import { UseQueryResult } from '@tanstack/react-query';
2
2
  import type { Audit } from '../../types';
3
3
  import { BFFErrorResponse } from '../../mutations';
4
4
  /**
5
- * Lists audit-log subscriptions for the current organization.
5
+ * Lists audit-log subscription groups for the current organization.
6
6
  *
7
- * Hits `POST /dashboard-bff/api/audit-logs/subscriptions/list` with a JSON
8
- * body of filter params and unwraps the `{ data: [...] }` envelope so
9
- * consumers receive a flat `Audit.AuditSubscription[]`.
7
+ * Hits `POST /dashboard-bff/api/audit-logs/subscriptions/list` with an empty
8
+ * JSON body and unwraps the `{ data: [...] }` envelope so consumers receive a
9
+ * flat `Audit.AuditSubscriptionGroup[]`.
10
+ *
11
+ * v2.0 breaking change: filter params (source/event/account_codes) were
12
+ * removed — the BFF now returns all groups for the current user.
10
13
  */
11
- export declare function useListAuditSubscriptions(params?: Audit.ListAuditSubscriptionsParams): UseQueryResult<Audit.AuditSubscription[], BFFErrorResponse>;
14
+ export declare function useListAuditSubscriptions(): UseQueryResult<Audit.AuditSubscriptionGroup[], BFFErrorResponse>;
@@ -3,6 +3,19 @@ import { AxiosError } from 'axios';
3
3
  import type { Audit } from '../../types';
4
4
  import { BFFErrorResponse } from '../../mutations';
5
5
  export declare function useGetAuditEvents(params: Audit.AuditEventsParams): UseQueryResult<Audit.AuditEvents, AxiosError>;
6
+ /**
7
+ * Fetches one audit event by its unique code. Powers the dashboard
8
+ * notification deep-link (DAS-15765): clicking "View in audit log" on a bell
9
+ * notification card opens that specific event in the audit log drawer — even
10
+ * when the user's current filtered page does not contain it. Resolves with
11
+ * a 404 (rejected query) when the event has been removed / retention purged /
12
+ * access revoked, which the frontend renders as the inline edge-state banner.
13
+ *
14
+ * [accountCodes] is the user's full authorized account list (up to ~800
15
+ * UUIDs). The BFF scopes the upstream lookup so a deep-link cannot open an
16
+ * event on an account the user can't read.
17
+ */
18
+ export declare function useGetAuditEventByCode(eventCode: string | null | undefined, accountCodes: string[] | undefined): UseQueryResult<Audit.AuditEventData, AxiosError>;
6
19
  export declare function useGetAuditMonitorEventDetail(id: number | null): UseQueryResult<Audit.AuditMonitorDetail, AxiosError>;
7
20
  export declare function usePostApiLogs(params: Audit.AuditApiLogsParams): UseQueryResult<Audit.AuditApiLogsResponse, BFFErrorResponse>;
8
21
  export declare function usePostWebhookLogs({ params, }: {
@@ -459,29 +459,25 @@ export declare namespace Audit {
459
459
  total_pages: number;
460
460
  data: ApiLogV3Item[];
461
461
  }
462
- interface AuditSubscription {
462
+ interface AuditSubscriptionGroup {
463
463
  code: string;
464
464
  user_code: string;
465
465
  user_email: string;
466
466
  organization_code: string;
467
- account_code: string;
468
- source: string;
469
- event: string;
467
+ sources: string[];
468
+ events: string[];
469
+ account_codes: string[];
470
470
  enabled: boolean;
471
471
  created_at: string;
472
472
  updated_at: string;
473
+ last_fired_at?: string | null;
473
474
  }
474
- interface CreateAuditSubscriptionPayload {
475
- account_code: string;
476
- source: string;
477
- event: string;
478
- }
479
- interface ListAuditSubscriptionsParams {
480
- source?: string;
481
- event?: string;
482
- account_codes?: string[];
483
- }
475
+ type CreateAuditSubscriptionPayload = {
476
+ sources: string[];
477
+ events: string[];
478
+ account_codes: string[];
479
+ };
484
480
  interface ListAuditSubscriptionsResponse {
485
- data: AuditSubscription[];
481
+ data: AuditSubscriptionGroup[];
486
482
  }
487
483
  }