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
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
import {
Configuration,
ConfigurationParameters,
ActionMenuApi,
BasicmessageApi,
ConnectionApi,
CredentialDefinitionApi,
CredentialsApi,
DidExchangeApi,
DiscoverFeaturesApi,
DiscoverFeaturesV20Api,
EndorseTransactionApi,
IntroductionApi,
IssueCredentialV10Api,
IssueCredentialV20Api,
JsonldApi,
LedgerApi,
MediationApi,
OutOfBandApi,
PresentProofV10Api,
PresentProofV20Api,
ResolverApi,
RevocationApi,
SchemaApi,
ServerApi,
TrustpingApi,
WalletApi,
} from './swagger';
class ApiAcapy {
public actionMenu: ActionMenuApi;
public basicmessage: BasicmessageApi;
public connection: ConnectionApi;
public credentialDefinition: CredentialDefinitionApi;
public credentials: CredentialsApi;
public didExchange: DidExchangeApi;
public discoverFeatures: DiscoverFeaturesApi;
public discoverFeaturesV20: DiscoverFeaturesV20Api;
public endorseTransaction: EndorseTransactionApi;
public introduction: IntroductionApi;
public issueCredentialV10: IssueCredentialV10Api;
public issueCredentialV20: IssueCredentialV20Api;
public jsonld: JsonldApi;
public ledger: LedgerApi;
public mediation: MediationApi;
public outOfBand: OutOfBandApi;
public presentProofV10: PresentProofV10Api;
public presentProofV20: PresentProofV20Api;
public resolver: ResolverApi;
public revocation: RevocationApi;
public schema: SchemaApi;
public server: ServerApi;
public trustping: TrustpingApi;
public wallet: WalletApi;
constructor() {
}
public initialize = (getAccessToken: () => Promise<string>, baseUrl: string, subdomain: string) => {
const cfg = new Configuration();
const fetchPatched = async (url: string, init?: any) => {
init = Object.assign({}, init);
Object.assign(init.headers, {
Authorization: `Bearer ${await getAccessToken()}`,
'Agent-Domain': subdomain
})
return fetch(url, init);
};
this.actionMenu = new ActionMenuApi(cfg, baseUrl, fetchPatched);
this.basicmessage = new BasicmessageApi(cfg, baseUrl, fetchPatched);
this.connection = new ConnectionApi(cfg, baseUrl, fetchPatched);
this.credentialDefinition = new CredentialDefinitionApi(cfg, baseUrl, fetchPatched);
this.credentials = new CredentialsApi(cfg, baseUrl, fetchPatched);
this.didExchange = new DidExchangeApi(cfg, baseUrl, fetchPatched);
this.discoverFeatures = new DiscoverFeaturesApi(cfg, baseUrl, fetchPatched);
this.discoverFeaturesV20 = new DiscoverFeaturesV20Api(cfg, baseUrl, fetchPatched);
this.endorseTransaction = new EndorseTransactionApi(cfg, baseUrl, fetchPatched);
this.introduction = new IntroductionApi(cfg, baseUrl, fetchPatched);
this.issueCredentialV10 = new IssueCredentialV10Api(cfg, baseUrl, fetchPatched);
this.issueCredentialV20 = new IssueCredentialV20Api(cfg, baseUrl, fetchPatched);
this.jsonld = new JsonldApi(cfg, baseUrl, fetchPatched);
this.ledger = new LedgerApi(cfg, baseUrl, fetchPatched);
this.mediation = new MediationApi(cfg, baseUrl, fetchPatched);
this.outOfBand = new OutOfBandApi(cfg, baseUrl, fetchPatched);
this.presentProofV10 = new PresentProofV10Api(cfg, baseUrl, fetchPatched);
this.presentProofV20 = new PresentProofV20Api(cfg, baseUrl, fetchPatched);
this.resolver = new ResolverApi(cfg, baseUrl, fetchPatched);
this.revocation = new RevocationApi(cfg, baseUrl, fetchPatched);
this.schema = new SchemaApi(cfg, baseUrl, fetchPatched);
this.server = new ServerApi(cfg, baseUrl, fetchPatched);
this.trustping = new TrustpingApi(cfg, baseUrl, fetchPatched);
this.wallet = new WalletApi(cfg, baseUrl, fetchPatched);
}
}
export default new ApiAcapy();