@hoshinotatsuya/pg-replica-sync 0.2.2 → 0.3.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.
Files changed (215) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/dist/compare-lsn.d.mts +3 -3
  4. package/dist/compare-lsn.d.ts +3 -3
  5. package/dist/compare-lsn.js +3 -3
  6. package/dist/constants/exclusion-reason.constant.d.mts +12 -12
  7. package/dist/constants/exclusion-reason.constant.d.ts +12 -12
  8. package/dist/constants/exclusion-reason.constant.d.ts.map +1 -1
  9. package/dist/constants/exclusion-reason.constant.js +12 -12
  10. package/dist/constants/exclusion-reason.constant.js.map +1 -1
  11. package/dist/constants/node-role.constant.d.mts +1 -1
  12. package/dist/constants/node-role.constant.d.ts +1 -1
  13. package/dist/constants/node-role.constant.d.ts.map +1 -1
  14. package/dist/constants/node-role.constant.js +1 -1
  15. package/dist/constants/node-role.constant.js.map +1 -1
  16. package/dist/constants/probe-sql.constant.d.mts +25 -25
  17. package/dist/constants/probe-sql.constant.d.ts +25 -25
  18. package/dist/constants/probe-sql.constant.js +25 -25
  19. package/dist/constants/replica-sync-defaults.constant.d.mts +26 -26
  20. package/dist/constants/replica-sync-defaults.constant.d.ts +26 -26
  21. package/dist/constants/replica-sync-defaults.constant.d.ts.map +1 -1
  22. package/dist/constants/replica-sync-defaults.constant.js +26 -26
  23. package/dist/constants/replica-sync-defaults.constant.js.map +1 -1
  24. package/dist/constants/route-reason.constant.d.mts +13 -13
  25. package/dist/constants/route-reason.constant.d.ts +13 -13
  26. package/dist/constants/route-reason.constant.d.ts.map +1 -1
  27. package/dist/constants/route-reason.constant.js +13 -13
  28. package/dist/constants/route-reason.constant.js.map +1 -1
  29. package/dist/constants/token-format.constant.d.mts +11 -11
  30. package/dist/constants/token-format.constant.d.ts +11 -11
  31. package/dist/constants/token-format.constant.d.ts.map +1 -1
  32. package/dist/constants/token-format.constant.js +11 -11
  33. package/dist/constants/token-format.constant.js.map +1 -1
  34. package/dist/constants/wal-format.constant.d.mts +6 -6
  35. package/dist/constants/wal-format.constant.d.ts +6 -6
  36. package/dist/constants/wal-format.constant.d.ts.map +1 -1
  37. package/dist/constants/wal-format.constant.js +6 -6
  38. package/dist/constants/wal-format.constant.js.map +1 -1
  39. package/dist/decode-canonical-base64url.d.mts +1 -1
  40. package/dist/decode-canonical-base64url.d.ts +1 -1
  41. package/dist/decode-canonical-base64url.d.ts.map +1 -1
  42. package/dist/decode-canonical-base64url.js +1 -1
  43. package/dist/decode-canonical-base64url.js.map +1 -1
  44. package/dist/deep-freeze.d.mts +7 -7
  45. package/dist/deep-freeze.d.ts +7 -7
  46. package/dist/deep-freeze.js +9 -9
  47. package/dist/deep-freeze.js.map +1 -1
  48. package/dist/destroy-client.d.mts +3 -3
  49. package/dist/destroy-client.d.ts +3 -3
  50. package/dist/destroy-client.js +3 -3
  51. package/dist/evaluate-replica.d.mts +3 -3
  52. package/dist/evaluate-replica.d.ts +3 -3
  53. package/dist/evaluate-replica.js +3 -3
  54. package/dist/format-lsn.d.mts +1 -1
  55. package/dist/format-lsn.d.ts +1 -1
  56. package/dist/format-lsn.d.ts.map +1 -1
  57. package/dist/format-lsn.js +2 -2
  58. package/dist/format-lsn.js.map +1 -1
  59. package/dist/invalid-lsn.error.d.mts +1 -1
  60. package/dist/invalid-lsn.error.d.ts +1 -1
  61. package/dist/invalid-lsn.error.d.ts.map +1 -1
  62. package/dist/invalid-lsn.error.js +2 -2
  63. package/dist/invalid-lsn.error.js.map +1 -1
  64. package/dist/invalid-replica-sync-options.error.d.mts +1 -1
  65. package/dist/invalid-replica-sync-options.error.d.ts +1 -1
  66. package/dist/invalid-replica-sync-options.error.d.ts.map +1 -1
  67. package/dist/invalid-replica-sync-options.error.js +1 -1
  68. package/dist/invalid-replica-sync-options.error.js.map +1 -1
  69. package/dist/lag-bytes.d.mts +3 -3
  70. package/dist/lag-bytes.d.ts +3 -3
  71. package/dist/lag-bytes.js +3 -3
  72. package/dist/lsn-or-null.d.mts +1 -1
  73. package/dist/lsn-or-null.d.ts +1 -1
  74. package/dist/lsn-or-null.d.ts.map +1 -1
  75. package/dist/lsn-or-null.js +1 -1
  76. package/dist/lsn-or-null.js.map +1 -1
  77. package/dist/notify.d.mts +7 -7
  78. package/dist/notify.d.ts +7 -7
  79. package/dist/notify.js +8 -8
  80. package/dist/notify.js.map +1 -1
  81. package/dist/parse-lsn.d.mts +3 -3
  82. package/dist/parse-lsn.d.ts +3 -3
  83. package/dist/parse-lsn.js +3 -3
  84. package/dist/probe-connection-closed.error.d.mts +1 -1
  85. package/dist/probe-connection-closed.error.d.ts +1 -1
  86. package/dist/probe-connection-closed.error.d.ts.map +1 -1
  87. package/dist/probe-connection-closed.error.js +2 -2
  88. package/dist/probe-connection-closed.error.js.map +1 -1
  89. package/dist/probe-connection.d.mts +20 -20
  90. package/dist/probe-connection.d.ts +20 -20
  91. package/dist/probe-connection.d.ts.map +1 -1
  92. package/dist/probe-connection.js +25 -25
  93. package/dist/probe-connection.js.map +1 -1
  94. package/dist/probe-timeout.error.d.mts +1 -1
  95. package/dist/probe-timeout.error.d.ts +1 -1
  96. package/dist/probe-timeout.error.d.ts.map +1 -1
  97. package/dist/probe-timeout.error.js +2 -2
  98. package/dist/probe-timeout.error.js.map +1 -1
  99. package/dist/read-node-state.d.mts +3 -3
  100. package/dist/read-node-state.d.ts +3 -3
  101. package/dist/read-node-state.js +4 -4
  102. package/dist/read-node-state.js.map +1 -1
  103. package/dist/replica-router.d.mts +133 -133
  104. package/dist/replica-router.d.ts +133 -133
  105. package/dist/replica-router.d.ts.map +1 -1
  106. package/dist/replica-router.js +162 -162
  107. package/dist/replica-router.js.map +1 -1
  108. package/dist/require-integer.d.mts +1 -1
  109. package/dist/require-integer.d.ts +1 -1
  110. package/dist/require-integer.d.ts.map +1 -1
  111. package/dist/require-integer.js +3 -3
  112. package/dist/require-integer.js.map +1 -1
  113. package/dist/secret-weakness.d.mts +13 -13
  114. package/dist/secret-weakness.d.ts +13 -13
  115. package/dist/secret-weakness.js +16 -16
  116. package/dist/secret-weakness.js.map +1 -1
  117. package/dist/smallest-period.d.mts +4 -4
  118. package/dist/smallest-period.d.ts +4 -4
  119. package/dist/smallest-period.js +4 -4
  120. package/dist/sql-state-of.d.mts +6 -6
  121. package/dist/sql-state-of.d.ts +6 -6
  122. package/dist/sql-state-of.js +6 -6
  123. package/dist/state-cache.d.mts +14 -14
  124. package/dist/state-cache.d.ts +14 -14
  125. package/dist/state-cache.d.ts.map +1 -1
  126. package/dist/state-cache.js +15 -15
  127. package/dist/state-cache.js.map +1 -1
  128. package/dist/timeline-of.d.mts +2 -2
  129. package/dist/timeline-of.d.ts +2 -2
  130. package/dist/timeline-of.js +2 -2
  131. package/dist/to-error.d.mts +1 -1
  132. package/dist/to-error.d.ts +1 -1
  133. package/dist/to-error.d.ts.map +1 -1
  134. package/dist/to-error.js +1 -1
  135. package/dist/to-error.js.map +1 -1
  136. package/dist/token-codec.d.mts +10 -10
  137. package/dist/token-codec.d.ts +10 -10
  138. package/dist/token-codec.js +31 -31
  139. package/dist/token-codec.js.map +1 -1
  140. package/dist/token-lsn.d.mts +13 -13
  141. package/dist/token-lsn.d.ts +13 -13
  142. package/dist/token-lsn.js +13 -13
  143. package/dist/transaction-not-committed.error.d.mts +2 -2
  144. package/dist/transaction-not-committed.error.d.ts +2 -2
  145. package/dist/transaction-not-committed.error.d.ts.map +1 -1
  146. package/dist/transaction-not-committed.error.js +3 -3
  147. package/dist/transaction-not-committed.error.js.map +1 -1
  148. package/dist/transaction-not-open.error.d.mts +5 -5
  149. package/dist/transaction-not-open.error.d.ts +5 -5
  150. package/dist/transaction-not-open.error.js +6 -6
  151. package/dist/transaction-not-open.error.js.map +1 -1
  152. package/dist/types/cache-entry.type.d.mts +4 -4
  153. package/dist/types/cache-entry.type.d.ts +4 -4
  154. package/dist/types/clock.type.d.mts +3 -3
  155. package/dist/types/clock.type.d.ts +3 -3
  156. package/dist/types/confirm-event.type.d.mts +3 -3
  157. package/dist/types/confirm-event.type.d.ts +3 -3
  158. package/dist/types/decoded-token.type.d.mts +2 -2
  159. package/dist/types/decoded-token.type.d.ts +2 -2
  160. package/dist/types/evaluated.type.d.mts +1 -1
  161. package/dist/types/evaluated.type.d.ts +1 -1
  162. package/dist/types/evaluated.type.d.ts.map +1 -1
  163. package/dist/types/exclusion.type.d.mts +1 -1
  164. package/dist/types/exclusion.type.d.ts +1 -1
  165. package/dist/types/exclusion.type.d.ts.map +1 -1
  166. package/dist/types/node-state.type.d.mts +13 -13
  167. package/dist/types/node-state.type.d.ts +13 -13
  168. package/dist/types/node-state.type.d.ts.map +1 -1
  169. package/dist/types/not-a-pool.type.d.mts +5 -5
  170. package/dist/types/not-a-pool.type.d.ts +5 -5
  171. package/dist/types/probe-event.type.d.mts +1 -1
  172. package/dist/types/probe-event.type.d.ts +1 -1
  173. package/dist/types/probe-event.type.d.ts.map +1 -1
  174. package/dist/types/probe-outcome.type.d.mts +1 -1
  175. package/dist/types/probe-outcome.type.d.ts +1 -1
  176. package/dist/types/probe-outcome.type.d.ts.map +1 -1
  177. package/dist/types/probe-sample.type.d.mts +1 -1
  178. package/dist/types/probe-sample.type.d.ts +1 -1
  179. package/dist/types/probe-sample.type.d.ts.map +1 -1
  180. package/dist/types/replica-node.type.d.mts +7 -7
  181. package/dist/types/replica-node.type.d.ts +7 -7
  182. package/dist/types/replica-requirement.type.d.mts +2 -2
  183. package/dist/types/replica-requirement.type.d.ts +2 -2
  184. package/dist/types/replica-router-options.type.d.mts +25 -25
  185. package/dist/types/replica-router-options.type.d.ts +25 -25
  186. package/dist/types/replica-router-options.type.d.ts.map +1 -1
  187. package/dist/types/route-decision.type.d.mts +5 -5
  188. package/dist/types/route-decision.type.d.ts +5 -5
  189. package/dist/types/route-decision.type.d.ts.map +1 -1
  190. package/dist/types/router-observer.type.d.mts +5 -5
  191. package/dist/types/router-observer.type.d.ts +5 -5
  192. package/dist/types/router-observer.type.d.ts.map +1 -1
  193. package/dist/types/router-stats.type.d.mts +8 -8
  194. package/dist/types/router-stats.type.d.ts +8 -8
  195. package/dist/types/router-stats.type.d.ts.map +1 -1
  196. package/dist/types/sql-command-executor.type.d.mts +4 -4
  197. package/dist/types/sql-command-executor.type.d.ts +4 -4
  198. package/dist/types/sql-query-executor.type.d.mts +3 -3
  199. package/dist/types/sql-query-executor.type.d.ts +3 -3
  200. package/dist/types/wal-layout.type.d.mts +1 -1
  201. package/dist/types/wal-layout.type.d.ts +1 -1
  202. package/dist/types/wal-layout.type.d.ts.map +1 -1
  203. package/dist/types/wal-position.type.d.mts +5 -5
  204. package/dist/types/wal-position.type.d.ts +5 -5
  205. package/dist/types/wal-position.type.d.ts.map +1 -1
  206. package/dist/value-text.d.mts +5 -5
  207. package/dist/value-text.d.ts +5 -5
  208. package/dist/value-text.js +6 -6
  209. package/dist/value-text.js.map +1 -1
  210. package/dist/wal-layout-of.d.mts +1 -1
  211. package/dist/wal-layout-of.d.ts +1 -1
  212. package/dist/wal-layout-of.d.ts.map +1 -1
  213. package/dist/wal-layout-of.js +1 -1
  214. package/dist/wal-layout-of.js.map +1 -1
  215. package/package.json +11 -9
