@pagopa/io-wallet-oid4vci 2.0.0-apt → 2.0.0-launchpad

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.d.mts CHANGED
@@ -119,43 +119,6 @@ declare function completeAuthorization(options: CompleteAuthorizationOptions): P
119
119
  */
120
120
  declare function sendAuthorizationResponseAndExtractCode(options: SendAuthorizationResponseAndExtractCodeOptions): Promise<AuthorizationResponse>;
121
121
 
122
- /**
123
- * Credential Offer schema
124
- * IT-Wallet v1.4 specification: Section 5.1
125
- *
126
- * Represents a credential offer from a Credential Issuer to a wallet.
127
- */
128
- declare const zCredentialOfferAPTITUDE: z$1.ZodObject<{
129
- credential_configuration_ids: z$1.ZodArray<z$1.ZodString>;
130
- credential_issuer: z$1.ZodURL;
131
- grants: z$1.ZodObject<{
132
- authorization_code: z$1.ZodOptional<z$1.ZodObject<{
133
- authorization_server: z$1.ZodOptional<z$1.ZodURL>;
134
- issuer_state: z$1.ZodOptional<z$1.ZodString>;
135
- }, z$1.core.$strip>>;
136
- "urn:ietf:params:oauth:grant-type:pre-authorized_code": z$1.ZodOptional<z$1.ZodObject<{
137
- authorization_server: z$1.ZodOptional<z$1.ZodURL>;
138
- "pre-authorized_code": z$1.ZodString;
139
- tx_code: z$1.ZodOptional<z$1.ZodObject<{
140
- description: z$1.ZodOptional<z$1.ZodString>;
141
- input_mode: z$1.ZodOptional<z$1.ZodEnum<{
142
- numeric: "numeric";
143
- digit: "digit";
144
- }>>;
145
- length: z$1.ZodOptional<z$1.ZodNumber>;
146
- }, z$1.core.$strip>>;
147
- }, z$1.core.$strip>>;
148
- }, z$1.core.$strip>;
149
- }, z$1.core.$strip>;
150
- type CredentialOfferAPTITUDE = z$1.infer<typeof zCredentialOfferAPTITUDE>;
151
- /**
152
- * TypeScript enum for Credential Offer Supported Grants
153
- */
154
- declare enum CREDENTIAL_OFFER_GRANTS {
155
- AUTHORIZATION_CODE = "authorization_code",
156
- PREAUTHORIZED_CODE = "urn:ietf:params:oauth:grant-type:pre-authorized_code"
157
- }
158
-
159
122
  /**
160
123
  * Authorization Code Grant schema
161
124
  * IT-Wallet v1.3 specification: Section 5.1
@@ -289,7 +252,7 @@ type CredentialOfferGrants = CredentialOfferGrantsV1_3 | CredentialOfferGrantsV1
289
252
  * TypeScript type for Credential Offer.
290
253
  * Union across supported IT-Wallet versions.
291
254
  */
292
- type CredentialOffer = CredentialOfferAPTITUDE | CredentialOfferV1_3 | CredentialOfferV1_4;
255
+ type CredentialOffer = CredentialOfferV1_3 | CredentialOfferV1_4;
293
256
  /**
294
257
  * TypeScript type for Credential Offer URI
295
258
  */
@@ -383,12 +346,6 @@ interface ResolveCredentialOfferOptionsV1_3 extends ResolveCredentialOfferOption
383
346
  interface ResolveCredentialOfferOptionsV1_4 extends ResolveCredentialOfferOptions {
384
347
  config: IoWalletSdkConfig<ItWalletSpecsVersion.V1_4>;
385
348
  }
386
- /**
387
- * Options for resolving a credential offer against the APTITUDE schema.
388
- */
389
- interface ResolveCredentialOfferOptionsAPTITUDE extends ResolveCredentialOfferOptions {
390
- config: IoWalletSdkConfig<ItWalletSpecsVersion.APTITUDE>;
391
- }
392
349
  /**
393
350
  * Base options shared across all validate-credential-offer versions.
394
351
  */
@@ -421,7 +378,7 @@ interface ValidateCredentialOfferOptions extends BaseValidateCredentialOfferOpti
421
378
  /**
422
379
  * The credential offer to validate against the configured IT-Wallet specification.
423
380
  */
424
- credentialOffer: CredentialOfferAPTITUDE | CredentialOfferV1_3 | CredentialOfferV1_4;
381
+ credentialOffer: CredentialOfferV1_3 | CredentialOfferV1_4;
425
382
  }
426
383
  /**
427
384
  * Options for validating an IT-Wallet v1.3 credential offer.
@@ -451,7 +408,7 @@ interface ExtractGrantDetailsOptions {
451
408
  /**
452
409
  * The credential offer to extract grant details from.
453
410
  */
454
- credentialOffer: CredentialOfferAPTITUDE | CredentialOfferV1_3 | CredentialOfferV1_4;
411
+ credentialOffer: CredentialOfferV1_3 | CredentialOfferV1_4;
455
412
  }
456
413
  /**
457
414
  * Options for extracting grant details from an IT-Wallet v1.3 credential offer.
@@ -473,16 +430,6 @@ interface ExtractGrantDetailsOptionsV1_4 extends ExtractGrantDetailsOptions {
473
430
  */
474
431
  credentialOffer: CredentialOfferV1_4;
475
432
  }
476
- /**
477
- * Options for extracting grant details from an Aptitude credential offer.
478
- */
479
- interface ExtractGrantDetailsOptionsAPTITUDE extends ExtractGrantDetailsOptions {
480
- config: IoWalletSdkConfig<ItWalletSpecsVersion.APTITUDE>;
481
- /**
482
- * The credential offer to extract grant details from.
483
- */
484
- credentialOffer: CredentialOfferAPTITUDE;
485
- }
486
433
  /**
487
434
  * Result of extracting grant details from an IT-Wallet v1.3 credential offer.
488
435
  */
