@gerege-systems/eid-mongolia-sdk 0.35.0 → 0.37.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/README.md +37 -27
- package/dist/{browser-CCP--VGv.d.ts → browser-CxTMnKOc.d.ts} +2 -3
- package/dist/{browser-w1Ca6FdZ.d.cts → browser-DdxKtnvo.d.cts} +2 -3
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/button.cjs +265 -46
- package/dist/button.d.cts +10 -3
- package/dist/button.d.ts +10 -3
- package/dist/button.js +263 -46
- package/dist/index.cjs +812 -836
- package/dist/index.d.cts +130 -115
- package/dist/index.d.ts +130 -115
- package/dist/index.js +386 -409
- package/package.json +1 -1
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 PersonBlock, b as RepresentationsResponse, A as AcspContext, F as FlowType } from './browser-
|
|
2
|
-
export { c as DEFAULT_SIGN_SESSION_TTL_MS, E as EndResult, d as NavigatorLike, O as OrgResult, e as Representation, f as SessionPresentation, g as SessionState, h as SignContext, i as SignatureAlgorithmParameters, j as SignatureProtocol, T as TokenCertSessionBlock, k as TokenCertStatus, l as isMobileUserAgent, p as parseExpiresAt, s as sessionExpiry, m as startExpiry } from './browser-
|
|
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 RepresentationsResponse, A as AcspContext, F as FlowType } from './browser-CxTMnKOc.js';
|
|
2
|
+
export { c as DEFAULT_SIGN_SESSION_TTL_MS, E as EndResult, d as NavigatorLike, O as OrgResult, e as Representation, f as SessionPresentation, g as SessionState, h as SignContext, i as SignatureAlgorithmParameters, j as SignatureProtocol, T as TokenCertSessionBlock, k as TokenCertStatus, l as isMobileUserAgent, p as parseExpiresAt, s as sessionExpiry, m as startExpiry } from './browser-CxTMnKOc.js';
|
|
3
3
|
import { O as OnBehalfErrorCode, R as RetryableErrorCode, E as EidError, A as ApiError, H as HttpErrorInit } from './errors-CgJcEjrZ.js';
|
|
4
4
|
export { a as AppTransactionTooLargeError, b as AuthenticationError, C as CertChoiceInvalidError, D as DeviceLinkError, F as ForbiddenError, N as NetworkError, c as NoSigningCertificateError, d as ON_BEHALF_ERROR_CODES, P as PDF_REGISTER_ERROR_CODES, e as PdfRegisterErrorCode, Q as QrTokenInvalidError, f as RETRYABLE_ERROR_CODES, g as RequestInvalidError, h as ResponseTooLargeError, S as SessionFailedError, V as ValidationError, p as parseRetryAfter } from './errors-CgJcEjrZ.js';
|
|
5
5
|
import { X509Certificate, KeyObject } from 'node:crypto';
|
|
@@ -821,6 +821,13 @@ declare class ResponseValidator {
|
|
|
821
821
|
* @internal
|
|
822
822
|
*/
|
|
823
823
|
verifyTokenAuthCertificate(leaf: X509Certificate): void;
|
|
824
|
+
/**
|
|
825
|
+
* «Миний QR» (`verifyQrPresentation`)-ийн гарын үсэгтний гэрчилгээ, цаг `nowMs` ± `skewMs`: CA биш, хугацаа,
|
|
826
|
+
* зориулалт (sign — contentCommitment, `checkKeyUsage`-ээс үл хамааран), trust anchor хүртэлх гинж (anchor ЗААВАЛ),
|
|
827
|
+
* issuer allowlist, түвшин (qcStatements, `requiredLevel`). Шууд issuer-ийг (revocation-д) буцаана.
|
|
828
|
+
* @internal
|
|
829
|
+
*/
|
|
830
|
+
verifyQrSigner(leaf: X509Certificate, nowMs: number, skewMs: number): X509Certificate | undefined;
|
|
824
831
|
/** Зориулалт (protocol), гинж, issuer — хугацаа/түвшнийг дуудагч шалгасан. */
|
|
825
832
|
private verifyCertificate;
|
|
826
833
|
/**
|
|
@@ -1118,30 +1125,31 @@ declare function tokenAuthDigest(rpUUID: string, challengeB64: string): Buffer;
|
|
|
1118
1125
|
*/
|
|
1119
1126
|
declare function tokenLimitOf(err: unknown): TokenLimit | undefined;
|
|
1120
1127
|
|
|
1121
|
-
/** Аттрибутын каталог (CA гэрээ v1, 2026-10-23). */
|
|
1122
|
-
declare const QR_ATTRIBUTES: readonly ["age_over_18", "age_over_21", "full_name", "phone", "birth_date", "civil_id"];
|
|
1123
|
-
type QrAttribute = (typeof QR_ATTRIBUTES)[number];
|
|
1124
1128
|
/** Иргэний аппын QR-ийн угтвар: `EIDMN-QR1:<token>`. */
|
|
1125
1129
|
declare const QR_PREFIX = "EIDMN-QR1:";
|
|
1126
1130
|
declare const DEFAULT_QR_ISSUER = "https://ca.eidmongolia.mn";
|
|
1127
|
-
|
|
1128
|
-
declare const
|
|
1129
|
-
/**
|
|
1130
|
-
declare const
|
|
1131
|
-
/**
|
|
1132
|
-
declare const
|
|
1131
|
+
/** `iat` / `exp` / гэрчилгээний хугацааны зөрүү (с). */
|
|
1132
|
+
declare const QR_CLOCK_SKEW_SECONDS = 60;
|
|
1133
|
+
/** `exp − iat`-ийн дээд хэмжээ (с). */
|
|
1134
|
+
declare const QR_MAX_AGE_SECONDS = 300;
|
|
1135
|
+
/** Өгөгдлийн хязгаар (гэрээний §1.3) — CA, апп, SDK гурвуулаа шалгана. */
|
|
1136
|
+
declare const QR_LIMITS: Readonly<{
|
|
1137
|
+
maxFields: 128;
|
|
1138
|
+
maxKeyChars: 64;
|
|
1139
|
+
maxValueBytes: 2048;
|
|
1140
|
+
maxPhotoBytes: 153600;
|
|
1141
|
+
}>;
|
|
1133
1142
|
/**
|
|
1134
|
-
*
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1137
|
-
* - `
|
|
1138
|
-
* - `
|
|
1139
|
-
* - `
|
|
1140
|
-
* - `
|
|
1141
|
-
* - `QR_PENDING` — `qr.result`-ийн
|
|
1142
|
-
* идэвхтэй хэвээр) — дахин `result` / `check` дуудаж болно. CA-ийн жинхэнэ хугацаа дуусалт = SessionFailedError TIMEOUT.
|
|
1143
|
+
* Клиент талын алдааны кодууд ({@link QrError.code}, гэрээний §6.2). CA-ийн кодууд (`QR_TOKEN_INVALID` 404,
|
|
1144
|
+
* `PERMISSION_DENIED` / `RP_REQUIRED` 403, `NO_SIGNING_CERTIFICATE` 409, `REQUEST_INVALID` 400, `RATE_LIMITED` 429)
|
|
1145
|
+
* өөрчлөгдөхгүй `ApiError` / `ForbiddenError`-ийн `code`-д ирнэ; зөвхөн `GET /session`-ийн 410 → `QR_PRESENTATION_GONE`.
|
|
1146
|
+
* - `QR_FORMAT_INVALID` — скан хийсэн мөр eID «Миний QR» биш (CA руу явахгүй)
|
|
1147
|
+
* - `QR_JWS_MALFORMED` … `QR_DATA_INVALID` — presentation-ийн шалгалт унасан — хариунд ИТГЭХГҮЙ
|
|
1148
|
+
* - `QR_REVOCATION_UNKNOWN` — OCSP хариу аваагүй (hard-fail; түр — дахин `verify` хийж болно)
|
|
1149
|
+
* - `QR_PRESENTATION_GONE` — presentation аль хэдийн уншигдсан эсвэл хугацаа нь дууссан → шинэ QR уншуулна
|
|
1150
|
+
* - `QR_PENDING` — `qr.result`-ийн `maxWaitMs` дууссан ч иргэн хараахан хариулаагүй — дахин `result` / `check`
|
|
1143
1151
|
*/
|
|
1144
|
-
declare const QR_ERROR_CODES: readonly ["QR_FORMAT_INVALID", "
|
|
1152
|
+
declare const QR_ERROR_CODES: readonly ["QR_FORMAT_INVALID", "QR_JWS_MALFORMED", "QR_HEADER_INVALID", "QR_CHAIN_INVALID", "QR_CERT_REVOKED", "QR_REVOCATION_UNKNOWN", "QR_SIGNATURE_INVALID", "QR_CLAIMS_INVALID", "QR_AUDIENCE_MISMATCH", "QR_SESSION_MISMATCH", "QR_NONCE_MISMATCH", "QR_NOT_YET_VALID", "QR_EXPIRED", "QR_DATA_INVALID", "QR_PRESENTATION_GONE", "QR_PENDING"];
|
|
1145
1153
|
type QrErrorCode = (typeof QR_ERROR_CODES)[number];
|
|
1146
1154
|
/** «Миний QR»-ийн клиент талын алдаа. */
|
|
1147
1155
|
declare class QrError extends EidError {
|
|
@@ -1149,141 +1157,148 @@ declare class QrError extends EidError {
|
|
|
1149
1157
|
readonly reason: string;
|
|
1150
1158
|
constructor(code: QrErrorCode, reason: string);
|
|
1151
1159
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1160
|
+
interface ParsedQr {
|
|
1161
|
+
token: string;
|
|
1162
|
+
/** Хэвийн болгосон QR мөр (`EIDMN-QR1:<token>`, хоосон зайгүй). */
|
|
1163
|
+
qr: string;
|
|
1164
|
+
}
|
|
1154
1165
|
interface QrConfig {
|
|
1155
|
-
/**
|
|
1156
|
-
jwksUrl?: string;
|
|
1157
|
-
/** Хүлээгдэх `iss`; анхдагч {@link DEFAULT_QR_ISSUER}. */
|
|
1166
|
+
/** Хүлээгдэх `iss`; анхдагч {@link DEFAULT_QR_ISSUER} (тест орчинд л). */
|
|
1158
1167
|
issuer?: string;
|
|
1159
|
-
jwksCacheTtlMs?: number;
|
|
1160
|
-
maxAgeMs?: number;
|
|
1161
1168
|
}
|
|
1162
1169
|
interface QrStartInput {
|
|
1163
|
-
/** Скан хийсэн агуулга (`EIDMN-QR1:<token>`)
|
|
1170
|
+
/** Скан хийсэн агуулга (`EIDMN-QR1:<token>`). */
|
|
1164
1171
|
qr: string;
|
|
1165
|
-
/**
|
|
1166
|
-
attributes: readonly QrAttribute[];
|
|
1167
|
-
/** RP-ийн nonce (сонголттой) — JWS-ийн `nonce`-д буцна; өгөөгүй бол rpChallenge. */
|
|
1172
|
+
/** RP-ийн nonce (16–128 байт, ASCII 0x21–0x7E) — JWS-ийн `nonce`-д буцна. Өгөөгүй бол base64url(16 санамсаргүй байт). */
|
|
1168
1173
|
nonce?: string;
|
|
1174
|
+
/** Касс / дэд системийн нэр (зөвхөн CA-ийн логт). Анхдагч `credentials.rpName`. */
|
|
1175
|
+
relyingPartyName?: string;
|
|
1169
1176
|
}
|
|
1170
|
-
/** `qr.start`-ийн хариу — JSON-оор хадгалж (stateless backend) `qr.result
|
|
1177
|
+
/** `qr.start`-ийн хариу — JSON-оор хадгалж (stateless backend) `qr.result` / `check`-д дамжуулна. */
|
|
1171
1178
|
interface QrSession {
|
|
1172
1179
|
sessionId: string;
|
|
1173
|
-
vc: string;
|
|
1174
1180
|
nonce: string;
|
|
1175
|
-
attributes: QrAttribute[];
|
|
1176
|
-
/** CA-ийн session дуусах мөч (мс epoch), байвал. */
|
|
1177
|
-
expiresAt?: number;
|
|
1178
1181
|
}
|
|
1179
|
-
interface
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
+
interface QrClaims {
|
|
1183
|
+
iss: string;
|
|
1184
|
+
/** Гарын үсэгтний ETSI (`PNOMN-…`) — x5c[0]-ийн subject serialNumber. */
|
|
1185
|
+
sub: string;
|
|
1186
|
+
/** RP UUID. */
|
|
1187
|
+
aud: string;
|
|
1188
|
+
/** CA-ийн бүртгэлтэй RP нэр. */
|
|
1189
|
+
rp_name: string;
|
|
1190
|
+
sid: string;
|
|
1191
|
+
nonce: string;
|
|
1192
|
+
iat: number;
|
|
1193
|
+
exp: number;
|
|
1194
|
+
/** Иргэний PIN2-оор зөвшөөрсөн өгүүлбэр. */
|
|
1195
|
+
statement: string;
|
|
1196
|
+
data: {
|
|
1197
|
+
source: string;
|
|
1198
|
+
fields: Record<string, string>;
|
|
1199
|
+
photo?: string;
|
|
1200
|
+
};
|
|
1182
1201
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
civil_id?: string;
|
|
1202
|
+
interface QrSigner {
|
|
1203
|
+
certificate: X509Certificate;
|
|
1204
|
+
/** = `claims.sub`. */
|
|
1205
|
+
etsi: string;
|
|
1206
|
+
givenName?: string;
|
|
1207
|
+
surname?: string;
|
|
1208
|
+
commonName?: string;
|
|
1191
1209
|
}
|
|
1210
|
+
/** Шалгагдсан presentation. */
|
|
1192
1211
|
interface QrPresentation {
|
|
1193
|
-
/** Энэ RP-д зориулсан тогтмол pairwise id (иргэний дугаар биш). */
|
|
1194
|
-
sub: string;
|
|
1195
|
-
attrs: QrAttrs;
|
|
1196
|
-
/** Хүссэн боловч бүртгэлд байхгүй (алдаа биш). */
|
|
1197
|
-
unavailable: QrAttribute[];
|
|
1198
|
-
sessionId: string;
|
|
1199
|
-
/** `iat`, мс epoch. */
|
|
1200
|
-
issuedAt: number;
|
|
1201
|
-
/** Түүхий compact JWS (аудитад хадгалж болно). */
|
|
1202
1212
|
jws: string;
|
|
1213
|
+
claims: QrClaims;
|
|
1214
|
+
/** «Миний мэдээлэл» — түлхүүр/утга яг апп дээр хадгалсан хэлбэрээр (payload-ийн дарааллаар). */
|
|
1215
|
+
data: Record<string, string>;
|
|
1216
|
+
/** Иргэний таних мэдээллийн эх сурвалж (`dan`, `passport`, `citizenid`, `gsign`, `guardian`, `unknown`…). */
|
|
1217
|
+
source: string;
|
|
1218
|
+
/** Нүүрний зураг (JPEG байт), байвал. */
|
|
1219
|
+
photo?: Uint8Array;
|
|
1220
|
+
signer: QrSigner;
|
|
1221
|
+
/** `iat`. */
|
|
1222
|
+
signedAt: Date;
|
|
1223
|
+
/** hex SHA-256(signingInput) — CA-ийн аудитын `qrsha`-тай тэнцүү (маргаанд тулгах). */
|
|
1224
|
+
sha256: string;
|
|
1203
1225
|
}
|
|
1204
|
-
/** `qr.check`-ийн хариу: иргэн хараахан хариулаагүй, эсвэл шалгагдсан presentation. */
|
|
1205
|
-
type QrCheck = {
|
|
1206
|
-
state: "RUNNING";
|
|
1207
|
-
} | {
|
|
1208
|
-
state: "COMPLETE";
|
|
1209
|
-
presentation: QrPresentation;
|
|
1210
|
-
};
|
|
1211
1226
|
interface QrExpect {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
audience: string;
|
|
1227
|
+
/** RP UUID (том/жижиг үсэг ялгахгүй). */
|
|
1228
|
+
rpUUID: string;
|
|
1215
1229
|
sessionId: string;
|
|
1216
1230
|
nonce: string;
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
}
|
|
1222
|
-
interface Jwk {
|
|
1223
|
-
kty?: string;
|
|
1224
|
-
crv?: string;
|
|
1225
|
-
x?: string;
|
|
1226
|
-
y?: string;
|
|
1227
|
-
kid?: string;
|
|
1228
|
-
alg?: string;
|
|
1229
|
-
use?: string;
|
|
1230
|
-
}
|
|
1231
|
-
interface Jwks {
|
|
1232
|
-
keys: Jwk[];
|
|
1231
|
+
/** Анхдагч {@link DEFAULT_QR_ISSUER}. */
|
|
1232
|
+
issuer?: string;
|
|
1233
|
+
/** Анхдагч одоо. */
|
|
1234
|
+
now?: Date;
|
|
1233
1235
|
}
|
|
1236
|
+
/** `qr.check`-ийн хариу: иргэн хараахан хариулаагүй, эсвэл шалгагдсан presentation. */
|
|
1237
|
+
type QrCheck = {
|
|
1238
|
+
complete: false;
|
|
1239
|
+
} | {
|
|
1240
|
+
complete: true;
|
|
1241
|
+
result: QrPresentation;
|
|
1242
|
+
};
|
|
1234
1243
|
/**
|
|
1235
|
-
*
|
|
1236
|
-
*
|
|
1237
|
-
* {@link QrError} `QR_PRESENTATION_INVALID` — хариунд ИТГЭХГҮЙ. Сүлжээгүй (хадгалсан presentation-ийг дахин шалгах, тест).
|
|
1244
|
+
* Скан хийсэн мөр → `{ token, qr }` (гэрээний §1.2): ASCII хоосон зай хасна; `EIDMN-QR1:` угтвар + 43 тэмдэгт base64url
|
|
1245
|
+
* токен. Бусад → {@link QrError} `QR_FORMAT_INVALID`.
|
|
1238
1246
|
*/
|
|
1239
|
-
declare function
|
|
1247
|
+
declare function parseQr(scanned: string): ParsedQr;
|
|
1248
|
+
/** «Миний QR»-ийн өгүүлбэр (гэрээний §1.4): иргэн PIN2-оор яг үүнийг зөвшөөрсөн. */
|
|
1249
|
+
declare function qrStatement(rpName: string): string;
|
|
1250
|
+
/**
|
|
1251
|
+
* «Миний QR» presentation-ийг шалгана (гэрээний §6.1, эхний алдаан дээр зогсоно): хэлбэр, header (`alg` PS256, `typ`
|
|
1252
|
+
* eidmn-myqr+jwt, `x5c` [гэрчилгээ, олгогч CA], өөр гишүүнгүй), гинж (x5c[1] ∪ trust.intermediates → trust anchor, цаг
|
|
1253
|
+
* ± 60 с; CA биш, KU contentCommitment, QUALIFIED, issuer allowlist, RSA ≥ 2048), цуцлалт (`trust.revocation`, алга бол
|
|
1254
|
+
* SDK-ийн OCSP; анхдагч hard-fail), PS256 гарын үсэг, claim (`iss`, `sub` = гэрчилгээний serialNumber, өгүүлбэр, `aud`,
|
|
1255
|
+
* `sid`, `nonce`, хугацаа), өгөгдлийн хязгаар. Алдаа бол {@link QrError} (§6.2-ийн код) — хариунд ИТГЭХГҮЙ.
|
|
1256
|
+
*
|
|
1257
|
+
* Итгэлцэл: `trust.trustAnchorsPem` алга бол {@link NATIONAL_ROOT_CA_PEM}; `intermediatesPem` алга бол
|
|
1258
|
+
* {@link CITIZEN_INTERMEDIATES_PEM}; issuer allowlist, `revocationMode` нь `TrustConfig`-ийн дүрмээр. `allowUntrusted`,
|
|
1259
|
+
* `checkKeyUsage: false` энд үйлчлэхгүй; түвшин үргэлж ≥ QUALIFIED.
|
|
1260
|
+
*/
|
|
1261
|
+
declare function verifyQrPresentation(jws: string, expect: QrExpect, trust: TrustConfig): Promise<QrPresentation>;
|
|
1240
1262
|
interface QrApiDeps {
|
|
1241
1263
|
http: Http;
|
|
1242
1264
|
session: SessionApi;
|
|
1243
1265
|
credentials: RpCredentials;
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1266
|
+
/** Клиентийн TrustConfig (`ClientConfig.trust`). */
|
|
1267
|
+
trust?: TrustConfig;
|
|
1268
|
+
/** Хүлээгдэх `iss` (`ClientConfig.qr.issuer`); анхдагч {@link DEFAULT_QR_ISSUER}. */
|
|
1269
|
+
issuer?: string;
|
|
1248
1270
|
}
|
|
1249
|
-
/** `client.qr` — «Миний QR»: parse → start → result. */
|
|
1271
|
+
/** `client.qr` — «Миний QR»: parse → start → result / check. */
|
|
1250
1272
|
declare class QrApi {
|
|
1251
1273
|
private readonly d;
|
|
1252
|
-
private jwks;
|
|
1253
|
-
private fetchedAt;
|
|
1254
|
-
private lastAttempt;
|
|
1255
|
-
private inflight;
|
|
1256
1274
|
constructor(d: QrApiDeps);
|
|
1257
1275
|
/** {@link parseQr}. */
|
|
1258
|
-
parse(scanned: string):
|
|
1276
|
+
parse(scanned: string): ParsedQr;
|
|
1259
1277
|
/**
|
|
1260
|
-
* `POST /authentication/qr` — QR-ийн токеныг (нэг удаагийн) CA-д өгч иргэний утас руу хүсэлт
|
|
1261
|
-
*
|
|
1262
|
-
*
|
|
1278
|
+
* `POST /authentication/qr` — QR-ийн токеныг (нэг удаагийн) CA-д өгч иргэний утас руу хүсэлт илгээнэ (VC алга). Буруу
|
|
1279
|
+
* мөр → {@link QrError} `QR_FORMAT_INVALID` (CA руу явахгүй). CA-ийн алдаа: 404 `QrTokenInvalidError` (шинэ QR), 409
|
|
1280
|
+
* `NoSigningCertificateError`, 403 `ForbiddenError` (`PERMISSION_DENIED` — `QR_PRESENT` алга, `RP_REQUIRED`), 400
|
|
1281
|
+
* `RequestInvalidError` (nonce буруу г.м.), 429 `RATE_LIMITED`.
|
|
1263
1282
|
*/
|
|
1264
1283
|
start(input: QrStartInput): Promise<QrSession>;
|
|
1265
1284
|
/**
|
|
1266
|
-
* Session дуустал long-poll хийж presentation-ийг
|
|
1267
|
-
* SessionFailedError (`
|
|
1268
|
-
*
|
|
1285
|
+
* Session дуустал long-poll хийж presentation-ийг {@link verifyQrPresentation}-аар шалгана. Татгалзсан / хугацаа
|
|
1286
|
+
* дууссан → SessionFailedError (`endResult`); `maxWaitMs` дуусахад иргэн хариулаагүй → `QR_PENDING`; 410 →
|
|
1287
|
+
* `QR_PRESENTATION_GONE` (CA presentation-ийг нэг л удаа өгнө — шинэ QR уншуулна).
|
|
1269
1288
|
*/
|
|
1270
1289
|
result(session: QrSession, opts?: {
|
|
1271
1290
|
maxWaitMs?: number;
|
|
1272
1291
|
serverPollMs?: number;
|
|
1273
1292
|
}): Promise<QrPresentation>;
|
|
1274
|
-
/**
|
|
1275
|
-
* Нэг удаагийн шалгалт (polling UI-д): `GET /session/{id}` (`serverPollMs` хүртэл, анхдагч 1000 мс) — иргэн хараахан
|
|
1276
|
-
* хариулаагүй бол `{ state: "RUNNING" }`, зөвшөөрсөн бол JWS/JWKS-ээр шалгасан `{ state: "COMPLETE", presentation }`.
|
|
1277
|
-
* Татгалзсан / CA-ийн хугацаа дууссан бол SessionFailedError; бусад алдаа {@link result}-тэй ижил.
|
|
1278
|
-
*/
|
|
1293
|
+
/** Нэг удаагийн шалгалт (polling UI): `GET /session/{id}` (`serverPollMs` хүртэл, анхдагч 1000 мс). Алдаа {@link result}-тэй ижил. */
|
|
1279
1294
|
check(session: QrSession, opts?: {
|
|
1280
1295
|
serverPollMs?: number;
|
|
1281
1296
|
}): Promise<QrCheck>;
|
|
1297
|
+
/** Presentation JWS-ийг шалгана; `rpUUID` анхдагч `credentials.rpUUID`, `issuer` — клиентийн тохиргоо. */
|
|
1298
|
+
verify(jws: string, expect: Omit<QrExpect, "rpUUID"> & {
|
|
1299
|
+
rpUUID?: string;
|
|
1300
|
+
}): Promise<QrPresentation>;
|
|
1282
1301
|
private finish;
|
|
1283
|
-
/** Хадгалсан presentation JWS-ийг QrSession-тэй тулгаж шалгана (JWKS кэш; танихгүй kid → нэг удаа дахин татна). */
|
|
1284
|
-
verify(jws: string, session: QrSession): Promise<QrPresentation>;
|
|
1285
|
-
private keys;
|
|
1286
|
-
private fetchJwks;
|
|
1287
1302
|
}
|
|
1288
1303
|
|
|
1289
1304
|
/** Хүсэлтийн хугацаа: CA бүх хүлээн авагчид 120 с-д илгээнэ, nginx 150 с. */
|
|
@@ -1409,7 +1424,7 @@ interface ClientConfig {
|
|
|
1409
1424
|
signSessionTtlMs?: number;
|
|
1410
1425
|
/** Trust anchor (Root CA) — validator-д. Production-д ЗААВАЛ. */
|
|
1411
1426
|
trust?: TrustConfig;
|
|
1412
|
-
/** «Миний QR»-ийн presentation шалгалт (
|
|
1427
|
+
/** «Миний QR»-ийн presentation шалгалт (хүлээгдэх `issuer`). Анхдагч = prod CA. */
|
|
1413
1428
|
qr?: QrConfig;
|
|
1414
1429
|
}
|
|
1415
1430
|
/** RP-API-ийн албан ёсны хост (2026-09-28-наас бүх RP, /v3-гүй). */
|
|
@@ -1424,7 +1439,7 @@ declare class EidClient {
|
|
|
1424
1439
|
readonly organization: OrganizationApi;
|
|
1425
1440
|
readonly person: PersonApi;
|
|
1426
1441
|
readonly token: TokenApi;
|
|
1427
|
-
/** «Миний QR» (биечлэн шалгах): parse → start → result. */
|
|
1442
|
+
/** «Миний QR» (биечлэн шалгах): parse → start → result / check. */
|
|
1428
1443
|
readonly qr: QrApi;
|
|
1429
1444
|
readonly session: SessionApi;
|
|
1430
1445
|
readonly validator: ResponseValidator;
|
|
@@ -1837,4 +1852,4 @@ declare function withReturnHint(callbackUrl: string, userAgent: string): string;
|
|
|
1837
1852
|
*/
|
|
1838
1853
|
declare function createEidLogin(opts: EidLoginOptions): EidLogin;
|
|
1839
1854
|
|
|
1840
|
-
export { APP_ATTESTATION_INVALID, AcspContext, type AcspV2Params, type ActivityCounts, type ActivityItem, type ActivityQuery, ApiError, AuthApi, type AuthDefaults, type AuthOptions, type BuildDeviceLinkInput, CITIZEN_INTERMEDIATES_PEM, CITIZEN_ISSUING_CA_SKI, CSR_KEY_REUSED, type CertChoiceOptions, type CertCounts, type CertSubject, CertificateLevel, type ClientConfig, type CompletedForRegistration, DEFAULT_BASE_URL, DEFAULT_MAX_WAIT_MS, DEFAULT_PDF_TIMEOUT_MS, DEFAULT_QR_ISSUER,
|
|
1855
|
+
export { APP_ATTESTATION_INVALID, AcspContext, type AcspV2Params, type ActivityCounts, type ActivityItem, type ActivityQuery, ApiError, AuthApi, type AuthDefaults, type AuthOptions, type BuildDeviceLinkInput, CITIZEN_INTERMEDIATES_PEM, CITIZEN_ISSUING_CA_SKI, CSR_KEY_REUSED, type CertChoiceOptions, type CertCounts, type CertSubject, CertificateLevel, type ClientConfig, type CompletedForRegistration, DEFAULT_BASE_URL, DEFAULT_MAX_WAIT_MS, DEFAULT_PDF_TIMEOUT_MS, DEFAULT_QR_ISSUER, DEFAULT_SHARE_TIMEOUT_MS, DeviceLinkSession, type DeviceLinkSessionType, type DeviceLinkType, EidClient, EidError, type EidLogin, type EidLoginContext, type EidLoginEvent, type EidLoginEventKind, type EidLoginIdentity, type EidLoginMode, type EidLoginOptions, type EidLoginRateLimitFn, type EidLoginRateLimits, type EidLoginRateRule, type EidLoginRequest, type EidLoginResponse, type EidLoginStore, type EidLoginSuccess, type EidLoginTx, FlowType, HashAlgorithm, Http, type HttpConfig, HttpErrorInit, Interaction, KYC_INCOMPLETE, LoginStoreFullError, MAX_APP_TRANSACTION_BYTES, MEMORY_LOGIN_STORE_MAX, NATIONAL_ROOT_CA_PEM, NO_ACTIVE_DEVICE, NotificationSession, type OcspCheckerOptions, OnBehalfErrorCode, OrganizationApi, PDF_SIGNATURE_REGISTER_FIELDS, type ParsedQr, type PdfDigestInput, type PdfDigestSession, type PdfDigestSigner, type PersonActivity, PersonApi, PersonBlock, type PersonCertificate, type PersonCertificates, type PersonChild, type PersonChildren, type PersonDevice, type PersonDevices, type PersonSummary, type PriorSignature, QR_CLOCK_SKEW_SECONDS, QR_ERROR_CODES, QR_LIMITS, QR_MAX_AGE_SECONDS, QR_PREFIX, QrApi, type QrApiDeps, type QrCheck, type QrClaims, type QrConfig, type QrDeviceLinkTickerOptions, QrError, type QrErrorCode, type QrExpect, type QrPresentation, type QrSession, type QrSigner, type QrStartInput, type RegisterSignatureInput, type RegisterSignatureResult, RepresentationsResponse, ResponseValidator, RetryableErrorCode, type RevocationChecker, type RevocationOutcome, type RevocationStatus, RpCredentials, SHARE_ERROR_CODES, SHARE_FORM_FIELDS, SessionApi, SessionResult, type SessionTtl, ShareError, type ShareErrorCode, type ShareInfo, type ShareInput, type ShareNotSignedReason, type ShareResult, SignApi, type SignDefaults, type SignOptions, SignatureAlgorithm, type Signer, type SignerRef, TOKEN_CONFLICT_CODES, TOKEN_ERROR_CODES, TOKEN_ISSUANCE_PENDING, TokenApi, type TokenAuthChallenge, type TokenAuthResult, type TokenCertInfo, type TokenCertInput, type TokenCertItem, type TokenCertPreview, type TokenCertResult, type TokenCertStart, type TokenConflictCode, type TokenErrorCode, type TokenIdentity, type TokenLimit, type TokenOrganization, type TrustConfig, type ValidateAuthOptions, type ValidateSignOptions, type VerifiedIdentity, type VerifiedSignature, WAIT_GRACE_MS, acspV2Digest, buildAcspV2Payload, buildDeviceLink, buildRegisterBody, certificateLevelOf, createEidLogin, defaultRateLimit, deviceLinkInput, forwardedClientIp, interactionsToBase64, memoryLoginStore, ocspRevocationChecker, parseQr, parseSessionResult, parseSubject, personMatchesCertificate, qrDeviceLinkTicker, qrStatement, randomChallenge, registrationFromCompleted, resolveBaseUrl, sha256Base64, tokenAuthDigest, tokenLimitOf, userChallengeOf, verifyPayloadSignature, verifyPrehashedSignature, verifyQrPresentation, verifyTokenCertificates, withReturnHint };
|