@credo-ts/openid4vc 0.6.0-pr-2392-20251010173905 → 0.6.0-pr-2457-20251016083534

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.
Files changed (163) hide show
  1. package/build/OpenId4VcApi.d.mts +1 -1
  2. package/build/OpenId4VcApi.d.ts +1 -1
  3. package/build/OpenId4VcApi.js +2 -2
  4. package/build/OpenId4VcApi.mjs +2 -2
  5. package/build/OpenId4VcModule.d.mts +1 -1
  6. package/build/OpenId4VcModule.d.ts +1 -1
  7. package/build/OpenId4VcModule.js +2 -2
  8. package/build/OpenId4VcModule.mjs +2 -2
  9. package/build/OpenId4VcModuleConfig.js +1 -1
  10. package/build/OpenId4VcModuleConfig.mjs +1 -1
  11. package/build/index.d.mts +15 -14
  12. package/build/index.d.ts +15 -14
  13. package/build/index.js +22 -15
  14. package/build/index.mjs +18 -17
  15. package/build/openid4vc-holder/OpenId4VcHolderApi.d.mts.map +1 -1
  16. package/build/openid4vc-holder/OpenId4VcHolderApi.d.ts.map +1 -1
  17. package/build/openid4vc-holder/OpenId4VcHolderApi.mjs.map +1 -1
  18. package/build/openid4vc-holder/OpenId4VciHolderService.d.mts.map +1 -1
  19. package/build/openid4vc-holder/OpenId4VciHolderService.d.ts.map +1 -1
  20. package/build/openid4vc-holder/OpenId4VciHolderService.js +11 -8
  21. package/build/openid4vc-holder/OpenId4VciHolderService.mjs +11 -8
  22. package/build/openid4vc-holder/OpenId4VciHolderService.mjs.map +1 -1
  23. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.mts.map +1 -1
  24. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts.map +1 -1
  25. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.mjs.map +1 -1
  26. package/build/openid4vc-holder/OpenId4vpHolderService.d.mts.map +1 -1
  27. package/build/openid4vc-holder/OpenId4vpHolderService.d.ts.map +1 -1
  28. package/build/openid4vc-holder/OpenId4vpHolderService.js +4 -4
  29. package/build/openid4vc-holder/OpenId4vpHolderService.mjs +4 -4
  30. package/build/openid4vc-holder/OpenId4vpHolderService.mjs.map +1 -1
  31. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts +5 -214
  32. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.mts.map +1 -1
  33. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +5 -214
  34. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts.map +1 -1
  35. package/build/openid4vc-issuer/OpenId4VcIssuerApi.js +1 -1
  36. package/build/openid4vc-issuer/OpenId4VcIssuerApi.mjs +1 -1
  37. package/build/openid4vc-issuer/OpenId4VcIssuerApi.mjs.map +1 -1
  38. package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.mts.map +1 -1
  39. package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts.map +1 -1
  40. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +7 -7
  41. package/build/openid4vc-issuer/OpenId4VcIssuerModule.mjs +7 -7
  42. package/build/openid4vc-issuer/OpenId4VcIssuerModule.mjs.map +1 -1
  43. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.mts.map +1 -1
  44. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts.map +1 -1
  45. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.mjs.map +1 -1
  46. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts +8 -218
  47. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.mts.map +1 -1
  48. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +8 -218
  49. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts.map +1 -1
  50. package/build/openid4vc-issuer/OpenId4VcIssuerService.js +18 -18
  51. package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs +19 -19
  52. package/build/openid4vc-issuer/OpenId4VcIssuerService.mjs.map +1 -1
  53. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.mts +1 -1
  54. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +1 -1
  55. package/build/openid4vc-issuer/index.js +2 -2
  56. package/build/openid4vc-issuer/index.mjs +2 -2
  57. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.mts +1 -1
  58. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.mts.map +1 -1
  59. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +1 -1
  60. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts.map +1 -1
  61. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +1 -1
  62. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.mjs +1 -1
  63. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.mjs.map +1 -1
  64. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.js +1 -1
  65. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.mjs +1 -1
  66. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.mjs.map +1 -1
  67. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.mts.map +1 -1
  68. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts.map +1 -1
  69. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.mjs.map +1 -1
  70. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.js +1 -1
  71. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs +1 -1
  72. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.mjs.map +1 -1
  73. package/build/openid4vc-issuer/repository/index.js +2 -2
  74. package/build/openid4vc-issuer/repository/index.mjs +2 -2
  75. package/build/openid4vc-issuer/router/accessTokenEndpoint.js +3 -4
  76. package/build/openid4vc-issuer/router/accessTokenEndpoint.mjs +3 -4
  77. package/build/openid4vc-issuer/router/accessTokenEndpoint.mjs.map +1 -1
  78. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js +5 -6
  79. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.mjs +6 -7
  80. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.mjs.map +1 -1
  81. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.mjs.map +1 -1
  82. package/build/openid4vc-issuer/router/credentialEndpoint.js +5 -6
  83. package/build/openid4vc-issuer/router/credentialEndpoint.mjs +5 -6
  84. package/build/openid4vc-issuer/router/credentialEndpoint.mjs.map +1 -1
  85. package/build/openid4vc-issuer/router/credentialOfferEndpoint.js +2 -4
  86. package/build/openid4vc-issuer/router/credentialOfferEndpoint.mjs +3 -4
  87. package/build/openid4vc-issuer/router/credentialOfferEndpoint.mjs.map +1 -1
  88. package/build/openid4vc-issuer/router/deferredCredentialEndpoint.js +2 -4
  89. package/build/openid4vc-issuer/router/deferredCredentialEndpoint.mjs +3 -4
  90. package/build/openid4vc-issuer/router/deferredCredentialEndpoint.mjs.map +1 -1
  91. package/build/openid4vc-issuer/router/index.js +4 -4
  92. package/build/openid4vc-issuer/router/index.mjs +4 -4
  93. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.mjs.map +1 -1
  94. package/build/openid4vc-issuer/router/jwksEndpoint.mjs.map +1 -1
  95. package/build/openid4vc-issuer/router/nonceEndpoint.mjs.map +1 -1
  96. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.mts +1 -1
  97. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.mts.map +1 -1
  98. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +1 -1
  99. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts.map +1 -1
  100. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +1 -1
  101. package/build/openid4vc-verifier/OpenId4VcVerifierApi.mjs +1 -1
  102. package/build/openid4vc-verifier/OpenId4VcVerifierApi.mjs.map +1 -1
  103. package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.mts.map +1 -1
  104. package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts.map +1 -1
  105. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +2 -2
  106. package/build/openid4vc-verifier/OpenId4VcVerifierModule.mjs +2 -2
  107. package/build/openid4vc-verifier/OpenId4VcVerifierModule.mjs.map +1 -1
  108. package/build/openid4vc-verifier/OpenId4VpVerifierService.d.mts +3 -3
  109. package/build/openid4vc-verifier/OpenId4VpVerifierService.d.mts.map +1 -1
  110. package/build/openid4vc-verifier/OpenId4VpVerifierService.d.ts +3 -3
  111. package/build/openid4vc-verifier/OpenId4VpVerifierService.d.ts.map +1 -1
  112. package/build/openid4vc-verifier/OpenId4VpVerifierService.js +17 -17
  113. package/build/openid4vc-verifier/OpenId4VpVerifierService.mjs +17 -17
  114. package/build/openid4vc-verifier/OpenId4VpVerifierService.mjs.map +1 -1
  115. package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.mts +1 -1
  116. package/build/openid4vc-verifier/OpenId4VpVerifierServiceOptions.d.ts +1 -1
  117. package/build/openid4vc-verifier/index.js +3 -3
  118. package/build/openid4vc-verifier/index.mjs +3 -3
  119. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.mts +1 -1
  120. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.mts.map +1 -1
  121. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +1 -1
  122. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts.map +1 -1
  123. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.mjs.map +1 -1
  124. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.js +1 -1
  125. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.mjs +1 -1
  126. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.mjs.map +1 -1
  127. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.mts.map +1 -1
  128. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts.map +1 -1
  129. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.mjs.map +1 -1
  130. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.js +1 -1
  131. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.mjs +1 -1
  132. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.mjs.map +1 -1
  133. package/build/openid4vc-verifier/repository/index.js +2 -2
  134. package/build/openid4vc-verifier/repository/index.mjs +2 -2
  135. package/build/openid4vc-verifier/router/authorizationEndpoint.js +1 -1
  136. package/build/openid4vc-verifier/router/authorizationEndpoint.mjs +1 -1
  137. package/build/openid4vc-verifier/router/authorizationEndpoint.mjs.map +1 -1
  138. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +1 -1
  139. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.mjs +1 -1
  140. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.mjs.map +1 -1
  141. package/build/shared/callbacks.d.mts +46 -0
  142. package/build/shared/callbacks.d.mts.map +1 -0
  143. package/build/shared/callbacks.d.ts +46 -0
  144. package/build/shared/callbacks.d.ts.map +1 -0
  145. package/build/shared/callbacks.js +5 -1
  146. package/build/shared/callbacks.mjs +1 -1
  147. package/build/shared/callbacks.mjs.map +1 -1
  148. package/build/shared/index.js +2 -1
  149. package/build/shared/index.mjs +2 -1
  150. package/build/shared/issuerMetadataUtils.d.mts +2 -258
  151. package/build/shared/issuerMetadataUtils.d.mts.map +1 -1
  152. package/build/shared/issuerMetadataUtils.d.ts +2 -258
  153. package/build/shared/issuerMetadataUtils.d.ts.map +1 -1
  154. package/build/shared/issuerMetadataUtils.mjs.map +1 -1
  155. package/build/shared/models/index.d.ts +1 -1
  156. package/build/shared/router/context.mjs.map +1 -1
  157. package/build/shared/router/index.js +1 -1
  158. package/build/shared/router/index.mjs +1 -1
  159. package/build/shared/router/tenants.mjs.map +1 -1
  160. package/build/shared/utils.js +0 -8
  161. package/build/shared/utils.mjs +1 -7
  162. package/build/shared/utils.mjs.map +1 -1
  163. package/package.json +8 -8
@@ -1,11 +1,11 @@
1
+ import { OpenId4VciCredentialOfferPayload } from "../shared/models/index.js";
1
2
  import { OpenId4VcUpdateIssuerRecordOptions, OpenId4VciCreateCredentialOfferOptions, OpenId4VciCreateCredentialResponseOptions, OpenId4VciCreateDeferredCredentialResponseOptions, OpenId4VciCreateIssuerOptions, OpenId4VciCreateStatelessCredentialOfferOptions } from "./OpenId4VcIssuerServiceOptions.js";
2
- import { OpenId4VcIssuerRecord } from "./repository/OpenId4VcIssuerRecord.js";
3
3
  import { OpenId4VcIssuanceSessionRecord } from "./repository/OpenId4VcIssuanceSessionRecord.js";
4
+ import { OpenId4VcIssuerRecord } from "./repository/OpenId4VcIssuerRecord.js";
4
5
  import { OpenId4VcIssuerModuleConfig } from "./OpenId4VcIssuerModuleConfig.js";
5
6
  import { OpenId4VcIssuerService } from "./OpenId4VcIssuerService.js";
6
7
  import { AgentContext } from "@credo-ts/core";
7
8
  import * as _openid4vc_openid4vci0 from "@openid4vc/openid4vci";
8
- import * as zod524 from "zod";
9
9
 
10
10
  //#region src/openid4vc-issuer/OpenId4VcIssuerApi.d.ts
