@openid4vc/openid4vp 0.8.1 → 0.8.2-alpha-20261025123453

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
@@ -1,4 +1,4 @@
1
- import { CallbackContext, CreateJarAuthorizationRequestOptions, DecodeJwtResult, HashAlgorithm, JarRequestObjectPayload, Jwk, JwkSet, JwtSigner, JwtSignerWithJwk, Oauth2Error, Oauth2ErrorOptions, zJarRequestObjectPayload } from "@openid4vc/oauth2";
1
+ import { CallbackContext, CreateJarAuthorizationRequestOptions, DecodeJwtResult, HashAlgorithm, JarRequestObjectPayload, Jwk, JwkSet, JwtSigner, JwtSignerWithJwk, Oauth2Error, Oauth2ErrorOptions, Oauth2ServerErrorResponseError, zJarRequestObjectPayload } from "@openid4vc/oauth2";
2
2
  import { NonEmptyArray } from "@openid4vc/utils";
3
3
  import z, { z as z$1 } from "zod";
4
4
  //#region src/models/z-wallet-metadata.d.ts
@@ -1404,32 +1404,6 @@ export declare function createOpenid4vpAuthorizationRequest(options: CreateOpeni
1404
1404
  jar: undefined;
1405
1405
  }>;
1406
1406
  //#endregion
1407
- //#region src/authorization-request/parse-authorization-request-params.d.ts
1408
- interface ParsedJarRequest {
1409
- type: 'jar';
1410
- provided: 'uri' | 'jwt' | 'params';
1411
- params: Openid4vpJarAuthorizationRequest;
1412
- }
1413
- interface ParsedOpenid4vpAuthorizationRequest {
1414
- type: 'openid4vp';
1415
- provided: 'uri' | 'jwt' | 'params';
1416
- params: Openid4vpAuthorizationRequest;
1417
- }
1418
- interface ParsedOpenid4vpDcApiAuthorizationRequest {
1419
- type: 'openid4vp_dc_api';
1420
- provided: 'uri' | 'jwt' | 'params';
1421
- params: Openid4vpAuthorizationRequestDcApi;
1422
- }
1423
- interface ParsedOpenid4vpIaeAuthorizationRequest {
1424
- type: 'openid4vp_iae';
1425
- provided: 'uri' | 'jwt' | 'params';
1426
- params: Openid4vpAuthorizationRequestIae;
1427
- }
1428
- interface ParseOpenid4vpAuthorizationRequestOptions {
1429
- authorizationRequest: string | Record<string, unknown>;
1430
- }
1431
- export declare function parseOpenid4vpAuthorizationRequest(options: ParseOpenid4vpAuthorizationRequestOptions): ParsedOpenid4vpAuthorizationRequest | ParsedJarRequest | ParsedOpenid4vpDcApiAuthorizationRequest | ParsedOpenid4vpIaeAuthorizationRequest;
1432
- //#endregion
1433
1407
  //#region src/jar/handle-jar-request/verify-jar-request.d.ts
1434
1408
  interface VerifiedJarRequest {
1435
1409
  authorizationRequestPayload: JarRequestObjectPayload;
@@ -1671,6 +1645,348 @@ export declare function getOpenid4vpClientId(options: GetOpenid4vpClientIdOption
1671
1645
  };
1672
1646
  };
1673
1647
  //#endregion