@@ -490,7 +437,7 @@ interface ExtractGrantDetailsResultV1_3 {
490
437
  /**
491
438
  * Details of the authorization code grant.
492
439
  */
493
- [CREDENTIAL_OFFER_GRANTS.AUTHORIZATION_CODE]: {
440
+ authorizationCodeGrant: {
494
441
  /**
495
442
  * HTTPS URL of the Authorization Server.
496
443
  * OPTIONAL, but REQUIRED when the Credential Issuer uses multiple Authorization Servers.
@@ -507,6 +454,11 @@ interface ExtractGrantDetailsResultV1_3 {
507
454
  */
508
455
  scope: string;
509
456
  };
457
+ /**
458
+ * The type of grant present in the credential offer.
459
+ * IT-Wallet only supports "authorization_code".
460
+ */
461
+ grantType: "authorization_code";
510
462
  }
511
463
  /**
512
464
  * Result of extracting grant details from an IT-Wallet v1.4 credential offer.
@@ -518,7 +470,7 @@ interface ExtractGrantDetailsResultV1_4 {
518
470
  /**
519
471
  * Details of the authorization code grant.
520
472
  */
521
- [CREDENTIAL_OFFER_GRANTS.AUTHORIZATION_CODE]: {
473
+ authorizationCodeGrant: {
522
474
  /**
523
475
  * HTTPS URL of the Authorization Server.
524
476
  * OPTIONAL, but REQUIRED when the Credential Issuer uses multiple Authorization Servers.
@@ -536,100 +488,36 @@ interface ExtractGrantDetailsResultV1_4 {
536
488
  */
537
489
  scope?: never;
538
490
  };
539
- }
540
- /**
541
- * Result of extracting grant details from an APTITUDE credential offer.
542
- *
543
- * It is an object keyed by the OAuth grant type. Each supported grant is optional
544
- * because an APTITUDE credential offer may provide either or both grant types.
545
- *
546
- * Difference from v1.4:
547
- * - Supports both authorization code and pre-authorized code grants.
548
- */
549
- interface ExtractGrantDetailsResultAPTITUDE {
550
491
  /**
551
- * Details of the authorization code grant.
492
+ * The type of grant present in the credential offer.
493
+ * IT-Wallet only supports "authorization_code".
552
494
  */
553
- [CREDENTIAL_OFFER_GRANTS.AUTHORIZATION_CODE]?: {
554
- /**
555
- * HTTPS URL of the Authorization Server.
556
- * OPTIONAL, but REQUIRED when the Credential Issuer uses multiple Authorization Servers.
557
- */
558
- authorizationServer?: string;
559
- /**
560
- * String value representing the issuer state.
561
- * OPTIONAL. Used to correlate the authorization request with the credential offer.
562
- */
563
- issuerState?: string;
564
- /**
565
- * Version 1.4 has dropped support for the scope field,
566
- * But typescript inference might have trouble recognizing this fact
567
- * in its union type, so this is needed
568
- */
569
- scope?: never;
570
- };
571
- [CREDENTIAL_OFFER_GRANTS.PREAUTHORIZED_CODE]?: {
572
- /**
573
- * HTTPS URL of the Authorization Server.
574
- * OPTIONAL, but REQUIRED when the Credential Issuer uses multiple Authorization Servers.
575
- */
576
- authorizationServer?: string;
577
- /**
578
- * REQUIRED. The code representing the Credential Issuer's authorization for
579
- * the Wallet to obtain Credentials of a certain type.
580
- */
581
- preAuthorizedCode: string;
582
- /**
583
- * OPTIONAL. Object indicating that a Transaction Code is required if present, even if empty.
584
- * It describes the requirements for a Transaction Code, which the Authorization Server expects
585
- * the End-User to present along with the Token Request in a Pre-Authorized Code Flow.
586
- * If the Authorization Server does not expect a Transaction Code, this object is absent.
587
- */
588
- txCode?: {
589
- /**
590
- * OPTIONAL. String containing guidance for the Holder
591
- * of the Wallet on how to obtain the Transaction Code.
592
- */
593
- description?: string;
594
- /**
595
- * OPTIONAL. String specifying the input character set.
596
- * Possible values are numeric (only digits) and text (any characters).
597
- * The default is numeric.
598
- */
599
- inputMode?: "digit" | "numeric";
600
- /**
601
- * OPTIONAL. Integer specifying the length of the Transaction Code.
602
- */
603
- length?: number;
604
- };
605
- };
495
+ grantType: "authorization_code";
606
496
  }
607
497
  /**
608
498
  * Result of extracting grant details from a credential offer.
609
499
  */
610
- type ExtractGrantDetailsResult = ExtractGrantDetailsResultAPTITUDE | ExtractGrantDetailsResultV1_3 | ExtractGrantDetailsResultV1_4;
500
+ type ExtractGrantDetailsResult = ExtractGrantDetailsResultV1_3 | ExtractGrantDetailsResultV1_4;
611
501
 
612
502
  /**
613
503
  * Extracts grant details from a credential offer according to the configured
614
- * Italian Wallet specification version. Returns version-specific grant details keyed by grant type.
504
+ * Italian Wallet specification version.
615
505
  *
506
+ * IT-Wallet only supports the `authorization_code` grant type. Pre-authorized
507
+ * code grants are NOT supported.
616
508
  *
617
509
  * Version Differences:
618
510
  * - v1.3: extracts `scope` (REQUIRED), `authorization_server` (OPTIONAL), `issuer_state` (OPTIONAL)
619
511
  * - v1.4: extracts `authorization_server` (OPTIONAL) and `issuer_state` (OPTIONAL); the
620
- * credential offer no longer carries a `scope`.
621
- * - APTITUDE: extracts `authorization_server` (OPTIONAL), `pre-authorized_code` (REQUIRED), and `tx_code` (OPTIONAL).
622
- * authorization_code properties are not mandatory anymore.
623
- *
512
+ * credential offer no longer carries a `scope`
624
513
  *
625
514
  * @param options - Extraction options including the credential offer and version config
626
- * @returns Version-specific grant details keyed by grant type.
627
- * @throws {CredentialOfferError} If grants or the either authorization_code or pre-authorized_code grants are missing
515
+ * @returns Version-specific grant details containing the grant type and authorization code grant information
516
+ * @throws {CredentialOfferError} If grants or the authorization_code grant is missing
628
517
  * @throws {ItWalletSpecsVersionError} If the configured version does not support credential offers
629
518
  */
630
519
  declare function extractGrantDetails(options: ExtractGrantDetailsOptionsV1_3): ExtractGrantDetailsResultV1_3;
631
520
  declare function extractGrantDetails(options: ExtractGrantDetailsOptionsV1_4): ExtractGrantDetailsResultV1_4;
632
- declare function extractGrantDetails(options: ExtractGrantDetailsOptionsAPTITUDE): ExtractGrantDetailsResultAPTITUDE;
633
521
  declare function extractGrantDetails(options: ExtractGrantDetailsOptions): ExtractGrantDetailsResult;
634
522
 
635
523
  /**
@@ -730,7 +618,6 @@ declare function parseCredentialOfferUri(options: ParseCredentialOfferUriOptions
730
618
  */
731
619
  declare function resolveCredentialOffer(options: ResolveCredentialOfferOptionsV1_3): Promise<CredentialOfferV1_3>;
732
620
  declare function resolveCredentialOffer(options: ResolveCredentialOfferOptionsV1_4): Promise<CredentialOfferV1_4>;
733
- declare function resolveCredentialOffer(options: ResolveCredentialOfferOptionsAPTITUDE): Promise<CredentialOfferAPTITUDE>;
734
621
  declare function resolveCredentialOffer(options: ResolveCredentialOfferOptions): Promise<CredentialOffer>;
735
622
 
736
623
  /**
@@ -47077,7 +46964,7 @@ declare class WalletProvider {
47077
46964
  * status: { status_list: { idx: 2, uri: "https://status.example.com" } } // Optional
47078
46965
  * });
47079
46966
  *
47080
- * @example v1.4, APTITUDE - Wallet attestation with required wallet_link and wallet_name
46967
+ * @example v1.4 - Wallet attestation with required wallet_link and wallet_name
47081
46968
  * const jwt = await provider.createItWalletAttestationJwt({
47082
46969
  * callbacks: { hash: myHashCallback, signJwt: mySignJwtCallback },
47083
46970
  * dpopJwkPublic: myJwk,
@@ -47097,4 +46984,4 @@ declare class WalletProvider {
47097
46984
  createItWalletAttestationJwt(options: WalletAttestationOptions): Promise<string>;
47098
46985
  }
47099
46986
 
47100
- export { type AuthorizationCodeGrant, type AuthorizationCodeGrantV1_3, type AuthorizationCodeGrantV1_4, type AuthorizationResponse, type BaseCredentialRequestOptions, CREDENTIAL_OFFER_GRANTS, type CompleteAuthorizationOptions, type CompleteAuthorizationResult, CreateCredentialResponseError, type CreateCredentialResponseOptions, type CreateCredentialResponseOptionsV1_0, type CreateCredentialResponseOptionsV1_3, type CreateCredentialResponseOptionsV1_4, type CreateCredentialResponseResult, type CreateCredentialResponseResultWithFlow, CredentialAuthorizationHeaderError, type CredentialObject, type CredentialOffer, CredentialOfferError, type CredentialOfferGrants, type CredentialOfferGrantsV1_3, type CredentialOfferGrantsV1_4, type CredentialOfferUri, type CredentialOfferV1_3, type CredentialOfferV1_4, type CredentialRequest, type CredentialRequestOptions, type CredentialRequestOptionsV1_0, type CredentialRequestOptionsV1_3, type CredentialRequestOptionsV1_4, type CredentialRequestV1_0, type CredentialRequestV1_3, type CredentialResponse, type CredentialResponseEncryption, type CredentialResponseV1_0, type CredentialResponseV1_3, type DeferredCredentialResponseV1_0, type DeferredCredentialResponseV1_3, type DeferredFlowOptionsV1_0, type DeferredFlowOptionsV1_3, type ExtractGrantDetailsOptions, type ExtractGrantDetailsOptionsV1_3, type ExtractGrantDetailsOptionsV1_4, type ExtractGrantDetailsResult, type ExtractGrantDetailsResultV1_3, type ExtractGrantDetailsResultV1_4, FetchCredentialResponseError, type FetchCredentialResponseOptions, FetchMetadataError, type FetchMetadataOptions, type FetchStatusListCallback, type ImmediateCredentialResponse, type ImmediateFlowOptions, InvalidDpopProofError, type KeyAttestationHeader, type KeyAttestationOptions, type KeyAttestationPayload, type KeyAttestationStatus, type MetadataResponse, type MetadataResponseV1_0, type MetadataResponseV1_3, type MetadataResponseV1_4, MissingDpopProofError, NonceRequestError, Oid4vciError, type ParseCredentialOfferUriOptions, ParseCredentialRequestError, type ParseCredentialRequestExpectedValues, type ParseCredentialRequestOptions, type ParsedCredentialProof, type ParsedCredentialRequest, type ProofJwtHeader, type ProofJwtHeaderV1_0, type ProofJwtHeaderV1_3, type ProofJwtPayload, type ResolveCredentialOfferOptions, type ResolveCredentialOfferOptionsV1_3, type ResolveCredentialOfferOptionsV1_4, type SendAuthorizationResponseAndExtractCodeOptions, type StatusList, type ValidateCredentialOfferOptions, type ValidateCredentialOfferOptionsV1_3, type ValidateCredentialOfferOptionsV1_4, type VerifyAuthorizationResponseFormPostJWTOptions, type VerifyAuthorizationResponseOptions, type VerifyCredentialRequestJwtProofBaseOptions, VerifyCredentialRequestJwtProofError, type VerifyCredentialRequestJwtProofOptions, type VerifyCredentialRequestJwtProofOptionsV1_0, type VerifyCredentialRequestJwtProofOptionsV1_3, type VerifyCredentialRequestJwtProofOptionsV1_4, type VerifyCredentialRequestJwtProofResult, type VerifyCredentialRequestJwtProofResultV1_0, type VerifyCredentialRequestJwtProofResultV1_3, type VerifyCredentialRequestJwtProofResultV1_4, VerifyKeyAttestationJwtError, type VerifyKeyAttestationJwtOptions, type VerifyKeyAttestationJwtResult, type WalletAttestationOptions, WalletProvider, WalletProviderError, completeAuthorization, createCredentialRequest, createCredentialResponse, extractGrantDetails, fetchCredentialResponse, fetchMetadata, keyAttestationTypeHeader, parseCredentialOfferUri, parseCredentialRequest, resolveCredentialOffer, sendAuthorizationResponseAndExtractCode, validateCredentialOffer, verifyAuthorizationResponse, verifyAuthorizationResponseFormPostJWT, verifyCredentialRequestJwtProof, verifyKeyAttestationJwt, zAuthorizationCodeGrantV1_3, zAuthorizationCodeGrantV1_4, zAuthorizationResponse, zCredentialObject, zCredentialOfferGrantsV1_3, zCredentialOfferGrantsV1_4, zCredentialOfferV1_3, zCredentialOfferV1_4, zCredentialRequestV1_0, zCredentialRequestV1_3, zCredentialResponseEncryption, zCredentialResponseV1_0, zCredentialResponseV1_3, zDeferredCredentialResponseV1_0, zDeferredCredentialResponseV1_3, zImmediateCredentialResponse, zKeyAttestationAlg, zKeyAttestationHeader, zKeyAttestationPayload, zKeyAttestationStatus, zKeyAttestationTypeHeader, zMetadataResponse, zMetadataResponseV1_0, zMetadataResponseV1_3, zMetadataResponseV1_4, zProofJwtHeaderV1_0, zProofJwtHeaderV1_3, zProofJwtPayload, zStatusList };
46987
+ export { type AuthorizationCodeGrant, type AuthorizationCodeGrantV1_3, type AuthorizationCodeGrantV1_4, type AuthorizationResponse, type BaseCredentialRequestOptions, type CompleteAuthorizationOptions, type CompleteAuthorizationResult, CreateCredentialResponseError, type CreateCredentialResponseOptions, type CreateCredentialResponseOptionsV1_0, type CreateCredentialResponseOptionsV1_3, type CreateCredentialResponseOptionsV1_4, type CreateCredentialResponseResult, type CreateCredentialResponseResultWithFlow, CredentialAuthorizationHeaderError, type CredentialObject, type CredentialOffer, CredentialOfferError, type CredentialOfferGrants, type CredentialOfferGrantsV1_3, type CredentialOfferGrantsV1_4, type CredentialOfferUri, type CredentialOfferV1_3, type CredentialOfferV1_4, type CredentialRequest, type CredentialRequestOptions, type CredentialRequestOptionsV1_0, type CredentialRequestOptionsV1_3, type CredentialRequestOptionsV1_4, type CredentialRequestV1_0, type CredentialRequestV1_3, type CredentialResponse, type CredentialResponseEncryption, type CredentialResponseV1_0, type CredentialResponseV1_3, type DeferredCredentialResponseV1_0, type DeferredCredentialResponseV1_3, type DeferredFlowOptionsV1_0, type DeferredFlowOptionsV1_3, type ExtractGrantDetailsOptions, type ExtractGrantDetailsOptionsV1_3, type ExtractGrantDetailsOptionsV1_4, type ExtractGrantDetailsResult, type ExtractGrantDetailsResultV1_3, type ExtractGrantDetailsResultV1_4, FetchCredentialResponseError, type FetchCredentialResponseOptions, FetchMetadataError, type FetchMetadataOptions, type FetchStatusListCallback, type ImmediateCredentialResponse, type ImmediateFlowOptions, InvalidDpopProofError, type KeyAttestationHeader, type KeyAttestationOptions, type KeyAttestationPayload, type KeyAttestationStatus, type MetadataResponse, type MetadataResponseV1_0, type MetadataResponseV1_3, type MetadataResponseV1_4, MissingDpopProofError, NonceRequestError, Oid4vciError, type ParseCredentialOfferUriOptions, ParseCredentialRequestError, type ParseCredentialRequestExpectedValues, type ParseCredentialRequestOptions, type ParsedCredentialProof, type ParsedCredentialRequest, type ProofJwtHeader, type ProofJwtHeaderV1_0, type ProofJwtHeaderV1_3, type ProofJwtPayload, type ResolveCredentialOfferOptions, type ResolveCredentialOfferOptionsV1_3, type ResolveCredentialOfferOptionsV1_4, type SendAuthorizationResponseAndExtractCodeOptions, type StatusList, type ValidateCredentialOfferOptions, type ValidateCredentialOfferOptionsV1_3, type ValidateCredentialOfferOptionsV1_4, type VerifyAuthorizationResponseFormPostJWTOptions, type VerifyAuthorizationResponseOptions, type VerifyCredentialRequestJwtProofBaseOptions, VerifyCredentialRequestJwtProofError, type VerifyCredentialRequestJwtProofOptions, type VerifyCredentialRequestJwtProofOptionsV1_0, type VerifyCredentialRequestJwtProofOptionsV1_3, type VerifyCredentialRequestJwtProofOptionsV1_4, type VerifyCredentialRequestJwtProofResult, type VerifyCredentialRequestJwtProofResultV1_0, type VerifyCredentialRequestJwtProofResultV1_3, type VerifyCredentialRequestJwtProofResultV1_4, VerifyKeyAttestationJwtError, type VerifyKeyAttestationJwtOptions, type VerifyKeyAttestationJwtResult, type WalletAttestationOptions, WalletProvider, WalletProviderError, completeAuthorization, createCredentialRequest, createCredentialResponse, extractGrantDetails, fetchCredentialResponse, fetchMetadata, keyAttestationTypeHeader, parseCredentialOfferUri, parseCredentialRequest, resolveCredentialOffer, sendAuthorizationResponseAndExtractCode, validateCredentialOffer, verifyAuthorizationResponse, verifyAuthorizationResponseFormPostJWT, verifyCredentialRequestJwtProof, verifyKeyAttestationJwt, zAuthorizationCodeGrantV1_3, zAuthorizationCodeGrantV1_4, zAuthorizationResponse, zCredentialObject, zCredentialOfferGrantsV1_3, zCredentialOfferGrantsV1_4, zCredentialOfferV1_3, zCredentialOfferV1_4, zCredentialRequestV1_0, zCredentialRequestV1_3, zCredentialResponseEncryption, zCredentialResponseV1_0, zCredentialResponseV1_3, zDeferredCredentialResponseV1_0, zDeferredCredentialResponseV1_3, zImmediateCredentialResponse, zKeyAttestationAlg, zKeyAttestationHeader, zKeyAttestationPayload, zKeyAttestationStatus, zKeyAttestationTypeHeader, zMetadataResponse, zMetadataResponseV1_0, zMetadataResponseV1_3, zMetadataResponseV1_4, zProofJwtHeaderV1_0, zProofJwtHeaderV1_3, zProofJwtPayload, zStatusList };
package/dist/index.d.ts CHANGED
@@ -119,43 +119,6 @@ declare function completeAuthorization(options: CompleteAuthorizationOptions): P
119
119
  */
120
120
  declare function sendAuthorizationResponseAndExtractCode(options: SendAuthorizationResponseAndExtractCodeOptions): Promise<AuthorizationResponse>;
121
121
 
122
- /**
123
- * Credential Offer schema
124
- * IT-Wallet v1.4 specification: Section 5.1
125
- *
126
- * Represents a credential offer from a Credential Issuer to a wallet.
127
- */
128
- declare const zCredentialOfferAPTITUDE: z$1.ZodObject<{
129
- credential_configuration_ids: z$1.ZodArray<z$1.ZodString>;
130
- credential_issuer: z$1.ZodURL;
131
- grants: z$1.ZodObject<{
132
- authorization_code: z$1.ZodOptional<z$1.ZodObject<{
133
- authorization_server: z$1.ZodOptional<z$1.ZodURL>;
134
- issuer_state: z$1.ZodOptional<z$1.ZodString>;
135
- }, z$1.core.$strip>>;
136
- "urn:ietf:params:oauth:grant-type:pre-authorized_code": z$1.ZodOptional<z$1.ZodObject<{
137
- authorization_server: z$1.ZodOptional<z$1.ZodURL>;
138
- "pre-authorized_code": z$1.ZodString;
139
- tx_code: z$1.ZodOptional<z$1.ZodObject<{
140
- description: z$1.ZodOptional<z$1.ZodString>;
141
- input_mode: z$1.ZodOptional<z$1.ZodEnum<{
142
- numeric: "numeric";
143
- digit: "digit";
144
- }>>;
145
- length: z$1.ZodOptional<z$1.ZodNumber>;
146
- }, z$1.core.$strip>>;
147
- }, z$1.core.$strip>>;
148
- }, z$1.core.$strip>;
149
- }, z$1.core.$strip>;
150
- type CredentialOfferAPTITUDE = z$1.infer<typeof zCredentialOfferAPTITUDE>;
151
- /**
152
- * TypeScript enum for Credential Offer Supported Grants
153
- */
154
- declare enum CREDENTIAL_OFFER_GRANTS {
155
- AUTHORIZATION_CODE = "authorization_code",
156
- PREAUTHORIZED_CODE = "urn:ietf:params:oauth:grant-type:pre-authorized_code"
157
- }
158
-
159
122
  /**
160
123
  * Authorization Code Grant schema
161
124
  * IT-Wallet v1.3 specification: Section 5.1
@@ -289,7 +252,7 @@ type CredentialOfferGrants = CredentialOfferGrantsV1_3 | CredentialOfferGrantsV1
289
252
  * TypeScript type for Credential Offer.
290
253
  * Union across supported IT-Wallet versions.
291
254
  */
292
- type CredentialOffer = CredentialOfferAPTITUDE | CredentialOfferV1_3 | CredentialOfferV1_4;
255
+ type CredentialOffer = CredentialOfferV1_3 | CredentialOfferV1_4;
293
256
  /**
294
257
  * TypeScript type for Credential Offer URI
295
258
  */
@@ -383,12 +346,6 @@ interface ResolveCredentialOfferOptionsV1_3 extends ResolveCredentialOfferOption
383
346
  interface ResolveCredentialOfferOptionsV1_4 extends ResolveCredentialOfferOptions {
384
347
  config: IoWalletSdkConfig<ItWalletSpecsVersion.V1_4>;
385
348
  }
386
- /**
387
- * Options for resolving a credential offer against the APTITUDE schema.
388
- */
389
- interface ResolveCredentialOfferOptionsAPTITUDE extends ResolveCredentialOfferOptions {
390
- config: IoWalletSdkConfig<ItWalletSpecsVersion.APTITUDE>;
391
- }
392
349
  /**
393
350
  * Base options shared across all validate-credential-offer versions.
394
351
  */
@@ -421,7 +378,7 @@ interface ValidateCredentialOfferOptions extends BaseValidateCredentialOfferOpti
421
378
  /**
422
379
  * The credential offer to validate against the configured IT-Wallet specification.
423
380
  */
424
- credentialOffer: CredentialOfferAPTITUDE | CredentialOfferV1_3 | CredentialOfferV1_4;
381
+ credentialOffer: CredentialOfferV1_3 | CredentialOfferV1_4;
425
382
  }