@@ -2,56 +2,56 @@ import type { Clock } from './clock.type.mjs';
2
2
  import type { ReplicaNode } from './replica-node.type.mjs';
3
3
  import type { RouterObserver } from './router-observer.type.mjs';
4
4
  /**
5
- * Настройки маршрутизатора. Необязательное поле можно передать и как
6
- * `undefined` (в том числе под `exactOptionalPropertyTypes`): это умолчание.
5
+ * The router settings. An optional field can also be passed as
6
+ * `undefined` (including under `exactOptionalPropertyTypes`): that is the default.
7
7
  */
8
8
  export interface ReplicaRouterOptions<TTarget> {
9
9
  readonly primary: ReplicaNode<TTarget>;
10
- /** Пустой список допустим: все чтения — на мастер (`no-replicas`). */
10
+ /** An empty list is allowed: all reads go to the primary (`no-replicas`). */
11
11
  readonly replicas: readonly ReplicaNode<TTarget>[];
12
12
  /**
13
- * Ключи подписи токена, не короче 32 байт: первый подписывает, все проверяют
14
- * (ротация — новый ключ первым, старый следом, пока живут выданные токены).
13
+ * The token signing keys, not shorter than 32 bytes: the first one signs, all of them verify
14
+ * (rotation: the new key first, the old one after it while the issued tokens live).
15
15
  */
16
16
  readonly secrets: readonly (string | Uint8Array)[];
17
17
  /**
18
- * Потолок жизни состояния узла в кэше, мс (`REPLICA_SYNC_DEFAULTS.STATE_TTL_MS`),
19
- * не больше `MAX_STATE_TTL_MS`.
18
+ * The lifetime ceiling of a node state in the cache, ms (`REPLICA_SYNC_DEFAULTS.STATE_TTL_MS`),
19
+ * not more than `MAX_STATE_TTL_MS`.
20
20
  */
21
21
  readonly stateTtlMs?: number | undefined;
22
- /** Потолок одного зонда (соединение + запрос), мс. */
22
+ /** The ceiling of one probe (connection + query), ms. */
23
23
  readonly probeTimeoutMs?: number | undefined;
24
24
  /**
25
- * Потолок жизни соединения зонда, которое не установилось или запрос на котором
26
- * не ответил, мс (`REPLICA_SYNC_DEFAULTS.CONNECT_TIMEOUT_MS`): до него соединение
27
- * не рвётся, даже если зонд уже отказал по `probeTimeoutMs`.
25
+ * The lifetime ceiling of a probe connection that did not get established or on which a query
26
+ * did not answer, ms (`REPLICA_SYNC_DEFAULTS.CONNECT_TIMEOUT_MS`): until it the connection
27
+ * is not torn, even if the probe has already been refused by `probeTimeoutMs`.
28
28
  */
29
29
  readonly connectTimeoutMs?: number | undefined;
30
- /** Узел, не ответивший зонду, не опрашивается столько, мс. */
30
+ /** A node that did not answer a probe is not polled for this many ms. */
31
31
  readonly unavailableRetryMs?: number | undefined;
32
- /** Без токена: потолок отставания реплики от позиции вставки мастера, байт. */
32
+ /** Without a token: the ceiling of a replica lag behind the primary insert position, bytes. */
33
33
  readonly maxLagBytes?: number | undefined;
34
- /** С токеном: сколько ждать догоняния перед уходом на мастер, мс (0 — не ждать). */
34
+ /** With a token: how long to wait for catch-up before going to the primary, ms (0 — do not wait). */
35
35
  readonly waitForCatchUpMs?: number | undefined;
36
- /** Интервал опроса реплик во время ожидания, мс. */
36
+ /** The interval of polling the replicas during the wait, ms. */
37
37
  readonly catchUpPollMs?: number | undefined;
38
- /** Не чаще одного нового зонда узла за столько мс (0 — без потолка). */
38
+ /** No more than one new probe of a node per this many ms (0 — no ceiling). */
39
39
  readonly minProbeIntervalMs?: number | undefined;
40
40
  /**
41
- * Сколько токен, который после failover ни одна реплика выполнить не может
42
- * (другая линия времени, другой кластер, впереди мастера), держит чтения на
43
- * мастере, мс; старше — чтение как без токена (`expiredTokens` в `stats()`).
44
- * Невыполнимость доказывается зондом мастера, начатым после первой встречи с
45
- * позицией токена; токен «без позиции» не стареет.
41
+ * How long a token that after a failover no replica can satisfy
42
+ * (another timeline, another cluster, ahead of the primary) holds reads on the
43
+ * primary, ms; an older one is read as without a token (`expiredTokens` in `stats()`).
44
+ * Unsatisfiability is proven by a primary probe started after the first encounter with the
45
+ * token position; a token "without a position" does not age.
46
46
  */
47
47
  readonly tokenTtlMs?: number | undefined;
48
48
  readonly observer?: RouterObserver | undefined;
49
- /** Часы кэша; по умолчанию `performance.now`. Обязаны возвращать конечное число. */
49
+ /** The cache clock; `performance.now` by default. It must return a finite number. */
50
50
  readonly clock?: Clock | undefined;
51
51
  /**
52
- * Часы момента выдачи токена — мс эпохи Unix, общие для процессов, которые
53
- * выдают и читают токены; по умолчанию `Date.now`. Расхождение часов процессов
54
- * сдвигает только срок невыполнимого токена (см. `tokenTtlMs`).
52
+ * The clock of the token issue moment — Unix epoch ms, shared by the processes that
53
+ * issue and read tokens; `Date.now` by default. A divergence of the process clocks
54
+ * shifts only the expiry of an unsatisfiable token (see `tokenTtlMs`).
55
55
  */
56
56
  readonly wallClock?: Clock | undefined;
57
57
  }
