Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import type { BaseEventInput } from './baseEvents.js';
import type {
AnonCredsPredicateType,
AnonCredsProofRequestRestriction,
} from '@aries-framework/anoncreds';
import { JsonTransformer, ProofExchangeRecord } from '@aries-framework/core';
import { BaseEvent } from './baseEvents.js';
export type EventAnonCredsProofsGetAllInput = BaseEventInput;
export class EventAnonCredsProofsGetAll extends BaseEvent<
Array<ProofExchangeRecord>
> {
public static token = 'anoncreds.proofs.getAll';
public get instance() {
return this.data.map((d) =>
JsonTransformer.fromJSON(d, ProofExchangeRecord),
);
}
public static fromEvent(e: EventAnonCredsProofsGetAll) {
return new EventAnonCredsProofsGetAll(
e.data,
e.tenantId,
e.id,
e.type,
e.timestamp,
);
}
}
export type EventAnonCredsProofsGetByIdInput = BaseEventInput<{
proofRecordId: string;
}>;
export class EventAnonCredsProofsGetById extends BaseEvent<ProofExchangeRecord | null> {
public static token = 'anoncreds.proofs.getById';
public get instance() {
return this.data
? JsonTransformer.fromJSON(this.data, ProofExchangeRecord)
: this.data;
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
}
public static fromEvent(e: EventAnonCredsProofsGetById) {
return new EventAnonCredsProofsGetById(
e.data,
e.tenantId,
e.id,
e.type,
e.timestamp,
);
}
}
export type EventDidcommAnonCredsProofsRequestInput = BaseEventInput<{
connectionId: string;
name: string;
requestedAttributes: {
[groupName: string]: {
names: Array<string>;
restrictions?: Array<AnonCredsProofRequestRestriction>;
};
};
requestedPredicates: {
[groupName: string]: {
name: string;
predicateType: AnonCredsPredicateType;
predicateValue: number;
restrictions?: Array<AnonCredsProofRequestRestriction>;
};
};
}>;
export class EventDidcommAnonCredsProofsRequest extends BaseEvent<ProofExchangeRecord> {
public static token = 'didcomm.anoncreds.proofs.request';
public get instance() {
return JsonTransformer.fromJSON(this.data, ProofExchangeRecord);
}
public static fromEvent(e: EventDidcommAnonCredsProofsRequest) {
return new EventDidcommAnonCredsProofsRequest(
e.data,
e.tenantId,
e.id,
e.type,
e.timestamp,
);
}
}
export type EventAnonCredsProofsDeleteByIdInput = BaseEventInput<{
proofRecordId: string;
}>;
export class EventAnonCredsProofsDeleteById extends BaseEvent {
public static token = 'anoncreds.proofs.deleteById';
public static fromEvent(e: EventDidcommAnonCredsProofsRequest) {
return new EventDidcommAnonCredsProofsRequest(
e.data,
e.tenantId,
e.id,
e.type,
e.timestamp,
);
}
}