@@ -3,21 +3,21 @@ import type { Query } from '../../storage/StorageService'
3
3
import type { DeleteCredentialOptions } from './CredentialServiceOptions'
4
4
import type {
5
5
AcceptCredentialOptions ,
6
- AcceptOfferOptions ,
7
- AcceptProposalOptions ,
8
- AcceptRequestOptions ,
6
+ AcceptCredentialOfferOptions ,
7
+ AcceptCredentialProposalOptions ,
8
+ AcceptCredentialRequestOptions ,
9
9
CreateOfferOptions ,
10
10
FindCredentialMessageReturn ,
11
- FindOfferMessageReturn ,
12
- FindProposalMessageReturn ,
13
- FindRequestMessageReturn ,
11
+ FindCredentialOfferMessageReturn ,
12
+ FindCredentialProposalMessageReturn ,
13
+ FindCredentialRequestMessageReturn ,
14
14
GetFormatDataReturn ,
15
- NegotiateOfferOptions ,
16
- NegotiateProposalOptions ,
15
+ NegotiateCredentialOfferOptions ,
16
+ NegotiateCredentialProposalOptions ,
17
17
OfferCredentialOptions ,
18
18
ProposeCredentialOptions ,
19
- SendProblemReportOptions ,
20
- ServiceMap ,
19
+ SendCredentialProblemReportOptions ,
20
+ CredentialServiceMap ,
21
21
} from './CredentialsApiOptions'
22
22
import type { CredentialFormat } from './formats'
23
23
import type { IndyCredentialFormat } from './formats/indy/IndyCredentialFormat'
@@ -47,21 +47,21 @@ import { CredentialRepository } from './repository/CredentialRepository'
47
47
export interface CredentialsApi < CFs extends CredentialFormat [ ] , CSs extends CredentialService < CFs > [ ] > {
48
48
// Propose Credential methods
49
49
proposeCredential ( options : ProposeCredentialOptions < CFs , CSs > ) : Promise < CredentialExchangeRecord >
50
- acceptProposal ( options : AcceptProposalOptions < CFs > ) : Promise < CredentialExchangeRecord >
51
- negotiateProposal ( options : NegotiateProposalOptions < CFs > ) : Promise < CredentialExchangeRecord >
50
+ acceptProposal ( options : AcceptCredentialProposalOptions < CFs > ) : Promise < CredentialExchangeRecord >
51
+ negotiateProposal ( options : NegotiateCredentialProposalOptions < CFs > ) : Promise < CredentialExchangeRecord >
52
52
53
53
// Offer Credential Methods
54
54
offerCredential ( options : OfferCredentialOptions < CFs , CSs > ) : Promise < CredentialExchangeRecord >
55
- acceptOffer ( options : AcceptOfferOptions < CFs > ) : Promise < CredentialExchangeRecord >
55
+ acceptOffer ( options : AcceptCredentialOfferOptions < CFs > ) : Promise < CredentialExchangeRecord >
56
56
declineOffer ( credentialRecordId : string ) : Promise < CredentialExchangeRecord >
57
- negotiateOffer ( options : NegotiateOfferOptions < CFs > ) : Promise < CredentialExchangeRecord >
57
+ negotiateOffer ( options : NegotiateCredentialOfferOptions < CFs > ) : Promise < CredentialExchangeRecord >
58
58
59
59
// Request Credential Methods
60
60
// This is for beginning the exchange with a request (no proposal or offer). Only possible
61
61
// (currently) with W3C. We will not implement this in phase I
62
62
63
63
// when the issuer accepts the request he issues the credential to the holder
64
- acceptRequest ( options : AcceptRequestOptions < CFs > ) : Promise < CredentialExchangeRecord >
64
+ acceptRequest ( options : AcceptCredentialRequestOptions < CFs > ) : Promise < CredentialExchangeRecord >
65
65
66
66
// Issue Credential Methods
67
67
acceptCredential ( options : AcceptCredentialOptions ) : Promise < CredentialExchangeRecord >
@@ -72,7 +72,7 @@ export interface CredentialsApi<CFs extends CredentialFormat[], CSs extends Cred
72
72
credentialRecord : CredentialExchangeRecord
73
73
} >
74
74
75
- sendProblemReport ( options : SendProblemReportOptions ) : Promise < CredentialExchangeRecord >
75
+ sendProblemReport ( options : SendCredentialProblemReportOptions ) : Promise < CredentialExchangeRecord >
76
76
77
77
// Record Methods
78
78
getAll ( ) : Promise < CredentialExchangeRecord [ ] >
@@ -84,9 +84,9 @@ export interface CredentialsApi<CFs extends CredentialFormat[], CSs extends Cred
84
84
getFormatData ( credentialRecordId : string ) : Promise < GetFormatDataReturn < CFs > >
85
85
86
86
// DidComm Message Records
87
- findProposalMessage ( credentialExchangeId : string ) : Promise < FindProposalMessageReturn < CSs > >
88
- findOfferMessage ( credentialExchangeId : string ) : Promise < FindOfferMessageReturn < CSs > >
89
- findRequestMessage ( credentialExchangeId : string ) : Promise < FindRequestMessageReturn < CSs > >
87
+ findProposalMessage ( credentialExchangeId : string ) : Promise < FindCredentialProposalMessageReturn < CSs > >
88
+ findOfferMessage ( credentialExchangeId : string ) : Promise < FindCredentialOfferMessageReturn < CSs > >
89
+ findRequestMessage ( credentialExchangeId : string ) : Promise < FindCredentialRequestMessageReturn < CSs > >
90
90
findCredentialMessage ( credentialExchangeId : string ) : Promise < FindCredentialMessageReturn < CSs > >
91
91
}
92
92
@@ -108,7 +108,7 @@ export class CredentialsApi<
108
108
private didCommMessageRepository : DidCommMessageRepository
109
109
private routingService : RoutingService
110
110
private logger : Logger
111
- private serviceMap : ServiceMap < CFs , CSs >
111
+ private serviceMap : CredentialServiceMap < CFs , CSs >
112
112
113
113
public constructor (
114
114
messageSender : MessageSender ,
@@ -141,7 +141,7 @@ export class CredentialsApi<
141
141
[ service . version ] : service ,
142
142
} ) ,
143
143
{ }
144
- ) as ServiceMap < CFs , CSs >
144
+ ) as CredentialServiceMap < CFs , CSs >
145
145
146
146
this . logger . debug ( `Initializing Credentials Module for agent ${ this . agentContext . config . label } ` )
147
147
}
@@ -195,7 +195,7 @@ export class CredentialsApi<
195
195
* @returns Credential exchange record associated with the credential offer
196
196
*
197
197
*/
198
- public async acceptProposal ( options : AcceptProposalOptions < CFs > ) : Promise < CredentialExchangeRecord > {
198
+ public async acceptProposal ( options : AcceptCredentialProposalOptions < CFs > ) : Promise < CredentialExchangeRecord > {
199
199
const credentialRecord = await this . getById ( options . credentialRecordId )
200
200
201
201
if ( ! credentialRecord . connectionId ) {
@@ -227,11 +227,11 @@ export class CredentialsApi<
227
227
* Negotiate a credential proposal as issuer (by sending a credential offer message) to the connection
228
228
* associated with the credential record.
229
229
*
230
- * @param options configuration for the offer see {@link NegotiateProposalOptions }
230
+ * @param options configuration for the offer see {@link NegotiateCredentialProposalOptions }
231
231
* @returns Credential exchange record associated with the credential offer
232
232
*
233
233
*/
234
- public async negotiateProposal ( options : NegotiateProposalOptions < CFs > ) : Promise < CredentialExchangeRecord > {
234
+ public async negotiateProposal ( options : NegotiateCredentialProposalOptions < CFs > ) : Promise < CredentialExchangeRecord > {
235
235
const credentialRecord = await this . getById ( options . credentialRecordId )
236
236
237
237
if ( ! credentialRecord . connectionId ) {
@@ -291,7 +291,7 @@ export class CredentialsApi<
291
291
* @param options The object containing config options of the offer to be accepted
292
292
* @returns Object containing offer associated credential record
293
293
*/
294
- public async acceptOffer ( options : AcceptOfferOptions < CFs > ) : Promise < CredentialExchangeRecord > {
294
+ public async acceptOffer ( options : AcceptCredentialOfferOptions < CFs > ) : Promise < CredentialExchangeRecord > {
295
295
const credentialRecord = await this . getById ( options . credentialRecordId )
296
296
297
297
const service = this . getService ( credentialRecord . protocolVersion )
@@ -369,7 +369,7 @@ export class CredentialsApi<
369
369
return credentialRecord
370
370
}
371
371
372
- public async negotiateOffer ( options : NegotiateOfferOptions < CFs > ) : Promise < CredentialExchangeRecord > {
372
+ public async negotiateOffer ( options : NegotiateCredentialOfferOptions < CFs > ) : Promise < CredentialExchangeRecord > {
373
373
const credentialRecord = await this . getById ( options . credentialRecordId )
374
374
375
375
const service = this . getService ( credentialRecord . protocolVersion )
@@ -424,7 +424,7 @@ export class CredentialsApi<
424
424
* @param options The object containing config options of the request
425
425
* @returns CredentialExchangeRecord updated with information pertaining to this request
426
426
*/
427
- public async acceptRequest ( options : AcceptRequestOptions < CFs > ) : Promise < CredentialExchangeRecord > {
427
+ public async acceptRequest ( options : AcceptCredentialRequestOptions < CFs > ) : Promise < CredentialExchangeRecord > {
428
428
const credentialRecord = await this . getById ( options . credentialRecordId )
429
429
430
430
// with version we can get the Service
@@ -539,7 +539,7 @@ export class CredentialsApi<
539
539
* @param message message to send
540
540
* @returns credential record associated with the credential problem report message
541
541
*/
542
- public async sendProblemReport ( options : SendProblemReportOptions ) {
542
+ public async sendProblemReport ( options : SendCredentialProblemReportOptions ) {
543
543
const credentialRecord = await this . getById ( options . credentialRecordId )
544
544
if ( ! credentialRecord . connectionId ) {
545
545
throw new AriesFrameworkError ( `No connectionId found for credential record '${ credentialRecord . id } '.` )
@@ -625,19 +625,19 @@ export class CredentialsApi<
625
625
await this . credentialRepository . update ( this . agentContext , credentialRecord )
626
626
}
627
627
628
- public async findProposalMessage ( credentialExchangeId : string ) : Promise < FindProposalMessageReturn < CSs > > {
628
+ public async findProposalMessage ( credentialExchangeId : string ) : Promise < FindCredentialProposalMessageReturn < CSs > > {
629
629
const service = await this . getServiceForCredentialExchangeId ( credentialExchangeId )
630
630
631
631
return service . findProposalMessage ( this . agentContext , credentialExchangeId )
632
632
}
633
633
634
- public async findOfferMessage ( credentialExchangeId : string ) : Promise < FindOfferMessageReturn < CSs > > {
634
+ public async findOfferMessage ( credentialExchangeId : string ) : Promise < FindCredentialOfferMessageReturn < CSs > > {
635
635
const service = await this . getServiceForCredentialExchangeId ( credentialExchangeId )
636
636
637
637
return service . findOfferMessage ( this . agentContext , credentialExchangeId )
638
638
}
639
639
640
- public async findRequestMessage ( credentialExchangeId : string ) : Promise < FindRequestMessageReturn < CSs > > {
640
+ public async findRequestMessage ( credentialExchangeId : string ) : Promise < FindCredentialRequestMessageReturn < CSs > > {
641
641
const service = await this . getServiceForCredentialExchangeId ( credentialExchangeId )
642
642
643
643
return service . findRequestMessage ( this . agentContext , credentialExchangeId )
0 commit comments