426
383
  /**
427
384
  * Options for validating an IT-Wallet v1.3 credential offer.
@@ -451,7 +408,7 @@ interface ExtractGrantDetailsOptions {
451
408
  /**
452
409
  * The credential offer to extract grant details from.
453
410
  */
454
- credentialOffer: CredentialOfferAPTITUDE | CredentialOfferV1_3 | CredentialOfferV1_4;
411
+ credentialOffer: CredentialOfferV1_3 | CredentialOfferV1_4;
455
412
  }
456
413
  /**
457
414
  * Options for extracting grant details from an IT-Wallet v1.3 credential offer.
@@ -473,16 +430,6 @@ interface ExtractGrantDetailsOptionsV1_4 extends ExtractGrantDetailsOptions {
473
430
  */
474
431
  credentialOffer: CredentialOfferV1_4;
475
432
  }
476
- /**
477
- * Options for extracting grant details from an Aptitude credential offer.
478
- */
479
- interface ExtractGrantDetailsOptionsAPTITUDE extends ExtractGrantDetailsOptions {
480
- config: IoWalletSdkConfig<ItWalletSpecsVersion.APTITUDE>;
481
- /**
482
- * The credential offer to extract grant details from.
483
- */
484
- credentialOffer: CredentialOfferAPTITUDE;
485
- }
486
433
  /**
487
434
  * Result of extracting grant details from an IT-Wallet v1.3 credential offer.
488
435
  */
