@credebl/ssi-mobile-openid4vc 2.0.2-alpha-20251027052801
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.mts +576 -0
- package/build/index.d.ts +576 -0
- package/build/index.js +1241 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +1161 -0
- package/build/index.mjs.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import * as _credo_ts_core0 from "@credo-ts/core";
|
|
2
|
+
import { Agent, ClaimFormat, DcqlCredentialsForRequest, DcqlQueryResult, DifPexCredentialsForRequest, JwkJson, Mdoc, Mdoc as Mdoc$1, MdocNameSpaces, MdocRecord, MdocRecord as MdocRecord$1, SdJwtVc, SdJwtVcPayload, SdJwtVcRecord, SdJwtVcRecord as SdJwtVcRecord$1, SdJwtVcSignOptions, SdJwtVcTypeMetadata, W3cCredentialRecord, W3cCredentialRecord as W3cCredentialRecord$1, X509Module, X509ModuleConfigOptions } from "@credo-ts/core";
|
|
3
|
+
import { GenericRecord } from "@credo-ts/core/build/modules/generic-records/repository/GenericRecord";
|
|
4
|
+
import * as _credo_ts_openid4vc0 from "@credo-ts/openid4vc";
|
|
5
|
+
import { OpenId4VcHolderModule, OpenId4VciAuthorizationFlow, OpenId4VciCredentialConfigurationSupported, OpenId4VciCredentialConfigurationSupportedWithFormats, OpenId4VciCredentialIssuerMetadataDisplay, OpenId4VciRequestTokenResponse, OpenId4VciRequestTokenResponse as OpenId4VciRequestTokenResponse$1, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedAuthorizationRequest as OpenId4VciResolvedAuthorizationRequest$1, OpenId4VciResolvedCredentialOffer, OpenId4VciResolvedCredentialOffer as OpenId4VciResolvedCredentialOffer$1, OpenId4VciTxCode, OpenId4VpResolvedAuthorizationRequest } from "@credo-ts/openid4vc";
|
|
6
|
+
import { MobileSDKModule } from "@credebl/ssi-mobile-core";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { PropsWithChildren } from "react";
|
|
9
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/metadata/metadata.d.ts
|
|
12
|
+
type CredentialDisplayClaims = (OpenId4VciCredentialConfigurationSupportedWithFormats & {
|
|
13
|
+
format: 'vc+sd-jwt';
|
|
14
|
+
})['claims'] | (OpenId4VciCredentialConfigurationSupportedWithFormats & {
|
|
15
|
+
format: 'dc+sd-jwt';
|
|
16
|
+
})['claims'];
|
|
17
|
+
interface OpenId4VcCredentialMetadata {
|
|
18
|
+
credential: {
|
|
19
|
+
display?: OpenId4VciCredentialConfigurationSupported['display'];
|
|
20
|
+
claims?: CredentialDisplayClaims;
|
|
21
|
+
order?: OpenId4VciCredentialConfigurationSupportedWithFormats['order'];
|
|
22
|
+
};
|
|
23
|
+
issuer: {
|
|
24
|
+
display?: OpenId4VciCredentialIssuerMetadataDisplay[];
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/display/display.d.ts
|
|
30
|
+
type CredentialForDisplayId = `w3c-credential-${string}` | `sd-jwt-vc-${string}` | `mdoc-${string}`;
|
|
31
|
+
interface FormattedSubmissionEntrySatisfiedCredential {
|
|
32
|
+
credential: CredentialForDisplay;
|
|
33
|
+
/**
|
|
34
|
+
* If not present the whole credential will be disclosed
|
|
35
|
+
*/
|
|
36
|
+
disclosed: {
|
|
37
|
+
attributes: CredentialForDisplay['attributes'];
|
|
38
|
+
metadata: CredentialForDisplay['metadata'];
|
|
39
|
+
paths: string[][];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
interface DisplayImage {
|
|
43
|
+
url?: string;
|
|
44
|
+
altText?: string;
|
|
45
|
+
}
|
|
46
|
+
interface CredentialDisplay {
|
|
47
|
+
name: string;
|
|
48
|
+
locale?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
textColor?: string;
|
|
51
|
+
backgroundColor?: string;
|
|
52
|
+
backgroundImage?: DisplayImage;
|
|
53
|
+
issuer: CredentialIssuerDisplay;
|
|
54
|
+
}
|
|
55
|
+
interface CredentialIssuerDisplay {
|
|
56
|
+
name: string;
|
|
57
|
+
domain?: string;
|
|
58
|
+
locale?: string;
|
|
59
|
+
logo?: DisplayImage;
|
|
60
|
+
}
|
|
61
|
+
type W3cIssuerJson = {
|
|
62
|
+
id: string;
|
|
63
|
+
};
|
|
64
|
+
type W3cCredentialSubjectJson = {
|
|
65
|
+
id?: string;
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
};
|
|
68
|
+
type W3cCredentialJson = {
|
|
69
|
+
type: Array<string>;
|
|
70
|
+
issuer: W3cIssuerJson;
|
|
71
|
+
issuanceDate: string;
|
|
72
|
+
expiryDate?: string;
|
|
73
|
+
credentialSubject: W3cCredentialSubjectJson | W3cCredentialSubjectJson[];
|
|
74
|
+
};
|
|
75
|
+
type JffW3cCredentialJson = W3cCredentialJson & {
|
|
76
|
+
name?: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
credentialBranding?: {
|
|
79
|
+
backgroundColor?: string;
|
|
80
|
+
};
|
|
81
|
+
issuer: string | (W3cIssuerJson & {
|
|
82
|
+
name?: string;
|
|
83
|
+
iconUrl?: string;
|
|
84
|
+
logoUrl?: string;
|
|
85
|
+
image?: string | {
|
|
86
|
+
id?: string;
|
|
87
|
+
type?: 'Image';
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
interface DisplayImage {
|
|
92
|
+
url?: string;
|
|
93
|
+
altText?: string;
|
|
94
|
+
}
|
|
95
|
+
interface CredentialDisplay {
|
|
96
|
+
name: string;
|
|
97
|
+
locale?: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
textColor?: string;
|
|
100
|
+
backgroundColor?: string;
|
|
101
|
+
backgroundImage?: DisplayImage;
|
|
102
|
+
issuer: CredentialIssuerDisplay;
|
|
103
|
+
}
|
|
104
|
+
interface CredentialIssuerDisplay {
|
|
105
|
+
name: string;
|
|
106
|
+
domain?: string;
|
|
107
|
+
locale?: string;
|
|
108
|
+
logo?: DisplayImage;
|
|
109
|
+
}
|
|
110
|
+
interface CredentialMetadata {
|
|
111
|
+
/**
|
|
112
|
+
* vct (sd-jwt) or doctype (mdoc) or last type entry (w3c)
|
|
113
|
+
*/
|
|
114
|
+
type: string;
|
|
115
|
+
/**
|
|
116
|
+
* issuer identifier. did or https url
|
|
117
|
+
*/
|
|
118
|
+
issuer?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Holder identifier. did or jwk thubmprint
|
|
121
|
+
*/
|
|
122
|
+
holder?: string;
|
|
123
|
+
validUntil?: string;
|
|
124
|
+
validFrom?: string;
|
|
125
|
+
issuedAt?: string;
|
|
126
|
+
hasRefreshToken?: boolean;
|
|
127
|
+
status?: unknown;
|
|
128
|
+
}
|
|
129
|
+
interface CredentialForDisplay {
|
|
130
|
+
id: CredentialForDisplayId;
|
|
131
|
+
createdAt: Date;
|
|
132
|
+
display: CredentialDisplay;
|
|
133
|
+
attributes: Record<string, unknown>;
|
|
134
|
+
rawAttributes: Record<string, unknown>;
|
|
135
|
+
metadata: CredentialMetadata;
|
|
136
|
+
claimFormat: ClaimFormat.SdJwtVc | ClaimFormat.MsoMdoc | ClaimFormat.JwtVc | ClaimFormat.LdpVc;
|
|
137
|
+
record: W3cCredentialRecord$1 | MdocRecord$1 | SdJwtVcRecord$1;
|
|
138
|
+
category?: CredentialCategoryMetadata;
|
|
139
|
+
hasRefreshToken: boolean;
|
|
140
|
+
}
|
|
141
|
+
interface CredentialCategoryMetadata {
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
credentialCategory: string;
|
|
146
|
+
/**
|
|
147
|
+
* Whether this instance of the canonical records should be displayed by default
|
|
148
|
+
*/
|
|
149
|
+
displayPriority?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* @default true
|
|
152
|
+
*/
|
|
153
|
+
canDeleteCredential?: boolean;
|
|
154
|
+
}
|
|
155
|
+
interface CredentialForDisplay {
|
|
156
|
+
id: CredentialForDisplayId;
|
|
157
|
+
createdAt: Date;
|
|
158
|
+
display: CredentialDisplay;
|
|
159
|
+
attributes: Record<string, unknown>;
|
|
160
|
+
rawAttributes: Record<string, unknown>;
|
|
161
|
+
metadata: CredentialMetadata;
|
|
162
|
+
claimFormat: ClaimFormat.SdJwtVc | ClaimFormat.MsoMdoc | ClaimFormat.JwtVc | ClaimFormat.LdpVc;
|
|
163
|
+
record: W3cCredentialRecord$1 | MdocRecord$1 | SdJwtVcRecord$1;
|
|
164
|
+
category?: CredentialCategoryMetadata;
|
|
165
|
+
hasRefreshToken: boolean;
|
|
166
|
+
}
|
|
167
|
+
declare function getCredentialDisplayWithDefaults(credentialDisplay?: Partial<CredentialDisplay>): CredentialDisplay;
|
|
168
|
+
declare function getIssuerDisplay(metadata: OpenId4VcCredentialMetadata | null | undefined, preferredLocale?: string): Partial<CredentialIssuerDisplay>;
|
|
169
|
+
declare function processIssuerDisplay(metadata: OpenId4VcCredentialMetadata | null | undefined, issuerDisplay: Partial<CredentialIssuerDisplay>): CredentialIssuerDisplay;
|
|
170
|
+
declare function getSdJwtIssuerDisplay(openId4VcMetadata?: OpenId4VcCredentialMetadata | null): CredentialIssuerDisplay;
|
|
171
|
+
declare function getCredentialDisplay(credentialPayload: Record<string, unknown>, openId4VcMetadata?: OpenId4VcCredentialMetadata | null, preferredLocale?: string): Partial<CredentialDisplay>;
|
|
172
|
+
declare function getW3cCredentialDisplay(credential: W3cCredentialJson, openId4VcMetadata?: OpenId4VcCredentialMetadata | null): {
|
|
173
|
+
name: string;
|
|
174
|
+
locale?: string | undefined;
|
|
175
|
+
description?: string | undefined;
|
|
176
|
+
textColor?: string | undefined;
|
|
177
|
+
backgroundColor?: string | undefined;
|
|
178
|
+
backgroundImage?: DisplayImage | undefined;
|
|
179
|
+
issuer?: CredentialIssuerDisplay | undefined;
|
|
180
|
+
};
|
|
181
|
+
declare function getSdJwtTypeMetadataCredentialDisplay(sdJwtTypeMetadata: SdJwtVcTypeMetadata, preferredLocale?: string): Omit<CredentialDisplay, 'issuer' | 'name'> & {
|
|
182
|
+
name?: string;
|
|
183
|
+
};
|
|
184
|
+
declare function getSdJwtCredentialDisplay(credentialPayload: Record<string, unknown>, openId4VcMetadata?: OpenId4VcCredentialMetadata | null, typeMetadata?: SdJwtVcTypeMetadata | null, preferredLocal?: string): {
|
|
185
|
+
name: string;
|
|
186
|
+
locale?: string | undefined;
|
|
187
|
+
description?: string | undefined;
|
|
188
|
+
textColor?: string | undefined;
|
|
189
|
+
backgroundColor?: string | undefined;
|
|
190
|
+
backgroundImage?: DisplayImage | undefined;
|
|
191
|
+
issuer?: CredentialIssuerDisplay | undefined;
|
|
192
|
+
};
|
|
193
|
+
declare function filterAndMapSdJwtKeys(sdJwtVcPayload: Record<string, unknown>): {
|
|
194
|
+
visibleProperties: {
|
|
195
|
+
[key: string]: unknown;
|
|
196
|
+
};
|
|
197
|
+
metadata: CredentialMetadata;
|
|
198
|
+
raw: {
|
|
199
|
+
issuedAt: Date | undefined;
|
|
200
|
+
validUntil: Date | undefined;
|
|
201
|
+
validFrom: Date | undefined;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
declare function getCredentialCategoryMetadata(credentialRecord: W3cCredentialRecord$1 | SdJwtVcRecord$1 | MdocRecord$1): CredentialCategoryMetadata | null;
|
|
205
|
+
declare function getCredentialForDisplayId(credentialRecord: W3cCredentialRecord$1 | SdJwtVcRecord$1 | MdocRecord$1): CredentialForDisplayId;
|
|
206
|
+
declare function getDisclosedAttributeNamesForDisplay(credential: FormattedSubmissionEntrySatisfiedCredential): string[];
|
|
207
|
+
declare function getCredentialForDisplay(credentialRecord: W3cCredentialRecord$1 | SdJwtVcRecord$1 | MdocRecord$1, preferredLocale?: string): CredentialForDisplay;
|
|
208
|
+
declare function getOpenId4VcIssuerDisplay(openId4VcMetadata?: OpenId4VcCredentialMetadata | null, preferredLocale?: string): CredentialIssuerDisplay;
|
|
209
|
+
declare function getOpenId4VcCredentialDisplay(openId4VcMetadata: OpenId4VcCredentialMetadata, preferredLocale?: string): Omit<CredentialDisplay, "name"> & {
|
|
210
|
+
name?: string;
|
|
211
|
+
};
|
|
212
|
+
declare function getAttributesAndMetadataForMdocPayload(namespaces: MdocNameSpaces, mdocInstance: Mdoc$1): {
|
|
213
|
+
attributes: Record<string, unknown>;
|
|
214
|
+
metadata: CredentialMetadata;
|
|
215
|
+
};
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/display/proof.d.ts
|
|
218
|
+
type MappedAttributesReturnType = string | number | boolean | {
|
|
219
|
+
[key: string]: MappedAttributesReturnType;
|
|
220
|
+
} | null | undefined | Array<MappedAttributesReturnType>;
|
|
221
|
+
interface FormattedSubmission {
|
|
222
|
+
name?: string;
|
|
223
|
+
purpose?: string;
|
|
224
|
+
areAllSatisfied: boolean;
|
|
225
|
+
entries: FormattedSubmissionEntry[];
|
|
226
|
+
}
|
|
227
|
+
interface OpenId4VPRequestRecord extends OpenId4VpResolvedAuthorizationRequest {
|
|
228
|
+
verifierHostName: string | undefined;
|
|
229
|
+
createdAt: string | Date;
|
|
230
|
+
credentialsForRequest: DifPexCredentialsForRequest | undefined;
|
|
231
|
+
type: string;
|
|
232
|
+
}
|
|
233
|
+
interface FormattedSubmissionEntrySatisfied {
|
|
234
|
+
/**
|
|
235
|
+
* can be either:
|
|
236
|
+
* - AnonCreds groupName
|
|
237
|
+
* - PEX inputDescriptorId
|
|
238
|
+
* - DCQL credential query id
|
|
239
|
+
*/
|
|
240
|
+
inputDescriptorId: string;
|
|
241
|
+
name?: string;
|
|
242
|
+
description?: string;
|
|
243
|
+
/**
|
|
244
|
+
* Whether the entry is satisfied
|
|
245
|
+
*/
|
|
246
|
+
isSatisfied: true;
|
|
247
|
+
/**
|
|
248
|
+
* Credentials that match the request entry. Wallet always needs to pick one.
|
|
249
|
+
*/
|
|
250
|
+
credentials: [FormattedSubmissionEntrySatisfiedCredential, ...FormattedSubmissionEntrySatisfiedCredential[]];
|
|
251
|
+
}
|
|
252
|
+
interface FormattedSubmissionEntryNotSatisfied {
|
|
253
|
+
/**
|
|
254
|
+
* can be either:
|
|
255
|
+
* - AnonCreds groupName
|
|
256
|
+
* - PEX inputDescriptorId
|
|
257
|
+
* - DCQL credential query id
|
|
258
|
+
*/
|
|
259
|
+
inputDescriptorId: string;
|
|
260
|
+
name?: string;
|
|
261
|
+
description?: string;
|
|
262
|
+
/**
|
|
263
|
+
* Whether the entry is satisfied
|
|
264
|
+
*/
|
|
265
|
+
isSatisfied: false;
|
|
266
|
+
requestedAttributePaths: Array<Array<string | number | null>>;
|
|
267
|
+
}
|
|
268
|
+
type FormattedSubmissionEntry = FormattedSubmissionEntryNotSatisfied | FormattedSubmissionEntrySatisfied;
|
|
269
|
+
declare function getDisclosedAttributePathArrays(payload: object, maxDepth?: number | undefined, prefix?: string[]): string[][];
|
|
270
|
+
declare function getAttributesAndMetadataForSdJwtPayload(sdJwtVcPayload: Record<string, unknown>): {
|
|
271
|
+
attributes: {
|
|
272
|
+
[k: string]: MappedAttributesReturnType;
|
|
273
|
+
};
|
|
274
|
+
metadata: CredentialMetadata;
|
|
275
|
+
raw: {
|
|
276
|
+
issuedAt: Date | undefined;
|
|
277
|
+
validUntil: Date | undefined;
|
|
278
|
+
validFrom: Date | undefined;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
declare function safeCalculateJwkThumbprint(jwk: JwkJson): string | undefined;
|
|
282
|
+
declare function recursivelyMapAttributes(value: unknown): MappedAttributesReturnType;
|
|
283
|
+
declare function getSelectedCredentialsForRequest(dcqlQueryResult: DcqlQueryResult, selectedCredentials: {
|
|
284
|
+
[credentialQueryId: string]: string;
|
|
285
|
+
}): DcqlCredentialsForRequest;
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/resolverProof.d.ts
|
|
288
|
+
type TrustedX509Entity = {
|
|
289
|
+
certificate: string;
|
|
290
|
+
name: string;
|
|
291
|
+
logoUri: string;
|
|
292
|
+
url: string;
|
|
293
|
+
};
|
|
294
|
+
type GetCredentialsForProofRequestOptions = {
|
|
295
|
+
requestPayload?: Record<string, unknown>;
|
|
296
|
+
uri?: string;
|
|
297
|
+
allowUntrustedFederation?: boolean;
|
|
298
|
+
origin?: string;
|
|
299
|
+
trustedX509Entities?: TrustedX509Entity[];
|
|
300
|
+
preferredLocale?: string;
|
|
301
|
+
};
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/OpenIDSdk.d.ts
|
|
304
|
+
type CredentialsForProofRequest = Awaited<ReturnType<OpenID4VCSDK['getCredentialsForProofRequest']>>;
|
|
305
|
+
type OpenId4VcConfiguration = {} & X509ModuleConfigOptions;
|
|
306
|
+
declare const getOpenid4VcModules: (configuration: OpenId4VcConfiguration) => {
|
|
307
|
+
readonly openId4VcHolder: OpenId4VcHolderModule;
|
|
308
|
+
readonly x509: X509Module;
|
|
309
|
+
};
|
|
310
|
+
type OpenId4VcAgent = Agent<ReturnType<typeof getOpenid4VcModules>>;
|
|
311
|
+
declare class OpenID4VCSDK implements MobileSDKModule {
|
|
312
|
+
private agent?;
|
|
313
|
+
private configuration;
|
|
314
|
+
constructor(configuration: OpenId4VcConfiguration);
|
|
315
|
+
private assertAndGetAgent;
|
|
316
|
+
initialize(agent: OpenId4VcAgent): void;
|
|
317
|
+
getAgentModules(): {
|
|
318
|
+
readonly openId4VcHolder: OpenId4VcHolderModule;
|
|
319
|
+
readonly x509: X509Module;
|
|
320
|
+
};
|
|
321
|
+
static OpenIDProvider({
|
|
322
|
+
agent,
|
|
323
|
+
children
|
|
324
|
+
}: PropsWithChildren<{
|
|
325
|
+
agent: Agent;
|
|
326
|
+
}>): react_jsx_runtime0.JSX.Element;
|
|
327
|
+
resolveOpenId4VciOffer({
|
|
328
|
+
offer,
|
|
329
|
+
authorization,
|
|
330
|
+
customHeaders,
|
|
331
|
+
fetchAuthorization
|
|
332
|
+
}: {
|
|
333
|
+
offer: {
|
|
334
|
+
uri: string;
|
|
335
|
+
};
|
|
336
|
+
authorization?: {
|
|
337
|
+
clientId: string;
|
|
338
|
+
redirectUri: string;
|
|
339
|
+
};
|
|
340
|
+
customHeaders?: Record<string, unknown>;
|
|
341
|
+
fetchAuthorization?: boolean;
|
|
342
|
+
}): Promise<{
|
|
343
|
+
resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer$1;
|
|
344
|
+
resolvedAuthorizationRequest: OpenId4VciResolvedAuthorizationRequest$1 | undefined;
|
|
345
|
+
}>;
|
|
346
|
+
acquirePreAuthorizedAccessToken({
|
|
347
|
+
resolvedCredentialOffer,
|
|
348
|
+
txCode
|
|
349
|
+
}: {
|
|
350
|
+
resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer$1;
|
|
351
|
+
txCode?: string;
|
|
352
|
+
}): Promise<OpenId4VciRequestTokenResponse$1>;
|
|
353
|
+
receiveCredentialFromOpenId4VciOffer({
|
|
354
|
+
resolvedCredentialOffer,
|
|
355
|
+
credentialConfigurationIdsToRequest,
|
|
356
|
+
accessToken,
|
|
357
|
+
clientId,
|
|
358
|
+
pidSchemes,
|
|
359
|
+
requestBatch
|
|
360
|
+
}: {
|
|
361
|
+
resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer$1;
|
|
362
|
+
credentialConfigurationIdsToRequest?: string[];
|
|
363
|
+
clientId?: string;
|
|
364
|
+
pidSchemes?: {
|
|
365
|
+
sdJwtVcVcts: Array<string>;
|
|
366
|
+
msoMdocDoctypes: Array<string>;
|
|
367
|
+
};
|
|
368
|
+
requestBatch?: boolean | number;
|
|
369
|
+
accessToken: OpenId4VciRequestTokenResponse$1;
|
|
370
|
+
}): Promise<Array<{
|
|
371
|
+
credentialConfigurationId: string;
|
|
372
|
+
configuration: OpenId4VciCredentialConfigurationSupportedWithFormats;
|
|
373
|
+
credential: SdJwtVcRecord$1 | MdocRecord$1 | W3cCredentialRecord$1;
|
|
374
|
+
}>>;
|
|
375
|
+
storeOpenIdCredential(cred: W3cCredentialRecord$1 | SdJwtVcRecord$1 | MdocRecord$1): Promise<void>;
|
|
376
|
+
acquireAuthorizationCodeAccessToken({
|
|
377
|
+
resolvedCredentialOffer,
|
|
378
|
+
codeVerifier,
|
|
379
|
+
authorizationCode,
|
|
380
|
+
clientId,
|
|
381
|
+
redirectUri
|
|
382
|
+
}: {
|
|
383
|
+
resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer$1;
|
|
384
|
+
codeVerifier?: string;
|
|
385
|
+
authorizationCode: string;
|
|
386
|
+
clientId: string;
|
|
387
|
+
redirectUri?: string;
|
|
388
|
+
}): Promise<OpenId4VciRequestTokenResponse$1>;
|
|
389
|
+
getCredentialsForProofRequest({
|
|
390
|
+
uri,
|
|
391
|
+
requestPayload,
|
|
392
|
+
allowUntrustedFederation,
|
|
393
|
+
origin,
|
|
394
|
+
trustedX509Entities,
|
|
395
|
+
preferredLocale
|
|
396
|
+
}: GetCredentialsForProofRequestOptions): Promise<{
|
|
397
|
+
readonly origin: string | undefined;
|
|
398
|
+
readonly verifier: {
|
|
399
|
+
readonly hostName: string | undefined;
|
|
400
|
+
readonly entityId: string;
|
|
401
|
+
readonly logo: {
|
|
402
|
+
url: string;
|
|
403
|
+
} | undefined;
|
|
404
|
+
readonly name: string | undefined;
|
|
405
|
+
};
|
|
406
|
+
readonly authorizationRequest: _credo_ts_openid4vc0.OpenId4VpAuthorizationRequestPayload;
|
|
407
|
+
readonly formattedSubmission: FormattedSubmission;
|
|
408
|
+
readonly transactionData: {
|
|
409
|
+
entry: _credo_ts_openid4vc0.ParsedTransactionDataEntry;
|
|
410
|
+
matchedCredentialIds: string[];
|
|
411
|
+
}[] | undefined;
|
|
412
|
+
readonly queryResult?: _credo_ts_core0.DcqlQueryResult | undefined;
|
|
413
|
+
readonly definition?: _credo_ts_core0.DifPresentationExchangeDefinition | undefined;
|
|
414
|
+
readonly credentialsForRequest?: _credo_ts_core0.DifPexCredentialsForRequest | undefined;
|
|
415
|
+
}>;
|
|
416
|
+
shareProof({
|
|
417
|
+
resolvedRequest,
|
|
418
|
+
selectedCredentials,
|
|
419
|
+
acceptTransactionData
|
|
420
|
+
}: {
|
|
421
|
+
resolvedRequest: CredentialsForProofRequest;
|
|
422
|
+
selectedCredentials: {
|
|
423
|
+
[inputDescriptorId: string]: string;
|
|
424
|
+
};
|
|
425
|
+
acceptTransactionData?: boolean;
|
|
426
|
+
}): Promise<{
|
|
427
|
+
readonly ok: true;
|
|
428
|
+
readonly authorizationResponse: ({
|
|
429
|
+
vp_token: string | Record<string, any> | Record<string, string | Record<string, any>> | [string | Record<string, any>, ...(string | Record<string, any>)[]];
|
|
430
|
+
presentation_submission?: any;
|
|
431
|
+
access_token?: string | undefined;
|
|
432
|
+
token_type?: string | undefined;
|
|
433
|
+
expires_in?: number | undefined;
|
|
434
|
+
state?: string | undefined;
|
|
435
|
+
refresh_token?: string | undefined;
|
|
436
|
+
id_token?: string | undefined;
|
|
437
|
+
} & {
|
|
438
|
+
[k: string]: unknown;
|
|
439
|
+
} & {
|
|
440
|
+
presentation_submission?: _credo_ts_core0.DifPresentationExchangeSubmission;
|
|
441
|
+
}) | {
|
|
442
|
+
response: string;
|
|
443
|
+
};
|
|
444
|
+
readonly authorizationResponsePayload: {
|
|
445
|
+
vp_token: string | Record<string, any> | Record<string, string | Record<string, any>> | [string | Record<string, any>, ...(string | Record<string, any>)[]];
|
|
446
|
+
presentation_submission?: any;
|
|
447
|
+
access_token?: string | undefined;
|
|
448
|
+
token_type?: string | undefined;
|
|
449
|
+
expires_in?: number | undefined;
|
|
450
|
+
state?: string | undefined;
|
|
451
|
+
refresh_token?: string | undefined;
|
|
452
|
+
id_token?: string | undefined;
|
|
453
|
+
} & {
|
|
454
|
+
[k: string]: unknown;
|
|
455
|
+
} & {
|
|
456
|
+
presentation_submission?: _credo_ts_core0.DifPresentationExchangeSubmission;
|
|
457
|
+
};
|
|
458
|
+
readonly serverResponse?: undefined;
|
|
459
|
+
readonly redirectUri?: undefined;
|
|
460
|
+
readonly presentationDuringIssuanceSession?: undefined;
|
|
461
|
+
} | {
|
|
462
|
+
readonly ok: false;
|
|
463
|
+
readonly serverResponse: {
|
|
464
|
+
readonly status: number;
|
|
465
|
+
readonly body: string | Record<string, unknown> | null;
|
|
466
|
+
};
|
|
467
|
+
readonly authorizationResponse: ({
|
|
468
|
+
vp_token: string | Record<string, any> | Record<string, string | Record<string, any>> | [string | Record<string, any>, ...(string | Record<string, any>)[]];
|
|
469
|
+
presentation_submission?: any;
|
|
470
|
+
access_token?: string | undefined;
|
|
471
|
+
token_type?: string | undefined;
|
|
472
|
+
expires_in?: number | undefined;
|
|
473
|
+
state?: string | undefined;
|
|
474
|
+
refresh_token?: string | undefined;
|
|
475
|
+
id_token?: string | undefined;
|
|
476
|
+
} & {
|
|
477
|
+
[k: string]: unknown;
|
|
478
|
+
} & {
|
|
479
|
+
presentation_submission?: _credo_ts_core0.DifPresentationExchangeSubmission;
|
|
480
|
+
}) | {
|
|
481
|
+
response: string;
|
|
482
|
+
};
|
|
483
|
+
readonly authorizationResponsePayload: {
|
|
484
|
+
vp_token: string | Record<string, any> | Record<string, string | Record<string, any>> | [string | Record<string, any>, ...(string | Record<string, any>)[]];
|
|
485
|
+
presentation_submission?: any;
|
|
486
|
+
access_token?: string | undefined;
|
|
487
|
+
token_type?: string | undefined;
|
|
488
|
+
expires_in?: number | undefined;
|
|
489
|
+
state?: string | undefined;
|
|
490
|
+
refresh_token?: string | undefined;
|
|
491
|
+
id_token?: string | undefined;
|
|
492
|
+
} & {
|
|
493
|
+
[k: string]: unknown;
|
|
494
|
+
} & {
|
|
495
|
+
presentation_submission?: _credo_ts_core0.DifPresentationExchangeSubmission;
|
|
496
|
+
};
|
|
497
|
+
readonly redirectUri?: undefined;
|
|
498
|
+
readonly presentationDuringIssuanceSession?: undefined;
|
|
499
|
+
} | {
|
|
500
|
+
readonly ok: true;
|
|
501
|
+
readonly serverResponse: {
|
|
502
|
+
readonly status: number;
|
|
503
|
+
readonly body: Record<string, unknown>;
|
|
504
|
+
};
|
|
505
|
+
readonly authorizationResponse: ({
|
|
506
|
+
vp_token: string | Record<string, any> | Record<string, string | Record<string, any>> | [string | Record<string, any>, ...(string | Record<string, any>)[]];
|
|
507
|
+
presentation_submission?: any;
|
|
508
|
+
access_token?: string | undefined;
|
|
509
|
+
token_type?: string | undefined;
|
|
510
|
+
expires_in?: number | undefined;
|
|
511
|
+
state?: string | undefined;
|
|
512
|
+
refresh_token?: string | undefined;
|
|
513
|
+
id_token?: string | undefined;
|
|
514
|
+
} & {
|
|
515
|
+
[k: string]: unknown;
|
|
516
|
+
} & {
|
|
517
|
+
presentation_submission?: _credo_ts_core0.DifPresentationExchangeSubmission;
|
|
518
|
+
}) | {
|
|
519
|
+
response: string;
|
|
520
|
+
};
|
|
521
|
+
readonly authorizationResponsePayload: {
|
|
522
|
+
vp_token: string | Record<string, any> | Record<string, string | Record<string, any>> | [string | Record<string, any>, ...(string | Record<string, any>)[]];
|
|
523
|
+
presentation_submission?: any;
|
|
524
|
+
access_token?: string | undefined;
|
|
525
|
+
token_type?: string | undefined;
|
|
526
|
+
expires_in?: number | undefined;
|
|
527
|
+
state?: string | undefined;
|
|
528
|
+
refresh_token?: string | undefined;
|
|
529
|
+
id_token?: string | undefined;
|
|
530
|
+
} & {
|
|
531
|
+
[k: string]: unknown;
|
|
532
|
+
} & {
|
|
533
|
+
presentation_submission?: _credo_ts_core0.DifPresentationExchangeSubmission;
|
|
534
|
+
};
|
|
535
|
+
readonly redirectUri: string | undefined;
|
|
536
|
+
readonly presentationDuringIssuanceSession: string | undefined;
|
|
537
|
+
}>;
|
|
538
|
+
getSubmissionForMdocDocumentRequest(encodedDeviceRequest: Uint8Array): Promise<{
|
|
539
|
+
areAllSatisfied: boolean;
|
|
540
|
+
entries: FormattedSubmissionEntry[];
|
|
541
|
+
}>;
|
|
542
|
+
signAndStoreCredential({
|
|
543
|
+
format,
|
|
544
|
+
payload
|
|
545
|
+
}: {
|
|
546
|
+
format: 'sd-jwt';
|
|
547
|
+
payload: SdJwtVcSignOptions<SdJwtVcPayload>;
|
|
548
|
+
}): Promise<SdJwtVcRecord$1>;
|
|
549
|
+
}
|
|
550
|
+
//#endregion
|
|
551
|
+
//#region src/providers/SdJwtVcProvider.d.ts
|
|
552
|
+
type SdJwtVcRecordState = {
|
|
553
|
+
sdJwtVcRecords: Array<SdJwtVcRecord$1>;
|
|
554
|
+
isLoading: boolean;
|
|
555
|
+
};
|
|
556
|
+
declare const useSdJwtVcRecords: () => SdJwtVcRecordState;
|
|
557
|
+
declare const useSdJwtVcRecordById: (id: string) => SdJwtVcRecord$1 | undefined;
|
|
558
|
+
interface Props$1 {
|
|
559
|
+
agent: Agent;
|
|
560
|
+
}
|
|
561
|
+
declare const SdJwtVcRecordProvider: React.FC<PropsWithChildren<Props$1>>;
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region src/providers/MdocProvider.d.ts
|
|
564
|
+
type MdocRecordState = {
|
|
565
|
+
mdocRecords: Array<MdocRecord$1>;
|
|
566
|
+
isLoading: boolean;
|
|
567
|
+
};
|
|
568
|
+
declare const useMdocRecords: () => MdocRecordState;
|
|
569
|
+
declare const useMdocRecordById: (id: string) => MdocRecord$1 | undefined;
|
|
570
|
+
interface Props {
|
|
571
|
+
agent: Agent;
|
|
572
|
+
}
|
|
573
|
+
declare const MdocRecordProvider: React$1.FC<PropsWithChildren<Props>>;
|
|
574
|
+
//#endregion
|
|
575
|
+
export { CredentialCategoryMetadata, CredentialDisplay, CredentialForDisplay, CredentialForDisplayId, CredentialIssuerDisplay, CredentialMetadata, CredentialsForProofRequest, DisplayImage, FormattedSubmission, FormattedSubmissionEntry, FormattedSubmissionEntryNotSatisfied, FormattedSubmissionEntrySatisfied, FormattedSubmissionEntrySatisfiedCredential, GenericRecord, JffW3cCredentialJson, Mdoc, MdocRecord, MdocRecordProvider, OpenID4VCSDK, OpenId4VPRequestRecord, OpenId4VcAgent, OpenId4VcConfiguration, OpenId4VciAuthorizationFlow, OpenId4VciRequestTokenResponse, OpenId4VciResolvedAuthorizationRequest, OpenId4VciResolvedCredentialOffer, OpenId4VciTxCode, SdJwtVc, SdJwtVcRecord, SdJwtVcRecordProvider, W3cCredentialJson, W3cCredentialRecord, W3cCredentialSubjectJson, W3cIssuerJson, filterAndMapSdJwtKeys, getAttributesAndMetadataForMdocPayload, getAttributesAndMetadataForSdJwtPayload, getCredentialCategoryMetadata, getCredentialDisplay, getCredentialDisplayWithDefaults, getCredentialForDisplay, getCredentialForDisplayId, getDisclosedAttributeNamesForDisplay, getDisclosedAttributePathArrays, getIssuerDisplay, getOpenId4VcCredentialDisplay, getOpenId4VcIssuerDisplay, getOpenid4VcModules, getSdJwtCredentialDisplay, getSdJwtIssuerDisplay, getSdJwtTypeMetadataCredentialDisplay, getSelectedCredentialsForRequest, getW3cCredentialDisplay, processIssuerDisplay, recursivelyMapAttributes, safeCalculateJwkThumbprint, useMdocRecordById, useMdocRecords, useSdJwtVcRecordById, useSdJwtVcRecords };
|
|
576
|
+
//# sourceMappingURL=index.d.mts.map
|