11
11
  /**
@@ -39,191 +39,7 @@ declare class OpenId4VcIssuerApi {
39
39
  issuerId: string;
40
40
  }): Promise<{
41
41
  credentialOffer: string;
42
- credentialOfferObject: zod524.objectInputType<{
43
- credential_issuer: zod524.ZodEffects<zod524.ZodString, string, string>;
44
- credential_configuration_ids: zod524.ZodArray<zod524.ZodString, "many">;
45
- grants: zod524.ZodOptional<zod524.ZodObject<{
46
- authorization_code: zod524.ZodOptional<zod524.ZodObject<{
47
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
48
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
49
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
50
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
51
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
52
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
53
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
54
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
55
- }, zod524.ZodTypeAny, "passthrough">>>;
56
- "urn:ietf:params:oauth:grant-type:pre-authorized_code": zod524.ZodOptional<zod524.ZodObject<{
57
- "pre-authorized_code": zod524.ZodString;
58
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
59
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
60
- length: zod524.ZodOptional<zod524.ZodNumber>;
61
- description: zod524.ZodOptional<zod524.ZodString>;
62
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
63
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
64
- length: zod524.ZodOptional<zod524.ZodNumber>;
65
- description: zod524.ZodOptional<zod524.ZodString>;
66
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
67
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
68
- length: zod524.ZodOptional<zod524.ZodNumber>;
69
- description: zod524.ZodOptional<zod524.ZodString>;
70
- }, zod524.ZodTypeAny, "passthrough">>>;
71
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
72
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
73
- "pre-authorized_code": zod524.ZodString;
74
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
75
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
76
- length: zod524.ZodOptional<zod524.ZodNumber>;
77
- description: zod524.ZodOptional<zod524.ZodString>;
78
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
79
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
80
- length: zod524.ZodOptional<zod524.ZodNumber>;
81
- description: zod524.ZodOptional<zod524.ZodString>;
82
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
83
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
84
- length: zod524.ZodOptional<zod524.ZodNumber>;
85
- description: zod524.ZodOptional<zod524.ZodString>;
86
- }, zod524.ZodTypeAny, "passthrough">>>;
87
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
88
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
89
- "pre-authorized_code": zod524.ZodString;
90
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
91
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
92
- length: zod524.ZodOptional<zod524.ZodNumber>;
93
- description: zod524.ZodOptional<zod524.ZodString>;
94
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
95
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
96
- length: zod524.ZodOptional<zod524.ZodNumber>;
97
- description: zod524.ZodOptional<zod524.ZodString>;
98
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
99
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
100
- length: zod524.ZodOptional<zod524.ZodNumber>;
101
- description: zod524.ZodOptional<zod524.ZodString>;
102
- }, zod524.ZodTypeAny, "passthrough">>>;
103
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
104
- }, zod524.ZodTypeAny, "passthrough">>>;
105
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
106
- authorization_code: zod524.ZodOptional<zod524.ZodObject<{
107
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
108
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
109
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
110
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
111
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
112
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
113
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
114
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
115
- }, zod524.ZodTypeAny, "passthrough">>>;
116
- "urn:ietf:params:oauth:grant-type:pre-authorized_code": zod524.ZodOptional<zod524.ZodObject<{
117
- "pre-authorized_code": zod524.ZodString;
118
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
119
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
120
- length: zod524.ZodOptional<zod524.ZodNumber>;
121
- description: zod524.ZodOptional<zod524.ZodString>;
122
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
123
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
124
- length: zod524.ZodOptional<zod524.ZodNumber>;
125
- description: zod524.ZodOptional<zod524.ZodString>;
126
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
127
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
128
- length: zod524.ZodOptional<zod524.ZodNumber>;
129
- description: zod524.ZodOptional<zod524.ZodString>;
130
- }, zod524.ZodTypeAny, "passthrough">>>;
131
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
132
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
133
- "pre-authorized_code": zod524.ZodString;
134
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
135
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
136
- length: zod524.ZodOptional<zod524.ZodNumber>;
137
- description: zod524.ZodOptional<zod524.ZodString>;
138
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
139
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
140
- length: zod524.ZodOptional<zod524.ZodNumber>;
141
- description: zod524.ZodOptional<zod524.ZodString>;
142
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
143
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
144
- length: zod524.ZodOptional<zod524.ZodNumber>;
145
- description: zod524.ZodOptional<zod524.ZodString>;
146
- }, zod524.ZodTypeAny, "passthrough">>>;
147
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
148
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
149
- "pre-authorized_code": zod524.ZodString;
150
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
151
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
152
- length: zod524.ZodOptional<zod524.ZodNumber>;
153
- description: zod524.ZodOptional<zod524.ZodString>;
154
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
155
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
156
- length: zod524.ZodOptional<zod524.ZodNumber>;
157
- description: zod524.ZodOptional<zod524.ZodString>;
158
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
159
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
160
- length: zod524.ZodOptional<zod524.ZodNumber>;
161
- description: zod524.ZodOptional<zod524.ZodString>;
162
- }, zod524.ZodTypeAny, "passthrough">>>;
163
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
164
- }, zod524.ZodTypeAny, "passthrough">>>;
165
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
166
- authorization_code: zod524.ZodOptional<zod524.ZodObject<{
167
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
168
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
169
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
170
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
171
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
172
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
173
- issuer_state: zod524.ZodOptional<zod524.ZodString>;
174
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
175
- }, zod524.ZodTypeAny, "passthrough">>>;
176
- "urn:ietf:params:oauth:grant-type:pre-authorized_code": zod524.ZodOptional<zod524.ZodObject<{
177
- "pre-authorized_code": zod524.ZodString;
178
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
179
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
180
- length: zod524.ZodOptional<zod524.ZodNumber>;
181
- description: zod524.ZodOptional<zod524.ZodString>;
182
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
183
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
184
- length: zod524.ZodOptional<zod524.ZodNumber>;
185
- description: zod524.ZodOptional<zod524.ZodString>;
186
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
187
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
188
- length: zod524.ZodOptional<zod524.ZodNumber>;
189
- description: zod524.ZodOptional<zod524.ZodString>;
190
- }, zod524.ZodTypeAny, "passthrough">>>;
191
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
192
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
193
- "pre-authorized_code": zod524.ZodString;
194
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
195
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
196
- length: zod524.ZodOptional<zod524.ZodNumber>;
197
- description: zod524.ZodOptional<zod524.ZodString>;
198
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
199
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
200
- length: zod524.ZodOptional<zod524.ZodNumber>;
201
- description: zod524.ZodOptional<zod524.ZodString>;
202
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
203
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
204
- length: zod524.ZodOptional<zod524.ZodNumber>;
205
- description: zod524.ZodOptional<zod524.ZodString>;
206
- }, zod524.ZodTypeAny, "passthrough">>>;
207
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
208
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
209
- "pre-authorized_code": zod524.ZodString;
210
- tx_code: zod524.ZodOptional<zod524.ZodObject<{
211
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
212
- length: zod524.ZodOptional<zod524.ZodNumber>;
213
- description: zod524.ZodOptional<zod524.ZodString>;
214
- }, "passthrough", zod524.ZodTypeAny, zod524.objectOutputType<{
215
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
216
- length: zod524.ZodOptional<zod524.ZodNumber>;
217
- description: zod524.ZodOptional<zod524.ZodString>;
218
- }, zod524.ZodTypeAny, "passthrough">, zod524.objectInputType<{
219
- input_mode: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodLiteral<"numeric">, zod524.ZodLiteral<"text">]>>;
220
- length: zod524.ZodOptional<zod524.ZodNumber>;
221
- description: zod524.ZodOptional<zod524.ZodString>;
222
- }, zod524.ZodTypeAny, "passthrough">>>;
223
- authorization_server: zod524.ZodOptional<zod524.ZodEffects<zod524.ZodString, string, string>>;
224
- }, zod524.ZodTypeAny, "passthrough">>>;
225
- }, zod524.ZodTypeAny, "passthrough">>>;
226
- }, zod524.ZodTypeAny, "passthrough">;
42
+ credentialOfferObject: OpenId4VciCredentialOfferPayload;
227
43
  }>;
228
44
  /**
229
45
  * Creates a credential offer. Either the preAuthorizedCodeFlowConfig or the authorizationCodeFlowConfig must be provided.
@@ -242,23 +58,8 @@ declare class OpenId4VcIssuerApi {
242
58
  createCredentialResponse(options: OpenId4VciCreateCredentialResponseOptions & {
243
59
  issuanceSessionId: string;
244
60
  }): Promise<{
245
- credentialResponse: zod524.objectOutputType<{
246
- credentials: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodArray<zod524.ZodObject<{
247
- credential: zod524.ZodUnion<[zod524.ZodString, zod524.ZodRecord<zod524.ZodString, zod524.ZodAny>]>;
248
- }, "strip", zod524.ZodTypeAny, {
249
- credential: string | Record<string, any>;
250
- }, {
251
- credential: string | Record<string, any>;
252
- }>, "many">, zod524.ZodArray<zod524.ZodUnion<[zod524.ZodString, zod524.ZodRecord<zod524.ZodString, zod524.ZodAny>]>, "many">]>>;
253
- interval: zod524.ZodOptional<zod524.ZodNumber>;
254
- notification_id: zod524.ZodOptional<zod524.ZodString>;
255
- } & {
256
- credential: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodString, zod524.ZodRecord<zod524.ZodString, zod524.ZodAny>]>>;
257
- transaction_id: zod524.ZodOptional<zod524.ZodString>;
258
- c_nonce: zod524.ZodOptional<zod524.ZodString>;
259
- c_nonce_expires_in: zod524.ZodOptional<zod524.ZodNumber>;
260
- }, zod524.ZodTypeAny, "passthrough">;
261
61
  issuanceSession: OpenId4VcIssuanceSessionRecord;
62
+ credentialResponse: _openid4vc_openid4vci0.CredentialResponse;
262
63
  }>;
263
64
  /**
264
65
  * This function creates a response which can be sent to the holder after receiving a deferred credential issuance request.
@@ -266,18 +67,8 @@ declare class OpenId4VcIssuerApi {
266
67
  createDeferredCredentialResponse(options: OpenId4VciCreateDeferredCredentialResponseOptions & {
267
68
  issuanceSessionId: string;
268
69
  }): Promise<{
269
- deferredCredentialResponse: zod524.objectOutputType<{
270
- credentials: zod524.ZodOptional<zod524.ZodUnion<[zod524.ZodArray<zod524.ZodObject<{
271
- credential: zod524.ZodUnion<[zod524.ZodString, zod524.ZodRecord<zod524.ZodString, zod524.ZodAny>]>;
272
- }, "strip", zod524.ZodTypeAny, {
273
- credential: string | Record<string, any>;
274
- }, {
275
- credential: string | Record<string, any>;
276
- }>, "many">, zod524.ZodArray<zod524.ZodUnion<[zod524.ZodString, zod524.ZodRecord<zod524.ZodString, zod524.ZodAny>]>, "many">]>>;
277
- interval: zod524.ZodOptional<zod524.ZodNumber>;
278
- notification_id: zod524.ZodOptional<zod524.ZodString>;
279
- }, zod524.ZodTypeAny, "passthrough">;
280
70
  issuanceSession: OpenId4VcIssuanceSessionRecord;
71
+ deferredCredentialResponse: _openid4vc_openid4vci0.DeferredCredentialResponse;
281
72
  }>;
282
73
  getIssuerMetadata(issuerId: string): Promise<_openid4vc_openid4vci0.IssuerMetadataResult>;
283
74
  getIssuanceSessionById(issuanceSessionId: string): Promise<OpenId4VcIssuanceSessionRecord>;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcIssuerApi.d.ts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerApi.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;AAqBa,cAAA,kBAAA,CAAkB;EAAA,SAAA,MAAA,EAEH,2BAFG;UAEH,YAAA;UAAA,sBAAA;aACF,CAAA,MAAA,EADE,2BACF,EAAA,YAAA,EAAA,YAAA,EAAA,sBAAA,EACU,sBADV;eACU,CAAA,CAAA,EAGR,OAHQ,CAAsB,qBAAA,EAAtB,CAAA;qBAAsB,CAAA,QAAA,EAAA,MAAA,CAAA,EAOP,OAPO,CAG9B,qBAAA,CAH8B;;;;;cAeQ,CAAA,OAAA,EAA7B,6BAA6B,CAAA,EAAA,OAAA,CAAA,qBAAA,CAAA;;;;6BAYa,CAAA,QAAA,EAAA,MAAA,CAAA,EALpB,OAKoB,CAAA,IAAA,CAAA;sBAwBlE,CAAA,OAAA,EAxBgC,kCAwBhC,CAAA,EAxBkE,OAwBlE,CAAA,IAAA,CAAA;;;;;0CAAA;;MAAsE;;;2CAAvB,MAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAYd;;MAA6D;qBAAvB;;;;;;oCAUvE;;MAAyE;;;qCAAhC,MAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;4CAezC;;MAAiF;;;qCAAhC,MAAA,CAAA,SAAA;;;;;;;;;;;uCAcb,QAd6C,sBAAA,CAc7C,oBAAA;qDAKc,QALd,8BAAA"}
1
+ {"version":3,"file":"OpenId4VcIssuerApi.d.ts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerApi.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;AAmBa,cAAA,kBAAA,CAAkB;EAAA,SAAA,MAAA,EAEH,2BAFG;UAEH,YAAA;UAAA,sBAAA;aACF,CAAA,MAAA,EADE,2BACF,EAAA,YAAA,EAAA,YAAA,EAAA,sBAAA,EACU,sBADV;eACU,CAAA,CAAA,EAGR,OAHQ,CAAsB,qBAAA,EAAtB,CAAA;qBAAsB,CAAA,QAAA,EAAA,MAAA,CAAA,EAOP,OAPO,CAG9B,qBAAA,CAH8B;;;;;cAeQ,CAAA,OAAA,EAA7B,6BAA6B,CAAA,EAAA,OAAA,CAAA,qBAAA,CAAA;;;;6BAYa,CAAA,QAAA,EAAA,MAAA,CAAA,EALpB,OAKoB,CAAA,IAAA,CAAA;sBAwBlE,CAAA,OAAA,EAxBgC,kCAwBhC,CAAA,EAxBkE,OAwBlE,CAAA,IAAA,CAAA;;;;;gCAY8F,CAAA,OAAA,EAZ9F,+CAY8F,GAAA;IAU9F,QAAA,EAAA,MAAA;MAtBsE,OAsB7B,CAAA;;IAAgC,qBAAA,EAtB1B,gCAsB0B;;;;;;;uBA6BrC,CAAA,OAAA,EAvCH,sCAuCG,GAAA;IAKc,QAAA,EAAA,MAAA;EAAA,CAAA,CAAA,EA5C4C,OA4C5C,CAAA;qBA5CqB;;;;;;oCAUvE;;MAAyE;qBAAhC;;;;;;4CAezC;;MAAiF;qBAAhC;;;uCAcb,QAd6C,sBAAA,CAc7C,oBAAA;qDAKc,QALd,8BAAA"}
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
+ const require_OpenId4VcIssuerModuleConfig = require('./OpenId4VcIssuerModuleConfig.js');
2
3
  const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
3
4
  const require_decorate = require('../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
4
- const require_OpenId4VcIssuerModuleConfig = require('./OpenId4VcIssuerModuleConfig.js');
5
5
  const require_OpenId4VcIssuerService = require('./OpenId4VcIssuerService.js');
6
6
  let __credo_ts_core = require("@credo-ts/core");
7
7
  __credo_ts_core = require_rolldown_runtime.__toESM(__credo_ts_core);
@@ -1,6 +1,6 @@
1
+ import { OpenId4VcIssuerModuleConfig } from "./OpenId4VcIssuerModuleConfig.mjs";
1
2
  import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
2
3
  import { __decorate } from "../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.mjs";
3
- import { OpenId4VcIssuerModuleConfig } from "./OpenId4VcIssuerModuleConfig.mjs";
4
4
  import { OpenId4VcIssuerService } from "./OpenId4VcIssuerService.mjs";
5
5
  import { AgentContext, injectable } from "@credo-ts/core";
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcIssuerApi.mjs","names":["OpenId4VcIssuerApi","config: OpenId4VcIssuerModuleConfig","agentContext: AgentContext","openId4VcIssuerService: OpenId4VcIssuerService"],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerApi.ts"],"sourcesContent":["import type {\n OpenId4VcUpdateIssuerRecordOptions,\n OpenId4VciCreateCredentialOfferOptions,\n OpenId4VciCreateCredentialResponseOptions,\n OpenId4VciCreateDeferredCredentialResponseOptions,\n OpenId4VciCreateIssuerOptions,\n OpenId4VciCreateStatelessCredentialOfferOptions,\n} from './OpenId4VcIssuerServiceOptions'\n\nimport { AgentContext, injectable } from '@credo-ts/core'\n\nimport { OpenId4VcIssuerModuleConfig } from './OpenId4VcIssuerModuleConfig'\nimport { OpenId4VcIssuerService } from './OpenId4VcIssuerService'\n\n/**\n * @public\n * This class represents the API for interacting with the OpenID4VC Issuer service.\n * It provides methods for creating a credential offer, creating a response to a credential issuance request,\n * and retrieving a credential offer from a URI.\n */\n@injectable()\nexport class OpenId4VcIssuerApi {\n public constructor(\n public readonly config: OpenId4VcIssuerModuleConfig,\n private agentContext: AgentContext,\n private openId4VcIssuerService: OpenId4VcIssuerService\n ) {}\n\n public async getAllIssuers() {\n return this.openId4VcIssuerService.getAllIssuers(this.agentContext)\n }\n\n public async getIssuerByIssuerId(issuerId: string) {\n return this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n }\n\n /**\n * Creates an issuer and stores the corresponding issuer metadata. Multiple issuers can be created, to allow different sets of\n * credentials to be issued with each issuer.\n */\n public async createIssuer(options: OpenId4VciCreateIssuerOptions) {\n return this.openId4VcIssuerService.createIssuer(this.agentContext, options)\n }\n\n /**\n * Rotate the key used for signing access tokens for the issuer with the given issuerId.\n */\n public async rotateAccessTokenSigningKey(issuerId: string) {\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n return this.openId4VcIssuerService.rotateAccessTokenSigningKey(this.agentContext, issuer)\n }\n\n public async updateIssuerMetadata(options: OpenId4VcUpdateIssuerRecordOptions) {\n const {\n issuerId,\n credentialConfigurationsSupported,\n display,\n dpopSigningAlgValuesSupported,\n batchCredentialIssuance,\n } = options\n\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n\n issuer.credentialConfigurationsSupported = credentialConfigurationsSupported\n issuer.display = display\n issuer.dpopSigningAlgValuesSupported = dpopSigningAlgValuesSupported\n issuer.batchCredentialIssuance = batchCredentialIssuance\n\n return this.openId4VcIssuerService.updateIssuer(this.agentContext, issuer)\n }\n\n /**\n * Creates a stateless credential offer. This can only be used with an external authorization server, as credo only supports stateful\n * credential offers.\n */\n public async createStatelessCredentialOffer(\n options: OpenId4VciCreateStatelessCredentialOfferOptions & { issuerId: string }\n ) {\n const { issuerId, ...rest } = options\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n return await this.openId4VcIssuerService.createStatelessCredentialOffer(this.agentContext, { ...rest, issuer })\n }\n\n /**\n * Creates a credential offer. Either the preAuthorizedCodeFlowConfig or the authorizationCodeFlowConfig must be provided.\n *\n * @returns Object containing the payload of the credential offer and the credential offer request, which can be sent to the wallet.\n */\n public async createCredentialOffer(options: OpenId4VciCreateCredentialOfferOptions & { issuerId: string }) {\n const { issuerId, ...rest } = options\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n return await this.openId4VcIssuerService.createCredentialOffer(this.agentContext, { ...rest, issuer })\n }\n\n /**\n * This function creates a response which can be sent to the holder after receiving a credential issuance request.\n */\n public async createCredentialResponse(\n options: OpenId4VciCreateCredentialResponseOptions & { issuanceSessionId: string }\n ) {\n const { issuanceSessionId, ...rest } = options\n const issuanceSession = await this.openId4VcIssuerService.getIssuanceSessionById(\n this.agentContext,\n issuanceSessionId\n )\n\n return await this.openId4VcIssuerService.createCredentialResponse(this.agentContext, { ...rest, issuanceSession })\n }\n\n /**\n * This function creates a response which can be sent to the holder after receiving a deferred credential issuance request.\n */\n public async createDeferredCredentialResponse(\n options: OpenId4VciCreateDeferredCredentialResponseOptions & { issuanceSessionId: string }\n ) {\n const { issuanceSessionId, ...rest } = options\n const issuanceSession = await this.openId4VcIssuerService.getIssuanceSessionById(\n this.agentContext,\n issuanceSessionId\n )\n\n return await this.openId4VcIssuerService.createDeferredCredentialResponse(this.agentContext, {\n ...rest,\n issuanceSession,\n })\n }\n\n public async getIssuerMetadata(issuerId: string) {\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n return this.openId4VcIssuerService.getIssuerMetadata(this.agentContext, issuer)\n }\n\n public async getIssuanceSessionById(issuanceSessionId: string) {\n return this.openId4VcIssuerService.getIssuanceSessionById(this.agentContext, issuanceSessionId)\n }\n}\n"],"mappings":";;;;;;;;AAqBO,+BAAMA,qBAAmB;CAC9B,AAAO,YACL,AAAgBC,QAChB,AAAQC,cACR,AAAQC,wBACR;EAHgB;EACR;EACA;;CAGV,MAAa,gBAAgB;AAC3B,SAAO,KAAK,uBAAuB,cAAc,KAAK,aAAa;;CAGrE,MAAa,oBAAoB,UAAkB;AACjD,SAAO,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;;;;;;CAOrF,MAAa,aAAa,SAAwC;AAChE,SAAO,KAAK,uBAAuB,aAAa,KAAK,cAAc,QAAQ;;;;;CAM7E,MAAa,4BAA4B,UAAkB;EACzD,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AACjG,SAAO,KAAK,uBAAuB,4BAA4B,KAAK,cAAc,OAAO;;CAG3F,MAAa,qBAAqB,SAA6C;EAC7E,MAAM,EACJ,UACA,mCACA,SACA,+BACA,4BACE;EAEJ,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AAEjG,SAAO,oCAAoC;AAC3C,SAAO,UAAU;AACjB,SAAO,gCAAgC;AACvC,SAAO,0BAA0B;AAEjC,SAAO,KAAK,uBAAuB,aAAa,KAAK,cAAc,OAAO;;;;;;CAO5E,MAAa,+BACX,SACA;EACA,MAAM,EAAE,SAAU,GAAG,SAAS;EAC9B,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AACjG,SAAO,MAAM,KAAK,uBAAuB,+BAA+B,KAAK,cAAc;GAAE,GAAG;GAAM;GAAQ,CAAC;;;;;;;CAQjH,MAAa,sBAAsB,SAAwE;EACzG,MAAM,EAAE,SAAU,GAAG,SAAS;EAC9B,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AACjG,SAAO,MAAM,KAAK,uBAAuB,sBAAsB,KAAK,cAAc;GAAE,GAAG;GAAM;GAAQ,CAAC;;;;;CAMxG,MAAa,yBACX,SACA;EACA,MAAM,EAAE,kBAAmB,GAAG,SAAS;EACvC,MAAM,kBAAkB,MAAM,KAAK,uBAAuB,uBACxD,KAAK,cACL,kBACD;AAED,SAAO,MAAM,KAAK,uBAAuB,yBAAyB,KAAK,cAAc;GAAE,GAAG;GAAM;GAAiB,CAAC;;;;;CAMpH,MAAa,iCACX,SACA;EACA,MAAM,EAAE,kBAAmB,GAAG,SAAS;EACvC,MAAM,kBAAkB,MAAM,KAAK,uBAAuB,uBACxD,KAAK,cACL,kBACD;AAED,SAAO,MAAM,KAAK,uBAAuB,iCAAiC,KAAK,cAAc;GAC3F,GAAG;GACH;GACD,CAAC;;CAGJ,MAAa,kBAAkB,UAAkB;EAC/C,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AACjG,SAAO,KAAK,uBAAuB,kBAAkB,KAAK,cAAc,OAAO;;CAGjF,MAAa,uBAAuB,mBAA2B;AAC7D,SAAO,KAAK,uBAAuB,uBAAuB,KAAK,cAAc,kBAAkB;;;iCAjHlG,YAAY"}
1
+ {"version":3,"file":"OpenId4VcIssuerApi.mjs","names":["OpenId4VcIssuerApi","config: OpenId4VcIssuerModuleConfig","agentContext: AgentContext","openId4VcIssuerService: OpenId4VcIssuerService"],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerApi.ts"],"sourcesContent":["import { AgentContext, injectable } from '@credo-ts/core'\nimport { OpenId4VcIssuerModuleConfig } from './OpenId4VcIssuerModuleConfig'\nimport { OpenId4VcIssuerService } from './OpenId4VcIssuerService'\nimport type {\n OpenId4VciCreateCredentialOfferOptions,\n OpenId4VciCreateCredentialResponseOptions,\n OpenId4VciCreateDeferredCredentialResponseOptions,\n OpenId4VciCreateIssuerOptions,\n OpenId4VciCreateStatelessCredentialOfferOptions,\n OpenId4VcUpdateIssuerRecordOptions,\n} from './OpenId4VcIssuerServiceOptions'\n\n/**\n * @public\n * This class represents the API for interacting with the OpenID4VC Issuer service.\n * It provides methods for creating a credential offer, creating a response to a credential issuance request,\n * and retrieving a credential offer from a URI.\n */\n@injectable()\nexport class OpenId4VcIssuerApi {\n public constructor(\n public readonly config: OpenId4VcIssuerModuleConfig,\n private agentContext: AgentContext,\n private openId4VcIssuerService: OpenId4VcIssuerService\n ) {}\n\n public async getAllIssuers() {\n return this.openId4VcIssuerService.getAllIssuers(this.agentContext)\n }\n\n public async getIssuerByIssuerId(issuerId: string) {\n return this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n }\n\n /**\n * Creates an issuer and stores the corresponding issuer metadata. Multiple issuers can be created, to allow different sets of\n * credentials to be issued with each issuer.\n */\n public async createIssuer(options: OpenId4VciCreateIssuerOptions) {\n return this.openId4VcIssuerService.createIssuer(this.agentContext, options)\n }\n\n /**\n * Rotate the key used for signing access tokens for the issuer with the given issuerId.\n */\n public async rotateAccessTokenSigningKey(issuerId: string) {\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n return this.openId4VcIssuerService.rotateAccessTokenSigningKey(this.agentContext, issuer)\n }\n\n public async updateIssuerMetadata(options: OpenId4VcUpdateIssuerRecordOptions) {\n const {\n issuerId,\n credentialConfigurationsSupported,\n display,\n dpopSigningAlgValuesSupported,\n batchCredentialIssuance,\n } = options\n\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n\n issuer.credentialConfigurationsSupported = credentialConfigurationsSupported\n issuer.display = display\n issuer.dpopSigningAlgValuesSupported = dpopSigningAlgValuesSupported\n issuer.batchCredentialIssuance = batchCredentialIssuance\n\n return this.openId4VcIssuerService.updateIssuer(this.agentContext, issuer)\n }\n\n /**\n * Creates a stateless credential offer. This can only be used with an external authorization server, as credo only supports stateful\n * credential offers.\n */\n public async createStatelessCredentialOffer(\n options: OpenId4VciCreateStatelessCredentialOfferOptions & { issuerId: string }\n ) {\n const { issuerId, ...rest } = options\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n return await this.openId4VcIssuerService.createStatelessCredentialOffer(this.agentContext, { ...rest, issuer })\n }\n\n /**\n * Creates a credential offer. Either the preAuthorizedCodeFlowConfig or the authorizationCodeFlowConfig must be provided.\n *\n * @returns Object containing the payload of the credential offer and the credential offer request, which can be sent to the wallet.\n */\n public async createCredentialOffer(options: OpenId4VciCreateCredentialOfferOptions & { issuerId: string }) {\n const { issuerId, ...rest } = options\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n return await this.openId4VcIssuerService.createCredentialOffer(this.agentContext, { ...rest, issuer })\n }\n\n /**\n * This function creates a response which can be sent to the holder after receiving a credential issuance request.\n */\n public async createCredentialResponse(\n options: OpenId4VciCreateCredentialResponseOptions & { issuanceSessionId: string }\n ) {\n const { issuanceSessionId, ...rest } = options\n const issuanceSession = await this.openId4VcIssuerService.getIssuanceSessionById(\n this.agentContext,\n issuanceSessionId\n )\n\n return await this.openId4VcIssuerService.createCredentialResponse(this.agentContext, { ...rest, issuanceSession })\n }\n\n /**\n * This function creates a response which can be sent to the holder after receiving a deferred credential issuance request.\n */\n public async createDeferredCredentialResponse(\n options: OpenId4VciCreateDeferredCredentialResponseOptions & { issuanceSessionId: string }\n ) {\n const { issuanceSessionId, ...rest } = options\n const issuanceSession = await this.openId4VcIssuerService.getIssuanceSessionById(\n this.agentContext,\n issuanceSessionId\n )\n\n return await this.openId4VcIssuerService.createDeferredCredentialResponse(this.agentContext, {\n ...rest,\n issuanceSession,\n })\n }\n\n public async getIssuerMetadata(issuerId: string) {\n const issuer = await this.openId4VcIssuerService.getIssuerByIssuerId(this.agentContext, issuerId)\n return this.openId4VcIssuerService.getIssuerMetadata(this.agentContext, issuer)\n }\n\n public async getIssuanceSessionById(issuanceSessionId: string) {\n return this.openId4VcIssuerService.getIssuanceSessionById(this.agentContext, issuanceSessionId)\n }\n}\n"],"mappings":";;;;;;;;AAmBO,+BAAMA,qBAAmB;CAC9B,AAAO,YACL,AAAgBC,QAChB,AAAQC,cACR,AAAQC,wBACR;EAHgB;EACR;EACA;;CAGV,MAAa,gBAAgB;AAC3B,SAAO,KAAK,uBAAuB,cAAc,KAAK,aAAa;;CAGrE,MAAa,oBAAoB,UAAkB;AACjD,SAAO,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;;;;;;CAOrF,MAAa,aAAa,SAAwC;AAChE,SAAO,KAAK,uBAAuB,aAAa,KAAK,cAAc,QAAQ;;;;;CAM7E,MAAa,4BAA4B,UAAkB;EACzD,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AACjG,SAAO,KAAK,uBAAuB,4BAA4B,KAAK,cAAc,OAAO;;CAG3F,MAAa,qBAAqB,SAA6C;EAC7E,MAAM,EACJ,UACA,mCACA,SACA,+BACA,4BACE;EAEJ,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AAEjG,SAAO,oCAAoC;AAC3C,SAAO,UAAU;AACjB,SAAO,gCAAgC;AACvC,SAAO,0BAA0B;AAEjC,SAAO,KAAK,uBAAuB,aAAa,KAAK,cAAc,OAAO;;;;;;CAO5E,MAAa,+BACX,SACA;EACA,MAAM,EAAE,SAAU,GAAG,SAAS;EAC9B,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AACjG,SAAO,MAAM,KAAK,uBAAuB,+BAA+B,KAAK,cAAc;GAAE,GAAG;GAAM;GAAQ,CAAC;;;;;;;CAQjH,MAAa,sBAAsB,SAAwE;EACzG,MAAM,EAAE,SAAU,GAAG,SAAS;EAC9B,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AACjG,SAAO,MAAM,KAAK,uBAAuB,sBAAsB,KAAK,cAAc;GAAE,GAAG;GAAM;GAAQ,CAAC;;;;;CAMxG,MAAa,yBACX,SACA;EACA,MAAM,EAAE,kBAAmB,GAAG,SAAS;EACvC,MAAM,kBAAkB,MAAM,KAAK,uBAAuB,uBACxD,KAAK,cACL,kBACD;AAED,SAAO,MAAM,KAAK,uBAAuB,yBAAyB,KAAK,cAAc;GAAE,GAAG;GAAM;GAAiB,CAAC;;;;;CAMpH,MAAa,iCACX,SACA;EACA,MAAM,EAAE,kBAAmB,GAAG,SAAS;EACvC,MAAM,kBAAkB,MAAM,KAAK,uBAAuB,uBACxD,KAAK,cACL,kBACD;AAED,SAAO,MAAM,KAAK,uBAAuB,iCAAiC,KAAK,cAAc;GAC3F,GAAG;GACH;GACD,CAAC;;CAGJ,MAAa,kBAAkB,UAAkB;EAC/C,MAAM,SAAS,MAAM,KAAK,uBAAuB,oBAAoB,KAAK,cAAc,SAAS;AACjG,SAAO,KAAK,uBAAuB,kBAAkB,KAAK,cAAc,OAAO;;CAGjF,MAAa,uBAAuB,mBAA2B;AAC7D,SAAO,KAAK,uBAAuB,uBAAuB,KAAK,cAAc,kBAAkB;;;iCAjHlG,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcIssuerModule.d.mts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModule.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;AAC0B,cADb,qBAAA,CACa;WAEI,MAAA,EAFJ,2BAEI;aAOO,CAAA,OAAA,EAPP,kCAOO;;;;8BAAA;+BAgBO,eAAe"}
1
+ {"version":3,"file":"OpenId4VcIssuerModule.d.mts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModule.ts"],"sourcesContent":[],"mappings":";;;;;;AAyBA;;AAC0B,cADb,qBAAA,CACa;WAEI,MAAA,EAFJ,2BAEI;aAOO,CAAA,OAAA,EAPP,kCAOO;;;;8BAAA;+BAgBO,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcIssuerModule.d.ts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModule.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;AAC0B,cADb,qBAAA,CACa;WAEI,MAAA,EAFJ,2BAEI;aAOO,CAAA,OAAA,EAPP,kCAOO;;;;8BAAA;+BAgBO,eAAe"}
1
+ {"version":3,"file":"OpenId4VcIssuerModule.d.ts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModule.ts"],"sourcesContent":[],"mappings":";;;;;;AAyBA;;AAC0B,cADb,qBAAA,CACa;WAEI,MAAA,EAFJ,2BAEI;aAOO,CAAA,OAAA,EAPP,kCAOO;;;;8BAAA;+BAgBO,eAAe"}
@@ -1,22 +1,22 @@
1
- const require_express = require('../shared/router/express.js');
2
1
  const require_context = require('../shared/router/context.js');
