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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { Controller } from '@nestjs/common';
import { MessagePattern } from '@nestjs/microservices';
import {
EventDidcommAnonCredsCredentialsGetAll,
EventDidcommAnonCredsCredentialsGetAllInput,
EventDidcommAnonCredsCredentialsGetById,
EventDidcommAnonCredsCredentialsGetByIdInput,
EventDidcommAnonCredsCredentialsOffer,
EventDidcommAnonCredsCredentialsOfferInput,
EventDidcommAnonCredsCredentialsOfferToSelfInput,
EventDidcommAnonCredsCredentialsOfferToSelf,
} from '@ocm/shared';
import { AnonCredsCredentialsService } from './anoncredsCredentials.service.js';
@Controller('anoncredsCredentials')
export class AnonCredsCredentialsController {
public constructor(private credentialsService: AnonCredsCredentialsService) {}
@MessagePattern(EventDidcommAnonCredsCredentialsGetAll.token)
public async getAll(
options: EventDidcommAnonCredsCredentialsGetAllInput,
): Promise<EventDidcommAnonCredsCredentialsGetAll> {
return new EventDidcommAnonCredsCredentialsGetAll(
await this.credentialsService.getAll(options),
options.tenantId,
);
}
@MessagePattern(EventDidcommAnonCredsCredentialsGetById.token)
public async getById(
options: EventDidcommAnonCredsCredentialsGetByIdInput,
): Promise<EventDidcommAnonCredsCredentialsGetById> {
return new EventDidcommAnonCredsCredentialsGetById(
await this.credentialsService.getById(options),
options.tenantId,
);
}
@MessagePattern(EventDidcommAnonCredsCredentialsOffer.token)
public async offer(
options: EventDidcommAnonCredsCredentialsOfferInput,
): Promise<EventDidcommAnonCredsCredentialsOffer> {
return new EventDidcommAnonCredsCredentialsOffer(
await this.credentialsService.offer(options),
options.tenantId,
);
}
@MessagePattern(EventDidcommAnonCredsCredentialsOfferToSelf.token)
public async offerToSelf(
options: EventDidcommAnonCredsCredentialsOfferToSelfInput,
): Promise<EventDidcommAnonCredsCredentialsOfferToSelf> {
return new EventDidcommAnonCredsCredentialsOfferToSelf(
await this.credentialsService.offerToSelf(options),
options.tenantId,
);
}
}