@@ -490,7 +437,7 @@ interface ExtractGrantDetailsResultV1_3 {
490
437
  /**
491
438
  * Details of the authorization code grant.
492
439
  */
493
- [CREDENTIAL_OFFER_GRANTS.AUTHORIZATION_CODE]: {
440
+ authorizationCodeGrant: {
494
441
  /**
495
442
  * HTTPS URL of the Authorization Server.
496
443
  * OPTIONAL, but REQUIRED when the Credential Issuer uses multiple Authorization Servers.
@@ -507,6 +454,11 @@ interface ExtractGrantDetailsResultV1_3 {
507
454
  */
508
455
  scope: string;
509
456
  };
457
+ /**
458
+ * The type of grant present in the credential offer.
459
+ * IT-Wallet only supports "authorization_code".
460
+ */
461
+ grantType: "authorization_code";
510
462
  }
511
463
  /**
512
464
  * Result of extracting grant details from an IT-Wallet v1.4 credential offer.
@@ -518,7 +470,7 @@ interface ExtractGrantDetailsResultV1_4 {
518
470
  /**
519
471
  * Details of the authorization code grant.
520
472
  */
521
- [CREDENTIAL_OFFER_GRANTS.AUTHORIZATION_CODE]: {
473
+ authorizationCodeGrant: {
522
474
  /**
523
475
  * HTTPS URL of the Authorization Server.
524
476
  * OPTIONAL, but REQUIRED when the Credential Issuer uses multiple Authorization Servers.
@@ -536,100 +488,36 @@ interface ExtractGrantDetailsResultV1_4 {
536
488
  */
537
489
  scope?: never;
538
490
  };
539
- }
540
- /**
541
- * Result of extracting grant details from an APTITUDE credential offer.
542
- *
543
- * It is an object keyed by the OAuth grant type. Each supported grant is optional
544
- * because an APTITUDE credential offer may provide either or both grant types.
545
- *
546
- * Difference from v1.4:
547
- * - Supports both authorization code and pre-authorized code grants.
548
- */
549
- interface ExtractGrantDetailsResultAPTITUDE {
550
491
  /**
551
- * Details of the authorization code grant.
492
+ * The type of grant present in the credential offer.
493
+ * IT-Wallet only supports "authorization_code".
552
494
  */
553
- [CREDENTIAL_OFFER_GRANTS.AUTHORIZATION_CODE]?: {
554
- /**
555
- * HTTPS URL of the Authorization Server.
556
- * OPTIONAL, but REQUIRED when the Credential Issuer uses multiple Authorization Servers.
557
- */
558
- authorizationServer?: string;
559
- /**
560
- * String value representing the issuer state.
561
- * OPTIONAL. Used to correlate the authorization request with the credential offer.
562
- */
563
- issuerState?: string;
564
- /**
565
- * Version 1.4 has dropped support for the scope field,
566
- * But typescript inference might have trouble recognizing this fact
567
- * in its union type, so this is needed
568
- */
569
- scope?: never;
570
- };
571
- [CREDENTIAL_OFFER_GRANTS.PREAUTHORIZED_CODE]?: {
572
- /**
573
- * HTTPS URL of the Authorization Server.
574
- * OPTIONAL, but REQUIRED when the Credential Issuer uses multiple Authorization Servers.
575
- */
576
- authorizationServer?: string;
577
- /**
578
- * REQUIRED. The code representing the Credential Issuer's authorization for
579
- * the Wallet to obtain Credentials of a certain type.
580
- */
581
- preAuthorizedCode: string;
582
- /**
583
- * OPTIONAL. Object indicating that a Transaction Code is required if present, even if empty.
584
- * It describes the requirements for a Transaction Code, which the Authorization Server expects
585
- * the End-User to present along with the Token Request in a Pre-Authorized Code Flow.
586
- * If the Authorization Server does not expect a Transaction Code, this object is absent.
587
- */
588
- txCode?: {
589
- /**
590
- * OPTIONAL. String containing guidance for the Holder
591
- * of the Wallet on how to obtain the Transaction Code.
592
- */
593
- description?: string;
594
- /**
595
- * OPTIONAL. String specifying the input character set.
596
- * Possible values are numeric (only digits) and text (any characters).
597
- * The default is numeric.
598
- */
599
- inputMode?: "digit" | "numeric";
600
- /**
601
- * OPTIONAL. Integer specifying the length of the Transaction Code.
602
- */
603
- length?: number;
604
- };
605
- };
495
+ grantType: "authorization_code";
606
496
  }
607
497
  /**
608
498
  * Result of extracting grant details from a credential offer.
609
499
  */
610
- type ExtractGrantDetailsResult = ExtractGrantDetailsResultAPTITUDE | ExtractGrantDetailsResultV1_3 | ExtractGrantDetailsResultV1_4;
500
+ type ExtractGrantDetailsResult = ExtractGrantDetailsResultV1_3 | ExtractGrantDetailsResultV1_4;
611
501
 
612
502
  /**
613
503
  * Extracts grant details from a credential offer according to the configured
614
- * Italian Wallet specification version. Returns version-specific grant details keyed by grant type.
504
+ * Italian Wallet specification version.
615
505
  *
506
+ * IT-Wallet only supports the `authorization_code` grant type. Pre-authorized
507
+ * code grants are NOT supported.
616
508
  *
617
509
  * Version Differences:
618
510
  * - v1.3: extracts `scope` (REQUIRED), `authorization_server` (OPTIONAL), `issuer_state` (OPTIONAL)
619
511
  * - v1.4: extracts `authorization_server` (OPTIONAL) and `issuer_state` (OPTIONAL); the
620
- * credential offer no longer carries a `scope`.
621
- * - APTITUDE: extracts `authorization_server` (OPTIONAL), `pre-authorized_code` (REQUIRED), and `tx_code` (OPTIONAL).
622
- * authorization_code properties are not mandatory anymore.
623
- *
512
+ * credential offer no longer carries a `scope`
624
513
  *
625
514
  * @param options - Extraction options including the credential offer and version config
626
- * @returns Version-specific grant details keyed by grant type.
627
- * @throws {CredentialOfferError} If grants or the either authorization_code or pre-authorized_code grants are missing
515
+ * @returns Version-specific grant details containing the grant type and authorization code grant information
516
+ * @throws {CredentialOfferError} If grants or the authorization_code grant is missing
628
517
  * @throws {ItWalletSpecsVersionError} If the configured version does not support credential offers
629
518
  */
630
519
  declare function extractGrantDetails(options: ExtractGrantDetailsOptionsV1_3): ExtractGrantDetailsResultV1_3;
631
520
  declare function extractGrantDetails(options: ExtractGrantDetailsOptionsV1_4): ExtractGrantDetailsResultV1_4;
632
- declare function extractGrantDetails(options: ExtractGrantDetailsOptionsAPTITUDE): ExtractGrantDetailsResultAPTITUDE;
633
521
  declare function extractGrantDetails(options: ExtractGrantDetailsOptions): ExtractGrantDetailsResult;
634
522
 
635
523
  /**
@@ -730,7 +618,6 @@ declare function parseCredentialOfferUri(options: ParseCredentialOfferUriOptions
730
618
  */
731
619
  declare function resolveCredentialOffer(options: ResolveCredentialOfferOptionsV1_3): Promise<CredentialOfferV1_3>;
732
620
  declare function resolveCredentialOffer(options: ResolveCredentialOfferOptionsV1_4): Promise<CredentialOfferV1_4>;
733
- declare function resolveCredentialOffer(options: ResolveCredentialOfferOptionsAPTITUDE): Promise<CredentialOfferAPTITUDE>;
734
621
  declare function resolveCredentialOffer(options: ResolveCredentialOfferOptions): Promise<CredentialOffer>;
735
622
 
736
623
  /**
@@ -47077,7 +46964,7 @@ declare class WalletProvider {
47077
46964
  * status: { status_list: { idx: 2, uri: "https://status.example.com" } } // Optional
47078
46965
  * });
47079
46966
  *
47080
- * @example v1.4, APTITUDE - Wallet attestation with required wallet_link and wallet_name
46967
+ * @example v1.4 - Wallet attestation with required wallet_link and wallet_name
47081
46968
  * const jwt = await provider.createItWalletAttestationJwt({
47082
46969
  * callbacks: { hash: myHashCallback, signJwt: mySignJwtCallback },
47083
46970
  * dpopJwkPublic: myJwk,
@@ -47097,4 +46984,4 @@ declare class WalletProvider {
47097
46984
  createItWalletAttestationJwt(options: WalletAttestationOptions): Promise<string>;
47098
46985
  }
47099
46986
 
47100
- export { type AuthorizationCodeGrant, type AuthorizationCodeGrantV1_3, type AuthorizationCodeGrantV1_4, type AuthorizationResponse, type BaseCredentialRequestOptions, CREDENTIAL_OFFER_GRANTS, type CompleteAuthorizationOptions, type CompleteAuthorizationResult, CreateCredentialResponseError, type CreateCredentialResponseOptions, type CreateCredentialResponseOptionsV1_0, type CreateCredentialResponseOptionsV1_3, type CreateCredentialResponseOptionsV1_4, type CreateCredentialResponseResult, type CreateCredentialResponseResultWithFlow, CredentialAuthorizationHeaderError, type CredentialObject, type CredentialOffer, CredentialOfferError, type CredentialOfferGrants, type CredentialOfferGrantsV1_3, type CredentialOfferGrantsV1_4, type CredentialOfferUri, type CredentialOfferV1_3, type CredentialOfferV1_4, type CredentialRequest, type CredentialRequestOptions, type CredentialRequestOptionsV1_0, type CredentialRequestOptionsV1_3, type CredentialRequestOptionsV1_4, type CredentialRequestV1_0, type CredentialRequestV1_3, type CredentialResponse, type CredentialResponseEncryption, type CredentialResponseV1_0, type CredentialResponseV1_3, type DeferredCredentialResponseV1_0, type DeferredCredentialResponseV1_3, type DeferredFlowOptionsV1_0, type DeferredFlowOptionsV1_3, type ExtractGrantDetailsOptions, type ExtractGrantDetailsOptionsV1_3, type ExtractGrantDetailsOptionsV1_4, type ExtractGrantDetailsResult, type ExtractGrantDetailsResultV1_3, type ExtractGrantDetailsResultV1_4, FetchCredentialResponseError, type FetchCredentialResponseOptions, FetchMetadataError, type FetchMetadataOptions, type FetchStatusListCallback, type ImmediateCredentialResponse, type ImmediateFlowOptions, InvalidDpopProofError, type KeyAttestationHeader, type KeyAttestationOptions, type KeyAttestationPayload, type KeyAttestationStatus, type MetadataResponse, type MetadataResponseV1_0, type MetadataResponseV1_3, type MetadataResponseV1_4, MissingDpopProofError, NonceRequestError, Oid4vciError, type ParseCredentialOfferUriOptions, ParseCredentialRequestError, type ParseCredentialRequestExpectedValues, type ParseCredentialRequestOptions, type ParsedCredentialProof, type ParsedCredentialRequest, type ProofJwtHeader, type ProofJwtHeaderV1_0, type ProofJwtHeaderV1_3, type ProofJwtPayload, type ResolveCredentialOfferOptions, type ResolveCredentialOfferOptionsV1_3, type ResolveCredentialOfferOptionsV1_4, type SendAuthorizationResponseAndExtractCodeOptions, type StatusList, type ValidateCredentialOfferOptions, type ValidateCredentialOfferOptionsV1_3, type ValidateCredentialOfferOptionsV1_4, type VerifyAuthorizationResponseFormPostJWTOptions, type VerifyAuthorizationResponseOptions, type VerifyCredentialRequestJwtProofBaseOptions, VerifyCredentialRequestJwtProofError, type VerifyCredentialRequestJwtProofOptions, type VerifyCredentialRequestJwtProofOptionsV1_0, type VerifyCredentialRequestJwtProofOptionsV1_3, type VerifyCredentialRequestJwtProofOptionsV1_4, type VerifyCredentialRequestJwtProofResult, type VerifyCredentialRequestJwtProofResultV1_0, type VerifyCredentialRequestJwtProofResultV1_3, type VerifyCredentialRequestJwtProofResultV1_4, VerifyKeyAttestationJwtError, type VerifyKeyAttestationJwtOptions, type VerifyKeyAttestationJwtResult, type WalletAttestationOptions, WalletProvider, WalletProviderError, completeAuthorization, createCredentialRequest, createCredentialResponse, extractGrantDetails, fetchCredentialResponse, fetchMetadata, keyAttestationTypeHeader, parseCredentialOfferUri, parseCredentialRequest, resolveCredentialOffer, sendAuthorizationResponseAndExtractCode, validateCredentialOffer, verifyAuthorizationResponse, verifyAuthorizationResponseFormPostJWT, verifyCredentialRequestJwtProof, verifyKeyAttestationJwt, zAuthorizationCodeGrantV1_3, zAuthorizationCodeGrantV1_4, zAuthorizationResponse, zCredentialObject, zCredentialOfferGrantsV1_3, zCredentialOfferGrantsV1_4, zCredentialOfferV1_3, zCredentialOfferV1_4, zCredentialRequestV1_0, zCredentialRequestV1_3, zCredentialResponseEncryption, zCredentialResponseV1_0, zCredentialResponseV1_3, zDeferredCredentialResponseV1_0, zDeferredCredentialResponseV1_3, zImmediateCredentialResponse, zKeyAttestationAlg, zKeyAttestationHeader, zKeyAttestationPayload, zKeyAttestationStatus, zKeyAttestationTypeHeader, zMetadataResponse, zMetadataResponseV1_0, zMetadataResponseV1_3, zMetadataResponseV1_4, zProofJwtHeaderV1_0, zProofJwtHeaderV1_3, zProofJwtPayload, zStatusList };
46987
+ export { type AuthorizationCodeGrant, type AuthorizationCodeGrantV1_3, type AuthorizationCodeGrantV1_4, type AuthorizationResponse, type BaseCredentialRequestOptions, type CompleteAuthorizationOptions, type CompleteAuthorizationResult, CreateCredentialResponseError, type CreateCredentialResponseOptions, type CreateCredentialResponseOptionsV1_0, type CreateCredentialResponseOptionsV1_3, type CreateCredentialResponseOptionsV1_4, type CreateCredentialResponseResult, type CreateCredentialResponseResultWithFlow, CredentialAuthorizationHeaderError, type CredentialObject, type CredentialOffer, CredentialOfferError, type CredentialOfferGrants, type CredentialOfferGrantsV1_3, type CredentialOfferGrantsV1_4, type CredentialOfferUri, type CredentialOfferV1_3, type CredentialOfferV1_4, type CredentialRequest, type CredentialRequestOptions, type CredentialRequestOptionsV1_0, type CredentialRequestOptionsV1_3, type CredentialRequestOptionsV1_4, type CredentialRequestV1_0, type CredentialRequestV1_3, type CredentialResponse, type CredentialResponseEncryption, type CredentialResponseV1_0, type CredentialResponseV1_3, type DeferredCredentialResponseV1_0, type DeferredCredentialResponseV1_3, type DeferredFlowOptionsV1_0, type DeferredFlowOptionsV1_3, type ExtractGrantDetailsOptions, type ExtractGrantDetailsOptionsV1_3, type ExtractGrantDetailsOptionsV1_4, type ExtractGrantDetailsResult, type ExtractGrantDetailsResultV1_3, type ExtractGrantDetailsResultV1_4, FetchCredentialResponseError, type FetchCredentialResponseOptions, FetchMetadataError, type FetchMetadataOptions, type FetchStatusListCallback, type ImmediateCredentialResponse, type ImmediateFlowOptions, InvalidDpopProofError, type KeyAttestationHeader, type KeyAttestationOptions, type KeyAttestationPayload, type KeyAttestationStatus, type MetadataResponse, type MetadataResponseV1_0, type MetadataResponseV1_3, type MetadataResponseV1_4, MissingDpopProofError, NonceRequestError, Oid4vciError, type ParseCredentialOfferUriOptions, ParseCredentialRequestError, type ParseCredentialRequestExpectedValues, type ParseCredentialRequestOptions, type ParsedCredentialProof, type ParsedCredentialRequest, type ProofJwtHeader, type ProofJwtHeaderV1_0, type ProofJwtHeaderV1_3, type ProofJwtPayload, type ResolveCredentialOfferOptions, type ResolveCredentialOfferOptionsV1_3, type ResolveCredentialOfferOptionsV1_4, type SendAuthorizationResponseAndExtractCodeOptions, type StatusList, type ValidateCredentialOfferOptions, type ValidateCredentialOfferOptionsV1_3, type ValidateCredentialOfferOptionsV1_4, type VerifyAuthorizationResponseFormPostJWTOptions, type VerifyAuthorizationResponseOptions, type VerifyCredentialRequestJwtProofBaseOptions, VerifyCredentialRequestJwtProofError, type VerifyCredentialRequestJwtProofOptions, type VerifyCredentialRequestJwtProofOptionsV1_0, type VerifyCredentialRequestJwtProofOptionsV1_3, type VerifyCredentialRequestJwtProofOptionsV1_4, type VerifyCredentialRequestJwtProofResult, type VerifyCredentialRequestJwtProofResultV1_0, type VerifyCredentialRequestJwtProofResultV1_3, type VerifyCredentialRequestJwtProofResultV1_4, VerifyKeyAttestationJwtError, type VerifyKeyAttestationJwtOptions, type VerifyKeyAttestationJwtResult, type WalletAttestationOptions, WalletProvider, WalletProviderError, completeAuthorization, createCredentialRequest, createCredentialResponse, extractGrantDetails, fetchCredentialResponse, fetchMetadata, keyAttestationTypeHeader, parseCredentialOfferUri, parseCredentialRequest, resolveCredentialOffer, sendAuthorizationResponseAndExtractCode, validateCredentialOffer, verifyAuthorizationResponse, verifyAuthorizationResponseFormPostJWT, verifyCredentialRequestJwtProof, verifyKeyAttestationJwt, zAuthorizationCodeGrantV1_3, zAuthorizationCodeGrantV1_4, zAuthorizationResponse, zCredentialObject, zCredentialOfferGrantsV1_3, zCredentialOfferGrantsV1_4, zCredentialOfferV1_3, zCredentialOfferV1_4, zCredentialRequestV1_0, zCredentialRequestV1_3, zCredentialResponseEncryption, zCredentialResponseV1_0, zCredentialResponseV1_3, zDeferredCredentialResponseV1_0, zDeferredCredentialResponseV1_3, zImmediateCredentialResponse, zKeyAttestationAlg, zKeyAttestationHeader, zKeyAttestationPayload, zKeyAttestationStatus, zKeyAttestationTypeHeader, zMetadataResponse, zMetadataResponseV1_0, zMetadataResponseV1_3, zMetadataResponseV1_4, zProofJwtHeaderV1_0, zProofJwtHeaderV1_3, zProofJwtPayload, zStatusList };