2
+ const require_express = require('../shared/router/express.js');
3
3
  const require_tenants = require('../shared/router/tenants.js');
4
4
  require('../shared/router/index.js');
5
5
  const require_OpenId4VcIssuerModuleConfig = require('./OpenId4VcIssuerModuleConfig.js');
6
- const require_OpenId4VcIssuerRepository = require('./repository/OpenId4VcIssuerRepository.js');
7
6
  const require_OpenId4VcIssuanceSessionRepository = require('./repository/OpenId4VcIssuanceSessionRepository.js');
7
+ const require_OpenId4VcIssuerRepository = require('./repository/OpenId4VcIssuerRepository.js');
8
8
  require('./repository/index.js');
9
9
  const require_OpenId4VcIssuerService = require('./OpenId4VcIssuerService.js');
10
10
  const require_OpenId4VcIssuerApi = require('./OpenId4VcIssuerApi.js');
11
11
  const require_accessTokenEndpoint = require('./router/accessTokenEndpoint.js');
12
- const require_credentialEndpoint = require('./router/credentialEndpoint.js');
13
- const require_issuerMetadataEndpoint = require('./router/issuerMetadataEndpoint.js');
12
+ const require_authorizationChallengeEndpoint = require('./router/authorizationChallengeEndpoint.js');
14
13
  const require_authorizationServerMetadataEndpoint = require('./router/authorizationServerMetadataEndpoint.js');
