@gerege-systems/eid-mongolia-sdk 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RpCredentials, C as CertificateLevel, I as Interaction, S as SignatureAlgorithm, H as HashAlgorithm, N as NotificationSession, D as DeviceLinkSession, a as SessionResult, P as PdfSessionBlock, b as RepresentationsResponse, A as AcspContext, F as FlowType, E as EidError } from './browser-B_XtyuFG.js';
2
- export { c as ApiError, d as AuthenticationError, e as DeviceLinkError, f as DeviceLinkInput, g as EndResult, h as ForbiddenError, i as NavigatorLike, j as NetworkError, O as ON_BEHALF_ERROR_CODES, k as OnBehalfErrorCode, l as OpenOrShowQROptions, m as OrgResult, n as PdfDocumentStatus, o as PdfSigner, p as Representation, q as SessionFailedError, r as SessionState, s as SignatureAlgorithmParameters, t as SignatureProtocol, V as ValidationError, u as deviceLink, v as isMobileUserAgent, w as openOrShowQR } from './browser-B_XtyuFG.js';
1
+ import { R as RpCredentials, C as CertificateLevel, I as Interaction, S as SignatureAlgorithm, H as HashAlgorithm, N as NotificationSession, D as DeviceLinkSession, a as SessionResult, P as PersonBlock, b as PdfSessionBlock, c as RepresentationsResponse, A as AcspContext, F as FlowType, E as EidError } from './browser-BWCDj8xO.js';
2
+ export { d as ApiError, e as AuthenticationError, f as DeviceLinkError, g as DeviceLinkInput, h as EndResult, i as ForbiddenError, j as HttpErrorInit, k as NavigatorLike, l as NetworkError, O as ON_BEHALF_ERROR_CODES, m as OnBehalfErrorCode, n as OpenOrShowQROptions, o as OrgResult, p as PdfDocumentStatus, q as PdfSigner, r as RETRYABLE_ERROR_CODES, s as Representation, t as RetryableErrorCode, u as SessionFailedError, v as SessionState, w as SignatureAlgorithmParameters, x as SignatureProtocol, T as TokenCertSessionBlock, y as TokenCertStatus, V as ValidationError, z as deviceLink, B as isMobileUserAgent, G as openOrShowQR, J as parseRetryAfter } from './browser-BWCDj8xO.js';
3
3
  import { X509Certificate, KeyObject } from 'node:crypto';
4
4
 
