@sphereon/oid4vci-client 0.20.2-next.2 → 0.20.2-next.21
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/dist/index.cjs +574 -116
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +93 -16
- package/dist/index.d.ts +93 -16
- package/dist/index.js +552 -94
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CredentialFormat, ISimpleLogger } from '@sphereon/ssi-types';
|
|
2
2
|
import { CreateDPoPClientOpts, JWK } from '@sphereon/oid4vc-common';
|
|
3
3
|
import * as _sphereon_oid4vci_common from '@sphereon/oid4vci-common';
|
|
4
|
-
import { AccessTokenRequestOpts, OpenIDResponse, AccessTokenResponse, DPoPResponseParams, AccessTokenRequest, TxCodeAndPinRequired, EndpointMetadata, AuthorizationServerOpts, IssuerOpts, RequestObjectOpts, PKCEOpts,
|
|
4
|
+
import { AccessTokenRequestOpts, OpenIDResponse, AccessTokenResponse, DPoPResponseParams, AccessTokenRequest, TxCodeAndPinRequired, EndpointMetadata, AuthorizationServerOpts, IssuerOpts, RequestObjectOpts, PKCEOpts, EndpointMetadataResult as EndpointMetadataResult$1, AuthorizationRequestOpts, CredentialOfferRequestWithBaseUrl, CredentialConfigurationSupported, OpenId4VCIVersion, AuthorizationChallengeRequestOpts, AuthorizationChallengeCodeResponse, CommonAuthorizationChallengeRequest, ExperimentalSubjectIssuance, EndpointMetadataResultV1_0_15, UniformCredentialOfferRequest, CredentialIssuerMetadataV1_0_15, EndpointMetadataResultV1_0, CredentialIssuerMetadataV1_0, Jwt, ProofOfPossessionCallbacks, PoPMode, ProofOfPossession, Alg, Typ, AuthorizationDetailsV1_0_15, AuthorizationDetailsV1_0, OID4VCICredentialFormat, CredentialResponse, CredentialRequest, CredentialRequestV1_0_15, CredentialRequestV1_0, CredentialIssuerMetadata, NotificationRequest, NotificationResponseResult, WellKnownEndpoints, CredentialOfferPayload, SignedMetadataVerifyCallback, CredentialOfferPayloadV1_0_15, IssuerMetadataV1_0_15, CredentialOfferPayloadV1_0, IssuerMetadataV1_0, AuthorizationResponse, CredentialResponseV1_0_15, CredentialConfigurationSupportedV1_0_15, AuthzFlowType } from '@sphereon/oid4vci-common';
|
|
5
5
|
|
|
6
6
|
declare class AccessTokenClient {
|
|
7
7
|
acquireAccessToken(opts: AccessTokenRequestOpts): Promise<OpenIDResponse<AccessTokenResponse, DPoPResponseParams>>;
|
|
@@ -37,10 +37,10 @@ declare function createSignedAuthRequestWhenNeeded(requestObject: Record<string,
|
|
|
37
37
|
}): Promise<void>;
|
|
38
38
|
declare const createAuthorizationRequestUrl: ({ pkce, endpointMetadata, authorizationRequest, credentialOffer, credentialConfigurationSupported, clientId, version, }: {
|
|
39
39
|
pkce: PKCEOpts;
|
|
40
|
-
endpointMetadata:
|
|
40
|
+
endpointMetadata: EndpointMetadataResult$1;
|
|
41
41
|
authorizationRequest: AuthorizationRequestOpts;
|
|
42
42
|
credentialOffer?: CredentialOfferRequestWithBaseUrl;
|
|
43
|
-
credentialConfigurationSupported?: Record<string,
|
|
43
|
+
credentialConfigurationSupported?: Record<string, CredentialConfigurationSupported>;
|
|
44
44
|
clientId?: string;
|
|
45
45
|
version?: OpenId4VCIVersion;
|
|
46
46
|
}) => Promise<string>;
|
|
@@ -109,6 +109,60 @@ declare class CredentialRequestClientBuilderV1_0_15 {
|
|
|
109
109
|
build(): CredentialRequestClient;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
declare class CredentialRequestClientBuilderV1_0 {
|
|
113
|
+
credentialEndpoint?: string;
|
|
114
|
+
deferredCredentialEndpoint?: string;
|
|
115
|
+
nonceEndpoint?: string;
|
|
116
|
+
deferredCredentialAwait: boolean;
|
|
117
|
+
deferredCredentialIntervalInMS: number;
|
|
118
|
+
credentialIdentifiers?: string[];
|
|
119
|
+
credentialConfigurationId?: string;
|
|
120
|
+
credentialTypes?: string[];
|
|
121
|
+
token?: string;
|
|
122
|
+
version?: OpenId4VCIVersion;
|
|
123
|
+
subjectIssuance?: ExperimentalSubjectIssuance;
|
|
124
|
+
issuerState?: string;
|
|
125
|
+
static fromCredentialIssuer({ credentialIssuer, metadata, version, credentialIdentifiers, credentialConfigurationId, credentialTypes, }: {
|
|
126
|
+
credentialIssuer: string;
|
|
127
|
+
metadata?: EndpointMetadataResultV1_0;
|
|
128
|
+
version?: OpenId4VCIVersion;
|
|
129
|
+
credentialIdentifiers?: string[];
|
|
130
|
+
credentialConfigurationId?: string;
|
|
131
|
+
credentialTypes?: string | string[];
|
|
132
|
+
}): CredentialRequestClientBuilderV1_0;
|
|
133
|
+
static fromURI({ uri, metadata, }: {
|
|
134
|
+
uri: string;
|
|
135
|
+
metadata?: EndpointMetadataResultV1_0;
|
|
136
|
+
}): Promise<CredentialRequestClientBuilderV1_0>;
|
|
137
|
+
static fromCredentialOfferRequest(opts: {
|
|
138
|
+
request: UniformCredentialOfferRequest;
|
|
139
|
+
scheme?: string;
|
|
140
|
+
baseUrl?: string;
|
|
141
|
+
version?: OpenId4VCIVersion;
|
|
142
|
+
metadata?: EndpointMetadataResultV1_0;
|
|
143
|
+
}): CredentialRequestClientBuilderV1_0;
|
|
144
|
+
static fromCredentialOffer({ credentialOffer, metadata, }: {
|
|
145
|
+
credentialOffer: CredentialOfferRequestWithBaseUrl;
|
|
146
|
+
metadata?: EndpointMetadataResultV1_0;
|
|
147
|
+
}): CredentialRequestClientBuilderV1_0;
|
|
148
|
+
withCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadataV1_0): this;
|
|
149
|
+
withCredentialEndpoint(credentialEndpoint: string): this;
|
|
150
|
+
withIssuerState(issuerState?: string): this;
|
|
151
|
+
withDeferredCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadataV1_0): this;
|
|
152
|
+
withDeferredCredentialEndpoint(deferredCredentialEndpoint: string): this;
|
|
153
|
+
withNonceEndpointFromMetadata(metadata: CredentialIssuerMetadataV1_0): this;
|
|
154
|
+
withNonceEndpoint(nonceEndpoint: string): this;
|
|
155
|
+
withDeferredCredentialAwait(deferredCredentialAwait: boolean, deferredCredentialIntervalInMS?: number): this;
|
|
156
|
+
withCredentialIdentifiers(credentialIdentifiers: string[]): this;
|
|
157
|
+
withCredentialConfigurationId(credentialConfigurationId: string): this;
|
|
158
|
+
withCredentialType(credentialTypes: string | string[]): this;
|
|
159
|
+
withSubjectIssuance(subjectIssuance: ExperimentalSubjectIssuance): this;
|
|
160
|
+
withToken(accessToken: string): this;
|
|
161
|
+
withTokenFromResponse(response: AccessTokenResponse): this;
|
|
162
|
+
withVersion(version: OpenId4VCIVersion): this;
|
|
163
|
+
build(): CredentialRequestClient;
|
|
164
|
+
}
|
|
165
|
+
|
|
112
166
|
declare class ProofOfPossessionBuilder<DIDDoc = never> {
|
|
113
167
|
private readonly proof?;
|
|
114
168
|
private readonly callbacks?;
|
|
@@ -123,6 +177,8 @@ declare class ProofOfPossessionBuilder<DIDDoc = never> {
|
|
|
123
177
|
private jti?;
|
|
124
178
|
private cNonce?;
|
|
125
179
|
private typ?;
|
|
180
|
+
private proofType;
|
|
181
|
+
private coseKey?;
|
|
126
182
|
private constructor();
|
|
127
183
|
static manual({ jwt, callbacks, version, mode, }: {
|
|
128
184
|
jwt?: Jwt;
|
|
@@ -151,6 +207,8 @@ declare class ProofOfPossessionBuilder<DIDDoc = never> {
|
|
|
151
207
|
withAlg(alg: Alg | string): this;
|
|
152
208
|
withJti(jti: string): this;
|
|
153
209
|
withTyp(typ: Typ): this;
|
|
210
|
+
withProofType(proofType: 'jwt' | 'cwt'): this;
|
|
211
|
+
withCoseKey(coseKey: unknown): this;
|
|
154
212
|
withAccessTokenNonce(cNonce: string): this;
|
|
155
213
|
withAccessTokenResponse(accessToken: AccessTokenResponse): this;
|
|
156
214
|
withEndpointMetadata(endpointMetadata: EndpointMetadata): this;
|
|
@@ -166,13 +224,14 @@ interface CredentialRequestOpts {
|
|
|
166
224
|
deferredCredentialEndpoint?: string;
|
|
167
225
|
credentialTypes?: string[];
|
|
168
226
|
credentialIdentifier?: string;
|
|
227
|
+
credentialIdentifiers?: string[];
|
|
169
228
|
credentialConfigurationId?: string;
|
|
170
229
|
proof: ProofOfPossession;
|
|
171
230
|
token: string;
|
|
172
231
|
version: OpenId4VCIVersion;
|
|
173
232
|
subjectIssuance?: ExperimentalSubjectIssuance;
|
|
174
233
|
issuerState?: string;
|
|
175
|
-
authorizationDetails?: AuthorizationDetailsV1_0_15[];
|
|
234
|
+
authorizationDetails?: (AuthorizationDetailsV1_0_15 | AuthorizationDetailsV1_0)[];
|
|
176
235
|
}
|
|
177
236
|
type CreateCredentialRequestOpts = {
|
|
178
237
|
credentialIdentifier?: string;
|
|
@@ -194,7 +253,7 @@ declare class CredentialRequestClient {
|
|
|
194
253
|
isDeferred(): boolean;
|
|
195
254
|
getCredentialEndpoint(): string;
|
|
196
255
|
getDeferredCredentialEndpoint(): string | undefined;
|
|
197
|
-
constructor(builder: CredentialRequestClientBuilderV1_0_15);
|
|
256
|
+
constructor(builder: CredentialRequestClientBuilderV1_0_15 | CredentialRequestClientBuilderV1_0);
|
|
198
257
|
/**
|
|
199
258
|
* Typically you should not use this method, as it omits a proof from the request.
|
|
200
259
|
* There are certain issuers that in specific circumstances can do without this proof, because they have other means of user binding
|
|
@@ -234,10 +293,10 @@ declare class CredentialRequestClient {
|
|
|
234
293
|
}): Promise<OpenIDResponse<CredentialResponse> & {
|
|
235
294
|
access_token: string;
|
|
236
295
|
}>;
|
|
237
|
-
createCredentialRequestWithoutProof(opts: CreateCredentialRequestOpts): Promise<CredentialRequestV1_0_15>;
|
|
296
|
+
createCredentialRequestWithoutProof(opts: CreateCredentialRequestOpts): Promise<CredentialRequestV1_0_15 | CredentialRequestV1_0>;
|
|
238
297
|
createCredentialRequest(opts: CreateCredentialRequestOpts & {
|
|
239
298
|
proofInput: ProofOfPossessionBuilder | ProofOfPossession;
|
|
240
|
-
}): Promise<CredentialRequestV1_0_15>;
|
|
299
|
+
}): Promise<CredentialRequestV1_0_15 | CredentialRequestV1_0>;
|
|
241
300
|
private createCredentialRequestImpl;
|
|
242
301
|
private version;
|
|
243
302
|
}
|
|
@@ -263,11 +322,12 @@ declare class CredentialOfferClientV1_0_15 {
|
|
|
263
322
|
declare class CredentialRequestClientBuilder {
|
|
264
323
|
private _builder;
|
|
265
324
|
private constructor();
|
|
266
|
-
static fromCredentialIssuer({ credentialIssuer, metadata, version, credentialIdentifier, credentialTypes, }: {
|
|
325
|
+
static fromCredentialIssuer({ credentialIssuer, metadata, version, credentialIdentifier, credentialIdentifiers, credentialTypes, }: {
|
|
267
326
|
credentialIssuer: string;
|
|
268
327
|
metadata?: EndpointMetadata;
|
|
269
328
|
version?: OpenId4VCIVersion;
|
|
270
329
|
credentialIdentifier?: string;
|
|
330
|
+
credentialIdentifiers?: string[];
|
|
271
331
|
credentialTypes?: string | string[];
|
|
272
332
|
}): CredentialRequestClientBuilder;
|
|
273
333
|
static fromURI({ uri, metadata, }: {
|
|
@@ -292,6 +352,7 @@ declare class CredentialRequestClientBuilder {
|
|
|
292
352
|
withDeferredCredentialEndpoint(deferredCredentialEndpoint: string): this;
|
|
293
353
|
withDeferredCredentialAwait(deferredCredentialAwait: boolean, deferredCredentialIntervalInMS?: number): this;
|
|
294
354
|
withCredentialIdentifier(credentialIdentifier: string): this;
|
|
355
|
+
withCredentialIdentifiers(credentialIdentifiers: string[]): this;
|
|
295
356
|
withIssuerState(issuerState?: string): this;
|
|
296
357
|
withCredentialType(credentialTypes: string | string[]): this;
|
|
297
358
|
withSubjectIssuance(subjectIssuance: ExperimentalSubjectIssuance): this;
|
|
@@ -344,20 +405,21 @@ declare class MetadataClient {
|
|
|
344
405
|
*
|
|
345
406
|
* @param credentialOffer
|
|
346
407
|
*/
|
|
347
|
-
static retrieveAllMetadataFromCredentialOffer(credentialOffer: CredentialOfferRequestWithBaseUrl): Promise<
|
|
408
|
+
static retrieveAllMetadataFromCredentialOffer(credentialOffer: CredentialOfferRequestWithBaseUrl): Promise<EndpointMetadataResult$1>;
|
|
348
409
|
/**
|
|
349
410
|
* Retrieve the metada using the initiation request obtained from a previous step
|
|
350
411
|
* @param request
|
|
351
412
|
*/
|
|
352
|
-
static retrieveAllMetadataFromCredentialOfferRequest(request: CredentialOfferPayload): Promise<
|
|
413
|
+
static retrieveAllMetadataFromCredentialOfferRequest(request: CredentialOfferPayload): Promise<EndpointMetadataResult$1>;
|
|
353
414
|
/**
|
|
354
415
|
* Retrieve all metadata from an issuer
|
|
355
416
|
* @param issuer The issuer URL
|
|
356
417
|
* @param opts
|
|
357
418
|
*/
|
|
358
419
|
static retrieveAllMetadata(issuer: string, opts?: {
|
|
359
|
-
errorOnNotFound
|
|
360
|
-
|
|
420
|
+
errorOnNotFound?: boolean;
|
|
421
|
+
signedMetadataVerifyCallback?: SignedMetadataVerifyCallback;
|
|
422
|
+
}): Promise<EndpointMetadataResult$1>;
|
|
361
423
|
/**
|
|
362
424
|
* Retrieve only the OID4VCI metadata for the issuer. So no OIDC/OAuth2 metadata
|
|
363
425
|
*
|
|
@@ -387,7 +449,8 @@ declare class MetadataClientV1_0_15 {
|
|
|
387
449
|
* @param opts
|
|
388
450
|
*/
|
|
389
451
|
static retrieveAllMetadata(issuer: string, opts?: {
|
|
390
|
-
errorOnNotFound
|
|
452
|
+
errorOnNotFound?: boolean;
|
|
453
|
+
signedMetadataVerifyCallback?: SignedMetadataVerifyCallback;
|
|
391
454
|
}): Promise<EndpointMetadataResultV1_0_15>;
|
|
392
455
|
/**
|
|
393
456
|
* Retrieve only the OID4VCI metadata for the issuer. So no OIDC/OAuth2 metadata
|
|
@@ -400,6 +463,18 @@ declare class MetadataClientV1_0_15 {
|
|
|
400
463
|
}): Promise<OpenIDResponse<IssuerMetadataV1_0_15> | undefined>;
|
|
401
464
|
}
|
|
402
465
|
|
|
466
|
+
declare class MetadataClientV1_0 {
|
|
467
|
+
static retrieveAllMetadataFromCredentialOffer(credentialOffer: CredentialOfferRequestWithBaseUrl): Promise<EndpointMetadataResultV1_0>;
|
|
468
|
+
static retrieveAllMetadataFromCredentialOfferRequest(request: CredentialOfferPayloadV1_0): Promise<EndpointMetadataResultV1_0>;
|
|
469
|
+
static retrieveAllMetadata(issuer: string, opts?: {
|
|
470
|
+
errorOnNotFound?: boolean;
|
|
471
|
+
signedMetadataVerifyCallback?: SignedMetadataVerifyCallback;
|
|
472
|
+
}): Promise<EndpointMetadataResultV1_0>;
|
|
473
|
+
static retrieveOpenID4VCIServerMetadata(issuerHost: string, opts?: {
|
|
474
|
+
errorOnNotFound?: boolean;
|
|
475
|
+
}): Promise<OpenIDResponse<IssuerMetadataV1_0> | undefined>;
|
|
476
|
+
}
|
|
477
|
+
|
|
403
478
|
interface OpenID4VCIClientStateV1_0_15 {
|
|
404
479
|
credentialIssuer: string;
|
|
405
480
|
credentialOffer?: CredentialOfferRequestWithBaseUrl;
|
|
@@ -567,8 +642,10 @@ declare class OpenID4VCIClient {
|
|
|
567
642
|
}): Promise<AccessTokenResponse & {
|
|
568
643
|
params?: DPoPResponseParams;
|
|
569
644
|
}>;
|
|
570
|
-
acquireCredentials({ credentialTypes, context, proofCallbacks, format, kid, jwk, alg, jti, deferredCredentialAwait, deferredCredentialIntervalInMS, createDPoPOpts, }: {
|
|
571
|
-
|
|
645
|
+
acquireCredentials({ credentialIdentifier, credentialConfigurationId, credentialTypes, context, proofCallbacks, format, kid, jwk, alg, jti, deferredCredentialAwait, deferredCredentialIntervalInMS, createDPoPOpts, }: {
|
|
646
|
+
credentialIdentifier?: string;
|
|
647
|
+
credentialConfigurationId?: string;
|
|
648
|
+
credentialTypes?: string | string[];
|
|
572
649
|
context?: string[];
|
|
573
650
|
proofCallbacks: ProofOfPossessionCallbacks;
|
|
574
651
|
format: CredentialFormat | OID4VCICredentialFormat;
|
|
@@ -624,4 +701,4 @@ declare class OpenID4VCIClient {
|
|
|
624
701
|
|
|
625
702
|
declare const LOG: ISimpleLogger<string>;
|
|
626
703
|
|
|
627
|
-
export { AccessTokenClient, type CreateCredentialRequestOpts, CredentialOfferClient, CredentialOfferClientV1_0_15, CredentialRequestClient, CredentialRequestClientBuilder, CredentialRequestClientBuilderV1_0_15, type CredentialRequestOpts, type EndpointMetadataResult, LOG, MetadataClient, MetadataClientV1_0_15, OpenID4VCIClient, type OpenID4VCIClientState, type OpenID4VCIClientStateV1_0_15, OpenID4VCIClientV1_0_15, ProofOfPossessionBuilder, acquireAuthorizationChallengeAuthCode, acquireAuthorizationChallengeAuthCodeUsingRequest, buildProof, constructBaseResponse, createAuthorizationChallengeRequest, createAuthorizationRequestUrl, createJwtBearerClientAssertion, createSignedAuthRequestWhenNeeded, generateMissingPKCEOpts, handleCredentialOfferUri, isUriEncoded, retrieveWellknown, sendAuthorizationChallengeRequest, sendNotification };
|
|
704
|
+
export { AccessTokenClient, type CreateCredentialRequestOpts, CredentialOfferClient, CredentialOfferClientV1_0_15, CredentialRequestClient, CredentialRequestClientBuilder, CredentialRequestClientBuilderV1_0, CredentialRequestClientBuilderV1_0_15, type CredentialRequestOpts, type EndpointMetadataResult, LOG, MetadataClient, MetadataClientV1_0, MetadataClientV1_0_15, OpenID4VCIClient, type OpenID4VCIClientState, type OpenID4VCIClientStateV1_0_15, OpenID4VCIClientV1_0_15, ProofOfPossessionBuilder, acquireAuthorizationChallengeAuthCode, acquireAuthorizationChallengeAuthCodeUsingRequest, buildProof, constructBaseResponse, createAuthorizationChallengeRequest, createAuthorizationRequestUrl, createJwtBearerClientAssertion, createSignedAuthRequestWhenNeeded, generateMissingPKCEOpts, handleCredentialOfferUri, isUriEncoded, retrieveWellknown, sendAuthorizationChallengeRequest, sendNotification };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CredentialFormat, ISimpleLogger } from '@sphereon/ssi-types';
|
|
2
2
|
import { CreateDPoPClientOpts, JWK } from '@sphereon/oid4vc-common';
|
|
3
3
|
import * as _sphereon_oid4vci_common from '@sphereon/oid4vci-common';
|
|
4
|
-
import { AccessTokenRequestOpts, OpenIDResponse, AccessTokenResponse, DPoPResponseParams, AccessTokenRequest, TxCodeAndPinRequired, EndpointMetadata, AuthorizationServerOpts, IssuerOpts, RequestObjectOpts, PKCEOpts,
|
|
4
|
+
import { AccessTokenRequestOpts, OpenIDResponse, AccessTokenResponse, DPoPResponseParams, AccessTokenRequest, TxCodeAndPinRequired, EndpointMetadata, AuthorizationServerOpts, IssuerOpts, RequestObjectOpts, PKCEOpts, EndpointMetadataResult as EndpointMetadataResult$1, AuthorizationRequestOpts, CredentialOfferRequestWithBaseUrl, CredentialConfigurationSupported, OpenId4VCIVersion, AuthorizationChallengeRequestOpts, AuthorizationChallengeCodeResponse, CommonAuthorizationChallengeRequest, ExperimentalSubjectIssuance, EndpointMetadataResultV1_0_15, UniformCredentialOfferRequest, CredentialIssuerMetadataV1_0_15, EndpointMetadataResultV1_0, CredentialIssuerMetadataV1_0, Jwt, ProofOfPossessionCallbacks, PoPMode, ProofOfPossession, Alg, Typ, AuthorizationDetailsV1_0_15, AuthorizationDetailsV1_0, OID4VCICredentialFormat, CredentialResponse, CredentialRequest, CredentialRequestV1_0_15, CredentialRequestV1_0, CredentialIssuerMetadata, NotificationRequest, NotificationResponseResult, WellKnownEndpoints, CredentialOfferPayload, SignedMetadataVerifyCallback, CredentialOfferPayloadV1_0_15, IssuerMetadataV1_0_15, CredentialOfferPayloadV1_0, IssuerMetadataV1_0, AuthorizationResponse, CredentialResponseV1_0_15, CredentialConfigurationSupportedV1_0_15, AuthzFlowType } from '@sphereon/oid4vci-common';
|
|
5
5
|
|
|
6
6
|
declare class AccessTokenClient {
|
|
7
7
|
acquireAccessToken(opts: AccessTokenRequestOpts): Promise<OpenIDResponse<AccessTokenResponse, DPoPResponseParams>>;
|
|
@@ -37,10 +37,10 @@ declare function createSignedAuthRequestWhenNeeded(requestObject: Record<string,
|
|
|
37
37
|
}): Promise<void>;
|
|
38
38
|
declare const createAuthorizationRequestUrl: ({ pkce, endpointMetadata, authorizationRequest, credentialOffer, credentialConfigurationSupported, clientId, version, }: {
|
|
39
39
|
pkce: PKCEOpts;
|
|
40
|
-
endpointMetadata:
|
|
40
|
+
endpointMetadata: EndpointMetadataResult$1;
|
|
41
41
|
authorizationRequest: AuthorizationRequestOpts;
|
|
42
42
|
credentialOffer?: CredentialOfferRequestWithBaseUrl;
|
|
43
|
-
credentialConfigurationSupported?: Record<string,
|
|
43
|
+
credentialConfigurationSupported?: Record<string, CredentialConfigurationSupported>;
|
|
44
44
|
clientId?: string;
|
|
45
45
|
version?: OpenId4VCIVersion;
|
|
46
46
|
}) => Promise<string>;
|
|
@@ -109,6 +109,60 @@ declare class CredentialRequestClientBuilderV1_0_15 {
|
|
|
109
109
|
build(): CredentialRequestClient;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
declare class CredentialRequestClientBuilderV1_0 {
|
|
113
|
+
credentialEndpoint?: string;
|
|
114
|
+
deferredCredentialEndpoint?: string;
|
|
115
|
+
nonceEndpoint?: string;
|
|
116
|
+
deferredCredentialAwait: boolean;
|
|
117
|
+
deferredCredentialIntervalInMS: number;
|
|
118
|
+
credentialIdentifiers?: string[];
|
|
119
|
+
credentialConfigurationId?: string;
|
|
120
|
+
credentialTypes?: string[];
|
|
121
|
+
token?: string;
|
|
122
|
+
version?: OpenId4VCIVersion;
|
|
123
|
+
subjectIssuance?: ExperimentalSubjectIssuance;
|
|
124
|
+
issuerState?: string;
|
|
125
|
+
static fromCredentialIssuer({ credentialIssuer, metadata, version, credentialIdentifiers, credentialConfigurationId, credentialTypes, }: {
|
|
126
|
+
credentialIssuer: string;
|
|
127
|
+
metadata?: EndpointMetadataResultV1_0;
|
|
128
|
+
version?: OpenId4VCIVersion;
|
|
129
|
+
credentialIdentifiers?: string[];
|
|
130
|
+
credentialConfigurationId?: string;
|
|
131
|
+
credentialTypes?: string | string[];
|
|
132
|
+
}): CredentialRequestClientBuilderV1_0;
|
|
133
|
+
static fromURI({ uri, metadata, }: {
|
|
134
|
+
uri: string;
|
|
135
|
+
metadata?: EndpointMetadataResultV1_0;
|
|
136
|
+
}): Promise<CredentialRequestClientBuilderV1_0>;
|
|
137
|
+
static fromCredentialOfferRequest(opts: {
|
|
138
|
+
request: UniformCredentialOfferRequest;
|
|
139
|
+
scheme?: string;
|
|
140
|
+
baseUrl?: string;
|
|
141
|
+
version?: OpenId4VCIVersion;
|
|
142
|
+
metadata?: EndpointMetadataResultV1_0;
|
|
143
|
+
}): CredentialRequestClientBuilderV1_0;
|
|
144
|
+
static fromCredentialOffer({ credentialOffer, metadata, }: {
|
|
145
|
+
credentialOffer: CredentialOfferRequestWithBaseUrl;
|
|
146
|
+
metadata?: EndpointMetadataResultV1_0;
|
|
147
|
+
}): CredentialRequestClientBuilderV1_0;
|
|
148
|
+
withCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadataV1_0): this;
|
|
149
|
+
withCredentialEndpoint(credentialEndpoint: string): this;
|
|
150
|
+
withIssuerState(issuerState?: string): this;
|
|
151
|
+
withDeferredCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadataV1_0): this;
|
|
152
|
+
withDeferredCredentialEndpoint(deferredCredentialEndpoint: string): this;
|
|
153
|
+
withNonceEndpointFromMetadata(metadata: CredentialIssuerMetadataV1_0): this;
|
|
154
|
+
withNonceEndpoint(nonceEndpoint: string): this;
|
|
155
|
+
withDeferredCredentialAwait(deferredCredentialAwait: boolean, deferredCredentialIntervalInMS?: number): this;
|
|
156
|
+
withCredentialIdentifiers(credentialIdentifiers: string[]): this;
|
|
157
|
+
withCredentialConfigurationId(credentialConfigurationId: string): this;
|
|
158
|
+
withCredentialType(credentialTypes: string | string[]): this;
|
|
159
|
+
withSubjectIssuance(subjectIssuance: ExperimentalSubjectIssuance): this;
|
|
160
|
+
withToken(accessToken: string): this;
|
|
161
|
+
withTokenFromResponse(response: AccessTokenResponse): this;
|
|
162
|
+
withVersion(version: OpenId4VCIVersion): this;
|
|
163
|
+
build(): CredentialRequestClient;
|
|
164
|
+
}
|
|
165
|
+
|
|
112
166
|
declare class ProofOfPossessionBuilder<DIDDoc = never> {
|
|
113
167
|
private readonly proof?;
|
|
114
168
|
private readonly callbacks?;
|
|
@@ -123,6 +177,8 @@ declare class ProofOfPossessionBuilder<DIDDoc = never> {
|
|
|
123
177
|
private jti?;
|
|
124
178
|
private cNonce?;
|
|
125
179
|
private typ?;
|
|
180
|
+
private proofType;
|
|
181
|
+
private coseKey?;
|
|
126
182
|
private constructor();
|
|
127
183
|
static manual({ jwt, callbacks, version, mode, }: {
|
|
128
184
|
jwt?: Jwt;
|
|
@@ -151,6 +207,8 @@ declare class ProofOfPossessionBuilder<DIDDoc = never> {
|
|
|
151
207
|
withAlg(alg: Alg | string): this;
|
|
152
208
|
withJti(jti: string): this;
|
|
153
209
|
withTyp(typ: Typ): this;
|
|
210
|
+
withProofType(proofType: 'jwt' | 'cwt'): this;
|
|
211
|
+
withCoseKey(coseKey: unknown): this;
|
|
154
212
|
withAccessTokenNonce(cNonce: string): this;
|
|
155
213
|
withAccessTokenResponse(accessToken: AccessTokenResponse): this;
|
|
156
214
|
withEndpointMetadata(endpointMetadata: EndpointMetadata): this;
|
|
@@ -166,13 +224,14 @@ interface CredentialRequestOpts {
|
|
|
166
224
|
deferredCredentialEndpoint?: string;
|
|
167
225
|
credentialTypes?: string[];
|
|
168
226
|
credentialIdentifier?: string;
|
|
227
|
+
credentialIdentifiers?: string[];
|
|
169
228
|
credentialConfigurationId?: string;
|
|
170
229
|
proof: ProofOfPossession;
|
|
171
230
|
token: string;
|
|
172
231
|
version: OpenId4VCIVersion;
|
|
173
232
|
subjectIssuance?: ExperimentalSubjectIssuance;
|
|
174
233
|
issuerState?: string;
|
|
175
|
-
authorizationDetails?: AuthorizationDetailsV1_0_15[];
|
|
234
|
+
authorizationDetails?: (AuthorizationDetailsV1_0_15 | AuthorizationDetailsV1_0)[];
|
|
176
235
|
}
|
|
177
236
|
type CreateCredentialRequestOpts = {
|
|
178
237
|
credentialIdentifier?: string;
|
|
@@ -194,7 +253,7 @@ declare class CredentialRequestClient {
|
|
|
194
253
|
isDeferred(): boolean;
|
|
195
254
|
getCredentialEndpoint(): string;
|
|
196
255
|
getDeferredCredentialEndpoint(): string | undefined;
|
|
197
|
-
constructor(builder: CredentialRequestClientBuilderV1_0_15);
|
|
256
|
+
constructor(builder: CredentialRequestClientBuilderV1_0_15 | CredentialRequestClientBuilderV1_0);
|
|
198
257
|
/**
|
|
199
258
|
* Typically you should not use this method, as it omits a proof from the request.
|
|
200
259
|
* There are certain issuers that in specific circumstances can do without this proof, because they have other means of user binding
|
|
@@ -234,10 +293,10 @@ declare class CredentialRequestClient {
|
|
|
234
293
|
}): Promise<OpenIDResponse<CredentialResponse> & {
|
|
235
294
|
access_token: string;
|
|
236
295
|
}>;
|
|
237
|
-
createCredentialRequestWithoutProof(opts: CreateCredentialRequestOpts): Promise<CredentialRequestV1_0_15>;
|
|
296
|
+
createCredentialRequestWithoutProof(opts: CreateCredentialRequestOpts): Promise<CredentialRequestV1_0_15 | CredentialRequestV1_0>;
|
|
238
297
|
createCredentialRequest(opts: CreateCredentialRequestOpts & {
|
|
239
298
|
proofInput: ProofOfPossessionBuilder | ProofOfPossession;
|
|
240
|
-
}): Promise<CredentialRequestV1_0_15>;
|
|
299
|
+
}): Promise<CredentialRequestV1_0_15 | CredentialRequestV1_0>;
|
|
241
300
|
private createCredentialRequestImpl;
|
|
242
301
|
private version;
|
|
243
302
|
}
|
|
@@ -263,11 +322,12 @@ declare class CredentialOfferClientV1_0_15 {
|
|
|
263
322
|
declare class CredentialRequestClientBuilder {
|
|
264
323
|
private _builder;
|
|
265
324
|
private constructor();
|
|
266
|
-
static fromCredentialIssuer({ credentialIssuer, metadata, version, credentialIdentifier, credentialTypes, }: {
|
|
325
|
+
static fromCredentialIssuer({ credentialIssuer, metadata, version, credentialIdentifier, credentialIdentifiers, credentialTypes, }: {
|
|
267
326
|
credentialIssuer: string;
|
|
268
327
|
metadata?: EndpointMetadata;
|
|
269
328
|
version?: OpenId4VCIVersion;
|
|
270
329
|
credentialIdentifier?: string;
|
|
330
|
+
credentialIdentifiers?: string[];
|
|
271
331
|
credentialTypes?: string | string[];
|
|
272
332
|
}): CredentialRequestClientBuilder;
|
|
273
333
|
static fromURI({ uri, metadata, }: {
|
|
@@ -292,6 +352,7 @@ declare class CredentialRequestClientBuilder {
|
|
|
292
352
|
withDeferredCredentialEndpoint(deferredCredentialEndpoint: string): this;
|
|
293
353
|
withDeferredCredentialAwait(deferredCredentialAwait: boolean, deferredCredentialIntervalInMS?: number): this;
|
|
294
354
|
withCredentialIdentifier(credentialIdentifier: string): this;
|
|
355
|
+
withCredentialIdentifiers(credentialIdentifiers: string[]): this;
|
|
295
356
|
withIssuerState(issuerState?: string): this;
|
|
296
357
|
withCredentialType(credentialTypes: string | string[]): this;
|
|
297
358
|
withSubjectIssuance(subjectIssuance: ExperimentalSubjectIssuance): this;
|
|
@@ -344,20 +405,21 @@ declare class MetadataClient {
|
|
|
344
405
|
*
|
|
345
406
|
* @param credentialOffer
|
|
346
407
|
*/
|
|
347
|
-
static retrieveAllMetadataFromCredentialOffer(credentialOffer: CredentialOfferRequestWithBaseUrl): Promise<
|
|
408
|
+
static retrieveAllMetadataFromCredentialOffer(credentialOffer: CredentialOfferRequestWithBaseUrl): Promise<EndpointMetadataResult$1>;
|
|
348
409
|
/**
|
|
349
410
|
* Retrieve the metada using the initiation request obtained from a previous step
|
|
350
411
|
* @param request
|
|
351
412
|
*/
|
|
352
|
-
static retrieveAllMetadataFromCredentialOfferRequest(request: CredentialOfferPayload): Promise<
|
|
413
|
+
static retrieveAllMetadataFromCredentialOfferRequest(request: CredentialOfferPayload): Promise<EndpointMetadataResult$1>;
|
|
353
414
|
/**
|
|
354
415
|
* Retrieve all metadata from an issuer
|
|
355
416
|
* @param issuer The issuer URL
|
|
356
417
|
* @param opts
|
|
357
418
|
*/
|
|
358
419
|
static retrieveAllMetadata(issuer: string, opts?: {
|
|
359
|
-
errorOnNotFound
|
|
360
|
-
|
|
420
|
+
errorOnNotFound?: boolean;
|
|
421
|
+
signedMetadataVerifyCallback?: SignedMetadataVerifyCallback;
|
|
422
|
+
}): Promise<EndpointMetadataResult$1>;
|
|
361
423
|
/**
|
|
362
424
|
* Retrieve only the OID4VCI metadata for the issuer. So no OIDC/OAuth2 metadata
|
|
363
425
|
*
|
|
@@ -387,7 +449,8 @@ declare class MetadataClientV1_0_15 {
|
|
|
387
449
|
* @param opts
|
|
388
450
|
*/
|
|
389
451
|
static retrieveAllMetadata(issuer: string, opts?: {
|
|
390
|
-
errorOnNotFound
|
|
452
|
+
errorOnNotFound?: boolean;
|
|
453
|
+
signedMetadataVerifyCallback?: SignedMetadataVerifyCallback;
|
|
391
454
|
}): Promise<EndpointMetadataResultV1_0_15>;
|
|
392
455
|
/**
|
|
393
456
|
* Retrieve only the OID4VCI metadata for the issuer. So no OIDC/OAuth2 metadata
|
|
@@ -400,6 +463,18 @@ declare class MetadataClientV1_0_15 {
|
|
|
400
463
|
}): Promise<OpenIDResponse<IssuerMetadataV1_0_15> | undefined>;
|
|
401
464
|
}
|
|
402
465
|
|
|
466
|
+
declare class MetadataClientV1_0 {
|
|
467
|
+
static retrieveAllMetadataFromCredentialOffer(credentialOffer: CredentialOfferRequestWithBaseUrl): Promise<EndpointMetadataResultV1_0>;
|
|
468
|
+
static retrieveAllMetadataFromCredentialOfferRequest(request: CredentialOfferPayloadV1_0): Promise<EndpointMetadataResultV1_0>;
|
|
469
|
+
static retrieveAllMetadata(issuer: string, opts?: {
|
|
470
|
+
errorOnNotFound?: boolean;
|
|
471
|
+
signedMetadataVerifyCallback?: SignedMetadataVerifyCallback;
|
|
472
|
+
}): Promise<EndpointMetadataResultV1_0>;
|
|
473
|
+
static retrieveOpenID4VCIServerMetadata(issuerHost: string, opts?: {
|
|
474
|
+
errorOnNotFound?: boolean;
|
|
475
|
+
}): Promise<OpenIDResponse<IssuerMetadataV1_0> | undefined>;
|
|
476
|
+
}
|
|
477
|
+
|
|
403
478
|
interface OpenID4VCIClientStateV1_0_15 {
|
|
404
479
|
credentialIssuer: string;
|
|
405
480
|
credentialOffer?: CredentialOfferRequestWithBaseUrl;
|
|
@@ -567,8 +642,10 @@ declare class OpenID4VCIClient {
|
|
|
567
642
|
}): Promise<AccessTokenResponse & {
|
|
568
643
|
params?: DPoPResponseParams;
|
|
569
644
|
}>;
|
|
570
|
-
acquireCredentials({ credentialTypes, context, proofCallbacks, format, kid, jwk, alg, jti, deferredCredentialAwait, deferredCredentialIntervalInMS, createDPoPOpts, }: {
|
|
571
|
-
|
|
645
|
+
acquireCredentials({ credentialIdentifier, credentialConfigurationId, credentialTypes, context, proofCallbacks, format, kid, jwk, alg, jti, deferredCredentialAwait, deferredCredentialIntervalInMS, createDPoPOpts, }: {
|
|
646
|
+
credentialIdentifier?: string;
|
|
647
|
+
credentialConfigurationId?: string;
|
|
648
|
+
credentialTypes?: string | string[];
|
|
572
649
|
context?: string[];
|
|
573
650
|
proofCallbacks: ProofOfPossessionCallbacks;
|
|
574
651
|
format: CredentialFormat | OID4VCICredentialFormat;
|
|
@@ -624,4 +701,4 @@ declare class OpenID4VCIClient {
|
|
|
624
701
|
|
|
625
702
|
declare const LOG: ISimpleLogger<string>;
|
|
626
703
|
|
|
627
|
-
export { AccessTokenClient, type CreateCredentialRequestOpts, CredentialOfferClient, CredentialOfferClientV1_0_15, CredentialRequestClient, CredentialRequestClientBuilder, CredentialRequestClientBuilderV1_0_15, type CredentialRequestOpts, type EndpointMetadataResult, LOG, MetadataClient, MetadataClientV1_0_15, OpenID4VCIClient, type OpenID4VCIClientState, type OpenID4VCIClientStateV1_0_15, OpenID4VCIClientV1_0_15, ProofOfPossessionBuilder, acquireAuthorizationChallengeAuthCode, acquireAuthorizationChallengeAuthCodeUsingRequest, buildProof, constructBaseResponse, createAuthorizationChallengeRequest, createAuthorizationRequestUrl, createJwtBearerClientAssertion, createSignedAuthRequestWhenNeeded, generateMissingPKCEOpts, handleCredentialOfferUri, isUriEncoded, retrieveWellknown, sendAuthorizationChallengeRequest, sendNotification };
|
|
704
|
+
export { AccessTokenClient, type CreateCredentialRequestOpts, CredentialOfferClient, CredentialOfferClientV1_0_15, CredentialRequestClient, CredentialRequestClientBuilder, CredentialRequestClientBuilderV1_0, CredentialRequestClientBuilderV1_0_15, type CredentialRequestOpts, type EndpointMetadataResult, LOG, MetadataClient, MetadataClientV1_0, MetadataClientV1_0_15, OpenID4VCIClient, type OpenID4VCIClientState, type OpenID4VCIClientStateV1_0_15, OpenID4VCIClientV1_0_15, ProofOfPossessionBuilder, acquireAuthorizationChallengeAuthCode, acquireAuthorizationChallengeAuthCodeUsingRequest, buildProof, constructBaseResponse, createAuthorizationChallengeRequest, createAuthorizationRequestUrl, createJwtBearerClientAssertion, createSignedAuthRequestWhenNeeded, generateMissingPKCEOpts, handleCredentialOfferUri, isUriEncoded, retrieveWellknown, sendAuthorizationChallengeRequest, sendNotification };
|