14
+ const require_credentialEndpoint = require('./router/credentialEndpoint.js');
15
15
  const require_credentialOfferEndpoint = require('./router/credentialOfferEndpoint.js');
16
+ const require_deferredCredentialEndpoint = require('./router/deferredCredentialEndpoint.js');
17
+ const require_issuerMetadataEndpoint = require('./router/issuerMetadataEndpoint.js');
16
18
  const require_jwksEndpoint = require('./router/jwksEndpoint.js');
17
19
  const require_nonceEndpoint = require('./router/nonceEndpoint.js');
18
- const require_authorizationChallengeEndpoint = require('./router/authorizationChallengeEndpoint.js');
19
- const require_deferredCredentialEndpoint = require('./router/deferredCredentialEndpoint.js');
20
20
  require('./router/index.js');
21
21
 
22
22
  //#region src/openid4vc-issuer/OpenId4VcIssuerModule.ts
@@ -54,7 +54,7 @@ var OpenId4VcIssuerModule = class {
54
54
  rootAgentContext.config.logger.debug("No issuerId provided for incoming oid4vci request, returning 404");
55
55
  _res.status(404).send("Not found");
56
56
  }
57
- let agentContext = void 0;
57
+ let agentContext;
58
58
  try {
59
59
  agentContext = await require_tenants.getAgentContextForActorId(rootAgentContext, issuerId);
60
60
  const issuer = await agentContext.dependencyManager.resolve(require_OpenId4VcIssuerApi.OpenId4VcIssuerApi).getIssuerByIssuerId(issuerId);
@@ -1,22 +1,22 @@
1
- import { importExpress } from "../shared/router/express.mjs";
2
1
  import { getRequestContext } from "../shared/router/context.mjs";
2
+ import { importExpress } from "../shared/router/express.mjs";
3
3
  import { getAgentContextForActorId } from "../shared/router/tenants.mjs";
4
4
  import "../shared/router/index.mjs";
5
5
  import { OpenId4VcIssuerModuleConfig } from "./OpenId4VcIssuerModuleConfig.mjs";
6
- import { OpenId4VcIssuerRepository } from "./repository/OpenId4VcIssuerRepository.mjs";
7
6
  import { OpenId4VcIssuanceSessionRepository } from "./repository/OpenId4VcIssuanceSessionRepository.mjs";
7
+ import { OpenId4VcIssuerRepository } from "./repository/OpenId4VcIssuerRepository.mjs";
8
8
  import "./repository/index.mjs";
9
9
  import { OpenId4VcIssuerService } from "./OpenId4VcIssuerService.mjs";
10
10
  import { OpenId4VcIssuerApi } from "./OpenId4VcIssuerApi.mjs";
11
11
  import { configureAccessTokenEndpoint } from "./router/accessTokenEndpoint.mjs";
12
- import { configureCredentialEndpoint } from "./router/credentialEndpoint.mjs";
13
- import { configureIssuerMetadataEndpoint } from "./router/issuerMetadataEndpoint.mjs";
12
+ import { configureAuthorizationChallengeEndpoint } from "./router/authorizationChallengeEndpoint.mjs";
14
13
  import { configureOAuthAuthorizationServerMetadataEndpoint } from "./router/authorizationServerMetadataEndpoint.mjs";
14
+ import { configureCredentialEndpoint } from "./router/credentialEndpoint.mjs";
15
15
  import { configureCredentialOfferEndpoint } from "./router/credentialOfferEndpoint.mjs";
16
+ import { configureDeferredCredentialEndpoint } from "./router/deferredCredentialEndpoint.mjs";
17
+ import { configureIssuerMetadataEndpoint } from "./router/issuerMetadataEndpoint.mjs";
16
18
  import { configureJwksEndpoint } from "./router/jwksEndpoint.mjs";
17
19
  import { configureNonceEndpoint } from "./router/nonceEndpoint.mjs";
18
- import { configureAuthorizationChallengeEndpoint } from "./router/authorizationChallengeEndpoint.mjs";
19
- import { configureDeferredCredentialEndpoint } from "./router/deferredCredentialEndpoint.mjs";
20
20
  import "./router/index.mjs";
21
21
 
22
22
  //#region src/openid4vc-issuer/OpenId4VcIssuerModule.ts
@@ -54,7 +54,7 @@ var OpenId4VcIssuerModule = class {
54
54
  rootAgentContext.config.logger.debug("No issuerId provided for incoming oid4vci request, returning 404");
55
55
  _res.status(404).send("Not found");
56
56
  }
57
- let agentContext = void 0;
57
+ let agentContext;
58
58
  try {
59
59
  agentContext = await getAgentContextForActorId(rootAgentContext, issuerId);
60
60
  const issuer = await agentContext.dependencyManager.resolve(OpenId4VcIssuerApi).getIssuerByIssuerId(issuerId);
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcIssuerModule.mjs","names":["agentContext: AgentContext | undefined"],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModule.ts"],"sourcesContent":["import type { AgentContext, DependencyManager } from '@credo-ts/core'\nimport type { NextFunction, Response } from 'express'\nimport type { OpenId4VcIssuerModuleConfigOptions } from './OpenId4VcIssuerModuleConfig'\nimport type { OpenId4VcIssuanceRequest } from './router'\n\nimport { getAgentContextForActorId, getRequestContext, importExpress } from '../shared/router'\n\nimport { OpenId4VcIssuerApi } from './OpenId4VcIssuerApi'\nimport { OpenId4VcIssuerModuleConfig } from './OpenId4VcIssuerModuleConfig'\nimport { OpenId4VcIssuerService } from './OpenId4VcIssuerService'\nimport { OpenId4VcIssuanceSessionRepository } from './repository'\nimport { OpenId4VcIssuerRepository } from './repository/OpenId4VcIssuerRepository'\nimport {\n configureAccessTokenEndpoint,\n configureAuthorizationChallengeEndpoint,\n configureCredentialEndpoint,\n configureCredentialOfferEndpoint,\n configureDeferredCredentialEndpoint,\n configureIssuerMetadataEndpoint,\n configureJwksEndpoint,\n configureNonceEndpoint,\n configureOAuthAuthorizationServerMetadataEndpoint,\n} from './router'\n\n/**\n * @public\n */\nexport class OpenId4VcIssuerModule {\n public readonly config: OpenId4VcIssuerModuleConfig\n\n public constructor(options: OpenId4VcIssuerModuleConfigOptions) {\n this.config = new OpenId4VcIssuerModuleConfig(options)\n }\n\n /**\n * Registers the dependencies of the openid4vc issuer module on the dependency manager.\n */\n public register(dependencyManager: DependencyManager) {\n // Since the OpenID4VC module is a nested module (a module consisting of three modules) we register the API\n // manually. In the future we may disallow resolving the sub-api, but for now it allows for a cleaner migration path\n dependencyManager.registerContextScoped(OpenId4VcIssuerApi)\n\n // Register config\n dependencyManager.registerInstance(OpenId4VcIssuerModuleConfig, this.config)\n\n // Services\n dependencyManager.registerSingleton(OpenId4VcIssuerService)\n\n // Repository\n dependencyManager.registerSingleton(OpenId4VcIssuerRepository)\n dependencyManager.registerSingleton(OpenId4VcIssuanceSessionRepository)\n }\n\n public async initialize(rootAgentContext: AgentContext): Promise<void> {\n this.configureRouter(rootAgentContext)\n }\n\n /**\n * Registers the endpoints on the router passed to this module.\n */\n private configureRouter(rootAgentContext: AgentContext) {\n const { Router, json, urlencoded } = importExpress()\n\n // TODO: it is currently not possible to initialize an agent\n // shut it down, and then start it again, as the\n // express router is configured with a specific `AgentContext` instance\n // and dependency manager. One option is to always create a new router\n // but then users cannot pass their own router implementation.\n // We need to find a proper way to fix this.\n\n // We use separate context router and endpoint router. Context router handles the linking of the request\n // to a specific agent context. Endpoint router only knows about a single context\n const endpointRouter = Router()\n const contextRouter = this.config.router\n\n // parse application/x-www-form-urlencoded\n contextRouter.use(urlencoded({ extended: false }))\n // parse application/json\n contextRouter.use(json())\n\n contextRouter.param('issuerId', async (req: OpenId4VcIssuanceRequest, _res, next, issuerId: string) => {\n if (!issuerId) {\n rootAgentContext.config.logger.debug('No issuerId provided for incoming oid4vci request, returning 404')\n _res.status(404).send('Not found')\n }\n\n let agentContext: AgentContext | undefined = undefined\n\n try {\n // FIXME: should we create combined openId actor record?\n agentContext = await getAgentContextForActorId(rootAgentContext, issuerId)\n const issuerApi = agentContext.dependencyManager.resolve(OpenId4VcIssuerApi)\n const issuer = await issuerApi.getIssuerByIssuerId(issuerId)\n\n req.requestContext = {\n agentContext,\n issuer,\n }\n } catch (error) {\n agentContext?.config.logger.error(\n 'Failed to correlate incoming oid4vci request to existing tenant and issuer',\n {\n error,\n }\n )\n // If the opening failed\n await agentContext?.endSession()\n\n return _res.status(404).send('Not found')\n }\n\n next()\n })\n\n contextRouter.use('/:issuerId', endpointRouter)\n\n // Configure endpoints\n configureIssuerMetadataEndpoint(endpointRouter)\n configureJwksEndpoint(endpointRouter, this.config)\n configureNonceEndpoint(endpointRouter, this.config)\n configureOAuthAuthorizationServerMetadataEndpoint(endpointRouter)\n configureCredentialOfferEndpoint(endpointRouter, this.config)\n configureAccessTokenEndpoint(endpointRouter, this.config)\n configureAuthorizationChallengeEndpoint(endpointRouter, this.config)\n configureCredentialEndpoint(endpointRouter, this.config)\n configureDeferredCredentialEndpoint(endpointRouter, this.config)\n\n // First one will be called for all requests (when next is called)\n contextRouter.use(async (req: OpenId4VcIssuanceRequest, _res: unknown, next) => {\n const { agentContext } = getRequestContext(req)\n await agentContext.endSession()\n\n next()\n })\n\n // This one will be called for all errors that are thrown\n contextRouter.use(async (_error: unknown, req: OpenId4VcIssuanceRequest, res: Response, next: NextFunction) => {\n const { agentContext } = getRequestContext(req)\n\n if (!res.headersSent) {\n agentContext.config.logger.warn(\n 'Error was thrown but openid4vci endpoint did not send a response. Sending generic server_error.'\n )\n\n res.status(500).json({\n error: 'server_error',\n error_description: 'An unexpected error occurred on the server.',\n })\n }\n\n await agentContext.endSession()\n next()\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,IAAa,wBAAb,MAAmC;CAGjC,AAAO,YAAY,SAA6C;AAC9D,OAAK,SAAS,IAAI,4BAA4B,QAAQ;;;;;CAMxD,AAAO,SAAS,mBAAsC;AAGpD,oBAAkB,sBAAsB,mBAAmB;AAG3D,oBAAkB,iBAAiB,6BAA6B,KAAK,OAAO;AAG5E,oBAAkB,kBAAkB,uBAAuB;AAG3D,oBAAkB,kBAAkB,0BAA0B;AAC9D,oBAAkB,kBAAkB,mCAAmC;;CAGzE,MAAa,WAAW,kBAA+C;AACrE,OAAK,gBAAgB,iBAAiB;;;;;CAMxC,AAAQ,gBAAgB,kBAAgC;EACtD,MAAM,EAAE,QAAQ,MAAM,eAAe,eAAe;EAWpD,MAAM,iBAAiB,QAAQ;EAC/B,MAAM,gBAAgB,KAAK,OAAO;AAGlC,gBAAc,IAAI,WAAW,EAAE,UAAU,OAAO,CAAC,CAAC;AAElD,gBAAc,IAAI,MAAM,CAAC;AAEzB,gBAAc,MAAM,YAAY,OAAO,KAA+B,MAAM,MAAM,aAAqB;AACrG,OAAI,CAAC,UAAU;AACb,qBAAiB,OAAO,OAAO,MAAM,mEAAmE;AACxG,SAAK,OAAO,IAAI,CAAC,KAAK,YAAY;;GAGpC,IAAIA,eAAyC;AAE7C,OAAI;AAEF,mBAAe,MAAM,0BAA0B,kBAAkB,SAAS;IAE1E,MAAM,SAAS,MADG,aAAa,kBAAkB,QAAQ,mBAAmB,CAC7C,oBAAoB,SAAS;AAE5D,QAAI,iBAAiB;KACnB;KACA;KACD;YACM,OAAO;AACd,kBAAc,OAAO,OAAO,MAC1B,8EACA,EACE,OACD,CACF;AAED,UAAM,cAAc,YAAY;AAEhC,WAAO,KAAK,OAAO,IAAI,CAAC,KAAK,YAAY;;AAG3C,SAAM;IACN;AAEF,gBAAc,IAAI,cAAc,eAAe;AAG/C,kCAAgC,eAAe;AAC/C,wBAAsB,gBAAgB,KAAK,OAAO;AAClD,yBAAuB,gBAAgB,KAAK,OAAO;AACnD,oDAAkD,eAAe;AACjE,mCAAiC,gBAAgB,KAAK,OAAO;AAC7D,+BAA6B,gBAAgB,KAAK,OAAO;AACzD,0CAAwC,gBAAgB,KAAK,OAAO;AACpE,8BAA4B,gBAAgB,KAAK,OAAO;AACxD,sCAAoC,gBAAgB,KAAK,OAAO;AAGhE,gBAAc,IAAI,OAAO,KAA+B,MAAe,SAAS;GAC9E,MAAM,EAAE,iBAAiB,kBAAkB,IAAI;AAC/C,SAAM,aAAa,YAAY;AAE/B,SAAM;IACN;AAGF,gBAAc,IAAI,OAAO,QAAiB,KAA+B,KAAe,SAAuB;GAC7G,MAAM,EAAE,iBAAiB,kBAAkB,IAAI;AAE/C,OAAI,CAAC,IAAI,aAAa;AACpB,iBAAa,OAAO,OAAO,KACzB,kGACD;AAED,QAAI,OAAO,IAAI,CAAC,KAAK;KACnB,OAAO;KACP,mBAAmB;KACpB,CAAC;;AAGJ,SAAM,aAAa,YAAY;AAC/B,SAAM;IACN"}
1
+ {"version":3,"file":"OpenId4VcIssuerModule.mjs","names":["agentContext: AgentContext | undefined"],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModule.ts"],"sourcesContent":["import type { AgentContext, DependencyManager } from '@credo-ts/core'\nimport type { NextFunction, Response } from 'express'\nimport { getAgentContextForActorId, getRequestContext, importExpress } from '../shared/router'\nimport { OpenId4VcIssuerApi } from './OpenId4VcIssuerApi'\nimport type { OpenId4VcIssuerModuleConfigOptions } from './OpenId4VcIssuerModuleConfig'\nimport { OpenId4VcIssuerModuleConfig } from './OpenId4VcIssuerModuleConfig'\nimport { OpenId4VcIssuerService } from './OpenId4VcIssuerService'\nimport { OpenId4VcIssuanceSessionRepository } from './repository'\nimport { OpenId4VcIssuerRepository } from './repository/OpenId4VcIssuerRepository'\nimport type { OpenId4VcIssuanceRequest } from './router'\nimport {\n configureAccessTokenEndpoint,\n configureAuthorizationChallengeEndpoint,\n configureCredentialEndpoint,\n configureCredentialOfferEndpoint,\n configureDeferredCredentialEndpoint,\n configureIssuerMetadataEndpoint,\n configureJwksEndpoint,\n configureNonceEndpoint,\n configureOAuthAuthorizationServerMetadataEndpoint,\n} from './router'\n\n/**\n * @public\n */\nexport class OpenId4VcIssuerModule {\n public readonly config: OpenId4VcIssuerModuleConfig\n\n public constructor(options: OpenId4VcIssuerModuleConfigOptions) {\n this.config = new OpenId4VcIssuerModuleConfig(options)\n }\n\n /**\n * Registers the dependencies of the openid4vc issuer module on the dependency manager.\n */\n public register(dependencyManager: DependencyManager) {\n // Since the OpenID4VC module is a nested module (a module consisting of three modules) we register the API\n // manually. In the future we may disallow resolving the sub-api, but for now it allows for a cleaner migration path\n dependencyManager.registerContextScoped(OpenId4VcIssuerApi)\n\n // Register config\n dependencyManager.registerInstance(OpenId4VcIssuerModuleConfig, this.config)\n\n // Services\n dependencyManager.registerSingleton(OpenId4VcIssuerService)\n\n // Repository\n dependencyManager.registerSingleton(OpenId4VcIssuerRepository)\n dependencyManager.registerSingleton(OpenId4VcIssuanceSessionRepository)\n }\n\n public async initialize(rootAgentContext: AgentContext): Promise<void> {\n this.configureRouter(rootAgentContext)\n }\n\n /**\n * Registers the endpoints on the router passed to this module.\n */\n private configureRouter(rootAgentContext: AgentContext) {\n const { Router, json, urlencoded } = importExpress()\n\n // TODO: it is currently not possible to initialize an agent\n // shut it down, and then start it again, as the\n // express router is configured with a specific `AgentContext` instance\n // and dependency manager. One option is to always create a new router\n // but then users cannot pass their own router implementation.\n // We need to find a proper way to fix this.\n\n // We use separate context router and endpoint router. Context router handles the linking of the request\n // to a specific agent context. Endpoint router only knows about a single context\n const endpointRouter = Router()\n const contextRouter = this.config.router\n\n // parse application/x-www-form-urlencoded\n contextRouter.use(urlencoded({ extended: false }))\n // parse application/json\n contextRouter.use(json())\n\n contextRouter.param('issuerId', async (req: OpenId4VcIssuanceRequest, _res, next, issuerId: string) => {\n if (!issuerId) {\n rootAgentContext.config.logger.debug('No issuerId provided for incoming oid4vci request, returning 404')\n _res.status(404).send('Not found')\n }\n\n let agentContext: AgentContext | undefined\n\n try {\n // FIXME: should we create combined openId actor record?\n agentContext = await getAgentContextForActorId(rootAgentContext, issuerId)\n const issuerApi = agentContext.dependencyManager.resolve(OpenId4VcIssuerApi)\n const issuer = await issuerApi.getIssuerByIssuerId(issuerId)\n\n req.requestContext = {\n agentContext,\n issuer,\n }\n } catch (error) {\n agentContext?.config.logger.error(\n 'Failed to correlate incoming oid4vci request to existing tenant and issuer',\n {\n error,\n }\n )\n // If the opening failed\n await agentContext?.endSession()\n\n return _res.status(404).send('Not found')\n }\n\n next()\n })\n\n contextRouter.use('/:issuerId', endpointRouter)\n\n // Configure endpoints\n configureIssuerMetadataEndpoint(endpointRouter)\n configureJwksEndpoint(endpointRouter, this.config)\n configureNonceEndpoint(endpointRouter, this.config)\n configureOAuthAuthorizationServerMetadataEndpoint(endpointRouter)\n configureCredentialOfferEndpoint(endpointRouter, this.config)\n configureAccessTokenEndpoint(endpointRouter, this.config)\n configureAuthorizationChallengeEndpoint(endpointRouter, this.config)\n configureCredentialEndpoint(endpointRouter, this.config)\n configureDeferredCredentialEndpoint(endpointRouter, this.config)\n\n // First one will be called for all requests (when next is called)\n contextRouter.use(async (req: OpenId4VcIssuanceRequest, _res: unknown, next) => {\n const { agentContext } = getRequestContext(req)\n await agentContext.endSession()\n\n next()\n })\n\n // This one will be called for all errors that are thrown\n contextRouter.use(async (_error: unknown, req: OpenId4VcIssuanceRequest, res: Response, next: NextFunction) => {\n const { agentContext } = getRequestContext(req)\n\n if (!res.headersSent) {\n agentContext.config.logger.warn(\n 'Error was thrown but openid4vci endpoint did not send a response. Sending generic server_error.'\n )\n\n res.status(500).json({\n error: 'server_error',\n error_description: 'An unexpected error occurred on the server.',\n })\n }\n\n await agentContext.endSession()\n next()\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAa,wBAAb,MAAmC;CAGjC,AAAO,YAAY,SAA6C;AAC9D,OAAK,SAAS,IAAI,4BAA4B,QAAQ;;;;;CAMxD,AAAO,SAAS,mBAAsC;AAGpD,oBAAkB,sBAAsB,mBAAmB;AAG3D,oBAAkB,iBAAiB,6BAA6B,KAAK,OAAO;AAG5E,oBAAkB,kBAAkB,uBAAuB;AAG3D,oBAAkB,kBAAkB,0BAA0B;AAC9D,oBAAkB,kBAAkB,mCAAmC;;CAGzE,MAAa,WAAW,kBAA+C;AACrE,OAAK,gBAAgB,iBAAiB;;;;;CAMxC,AAAQ,gBAAgB,kBAAgC;EACtD,MAAM,EAAE,QAAQ,MAAM,eAAe,eAAe;EAWpD,MAAM,iBAAiB,QAAQ;EAC/B,MAAM,gBAAgB,KAAK,OAAO;AAGlC,gBAAc,IAAI,WAAW,EAAE,UAAU,OAAO,CAAC,CAAC;AAElD,gBAAc,IAAI,MAAM,CAAC;AAEzB,gBAAc,MAAM,YAAY,OAAO,KAA+B,MAAM,MAAM,aAAqB;AACrG,OAAI,CAAC,UAAU;AACb,qBAAiB,OAAO,OAAO,MAAM,mEAAmE;AACxG,SAAK,OAAO,IAAI,CAAC,KAAK,YAAY;;GAGpC,IAAIA;AAEJ,OAAI;AAEF,mBAAe,MAAM,0BAA0B,kBAAkB,SAAS;IAE1E,MAAM,SAAS,MADG,aAAa,kBAAkB,QAAQ,mBAAmB,CAC7C,oBAAoB,SAAS;AAE5D,QAAI,iBAAiB;KACnB;KACA;KACD;YACM,OAAO;AACd,kBAAc,OAAO,OAAO,MAC1B,8EACA,EACE,OACD,CACF;AAED,UAAM,cAAc,YAAY;AAEhC,WAAO,KAAK,OAAO,IAAI,CAAC,KAAK,YAAY;;AAG3C,SAAM;IACN;AAEF,gBAAc,IAAI,cAAc,eAAe;AAG/C,kCAAgC,eAAe;AAC/C,wBAAsB,gBAAgB,KAAK,OAAO;AAClD,yBAAuB,gBAAgB,KAAK,OAAO;AACnD,oDAAkD,eAAe;AACjE,mCAAiC,gBAAgB,KAAK,OAAO;AAC7D,+BAA6B,gBAAgB,KAAK,OAAO;AACzD,0CAAwC,gBAAgB,KAAK,OAAO;AACpE,8BAA4B,gBAAgB,KAAK,OAAO;AACxD,sCAAoC,gBAAgB,KAAK,OAAO;AAGhE,gBAAc,IAAI,OAAO,KAA+B,MAAe,SAAS;GAC9E,MAAM,EAAE,iBAAiB,kBAAkB,IAAI;AAC/C,SAAM,aAAa,YAAY;AAE/B,SAAM;IACN;AAGF,gBAAc,IAAI,OAAO,QAAiB,KAA+B,KAAe,SAAuB;GAC7G,MAAM,EAAE,iBAAiB,kBAAkB,IAAI;AAE/C,OAAI,CAAC,IAAI,aAAa;AACpB,iBAAa,OAAO,OAAO,KACzB,kGACD;AAED,QAAI,OAAO,IAAI,CAAC,KAAK;KACnB,OAAO;KACP,mBAAmB;KACpB,CAAC;;AAGJ,SAAM,aAAa,YAAY;AAC/B,SAAM;IACN"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcIssuerModuleConfig.d.mts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModuleConfig.ts"],"sourcesContent":[],"mappings":";;;;UAeiB,kCAAA;;AAAjB;;;SA0FuC,EAAA,MAAA;;;;AA4DvC;;;;QAa8B,CAAA,EArJnB,MAqJmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAzES;;;;;;;gDAQS;;;;;;;;0DASU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2C7C,2BAAA;;mBAEa;;;;;;;;0DASuC;uBAEnC;;;;;6CAekB;;;;qDAOQ"}
1
+ {"version":3,"file":"OpenId4VcIssuerModuleConfig.d.mts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModuleConfig.ts"],"sourcesContent":[],"mappings":";;;;UAciB,kCAAA;;AAAjB;;;SA0FuC,EAAA,MAAA;;;;AA4DvC;;;;QAa8B,CAAA,EArJnB,MAqJmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAzES;;;;;;;gDAQS;;;;;;;;0DASU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2C7C,2BAAA;;mBAEa;;;;;;;;0DASuC;uBAEnC;;;;;6CAekB;;;;qDAOQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcIssuerModuleConfig.d.ts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModuleConfig.ts"],"sourcesContent":[],"mappings":";;;;UAeiB,kCAAA;;AAAjB;;;SA0FuC,EAAA,MAAA;;;;AA4DvC;;;;QAa8B,CAAA,EArJnB,MAqJmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAzES;;;;;;;gDAQS;;;;;;;;0DASU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2C7C,2BAAA;;mBAEa;;;;;;;;0DASuC;uBAEnC;;;;;6CAekB;;;;qDAOQ"}
1
+ {"version":3,"file":"OpenId4VcIssuerModuleConfig.d.ts","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModuleConfig.ts"],"sourcesContent":[],"mappings":";;;;UAciB,kCAAA;;AAAjB;;;SA0FuC,EAAA,MAAA;;;;AA4DvC;;;;QAa8B,CAAA,EArJnB,MAqJmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAzES;;;;;;;gDAQS;;;;;;;;0DASU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2C7C,2BAAA;;mBAEa;;;;;;;;0DASuC;uBAEnC;;;;;6CAekB;;;;qDAOQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4VcIssuerModuleConfig.mjs","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModuleConfig.ts"],"sourcesContent":["import type { Router } from 'express'\nimport type {\n OpenId4VciCredentialRequestToCredentialMapper,\n OpenId4VciDeferredCredentialRequestToCredentialMapper,\n OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization,\n} from './OpenId4VcIssuerServiceOptions'\n\nimport { importExpress } from '../shared/router'\n\nconst DEFAULT_C_NONCE_EXPIRES_IN = 1 * 60 // 1 minute\nconst DEFAULT_AUTHORIZATION_CODE_EXPIRES_IN = 1 * 60 // 1 minute\nconst DEFAULT_TOKEN_EXPIRES_IN = 3 * 60 // 3 minutes\nconst DEFAULT_REFRESH_TOKEN_EXPIRES_IN = 90 * 24 * 60 * 60 // 90 days\nconst DEFAULT_STATEFUL_CREDENTIAL_OFFER_EXPIRES_IN = 3 * 60 // 3 minutes\n\nexport interface OpenId4VcIssuerModuleConfigOptions {\n /**\n * Base url at which the issuer endpoints will be hosted. All endpoints will be exposed with\n * this path as prefix.\n */\n baseUrl: string\n\n /**\n * Express router on which the openid4vci endpoints will be registered. If\n * no router is provided, a new one will be created.\n *\n * NOTE: you must manually register the router on your express app and\n * expose this on a public url that is reachable when `baseUrl` is called.\n */\n router?: Router\n\n /**\n * The time after which a cNonce will expire.\n *\n * @default 60 (1 minute)\n */\n cNonceExpiresInSeconds?: number\n\n /**\n * The time after which a stateful credential offer not bound to a subject expires. Once the offer has been bound\n * to a subject the access token expiration takes effect. This is to prevent long-lived `pre-authorized_code` and\n * `issuer_state` values.\n *\n * @default 180 (3 minutes)\n */\n statefulCredentialOfferExpirationInSeconds?: number\n\n /**\n * The time after which an authorization code will expire.\n *\n * @default 60 (1 minute)\n */\n authorizationCodeExpiresInSeconds?: number\n\n /**\n * The time after which an access token will expire.\n *\n * @default 180 (3 minutes)\n */\n accessTokenExpiresInSeconds?: number\n\n /**\n * The time after which a refresh token will expire.\n *\n * @default 7776000 (90 days)\n */\n refreshTokenExpiresInSeconds?: number\n\n /**\n * Whether DPoP is required for all issuance sessions. This value can be overridden when creating\n * a credential offer. If dpop is not required, but used by a client in the first request to credo,\n * DPoP will be required going forward.\n *\n * @default false\n */\n dpopRequired?: boolean\n\n /**\n * Whether wallet attestations are required for all issuance sessions. This value can be overridden when creating\n * a credential offer, but will have effect for dynamic issuance sessions. If wallet attestations are not required\n * but used by a client in the first request to credo,\n * wallet attestations will be required going forward.\n *\n * @default false\n */\n walletAttestationsRequired?: boolean\n\n /**\n * Whether to allow dynamic issuance sessions based on a credential request.\n *\n * This requires an external authorization server which issues access tokens without\n * a `pre-authorized_code` or `issuer_state` parameter.\n *\n * Credo only support stateful credential offer sessions (pre-auth or presentation during issuance)\n *\n * @default false\n */\n allowDynamicIssuanceSessions?: boolean\n\n /**\n * A function mapping a credential request to the credential to be issued.\n *\n * When multiple credentials are returned it is recommended to use different or approximate issuance and expiration\n * times to prevent correlation based on the specific time\n */\n credentialRequestToCredentialMapper: OpenId4VciCredentialRequestToCredentialMapper\n\n /**\n * A function mapping a deferred credential request to the credential to be issued.\n *\n * When multiple credentials are returned it is recommended to use different or approximate issuance and expiration\n * times to prevent correlation based on the specific time\n */\n deferredCredentialRequestToCredentialMapper?: OpenId4VciDeferredCredentialRequestToCredentialMapper\n\n /**\n * Callback to get a verification session that needs to be fulfilled for the authorization of\n * of a credential issuance session. Once the verification session has been completed the user can\n * retrieve an authorization code and access token and retrieve the credential(s).\n *\n * Required if presentation during issuance flow is used\n */\n getVerificationSessionForIssuanceSessionAuthorization?: OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization\n\n /**\n * Custom the paths used for endpoints\n */\n endpoints?: {\n /**\n * @default /nonce\n */\n nonce?: string\n\n /**\n * @default /challenge\n */\n authorizationChallenge?: string\n\n /**\n * @default /offers\n */\n credentialOffer?: string\n\n /**\n * @default /credential\n */\n credential?: string\n\n /**\n * @default /deferred-credential\n */\n deferredCredential?: string\n\n /**\n * @default /token\n */\n accessToken?: string\n\n /**\n * @default /jwks\n */\n jwks: string\n }\n}\n\nexport class OpenId4VcIssuerModuleConfig {\n private options: OpenId4VcIssuerModuleConfigOptions\n public readonly router: Router\n\n /**\n * Callback to get a verification session that needs to be fulfilled for the authorization of\n * of a credential issuance session. Once the verification session has been completed the user can\n * retrieve an authorization code and access token and retrieve the credential(s).\n *\n * Required if presentation during issuance flow is used\n */\n public getVerificationSessionForIssuanceSessionAuthorization?: OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization\n\n public constructor(options: OpenId4VcIssuerModuleConfigOptions) {\n this.options = options\n this.getVerificationSessionForIssuanceSessionAuthorization =\n options.getVerificationSessionForIssuanceSessionAuthorization\n\n this.router = options.router ?? importExpress().Router()\n }\n\n public get baseUrl() {\n return this.options.baseUrl\n }\n\n /**\n * A function mapping a credential request to the credential to be issued.\n */\n public get credentialRequestToCredentialMapper() {\n return this.options.credentialRequestToCredentialMapper\n }\n\n /**\n * A function mapping a credential request to the credential to be issued.\n */\n public get deferredCredentialRequestToCredentialMapper() {\n return this.options.deferredCredentialRequestToCredentialMapper\n }\n\n /**\n * The time after which a cNone will expire.\n *\n * @default 60 (1 minute)\n */\n public get cNonceExpiresInSeconds(): number {\n return this.options.cNonceExpiresInSeconds ?? DEFAULT_C_NONCE_EXPIRES_IN\n }\n\n /**\n * The time after which a stateful credential offer not bound to a subject expires. Once the offer has been bound\n * to a subject the access token expiration takes effect. This is to prevent long-lived `pre-authorized_code` and\n * `issuer_state` values.\n *\n * @default 360 (5 minutes)\n */\n public get statefulCredentialOfferExpirationInSeconds(): number {\n return this.options.statefulCredentialOfferExpirationInSeconds ?? DEFAULT_STATEFUL_CREDENTIAL_OFFER_EXPIRES_IN\n }\n\n /**\n * The time after which a cNonce will expire.\n *\n * @default 60 (1 minute)\n */\n public get authorizationCodeExpiresInSeconds(): number {\n return this.options.authorizationCodeExpiresInSeconds ?? DEFAULT_AUTHORIZATION_CODE_EXPIRES_IN\n }\n\n /**\n * The time after which an access token will expire.\n *\n * @default 180 (3 minutes)\n */\n public get accessTokenExpiresInSeconds(): number {\n return this.options.accessTokenExpiresInSeconds ?? DEFAULT_TOKEN_EXPIRES_IN\n }\n\n /**\n * The time after which a refresh token will expire.\n *\n * @default 7776000 (90 days)\n */\n public get refreshTokenExpiresInSeconds(): number {\n return this.options.refreshTokenExpiresInSeconds ?? DEFAULT_REFRESH_TOKEN_EXPIRES_IN\n }\n\n /**\n * Whether DPoP is required for all issuance sessions. This value can be overridden when creating\n * a credential offer. If dpop is not required, but used by a client in the first request to credo,\n * DPoP will be required going forward.\n *\n * @default false\n */\n public get dpopRequired(): boolean {\n return this.options.dpopRequired ?? false\n }\n\n /**\n * Whether wallet attestations are required for all issuance sessions. This value can be overridden when creating\n * a credential offer, but will have effect for dynamic issuance sessions. If wallet attestations are not required\n * but used by a client in the first request to credo,\n * wallet attestations will be required going forward.\n *\n * @default false\n */\n public get walletAttestationsRequired(): boolean {\n return this.options.walletAttestationsRequired ?? false\n }\n\n /**\n * Whether to allow dynamic issuance sessions based on a credential request.\n *\n * This requires an external authorization server which issues access tokens without\n * a `pre-authorized_code` or `issuer_state` parameter.\n *\n * Credo only supports stateful credential offer sessions (pre-auth or presentation during issuance)\n *\n * @default false\n */\n public get allowDynamicIssuanceSessions(): boolean {\n return this.options.allowDynamicIssuanceSessions ?? false\n }\n\n /**\n * @default /nonce\n */\n public get nonceEndpointPath(): string {\n return this.options.endpoints?.nonce ?? '/nonce'\n }\n\n /**\n * @default /challenge\n */\n public get authorizationChallengeEndpointPath(): string {\n return this.options.endpoints?.authorizationChallenge ?? '/challenge'\n }\n\n /**\n * @default /offers\n */\n public get credentialOfferEndpointPath(): string {\n return this.options.endpoints?.credentialOffer ?? '/offers'\n }\n\n /**\n * @default /credential\n */\n public get credentialEndpointPath(): string {\n return this.options.endpoints?.credential ?? '/credential'\n }\n\n /**\n * @default /deferred-credential\n */\n public get deferredCredentialEndpointPath(): string {\n return this.options.endpoints?.deferredCredential ?? '/deferred-credential'\n }\n\n /**\n * @default /token\n */\n public get accessTokenEndpointPath(): string {\n return this.options.endpoints?.accessToken ?? '/token'\n }\n\n /**\n * @default /jwks\n */\n public get jwksEndpointPath(): string {\n return this.options.endpoints?.jwks ?? '/jwks'\n }\n}\n"],"mappings":";;;;AASA,MAAM,6BAA6B;AACnC,MAAM,wCAAwC;AAC9C,MAAM,2BAA2B;AACjC,MAAM,mCAAmC,OAAU,KAAK;AACxD,MAAM,+CAA+C;AAwJrD,IAAa,8BAAb,MAAyC;CAavC,AAAO,YAAY,SAA6C;AAC9D,OAAK,UAAU;AACf,OAAK,wDACH,QAAQ;AAEV,OAAK,SAAS,QAAQ,UAAU,eAAe,CAAC,QAAQ;;CAG1D,IAAW,UAAU;AACnB,SAAO,KAAK,QAAQ;;;;;CAMtB,IAAW,sCAAsC;AAC/C,SAAO,KAAK,QAAQ;;;;;CAMtB,IAAW,8CAA8C;AACvD,SAAO,KAAK,QAAQ;;;;;;;CAQtB,IAAW,yBAAiC;AAC1C,SAAO,KAAK,QAAQ,0BAA0B;;;;;;;;;CAUhD,IAAW,6CAAqD;AAC9D,SAAO,KAAK,QAAQ,8CAA8C;;;;;;;CAQpE,IAAW,oCAA4C;AACrD,SAAO,KAAK,QAAQ,qCAAqC;;;;;;;CAQ3D,IAAW,8BAAsC;AAC/C,SAAO,KAAK,QAAQ,+BAA+B;;;;;;;CAQrD,IAAW,+BAAuC;AAChD,SAAO,KAAK,QAAQ,gCAAgC;;;;;;;;;CAUtD,IAAW,eAAwB;AACjC,SAAO,KAAK,QAAQ,gBAAgB;;;;;;;;;;CAWtC,IAAW,6BAAsC;AAC/C,SAAO,KAAK,QAAQ,8BAA8B;;;;;;;;;;;;CAapD,IAAW,+BAAwC;AACjD,SAAO,KAAK,QAAQ,gCAAgC;;;;;CAMtD,IAAW,oBAA4B;AACrC,SAAO,KAAK,QAAQ,WAAW,SAAS;;;;;CAM1C,IAAW,qCAA6C;AACtD,SAAO,KAAK,QAAQ,WAAW,0BAA0B;;;;;CAM3D,IAAW,8BAAsC;AAC/C,SAAO,KAAK,QAAQ,WAAW,mBAAmB;;;;;CAMpD,IAAW,yBAAiC;AAC1C,SAAO,KAAK,QAAQ,WAAW,cAAc;;;;;CAM/C,IAAW,iCAAyC;AAClD,SAAO,KAAK,QAAQ,WAAW,sBAAsB;;;;;CAMvD,IAAW,0BAAkC;AAC3C,SAAO,KAAK,QAAQ,WAAW,eAAe;;;;;CAMhD,IAAW,mBAA2B;AACpC,SAAO,KAAK,QAAQ,WAAW,QAAQ"}
1
+ {"version":3,"file":"OpenId4VcIssuerModuleConfig.mjs","names":[],"sources":["../../src/openid4vc-issuer/OpenId4VcIssuerModuleConfig.ts"],"sourcesContent":["import type { Router } from 'express'\nimport { importExpress } from '../shared/router'\nimport type {\n OpenId4VciCredentialRequestToCredentialMapper,\n OpenId4VciDeferredCredentialRequestToCredentialMapper,\n OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization,\n} from './OpenId4VcIssuerServiceOptions'\n\nconst DEFAULT_C_NONCE_EXPIRES_IN = 1 * 60 // 1 minute\nconst DEFAULT_AUTHORIZATION_CODE_EXPIRES_IN = 1 * 60 // 1 minute\nconst DEFAULT_TOKEN_EXPIRES_IN = 3 * 60 // 3 minutes\nconst DEFAULT_REFRESH_TOKEN_EXPIRES_IN = 90 * 24 * 60 * 60 // 90 days\nconst DEFAULT_STATEFUL_CREDENTIAL_OFFER_EXPIRES_IN = 3 * 60 // 3 minutes\n\nexport interface OpenId4VcIssuerModuleConfigOptions {\n /**\n * Base url at which the issuer endpoints will be hosted. All endpoints will be exposed with\n * this path as prefix.\n */\n baseUrl: string\n\n /**\n * Express router on which the openid4vci endpoints will be registered. If\n * no router is provided, a new one will be created.\n *\n * NOTE: you must manually register the router on your express app and\n * expose this on a public url that is reachable when `baseUrl` is called.\n */\n router?: Router\n\n /**\n * The time after which a cNonce will expire.\n *\n * @default 60 (1 minute)\n */\n cNonceExpiresInSeconds?: number\n\n /**\n * The time after which a stateful credential offer not bound to a subject expires. Once the offer has been bound\n * to a subject the access token expiration takes effect. This is to prevent long-lived `pre-authorized_code` and\n * `issuer_state` values.\n *\n * @default 180 (3 minutes)\n */\n statefulCredentialOfferExpirationInSeconds?: number\n\n /**\n * The time after which an authorization code will expire.\n *\n * @default 60 (1 minute)\n */\n authorizationCodeExpiresInSeconds?: number\n\n /**\n * The time after which an access token will expire.\n *\n * @default 180 (3 minutes)\n */\n accessTokenExpiresInSeconds?: number\n\n /**\n * The time after which a refresh token will expire.\n *\n * @default 7776000 (90 days)\n */\n refreshTokenExpiresInSeconds?: number\n\n /**\n * Whether DPoP is required for all issuance sessions. This value can be overridden when creating\n * a credential offer. If dpop is not required, but used by a client in the first request to credo,\n * DPoP will be required going forward.\n *\n * @default false\n */\n dpopRequired?: boolean\n\n /**\n * Whether wallet attestations are required for all issuance sessions. This value can be overridden when creating\n * a credential offer, but will have effect for dynamic issuance sessions. If wallet attestations are not required\n * but used by a client in the first request to credo,\n * wallet attestations will be required going forward.\n *\n * @default false\n */\n walletAttestationsRequired?: boolean\n\n /**\n * Whether to allow dynamic issuance sessions based on a credential request.\n *\n * This requires an external authorization server which issues access tokens without\n * a `pre-authorized_code` or `issuer_state` parameter.\n *\n * Credo only support stateful credential offer sessions (pre-auth or presentation during issuance)\n *\n * @default false\n */\n allowDynamicIssuanceSessions?: boolean\n\n /**\n * A function mapping a credential request to the credential to be issued.\n *\n * When multiple credentials are returned it is recommended to use different or approximate issuance and expiration\n * times to prevent correlation based on the specific time\n */\n credentialRequestToCredentialMapper: OpenId4VciCredentialRequestToCredentialMapper\n\n /**\n * A function mapping a deferred credential request to the credential to be issued.\n *\n * When multiple credentials are returned it is recommended to use different or approximate issuance and expiration\n * times to prevent correlation based on the specific time\n */\n deferredCredentialRequestToCredentialMapper?: OpenId4VciDeferredCredentialRequestToCredentialMapper\n\n /**\n * Callback to get a verification session that needs to be fulfilled for the authorization of\n * of a credential issuance session. Once the verification session has been completed the user can\n * retrieve an authorization code and access token and retrieve the credential(s).\n *\n * Required if presentation during issuance flow is used\n */\n getVerificationSessionForIssuanceSessionAuthorization?: OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization\n\n /**\n * Custom the paths used for endpoints\n */\n endpoints?: {\n /**\n * @default /nonce\n */\n nonce?: string\n\n /**\n * @default /challenge\n */\n authorizationChallenge?: string\n\n /**\n * @default /offers\n */\n credentialOffer?: string\n\n /**\n * @default /credential\n */\n credential?: string\n\n /**\n * @default /deferred-credential\n */\n deferredCredential?: string\n\n /**\n * @default /token\n */\n accessToken?: string\n\n /**\n * @default /jwks\n */\n jwks: string\n }\n}\n\nexport class OpenId4VcIssuerModuleConfig {\n private options: OpenId4VcIssuerModuleConfigOptions\n public readonly router: Router\n\n /**\n * Callback to get a verification session that needs to be fulfilled for the authorization of\n * of a credential issuance session. Once the verification session has been completed the user can\n * retrieve an authorization code and access token and retrieve the credential(s).\n *\n * Required if presentation during issuance flow is used\n */\n public getVerificationSessionForIssuanceSessionAuthorization?: OpenId4VciGetVerificationSessionForIssuanceSessionAuthorization\n\n public constructor(options: OpenId4VcIssuerModuleConfigOptions) {\n this.options = options\n this.getVerificationSessionForIssuanceSessionAuthorization =\n options.getVerificationSessionForIssuanceSessionAuthorization\n\n this.router = options.router ?? importExpress().Router()\n }\n\n public get baseUrl() {\n return this.options.baseUrl\n }\n\n /**\n * A function mapping a credential request to the credential to be issued.\n */\n public get credentialRequestToCredentialMapper() {\n return this.options.credentialRequestToCredentialMapper\n }\n\n /**\n * A function mapping a credential request to the credential to be issued.\n */\n public get deferredCredentialRequestToCredentialMapper() {\n return this.options.deferredCredentialRequestToCredentialMapper\n }\n\n /**\n * The time after which a cNone will expire.\n *\n * @default 60 (1 minute)\n */\n public get cNonceExpiresInSeconds(): number {\n return this.options.cNonceExpiresInSeconds ?? DEFAULT_C_NONCE_EXPIRES_IN\n }\n\n /**\n * The time after which a stateful credential offer not bound to a subject expires. Once the offer has been bound\n * to a subject the access token expiration takes effect. This is to prevent long-lived `pre-authorized_code` and\n * `issuer_state` values.\n *\n * @default 360 (5 minutes)\n */\n public get statefulCredentialOfferExpirationInSeconds(): number {\n return this.options.statefulCredentialOfferExpirationInSeconds ?? DEFAULT_STATEFUL_CREDENTIAL_OFFER_EXPIRES_IN\n }\n\n /**\n * The time after which a cNonce will expire.\n *\n * @default 60 (1 minute)\n */\n public get authorizationCodeExpiresInSeconds(): number {\n return this.options.authorizationCodeExpiresInSeconds ?? DEFAULT_AUTHORIZATION_CODE_EXPIRES_IN\n }\n\n /**\n * The time after which an access token will expire.\n *\n * @default 180 (3 minutes)\n */\n public get accessTokenExpiresInSeconds(): number {\n return this.options.accessTokenExpiresInSeconds ?? DEFAULT_TOKEN_EXPIRES_IN\n }\n\n /**\n * The time after which a refresh token will expire.\n *\n * @default 7776000 (90 days)\n */\n public get refreshTokenExpiresInSeconds(): number {\n return this.options.refreshTokenExpiresInSeconds ?? DEFAULT_REFRESH_TOKEN_EXPIRES_IN\n }\n\n /**\n * Whether DPoP is required for all issuance sessions. This value can be overridden when creating\n * a credential offer. If dpop is not required, but used by a client in the first request to credo,\n * DPoP will be required going forward.\n *\n * @default false\n */\n public get dpopRequired(): boolean {\n return this.options.dpopRequired ?? false\n }\n\n /**\n * Whether wallet attestations are required for all issuance sessions. This value can be overridden when creating\n * a credential offer, but will have effect for dynamic issuance sessions. If wallet attestations are not required\n * but used by a client in the first request to credo,\n * wallet attestations will be required going forward.\n *\n * @default false\n */\n public get walletAttestationsRequired(): boolean {\n return this.options.walletAttestationsRequired ?? false\n }\n\n /**\n * Whether to allow dynamic issuance sessions based on a credential request.\n *\n * This requires an external authorization server which issues access tokens without\n * a `pre-authorized_code` or `issuer_state` parameter.\n *\n * Credo only supports stateful credential offer sessions (pre-auth or presentation during issuance)\n *\n * @default false\n */\n public get allowDynamicIssuanceSessions(): boolean {\n return this.options.allowDynamicIssuanceSessions ?? false\n }\n\n /**\n * @default /nonce\n */\n public get nonceEndpointPath(): string {\n return this.options.endpoints?.nonce ?? '/nonce'\n }\n\n /**\n * @default /challenge\n */\n public get authorizationChallengeEndpointPath(): string {\n return this.options.endpoints?.authorizationChallenge ?? '/challenge'\n }\n\n /**\n * @default /offers\n */\n public get credentialOfferEndpointPath(): string {\n return this.options.endpoints?.credentialOffer ?? '/offers'\n }\n\n /**\n * @default /credential\n */\n public get credentialEndpointPath(): string {\n return this.options.endpoints?.credential ?? '/credential'\n }\n\n /**\n * @default /deferred-credential\n */\n public get deferredCredentialEndpointPath(): string {\n return this.options.endpoints?.deferredCredential ?? '/deferred-credential'\n }\n\n /**\n * @default /token\n */\n public get accessTokenEndpointPath(): string {\n return this.options.endpoints?.accessToken ?? '/token'\n }\n\n /**\n * @default /jwks\n */\n public get jwksEndpointPath(): string {\n return this.options.endpoints?.jwks ?? '/jwks'\n }\n}\n"],"mappings":";;;;AAQA,MAAM,6BAA6B;AACnC,MAAM,wCAAwC;AAC9C,MAAM,2BAA2B;AACjC,MAAM,mCAAmC,OAAU,KAAK;AACxD,MAAM,+CAA+C;AAwJrD,IAAa,8BAAb,MAAyC;CAavC,AAAO,YAAY,SAA6C;AAC9D,OAAK,UAAU;AACf,OAAK,wDACH,QAAQ;AAEV,OAAK,SAAS,QAAQ,UAAU,eAAe,CAAC,QAAQ;;CAG1D,IAAW,UAAU;AACnB,SAAO,KAAK,QAAQ;;;;;CAMtB,IAAW,sCAAsC;AAC/C,SAAO,KAAK,QAAQ;;;;;CAMtB,IAAW,8CAA8C;AACvD,SAAO,KAAK,QAAQ;;;;;;;CAQtB,IAAW,yBAAiC;AAC1C,SAAO,KAAK,QAAQ,0BAA0B;;;;;;;;;CAUhD,IAAW,6CAAqD;AAC9D,SAAO,KAAK,QAAQ,8CAA8C;;;;;;;CAQpE,IAAW,oCAA4C;AACrD,SAAO,KAAK,QAAQ,qCAAqC;;;;;;;CAQ3D,IAAW,8BAAsC;AAC/C,SAAO,KAAK,QAAQ,+BAA+B;;;;;;;CAQrD,IAAW,+BAAuC;AAChD,SAAO,KAAK,QAAQ,gCAAgC;;;;;;;;;CAUtD,IAAW,eAAwB;AACjC,SAAO,KAAK,QAAQ,gBAAgB;;;;;;;;;;CAWtC,IAAW,6BAAsC;AAC/C,SAAO,KAAK,QAAQ,8BAA8B;;;;;;;;;;;;CAapD,IAAW,+BAAwC;AACjD,SAAO,KAAK,QAAQ,gCAAgC;;;;;CAMtD,IAAW,oBAA4B;AACrC,SAAO,KAAK,QAAQ,WAAW,SAAS;;;;;CAM1C,IAAW,qCAA6C;AACtD,SAAO,KAAK,QAAQ,WAAW,0BAA0B;;;;;CAM3D,IAAW,8BAAsC;AAC/C,SAAO,KAAK,QAAQ,WAAW,mBAAmB;;;;;CAMpD,IAAW,yBAAiC;AAC1C,SAAO,KAAK,QAAQ,WAAW,cAAc;;;;;CAM/C,IAAW,iCAAyC;AAClD,SAAO,KAAK,QAAQ,WAAW,sBAAsB;;;;;CAMvD,IAAW,0BAAkC;AAC3C,SAAO,KAAK,QAAQ,WAAW,eAAe;;;;;CAMhD,IAAW,mBAA2B;AACpC,SAAO,KAAK,QAAQ,WAAW,QAAQ"}