5
5
  interface HttpConfig {
@@ -100,6 +100,11 @@ interface SignOptions {
100
100
  * өөрөө иргэний PIN2 гэрчилгээгээр — байгууллага нь digest-д ОРОХГҮЙ.
101
101
  */
102
102
  onBehalfOf?: string;
103
+ /**
104
+ * Гарын үсэг зурагдах баримтын нэр — CA-ийн /verify хуудас ба иргэний түүхэнд харагдана. Заавал биш: өгөөгүй бол CA
105
+ * interaction текстээс таамаглана.
106
+ */
107
+ fileName?: string;
103
108
  }
104
109
  declare class SignApi {
105
110
  private readonly http;
@@ -121,6 +126,14 @@ declare class SignApi {
121
126
 
122
127
  /** RP-API-ийн session JSON-ийг SessionResult болгон задална (rpclient.ts-тэй ижил mapping). */
123
128
  declare function parseSessionResult(raw: unknown): SessionResult;
129
+ /**
130
+ * Person блокийн `civilId` нь баталгаажсан гэрчилгээний SERIALNUMBER-тэй (`PNOMN-<civilId>`) таарах эсэх — хоёулаа
131
+ * хоосон биш байх ёстой. Person блок гарын үсэгт ордоггүй тул RP үүнийг validateAuth-ийн дараа шалгаж байж нэр /
132
+ * төрсөн огноонд итгэнэ. `subject` — validateAuth-ийн `parsedSubject` (эсвэл түүний `serialNumber`).
133
+ */
134
+ declare function personMatchesCertificate(person: PersonBlock | null | undefined, subject: {
135
+ serialNumber?: string;
136
+ } | string | null | undefined): boolean;
124
137
  declare class SessionApi {
125
138
  private readonly http;
126
139
  constructor(http: Http);
@@ -138,7 +151,15 @@ declare class SessionApi {
138
151
 
139
152
  interface PdfDefaults {
140
153
  certificateLevel: CertificateLevel;
154
+ /** prepare / document дуудлагын хугацаа (мс); анхдагч {@link DEFAULT_PDF_TIMEOUT_MS}. */
155
+ timeoutMs?: number;
141
156
  }
157
+ /**
158
+ * PAdES prepare / баримт татах нэг дуудлагын анхдагч хугацаа (мс). CA prepare нь ≤ 10 MiB уншиж, өмнөх гарын үсэг +
159
+ * LTV өгөгдөл шалгаад push эхлүүлдэг; баримт татахад угсралтыг ≤ 30с хүлээдэг (PADES_SIGNING §3.4). 80с нь хоёуланд
160
+ * хүрэлцэнэ, CA-ийн nginx proxy_read_timeout-оос бага.
161
+ */
162
+ declare const DEFAULT_PDF_TIMEOUT_MS = 80000;
142
163
  /** Гарын үсэг зурагч — яг нэг нь. */
143
164
  type PdfSignerRef = {
144
165
  etsi: string;
@@ -193,11 +214,16 @@ declare class PdfApi {
193
214
  private readonly creds;
194
215
  private readonly defaults;
195
216
  constructor(http: Http, creds: RpCredentials, defaults: PdfDefaults);
196
- /** POST /pdf/sign/prepare — multipart (`request` JSON + `pdf`). SIGN эрх шаардана. */
217
+ /**
218
+ * POST /pdf/sign/prepare — multipart (`request` JSON + `pdf`). SIGN эрх шаардана. Түр алдаа: `ApiError` 429
219
+ * PDF_PREPARE_BUSY, 503 LTV_UNAVAILABLE / TSA_UNAVAILABLE — `retryAfterMs`-ийн дараа дахин (`retryable`).
220
+ */
197
221
  prepare(input: PdfPrepareInput): Promise<PdfPrepareSession>;
198
222
  /**
199
223
  * GET /pdf/sign/{sessionID}/document — гарын үсэгтэй PDF (READY-ээс хойш 30 мин). Татсан байтын SHA-256-ийг
200
- * session-ий `pdf.outSha256`-тай тулга. Эрх хасагдсан бол `ForbiddenError` `.code = "REPRESENTATION_REVOKED"`.
224
+ * session-ий `pdf.outSha256`-тай тулга. Эрх хасагдсан бол `ForbiddenError` `.code = "REPRESENTATION_REVOKED"`. Баримт
225
+ * бэлэн болоогүй бол `ApiError` 503 `.code` DOCUMENT_PENDING / TSA_UNAVAILABLE / LTV_UNAVAILABLE — `retryAfterMs`-ийн
226
+ * дараа дахин татна (`retryable`).
201
227
  */
202
228
  document(sessionId: string): Promise<Uint8Array>;
203
229
  /**
@@ -216,6 +242,264 @@ declare class OrganizationApi {
216
242
  getRepresentations(personEtsi: string): Promise<RepresentationsResponse>;
217
243
  }
218
244
 
245
+ /** Токенд холбогдсон байгууллага. */
246
+ interface TokenOrganization {
247
+ etsi: string;
248
+ name: string;
249
+ }
250
+ /** Иргэний нэг гэрчилгээ. */
251
+ interface PersonCertificate {
252
+ documentNumber: string;
253
+ /** AUTH | SIGN | SEAL. */
254
+ type: string;
255
+ /** MOBILE | TOKEN | HSM. */
256
+ keyMedium: string;
257
+ serialNumber: string;
258
+ certificateLevel: string;
259
+ /** VALID | REVOKED | EXPIRED | SUSPENDED. */
260
+ status: string;
261
+ /** RFC 3339. */
262
+ notBefore: string;
263
+ notAfter: string;
264
+ issuerDn: string;
265
+ /** base64 DER (нийтийн артефакт). */
266
+ certValue?: string;
267
+ /** TOKEN мөрөнд токенд холбогдсон байгууллага; хувийн токенд алга. */
268
+ organization?: TokenOrganization;
269
+ }
270
+ interface CertCounts {
271
+ valid: number;
272
+ revoked: number;
273
+ expired: number;
274
+ suspended: number;
275
+ total: number;
276
+ }
277
+ /** GET /certificates/etsi/{personEtsi}. */
278
+ interface PersonCertificates {
279
+ personEtsi: string;
280
+ counts: CertCounts;
281
+ certificates: PersonCertificate[];
282
+ raw: unknown;
283
+ }
284
+ interface PersonDevice {
285
+ deviceId?: string;
286
+ documentNumber: string;
287
+ /** APNS | FCM. */
288
+ platform?: string;
289
+ pushTopic?: string;
290
+ enrolledAt: string;
291
+ active: boolean;
292
+ deactivatedAt?: string | null;
293
+ }
294
+ /** GET /devices/etsi/{personEtsi}. */
295
+ interface PersonDevices {
296
+ personEtsi: string;
297
+ devices: PersonDevice[];
298
+ activeCount: number;
299
+ total: number;
300
+ raw: unknown;
301
+ }
302
+ /** Үйл ажиллагааны нэг бичлэг (kind/reason: EID_PERSON_PKI §Activity kind/reason; шинэ код нэмэгдэж болно). */
303
+ interface ActivityItem {
304
+ id?: string;
305
+ sessionId?: string;
306
+ /** AUTH | SIGN | PIN_CHECK | ENROLL | TOKEN_AUTH | … */
307
+ kind: string;
308
+ /** AUTHENTICATION | SIGNATURE (зөвхөн AUTH/SIGN). */
309
+ flow?: string;
310
+ /** OK | DENIED | FAILED. */
311
+ outcome: string;
312
+ reason?: string;
313
+ pinSlot?: string;
314
+ endResult?: string;
315
+ rpName?: string;
316
+ subsystemName?: string;
317
+ docText?: string;
318
+ interactionType?: string;
319
+ documentNumber?: string;
320
+ clientIp?: string;
321
+ timestamp: string;
322
+ onBehalfOfName?: string;
323
+ }
324
+ interface ActivityCounts {
325
+ authentication: number;
326
+ signature: number;
327
+ }
328
+ /** GET /rp/activity/etsi/{personEtsi} (RP-scoped; eID портал — бүрэн түүх). */
329
+ interface PersonActivity {
330
+ personEtsi: string;
331
+ counts: ActivityCounts;
332
+ sessions: ActivityItem[];
333
+ total: number;
334
+ limit: number;
335
+ offset: number;
336
+ raw: unknown;
337
+ }
338
+ /** activity-ийн шүүлт. Өгөөгүй = серверийн анхдагч (limit 20, offset 0, бүх flow). */
339
+ interface ActivityQuery {
340
+ flow?: "AUTHENTICATION" | "SIGNATURE";
341
+ /** 1–200. */
342
+ limit?: number;
343
+ offset?: number;
344
+ }
345
+ /** GET /person/summary/etsi/{personEtsi}. `lastName` = ЭЦГИЙН нэр, `familyName` = УРГИЙН овог. */
346
+ interface PersonSummary {
347
+ personEtsi: string;
348
+ firstName?: string;
349
+ lastName?: string;
350
+ familyName?: string;
351
+ certificates: CertCounts;
352
+ activity: ActivityCounts;
353
+ devicesActive: number;
354
+ devicesTotal: number;
355
+ representationCount: number;
356
+ raw: unknown;
357
+ }
358
+ interface PersonChild {
359
+ etsi: string;
360
+ regNo: string;
361
+ /** «Овог Нэр». */
362
+ name: string;
363
+ /** YYYY-MM-DD. */
364
+ birthDate?: string;
365
+ registered: boolean;
366
+ /** 18 нас хүрэх өдөр; бүртгэлгүй бол алга. */
367
+ certNotAfter?: string;
368
+ }
369
+ /** GET /person/children/etsi/{personEtsi}. */
370
+ interface PersonChildren {
371
+ children: PersonChild[];
372
+ raw: unknown;
373
+ }
374
+ declare class PersonApi {
375
+ private readonly http;
376
+ constructor(http: Http);
377
+ private get;
378
+ /** Иргэний бүх гэрчилгээ + статусын тоолол. */
379
+ certificates(personEtsi: string): Promise<PersonCertificates>;
380
+ /** Иргэний холбоотой төхөөрөмжүүд (идэвхтэй + идэвхгүй). */
381
+ devices(personEtsi: string): Promise<PersonDevices>;
382
+ /** Иргэний үйл ажиллагааны түүх. */
383
+ activity(personEtsi: string, query?: ActivityQuery): Promise<PersonActivity>;
384
+ /** Самбарын нэгдсэн тоо. */
385
+ summary(personEtsi: string): Promise<PersonSummary>;
386
+ /** Асран хамгаалж буй хүүхдүүд (зөвхөн унших). */
387
+ children(personEtsi: string): Promise<PersonChildren>;
388
+ }
389
+
390
+ interface TokenCertInput {
391
+ /** Иргэн (PNOMN-…) — батлах push түүний утсанд очно. */
392
+ signerEtsi: string;
393
+ /** PKCS#10 DER (EC P-256, ecdsa-with-SHA256, өөр өөр түлхүүр, ≤ 4 KiB). */
394
+ csrAuth: Uint8Array;
395
+ csrSign: Uint8Array;
396
+ /** `[A-Za-z0-9-]{1,64}`. */
397
+ tokenSerial: string;
398
+ /** Заавал биш (≤ 64). */
399
+ tokenLabel?: string;
400
+ /** Байгууллагын токен (NTRMN-…); хоосон/алга = хувийн токен. */
401
+ onBehalfOf?: string;
402
+ }
403
+ interface TokenCertStart {
404
+ sessionId: string;
405
+ /** Иргэнд ХАРУУЛАХ баталгаажуулах код (ПИН биш). */
406
+ vc: string | null;
407
+ /** hex(SHA-256(CSR DER)) — SDK илгээсэн CSR-тэй тулгасан (жижиг үсэг). */
408
+ csrAuthSha256: string;
409
+ csrSignSha256: string;
410
+ expiresAt?: string;
411
+ }
412
+ interface TokenCertItem {
413
+ /** base64 DER. */
414
+ certificate: string;
415
+ certificatePem: string;
416
+ serialHex: string;
417
+ notBefore: string;
418
+ notAfter: string;
419
+ }
420
+ /** GET /token/certificate/{sessionID} (зөвхөн үүсгэсэн RP, 24 цаг идэмпотент). */
421
+ interface TokenCertResult {
422
+ status: string;
423
+ auth: TokenCertItem | null;
424
+ sign: TokenCertItem | null;
425
+ /** base64 DER: 04, 03, 02 (root-гүй). */
426
+ chain: string[];
427
+ chainPem: string;
428
+ /** Хувийн токенд null. */
429
+ organization: TokenOrganization | null;
430
+ keyMedium: string;
431
+ certificateLevel: string;
432
+ raw: unknown;
433
+ }
434
+ interface TokenAuthChallenge {
435
+ challengeId: string;
436
+ /** base64 (32 байт). */
437
+ challenge: string;
438
+ /** CA-ийн холбосон RP (жижиг үсэг) — hash-д ЯГ ЭНЭ мөр орно. */
439
+ rpUUID: string;
440
+ expiresAt: string;
441
+ }
442
+ /** CA-ийн баталгаажуулсан иргэн; givenName/surname — KYC бүртгэлээс (кирилл). */
443
+ interface TokenIdentity {
444
+ etsi: string;
445
+ givenName: string;
446
+ surname: string;
447
+ }
448
+ interface TokenAuthResult {
449
+ identity: TokenIdentity;
450
+ serialHex: string;
451
+ notAfter: string;
452
+ /** Токен байгууллагад холбогдсон бол; эс бөгөөс null. */
453
+ organization: TokenOrganization | null;
454
+ raw: unknown;
455
+ }
456
+ /** 409 TOKEN_LIMIT_REACHED-ийн дэлгэрэнгүй. `limit` 0 = тухайн төрлийн олголт хаалттай. */
457
+ interface TokenLimit {
458
+ kind: "PERSONAL" | "ORGANIZATION";
459
+ limit: number;
460
+ /** Зөвхөн ORGANIZATION-д (NTRMN-…). */
461
+ organization?: string;
462
+ }
463
+ declare class TokenApi {
464
+ private readonly http;
465
+ private readonly creds;
466
+ constructor(http: Http, creds: RpCredentials);
467
+ /**
468
+ * POST /token/certificate — токены AUTH + SIGN гэрчилгээ олголт эхлүүлнэ (иргэн утсаараа батална). CA-ийн буцаасан
469
+ * CSR hash-ууд илгээсэнтэй таарахгүй бол ValidationError.
470
+ */
471
+ issueCertificate(input: TokenCertInput): Promise<TokenCertStart>;
472
+ /**
473
+ * GET /token/certificate/{sessionID} — олгосон AUTH + SIGN гэрчилгээ + гинж. Токенд бичихээс өмнө
474
+ * {@link verifyTokenCertificates}-ээр CSR-ийн түлхүүртэй тулга.
475
+ */
476
+ certificateResult(sessionId: string): Promise<TokenCertResult>;
477
+ /** POST /token/auth/challenge — энэ RP-д холбогдсон нэг удаагийн challenge (2 мин). */
478
+ authChallenge(): Promise<TokenAuthChallenge>;
479
+ /**
480
+ * POST /token/auth/verify — токены AUTH гэрчилгээ (DER) + challenge дээрх түүхий r||s. CA гинж, төлөв, цуцлалт, гарын
481
+ * үсгийг шалгана; SDK нэмж endResult === OK ба identity.etsi === гэрчилгээний SERIALNUMBER-ийг тулгана (эс бөгөөс
482
+ * ValidationError). Challenge нэг удаагийн — алдааны дараа шинээр авна.
483
+ */
484
+ authVerify(challengeId: string, certDer: Uint8Array, signature: Uint8Array): Promise<TokenAuthResult>;
485
+ }
486
+ /**
487
+ * Олгосон AUTH/SIGN гэрчилгээ бүр задарч, илгээсэн CSR-ийн public key-тэй (SPKI) ЯГ таарахыг шалгана. Таарахгүй бол
488
+ * ValidationError — гэрчилгээг токенд бүү бич.
489
+ */
490
+ declare function verifyTokenCertificates(result: TokenCertResult, csrAuth: Uint8Array, csrSign: Uint8Array): void;
491
+ /**
492
+ * Токены зурах 32 байт: SHA-256("eID-TOKEN-AUTH" || rpUUID || challenge) (docs/TOKEN_AUTH.md). `rpUUID` — challenge
493
+ * хариуны `rpUUID` (жижиг үсэг, 36), `challengeB64` — 32 байт base64. Токен үүнийг CKM_ECDSA-аар зурж, түүхий r||s
494
+ * (64 байт)-ийг authVerify-д өгнө.
495
+ */
496
+ declare function tokenAuthDigest(rpUUID: string, challengeB64: string): Buffer;
497
+ /**
498
+ * err нь 409 TOKEN_LIMIT_REACHED бол түүний `{kind, limit, organization}`. Гэрээнээс гадуур хэлбэр бол undefined —
499
+ * татгалзал хүчинтэй хэвээр, дэлгэрэнгүйгүй.
500
+ */
501
+ declare function tokenLimitOf(err: unknown): TokenLimit | undefined;
502
+
219
503
  /** Задалсан subject. Cert-д байхгүй талбар — undefined. Давхардсан OID-ийн эхнийх нь. */
220
504
  interface CertSubject {
221
505
  /** 2.5.4.42 GIVENNAME. */
@@ -291,6 +575,16 @@ interface ValidateSignOptions {
291
575
  * хэрэгжүүлнэ. "good" = хүчинтэй, "revoked" = цуцлагдсан, "unknown" = тогтоогдсонгүй.
292
576
  */
293
577
  type RevocationStatus = "good" | "revoked" | "unknown";
578
+ /**
579
+ * {@link ResponseValidator.checkRevocationStatus}-ийн амжилттай дүн: "good" — issuer хүчинтэй гэж хариулсан;
580
+ * "unchecked" — "unknown", soft-fail горимд зөвшөөрөв; "skipped" — revocation hook тохируулаагүй.
581
+ */
582
+ type RevocationOutcome = "good" | "unchecked" | "skipped";
583
+ /**
584
+ * eID Mongolia Issuing CA (04)-ийн Subject Key Identifier — иргэний утасны болон USB токены AUTH/SIGN гэрчилгээг
585
+ * гаргадаг цорын ганц CA. `TrustConfig.allowedIssuerSkis`-д.
586
+ */
587
+ declare const CITIZEN_ISSUING_CA_SKI = "b8a37f2c64ad677912db7d9e34f246358a2fb909";
294
588
  type RevocationChecker = (cert: X509Certificate, issuer: X509Certificate | undefined) => Promise<RevocationStatus>;
295
589
  interface TrustConfig {
296
590
  /**
@@ -320,6 +614,19 @@ interface TrustConfig {
320
614
  * revocation тохируулсан үед); "soft-fail" — "unknown"-г зөвшөөрнө.
321
615
  */
322
616
  revocationMode?: "hard-fail" | "soft-fail";
617
+ /**
618
+ * Иргэний гэрчилгээг шууд гаргасан CA-ийн Subject Key Identifier (hex, ":" зөвшөөрнө) жагсаалт. Хоосон/алга бол trust
619
+ * anchor хүртэл гинжлэгдсэн дурын CA зөвшөөрөгдөнө (хуучин зан). Ижил root-ийн доорх өөр CA (ж: байгууллагын Issuing
620
+ * CA) иргэний гэрчилгээ гаргахаас хамгаалахад: `[CITIZEN_ISSUING_CA_SKI]`.
621
+ */
622
+ allowedIssuerSkis?: string[];
623
+ /**
624
+ * true бол гэрчилгээний зориулалтыг CA-ийн профайлаар шалгана: auth → KeyUsage digitalSignature + ExtKeyUsage
625
+ * clientAuth (P-CITIZEN-AUTH); sign → KeyUsage contentCommitment / nonRepudiation (P-CITIZEN-SIGN). Анхдагч false.
626
+ */
627
+ checkKeyUsage?: boolean;
628
+ /** ACSP_V2 payload-ийн scheme нэр (CA-ийн `capabilities.acsp_scheme_name`); анхдагч "smart-id". */
629
+ schemeName?: string;
323
630
  }
324
631
  /** Баталгаажсан иргэний таних мэдээлэл (auth). */
325
632
  interface VerifiedIdentity {
@@ -350,6 +657,9 @@ declare class ResponseValidator {
350
657
  private readonly allowUntrusted;
351
658
  private readonly revocation?;
352
659
  private readonly revocationMode;
660
+ private readonly allowedIssuers?;
661
+ private readonly checkKeyUsage;
662
+ private readonly schemeName?;
353
663
  constructor(trust?: TrustConfig);
354
664
  /**
355
665
  * Auth session-ийн хариуг бүрэн шалгаж, баталгаажсан иргэнийг буцаана.
@@ -377,6 +687,13 @@ declare class ResponseValidator {
377
687
  private algorithmOf;
378
688
  /** state/endResult, cert байгаа эсэх, chain, validity, certLevel — нийтлэг шалгалт. */
379
689
  private precheck;
690
+ /**
691
+ * checkKeyUsage үед гэрчилгээний зориулалт протоколд тохирох эсэх (CA crypto/ca_profile.go): ACSP_V2 (auth) → KU
692
+ * digitalSignature + EKU clientAuth (эсвэл anyExtendedKeyUsage); RAW_DIGEST_SIGNATURE (sign) → KU contentCommitment.
693
+ */
694
+ private checkPurpose;
695
+ /** allowedIssuerSkis үед leaf-ийн шууд issuer-ийн SKI (issuer-т алга бол leaf-ийн AKI) жагсаалтад байх ёстой. */
696
+ private checkIssuer;
380
697
  private checkValidity;
381
698
  private checkLevel;
382
699
  /** leaf-ээс эхлэн issuer-ийг intermediates/anchors дотроос олж, anchor хүртэл chain зангидна. */
@@ -390,6 +707,11 @@ declare class ResponseValidator {
390
707
  * дуудна (тэдгээр нь sync; revocation нь сүлжээ I/O тул async).
391
708
  */
392
709
  checkRevocation(cert: X509Certificate): Promise<void>;
710
+ /**
711
+ * {@link checkRevocation} + юу шийдсэнийг буцаана (лог/аудитад): "good" | "unchecked" (unknown, soft-fail) |
712
+ * "skipped" (hook алга). "revoked", мөн hard-fail горимд "unknown" → ValidationError; hook-ийн алдаа дамжина.
713
+ */
714
+ checkRevocationStatus(cert: X509Certificate): Promise<RevocationOutcome>;
393
715
  }
394
716
  /** Payload (auth) дээрх гарын үсэг — алгоритмаар салаалж node:crypto verify. */
395
717
  /** Smart-ID: userChallenge = BASE64URL(SHA-256(UTF-8(userChallengeVerifier))), padding-гүй. */
@@ -410,6 +732,8 @@ interface ClientConfig {
410
732
  defaultCertificateLevel?: CertificateLevel;
411
733
  /** HTTP timeout (мс). */
412
734
  timeoutMs?: number;
735
+ /** PAdES prepare / баримт татах дуудлагын хугацаа (мс). Анхдагч 80000 ({@link DEFAULT_PDF_TIMEOUT_MS}). */
736
+ pdfTimeoutMs?: number;
413
737
  /** undici Dispatcher (mTLS client cert). */
414
738
  dispatcher?: unknown;
415
739
  /** fetch орлуулагч (тест). */
@@ -426,6 +750,8 @@ declare class EidClient {
426
750
  readonly sign: SignApi;
427
751
  readonly pdf: PdfApi;
428
752
  readonly organization: OrganizationApi;
753
+ readonly person: PersonApi;
754
+ readonly token: TokenApi;
429
755
  readonly session: SessionApi;
430
756
  readonly validator: ResponseValidator;
431
757
  constructor(cfg: ClientConfig);
@@ -663,4 +989,4 @@ declare class EidOidcClient {
663
989
  /** PKCE S256: `BASE64URL(SHA-256(ASCII(code_verifier)))` (RFC 7636 §4.2). */
664
990
  declare function pkceChallenge(codeVerifier: string): Promise<string>;
665
991
 
666
- export { AcspContext, type AcspV2Params, AuthApi, type AuthDefaults, type AuthOptions, type BuildDeviceLinkInput, type CertSubject, CertificateLevel, type ClientConfig, type CreateAuthorizationOptions, DEFAULT_BASE_URL, DeviceLinkSession, type DeviceLinkSessionType, type DeviceLinkType, EID_ACR_ADVANCED, EID_ACR_QUALIFIED, EID_OIDC_ISSUER, type EidAuthorization, type EidCallbackChecks, type EidCallbackResult, EidClient, EidError, type EidIdTokenClaims, EidOidcClient, type EidOidcClientConfig, type EidOidcDiscovery, EidOidcError, type EidOidcErrorCode, FlowType, HashAlgorithm, Http, type HttpConfig, Interaction, NotificationSession, OrganizationApi, PdfApi, type PdfDefaults, type PdfPrepareInput, type PdfPrepareSession, PdfSessionBlock, type PdfSignerRef, type QrDeviceLinkTickerOptions, RepresentationsResponse, ResponseValidator, type RevocationChecker, type RevocationStatus, RpCredentials, SessionApi, SessionResult, SignApi, type SignDefaults, type SignOptions, SignatureAlgorithm, type TrustConfig, type ValidateAuthOptions, type ValidateSignOptions, type VerifiedIdentity, type VerifiedSignature, acspV2Digest, buildAcspV2Payload, buildDeviceLink, interactionsToBase64, parseSessionResult, parseSubject, pkceChallenge, qrDeviceLinkTicker, randomChallenge, resolveBaseUrl, sha256Base64, userChallengeOf, verifyPayloadSignature, verifyPrehashedSignature };
992
+ export { AcspContext, type AcspV2Params, type ActivityCounts, type ActivityItem, type ActivityQuery, AuthApi, type AuthDefaults, type AuthOptions, type BuildDeviceLinkInput, CITIZEN_ISSUING_CA_SKI, type CertCounts, type CertSubject, CertificateLevel, type ClientConfig, type CreateAuthorizationOptions, DEFAULT_BASE_URL, DEFAULT_PDF_TIMEOUT_MS, DeviceLinkSession, type DeviceLinkSessionType, type DeviceLinkType, EID_ACR_ADVANCED, EID_ACR_QUALIFIED, EID_OIDC_ISSUER, type EidAuthorization, type EidCallbackChecks, type EidCallbackResult, EidClient, EidError, type EidIdTokenClaims, EidOidcClient, type EidOidcClientConfig, type EidOidcDiscovery, EidOidcError, type EidOidcErrorCode, FlowType, HashAlgorithm, Http, type HttpConfig, Interaction, NotificationSession, OrganizationApi, PdfApi, type PdfDefaults, type PdfPrepareInput, type PdfPrepareSession, PdfSessionBlock, type PdfSignerRef, type PersonActivity, PersonApi, PersonBlock, type PersonCertificate, type PersonCertificates, type PersonChild, type PersonChildren, type PersonDevice, type PersonDevices, type PersonSummary, type QrDeviceLinkTickerOptions, RepresentationsResponse, ResponseValidator, type RevocationChecker, type RevocationOutcome, type RevocationStatus, RpCredentials, SessionApi, SessionResult, SignApi, type SignDefaults, type SignOptions, SignatureAlgorithm, TokenApi, type TokenAuthChallenge, type TokenAuthResult, type TokenCertInput, type TokenCertItem, type TokenCertResult, type TokenCertStart, type TokenIdentity, type TokenLimit, type TokenOrganization, type TrustConfig, type ValidateAuthOptions, type ValidateSignOptions, type VerifiedIdentity, type VerifiedSignature, acspV2Digest, buildAcspV2Payload, buildDeviceLink, interactionsToBase64, parseSessionResult, parseSubject, personMatchesCertificate, pkceChallenge, qrDeviceLinkTicker, randomChallenge, resolveBaseUrl, sha256Base64, tokenAuthDigest, tokenLimitOf, userChallengeOf, verifyPayloadSignature, verifyPrehashedSignature, verifyTokenCertificates };