@@ -2,56 +2,56 @@ import type { Clock } from './clock.type';
2
2
  import type { ReplicaNode } from './replica-node.type';
3
3
  import type { RouterObserver } from './router-observer.type';
4
4
  /**
5
- * Настройки маршрутизатора. Необязательное поле можно передать и как
6
- * `undefined` (в том числе под `exactOptionalPropertyTypes`): это умолчание.
5
+ * The router settings. An optional field can also be passed as
6
+ * `undefined` (including under `exactOptionalPropertyTypes`): that is the default.
7
7
  */
8
8
  export interface ReplicaRouterOptions<TTarget> {
9
9
  readonly primary: ReplicaNode<TTarget>;
10
- /** Пустой список допустим: все чтения — на мастер (`no-replicas`). */
10
+ /** An empty list is allowed: all reads go to the primary (`no-replicas`). */
11
11
  readonly replicas: readonly ReplicaNode<TTarget>[];
12
12
  /**
13
- * Ключи подписи токена, не короче 32 байт: первый подписывает, все проверяют
14
- * (ротация — новый ключ первым, старый следом, пока живут выданные токены).
13
+ * The token signing keys, not shorter than 32 bytes: the first one signs, all of them verify
14
+ * (rotation: the new key first, the old one after it while the issued tokens live).
15
15
  */
16
16
  readonly secrets: readonly (string | Uint8Array)[];
17
17
  /**
18
- * Потолок жизни состояния узла в кэше, мс (`REPLICA_SYNC_DEFAULTS.STATE_TTL_MS`),
19
- * не больше `MAX_STATE_TTL_MS`.
18
+ * The lifetime ceiling of a node state in the cache, ms (`REPLICA_SYNC_DEFAULTS.STATE_TTL_MS`),
19
+ * not more than `MAX_STATE_TTL_MS`.
20
20
  */
21
21
  readonly stateTtlMs?: number | undefined;
22
- /** Потолок одного зонда (соединение + запрос), мс. */
22
+ /** The ceiling of one probe (connection + query), ms. */
23
23
  readonly probeTimeoutMs?: number | undefined;
24
24
  /**
25
- * Потолок жизни соединения зонда, которое не установилось или запрос на котором
26
- * не ответил, мс (`REPLICA_SYNC_DEFAULTS.CONNECT_TIMEOUT_MS`): до него соединение
27
- * не рвётся, даже если зонд уже отказал по `probeTimeoutMs`.
25
+ * The lifetime ceiling of a probe connection that did not get established or on which a query
26
+ * did not answer, ms (`REPLICA_SYNC_DEFAULTS.CONNECT_TIMEOUT_MS`): until it the connection
27
+ * is not torn, even if the probe has already been refused by `probeTimeoutMs`.
28
28
  */
29
29
  readonly connectTimeoutMs?: number | undefined;
30
- /** Узел, не ответивший зонду, не опрашивается столько, мс. */
30
+ /** A node that did not answer a probe is not polled for this many ms. */
31
31
  readonly unavailableRetryMs?: number | undefined;
32
- /** Без токена: потолок отставания реплики от позиции вставки мастера, байт. */
32
+ /** Without a token: the ceiling of a replica lag behind the primary insert position, bytes. */
33
33
  readonly maxLagBytes?: number | undefined;
34
- /** С токеном: сколько ждать догоняния перед уходом на мастер, мс (0 — не ждать). */
34
+ /** With a token: how long to wait for catch-up before going to the primary, ms (0 — do not wait). */
35
35
  readonly waitForCatchUpMs?: number | undefined;
36
- /** Интервал опроса реплик во время ожидания, мс. */
36
+ /** The interval of polling the replicas during the wait, ms. */
37
37
  readonly catchUpPollMs?: number | undefined;
38
- /** Не чаще одного нового зонда узла за столько мс (0 — без потолка). */
38
+ /** No more than one new probe of a node per this many ms (0 — no ceiling). */
39
39
  readonly minProbeIntervalMs?: number | undefined;
40
40
  /**
41
- * Сколько токен, который после failover ни одна реплика выполнить не может
42
- * (другая линия времени, другой кластер, впереди мастера), держит чтения на
43
- * мастере, мс; старше — чтение как без токена (`expiredTokens` в `stats()`).
44
- * Невыполнимость доказывается зондом мастера, начатым после первой встречи с
45
- * позицией токена; токен «без позиции» не стареет.
41
+ * How long a token that after a failover no replica can satisfy
42
+ * (another timeline, another cluster, ahead of the primary) holds reads on the
43
+ * primary, ms; an older one is read as without a token (`expiredTokens` in `stats()`).
44
+ * Unsatisfiability is proven by a primary probe started after the first encounter with the
45
+ * token position; a token "without a position" does not age.
46
46
  */
47
47
  readonly tokenTtlMs?: number | undefined;
48
48
  readonly observer?: RouterObserver | undefined;
49
- /** Часы кэша; по умолчанию `performance.now`. Обязаны возвращать конечное число. */
49
+ /** The cache clock; `performance.now` by default. It must return a finite number. */
50
50
  readonly clock?: Clock | undefined;
51
51
  /**
52
- * Часы момента выдачи токена — мс эпохи Unix, общие для процессов, которые
53
- * выдают и читают токены; по умолчанию `Date.now`. Расхождение часов процессов
54
- * сдвигает только срок невыполнимого токена (см. `tokenTtlMs`).
52
+ * The clock of the token issue moment — Unix epoch ms, shared by the processes that
53
+ * issue and read tokens; `Date.now` by default. A divergence of the process clocks
54
+ * shifts only the expiry of an unsatisfiable token (see `tokenTtlMs`).
55
55
  */
56
56
  readonly wallClock?: Clock | undefined;
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"replica-router-options.type.d.ts","sourceRoot":"","sources":["../../src/types/replica-router-options.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,OAAO;IAC3C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,sDAAsD;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,8DAA8D;IAC9D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,oDAAoD;IACpD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,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AAG,SAAS,CAAC;IACjD,+FAA+F;IAC/F,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,qGAAqG;IACrG,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,gEAAgE;IAChE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC/C,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CACxC"}
@@ -1,19 +1,19 @@
1
1
  import type { Exclusion } from './exclusion.type.mjs';
2
2
  import type { NodeRole } from './node-role.type.mjs';
3
3
  import type { RouteReason } from './route-reason.type.mjs';
4
- /** Куда читать: узел, его `target`, причина и почему не подошли остальные реплики. */
4
+ /** Where to read: the node, its `target`, the reason and why the other replicas did not fit. */
5
5
  export interface RouteDecision<TTarget> {
6
6
  readonly role: NodeRole;
7
7
  readonly node: string;
8
8
  readonly target: TTarget;
9
9
  readonly reason: RouteReason;
10
10
  readonly excluded: readonly Exclusion[];
11
- /** Сколько опросов реплик ушло на ожидание догоняния (0 — не ждали). */
11
+ /** How many replica polls went into waiting for catch-up (0 — did not wait). */
12
12
  readonly catchUpPolls: number;
13
13
  /**
14
- * Узел — балансировщик (`balanced: true`): решение доказано про сервер зонда,
15
- * а не про сервер чтения. Читать можно только после `router.confirm(decision,
16
- * соединение чтения) === true`; иначе — с мастера.
14
+ * The node is a balancer (`balanced: true`): the decision is proven about the probe server,
15
+ * not about the read server. Reading is allowed only after `router.confirm(decision,
16
+ * the read connection) === true`; otherwise from the primary.
17
17
  */
18
18
  readonly mustConfirm: boolean;
19
19
  }
@@ -1,19 +1,19 @@
1
1
  import type { Exclusion } from './exclusion.type';
2
2
  import type { NodeRole } from './node-role.type';
3
3
  import type { RouteReason } from './route-reason.type';
4
- /** Куда читать: узел, его `target`, причина и почему не подошли остальные реплики. */
4
+ /** Where to read: the node, its `target`, the reason and why the other replicas did not fit. */
5
5
  export interface RouteDecision<TTarget> {
6
6
  readonly role: NodeRole;
7
7
  readonly node: string;
8
8
  readonly target: TTarget;
9
9
  readonly reason: RouteReason;
10
10
  readonly excluded: readonly Exclusion[];
11
- /** Сколько опросов реплик ушло на ожидание догоняния (0 — не ждали). */
11
+ /** How many replica polls went into waiting for catch-up (0 — did not wait). */
12
12
  readonly catchUpPolls: number;
13
13
  /**
14
- * Узел — балансировщик (`balanced: true`): решение доказано про сервер зонда,
15
- * а не про сервер чтения. Читать можно только после `router.confirm(decision,
16
- * соединение чтения) === true`; иначе — с мастера.
14
+ * The node is a balancer (`balanced: true`): the decision is proven about the probe server,
15
+ * not about the read server. Reading is allowed only after `router.confirm(decision,
16
+ * the read connection) === true`; otherwise from the primary.
17
17
  */
18
18
  readonly mustConfirm: boolean;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"route-decision.type.d.ts","sourceRoot":"","sources":["../../src/types/route-decision.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,sFAAsF;AACtF,MAAM,WAAW,aAAa,CAAC,OAAO;IACpC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IACxC,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B"}
1
+ {"version":3,"file":"route-decision.type.d.ts","sourceRoot":"","sources":["../../src/types/route-decision.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gGAAgG;AAChG,MAAM,WAAW,aAAa,CAAC,OAAO;IACpC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,SAAS,EAAE,CAAC;IACxC,gFAAgF;IAChF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B"}
@@ -2,17 +2,17 @@ import type { ConfirmEvent } from './confirm-event.type.mjs';
2
2
  import type { ProbeEvent } from './probe-event.type.mjs';
3
3
  import type { RouteDecision } from './route-decision.type.mjs';
4
4
  /**
5
- * Наблюдение для метрик и логов. Отказ наблюдателя маршрутизацию не роняет:
6
- * исключение хука, отказ `async`-хука и бросающий геттер свойства хука
7
- * проглатываются.
5
+ * Observation for metrics and logs. An observer refusal does not fail the routing:
6
+ * an exception of a hook, a refusal of an `async` hook and a throwing getter of a hook property
7
+ * are swallowed.
8
8
  */
9
9
  export interface RouterObserver {
10
10
  readonly routed?: ((decision: RouteDecision<unknown>) => void) | undefined;
11
11
  readonly probed?: ((event: ProbeEvent) => void) | undefined;
12
- /** Позицию после записи определить не смогли — выдан токен «только мастер». */
12
+ /** The position after the write could not be determined — a "primary only" token is issued. */
13
13
  readonly tokenUnresolved?: ((event: {
14
14
  readonly error: Error;
15
15
  }) => void) | undefined;
16
- /** Итог `confirm` на соединении чтения (подтверждено или почему нет). */
16
+ /** The outcome of `confirm` on the read connection (confirmed or why not). */
17
17
  readonly confirmed?: ((event: ConfirmEvent) => void) | undefined;
18
18
  }
@@ -2,18 +2,18 @@ import type { ConfirmEvent } from './confirm-event.type';
2
2
  import type { ProbeEvent } from './probe-event.type';
3
3
  import type { RouteDecision } from './route-decision.type';
4
4
  /**
5
- * Наблюдение для метрик и логов. Отказ наблюдателя маршрутизацию не роняет:
6
- * исключение хука, отказ `async`-хука и бросающий геттер свойства хука
7
- * проглатываются.
5
+ * Observation for metrics and logs. An observer refusal does not fail the routing:
6
+ * an exception of a hook, a refusal of an `async` hook and a throwing getter of a hook property
7
+ * are swallowed.
8
8
  */
9
9
  export interface RouterObserver {
10
10
  readonly routed?: ((decision: RouteDecision<unknown>) => void) | undefined;
11
11
  readonly probed?: ((event: ProbeEvent) => void) | undefined;
12
- /** Позицию после записи определить не смогли — выдан токен «только мастер». */
12
+ /** The position after the write could not be determined — a "primary only" token is issued. */
13
13
  readonly tokenUnresolved?: ((event: {
14
14
  readonly error: Error;
15
15
  }) => void) | undefined;
16
- /** Итог `confirm` на соединении чтения (подтверждено или почему нет). */
16
+ /** The outcome of `confirm` on the read connection (confirmed or why not). */
17
17
  readonly confirmed?: ((event: ConfirmEvent) => void) | undefined;
18
18
  }
19
19
  //# sourceMappingURL=router-observer.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router-observer.type.d.ts","sourceRoot":"","sources":["../../src/types/router-observer.type.ts"],"names":[],"mapp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GAAG,SAAS,CAAC;IAC5D,+FAA+F;IAC/F,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpF,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAClE"}
@@ -1,10 +1,10 @@
1
1
  import type { ExclusionReason } from './exclusion-reason.type.mjs';
2
2
  import type { RouteReason } from './route-reason.type.mjs';
3
3
  /**
4
- * Счётчики с момента создания маршрутизатора: доля чтений с реплик и мастера,
5
- * причины, отставание. Отставание — последнее измеренное (байт WAL от позиции
6
- * вставки мастера, число; больше 2⁵³ − 1 — этот потолок), `null` — ещё не
7
- * измерено или не определилось. Объект сериализуется `JSON.stringify` как есть.
4
+ * Counters since the router was created: the share of reads from replicas and the primary,
5
+ * the reasons, the lag. The lag is the last measured one (bytes of WAL from the primary insert
6
+ * position, a number; above 2⁵³ − 1 it is this ceiling), `null` means not yet
7
+ * measured or not determined. The object is serialized by `JSON.stringify` as is.
8
8
  */
9
9
  export interface RouterStats {
10
10
  readonly reads: {
@@ -18,12 +18,12 @@ export interface RouterStats {
18
18
  readonly failed: number;
19
19
  };
20
20
  readonly lagBytes: Readonly<Record<string, number | null>>;
21
- /** Токены старше `tokenTtlMs`, которые иначе держали бы чтение на мастере, — прочитаны как без токена. */
21
+ /** Tokens older than `tokenTtlMs` that would otherwise hold a read on the primary — read as without a token. */
22
22
  readonly expiredTokens: number;
23
23
  /**
24
- * `confirm` на соединении чтения: подтверждено / отклонено и почему. Решение
25
- * «реплика», отклонённое здесь, в `reads.replica` уже посчитано — чтение
26
- * ушло на мастер; без этого счётчика доля мастера была бы не видна.
24
+ * `confirm` on the read connection: confirmed / rejected and why. A "replica"
25
+ * decision rejected here is already counted in `reads.replica` — the read
26
+ * went to the primary; without this counter the share of the primary would not be visible.
27
27
  */
28
28
  readonly confirms: {
29
29
  readonly confirmed: number;
@@ -1,10 +1,10 @@
1
1
  import type { ExclusionReason } from './exclusion-reason.type';
2
2
  import type { RouteReason } from './route-reason.type';
3
3
  /**
4
- * Счётчики с момента создания маршрутизатора: доля чтений с реплик и мастера,
5
- * причины, отставание. Отставание — последнее измеренное (байт WAL от позиции
6
- * вставки мастера, число; больше 2⁵³ − 1 — этот потолок), `null` — ещё не
7
- * измерено или не определилось. Объект сериализуется `JSON.stringify` как есть.
4
+ * Counters since the router was created: the share of reads from replicas and the primary,
5
+ * the reasons, the lag. The lag is the last measured one (bytes of WAL from the primary insert
6
+ * position, a number; above 2⁵³ − 1 it is this ceiling), `null` means not yet
7
+ * measured or not determined. The object is serialized by `JSON.stringify` as is.
8
8
  */
9
9
  export interface RouterStats {
10
10
  readonly reads: {
@@ -18,12 +18,12 @@ export interface RouterStats {
18
18
  readonly failed: number;
19
19
  };
20
20
  readonly lagBytes: Readonly<Record<string, number | null>>;
21
- /** Токены старше `tokenTtlMs`, которые иначе держали бы чтение на мастере, — прочитаны как без токена. */
21
+ /** Tokens older than `tokenTtlMs` that would otherwise hold a read on the primary — read as without a token. */
22
22
  readonly expiredTokens: number;
23
23
  /**
24
- * `confirm` на соединении чтения: подтверждено / отклонено и почему. Решение
25
- * «реплика», отклонённое здесь, в `reads.replica` уже посчитано — чтение
26
- * ушло на мастер; без этого счётчика доля мастера была бы не видна.
24
+ * `confirm` on the read connection: confirmed / rejected and why. A "replica"
25
+ * decision rejected here is already counted in `reads.replica` — the read
26
+ * went to the primary; without this counter the share of the primary would not be visible.
27
27
  */
28
28
  readonly confirms: {
29
29
  readonly confirmed: number;
@@ -1 +1 @@
1
- {"version":3,"file":"router-stats.type.d.ts","sourceRoot":"","sources":["../../src/types/router-stats.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,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WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAC3D,gHAAgH;IAChH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;KACtE,CAAC;CACH"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Соединение, на котором идёт транзакция записи: `pg.Client` или `pg.PoolClient`
3
- * (не пул — у пула COMMIT ушёл бы на случайное соединение). `command` — тег
4
- * ответа: у `COMMIT` транзакции с ошибкой он `ROLLBACK`. Драйвер, который тега не
5
- * сообщает, подходит: состояние транзакции до COMMIT проверяется отдельно.
2
+ * The connection on which the write transaction runs: `pg.Client` or `pg.PoolClient`
3
+ * (not a pool — with a pool COMMIT would go to a random connection). `command` is the answer
4
+ * tag: for the `COMMIT` of a transaction with an error it is `ROLLBACK`. A driver that does not report the tag
5
+ * fits: the transaction state before COMMIT is checked separately.
6
6
  */
7
7
  export interface SqlCommandExecutor {
8
8
  query(text: string): Promise<{
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Соединение, на котором идёт транзакция записи: `pg.Client` или `pg.PoolClient`
3
- * (не пул — у пула COMMIT ушёл бы на случайное соединение). `command` — тег
4
- * ответа: у `COMMIT` транзакции с ошибкой он `ROLLBACK`. Драйвер, который тега не
5
- * сообщает, подходит: состояние транзакции до COMMIT проверяется отдельно.
2
+ * The connection on which the write transaction runs: `pg.Client` or `pg.PoolClient`
3
+ * (not a pool — with a pool COMMIT would go to a random connection). `command` is the answer
4
+ * tag: for the `COMMIT` of a transaction with an error it is `ROLLBACK`. A driver that does not report the tag
5
+ * fits: the transaction state before COMMIT is checked separately.
6
6
  */
7
7
  export interface SqlCommandExecutor {
8
8
  query(text: string): Promise<{
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Чем выполнить запрос: `pg.Client`, `pg.PoolClient`, `pg.Pool` — или что угодно
3
- * с той же формой. Структурно, чтобы вторая копия `pg` в монорепозитории
4
- * подходила так же.
2
+ * What to run a query with: `pg.Client`, `pg.PoolClient`, `pg.Pool` — or anything
3
+ * of the same shape. Structurally, so that a second copy of `pg` in a monorepo
4
+ * fits the same way.
5
5
  */
6
6
  export interface SqlQueryExecutor {
7
7
  query(text: string): Promise<{
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Чем выполнить запрос: `pg.Client`, `pg.PoolClient`, `pg.Pool` — или что угодно
3
- * с той же формой. Структурно, чтобы вторая копия `pg` в монорепозитории
4
- * подходила так же.
2
+ * What to run a query with: `pg.Client`, `pg.PoolClient`, `pg.Pool` — or anything
3
+ * of the same shape. Structurally, so that a second copy of `pg` in a monorepo
4
+ * fits the same way.
5
5
  */
6
6
  export interface SqlQueryExecutor {
7
7
  query(text: string): Promise<{
@@ -1,4 +1,4 @@
1
- /** Раскладка WAL сервера (`pg_control_init()`): выравнивание, размер страницы и сегмента, байт. */
1
+ /** The server WAL layout (`pg_control_init()`): the alignment, the page size and the segment size, bytes. */
2
2
  export interface WalLayout {
3
3
  readonly maxAlign: number;
4
4
  readonly blockSize: number;
@@ -1,4 +1,4 @@
1
- /** Раскладка WAL сервера (`pg_control_init()`): выравнивание, размер страницы и сегмента, байт. */
1
+ /** The server WAL layout (`pg_control_init()`): the alignment, the page size and the segment size, bytes. */
2
2
  export interface WalLayout {
3
3
  readonly maxAlign: number;
4
4
  readonly blockSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"wal-layout.type.d.ts","sourceRoot":"","sources":["../../src/types/wal-layout.type.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
1
+ {"version":3,"file":"wal-layout.type.d.ts","sourceRoot":"","sources":["../../src/types/wal-layout.type.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Позиция в WAL конкретного кластера на конкретной линии времени. Одна позиция
3
- * без линии времени после failover ничего не значит: на новой линии те же
4
- * номера означают другие записи.
2
+ * A WAL position of a specific cluster on a specific timeline. One position
3
+ * without a timeline means nothing after a failover: on a new timeline the same
4
+ * numbers mean other records.
5
5
  */
6
6
  export interface WalPosition {
7
- /** `pg_control_system().system_identifier` — общий у мастера и его реплик. */
7
+ /** `pg_control_system().system_identifier` — shared by the primary and its replicas. */
8
8
  readonly systemId: string;
9
9
  readonly timeline: number;
10
- /** 64-битная позиция (`X/Y` → X·2³² + Y). */
10
+ /** A 64-bit position (`X/Y` → X·2³² + Y). */
11
11
  readonly lsn: bigint;
12
12
  }
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Позиция в WAL конкретного кластера на конкретной линии времени. Одна позиция
3
- * без линии времени после failover ничего не значит: на новой линии те же
4
- * номера означают другие записи.
2
+ * A WAL position of a specific cluster on a specific timeline. One position
3
+ * without a timeline means nothing after a failover: on a new timeline the same
4
+ * numbers mean other records.
5
5
  */
6
6
  export interface WalPosition {
7
- /** `pg_control_system().system_identifier` — общий у мастера и его реплик. */
7
+ /** `pg_control_system().system_identifier` — shared by the primary and its replicas. */
8
8
  readonly systemId: string;
9
9
  readonly timeline: number;
10
- /** 64-битная позиция (`X/Y` → X·2³² + Y). */
10
+ /** A 64-bit position (`X/Y` → X·2³² + Y). */
11
11
  readonly lsn: bigint;
12
12
  }
13
13
  //# sourceMappingURL=wal-position.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wal-position.type.d.ts","sourceRoot":"","sources":["../../src/types/wal-position.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"wal-position.type.d.ts","sourceRoot":"","sources":["../../src/types/wal-position.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB"}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Текст брошенного значения, который сам не бросает. Обычное значение — как
3
- * `String(value)` (у ошибки — «Имя: сообщение»), но `String()` на значении без
4
- * прототипа (`Object.create(null)`) или с бросающим `toString` /
5
- * `Symbol.toPrimitive` бросает TypeError — в ветке, которая разбирает отказ.
6
- * Тогда — `message`, если это строка, иначе тег объекта.
2
+ * The text of a thrown value that does not throw itself. An ordinary value is as
3
+ * `String(value)` (for an error — "Name: message"), but `String()` on a value without
4
+ * a prototype (`Object.create(null)`) or with a throwing `toString` /
5
+ * `Symbol.toPrimitive` throws a TypeError — in the branch that handles a refusal.
6
+ * Then `message` if it is a string, otherwise the object tag.
7
7
  */
8
8
  export declare function valueText(value: unknown): string;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Текст брошенного значения, который сам не бросает. Обычное значение — как
3
- * `String(value)` (у ошибки — «Имя: сообщение»), но `String()` на значении без
4
- * прототипа (`Object.create(null)`) или с бросающим `toString` /
5
- * `Symbol.toPrimitive` бросает TypeError — в ветке, которая разбирает отказ.
6
- * Тогда — `message`, если это строка, иначе тег объекта.
2
+ * The text of a thrown value that does not throw itself. An ordinary value is as
3
+ * `String(value)` (for an error — "Name: message"), but `String()` on a value without
4
+ * a prototype (`Object.create(null)`) or with a throwing `toString` /
5
+ * `Symbol.toPrimitive` throws a TypeError — in the branch that handles a refusal.
6
+ * Then `message` if it is a string, otherwise the object tag.
7
7
  */
8
8
  export declare function valueText(value: unknown): string;
9
9
  //# sourceMappingURL=value-text.d.ts.map
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.valueText = valueText;
4
4
  /**
5
- * Текст брошенного значения, который сам не бросает. Обычное значение — как
6
- * `String(value)` (у ошибки — «Имя: сообщение»), но `String()` на значении без
7
- * прототипа (`Object.create(null)`) или с бросающим `toString` /
8
- * `Symbol.toPrimitive` бросает TypeError — в ветке, которая разбирает отказ.
9
- * Тогда — `message`, если это строка, иначе тег объекта.
5
+ * The text of a thrown value that does not throw itself. An ordinary value is as
6
+ * `String(value)` (for an error — "Name: message"), but `String()` on a value without
7
+ * a prototype (`Object.create(null)`) or with a throwing `toString` /
8
+ * `Symbol.toPrimitive` throws a TypeError — in the branch that handles a refusal.
9
+ * Then `message` if it is a string, otherwise the object tag.
10
10
  */
11
11
  function valueText(value) {
12
12
  try {
@@ -18,7 +18,7 @@ function valueText(value) {
18
18
  return typeof message === 'string' ? message : Object.prototype.toString.call(value);
19
19
  }
20
20
  catch {
21
- return '[значение без текста]';
21
+ return '[a value without text]';
22
22
  }
23
23
  }
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"value-text.js","sourceRoot":"","sources":["../src/value-text.ts"],"names":[],"mappings":";;AAOA,8BAWC;AAlBD;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,MAAM,OAAO,GAAI,KAAsC,EAAE,OAAO,CAAC;YACjE,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvF,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,uBAAuB,CAAC;QACjC,CAAC;IACH,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"value-text.js","sourceRoot":"","sources":["../src/value-text.ts"],"names":[],"mappings":";;AAOA,8BAWC;AAlBD;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,KAAc;IACtC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,MAAM,OAAO,GAAI,KAAsC,EAAE,OAAO,CAAC;YACjE,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvF,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,wBAAwB,CAAC;QAClC,CAAC;IACH,CAAC;AACH,CAAC"}