@eudiplo/sdk-core 1.14.0-main.07a91c4

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.
@@ -0,0 +1,299 @@
1
+ import { S as Session } from './client.gen-CU56lLgT.mjs';
2
+ export { A as AllowListPolicy, a as ApiKeyConfig, b as AppControllerMainData, c as AppControllerMainResponses, d as AttestationBasedPolicy, e as AuthControllerGetGlobalJwksData, f as AuthControllerGetGlobalJwksResponses, g as AuthControllerGetOAuth2TokenData, h as AuthControllerGetOAuth2TokenErrors, i as AuthControllerGetOAuth2TokenResponse, j as AuthControllerGetOAuth2TokenResponses, k as AuthControllerGetOidcDiscoveryData, l as AuthControllerGetOidcDiscoveryResponses, m as AuthenticationMethodAuth, n as AuthenticationMethodNone, o as AuthenticationMethodPresentation, p as AuthenticationUrlConfig, q as AuthorizationResponse, r as AuthorizeControllerAuthorizationChallengeEndpointData, s as AuthorizeControllerAuthorizationChallengeEndpointResponses, t as AuthorizeControllerAuthorizeData, u as AuthorizeControllerAuthorizeResponses, v as AuthorizeControllerParData, w as AuthorizeControllerParResponse, x as AuthorizeControllerParResponses, y as AuthorizeControllerTokenData, z as AuthorizeControllerTokenResponse, B as AuthorizeControllerTokenResponses, C as AuthorizeQueries, D as CertControllerAddCertificateData, E as CertControllerAddCertificateResponse, F as CertControllerAddCertificateResponses, G as CertControllerDeleteCertificateData, H as CertControllerDeleteCertificateResponses, I as CertControllerExportConfigData, J as CertControllerExportConfigResponse, K as CertControllerExportConfigResponses, L as CertControllerGetCertificateData, M as CertControllerGetCertificateResponse, N as CertControllerGetCertificateResponses, O as CertControllerGetCertificatesData, P as CertControllerGetCertificatesResponse, Q as CertControllerGetCertificatesResponses, R as CertControllerUpdateCertificateData, T as CertControllerUpdateCertificateResponses, U as CertEntity, V as CertImportDto, W as CertResponseDto, X as CertUpdateDto, Y as CertUsageEntity, Z as Claim, _ as ClaimsQuery, $ as ClientControllerCreateClientData, a0 as ClientControllerCreateClientResponse, a1 as ClientControllerCreateClientResponses, a2 as ClientControllerDeleteClientData, a3 as ClientControllerDeleteClientResponses, a4 as ClientControllerGetClientData, a5 as ClientControllerGetClientResponse, a6 as ClientControllerGetClientResponses, a7 as ClientControllerGetClientSecretData, a8 as ClientControllerGetClientSecretResponse, a9 as ClientControllerGetClientSecretResponses, aa as ClientControllerGetClientsData, ab as ClientControllerGetClientsResponse, ac as ClientControllerGetClientsResponses, ad as ClientControllerUpdateClientData, ae as ClientControllerUpdateClientResponse, af as ClientControllerUpdateClientResponses, ag as ClientCredentialsDto, ah as ClientEntity, ai as ClientOptions, aj as ClientSecretResponseDto, ak as CreateClientDto, al as CreateStatusListDto, am as CreateTenantDto, an as CredentialConfig, ao as CredentialConfigControllerDeleteIssuanceConfigurationData, ap as CredentialConfigControllerDeleteIssuanceConfigurationResponses, aq as CredentialConfigControllerGetConfigByIdData, ar as CredentialConfigControllerGetConfigByIdResponse, as as CredentialConfigControllerGetConfigByIdResponses, at as CredentialConfigControllerGetConfigsData, au as CredentialConfigControllerGetConfigsResponse, av as CredentialConfigControllerGetConfigsResponses, aw as CredentialConfigControllerStoreCredentialConfigurationData, ax as CredentialConfigControllerStoreCredentialConfigurationResponse, ay as CredentialConfigControllerStoreCredentialConfigurationResponses, az as CredentialConfigControllerUpdateCredentialConfigurationData, aA as CredentialConfigControllerUpdateCredentialConfigurationResponse, aB as CredentialConfigControllerUpdateCredentialConfigurationResponses, aC as CredentialConfigCreate, aD as CredentialConfigUpdate, aE as CredentialOfferControllerGetOfferData, aF as CredentialOfferControllerGetOfferResponse, aG as CredentialOfferControllerGetOfferResponses, aH as CredentialQuery, aI as CredentialSetQuery, aJ as Dcql, aK as Display, aL as DisplayImage, aM as DisplayInfo, aN as DisplayLogo, aO as EcPublic, aP as EmbeddedDisclosurePolicy, aQ as FileUploadDto, aR as HealthControllerCheckData, aS as HealthControllerCheckError, aT as HealthControllerCheckErrors, aU as HealthControllerCheckResponse, aV as HealthControllerCheckResponses, aW as ImportTenantDto, aX as IssuanceConfig, aY as IssuanceConfigControllerGetIssuanceConfigurationsData, aZ as IssuanceConfigControllerGetIssuanceConfigurationsResponse, a_ as IssuanceConfigControllerGetIssuanceConfigurationsResponses, a$ as IssuanceConfigControllerStoreIssuanceConfigurationData, b0 as IssuanceConfigControllerStoreIssuanceConfigurationResponse, b1 as IssuanceConfigControllerStoreIssuanceConfigurationResponses, b2 as IssuanceDto, b3 as IssuerMetadataCredentialConfig, b4 as JwksResponseDto, b5 as Key, b6 as KeyControllerAddKeyData, b7 as KeyControllerAddKeyResponses, b8 as KeyControllerDeleteKeyData, b9 as KeyControllerDeleteKeyResponses, ba as KeyControllerGetKeyData, bb as KeyControllerGetKeyResponse, bc as KeyControllerGetKeyResponses, bd as KeyControllerGetKeysData, be as KeyControllerGetKeysResponse, bf as KeyControllerGetKeysResponses, bg as KeyControllerUpdateKeyData, bh as KeyControllerUpdateKeyResponses, bi as KeyEntity, bj as KeyImportDto, bk as NoneTrustPolicy, bl as NotificationRequestDto, bm as OfferRequestDto, bn as OfferResponse, bo as Oid4VciControllerCredentialData, bp as Oid4VciControllerCredentialResponses, bq as Oid4VciControllerNonceData, br as Oid4VciControllerNonceResponses, bs as Oid4VciControllerNotificationsData, bt as Oid4VciControllerNotificationsResponses, bu as Oid4VciMetadataControllerVctData, bv as Oid4VciMetadataControllerVctResponse, bw as Oid4VciMetadataControllerVctResponses, bx as Oid4VpControllerGetPostRequestWithSessionData, by as Oid4VpControllerGetPostRequestWithSessionResponse, bz as Oid4VpControllerGetPostRequestWithSessionResponses, bA as Oid4VpControllerGetRequestWithSessionData, bB as Oid4VpControllerGetRequestWithSessionResponse, bC as Oid4VpControllerGetRequestWithSessionResponses, bD as Oid4VpControllerGetResponseData, bE as Oid4VpControllerGetResponseResponse, bF as Oid4VpControllerGetResponseResponses, bG as ParResponseDto, bH as PolicyCredential, bI as PresentationAttachment, bJ as PresentationConfig, bK as PresentationConfigCreateDto, bL as PresentationConfigUpdateDto, bM as PresentationDuringIssuanceConfig, bN as PresentationManagementControllerConfigurationData, bO as PresentationManagementControllerConfigurationResponse, bP as PresentationManagementControllerConfigurationResponses, bQ as PresentationManagementControllerDeleteConfigurationData, bR as PresentationManagementControllerDeleteConfigurationResponses, bS as PresentationManagementControllerGetConfigurationData, bT as PresentationManagementControllerGetConfigurationResponse, bU as PresentationManagementControllerGetConfigurationResponses, bV as PresentationManagementControllerStorePresentationConfigData, bW as PresentationManagementControllerStorePresentationConfigResponse, bX as PresentationManagementControllerStorePresentationConfigResponses, bY as PresentationManagementControllerUpdateConfigurationData, bZ as PresentationManagementControllerUpdateConfigurationResponse, b_ as PresentationManagementControllerUpdateConfigurationResponses, b$ as PresentationRequest, c0 as PrometheusControllerIndexData, c1 as PrometheusControllerIndexResponses, c2 as RegistrationCertificateRequest, c3 as RoleDto, c4 as RootOfTrustPolicy, c5 as SchemaResponse, c6 as SessionConfigControllerGetConfigData, c7 as SessionConfigControllerGetConfigResponse, c8 as SessionConfigControllerGetConfigResponses, c9 as SessionConfigControllerResetConfigData, ca as SessionConfigControllerResetConfigResponses, cb as SessionConfigControllerUpdateConfigData, cc as SessionConfigControllerUpdateConfigResponse, cd as SessionConfigControllerUpdateConfigResponses, ce as SessionControllerDeleteSessionData, cf as SessionControllerDeleteSessionResponses, cg as SessionControllerGetAllSessionsData, ch as SessionControllerGetAllSessionsResponse, ci as SessionControllerGetAllSessionsResponses, cj as SessionControllerGetSessionData, ck as SessionControllerGetSessionResponse, cl as SessionControllerGetSessionResponses, cm as SessionControllerRevokeAllData, cn as SessionControllerRevokeAllResponses, co as SessionStorageConfig, cp as StatusListAggregationDto, cq as StatusListConfig, cr as StatusListConfigControllerGetConfigData, cs as StatusListConfigControllerGetConfigResponse, ct as StatusListConfigControllerGetConfigResponses, cu as StatusListConfigControllerResetConfigData, cv as StatusListConfigControllerResetConfigResponse, cw as StatusListConfigControllerResetConfigResponses, cx as StatusListConfigControllerUpdateConfigData, cy as StatusListConfigControllerUpdateConfigResponse, cz as StatusListConfigControllerUpdateConfigResponses, cA as StatusListControllerGetListData, cB as StatusListControllerGetListResponse, cC as StatusListControllerGetListResponses, cD as StatusListControllerGetStatusListAggregationData, cE as StatusListControllerGetStatusListAggregationResponse, cF as StatusListControllerGetStatusListAggregationResponses, cG as StatusListImportDto, cH as StatusListManagementControllerCreateListData, cI as StatusListManagementControllerCreateListResponse, cJ as StatusListManagementControllerCreateListResponses, cK as StatusListManagementControllerDeleteListData, cL as StatusListManagementControllerDeleteListResponse, cM as StatusListManagementControllerDeleteListResponses, cN as StatusListManagementControllerGetListData, cO as StatusListManagementControllerGetListResponse, cP as StatusListManagementControllerGetListResponses, cQ as StatusListManagementControllerGetListsData, cR as StatusListManagementControllerGetListsResponse, cS as StatusListManagementControllerGetListsResponses, cT as StatusListManagementControllerUpdateListData, cU as StatusListManagementControllerUpdateListResponse, cV as StatusListManagementControllerUpdateListResponses, cW as StatusListResponseDto, cX as StatusUpdateDto, cY as StorageControllerDownloadData, cZ as StorageControllerDownloadResponses, c_ as StorageControllerUploadData, c$ as StorageControllerUploadResponse, d0 as StorageControllerUploadResponses, d1 as TenantControllerDeleteTenantData, d2 as TenantControllerDeleteTenantResponses, d3 as TenantControllerGetTenantData, d4 as TenantControllerGetTenantResponse, d5 as TenantControllerGetTenantResponses, d6 as TenantControllerGetTenantsData, d7 as TenantControllerGetTenantsResponse, d8 as TenantControllerGetTenantsResponses, d9 as TenantControllerInitTenantData, da as TenantControllerInitTenantResponses, db as TenantControllerUpdateTenantData, dc as TenantControllerUpdateTenantResponse, dd as TenantControllerUpdateTenantResponses, de as TenantEntity, df as TokenResponse, dg as TrustList, dh as TrustListControllerCreateTrustListData, di as TrustListControllerCreateTrustListResponse, dj as TrustListControllerCreateTrustListResponses, dk as TrustListControllerDeleteTrustListData, dl as TrustListControllerDeleteTrustListResponses, dm as TrustListControllerExportTrustListData, dn as TrustListControllerExportTrustListResponse, dp as TrustListControllerExportTrustListResponses, dq as TrustListControllerGetAllTrustListsData, dr as TrustListControllerGetAllTrustListsResponse, ds as TrustListControllerGetAllTrustListsResponses, dt as TrustListControllerGetTrustListData, du as TrustListControllerGetTrustListResponse, dv as TrustListControllerGetTrustListResponses, dw as TrustListControllerGetTrustListVersionData, dx as TrustListControllerGetTrustListVersionResponse, dy as TrustListControllerGetTrustListVersionResponses, dz as TrustListControllerGetTrustListVersionsData, dA as TrustListControllerGetTrustListVersionsResponse, dB as TrustListControllerGetTrustListVersionsResponses, dC as TrustListControllerUpdateTrustListData, dD as TrustListControllerUpdateTrustListResponse, dE as TrustListControllerUpdateTrustListResponses, dF as TrustListCreateDto, dG as TrustListPublicControllerGetTrustListJwtData, dH as TrustListPublicControllerGetTrustListJwtResponse, dI as TrustListPublicControllerGetTrustListJwtResponses, dJ as TrustListVersion, dK as TrustedAuthorityQuery, dL as UpdateClientDto, dM as UpdateKeyDto, dN as UpdateSessionConfigDto, dO as UpdateStatusListConfigDto, dP as UpdateStatusListDto, dQ as UpdateTenantDto, dR as Vct, dS as VerifierOfferControllerGetOfferData, dT as VerifierOfferControllerGetOfferResponse, dU as VerifierOfferControllerGetOfferResponses, dV as WebHookAuthConfigHeader, dW as WebHookAuthConfigNone, dX as WebhookConfig, dY as WellKnownControllerAuthzMetadata0Data, dZ as WellKnownControllerAuthzMetadata0Responses, d_ as WellKnownControllerAuthzMetadata1Data, d$ as WellKnownControllerAuthzMetadata1Responses, e0 as WellKnownControllerGetJwks0Data, e1 as WellKnownControllerGetJwks0Response, e2 as WellKnownControllerGetJwks0Responses, e3 as WellKnownControllerGetJwks1Data, e4 as WellKnownControllerGetJwks1Response, e5 as WellKnownControllerGetJwks1Responses, e6 as WellKnownControllerIssuerMetadata0Data, e7 as WellKnownControllerIssuerMetadata0Response, e8 as WellKnownControllerIssuerMetadata0Responses, e9 as WellKnownControllerIssuerMetadata1Data, ea as WellKnownControllerIssuerMetadata1Response, eb as WellKnownControllerIssuerMetadata1Responses, ec as client } from './client.gen-CU56lLgT.mjs';
3
+ export { Options, appControllerMain, authControllerGetGlobalJwks, authControllerGetOAuth2Token, authControllerGetOidcDiscovery, authorizeControllerAuthorizationChallengeEndpoint, authorizeControllerAuthorize, authorizeControllerPar, authorizeControllerToken, certControllerAddCertificate, certControllerDeleteCertificate, certControllerExportConfig, certControllerGetCertificate, certControllerGetCertificates, certControllerUpdateCertificate, clientControllerCreateClient, clientControllerDeleteClient, clientControllerGetClient, clientControllerGetClientSecret, clientControllerGetClients, clientControllerUpdateClient, credentialConfigControllerDeleteIssuanceConfiguration, credentialConfigControllerGetConfigById, credentialConfigControllerGetConfigs, credentialConfigControllerStoreCredentialConfiguration, credentialConfigControllerUpdateCredentialConfiguration, credentialOfferControllerGetOffer, healthControllerCheck, issuanceConfigControllerGetIssuanceConfigurations, issuanceConfigControllerStoreIssuanceConfiguration, keyControllerAddKey, keyControllerDeleteKey, keyControllerGetKey, keyControllerGetKeys, keyControllerUpdateKey, oid4VciControllerCredential, oid4VciControllerNonce, oid4VciControllerNotifications, oid4VciMetadataControllerVct, oid4VpControllerGetPostRequestWithSession, oid4VpControllerGetRequestWithSession, oid4VpControllerGetResponse, presentationManagementControllerConfiguration, presentationManagementControllerDeleteConfiguration, presentationManagementControllerGetConfiguration, presentationManagementControllerStorePresentationConfig, presentationManagementControllerUpdateConfiguration, prometheusControllerIndex, sessionConfigControllerGetConfig, sessionConfigControllerResetConfig, sessionConfigControllerUpdateConfig, sessionControllerDeleteSession, sessionControllerGetAllSessions, sessionControllerGetSession, sessionControllerRevokeAll, statusListConfigControllerGetConfig, statusListConfigControllerResetConfig, statusListConfigControllerUpdateConfig, statusListControllerGetList, statusListControllerGetStatusListAggregation, statusListManagementControllerCreateList, statusListManagementControllerDeleteList, statusListManagementControllerGetList, statusListManagementControllerGetLists, statusListManagementControllerUpdateList, storageControllerDownload, storageControllerUpload, tenantControllerDeleteTenant, tenantControllerGetTenant, tenantControllerGetTenants, tenantControllerInitTenant, tenantControllerUpdateTenant, trustListControllerCreateTrustList, trustListControllerDeleteTrustList, trustListControllerExportTrustList, trustListControllerGetAllTrustLists, trustListControllerGetTrustList, trustListControllerGetTrustListVersion, trustListControllerGetTrustListVersions, trustListControllerUpdateTrustList, trustListPublicControllerGetTrustListJwt, verifierOfferControllerGetOffer, wellKnownControllerAuthzMetadata0, wellKnownControllerAuthzMetadata1, wellKnownControllerGetJwks0, wellKnownControllerGetJwks1, wellKnownControllerIssuerMetadata0, wellKnownControllerIssuerMetadata1 } from './api/index.mjs';
4
+ import './types.gen-CIiveH8G.mjs';
5
+
6
+ /**
7
+ * Configuration options for the EudiploClient
8
+ */
9
+ interface EudiploClientConfig {
10
+ /** Base URL of the EUDIPLO server (e.g., 'https://eudiplo.example.com') */
11
+ baseUrl: string;
12
+ /** OAuth2 client ID */
13
+ clientId: string;
14
+ /** OAuth2 client secret */
15
+ clientSecret: string;
16
+ /** Optional: Auto-refresh token before expiry (default: true) */
17
+ autoRefresh?: boolean;
18
+ /** Optional: Custom fetch implementation (useful for Cloudflare Workers) */
19
+ fetch?: typeof fetch;
20
+ }
21
+ /**
22
+ * Options for session polling
23
+ */
24
+ interface SessionPollingOptions {
25
+ /** Polling interval in milliseconds (default: 1000) */
26
+ interval?: number;
27
+ /** Maximum time to wait in milliseconds (default: 300000 = 5 minutes) */
28
+ timeout?: number;
29
+ /** Callback on each poll */
30
+ onUpdate?: (session: Session) => void;
31
+ /** AbortSignal to cancel polling */
32
+ signal?: AbortSignal;
33
+ }
34
+ /**
35
+ * Simplified options for creating an issuance offer
36
+ */
37
+ interface IssuanceOfferOptions {
38
+ /** Credential configuration IDs to issue */
39
+ credentialConfigurationIds: string[];
40
+ /** Claims to include in the credentials (keyed by config ID) */
41
+ claims?: Record<string, Record<string, unknown>>;
42
+ /** Response type: 'qrcode' returns a data URL, 'uri' returns the offer URI */
43
+ responseType?: 'qrcode' | 'uri' | 'dc-api';
44
+ /** Transaction code for pre-authorized flow */
45
+ txCode?: string;
46
+ /** Flow type (default: 'pre_authorized_code') */
47
+ flow?: 'authorization_code' | 'pre_authorized_code';
48
+ }
49
+ /**
50
+ * Simplified options for creating a presentation request
51
+ */
52
+ interface PresentationRequestOptions {
53
+ /** ID of the presentation configuration */
54
+ configId: string;
55
+ /** Response type: 'qrcode' returns a data URL, 'uri' returns the request URI */
56
+ responseType?: 'qrcode' | 'uri' | 'dc-api';
57
+ /** Optional redirect URI after presentation completes */
58
+ redirectUri?: string;
59
+ }
60
+ /**
61
+ * Result of creating an offer or request
62
+ */
63
+ interface OfferResult {
64
+ /** The URI to encode in a QR code or use directly */
65
+ uri: string;
66
+ /** Session ID for polling */
67
+ sessionId: string;
68
+ }
69
+ /**
70
+ * Framework-agnostic EUDIPLO client for demos and integrations.
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * import { EudiploClient } from '@eudiplo/sdk-core';
75
+ *
76
+ * const client = new EudiploClient({
77
+ * baseUrl: 'https://eudiplo.example.com',
78
+ * clientId: 'my-demo',
79
+ * clientSecret: 'secret123'
80
+ * });
81
+ *
82
+ * // Create a presentation request for age verification
83
+ * const { uri, sessionId } = await client.createPresentationRequest({
84
+ * configId: 'age-over-18'
85
+ * });
86
+ *
87
+ * // Display QR code with `uri`, then wait for completion
88
+ * const session = await client.waitForSession(sessionId);
89
+ * console.log('Verified:', session.credentials);
90
+ * ```
91
+ */
92
+ declare class EudiploClient {
93
+ private config;
94
+ private accessToken?;
95
+ private tokenExpiresAt?;
96
+ private refreshPromise?;
97
+ constructor(config: EudiploClientConfig);
98
+ /**
99
+ * Authenticate and obtain an access token.
100
+ * Called automatically by other methods, but can be called explicitly.
101
+ */
102
+ authenticate(): Promise<void>;
103
+ private _doAuthenticate;
104
+ /**
105
+ * Ensure we have a valid access token, refreshing if necessary.
106
+ */
107
+ private ensureAuthenticated;
108
+ /**
109
+ * Create a credential issuance offer.
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * const { uri, sessionId } = await client.createIssuanceOffer({
114
+ * credentialConfigurationIds: ['PID'],
115
+ * claims: {
116
+ * PID: { given_name: 'John', family_name: 'Doe' }
117
+ * }
118
+ * });
119
+ * ```
120
+ */
121
+ createIssuanceOffer(options: IssuanceOfferOptions): Promise<OfferResult>;
122
+ /**
123
+ * Create a presentation request (for verification).
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * // Age verification
128
+ * const { uri, sessionId } = await client.createPresentationRequest({
129
+ * configId: 'age-over-18'
130
+ * });
131
+ *
132
+ * // Show QR code, wait for wallet to respond
133
+ * const session = await client.waitForSession(sessionId);
134
+ * ```
135
+ */
136
+ createPresentationRequest(options: PresentationRequestOptions): Promise<OfferResult>;
137
+ /**
138
+ * Get the current status of a session.
139
+ */
140
+ getSession(sessionId: string): Promise<Session>;
141
+ /**
142
+ * Wait for a session to complete (polling).
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * const session = await client.waitForSession(sessionId, {
147
+ * interval: 1000,
148
+ * timeout: 60000,
149
+ * onUpdate: (s) => console.log('Status:', s.status)
150
+ * });
151
+ * ```
152
+ */
153
+ waitForSession(sessionId: string, options?: SessionPollingOptions): Promise<Session>;
154
+ /**
155
+ * Helper to sleep with abort support
156
+ */
157
+ private sleep;
158
+ /**
159
+ * Get the current access token (for advanced usage)
160
+ */
161
+ getAccessToken(): string | undefined;
162
+ /**
163
+ * Get the configured base URL
164
+ */
165
+ getBaseUrl(): string;
166
+ }
167
+ /**
168
+ * Credentials for EUDIPLO authentication
169
+ */
170
+ interface EudiploCredentials {
171
+ baseUrl: string;
172
+ clientId: string;
173
+ clientSecret: string;
174
+ }
175
+ /**
176
+ * Options for the verify function
177
+ */
178
+ interface VerifyOptions extends EudiploCredentials {
179
+ /** Presentation configuration ID */
180
+ configId: string;
181
+ /** Optional redirect URI */
182
+ redirectUri?: string;
183
+ /** Polling options */
184
+ polling?: SessionPollingOptions;
185
+ }
186
+ /**
187
+ * Options for the issue function
188
+ */
189
+ interface IssueOptions extends EudiploCredentials {
190
+ /** Credential configuration IDs */
191
+ credentialConfigurationIds: string[];
192
+ /** Claims per credential config */
193
+ claims?: Record<string, Record<string, unknown>>;
194
+ /** Transaction code (optional) */
195
+ txCode?: string;
196
+ /** Polling options */
197
+ polling?: SessionPollingOptions;
198
+ }
199
+ /**
200
+ * Result of a verification or issuance flow
201
+ */
202
+ interface FlowResult {
203
+ /** URI for QR code */
204
+ uri: string;
205
+ /** Session ID */
206
+ sessionId: string;
207
+ /** Wait for the session to complete */
208
+ waitForCompletion: (options?: SessionPollingOptions) => Promise<Session>;
209
+ /** Get current session status */
210
+ getStatus: () => Promise<Session>;
211
+ }
212
+ /**
213
+ * Create a presentation request for verification.
214
+ * Returns a URI for QR code and a function to wait for completion.
215
+ *
216
+ * @example
217
+ * ```typescript
218
+ * import { verify } from '@eudiplo/sdk-core';
219
+ *
220
+ * const { uri, waitForCompletion } = await verify({
221
+ * baseUrl: 'https://eudiplo.example.com',
222
+ * clientId: 'demo',
223
+ * clientSecret: 'secret',
224
+ * configId: 'age-over-18'
225
+ * });
226
+ *
227
+ * console.log('Scan this:', uri);
228
+ * const session = await waitForCompletion();
229
+ * console.log('Verified!', session.credentials);
230
+ * ```
231
+ */
232
+ declare function verify(options: VerifyOptions): Promise<FlowResult>;
233
+ /**
234
+ * Create a credential issuance offer.
235
+ * Returns a URI for QR code and a function to wait for completion.
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * import { issue } from '@eudiplo/sdk-core';
240
+ *
241
+ * const { uri, waitForCompletion } = await issue({
242
+ * baseUrl: 'https://eudiplo.example.com',
243
+ * clientId: 'demo',
244
+ * clientSecret: 'secret',
245
+ * credentialConfigurationIds: ['PID'],
246
+ * claims: {
247
+ * PID: { given_name: 'John', family_name: 'Doe' }
248
+ * }
249
+ * });
250
+ *
251
+ * console.log('Scan this:', uri);
252
+ * const session = await waitForCompletion();
253
+ * ```
254
+ */
255
+ declare function issue(options: IssueOptions): Promise<FlowResult>;
256
+ /**
257
+ * One-liner: Verify and wait for result in a single call.
258
+ *
259
+ * @example
260
+ * ```typescript
261
+ * import { verifyAndWait } from '@eudiplo/sdk-core';
262
+ *
263
+ * const session = await verifyAndWait({
264
+ * baseUrl: 'https://eudiplo.example.com',
265
+ * clientId: 'demo',
266
+ * clientSecret: 'secret',
267
+ * configId: 'age-over-18',
268
+ * onUri: (uri) => showQRCode(uri),
269
+ * onUpdate: (s) => console.log('Status:', s.status)
270
+ * });
271
+ * ```
272
+ */
273
+ declare function verifyAndWait(options: VerifyOptions & {
274
+ /** Called with the URI when available - use to display QR code */
275
+ onUri: (uri: string) => void;
276
+ }): Promise<Session>;
277
+ /**
278
+ * One-liner: Issue credential and wait for completion in a single call.
279
+ *
280
+ * @example
281
+ * ```typescript
282
+ * import { issueAndWait } from '@eudiplo/sdk-core';
283
+ *
284
+ * const session = await issueAndWait({
285
+ * baseUrl: 'https://eudiplo.example.com',
286
+ * clientId: 'demo',
287
+ * clientSecret: 'secret',
288
+ * credentialConfigurationIds: ['PID'],
289
+ * claims: { PID: { given_name: 'John' } },
290
+ * onUri: (uri) => showQRCode(uri)
291
+ * });
292
+ * ```
293
+ */
294
+ declare function issueAndWait(options: IssueOptions & {
295
+ /** Called with the URI when available - use to display QR code */
296
+ onUri: (uri: string) => void;
297
+ }): Promise<Session>;
298
+
299
+ export { EudiploClient, type EudiploClientConfig, type EudiploCredentials, type FlowResult, type IssuanceOfferOptions, type IssueOptions, type OfferResult, type PresentationRequestOptions, Session, type SessionPollingOptions, type VerifyOptions, issue, issueAndWait, verify, verifyAndWait };
@@ -0,0 +1,299 @@
1
+ import { S as Session } from './client.gen-CsfHl8pY.js';
2
+ export { A as AllowListPolicy, a as ApiKeyConfig, b as AppControllerMainData, c as AppControllerMainResponses, d as AttestationBasedPolicy, e as AuthControllerGetGlobalJwksData, f as AuthControllerGetGlobalJwksResponses, g as AuthControllerGetOAuth2TokenData, h as AuthControllerGetOAuth2TokenErrors, i as AuthControllerGetOAuth2TokenResponse, j as AuthControllerGetOAuth2TokenResponses, k as AuthControllerGetOidcDiscoveryData, l as AuthControllerGetOidcDiscoveryResponses, m as AuthenticationMethodAuth, n as AuthenticationMethodNone, o as AuthenticationMethodPresentation, p as AuthenticationUrlConfig, q as AuthorizationResponse, r as AuthorizeControllerAuthorizationChallengeEndpointData, s as AuthorizeControllerAuthorizationChallengeEndpointResponses, t as AuthorizeControllerAuthorizeData, u as AuthorizeControllerAuthorizeResponses, v as AuthorizeControllerParData, w as AuthorizeControllerParResponse, x as AuthorizeControllerParResponses, y as AuthorizeControllerTokenData, z as AuthorizeControllerTokenResponse, B as AuthorizeControllerTokenResponses, C as AuthorizeQueries, D as CertControllerAddCertificateData, E as CertControllerAddCertificateResponse, F as CertControllerAddCertificateResponses, G as CertControllerDeleteCertificateData, H as CertControllerDeleteCertificateResponses, I as CertControllerExportConfigData, J as CertControllerExportConfigResponse, K as CertControllerExportConfigResponses, L as CertControllerGetCertificateData, M as CertControllerGetCertificateResponse, N as CertControllerGetCertificateResponses, O as CertControllerGetCertificatesData, P as CertControllerGetCertificatesResponse, Q as CertControllerGetCertificatesResponses, R as CertControllerUpdateCertificateData, T as CertControllerUpdateCertificateResponses, U as CertEntity, V as CertImportDto, W as CertResponseDto, X as CertUpdateDto, Y as CertUsageEntity, Z as Claim, _ as ClaimsQuery, $ as ClientControllerCreateClientData, a0 as ClientControllerCreateClientResponse, a1 as ClientControllerCreateClientResponses, a2 as ClientControllerDeleteClientData, a3 as ClientControllerDeleteClientResponses, a4 as ClientControllerGetClientData, a5 as ClientControllerGetClientResponse, a6 as ClientControllerGetClientResponses, a7 as ClientControllerGetClientSecretData, a8 as ClientControllerGetClientSecretResponse, a9 as ClientControllerGetClientSecretResponses, aa as ClientControllerGetClientsData, ab as ClientControllerGetClientsResponse, ac as ClientControllerGetClientsResponses, ad as ClientControllerUpdateClientData, ae as ClientControllerUpdateClientResponse, af as ClientControllerUpdateClientResponses, ag as ClientCredentialsDto, ah as ClientEntity, ai as ClientOptions, aj as ClientSecretResponseDto, ak as CreateClientDto, al as CreateStatusListDto, am as CreateTenantDto, an as CredentialConfig, ao as CredentialConfigControllerDeleteIssuanceConfigurationData, ap as CredentialConfigControllerDeleteIssuanceConfigurationResponses, aq as CredentialConfigControllerGetConfigByIdData, ar as CredentialConfigControllerGetConfigByIdResponse, as as CredentialConfigControllerGetConfigByIdResponses, at as CredentialConfigControllerGetConfigsData, au as CredentialConfigControllerGetConfigsResponse, av as CredentialConfigControllerGetConfigsResponses, aw as CredentialConfigControllerStoreCredentialConfigurationData, ax as CredentialConfigControllerStoreCredentialConfigurationResponse, ay as CredentialConfigControllerStoreCredentialConfigurationResponses, az as CredentialConfigControllerUpdateCredentialConfigurationData, aA as CredentialConfigControllerUpdateCredentialConfigurationResponse, aB as CredentialConfigControllerUpdateCredentialConfigurationResponses, aC as CredentialConfigCreate, aD as CredentialConfigUpdate, aE as CredentialOfferControllerGetOfferData, aF as CredentialOfferControllerGetOfferResponse, aG as CredentialOfferControllerGetOfferResponses, aH as CredentialQuery, aI as CredentialSetQuery, aJ as Dcql, aK as Display, aL as DisplayImage, aM as DisplayInfo, aN as DisplayLogo, aO as EcPublic, aP as EmbeddedDisclosurePolicy, aQ as FileUploadDto, aR as HealthControllerCheckData, aS as HealthControllerCheckError, aT as HealthControllerCheckErrors, aU as HealthControllerCheckResponse, aV as HealthControllerCheckResponses, aW as ImportTenantDto, aX as IssuanceConfig, aY as IssuanceConfigControllerGetIssuanceConfigurationsData, aZ as IssuanceConfigControllerGetIssuanceConfigurationsResponse, a_ as IssuanceConfigControllerGetIssuanceConfigurationsResponses, a$ as IssuanceConfigControllerStoreIssuanceConfigurationData, b0 as IssuanceConfigControllerStoreIssuanceConfigurationResponse, b1 as IssuanceConfigControllerStoreIssuanceConfigurationResponses, b2 as IssuanceDto, b3 as IssuerMetadataCredentialConfig, b4 as JwksResponseDto, b5 as Key, b6 as KeyControllerAddKeyData, b7 as KeyControllerAddKeyResponses, b8 as KeyControllerDeleteKeyData, b9 as KeyControllerDeleteKeyResponses, ba as KeyControllerGetKeyData, bb as KeyControllerGetKeyResponse, bc as KeyControllerGetKeyResponses, bd as KeyControllerGetKeysData, be as KeyControllerGetKeysResponse, bf as KeyControllerGetKeysResponses, bg as KeyControllerUpdateKeyData, bh as KeyControllerUpdateKeyResponses, bi as KeyEntity, bj as KeyImportDto, bk as NoneTrustPolicy, bl as NotificationRequestDto, bm as OfferRequestDto, bn as OfferResponse, bo as Oid4VciControllerCredentialData, bp as Oid4VciControllerCredentialResponses, bq as Oid4VciControllerNonceData, br as Oid4VciControllerNonceResponses, bs as Oid4VciControllerNotificationsData, bt as Oid4VciControllerNotificationsResponses, bu as Oid4VciMetadataControllerVctData, bv as Oid4VciMetadataControllerVctResponse, bw as Oid4VciMetadataControllerVctResponses, bx as Oid4VpControllerGetPostRequestWithSessionData, by as Oid4VpControllerGetPostRequestWithSessionResponse, bz as Oid4VpControllerGetPostRequestWithSessionResponses, bA as Oid4VpControllerGetRequestWithSessionData, bB as Oid4VpControllerGetRequestWithSessionResponse, bC as Oid4VpControllerGetRequestWithSessionResponses, bD as Oid4VpControllerGetResponseData, bE as Oid4VpControllerGetResponseResponse, bF as Oid4VpControllerGetResponseResponses, bG as ParResponseDto, bH as PolicyCredential, bI as PresentationAttachment, bJ as PresentationConfig, bK as PresentationConfigCreateDto, bL as PresentationConfigUpdateDto, bM as PresentationDuringIssuanceConfig, bN as PresentationManagementControllerConfigurationData, bO as PresentationManagementControllerConfigurationResponse, bP as PresentationManagementControllerConfigurationResponses, bQ as PresentationManagementControllerDeleteConfigurationData, bR as PresentationManagementControllerDeleteConfigurationResponses, bS as PresentationManagementControllerGetConfigurationData, bT as PresentationManagementControllerGetConfigurationResponse, bU as PresentationManagementControllerGetConfigurationResponses, bV as PresentationManagementControllerStorePresentationConfigData, bW as PresentationManagementControllerStorePresentationConfigResponse, bX as PresentationManagementControllerStorePresentationConfigResponses, bY as PresentationManagementControllerUpdateConfigurationData, bZ as PresentationManagementControllerUpdateConfigurationResponse, b_ as PresentationManagementControllerUpdateConfigurationResponses, b$ as PresentationRequest, c0 as PrometheusControllerIndexData, c1 as PrometheusControllerIndexResponses, c2 as RegistrationCertificateRequest, c3 as RoleDto, c4 as RootOfTrustPolicy, c5 as SchemaResponse, c6 as SessionConfigControllerGetConfigData, c7 as SessionConfigControllerGetConfigResponse, c8 as SessionConfigControllerGetConfigResponses, c9 as SessionConfigControllerResetConfigData, ca as SessionConfigControllerResetConfigResponses, cb as SessionConfigControllerUpdateConfigData, cc as SessionConfigControllerUpdateConfigResponse, cd as SessionConfigControllerUpdateConfigResponses, ce as SessionControllerDeleteSessionData, cf as SessionControllerDeleteSessionResponses, cg as SessionControllerGetAllSessionsData, ch as SessionControllerGetAllSessionsResponse, ci as SessionControllerGetAllSessionsResponses, cj as SessionControllerGetSessionData, ck as SessionControllerGetSessionResponse, cl as SessionControllerGetSessionResponses, cm as SessionControllerRevokeAllData, cn as SessionControllerRevokeAllResponses, co as SessionStorageConfig, cp as StatusListAggregationDto, cq as StatusListConfig, cr as StatusListConfigControllerGetConfigData, cs as StatusListConfigControllerGetConfigResponse, ct as StatusListConfigControllerGetConfigResponses, cu as StatusListConfigControllerResetConfigData, cv as StatusListConfigControllerResetConfigResponse, cw as StatusListConfigControllerResetConfigResponses, cx as StatusListConfigControllerUpdateConfigData, cy as StatusListConfigControllerUpdateConfigResponse, cz as StatusListConfigControllerUpdateConfigResponses, cA as StatusListControllerGetListData, cB as StatusListControllerGetListResponse, cC as StatusListControllerGetListResponses, cD as StatusListControllerGetStatusListAggregationData, cE as StatusListControllerGetStatusListAggregationResponse, cF as StatusListControllerGetStatusListAggregationResponses, cG as StatusListImportDto, cH as StatusListManagementControllerCreateListData, cI as StatusListManagementControllerCreateListResponse, cJ as StatusListManagementControllerCreateListResponses, cK as StatusListManagementControllerDeleteListData, cL as StatusListManagementControllerDeleteListResponse, cM as StatusListManagementControllerDeleteListResponses, cN as StatusListManagementControllerGetListData, cO as StatusListManagementControllerGetListResponse, cP as StatusListManagementControllerGetListResponses, cQ as StatusListManagementControllerGetListsData, cR as StatusListManagementControllerGetListsResponse, cS as StatusListManagementControllerGetListsResponses, cT as StatusListManagementControllerUpdateListData, cU as StatusListManagementControllerUpdateListResponse, cV as StatusListManagementControllerUpdateListResponses, cW as StatusListResponseDto, cX as StatusUpdateDto, cY as StorageControllerDownloadData, cZ as StorageControllerDownloadResponses, c_ as StorageControllerUploadData, c$ as StorageControllerUploadResponse, d0 as StorageControllerUploadResponses, d1 as TenantControllerDeleteTenantData, d2 as TenantControllerDeleteTenantResponses, d3 as TenantControllerGetTenantData, d4 as TenantControllerGetTenantResponse, d5 as TenantControllerGetTenantResponses, d6 as TenantControllerGetTenantsData, d7 as TenantControllerGetTenantsResponse, d8 as TenantControllerGetTenantsResponses, d9 as TenantControllerInitTenantData, da as TenantControllerInitTenantResponses, db as TenantControllerUpdateTenantData, dc as TenantControllerUpdateTenantResponse, dd as TenantControllerUpdateTenantResponses, de as TenantEntity, df as TokenResponse, dg as TrustList, dh as TrustListControllerCreateTrustListData, di as TrustListControllerCreateTrustListResponse, dj as TrustListControllerCreateTrustListResponses, dk as TrustListControllerDeleteTrustListData, dl as TrustListControllerDeleteTrustListResponses, dm as TrustListControllerExportTrustListData, dn as TrustListControllerExportTrustListResponse, dp as TrustListControllerExportTrustListResponses, dq as TrustListControllerGetAllTrustListsData, dr as TrustListControllerGetAllTrustListsResponse, ds as TrustListControllerGetAllTrustListsResponses, dt as TrustListControllerGetTrustListData, du as TrustListControllerGetTrustListResponse, dv as TrustListControllerGetTrustListResponses, dw as TrustListControllerGetTrustListVersionData, dx as TrustListControllerGetTrustListVersionResponse, dy as TrustListControllerGetTrustListVersionResponses, dz as TrustListControllerGetTrustListVersionsData, dA as TrustListControllerGetTrustListVersionsResponse, dB as TrustListControllerGetTrustListVersionsResponses, dC as TrustListControllerUpdateTrustListData, dD as TrustListControllerUpdateTrustListResponse, dE as TrustListControllerUpdateTrustListResponses, dF as TrustListCreateDto, dG as TrustListPublicControllerGetTrustListJwtData, dH as TrustListPublicControllerGetTrustListJwtResponse, dI as TrustListPublicControllerGetTrustListJwtResponses, dJ as TrustListVersion, dK as TrustedAuthorityQuery, dL as UpdateClientDto, dM as UpdateKeyDto, dN as UpdateSessionConfigDto, dO as UpdateStatusListConfigDto, dP as UpdateStatusListDto, dQ as UpdateTenantDto, dR as Vct, dS as VerifierOfferControllerGetOfferData, dT as VerifierOfferControllerGetOfferResponse, dU as VerifierOfferControllerGetOfferResponses, dV as WebHookAuthConfigHeader, dW as WebHookAuthConfigNone, dX as WebhookConfig, dY as WellKnownControllerAuthzMetadata0Data, dZ as WellKnownControllerAuthzMetadata0Responses, d_ as WellKnownControllerAuthzMetadata1Data, d$ as WellKnownControllerAuthzMetadata1Responses, e0 as WellKnownControllerGetJwks0Data, e1 as WellKnownControllerGetJwks0Response, e2 as WellKnownControllerGetJwks0Responses, e3 as WellKnownControllerGetJwks1Data, e4 as WellKnownControllerGetJwks1Response, e5 as WellKnownControllerGetJwks1Responses, e6 as WellKnownControllerIssuerMetadata0Data, e7 as WellKnownControllerIssuerMetadata0Response, e8 as WellKnownControllerIssuerMetadata0Responses, e9 as WellKnownControllerIssuerMetadata1Data, ea as WellKnownControllerIssuerMetadata1Response, eb as WellKnownControllerIssuerMetadata1Responses, ec as client } from './client.gen-CsfHl8pY.js';
3
+ export { Options, appControllerMain, authControllerGetGlobalJwks, authControllerGetOAuth2Token, authControllerGetOidcDiscovery, authorizeControllerAuthorizationChallengeEndpoint, authorizeControllerAuthorize, authorizeControllerPar, authorizeControllerToken, certControllerAddCertificate, certControllerDeleteCertificate, certControllerExportConfig, certControllerGetCertificate, certControllerGetCertificates, certControllerUpdateCertificate, clientControllerCreateClient, clientControllerDeleteClient, clientControllerGetClient, clientControllerGetClientSecret, clientControllerGetClients, clientControllerUpdateClient, credentialConfigControllerDeleteIssuanceConfiguration, credentialConfigControllerGetConfigById, credentialConfigControllerGetConfigs, credentialConfigControllerStoreCredentialConfiguration, credentialConfigControllerUpdateCredentialConfiguration, credentialOfferControllerGetOffer, healthControllerCheck, issuanceConfigControllerGetIssuanceConfigurations, issuanceConfigControllerStoreIssuanceConfiguration, keyControllerAddKey, keyControllerDeleteKey, keyControllerGetKey, keyControllerGetKeys, keyControllerUpdateKey, oid4VciControllerCredential, oid4VciControllerNonce, oid4VciControllerNotifications, oid4VciMetadataControllerVct, oid4VpControllerGetPostRequestWithSession, oid4VpControllerGetRequestWithSession, oid4VpControllerGetResponse, presentationManagementControllerConfiguration, presentationManagementControllerDeleteConfiguration, presentationManagementControllerGetConfiguration, presentationManagementControllerStorePresentationConfig, presentationManagementControllerUpdateConfiguration, prometheusControllerIndex, sessionConfigControllerGetConfig, sessionConfigControllerResetConfig, sessionConfigControllerUpdateConfig, sessionControllerDeleteSession, sessionControllerGetAllSessions, sessionControllerGetSession, sessionControllerRevokeAll, statusListConfigControllerGetConfig, statusListConfigControllerResetConfig, statusListConfigControllerUpdateConfig, statusListControllerGetList, statusListControllerGetStatusListAggregation, statusListManagementControllerCreateList, statusListManagementControllerDeleteList, statusListManagementControllerGetList, statusListManagementControllerGetLists, statusListManagementControllerUpdateList, storageControllerDownload, storageControllerUpload, tenantControllerDeleteTenant, tenantControllerGetTenant, tenantControllerGetTenants, tenantControllerInitTenant, tenantControllerUpdateTenant, trustListControllerCreateTrustList, trustListControllerDeleteTrustList, trustListControllerExportTrustList, trustListControllerGetAllTrustLists, trustListControllerGetTrustList, trustListControllerGetTrustListVersion, trustListControllerGetTrustListVersions, trustListControllerUpdateTrustList, trustListPublicControllerGetTrustListJwt, verifierOfferControllerGetOffer, wellKnownControllerAuthzMetadata0, wellKnownControllerAuthzMetadata1, wellKnownControllerGetJwks0, wellKnownControllerGetJwks1, wellKnownControllerIssuerMetadata0, wellKnownControllerIssuerMetadata1 } from './api/index.js';
4
+ import './types.gen-CIiveH8G.js';
5
+
6
+ /**
7
+ * Configuration options for the EudiploClient
8
+ */
9
+ interface EudiploClientConfig {
10
+ /** Base URL of the EUDIPLO server (e.g., 'https://eudiplo.example.com') */
11
+ baseUrl: string;
12
+ /** OAuth2 client ID */
13
+ clientId: string;
14
+ /** OAuth2 client secret */
15
+ clientSecret: string;
16
+ /** Optional: Auto-refresh token before expiry (default: true) */
17
+ autoRefresh?: boolean;
18
+ /** Optional: Custom fetch implementation (useful for Cloudflare Workers) */
19
+ fetch?: typeof fetch;
20
+ }
21
+ /**
22
+ * Options for session polling
23
+ */
24
+ interface SessionPollingOptions {
25
+ /** Polling interval in milliseconds (default: 1000) */
26
+ interval?: number;
27
+ /** Maximum time to wait in milliseconds (default: 300000 = 5 minutes) */
28
+ timeout?: number;
29
+ /** Callback on each poll */
30
+ onUpdate?: (session: Session) => void;
31
+ /** AbortSignal to cancel polling */
32
+ signal?: AbortSignal;
33
+ }
34
+ /**
35
+ * Simplified options for creating an issuance offer
36
+ */
37
+ interface IssuanceOfferOptions {
38
+ /** Credential configuration IDs to issue */
39
+ credentialConfigurationIds: string[];
40
+ /** Claims to include in the credentials (keyed by config ID) */
41
+ claims?: Record<string, Record<string, unknown>>;
42
+ /** Response type: 'qrcode' returns a data URL, 'uri' returns the offer URI */
43
+ responseType?: 'qrcode' | 'uri' | 'dc-api';
44
+ /** Transaction code for pre-authorized flow */
45
+ txCode?: string;
46
+ /** Flow type (default: 'pre_authorized_code') */
47
+ flow?: 'authorization_code' | 'pre_authorized_code';
48
+ }
49
+ /**
50
+ * Simplified options for creating a presentation request
51
+ */
52
+ interface PresentationRequestOptions {
53
+ /** ID of the presentation configuration */
54
+ configId: string;
55
+ /** Response type: 'qrcode' returns a data URL, 'uri' returns the request URI */
56
+ responseType?: 'qrcode' | 'uri' | 'dc-api';
57
+ /** Optional redirect URI after presentation completes */
58
+ redirectUri?: string;
59
+ }
60
+ /**
61
+ * Result of creating an offer or request
62
+ */
63
+ interface OfferResult {
64
+ /** The URI to encode in a QR code or use directly */
65
+ uri: string;
66
+ /** Session ID for polling */
67
+ sessionId: string;
68
+ }
69
+ /**
70
+ * Framework-agnostic EUDIPLO client for demos and integrations.
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * import { EudiploClient } from '@eudiplo/sdk-core';
75
+ *
76
+ * const client = new EudiploClient({
77
+ * baseUrl: 'https://eudiplo.example.com',
78
+ * clientId: 'my-demo',
79
+ * clientSecret: 'secret123'
80
+ * });
81
+ *
82
+ * // Create a presentation request for age verification
83
+ * const { uri, sessionId } = await client.createPresentationRequest({
84
+ * configId: 'age-over-18'
85
+ * });
86
+ *
87
+ * // Display QR code with `uri`, then wait for completion
88
+ * const session = await client.waitForSession(sessionId);
89
+ * console.log('Verified:', session.credentials);
90
+ * ```
91
+ */
92
+ declare class EudiploClient {
93
+ private config;
94
+ private accessToken?;
95
+ private tokenExpiresAt?;
96
+ private refreshPromise?;
97
+ constructor(config: EudiploClientConfig);
98
+ /**
99
+ * Authenticate and obtain an access token.
100
+ * Called automatically by other methods, but can be called explicitly.
101
+ */
102
+ authenticate(): Promise<void>;
103
+ private _doAuthenticate;
104
+ /**
105
+ * Ensure we have a valid access token, refreshing if necessary.
106
+ */
107
+ private ensureAuthenticated;
108
+ /**
109
+ * Create a credential issuance offer.
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * const { uri, sessionId } = await client.createIssuanceOffer({
114
+ * credentialConfigurationIds: ['PID'],
115
+ * claims: {
116
+ * PID: { given_name: 'John', family_name: 'Doe' }
117
+ * }
118
+ * });
119
+ * ```
120
+ */
121
+ createIssuanceOffer(options: IssuanceOfferOptions): Promise<OfferResult>;
122
+ /**
123
+ * Create a presentation request (for verification).
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * // Age verification
128
+ * const { uri, sessionId } = await client.createPresentationRequest({
129
+ * configId: 'age-over-18'
130
+ * });
131
+ *
132
+ * // Show QR code, wait for wallet to respond
133
+ * const session = await client.waitForSession(sessionId);
134
+ * ```
135
+ */
136
+ createPresentationRequest(options: PresentationRequestOptions): Promise<OfferResult>;
137
+ /**
138
+ * Get the current status of a session.
139
+ */
140
+ getSession(sessionId: string): Promise<Session>;
141
+ /**
142
+ * Wait for a session to complete (polling).
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * const session = await client.waitForSession(sessionId, {
147
+ * interval: 1000,
148
+ * timeout: 60000,
149
+ * onUpdate: (s) => console.log('Status:', s.status)
150
+ * });
151
+ * ```
152
+ */
153
+ waitForSession(sessionId: string, options?: SessionPollingOptions): Promise<Session>;
154
+ /**
155
+ * Helper to sleep with abort support
156
+ */
157
+ private sleep;
158
+ /**
159
+ * Get the current access token (for advanced usage)
160
+ */
161
+ getAccessToken(): string | undefined;
162
+ /**
163
+ * Get the configured base URL
164
+ */
165
+ getBaseUrl(): string;
166
+ }
167
+ /**
168
+ * Credentials for EUDIPLO authentication
169
+ */
170
+ interface EudiploCredentials {
171
+ baseUrl: string;
172
+ clientId: string;
173
+ clientSecret: string;
174
+ }
175
+ /**
176
+ * Options for the verify function
177
+ */
178
+ interface VerifyOptions extends EudiploCredentials {
179
+ /** Presentation configuration ID */
180
+ configId: string;
181
+ /** Optional redirect URI */
182
+ redirectUri?: string;
183
+ /** Polling options */
184
+ polling?: SessionPollingOptions;
185
+ }
186
+ /**
187
+ * Options for the issue function
188
+ */
189
+ interface IssueOptions extends EudiploCredentials {
190
+ /** Credential configuration IDs */
191
+ credentialConfigurationIds: string[];
192
+ /** Claims per credential config */
193
+ claims?: Record<string, Record<string, unknown>>;
194
+ /** Transaction code (optional) */
195
+ txCode?: string;
196
+ /** Polling options */
197
+ polling?: SessionPollingOptions;
198
+ }
199
+ /**
200
+ * Result of a verification or issuance flow
201
+ */
202
+ interface FlowResult {
203
+ /** URI for QR code */
204
+ uri: string;
205
+ /** Session ID */
206
+ sessionId: string;
207
+ /** Wait for the session to complete */
208
+ waitForCompletion: (options?: SessionPollingOptions) => Promise<Session>;
209
+ /** Get current session status */
210
+ getStatus: () => Promise<Session>;
211
+ }
212
+ /**
213
+ * Create a presentation request for verification.
214
+ * Returns a URI for QR code and a function to wait for completion.
215
+ *
216
+ * @example
217
+ * ```typescript
218
+ * import { verify } from '@eudiplo/sdk-core';
219
+ *
220
+ * const { uri, waitForCompletion } = await verify({
221
+ * baseUrl: 'https://eudiplo.example.com',
222
+ * clientId: 'demo',
223
+ * clientSecret: 'secret',
224
+ * configId: 'age-over-18'
225
+ * });
226
+ *
227
+ * console.log('Scan this:', uri);
228
+ * const session = await waitForCompletion();
229
+ * console.log('Verified!', session.credentials);
230
+ * ```
231
+ */
232
+ declare function verify(options: VerifyOptions): Promise<FlowResult>;
233
+ /**
234
+ * Create a credential issuance offer.
235
+ * Returns a URI for QR code and a function to wait for completion.
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * import { issue } from '@eudiplo/sdk-core';
240
+ *
241
+ * const { uri, waitForCompletion } = await issue({
242
+ * baseUrl: 'https://eudiplo.example.com',
243
+ * clientId: 'demo',
244
+ * clientSecret: 'secret',
245
+ * credentialConfigurationIds: ['PID'],
246
+ * claims: {
247
+ * PID: { given_name: 'John', family_name: 'Doe' }
248
+ * }
249
+ * });
250
+ *
251
+ * console.log('Scan this:', uri);
252
+ * const session = await waitForCompletion();
253
+ * ```
254
+ */
255
+ declare function issue(options: IssueOptions): Promise<FlowResult>;
256
+ /**
257
+ * One-liner: Verify and wait for result in a single call.
258
+ *
259
+ * @example
260
+ * ```typescript
261
+ * import { verifyAndWait } from '@eudiplo/sdk-core';
262
+ *
263
+ * const session = await verifyAndWait({
264
+ * baseUrl: 'https://eudiplo.example.com',
265
+ * clientId: 'demo',
266
+ * clientSecret: 'secret',
267
+ * configId: 'age-over-18',
268
+ * onUri: (uri) => showQRCode(uri),
269
+ * onUpdate: (s) => console.log('Status:', s.status)
270
+ * });
271
+ * ```
272
+ */
273
+ declare function verifyAndWait(options: VerifyOptions & {
274
+ /** Called with the URI when available - use to display QR code */
275
+ onUri: (uri: string) => void;
276
+ }): Promise<Session>;
277
+ /**
278
+ * One-liner: Issue credential and wait for completion in a single call.
279
+ *
280
+ * @example
281
+ * ```typescript
282
+ * import { issueAndWait } from '@eudiplo/sdk-core';
283
+ *
284
+ * const session = await issueAndWait({
285
+ * baseUrl: 'https://eudiplo.example.com',
286
+ * clientId: 'demo',
287
+ * clientSecret: 'secret',
288
+ * credentialConfigurationIds: ['PID'],
289
+ * claims: { PID: { given_name: 'John' } },
290
+ * onUri: (uri) => showQRCode(uri)
291
+ * });
292
+ * ```
293
+ */
294
+ declare function issueAndWait(options: IssueOptions & {
295
+ /** Called with the URI when available - use to display QR code */
296
+ onUri: (uri: string) => void;
297
+ }): Promise<Session>;
298
+
299
+ export { EudiploClient, type EudiploClientConfig, type EudiploCredentials, type FlowResult, type IssuanceOfferOptions, type IssueOptions, type OfferResult, type PresentationRequestOptions, Session, type SessionPollingOptions, type VerifyOptions, issue, issueAndWait, verify, verifyAndWait };