Skip to content

Commit 14f63d7

Browse files
committed
wip: creating additional tests for auditeventsget
1 parent c733337 commit 14f63d7

File tree

4 files changed

+237
-234
lines changed

4 files changed

+237
-234
lines changed

src/nodes/agent/handlers/NodesAuditEventsGet.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import type {
88
AgentAuditMessage,
99
} from '../types';
1010
import type Audit from '../../../audit/Audit';
11+
import type { AuditEvent } from '@/audit/types';
1112
import { ServerHandler } from '@matrixai/rpc';
12-
import * as auditUtils from '../../../audit/utils'
13-
import { AuditEvent } from '@/audit/types';
13+
import * as auditUtils from '../../../audit/utils';
1414

1515
/**
1616
* Gets audit events from a node
@@ -48,7 +48,7 @@ class NodesAuditEventsGet extends ServerHandler<
4848
yield {
4949
id: auditUtils.encodeAuditEventId(auditEvent.id),
5050
path: auditEvent.path,
51-
data: auditEvent.data
51+
data: auditEvent.data,
5252
};
5353
}
5454
});

src/nodes/agent/handlers/NodesClaimsGet.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { ServerHandler } from '@matrixai/rpc';
1212
import * as claimsUtils from '../../../claims/utils';
1313
import * as ids from '../../../ids';
1414

15-
1615
/**
1716
* Gets the sigchain claims of a node
1817
*/
@@ -39,11 +38,11 @@ class NodesClaimsGet extends ServerHandler<
3938
AgentRPCResponseResult<AgentClaimMessage>
4039
> {
4140
for await (const [claimId, signedClaim] of sigchain.getSignedClaims(
42-
{
41+
{
4342
seek: decodedClaimId,
4443
order: order,
4544
limit: limit,
46-
},
45+
},
4746
tran,
4847
)) {
4948
ctx.signal.throwIfAborted();

src/nodes/agent/types.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type { VaultAction, VaultName } from '../../vaults/types';
1515
import type { SignedNotification } from '../../notifications/types';
1616
import type { Host, Hostname, Port } from '../../network/types';
1717
import type { NodeContact } from '../../nodes/types';
18-
import { AuditEvent } from '@/audit/types';
18+
import type { AuditEvent } from '@/audit/types';
1919

2020
type AgentRPCRequestParams<T extends JSONObject = JSONObject> =
2121
JSONRPCRequestParams<T>;
@@ -30,21 +30,20 @@ type AuditIdMessage = {
3030
limit?: number;
3131
};
3232

33-
type AgentAuditMessage<T extends AuditEvent> = Omit<T, 'id'> & {
34-
id: AuditEventIdEncoded
33+
type AgentAuditMessage<T extends AuditEvent> = Omit<T, 'id'> & {
34+
id: AuditEventIdEncoded;
3535
};
3636

3737
type NodesClaimsGetMessage = {
3838
seek?: ClaimIdEncoded | number;
3939
order?: 'asc' | 'desc';
40-
limit?: number;
41-
}
40+
limit?: number;
41+
};
4242

4343
type ClaimIdMessage = {
4444
claimIdEncoded: ClaimIdEncoded;
4545
};
4646

47-
4847
type AgentClaimMessage = Partial<ClaimIdMessage> & {
4948
signedTokenEncoded: SignedTokenEncoded;
5049
};

0 commit comments

Comments
 (0)