1648
+ //#region src/authorization-request/z-authorization-request-payload.d.ts
1649
+ /**
1650
+ * An unsigned OpenID4VP authorization request payload, or the payload of a signed request object.
1651
+ */
1652
+ declare const zOpenid4vpAuthorizationRequestPayload: z$1.ZodUnion<readonly [z$1.ZodObject<{
1653
+ response_type: z$1.ZodLiteral<"vp_token">;
1654
+ nonce: z$1.ZodString;
1655
+ presentation_definition: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>, z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<any, string>>]>>;
1656
+ dcql_query: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>, z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<any, string>>]>>;
1657
+ client_metadata: z$1.ZodOptional<z$1.ZodObject<{
1658
+ authorization_signed_response_alg: z$1.ZodOptional<z$1.ZodString>;
1659
+ authorization_encrypted_response_alg: z$1.ZodOptional<z$1.ZodString>;
1660
+ authorization_encrypted_response_enc: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1661
+ jwks_uri: z$1.ZodOptional<z$1.ZodURL>;
1662
+ jwks: z$1.ZodOptional<z$1.ZodObject<{
1663
+ keys: z$1.ZodArray<z$1.ZodObject<{
1664
+ kty: z$1.ZodString;
1665
+ crv: z$1.ZodOptional<z$1.ZodString>;
1666
+ x: z$1.ZodOptional<z$1.ZodString>;
1667
+ y: z$1.ZodOptional<z$1.ZodString>;
1668
+ e: z$1.ZodOptional<z$1.ZodString>;
1669
+ n: z$1.ZodOptional<z$1.ZodString>;
1670
+ alg: z$1.ZodOptional<z$1.ZodString>;
1671
+ d: z$1.ZodOptional<z$1.ZodString>;
1672
+ dp: z$1.ZodOptional<z$1.ZodString>;
1673
+ dq: z$1.ZodOptional<z$1.ZodString>;
1674
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
1675
+ k: z$1.ZodOptional<z$1.ZodString>;
1676
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1677
+ kid: z$1.ZodOptional<z$1.ZodString>;
1678
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1679
+ d: z$1.ZodOptional<z$1.ZodString>;
1680
+ r: z$1.ZodOptional<z$1.ZodString>;
1681
+ t: z$1.ZodOptional<z$1.ZodString>;
1682
+ }, z$1.core.$loose>>>;
1683
+ p: z$1.ZodOptional<z$1.ZodString>;
1684
+ q: z$1.ZodOptional<z$1.ZodString>;
1685
+ qi: z$1.ZodOptional<z$1.ZodString>;
1686
+ use: z$1.ZodOptional<z$1.ZodString>;
1687
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1688
+ x5t: z$1.ZodOptional<z$1.ZodString>;
1689
+ 'x5t#S256': z$1.ZodOptional<z$1.ZodString>;
1690
+ x5u: z$1.ZodOptional<z$1.ZodString>;
1691
+ }, z$1.core.$loose>>;
1692
+ }, z$1.core.$loose>>;
1693
+ vp_formats: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
1694
+ alg_values_supported: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1695
+ }, z$1.core.$loose>>>;
1696
+ vp_formats_supported: z$1.ZodOptional<z$1.ZodObject<{
1697
+ 'dc+sd-jwt': z$1.ZodOptional<z$1.ZodObject<{
1698
+ 'sd-jwt_alg_values': z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1699
+ 'kb-jwt_alg_values': z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1700
+ }, z$1.core.$loose>>;
1701
+ jwt_vc_json: z$1.ZodOptional<z$1.ZodObject<{
1702
+ alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1703
+ }, z$1.core.$loose>>;
1704
+ ldp_vc: z$1.ZodOptional<z$1.ZodObject<{
1705
+ proof_type_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1706
+ cryptosuite_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1707
+ }, z$1.core.$loose>>;
1708
+ mso_mdoc: z$1.ZodOptional<z$1.ZodObject<{
1709
+ issuer_signed_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1710
+ device_signed_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1711
+ issuerauth_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1712
+ deviceauth_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1713
+ }, z$1.core.$loose>>;
1714
+ }, z$1.core.$catchall<z$1.ZodObject<{}, z$1.core.$loose>>>>;
1715
+ encrypted_response_enc_values_supported: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1716
+ logo_uri: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodURL, z$1.ZodString]>>;
1717
+ client_name: z$1.ZodOptional<z$1.ZodString>;
1718
+ }, z$1.core.$loose>>;
1719
+ state: z$1.ZodOptional<z$1.ZodString>;
1720
+ transaction_data: z$1.ZodOptional<z$1.ZodArray<z$1.ZodBase64URL>>;
1721
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1722
+ verifier_attestations: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1723
+ format: z$1.ZodString;
1724
+ data: z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodString]>;
1725
+ credential_ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1726
+ }, z$1.core.$strip>>>;
1727
+ verifier_info: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1728
+ format: z$1.ZodString;
1729
+ data: z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodString]>;
1730
+ credential_ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1731
+ }, z$1.core.$strip>>>;
1732
+ client_id: z$1.ZodOptional<z$1.ZodString>;
1733
+ expected_origins: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1734
+ response_mode: z$1.ZodEnum<{
1735
+ dc_api: "dc_api";
1736
+ "dc_api.jwt": "dc_api.jwt";
1737
+ w3c_dc_api: "w3c_dc_api";
1738
+ "w3c_dc_api.jwt": "w3c_dc_api.jwt";
1739
+ }>;
1740
+ client_id_scheme: z$1.ZodOptional<z$1.ZodNever>;
1741
+ scope: z$1.ZodOptional<z$1.ZodNever>;
1742
+ }, z$1.core.$loose>, z$1.ZodObject<{
1743
+ response_type: z$1.ZodLiteral<"vp_token">;
1744
+ nonce: z$1.ZodString;
1745
+ client_metadata: z$1.ZodOptional<z$1.ZodObject<{
1746
+ authorization_signed_response_alg: z$1.ZodOptional<z$1.ZodString>;
1747
+ authorization_encrypted_response_alg: z$1.ZodOptional<z$1.ZodString>;
1748
+ authorization_encrypted_response_enc: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1749
+ jwks_uri: z$1.ZodOptional<z$1.ZodURL>;
1750
+ jwks: z$1.ZodOptional<z$1.ZodObject<{
1751
+ keys: z$1.ZodArray<z$1.ZodObject<{
1752
+ kty: z$1.ZodString;
1753
+ crv: z$1.ZodOptional<z$1.ZodString>;
1754
+ x: z$1.ZodOptional<z$1.ZodString>;
1755
+ y: z$1.ZodOptional<z$1.ZodString>;
1756
+ e: z$1.ZodOptional<z$1.ZodString>;
1757
+ n: z$1.ZodOptional<z$1.ZodString>;
1758
+ alg: z$1.ZodOptional<z$1.ZodString>;
1759
+ d: z$1.ZodOptional<z$1.ZodString>;
1760
+ dp: z$1.ZodOptional<z$1.ZodString>;
1761
+ dq: z$1.ZodOptional<z$1.ZodString>;
1762
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
1763
+ k: z$1.ZodOptional<z$1.ZodString>;
1764
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1765
+ kid: z$1.ZodOptional<z$1.ZodString>;
1766
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1767
+ d: z$1.ZodOptional<z$1.ZodString>;
1768
+ r: z$1.ZodOptional<z$1.ZodString>;
1769
+ t: z$1.ZodOptional<z$1.ZodString>;
1770
+ }, z$1.core.$loose>>>;
1771
+ p: z$1.ZodOptional<z$1.ZodString>;
1772
+ q: z$1.ZodOptional<z$1.ZodString>;
1773
+ qi: z$1.ZodOptional<z$1.ZodString>;
1774
+ use: z$1.ZodOptional<z$1.ZodString>;
1775
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1776
+ x5t: z$1.ZodOptional<z$1.ZodString>;
1777
+ 'x5t#S256': z$1.ZodOptional<z$1.ZodString>;
1778
+ x5u: z$1.ZodOptional<z$1.ZodString>;
1779
+ }, z$1.core.$loose>>;
1780
+ }, z$1.core.$loose>>;
1781
+ vp_formats: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
1782
+ alg_values_supported: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1783
+ }, z$1.core.$loose>>>;
1784
+ vp_formats_supported: z$1.ZodOptional<z$1.ZodObject<{
1785
+ 'dc+sd-jwt': z$1.ZodOptional<z$1.ZodObject<{
1786
+ 'sd-jwt_alg_values': z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1787
+ 'kb-jwt_alg_values': z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1788
+ }, z$1.core.$loose>>;
1789
+ jwt_vc_json: z$1.ZodOptional<z$1.ZodObject<{
1790
+ alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1791
+ }, z$1.core.$loose>>;
1792
+ ldp_vc: z$1.ZodOptional<z$1.ZodObject<{
1793
+ proof_type_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1794
+ cryptosuite_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1795
+ }, z$1.core.$loose>>;
1796
+ mso_mdoc: z$1.ZodOptional<z$1.ZodObject<{
1797
+ issuer_signed_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1798
+ device_signed_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1799
+ issuerauth_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1800
+ deviceauth_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1801
+ }, z$1.core.$loose>>;
1802
+ }, z$1.core.$catchall<z$1.ZodObject<{}, z$1.core.$loose>>>>;
1803
+ encrypted_response_enc_values_supported: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1804
+ logo_uri: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodURL, z$1.ZodString]>>;
1805
+ client_name: z$1.ZodOptional<z$1.ZodString>;
1806
+ }, z$1.core.$loose>>;
1807
+ state: z$1.ZodOptional<z$1.ZodString>;
1808
+ transaction_data: z$1.ZodOptional<z$1.ZodArray<z$1.ZodBase64URL>>;
1809
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1810
+ verifier_attestations: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1811
+ format: z$1.ZodString;
1812
+ data: z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodString]>;
1813
+ credential_ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1814
+ }, z$1.core.$strip>>>;
1815
+ verifier_info: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1816
+ format: z$1.ZodString;
1817
+ data: z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodString]>;
1818
+ credential_ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1819
+ }, z$1.core.$strip>>>;
1820
+ client_id: z$1.ZodOptional<z$1.ZodString>;
1821
+ client_id_scheme: z$1.ZodOptional<z$1.ZodNever>;
1822
+ scope: z$1.ZodOptional<z$1.ZodNever>;
1823
+ response_mode: z$1.ZodEnum<{
1824
+ iae_post: "iae_post";
1825
+ "iae_post.jwt": "iae_post.jwt";
1826
+ }>;
1827
+ dcql_query: z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>;
1828
+ expected_url: z$1.ZodOptional<z$1.ZodString>;
1829
+ expected_origins: z$1.ZodOptional<z$1.ZodNever>;
1830
+ }, z$1.core.$loose>, z$1.ZodObject<{
1831
+ response_type: z$1.ZodLiteral<"vp_token">;
1832
+ client_id: z$1.ZodString;
1833
+ redirect_uri: z$1.ZodOptional<z$1.ZodURL>;
1834
+ response_uri: z$1.ZodOptional<z$1.ZodURL>;
1835
+ request_uri: z$1.ZodOptional<z$1.ZodURL>;
1836
+ request_uri_method: z$1.ZodOptional<z$1.ZodString>;
1837
+ response_mode: z$1.ZodOptional<z$1.ZodEnum<{
1838
+ direct_post: "direct_post";
1839
+ "direct_post.jwt": "direct_post.jwt";
1840
+ }>>;
1841
+ nonce: z$1.ZodString;
1842
+ wallet_nonce: z$1.ZodOptional<z$1.ZodString>;
1843
+ scope: z$1.ZodOptional<z$1.ZodString>;
1844
+ presentation_definition: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>, z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<any, string>>]>>;
1845
+ presentation_definition_uri: z$1.ZodOptional<z$1.ZodURL>;
1846
+ dcql_query: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>, z$1.ZodPipe<z$1.ZodString, z$1.ZodTransform<any, string>>]>>;
1847
+ client_metadata: z$1.ZodOptional<z$1.ZodObject<{
1848
+ authorization_signed_response_alg: z$1.ZodOptional<z$1.ZodString>;
1849
+ authorization_encrypted_response_alg: z$1.ZodOptional<z$1.ZodString>;
1850
+ authorization_encrypted_response_enc: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
1851
+ jwks_uri: z$1.ZodOptional<z$1.ZodURL>;
1852
+ jwks: z$1.ZodOptional<z$1.ZodObject<{
1853
+ keys: z$1.ZodArray<z$1.ZodObject<{
1854
+ kty: z$1.ZodString;
1855
+ crv: z$1.ZodOptional<z$1.ZodString>;
1856
+ x: z$1.ZodOptional<z$1.ZodString>;
1857
+ y: z$1.ZodOptional<z$1.ZodString>;
1858
+ e: z$1.ZodOptional<z$1.ZodString>;
1859
+ n: z$1.ZodOptional<z$1.ZodString>;
1860
+ alg: z$1.ZodOptional<z$1.ZodString>;
1861
+ d: z$1.ZodOptional<z$1.ZodString>;
1862
+ dp: z$1.ZodOptional<z$1.ZodString>;
1863
+ dq: z$1.ZodOptional<z$1.ZodString>;
1864
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
1865
+ k: z$1.ZodOptional<z$1.ZodString>;
1866
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1867
+ kid: z$1.ZodOptional<z$1.ZodString>;
1868
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1869
+ d: z$1.ZodOptional<z$1.ZodString>;
1870
+ r: z$1.ZodOptional<z$1.ZodString>;
1871
+ t: z$1.ZodOptional<z$1.ZodString>;
1872
+ }, z$1.core.$loose>>>;
1873
+ p: z$1.ZodOptional<z$1.ZodString>;
1874
+ q: z$1.ZodOptional<z$1.ZodString>;
1875
+ qi: z$1.ZodOptional<z$1.ZodString>;
1876
+ use: z$1.ZodOptional<z$1.ZodString>;
1877
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1878
+ x5t: z$1.ZodOptional<z$1.ZodString>;
1879
+ 'x5t#S256': z$1.ZodOptional<z$1.ZodString>;
1880
+ x5u: z$1.ZodOptional<z$1.ZodString>;
1881
+ }, z$1.core.$loose>>;
1882
+ }, z$1.core.$loose>>;
1883
+ vp_formats: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
1884
+ alg_values_supported: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1885
+ }, z$1.core.$loose>>>;
1886
+ vp_formats_supported: z$1.ZodOptional<z$1.ZodObject<{
1887
+ 'dc+sd-jwt': z$1.ZodOptional<z$1.ZodObject<{
1888
+ 'sd-jwt_alg_values': z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1889
+ 'kb-jwt_alg_values': z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1890
+ }, z$1.core.$loose>>;
1891
+ jwt_vc_json: z$1.ZodOptional<z$1.ZodObject<{
1892
+ alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1893
+ }, z$1.core.$loose>>;
1894
+ ldp_vc: z$1.ZodOptional<z$1.ZodObject<{
1895
+ proof_type_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1896
+ cryptosuite_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1897
+ }, z$1.core.$loose>>;
1898
+ mso_mdoc: z$1.ZodOptional<z$1.ZodObject<{
1899
+ issuer_signed_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1900
+ device_signed_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1901
+ issuerauth_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1902
+ deviceauth_alg_values: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodNumber], z$1.ZodNumber>>;
1903
+ }, z$1.core.$loose>>;
1904
+ }, z$1.core.$catchall<z$1.ZodObject<{}, z$1.core.$loose>>>>;
1905
+ encrypted_response_enc_values_supported: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1906
+ logo_uri: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodURL, z$1.ZodString]>>;
1907
+ client_name: z$1.ZodOptional<z$1.ZodString>;
1908
+ }, z$1.core.$loose>>;
1909
+ client_metadata_uri: z$1.ZodOptional<z$1.ZodURL>;
1910
+ state: z$1.ZodOptional<z$1.ZodString>;
1911
+ transaction_data: z$1.ZodOptional<z$1.ZodArray<z$1.ZodBase64URL>>;
1912
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
1913
+ client_id_scheme: z$1.ZodOptional<z$1.ZodEnum<{
1914
+ did: "did";
1915
+ entity_id: "entity_id";
1916
+ "pre-registered": "pre-registered";
1917
+ redirect_uri: "redirect_uri";
1918
+ verifier_attestation: "verifier_attestation";
1919
+ x509_hash: "x509_hash";
1920
+ x509_san_dns: "x509_san_dns";
1921
+ x509_san_uri: "x509_san_uri";
1922
+ }>>;
1923
+ verifier_attestations: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1924
+ format: z$1.ZodString;
1925
+ data: z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodString]>;
1926
+ credential_ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1927
+ }, z$1.core.$strip>>>;
1928
+ verifier_info: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
1929
+ format: z$1.ZodString;
1930
+ data: z$1.ZodUnion<[z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>, z$1.ZodString]>;
1931
+ credential_ids: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
1932
+ }, z$1.core.$strip>>>;
1933
+ }, z$1.core.$loose>]>;
1934
+ type Openid4vpAuthorizationRequestPayload = z$1.infer<typeof zOpenid4vpAuthorizationRequestPayload>;
1935
+ //#endregion
1936
+ //#region src/authorization-request/Openid4vpAuthorizationRequestError.d.ts
1937
+ /**
1938
+ * Error thrown when resolving an authorization request fails once the authorization request payload is known.
1939
+ * The wallet can answer it with an Authorization Error Response (OpenID4VP 1.0 Section 8.5) containing
1940
+ * `errorResponse`.
1941
+ *
1942
+ * `isClientAuthenticated` tells whether the client was authenticated: the JAR (if any) was verified and the
1943
+ * client identifier was validated, so the `response_uri` belongs to the client. When it is `false`, the
1944
+ * `response_uri` comes from a request that could not be verified, so a `redirect_uri` the response endpoint
1945
+ * returns should not be opened: it could send the user anywhere, in the name of any verifier.
1946
+ *
1947
+ * For the `openid_federation` client identifier prefix, the trust chain is verified outside this
1948
+ * library, so verify it before treating the client as authenticated.
1949
+ *
1950
+ * Failures before the payload is known (for example when fetching the request object) throw a plain
1951
+ * `Oauth2ServerErrorResponseError`, as there is nowhere to send the error to.
1952
+ */
1953
+ export declare class Openid4vpAuthorizationRequestError extends Oauth2ServerErrorResponseError {
1954
+ readonly authorizationRequestPayload: Openid4vpAuthorizationRequestPayload;
1955
+ /**
1956
+ * Whether the client was authenticated. Only then is `client` defined.
1957
+ */
1958
+ readonly isClientAuthenticated: boolean;
1959
+ readonly client: ParsedClientIdentifier | undefined;
1960
+ readonly jar: VerifiedJarRequest | undefined;
1961
+ constructor(error: Oauth2ServerErrorResponseError, request: Pick<Openid4vpAuthorizationRequestError, 'authorizationRequestPayload'> & Partial<Pick<Openid4vpAuthorizationRequestError, 'client' | 'jar'>>);
1962
+ }
1963
+ //#endregion
1964
+ //#region src/authorization-request/parse-authorization-request-params.d.ts
1965
+ interface ParsedJarRequest {
1966
+ type: 'jar';
1967
+ provided: 'uri' | 'jwt' | 'params';
1968
+ params: Openid4vpJarAuthorizationRequest;
1969
+ }
1970
+ interface ParsedOpenid4vpAuthorizationRequest {
1971
+ type: 'openid4vp';
1972
+ provided: 'uri' | 'jwt' | 'params';
1973
+ params: Openid4vpAuthorizationRequest;
1974
+ }
1975
+ interface ParsedOpenid4vpDcApiAuthorizationRequest {
1976
+ type: 'openid4vp_dc_api';
1977
+ provided: 'uri' | 'jwt' | 'params';
1978
+ params: Openid4vpAuthorizationRequestDcApi;
1979
+ }
1980
+ interface ParsedOpenid4vpIaeAuthorizationRequest {
1981
+ type: 'openid4vp_iae';
1982
+ provided: 'uri' | 'jwt' | 'params';
1983
+ params: Openid4vpAuthorizationRequestIae;
1984
+ }
1985
+ interface ParseOpenid4vpAuthorizationRequestOptions {
1986
+ authorizationRequest: string | Record<string, unknown>;
1987
+ }
1988
+ export declare function parseOpenid4vpAuthorizationRequest(options: ParseOpenid4vpAuthorizationRequestOptions): ParsedOpenid4vpAuthorizationRequest | ParsedJarRequest | ParsedOpenid4vpDcApiAuthorizationRequest | ParsedOpenid4vpIaeAuthorizationRequest;
1989
+ //#endregion
1674
1990
  //#region src/models/z-pex.d.ts
