-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #730 from MatrixAI/feature-audit-multipath
Adding multiple path support when requesting audit events
- Loading branch information
Showing
10 changed files
with
429 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,12 @@ | ||
import type { ReadableStream } from 'stream/web'; | ||
import type { HandlerTypes } from '@matrixai/rpc'; | ||
import type { ContextTimedInput } from '@matrixai/contexts'; | ||
import type { | ||
AuditEventToAuditEventSerialized, | ||
TopicSubPath, | ||
TopicSubPathToAuditEvent, | ||
} from '../../audit/types'; | ||
import type { ClientRPCRequestParams, ClientRPCResponseResult } from '../types'; | ||
import type AuditEventsGet from '../handlers/AuditEventsGet'; | ||
import type { AuditEventIdEncoded } from '../../ids/types'; | ||
import { ServerCaller } from '@matrixai/rpc'; | ||
|
||
type CallerTypes = HandlerTypes<AuditEventsGet>; | ||
|
||
type AuditEventsGetTypeOverride = <T extends TopicSubPath>( | ||
input: ClientRPCRequestParams<{ | ||
seek?: AuditEventIdEncoded | number; | ||
seekEnd?: AuditEventIdEncoded | number; | ||
order?: 'asc' | 'desc'; | ||
limit?: number; | ||
awaitFutureEvents?: boolean; | ||
}> & { | ||
path: T; | ||
}, | ||
ctx?: ContextTimedInput, | ||
) => Promise< | ||
ReadableStream< | ||
ClientRPCResponseResult< | ||
AuditEventToAuditEventSerialized<TopicSubPathToAuditEvent<T>> | ||
> | ||
> | ||
>; | ||
|
||
const auditEventsGet = new ServerCaller< | ||
CallerTypes['input'], | ||
CallerTypes['output'] | ||
>(); | ||
|
||
export default auditEventsGet; | ||
|
||
export type { AuditEventsGetTypeOverride }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.