@gerege-systems/eid-mongolia-sdk 0.24.0 → 0.26.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/pades.d.cts CHANGED
@@ -57,9 +57,15 @@ interface PadesPrepareOptions {
57
57
  * Харагдах гарын үсгийн байршил (Go `pades.Appearance`, APPEARANCE_SPEC.md §1). Координат нь pt, тухайн хуудасны CropBox
58
58
  * (байхгүй бол MediaBox)-ийн /Rotate-ийн ДАРААХ (дэлгэцэнд харагдах) зүүн доод булангаас; x баруун тийш, y дээш. Утга бүр
59
59
  * 0.01 pt хүртэл тойрогдоно. Өндөр ≥ 45 pt (QR), эс бөгөөс REQUEST_INVALID.
60
+ * `x, y` нь хүссэн байрлал: тэнд хуудасны агуулга байвал дүрслэл чөлөөт зай руу шилжинэ (PLACEMENT_SPEC.md) — эцсийн
61
+ * байрлал {@link PadesPrepared.placement}-д.
60
62
  */
61
63
  interface PadesAppearance {
62
- /** Оролтын баримтын хуудас, 1-ээс; 0/байхгүй = оролтын сүүлийн хуудас (энэ prepare-ийн нэмэх verify хуудас тооцогдохгүй). */
64
+ /**
65
+ * Оролтын баримтын хуудас, 1-ээс (тодорхой дугаар — юуг ч алгасахгүй); 0/байхгүй = оролтын eID verify хуудас БИШ
66
+ * сүүлийн хуудас: энэ prepare-ийн нэмэх ба өмнөх гарын үсгүүдийн нэмсэн verify хуудас тооцогдохгүй (0.26.0+,
67
+ * PLACEMENT_SPEC §1a — `/Annots`-д энэ баримтын `https://ca.eidmongolia.mn/verify/<docId>` Link-тэй хуудас).
68
+ */
63
69
  page?: number;
64
70
  x: number;
65
71
  y: number;
@@ -76,7 +82,30 @@ interface PadesPrepared {
76
82
  docId: string;
77
83
  /** Тунгалаг, сериалчилж хадгалж болно (бэлтгэсэн PDF дотор нь — PDF-тэй ижил нууцлалтай). Go SDK-тай нийцтэй. */
78
84
  state: Uint8Array;
85
+ /** Харагдах дүрслэл хаана зурагдсан (Go `Prepared.Placement`, PLACEMENT_SPEC.md); `appearance`-гүй бол байхгүй. */
86
+ placement?: PadesPlacement;
87
+ }
88
+ /**
89
+ * The visible stamp's final rect (Go `pades.Placement`, PLACEMENT_SPEC.md) — `appearance` coordinates, pt. The stamp
90
+ * avoids existing page content: `appearance.x/y` is the preferred spot.
91
+ * - `requested` — drawn at `appearance.x/y` (that spot was free);
92
+ * - `moved` — that spot overlapped page content; the stamp moved to the first free spot (mirrored column, then up in
93
+ * 12 pt steps);
94
+ * - `overlap` — no free spot; drawn at the requested spot over content;
95
+ * - `unscanned` — the page could not be scanned within the limits; drawn at the requested spot.
96
+ *
97
+ * The signature is valid in every case; surface `overlap` / `unscanned` to the user (e.g. a notice).
98
+ */
99
+ interface PadesPlacement {
100
+ /** 1-based page of the input document the stamp is on. */
101
+ page: number;
102
+ x: number;
103
+ y: number;
104
+ width: number;
105
+ height: number;
106
+ status: PadesPlacementStatus;
79
107
  }
108
+ type PadesPlacementStatus = "requested" | "moved" | "overlap" | "unscanned";
80
109
  interface PadesCompleteOptions {
81
110
  /** RFC 3161 TSA. Анхдагч `https://tsa.timeserver.mn/`. */
82
111
  tsaUrl?: string;
@@ -153,4 +182,4 @@ declare function prepare(pdf: Uint8Array | ArrayBuffer, opts: PadesPrepareOption
153
182
  */
154
183
  declare function complete(state: Uint8Array | ArrayBuffer, signature: Uint8Array | string, opts?: PadesCompleteOptions): Promise<PadesCompleted>;
155
184
 
156
- export { CertificateRevokedError, PADES_ERROR_CODES, PROFILE_VERSION, type PadesAppearance, type PadesCompleteOptions, type PadesCompleted, PadesError, type PadesErrorCode, type PadesPrepareOptions, type PadesPrepared, complete, prepare, profileVersion };
185
+ export { CertificateRevokedError, PADES_ERROR_CODES, PROFILE_VERSION, type PadesAppearance, type PadesCompleteOptions, type PadesCompleted, PadesError, type PadesErrorCode, type PadesPlacement, type PadesPlacementStatus, type PadesPrepareOptions, type PadesPrepared, complete, prepare, profileVersion };
package/dist/pades.d.ts CHANGED
@@ -57,9 +57,15 @@ interface PadesPrepareOptions {
57
57
  * Харагдах гарын үсгийн байршил (Go `pades.Appearance`, APPEARANCE_SPEC.md §1). Координат нь pt, тухайн хуудасны CropBox
58
58
  * (байхгүй бол MediaBox)-ийн /Rotate-ийн ДАРААХ (дэлгэцэнд харагдах) зүүн доод булангаас; x баруун тийш, y дээш. Утга бүр
59
59
  * 0.01 pt хүртэл тойрогдоно. Өндөр ≥ 45 pt (QR), эс бөгөөс REQUEST_INVALID.
60
+ * `x, y` нь хүссэн байрлал: тэнд хуудасны агуулга байвал дүрслэл чөлөөт зай руу шилжинэ (PLACEMENT_SPEC.md) — эцсийн
61
+ * байрлал {@link PadesPrepared.placement}-д.
60
62
  */
61
63
  interface PadesAppearance {
62
- /** Оролтын баримтын хуудас, 1-ээс; 0/байхгүй = оролтын сүүлийн хуудас (энэ prepare-ийн нэмэх verify хуудас тооцогдохгүй). */
64
+ /**
65
+ * Оролтын баримтын хуудас, 1-ээс (тодорхой дугаар — юуг ч алгасахгүй); 0/байхгүй = оролтын eID verify хуудас БИШ
66
+ * сүүлийн хуудас: энэ prepare-ийн нэмэх ба өмнөх гарын үсгүүдийн нэмсэн verify хуудас тооцогдохгүй (0.26.0+,
67
+ * PLACEMENT_SPEC §1a — `/Annots`-д энэ баримтын `https://ca.eidmongolia.mn/verify/<docId>` Link-тэй хуудас).
68
+ */
63
69
  page?: number;
64
70
  x: number;
65
71
  y: number;
@@ -76,7 +82,30 @@ interface PadesPrepared {
76
82
  docId: string;
77
83
  /** Тунгалаг, сериалчилж хадгалж болно (бэлтгэсэн PDF дотор нь — PDF-тэй ижил нууцлалтай). Go SDK-тай нийцтэй. */
78
84
  state: Uint8Array;
85
+ /** Харагдах дүрслэл хаана зурагдсан (Go `Prepared.Placement`, PLACEMENT_SPEC.md); `appearance`-гүй бол байхгүй. */
86
+ placement?: PadesPlacement;
87
+ }
88
+ /**
89
+ * The visible stamp's final rect (Go `pades.Placement`, PLACEMENT_SPEC.md) — `appearance` coordinates, pt. The stamp
90
+ * avoids existing page content: `appearance.x/y` is the preferred spot.
91
+ * - `requested` — drawn at `appearance.x/y` (that spot was free);
92
+ * - `moved` — that spot overlapped page content; the stamp moved to the first free spot (mirrored column, then up in
93
+ * 12 pt steps);
94
+ * - `overlap` — no free spot; drawn at the requested spot over content;
95
+ * - `unscanned` — the page could not be scanned within the limits; drawn at the requested spot.
96
+ *
97
+ * The signature is valid in every case; surface `overlap` / `unscanned` to the user (e.g. a notice).
98
+ */
99
+ interface PadesPlacement {
100
+ /** 1-based page of the input document the stamp is on. */
101
+ page: number;
102
+ x: number;
103
+ y: number;
104
+ width: number;
105
+ height: number;
106
+ status: PadesPlacementStatus;
79
107
  }
108
+ type PadesPlacementStatus = "requested" | "moved" | "overlap" | "unscanned";
80
109
  interface PadesCompleteOptions {
81
110
  /** RFC 3161 TSA. Анхдагч `https://tsa.timeserver.mn/`. */
82
111
  tsaUrl?: string;
@@ -153,4 +182,4 @@ declare function prepare(pdf: Uint8Array | ArrayBuffer, opts: PadesPrepareOption
153
182
  */
154
183
  declare function complete(state: Uint8Array | ArrayBuffer, signature: Uint8Array | string, opts?: PadesCompleteOptions): Promise<PadesCompleted>;
155
184
 
156
- export { CertificateRevokedError, PADES_ERROR_CODES, PROFILE_VERSION, type PadesAppearance, type PadesCompleteOptions, type PadesCompleted, PadesError, type PadesErrorCode, type PadesPrepareOptions, type PadesPrepared, complete, prepare, profileVersion };
185
+ export { CertificateRevokedError, PADES_ERROR_CODES, PROFILE_VERSION, type PadesAppearance, type PadesCompleteOptions, type PadesCompleted, PadesError, type PadesErrorCode, type PadesPlacement, type PadesPlacementStatus, type PadesPrepareOptions, type PadesPrepared, complete, prepare, profileVersion };