1675
1991
  declare const zPexPresentationDefinition: z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>;
1676
1992
  declare const zPexPresentationSubmission: z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>;
@@ -1698,7 +2014,7 @@ export declare function parseTransactionData(options: ParseTransactionDataOption
1698
2014
  //#endregion
1699
2015
  //#region src/authorization-request/resolve-authorization-request.d.ts
1700
2016
  interface ResolveOpenid4vpAuthorizationRequestOptions {
1701
- authorizationRequestPayload: Openid4vpAuthorizationRequest | Openid4vpAuthorizationRequestDcApi | Openid4vpAuthorizationRequestIae | Openid4vpJarAuthorizationRequest;
2017
+ authorizationRequestPayload: Openid4vpAuthorizationRequestPayload | Openid4vpJarAuthorizationRequest;
1702
2018
  wallet?: WalletVerificationOptions;
1703
2019
  /**
1704
2020
  * The response mode that is expected for the resolved presentation request.
@@ -1708,7 +2024,7 @@ interface ResolveOpenid4vpAuthorizationRequestOptions {
1708
2024
  }
1709
2025
  type ResolvedOpenid4vpAuthorizationRequest = {
1710
2026
  transactionData?: ParsedTransactionDataEntry[];
1711
- authorizationRequestPayload: Openid4vpAuthorizationRequest | Openid4vpAuthorizationRequestDcApi | Openid4vpAuthorizationRequestIae;
2027
+ authorizationRequestPayload: Openid4vpAuthorizationRequestPayload;
1712
2028
  jar: VerifiedJarRequest | undefined;
1713
2029
  client: ParsedClientIdentifier;
1714
2030
  pex?: {
@@ -1819,7 +2135,7 @@ export declare const zOpenid4vpAuthorizationErrorResponse: z$1.ZodObject<{
1819
2135
  type Openid4vpAuthorizationErrorResponse = z$1.infer<typeof zOpenid4vpAuthorizationErrorResponse>;
1820
2136
  //#endregion
1821
2137
  //#region src/authorization-response/create-authorization-response.d.ts
1822
- interface CreateOpenid4vpAuthorizationResponseOptions {
2138
+ interface CreateOpenid4vpAuthorizationResponseOptions<ResponsePayload extends Openid4vpAuthorizationResponse | Openid4vpAuthorizationErrorResponse = Openid4vpAuthorizationResponse> {
1823
2139
  authorizationRequestPayload: Openid4vpAuthorizationRequest | Openid4vpAuthorizationRequestDcApi;
1824
2140
  /**
1825
2141
  * Optional client metadata to use for sending the authorization response. In case of e.g. OpenID Federation
@@ -1830,7 +2146,14 @@ interface CreateOpenid4vpAuthorizationResponseOptions {
1830
2146
  * The origin of the reuqest, required when creating a response for the Digital Credentials API.
1831
2147
  */
1832
2148
  origin?: string;
1833
- authorizationResponsePayload: Openid4vpAuthorizationResponse & {
2149
+ /**
2150
+ * The authorization response, or an authorization error response (OpenID4VP 1.0 Section 8.5). The `state`
2151
+ * is taken from the authorization request.
2152
+ *
2153
+ * An error response can be created without `jarm` for a JARM response mode, for when the wallet
2154
+ * is unable to encrypt the response (OpenID4VP 1.0 Section 8.3.1).
2155
+ */
2156
+ authorizationResponsePayload: ResponsePayload & {
1834
2157
  state?: never;
1835
2158
  };
1836
2159
  jarm?: {
@@ -1851,8 +2174,8 @@ interface CreateOpenid4vpAuthorizationResponseOptions {
1851
2174
  };
1852
2175
  callbacks: Pick<CallbackContext, 'signJwt' | 'encryptJwe' | 'fetch' | 'getJwks'>;
1853
2176
  }
1854
- interface CreateOpenid4vpAuthorizationResponseResult {
1855
- authorizationResponsePayload: Openid4vpAuthorizationResponse;
2177
+ interface CreateOpenid4vpAuthorizationResponseResult<ResponsePayload extends Openid4vpAuthorizationResponse | Openid4vpAuthorizationErrorResponse = Openid4vpAuthorizationResponse> {
2178
+ authorizationResponsePayload: ResponsePayload;
1856
2179
  jarm?: {
1857
2180
  responseJwt: string;
1858
2181
  /**
@@ -1861,7 +2184,7 @@ interface CreateOpenid4vpAuthorizationResponseResult {
1861
2184
  encryptionJwk?: Jwk;
1862
2185
  };
1863
2186
  }
1864
- export declare function createOpenid4vpAuthorizationResponse(options: CreateOpenid4vpAuthorizationResponseOptions): Promise<CreateOpenid4vpAuthorizationResponseResult>;
2187
+ export declare function createOpenid4vpAuthorizationResponse<ResponsePayload extends Openid4vpAuthorizationResponse | Openid4vpAuthorizationErrorResponse = Openid4vpAuthorizationResponse>(options: CreateOpenid4vpAuthorizationResponseOptions<ResponsePayload>): Promise<CreateOpenid4vpAuthorizationResponseResult<ResponsePayload>>;
1865
2188
  //#endregion
1866
2189
  //#region src/authorization-response/Openid4vpAuthorizationResponseError.d.ts
1867
2190
  /**
@@ -2154,7 +2477,7 @@ export declare function parseJarmAuthorizationResponse(options: ParseJarmAuthori
2154
2477
  //#region src/authorization-response/submit-authorization-response.d.ts
2155
2478
  interface SubmitOpenid4vpAuthorizationResponseOptions {
2156
2479
  authorizationRequestPayload: Pick<Openid4vpAuthorizationRequest, 'response_uri'>;
2157
- authorizationResponsePayload: Openid4vpAuthorizationResponse;
2480
+ authorizationResponsePayload: Openid4vpAuthorizationResponse | Openid4vpAuthorizationErrorResponse;
2158
2481
  jarm?: {
2159
2482
  responseJwt: string;
2160
2483
  };
@@ -2290,7 +2613,7 @@ export declare class Openid4vpClient {
2290
2613
  constructor(options: Openid4vpClientOptions);
2291
2614
  parseOpenid4vpAuthorizationRequest(options: ParseOpenid4vpAuthorizationRequestOptions): ParsedJarRequest | ParsedOpenid4vpAuthorizationRequest | ParsedOpenid4vpDcApiAuthorizationRequest | ParsedOpenid4vpIaeAuthorizationRequest;
2292
2615
  resolveOpenId4vpAuthorizationRequest(options: Omit<ResolveOpenid4vpAuthorizationRequestOptions, 'callbacks'>): Promise<ResolvedOpenid4vpAuthorizationRequest>;
2293
- createOpenid4vpAuthorizationResponse(options: Omit<CreateOpenid4vpAuthorizationResponseOptions, 'callbacks'>): Promise<CreateOpenid4vpAuthorizationResponseResult>;
2616
+ createOpenid4vpAuthorizationResponse<ResponsePayload extends Openid4vpAuthorizationResponse | Openid4vpAuthorizationErrorResponse = Openid4vpAuthorizationResponse>(options: Omit<CreateOpenid4vpAuthorizationResponseOptions<ResponsePayload>, 'callbacks'>): Promise<CreateOpenid4vpAuthorizationResponseResult<ResponsePayload>>;
2294
2617
  submitOpenid4vpAuthorizationResponse(options: Omit<SubmitOpenid4vpAuthorizationResponseOptions, 'callbacks'>): Promise<{
2295
2618
  readonly responseMode: 'direct_post.jwt';
2296
2619
  readonly response: Response;