@gerege-systems/eid-mongolia-sdk 0.31.0 → 0.32.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 +10 -0
- package/dist/browser.d.cts +17 -1
- package/dist/browser.d.ts +17 -1
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +14 -0
- package/dist/pades.d.cts +3 -24
- package/dist/pades.d.ts +3 -24
- package/dist/{browser-B3cWNpRM.d.cts → types-ByGHVzuP.d.cts} +50 -17
- package/dist/{browser-X_HjiWxc.d.ts → types-ByGHVzuP.d.ts} +50 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -684,7 +684,17 @@ const p = await prepare(pdfBytes, { signerCert, verifyPage: true, fileName: "Г
|
|
|
684
684
|
`width·height` байт, `sha256` жижиг hex) бол `REQUEST_INVALID`. Зургийн sha256 `complete().images` →
|
|
685
685
|
`registrationFromCompleted` → `images` болж CA-д очно. Дүрэм: `APPEARANCE_SPEC.md` §6, `PLACEMENT_SPEC.md` §6c.
|
|
686
686
|
|
|
687
|
+
Зургийг RP backend-ээс (0.32.0+): `eid.person.signatureImage(personEtsi)` → `GET /person/etsi/{personEtsi}/signature-image`
|
|
688
|
+
(**SIGN** эрх + иргэн сүүлийн 24 цагт нэвтэрсэн; зураг хадгалаагүй бол `null`, 403 → `ForbiddenError`) →
|
|
689
|
+
`EidImage { png, sha256, width, height, updatedAt, pdfImage }`; тамга — `organization.getRepresentations()`-ийн
|
|
690
|
+
`representations[].stampImage` (`stampImageSet` — бий эсэх; зураг зөвхөн SIGN эрхтэй RP-д). `pdfImage`-ийг хэвээр дамжуулна:
|
|
691
|
+
|
|
687
692
|
```ts
|
|
693
|
+
// backend
|
|
694
|
+
const sig = await eid.person.signatureImage(signerEtsi); // EidImage | null
|
|
695
|
+
const rep = (await eid.organization.getRepresentations(signerEtsi)).representations.find((r) => r.orgEtsi === orgEtsi);
|
|
696
|
+
const signatureImage = sig?.pdfImage, stampImage = rep?.stampImage?.pdfImage;
|
|
697
|
+
// клиент (/pades)
|
|
688
698
|
const p = await prepare(pdfBytes, { signerCert, claimedRole, verifyPage: true, fileName: "Гэрээ №12.pdf",
|
|
689
699
|
appearance: { x: 340, y: 36, width: 0, height: 0, signatureImage, stampImage } }); // 240 × 147.5
|
|
690
700
|
```
|
package/dist/browser.d.cts
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
export { D as DeviceLinkSession, d as NavigatorLike, k as isMobileUserAgent } from './browser-B3cWNpRM.cjs';
|
|
2
1
|
export { D as DeviceLinkError, E as EidError } from './errors-3JEfE-FW.cjs';
|
|
2
|
+
export { D as DeviceLinkSession } from './types-ByGHVzuP.cjs';
|
|
3
|
+
|
|
4
|
+
/** isMobileUserAgent-ийн уншдаг navigator-ийн хэсэг (тестэд орлуулна). */
|
|
5
|
+
interface NavigatorLike {
|
|
6
|
+
userAgent?: string;
|
|
7
|
+
maxTouchPoints?: number;
|
|
8
|
+
userAgentData?: {
|
|
9
|
+
mobile?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Анхдагч гар утас/таблет илрүүлэгч: Android, iPhone/iPod/iPad, UA-CH `mobile`, мөн desktop UA
|
|
14
|
+
* илгээдэг iPadOS (Macintosh + мэдрэгч дэлгэц, maxTouchPoints > 1).
|
|
15
|
+
*/
|
|
16
|
+
declare function isMobileUserAgent(nav?: NavigatorLike): boolean;
|
|
17
|
+
|
|
18
|
+
export { type NavigatorLike, isMobileUserAgent };
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
export { D as DeviceLinkSession, d as NavigatorLike, k as isMobileUserAgent } from './browser-X_HjiWxc.js';
|
|
2
1
|
export { D as DeviceLinkError, E as EidError } from './errors-3JEfE-FW.js';
|
|
2
|
+
export { D as DeviceLinkSession } from './types-ByGHVzuP.js';
|
|
3
|
+
|
|
4
|
+
/** isMobileUserAgent-ийн уншдаг navigator-ийн хэсэг (тестэд орлуулна). */
|
|
5
|
+
interface NavigatorLike {
|
|
6
|
+
userAgent?: string;
|
|
7
|
+
maxTouchPoints?: number;
|
|
8
|
+
userAgentData?: {
|
|
9
|
+
mobile?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Анхдагч гар утас/таблет илрүүлэгч: Android, iPhone/iPod/iPad, UA-CH `mobile`, мөн desktop UA
|
|
14
|
+
* илгээдэг iPadOS (Macintosh + мэдрэгч дэлгэц, maxTouchPoints > 1).
|
|
15
|
+
*/
|
|
16
|
+
declare function isMobileUserAgent(nav?: NavigatorLike): boolean;
|
|
17
|
+
|
|
18
|
+
export { type NavigatorLike, isMobileUserAgent };
|
package/dist/index.cjs
CHANGED
|
@@ -391,6 +391,7 @@ var RP_ROUTES = {
|
|
|
391
391
|
personActivity: { method: "GET", path: "/rp/activity/etsi/{personEtsi}" },
|
|
392
392
|
personSummary: { method: "GET", path: "/person/summary/etsi/{personEtsi}" },
|
|
393
393
|
personChildren: { method: "GET", path: "/person/children/etsi/{personEtsi}" },
|
|
394
|
+
personSignatureImage: { method: "GET", path: "/person/etsi/{personEtsi}/signature-image" },
|
|
394
395
|
tokenCertificate: { method: "POST", path: "/token/certificate" },
|
|
395
396
|
tokenCertificateResult: { method: "GET", path: "/token/certificate/{sessionID}" },
|
|
396
397
|
pdfSignatures: { method: "POST", path: "/pdf/signatures" },
|
|
@@ -1162,6 +1163,19 @@ var PersonApi = class {
|
|
|
1162
1163
|
children(personEtsi) {
|
|
1163
1164
|
return this.get(routePath(RP_ROUTES.personChildren, personEtsi));
|
|
1164
1165
|
}
|
|
1166
|
+
/**
|
|
1167
|
+
* GET /person/etsi/{personEtsi}/signature-image — иргэний гарын үсгийн зураг (харагдах гарын үсэгт:
|
|
1168
|
+
* `appearance.signatureImage = img.pdfImage`). PKI_READ биш, **SIGN** эрх; иргэн сүүлийн 24 цагт танай RP-ээр
|
|
1169
|
+
* нэвтэрсэн байх ёстой (эс бөгөөс `ForbiddenError`). Иргэн зураг хадгалаагүй (404) бол `null`.
|
|
1170
|
+
*/
|
|
1171
|
+
async signatureImage(personEtsi) {
|
|
1172
|
+
try {
|
|
1173
|
+
return rec3(await this.http.get(routePath(RP_ROUTES.personSignatureImage, personEtsi)));
|
|
1174
|
+
} catch (e) {
|
|
1175
|
+
if (e instanceof ApiError && e.status === 404) return null;
|
|
1176
|
+
throw e;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1165
1179
|
};
|
|
1166
1180
|
|
|
1167
1181
|
// src/token.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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,
|
|
2
|
-
export {
|
|
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, b as PersonBlock, c as RepresentationsResponse, E as EidImage, A as AcspContext, F as FlowType } from './types-ByGHVzuP.cjs';
|
|
2
|
+
export { d as DEFAULT_SIGN_SESSION_TTL_MS, e as EndResult, O as OrgResult, P as PdfImage, f as Representation, g as SessionState, h as SignContext, i as SignatureAlgorithmParameters, j as SignatureProtocol, T as TokenCertSessionBlock, k as TokenCertStatus, p as parseExpiresAt, s as sessionExpiry, l as startExpiry } from './types-ByGHVzuP.cjs';
|
|
3
3
|
import { O as OnBehalfErrorCode, R as RetryableErrorCode, A as ApiError, H as HttpErrorInit } from './errors-3JEfE-FW.cjs';
|
|
4
4
|
export { a as AppTransactionTooLargeError, b as AuthenticationError, C as CertChoiceInvalidError, D as DeviceLinkError, E as EidError, F as ForbiddenError, N as NetworkError, c as NoSigningCertificateError, d as ON_BEHALF_ERROR_CODES, P as PDF_REGISTER_ERROR_CODES, e as PdfRegisterErrorCode, f as RETRYABLE_ERROR_CODES, g as RequestInvalidError, h as ResponseTooLargeError, S as SessionFailedError, V as ValidationError, p as parseRetryAfter } from './errors-3JEfE-FW.cjs';
|
|
5
5
|
import { X509Certificate, KeyObject } from 'node:crypto';
|
|
6
|
+
export { NavigatorLike, isMobileUserAgent } from './browser.cjs';
|
|
6
7
|
|
|
7
8
|
interface HttpConfig {
|
|
8
9
|
/** RP-API-ийн бүтэн суурь URL. Ж: https://rp.eidmongolia.mn */
|
|
@@ -577,6 +578,12 @@ declare class PersonApi {
|
|
|
577
578
|
summary(personEtsi: string): Promise<PersonSummary>;
|
|
578
579
|
/** Асран хамгаалж буй хүүхдүүд (зөвхөн унших). */
|
|
579
580
|
children(personEtsi: string): Promise<PersonChildren>;
|
|
581
|
+
/**
|
|
582
|
+
* GET /person/etsi/{personEtsi}/signature-image — иргэний гарын үсгийн зураг (харагдах гарын үсэгт:
|
|
583
|
+
* `appearance.signatureImage = img.pdfImage`). PKI_READ биш, **SIGN** эрх; иргэн сүүлийн 24 цагт танай RP-ээр
|
|
584
|
+
* нэвтэрсэн байх ёстой (эс бөгөөс `ForbiddenError`). Иргэн зураг хадгалаагүй (404) бол `null`.
|
|
585
|
+
*/
|
|
586
|
+
signatureImage(personEtsi: string): Promise<EidImage | null>;
|
|
580
587
|
}
|
|
581
588
|
|
|
582
589
|
/** Задалсан subject. Cert-д байхгүй талбар — undefined. Давхардсан OID-ийн эхнийх нь. */
|
|
@@ -1680,4 +1687,4 @@ declare function withReturnHint(callbackUrl: string, userAgent: string): string;
|
|
|
1680
1687
|
*/
|
|
1681
1688
|
declare function createEidLogin(opts: EidLoginOptions): EidLogin;
|
|
1682
1689
|
|
|
1683
|
-
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_SHARE_TIMEOUT_MS, DeviceLinkSession, type DeviceLinkSessionType, type DeviceLinkType, EidClient, 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 PdfDigestInput, type PdfDigestSession, type PdfDigestSigner, type PdfSignatureImage, type PersonActivity, PersonApi, PersonBlock, type PersonCertificate, type PersonCertificates, type PersonChild, type PersonChildren, type PersonDevice, type PersonDevices, type PersonSummary, type PriorSignature, type QrDeviceLinkTickerOptions, 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, parseSessionResult, parseSubject, personMatchesCertificate, qrDeviceLinkTicker, randomChallenge, registrationFromCompleted, resolveBaseUrl, sha256Base64, tokenAuthDigest, tokenLimitOf, userChallengeOf, verifyPayloadSignature, verifyPrehashedSignature, verifyTokenCertificates, withReturnHint };
|
|
1690
|
+
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_SHARE_TIMEOUT_MS, DeviceLinkSession, type DeviceLinkSessionType, type DeviceLinkType, EidClient, EidImage, 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 PdfDigestInput, type PdfDigestSession, type PdfDigestSigner, type PdfSignatureImage, type PersonActivity, PersonApi, PersonBlock, type PersonCertificate, type PersonCertificates, type PersonChild, type PersonChildren, type PersonDevice, type PersonDevices, type PersonSummary, type PriorSignature, type QrDeviceLinkTickerOptions, 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, parseSessionResult, parseSubject, personMatchesCertificate, qrDeviceLinkTicker, randomChallenge, registrationFromCompleted, resolveBaseUrl, sha256Base64, tokenAuthDigest, tokenLimitOf, userChallengeOf, verifyPayloadSignature, verifyPrehashedSignature, verifyTokenCertificates, withReturnHint };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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,
|
|
2
|
-
export {
|
|
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, b as PersonBlock, c as RepresentationsResponse, E as EidImage, A as AcspContext, F as FlowType } from './types-ByGHVzuP.js';
|
|
2
|
+
export { d as DEFAULT_SIGN_SESSION_TTL_MS, e as EndResult, O as OrgResult, P as PdfImage, f as Representation, g as SessionState, h as SignContext, i as SignatureAlgorithmParameters, j as SignatureProtocol, T as TokenCertSessionBlock, k as TokenCertStatus, p as parseExpiresAt, s as sessionExpiry, l as startExpiry } from './types-ByGHVzuP.js';
|
|
3
3
|
import { O as OnBehalfErrorCode, R as RetryableErrorCode, A as ApiError, H as HttpErrorInit } from './errors-3JEfE-FW.js';
|
|
4
4
|
export { a as AppTransactionTooLargeError, b as AuthenticationError, C as CertChoiceInvalidError, D as DeviceLinkError, E as EidError, F as ForbiddenError, N as NetworkError, c as NoSigningCertificateError, d as ON_BEHALF_ERROR_CODES, P as PDF_REGISTER_ERROR_CODES, e as PdfRegisterErrorCode, f as RETRYABLE_ERROR_CODES, g as RequestInvalidError, h as ResponseTooLargeError, S as SessionFailedError, V as ValidationError, p as parseRetryAfter } from './errors-3JEfE-FW.js';
|
|
5
5
|
import { X509Certificate, KeyObject } from 'node:crypto';
|
|
6
|
+
export { NavigatorLike, isMobileUserAgent } from './browser.js';
|
|
6
7
|
|
|
7
8
|
interface HttpConfig {
|
|
8
9
|
/** RP-API-ийн бүтэн суурь URL. Ж: https://rp.eidmongolia.mn */
|
|
@@ -577,6 +578,12 @@ declare class PersonApi {
|
|
|
577
578
|
summary(personEtsi: string): Promise<PersonSummary>;
|
|
578
579
|
/** Асран хамгаалж буй хүүхдүүд (зөвхөн унших). */
|
|
579
580
|
children(personEtsi: string): Promise<PersonChildren>;
|
|
581
|
+
/**
|
|
582
|
+
* GET /person/etsi/{personEtsi}/signature-image — иргэний гарын үсгийн зураг (харагдах гарын үсэгт:
|
|
583
|
+
* `appearance.signatureImage = img.pdfImage`). PKI_READ биш, **SIGN** эрх; иргэн сүүлийн 24 цагт танай RP-ээр
|
|
584
|
+
* нэвтэрсэн байх ёстой (эс бөгөөс `ForbiddenError`). Иргэн зураг хадгалаагүй (404) бол `null`.
|
|
585
|
+
*/
|
|
586
|
+
signatureImage(personEtsi: string): Promise<EidImage | null>;
|
|
580
587
|
}
|
|
581
588
|
|
|
582
589
|
/** Задалсан subject. Cert-д байхгүй талбар — undefined. Давхардсан OID-ийн эхнийх нь. */
|
|
@@ -1680,4 +1687,4 @@ declare function withReturnHint(callbackUrl: string, userAgent: string): string;
|
|
|
1680
1687
|
*/
|
|
1681
1688
|
declare function createEidLogin(opts: EidLoginOptions): EidLogin;
|
|
1682
1689
|
|
|
1683
|
-
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_SHARE_TIMEOUT_MS, DeviceLinkSession, type DeviceLinkSessionType, type DeviceLinkType, EidClient, 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 PdfDigestInput, type PdfDigestSession, type PdfDigestSigner, type PdfSignatureImage, type PersonActivity, PersonApi, PersonBlock, type PersonCertificate, type PersonCertificates, type PersonChild, type PersonChildren, type PersonDevice, type PersonDevices, type PersonSummary, type PriorSignature, type QrDeviceLinkTickerOptions, 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, parseSessionResult, parseSubject, personMatchesCertificate, qrDeviceLinkTicker, randomChallenge, registrationFromCompleted, resolveBaseUrl, sha256Base64, tokenAuthDigest, tokenLimitOf, userChallengeOf, verifyPayloadSignature, verifyPrehashedSignature, verifyTokenCertificates, withReturnHint };
|
|
1690
|
+
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_SHARE_TIMEOUT_MS, DeviceLinkSession, type DeviceLinkSessionType, type DeviceLinkType, EidClient, EidImage, 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 PdfDigestInput, type PdfDigestSession, type PdfDigestSigner, type PdfSignatureImage, type PersonActivity, PersonApi, PersonBlock, type PersonCertificate, type PersonCertificates, type PersonChild, type PersonChildren, type PersonDevice, type PersonDevices, type PersonSummary, type PriorSignature, type QrDeviceLinkTickerOptions, 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, parseSessionResult, parseSubject, personMatchesCertificate, qrDeviceLinkTicker, randomChallenge, registrationFromCompleted, resolveBaseUrl, sha256Base64, tokenAuthDigest, tokenLimitOf, userChallengeOf, verifyPayloadSignature, verifyPrehashedSignature, verifyTokenCertificates, withReturnHint };
|
package/dist/index.js
CHANGED
|
@@ -168,6 +168,7 @@ var RP_ROUTES = {
|
|
|
168
168
|
personActivity: { method: "GET", path: "/rp/activity/etsi/{personEtsi}" },
|
|
169
169
|
personSummary: { method: "GET", path: "/person/summary/etsi/{personEtsi}" },
|
|
170
170
|
personChildren: { method: "GET", path: "/person/children/etsi/{personEtsi}" },
|
|
171
|
+
personSignatureImage: { method: "GET", path: "/person/etsi/{personEtsi}/signature-image" },
|
|
171
172
|
tokenCertificate: { method: "POST", path: "/token/certificate" },
|
|
172
173
|
tokenCertificateResult: { method: "GET", path: "/token/certificate/{sessionID}" },
|
|
173
174
|
pdfSignatures: { method: "POST", path: "/pdf/signatures" },
|
|
@@ -939,6 +940,19 @@ var PersonApi = class {
|
|
|
939
940
|
children(personEtsi) {
|
|
940
941
|
return this.get(routePath(RP_ROUTES.personChildren, personEtsi));
|
|
941
942
|
}
|
|
943
|
+
/**
|
|
944
|
+
* GET /person/etsi/{personEtsi}/signature-image — иргэний гарын үсгийн зураг (харагдах гарын үсэгт:
|
|
945
|
+
* `appearance.signatureImage = img.pdfImage`). PKI_READ биш, **SIGN** эрх; иргэн сүүлийн 24 цагт танай RP-ээр
|
|
946
|
+
* нэвтэрсэн байх ёстой (эс бөгөөс `ForbiddenError`). Иргэн зураг хадгалаагүй (404) бол `null`.
|
|
947
|
+
*/
|
|
948
|
+
async signatureImage(personEtsi) {
|
|
949
|
+
try {
|
|
950
|
+
return rec3(await this.http.get(routePath(RP_ROUTES.personSignatureImage, personEtsi)));
|
|
951
|
+
} catch (e) {
|
|
952
|
+
if (e instanceof ApiError && e.status === 404) return null;
|
|
953
|
+
throw e;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
942
956
|
};
|
|
943
957
|
|
|
944
958
|
// src/token.ts
|
package/dist/pades.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { E as EidError } from './errors-3JEfE-FW.cjs';
|
|
2
|
+
import { P as PdfImage } from './types-ByGHVzuP.cjs';
|
|
2
3
|
import { F as FetchFn } from './fetch-BjfH46q9.cjs';
|
|
3
4
|
|
|
4
5
|
/** Олгогчийн гарын үсэгтэй «revoked» хариу (OCSP эсвэл CRL) — complete-д дахин оролдохгүй хатуу алдаа (Go ErrCertificateRevoked). */
|
|
@@ -103,29 +104,7 @@ interface PadesAppearance {
|
|
|
103
104
|
*/
|
|
104
105
|
stampImage?: PdfImage;
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
-
* A "PDF image" as the CA serves it (Go `pades.PDFImage`, APPEARANCE_SPEC.md §6.1): one ink colour + an 8-bit alpha
|
|
108
|
-
* channel. The SDK writes `alpha` into the PDF verbatim (/SMask, /FlateDecode) — nothing is compressed at runtime, so
|
|
109
|
-
* every SDK writes the same bytes. Not a PNG.
|
|
110
|
-
*/
|
|
111
|
-
interface PdfImage {
|
|
112
|
-
/** px, 1…1600. */
|
|
113
|
-
width: number;
|
|
114
|
-
/** px, 1…1600. */
|
|
115
|
-
height: number;
|
|
116
|
-
/** Ink colour `[r, g, b]`, 0…255. */
|
|
117
|
-
color: [number, number, number];
|
|
118
|
-
/**
|
|
119
|
-
* Standard base64 of a zlib stream (RFC 1950, no preset dictionary, nothing after the Adler-32) inflating to exactly
|
|
120
|
-
* `width·height` bytes, rows top-down, no PNG filter bytes; ≤ 300 KiB decoded.
|
|
121
|
-
*/
|
|
122
|
-
alpha: string;
|
|
123
|
-
/**
|
|
124
|
-
* Lowercase hex SHA-256 of the PNG the CA stores; not written into the PDF — carried to the registration
|
|
125
|
-
* ({@link PadesCompleted.images} → `registrationFromCompleted` → `images`).
|
|
126
|
-
*/
|
|
127
|
-
sha256: string;
|
|
128
|
-
}
|
|
107
|
+
|
|
129
108
|
/** One image drawn in a signature's stamp, as registered with the CA (`POST /pdf/signatures` `images`, APPEARANCE_SPEC §6.6). */
|
|
130
109
|
interface PadesImageRef {
|
|
131
110
|
kind: "signature" | "stamp";
|
|
@@ -309,4 +288,4 @@ declare function suggestPlacement(pdf: Uint8Array, appearance: PadesAppearance):
|
|
|
309
288
|
*/
|
|
310
289
|
declare function complete(state: Uint8Array | ArrayBuffer, signature: Uint8Array | string, opts?: PadesCompleteOptions): Promise<PadesCompleted>;
|
|
311
290
|
|
|
312
|
-
export { CertificateRevokedError, DEFAULT_ORG_STAMP_SIZE, DEFAULT_SIGNATURE_STAMP_SIZE, DEFAULT_STAMP_SIZE, PADES_ERROR_CODES, PROFILE_VERSION, type PadesAppearance, type PadesCompleteOptions, type PadesCompleted, PadesError, type PadesErrorCode, type PadesImageRef, type PadesPlacement, type PadesPlacementStatus, type PadesPrepareOptions, type PadesPrepared,
|
|
291
|
+
export { CertificateRevokedError, DEFAULT_ORG_STAMP_SIZE, DEFAULT_SIGNATURE_STAMP_SIZE, DEFAULT_STAMP_SIZE, PADES_ERROR_CODES, PROFILE_VERSION, type PadesAppearance, type PadesCompleteOptions, type PadesCompleted, PadesError, type PadesErrorCode, type PadesImageRef, type PadesPlacement, type PadesPlacementStatus, type PadesPrepareOptions, type PadesPrepared, PdfImage, type PlacementSuggestion, complete, prepare, profileVersion, suggestPlacement };
|
package/dist/pades.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { E as EidError } from './errors-3JEfE-FW.js';
|
|
2
|
+
import { P as PdfImage } from './types-ByGHVzuP.js';
|
|
2
3
|
import { F as FetchFn } from './fetch-BjfH46q9.js';
|
|
3
4
|
|
|
4
5
|
/** Олгогчийн гарын үсэгтэй «revoked» хариу (OCSP эсвэл CRL) — complete-д дахин оролдохгүй хатуу алдаа (Go ErrCertificateRevoked). */
|
|
@@ -103,29 +104,7 @@ interface PadesAppearance {
|
|
|
103
104
|
*/
|
|
104
105
|
stampImage?: PdfImage;
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
-
* A "PDF image" as the CA serves it (Go `pades.PDFImage`, APPEARANCE_SPEC.md §6.1): one ink colour + an 8-bit alpha
|
|
108
|
-
* channel. The SDK writes `alpha` into the PDF verbatim (/SMask, /FlateDecode) — nothing is compressed at runtime, so
|
|
109
|
-
* every SDK writes the same bytes. Not a PNG.
|
|
110
|
-
*/
|
|
111
|
-
interface PdfImage {
|
|
112
|
-
/** px, 1…1600. */
|
|
113
|
-
width: number;
|
|
114
|
-
/** px, 1…1600. */
|
|
115
|
-
height: number;
|
|
116
|
-
/** Ink colour `[r, g, b]`, 0…255. */
|
|
117
|
-
color: [number, number, number];
|
|
118
|
-
/**
|
|
119
|
-
* Standard base64 of a zlib stream (RFC 1950, no preset dictionary, nothing after the Adler-32) inflating to exactly
|
|
120
|
-
* `width·height` bytes, rows top-down, no PNG filter bytes; ≤ 300 KiB decoded.
|
|
121
|
-
*/
|
|
122
|
-
alpha: string;
|
|
123
|
-
/**
|
|
124
|
-
* Lowercase hex SHA-256 of the PNG the CA stores; not written into the PDF — carried to the registration
|
|
125
|
-
* ({@link PadesCompleted.images} → `registrationFromCompleted` → `images`).
|
|
126
|
-
*/
|
|
127
|
-
sha256: string;
|
|
128
|
-
}
|
|
107
|
+
|
|
129
108
|
/** One image drawn in a signature's stamp, as registered with the CA (`POST /pdf/signatures` `images`, APPEARANCE_SPEC §6.6). */
|
|
130
109
|
interface PadesImageRef {
|
|
131
110
|
kind: "signature" | "stamp";
|
|
@@ -309,4 +288,4 @@ declare function suggestPlacement(pdf: Uint8Array, appearance: PadesAppearance):
|
|
|
309
288
|
*/
|
|
310
289
|
declare function complete(state: Uint8Array | ArrayBuffer, signature: Uint8Array | string, opts?: PadesCompleteOptions): Promise<PadesCompleted>;
|
|
311
290
|
|
|
312
|
-
export { CertificateRevokedError, DEFAULT_ORG_STAMP_SIZE, DEFAULT_SIGNATURE_STAMP_SIZE, DEFAULT_STAMP_SIZE, PADES_ERROR_CODES, PROFILE_VERSION, type PadesAppearance, type PadesCompleteOptions, type PadesCompleted, PadesError, type PadesErrorCode, type PadesImageRef, type PadesPlacement, type PadesPlacementStatus, type PadesPrepareOptions, type PadesPrepared,
|
|
291
|
+
export { CertificateRevokedError, DEFAULT_ORG_STAMP_SIZE, DEFAULT_SIGNATURE_STAMP_SIZE, DEFAULT_STAMP_SIZE, PADES_ERROR_CODES, PROFILE_VERSION, type PadesAppearance, type PadesCompleteOptions, type PadesCompleted, PadesError, type PadesErrorCode, type PadesImageRef, type PadesPlacement, type PadesPlacementStatus, type PadesPrepareOptions, type PadesPrepared, PdfImage, type PlacementSuggestion, complete, prepare, profileVersion, suggestPlacement };
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import './errors-3JEfE-FW.cjs';
|
|
2
|
-
|
|
3
|
-
/** isMobileUserAgent-ийн уншдаг navigator-ийн хэсэг (тестэд орлуулна). */
|
|
4
|
-
interface NavigatorLike {
|
|
5
|
-
userAgent?: string;
|
|
6
|
-
maxTouchPoints?: number;
|
|
7
|
-
userAgentData?: {
|
|
8
|
-
mobile?: boolean;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Анхдагч гар утас/таблет илрүүлэгч: Android, iPhone/iPod/iPad, UA-CH `mobile`, мөн desktop UA
|
|
13
|
-
* илгээдэг iPadOS (Macintosh + мэдрэгч дэлгэц, maxTouchPoints > 1).
|
|
14
|
-
*/
|
|
15
|
-
declare function isMobileUserAgent(nav?: NavigatorLike): boolean;
|
|
16
|
-
|
|
17
1
|
/** Сертификатын баталгаажуулалтын түвшин (eIDAS LoA). QUALIFIED — хууль ёсны гарын үсэгт. */
|
|
18
2
|
type CertificateLevel = "ADVANCED" | "QUALIFIED" | "QSCD";
|
|
19
3
|
/** Гарын үсгийн протокол: auth → ACSP_V2, sign → RAW_DIGEST_SIGNATURE (Smart-ID v3). */
|
|
@@ -274,6 +258,55 @@ interface Representation {
|
|
|
274
258
|
validFrom: string;
|
|
275
259
|
/** ISO 8601; байхгүй = хугацаагүй. */
|
|
276
260
|
validTo?: string;
|
|
261
|
+
/** Байгууллагад тамганы зураг хадгалсан эсэх (хуучин CA-д байхгүй). */
|
|
262
|
+
stampImageSet?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Тамганы зураг — зөвхөн SIGN эрхтэй RP-д, зураг байвал. PDF-д: `appearance.stampImage = stampImage.pdfImage`
|
|
265
|
+
* (`claimedRole`-той).
|
|
266
|
+
*/
|
|
267
|
+
stampImage?: EidImage;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* CA-ийн хадгалсан ил тод PNG — иргэний гарын үсгийн зураг (`person.signatureImage()`) эсвэл байгууллагын тамга
|
|
271
|
+
* (`Representation.stampImage`); CA docs/SIGNATURE_IMAGES.md.
|
|
272
|
+
*/
|
|
273
|
+
interface EidImage {
|
|
274
|
+
/** base64 ил тод PNG. */
|
|
275
|
+
png: string;
|
|
276
|
+
/** PNG-ийн sha256, жижиг hex. */
|
|
277
|
+
sha256: string;
|
|
278
|
+
width: number;
|
|
279
|
+
height: number;
|
|
280
|
+
/** RFC 3339 (UTC). */
|
|
281
|
+
updatedAt?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Харагдах гарын үсэгт шигтгэх «PDF зураг» — `appearance.signatureImage` / `stampImage`-д хэвээр өгнө; CA PNG-ийг
|
|
284
|
+
* хөрвүүлж чадаагүй (олон өнгө, alpha > 300 KiB) бол байхгүй.
|
|
285
|
+
*/
|
|
286
|
+
pdfImage?: PdfImage;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* A "PDF image" as the CA serves it (Go `pades.PDFImage`, APPEARANCE_SPEC.md §6.1): one ink colour + an 8-bit alpha
|
|
290
|
+
* channel. The SDK writes `alpha` into the PDF verbatim (/SMask, /FlateDecode) — nothing is compressed at runtime, so
|
|
291
|
+
* every SDK writes the same bytes. Not a PNG.
|
|
292
|
+
*/
|
|
293
|
+
interface PdfImage {
|
|
294
|
+
/** px, 1…1600. */
|
|
295
|
+
width: number;
|
|
296
|
+
/** px, 1…1600. */
|
|
297
|
+
height: number;
|
|
298
|
+
/** Ink colour `[r, g, b]`, 0…255. */
|
|
299
|
+
color: [number, number, number];
|
|
300
|
+
/**
|
|
301
|
+
* Standard base64 of a zlib stream (RFC 1950, no preset dictionary, nothing after the Adler-32) inflating to exactly
|
|
302
|
+
* `width·height` bytes, rows top-down, no PNG filter bytes; ≤ 300 KiB decoded.
|
|
303
|
+
*/
|
|
304
|
+
alpha: string;
|
|
305
|
+
/**
|
|
306
|
+
* Lowercase hex SHA-256 of the PNG the CA stores; not written into the PDF — carried to the registration
|
|
307
|
+
* (`PadesCompleted.images` → `registrationFromCompleted` → `images`).
|
|
308
|
+
*/
|
|
309
|
+
sha256: string;
|
|
277
310
|
}
|
|
278
311
|
/** GET /organization/representations/etsi/{personEtsi} хариу. */
|
|
279
312
|
interface RepresentationsResponse {
|
|
@@ -309,4 +342,4 @@ interface RpCredentials {
|
|
|
309
342
|
apiSecret: string;
|
|
310
343
|
}
|
|
311
344
|
|
|
312
|
-
export { type AcspContext as A, type CertificateLevel as C, type DeviceLinkSession as D, type
|
|
345
|
+
export { type AcspContext as A, type CertificateLevel as C, type DeviceLinkSession as D, type EidImage as E, type FlowType as F, type HashAlgorithm as H, type Interaction as I, type NotificationSession as N, type OrgResult as O, type PdfImage as P, type RpCredentials as R, type SignatureAlgorithm as S, type TokenCertSessionBlock as T, type SessionResult as a, type PersonBlock as b, type RepresentationsResponse as c, DEFAULT_SIGN_SESSION_TTL_MS as d, type EndResult as e, type Representation as f, type SessionState as g, type SignContext as h, type SignatureAlgorithmParameters as i, type SignatureProtocol as j, type TokenCertStatus as k, startExpiry as l, parseExpiresAt as p, sessionExpiry as s };
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import './errors-3JEfE-FW.js';
|
|
2
|
-
|
|
3
|
-
/** isMobileUserAgent-ийн уншдаг navigator-ийн хэсэг (тестэд орлуулна). */
|
|
4
|
-
interface NavigatorLike {
|
|
5
|
-
userAgent?: string;
|
|
6
|
-
maxTouchPoints?: number;
|
|
7
|
-
userAgentData?: {
|
|
8
|
-
mobile?: boolean;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Анхдагч гар утас/таблет илрүүлэгч: Android, iPhone/iPod/iPad, UA-CH `mobile`, мөн desktop UA
|
|
13
|
-
* илгээдэг iPadOS (Macintosh + мэдрэгч дэлгэц, maxTouchPoints > 1).
|
|
14
|
-
*/
|
|
15
|
-
declare function isMobileUserAgent(nav?: NavigatorLike): boolean;
|
|
16
|
-
|
|
17
1
|
/** Сертификатын баталгаажуулалтын түвшин (eIDAS LoA). QUALIFIED — хууль ёсны гарын үсэгт. */
|
|
18
2
|
type CertificateLevel = "ADVANCED" | "QUALIFIED" | "QSCD";
|
|
19
3
|
/** Гарын үсгийн протокол: auth → ACSP_V2, sign → RAW_DIGEST_SIGNATURE (Smart-ID v3). */
|
|
@@ -274,6 +258,55 @@ interface Representation {
|
|
|
274
258
|
validFrom: string;
|
|
275
259
|
/** ISO 8601; байхгүй = хугацаагүй. */
|
|
276
260
|
validTo?: string;
|
|
261
|
+
/** Байгууллагад тамганы зураг хадгалсан эсэх (хуучин CA-д байхгүй). */
|
|
262
|
+
stampImageSet?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Тамганы зураг — зөвхөн SIGN эрхтэй RP-д, зураг байвал. PDF-д: `appearance.stampImage = stampImage.pdfImage`
|
|
265
|
+
* (`claimedRole`-той).
|
|
266
|
+
*/
|
|
267
|
+
stampImage?: EidImage;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* CA-ийн хадгалсан ил тод PNG — иргэний гарын үсгийн зураг (`person.signatureImage()`) эсвэл байгууллагын тамга
|
|
271
|
+
* (`Representation.stampImage`); CA docs/SIGNATURE_IMAGES.md.
|
|
272
|
+
*/
|
|
273
|
+
interface EidImage {
|
|
274
|
+
/** base64 ил тод PNG. */
|
|
275
|
+
png: string;
|
|
276
|
+
/** PNG-ийн sha256, жижиг hex. */
|
|
277
|
+
sha256: string;
|
|
278
|
+
width: number;
|
|
279
|
+
height: number;
|
|
280
|
+
/** RFC 3339 (UTC). */
|
|
281
|
+
updatedAt?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Харагдах гарын үсэгт шигтгэх «PDF зураг» — `appearance.signatureImage` / `stampImage`-д хэвээр өгнө; CA PNG-ийг
|
|
284
|
+
* хөрвүүлж чадаагүй (олон өнгө, alpha > 300 KiB) бол байхгүй.
|
|
285
|
+
*/
|
|
286
|
+
pdfImage?: PdfImage;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* A "PDF image" as the CA serves it (Go `pades.PDFImage`, APPEARANCE_SPEC.md §6.1): one ink colour + an 8-bit alpha
|
|
290
|
+
* channel. The SDK writes `alpha` into the PDF verbatim (/SMask, /FlateDecode) — nothing is compressed at runtime, so
|
|
291
|
+
* every SDK writes the same bytes. Not a PNG.
|
|
292
|
+
*/
|
|
293
|
+
interface PdfImage {
|
|
294
|
+
/** px, 1…1600. */
|
|
295
|
+
width: number;
|
|
296
|
+
/** px, 1…1600. */
|
|
297
|
+
height: number;
|
|
298
|
+
/** Ink colour `[r, g, b]`, 0…255. */
|
|
299
|
+
color: [number, number, number];
|
|
300
|
+
/**
|
|
301
|
+
* Standard base64 of a zlib stream (RFC 1950, no preset dictionary, nothing after the Adler-32) inflating to exactly
|
|
302
|
+
* `width·height` bytes, rows top-down, no PNG filter bytes; ≤ 300 KiB decoded.
|
|
303
|
+
*/
|
|
304
|
+
alpha: string;
|
|
305
|
+
/**
|
|
306
|
+
* Lowercase hex SHA-256 of the PNG the CA stores; not written into the PDF — carried to the registration
|
|
307
|
+
* (`PadesCompleted.images` → `registrationFromCompleted` → `images`).
|
|
308
|
+
*/
|
|
309
|
+
sha256: string;
|
|
277
310
|
}
|
|
278
311
|
/** GET /organization/representations/etsi/{personEtsi} хариу. */
|
|
279
312
|
interface RepresentationsResponse {
|
|
@@ -309,4 +342,4 @@ interface RpCredentials {
|
|
|
309
342
|
apiSecret: string;
|
|
310
343
|
}
|
|
311
344
|
|
|
312
|
-
export { type AcspContext as A, type CertificateLevel as C, type DeviceLinkSession as D, type
|
|
345
|
+
export { type AcspContext as A, type CertificateLevel as C, type DeviceLinkSession as D, type EidImage as E, type FlowType as F, type HashAlgorithm as H, type Interaction as I, type NotificationSession as N, type OrgResult as O, type PdfImage as P, type RpCredentials as R, type SignatureAlgorithm as S, type TokenCertSessionBlock as T, type SessionResult as a, type PersonBlock as b, type RepresentationsResponse as c, DEFAULT_SIGN_SESSION_TTL_MS as d, type EndResult as e, type Representation as f, type SessionState as g, type SignContext as h, type SignatureAlgorithmParameters as i, type SignatureProtocol as j, type TokenCertStatus as k, startExpiry as l, parseExpiresAt as p, sessionExpiry as s };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gerege-systems/eid-mongolia-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "e-ID Mongolia Relying Party SDK — иргэнээр утсаар нь нэвтрэлт ба хууль ёсны цахим гарын үсэг (RP-API v3, Smart-ID нийцтэй).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|