@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
@@ -1,52 +1,52 @@
1
- /** Умолчания маршрутизатора; каждое переопределяется опцией с тем же смыслом. */
1
+ /** The router defaults; each one is overridden by an option with the same meaning. */
2
2
  export declare const REPLICA_SYNC_DEFAULTS: {
3
- /** Сколько живёт состояние узла в кэше, мс. */
3
+ /** How long a node state lives in the cache, ms. */
4
4
  readonly STATE_TTL_MS: 250;
5
5
  /**
6
- * Потолок `stateTtlMs`, мс: окно, в котором перезапуск реплики (позиция
7
- * воспроизведения после него МЕНЬШЕ — откат к minRecoveryPoint) может остаться
8
- * незамеченным, если потеря соединения зонда не дошла до клиента.
6
+ * The ceiling of `stateTtlMs`, ms: the window in which a replica restart (the replay
7
+ * position after it is SMALLER — a rollback to minRecoveryPoint) may stay
8
+ * unnoticed if the loss of the probe connection did not reach the client.
9
9
  */
10
10
  readonly MAX_STATE_TTL_MS: 1000;
11
- /** Потолок одного зонда (установка соединения + запрос), мс. */
11
+ /** The ceiling of one probe (connection establishment + query), ms. */
12
12
  readonly PROBE_TIMEOUT_MS: 1000;
13
13
  /**
14
- * Потолок жизни соединения зонда, которое не установилось или запрос на котором
15
- * не ответил, мс (с начала установки или запроса). Зонд, не уложившийся в
16
- * `PROBE_TIMEOUT_MS`, — отказ этого зонда, но соединение не рвётся до этого
17
- * потолка: медленная, но живая реплика (установка дольше потолка зонда) получает
18
- * готовое соединение к следующему зонду, а замёрзшая остаётся недоступной.
14
+ * The lifetime ceiling of a probe connection that did not get established or on which a query
15
+ * did not answer, ms (from the start of the establishment or the query). A probe that did not fit into
16
+ * `PROBE_TIMEOUT_MS` is a refusal of this probe, but the connection is not torn until this
17
+ * ceiling: a slow but alive replica (establishment longer than the probe ceiling) gets
18
+ * a ready connection for the next probe, and a frozen one stays unavailable.
19
19
  */
20
20
  readonly CONNECT_TIMEOUT_MS: 10000;
21
- /** Сколько узел, не ответивший зонду, не опрашивается снова, мс. */
21
+ /** How long a node that did not answer a probe is not polled again, ms. */
22
22
  readonly UNAVAILABLE_RETRY_MS: 2000;
23
- /** Без токена: потолок отставания реплики от мастера, байт WAL. */
23
+ /** Without a token: the ceiling of a replica lag behind the primary, bytes of WAL. */
24
24
  readonly MAX_LAG_BYTES: 1048576;
25
- /** Ожидание догоняния перед уходом на мастер, мс (0 — не ждать). */
25
+ /** Waiting for catch-up before going to the primary, ms (0 — do not wait). */
26
26
  readonly WAIT_FOR_CATCH_UP_MS: 0;
27
- /** Интервал опроса реплик во время ожидания, мс. */
27
+ /** The interval of polling the replicas during the wait, ms. */
28
28
  readonly CATCH_UP_POLL_MS: 10;
29
29
  /**
30
- * Не чаще одного нового зонда узла за столько мс, при любом числе чтений:
31
- * токен впереди реплики требует свежего зонда, и без потолка отставшие реплики
32
- * опрашивались бы на каждое чтение.
30
+ * No more than one new probe of a node per this many ms, with any number of reads:
31
+ * a token ahead of a replica requires a fresh probe, and without a ceiling lagging replicas
32
+ * would be polled on every read.
33
33
  */
34
34
  readonly MIN_PROBE_INTERVAL_MS: 10;
35
35
  /**
36
- * Сколько токен, который после failover ни одна реплика выполнить не может
37
- * (другая линия времени, другой кластер, впереди мастера), держит чтения на
38
- * мастере, мс; старше — чтение как без токена. Токен «без позиции» не
39
- * стареет: его позиция неизвестна.
36
+ * How long a token that after a failover no replica can satisfy
37
+ * (another timeline, another cluster, ahead of the primary) holds reads on the
38
+ * primary, ms; an older one is read as without a token. A token "without a position" does not
39
+ * age: its position is unknown.
40
40
  */
41
41
  readonly TOKEN_TTL_MS: 60000;
42
42
  /**
43
- * Сколько позиций токенов маршрутизатор помнит (момент первой встречи — для
44
- * потолка частоты зондов и истечения); вытесняется давно не встречавшаяся (LRU).
43
+ * How many token positions the router remembers (the moment of the first encounter — for
44
+ * the probe frequency ceiling and expiry); the one not seen for the longest time is evicted (LRU).
45
45
  */
46
46
  readonly POSITION_MEMORY: 1024;
47
- /** Потолок значений, которые идут в таймеры (`setTimeout` больше 2³¹−1 мс срабатывает через 1 мс). */
47
+ /** The ceiling of values that go into timers (`setTimeout` above 2³¹−1 ms fires after 1 ms). */
48
48
  readonly MAX_TIMER_MS: 2147483647;
49
- /** `application_name` соединений зонда, если адрес его не задаёт: видно в pg_stat_activity. */
49
+ /** The `application_name` of the probe connections if the address does not set it: visible in pg_stat_activity. */
50
50
  readonly APPLICATION_NAME: "pg-replica-sync";
51
51
  };
52
52
  //# sourceMappingURL=replica-sync-defaults.constant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replica-sync-defaults.constant.d.ts","sourceRoot":"","sources":["../../src/constants/replica-sync-defaults.constant.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,eAAO,MAAM,qBAAqB;IAChC,+CAA+C;;IAE/C;;;;OAIG;;IAEH,gEAAgE;;IAEhE;;;;;;OAMG;;IAEH,oEAAoE;;IAEpE,mEAAmE;;IAEnE,oEAAoE;;IAEpE,oDAAoD;;IAEpD;;;;OAIG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH,sGAAsG;;IAEtG,+FAA+F;;CAEvF,CAAC"}
1
+ {"version":3,"file":"replica-sync-defaults.constant.d.ts","sourceRoot":"","sources":["../../src/constants/replica-sync-defaults.constant.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,eAAO,MAAM,qBAAqB;IAChC,oDAAoD;;IAEpD;;;;OAIG;;IAEH,uEAAuE;;IAEvE;;;;;;OAMG;;IAEH,2EAA2E;;IAE3E,sFAAsF;;IAEtF,8EAA8E;;IAE9E,gEAAgE;;IAEhE;;;;OAIG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH,gGAAgG;;IAEhG,mHAAmH;;CAE3G,CAAC"}
@@ -2,55 +2,55 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.REPLICA_SYNC_DEFAULTS = void 0;
4
4
  const deep_freeze_1 = require("../deep-freeze");
5
- /** Умолчания маршрутизатора; каждое переопределяется опцией с тем же смыслом. */
5
+ /** The router defaults; each one is overridden by an option with the same meaning. */
6
6
  exports.REPLICA_SYNC_DEFAULTS = {
7
- /** Сколько живёт состояние узла в кэше, мс. */
7
+ /** How long a node state lives in the cache, ms. */
8
8
  STATE_TTL_MS: 250,
9
9
  /**
10
- * Потолок `stateTtlMs`, мс: окно, в котором перезапуск реплики (позиция
11
- * воспроизведения после него МЕНЬШЕ — откат к minRecoveryPoint) может остаться
12
- * незамеченным, если потеря соединения зонда не дошла до клиента.
10
+ * The ceiling of `stateTtlMs`, ms: the window in which a replica restart (the replay
11
+ * position after it is SMALLER — a rollback to minRecoveryPoint) may stay
12
+ * unnoticed if the loss of the probe connection did not reach the client.
13
13
  */
14
14
  MAX_STATE_TTL_MS: 1_000,
15
- /** Потолок одного зонда (установка соединения + запрос), мс. */
15
+ /** The ceiling of one probe (connection establishment + query), ms. */
16
16
  PROBE_TIMEOUT_MS: 1_000,
17
17
  /**
18
- * Потолок жизни соединения зонда, которое не установилось или запрос на котором
19
- * не ответил, мс (с начала установки или запроса). Зонд, не уложившийся в
20
- * `PROBE_TIMEOUT_MS`, — отказ этого зонда, но соединение не рвётся до этого
21
- * потолка: медленная, но живая реплика (установка дольше потолка зонда) получает
22
- * готовое соединение к следующему зонду, а замёрзшая остаётся недоступной.
18
+ * The lifetime ceiling of a probe connection that did not get established or on which a query
19
+ * did not answer, ms (from the start of the establishment or the query). A probe that did not fit into
20
+ * `PROBE_TIMEOUT_MS` is a refusal of this probe, but the connection is not torn until this
21
+ * ceiling: a slow but alive replica (establishment longer than the probe ceiling) gets
22
+ * a ready connection for the next probe, and a frozen one stays unavailable.
23
23
  */
24
24
  CONNECT_TIMEOUT_MS: 10_000,
25
- /** Сколько узел, не ответивший зонду, не опрашивается снова, мс. */
25
+ /** How long a node that did not answer a probe is not polled again, ms. */
26
26
  UNAVAILABLE_RETRY_MS: 2_000,
27
- /** Без токена: потолок отставания реплики от мастера, байт WAL. */
27
+ /** Without a token: the ceiling of a replica lag behind the primary, bytes of WAL. */
28
28
  MAX_LAG_BYTES: 1_048_576,
29
- /** Ожидание догоняния перед уходом на мастер, мс (0 — не ждать). */
29
+ /** Waiting for catch-up before going to the primary, ms (0 — do not wait). */
30
30
  WAIT_FOR_CATCH_UP_MS: 0,
31
- /** Интервал опроса реплик во время ожидания, мс. */
31
+ /** The interval of polling the replicas during the wait, ms. */
32
32
  CATCH_UP_POLL_MS: 10,
33
33
  /**
34
- * Не чаще одного нового зонда узла за столько мс, при любом числе чтений:
35
- * токен впереди реплики требует свежего зонда, и без потолка отставшие реплики
36
- * опрашивались бы на каждое чтение.
34
+ * No more than one new probe of a node per this many ms, with any number of reads:
35
+ * a token ahead of a replica requires a fresh probe, and without a ceiling lagging replicas
36
+ * would be polled on every read.
37
37
  */
38
38
  MIN_PROBE_INTERVAL_MS: 10,
39
39
  /**
40
- * Сколько токен, который после failover ни одна реплика выполнить не может
41
- * (другая линия времени, другой кластер, впереди мастера), держит чтения на
42
- * мастере, мс; старше — чтение как без токена. Токен «без позиции» не
43
- * стареет: его позиция неизвестна.
40
+ * How long a token that after a failover no replica can satisfy
41
+ * (another timeline, another cluster, ahead of the primary) holds reads on the
42
+ * primary, ms; an older one is read as without a token. A token "without a position" does not
43
+ * age: its position is unknown.
44
44
  */
45
45
  TOKEN_TTL_MS: 60_000,
46
46
  /**
47
- * Сколько позиций токенов маршрутизатор помнит (момент первой встречи — для
48
- * потолка частоты зондов и истечения); вытесняется давно не встречавшаяся (LRU).
47
+ * How many token positions the router remembers (the moment of the first encounter — for
48
+ * the probe frequency ceiling and expiry); the one not seen for the longest time is evicted (LRU).
49
49
  */
50
50
  POSITION_MEMORY: 1_024,
51
- /** Потолок значений, которые идут в таймеры (`setTimeout` больше 2³¹−1 мс срабатывает через 1 мс). */
51
+ /** The ceiling of values that go into timers (`setTimeout` above 2³¹−1 ms fires after 1 ms). */
52
52
  MAX_TIMER_MS: 2_147_483_647,
53
- /** `application_name` соединений зонда, если адрес его не задаёт: видно в pg_stat_activity. */
53
+ /** The `application_name` of the probe connections if the address does not set it: visible in pg_stat_activity. */
54
54
  APPLICATION_NAME: 'pg-replica-sync',
55
55
  };
56
56
  (0, deep_freeze_1.deepFreeze)(exports.REPLICA_SYNC_DEFAULTS);
@@ -1 +1 @@
1
- {"version":3,"file":"replica-sync-defaults.constant.js","sourceRoot":"","sources":["../../src/constants/replica-sync-defaults.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,iFAAiF;AACpE,QAAA,qBAAqB,GAAG;IACnC,+CAA+C;IAC/C,YAAY,EAAE,GAAG;IACjB;;;;OAIG;IACH,gBAAgB,EAAE,KAAK;IACvB,gEAAgE;IAChE,gBAAgB,EAAE,KAAK;IACvB;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM;IAC1B,oEAAoE;IACpE,oBAAoB,EAAE,KAAK;IAC3B,mEAAmE;IACnE,aAAa,EAAE,SAAS;IACxB,oEAAoE;IACpE,oBAAoB,EAAE,CAAC;IACvB,oDAAoD;IACpD,gBAAgB,EAAE,EAAE;IACpB;;;;OAIG;IACH,qBAAqB,EAAE,EAAE;IACzB;;;;;OAKG;IACH,YAAY,EAAE,MAAM;IACpB;;;OAGG;IACH,eAAe,EAAE,KAAK;IACtB,sGAAsG;IACtG,YAAY,EAAE,aAAa;IAC3B,+FAA+F;IAC/F,gBAAgB,EAAE,iBAAiB;CAC3B,CAAC;AACX,IAAA,wBAAU,EAAC,6BAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"replica-sync-defaults.constant.js","sourceRoot":"","sources":["../../src/constants/replica-sync-defaults.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,sFAAsF;AACzE,QAAA,qBAAqB,GAAG;IACnC,oDAAoD;IACpD,YAAY,EAAE,GAAG;IACjB;;;;OAIG;IACH,gBAAgB,EAAE,KAAK;IACvB,uEAAuE;IACvE,gBAAgB,EAAE,KAAK;IACvB;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM;IAC1B,2EAA2E;IAC3E,oBAAoB,EAAE,KAAK;IAC3B,sFAAsF;IACtF,aAAa,EAAE,SAAS;IACxB,8EAA8E;IAC9E,oBAAoB,EAAE,CAAC;IACvB,gEAAgE;IAChE,gBAAgB,EAAE,EAAE;IACpB;;;;OAIG;IACH,qBAAqB,EAAE,EAAE;IACzB;;;;;OAKG;IACH,YAAY,EAAE,MAAM;IACpB;;;OAGG;IACH,eAAe,EAAE,KAAK;IACtB,gGAAgG;IAChG,YAAY,EAAE,aAAa;IAC3B,mHAAmH;IACnH,gBAAgB,EAAE,iBAAiB;CAC3B,CAAC;AACX,IAAA,wBAAU,EAAC,6BAAqB,CAAC,CAAC"}
@@ -1,27 +1,27 @@
1
1
  /**
2
- * Почему чтение ушло туда, куда ушло. Значение — метка метрики: словарь
3
- * закрытый, каждая причина ухода на мастер называется отдельно, чтобы «реплики
4
- * отстают» отличалось от «токен испорчен» и от «не смогли определить».
2
+ * Why the read went where it went. The value is a metric label: the dictionary
3
+ * is closed, each reason for going to the primary is named separately, so that "the replicas
4
+ * lag" differs from "the token is broken" and from "could not determine".
5
5
  */
6
6
  export declare const ROUTE_REASON: {
7
- /** Реплика догнала позицию токена. */
7
+ /** The replica caught up with the token position. */
8
8
  readonly replicaCaughtUp: "replica-caught-up";
9
- /** Без токена: отставание реплики в потолке. */
9
+ /** Without a token: the replica lag is within the ceiling. */
10
10
  readonly replicaWithinLag: "replica-within-lag";
11
- /** Реплик не задано. */
11
+ /** No replicas are configured. */
12
12
  readonly noReplicas: "no-replicas";
13
- /** Токен не разбирается: не та форма, не та подпись, слишком длинный. */
13
+ /** The token does not parse: the wrong form, the wrong signature, too long. */
14
14
  readonly tokenInvalid: "token-invalid";
15
- /** Токен выдан без позиции (позицию после записи определить не смогли). */
15
+ /** The token was issued without a position (the position after the write could not be determined). */
16
16
  readonly tokenUnresolved: "token-unresolved";
17
- /** Токен с другой линии времени, чем у мастера: был failover. */
17
+ /** The token is from another timeline than the primary's: there was a failover. */
18
18
  readonly tokenOtherTimeline: "token-other-timeline";
19
- /** Позиция токена впереди мастера той же линии времени. */
19
+ /** The token position is ahead of the primary on the same timeline. */
20
20
  readonly tokenAheadOfPrimary: "token-ahead-of-primary";
21
- /** Токен выдан другим кластером (system identifier не совпал). */
21
+ /** The token was issued by another cluster (the system identifier did not match). */
22
22
  readonly tokenForeign: "token-foreign";
23
- /** Ни одна реплика не подошла; почему каждая — в `excluded`. */
23
+ /** No replica fitted; why each did not is in `excluded`. */
24
24
  readonly noReplicaEligible: "no-replica-eligible";
25
- /** Без токена: позицию или линию времени мастера определить не смогли. */
25
+ /** Without a token: the primary position or timeline could not be determined. */
26
26
  readonly primaryStateUnknown: "primary-state-unknown";
27
27
  };
@@ -1,28 +1,28 @@
1
1
  /**
2
- * Почему чтение ушло туда, куда ушло. Значение — метка метрики: словарь
3
- * закрытый, каждая причина ухода на мастер называется отдельно, чтобы «реплики
4
- * отстают» отличалось от «токен испорчен» и от «не смогли определить».
2
+ * Why the read went where it went. The value is a metric label: the dictionary
3
+ * is closed, each reason for going to the primary is named separately, so that "the replicas
4
+ * lag" differs from "the token is broken" and from "could not determine".
5
5
  */
6
6
  export declare const ROUTE_REASON: {
7
- /** Реплика догнала позицию токена. */
7
+ /** The replica caught up with the token position. */
8
8
  readonly replicaCaughtUp: "replica-caught-up";
9
- /** Без токена: отставание реплики в потолке. */
9
+ /** Without a token: the replica lag is within the ceiling. */
10
10
  readonly replicaWithinLag: "replica-within-lag";
11
- /** Реплик не задано. */
11
+ /** No replicas are configured. */
12
12
  readonly noReplicas: "no-replicas";
13
- /** Токен не разбирается: не та форма, не та подпись, слишком длинный. */
13
+ /** The token does not parse: the wrong form, the wrong signature, too long. */
14
14
  readonly tokenInvalid: "token-invalid";
15
- /** Токен выдан без позиции (позицию после записи определить не смогли). */
15
+ /** The token was issued without a position (the position after the write could not be determined). */
16
16
  readonly tokenUnresolved: "token-unresolved";
17
- /** Токен с другой линии времени, чем у мастера: был failover. */
17
+ /** The token is from another timeline than the primary's: there was a failover. */
18
18
  readonly tokenOtherTimeline: "token-other-timeline";
19
- /** Позиция токена впереди мастера той же линии времени. */
19
+ /** The token position is ahead of the primary on the same timeline. */
20
20
  readonly tokenAheadOfPrimary: "token-ahead-of-primary";
21
- /** Токен выдан другим кластером (system identifier не совпал). */
21
+ /** The token was issued by another cluster (the system identifier did not match). */
22
22
  readonly tokenForeign: "token-foreign";
23
- /** Ни одна реплика не подошла; почему каждая — в `excluded`. */
23
+ /** No replica fitted; why each did not is in `excluded`. */
24
24
  readonly noReplicaEligible: "no-replica-eligible";
25
- /** Без токена: позицию или линию времени мастера определить не смогли. */
25
+ /** Without a token: the primary position or timeline could not be determined. */
26
26
  readonly primaryStateUnknown: "primary-state-unknown";
27
27
  };
28
28
  //# sourceMappingURL=route-reason.constant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-reason.constant.d.ts","sourceRoot":"","sources":["../../src/constants/route-reason.constant.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,YAAY;IACvB,sCAAsC;;IAEtC,gDAAgD;;IAEhD,wBAAwB;;IAExB,yEAAyE;;IAEzE,2EAA2E;;IAE3E,iEAAiE;;IAEjE,2DAA2D;;IAE3D,kEAAkE;;IAElE,gEAAgE;;IAEhE,0EAA0E;;CAElE,CAAC"}
1
+ {"version":3,"file":"route-reason.constant.d.ts","sourceRoot":"","sources":["../../src/constants/route-reason.constant.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,YAAY;IACvB,qDAAqD;;IAErD,8DAA8D;;IAE9D,kCAAkC;;IAElC,+EAA+E;;IAE/E,sGAAsG;;IAEtG,mFAAmF;;IAEnF,uEAAuE;;IAEvE,qFAAqF;;IAErF,4DAA4D;;IAE5D,iFAAiF;;CAEzE,CAAC"}
@@ -3,30 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ROUTE_REASON = void 0;
4
4
  const deep_freeze_1 = require("../deep-freeze");
5
5
  /**
6
- * Почему чтение ушло туда, куда ушло. Значение — метка метрики: словарь
7
- * закрытый, каждая причина ухода на мастер называется отдельно, чтобы «реплики
8
- * отстают» отличалось от «токен испорчен» и от «не смогли определить».
6
+ * Why the read went where it went. The value is a metric label: the dictionary
7
+ * is closed, each reason for going to the primary is named separately, so that "the replicas
8
+ * lag" differs from "the token is broken" and from "could not determine".
9
9
  */
10
10
  exports.ROUTE_REASON = {
11
- /** Реплика догнала позицию токена. */
11
+ /** The replica caught up with the token position. */
12
12
  replicaCaughtUp: 'replica-caught-up',
13
- /** Без токена: отставание реплики в потолке. */
13
+ /** Without a token: the replica lag is within the ceiling. */
14
14
  replicaWithinLag: 'replica-within-lag',
15
- /** Реплик не задано. */
15
+ /** No replicas are configured. */
16
16
  noReplicas: 'no-replicas',
17
- /** Токен не разбирается: не та форма, не та подпись, слишком длинный. */
17
+ /** The token does not parse: the wrong form, the wrong signature, too long. */
18
18
  tokenInvalid: 'token-invalid',
19
- /** Токен выдан без позиции (позицию после записи определить не смогли). */
19
+ /** The token was issued without a position (the position after the write could not be determined). */
20
20
  tokenUnresolved: 'token-unresolved',
21
- /** Токен с другой линии времени, чем у мастера: был failover. */
21
+ /** The token is from another timeline than the primary's: there was a failover. */
22
22
  tokenOtherTimeline: 'token-other-timeline',
23
- /** Позиция токена впереди мастера той же линии времени. */
23
+ /** The token position is ahead of the primary on the same timeline. */
24
24
  tokenAheadOfPrimary: 'token-ahead-of-primary',
25
- /** Токен выдан другим кластером (system identifier не совпал). */
25
+ /** The token was issued by another cluster (the system identifier did not match). */
26
26
  tokenForeign: 'token-foreign',
27
- /** Ни одна реплика не подошла; почему каждая — в `excluded`. */
27
+ /** No replica fitted; why each did not is in `excluded`. */
28
28
  noReplicaEligible: 'no-replica-eligible',
29
- /** Без токена: позицию или линию времени мастера определить не смогли. */
29
+ /** Without a token: the primary position or timeline could not be determined. */
30
30
  primaryStateUnknown: 'primary-state-unknown',
31
31
  };
32
32
  (0, deep_freeze_1.deepFreeze)(exports.ROUTE_REASON);
@@ -1 +1 @@
1
- {"version":3,"file":"route-reason.constant.js","sourceRoot":"","sources":["../../src/constants/route-reason.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C;;;;GAIG;AACU,QAAA,YAAY,GAAG;IAC1B,sCAAsC;IACtC,eAAe,EAAE,mBAAmB;IACpC,gDAAgD;IAChD,gBAAgB,EAAE,oBAAoB;IACtC,wBAAwB;IACxB,UAAU,EAAE,aAAa;IACzB,yEAAyE;IACzE,YAAY,EAAE,eAAe;IAC7B,2EAA2E;IAC3E,eAAe,EAAE,kBAAkB;IACnC,iEAAiE;IACjE,kBAAkB,EAAE,sBAAsB;IAC1C,2DAA2D;IAC3D,mBAAmB,EAAE,wBAAwB;IAC7C,kEAAkE;IAClE,YAAY,EAAE,eAAe;IAC7B,gEAAgE;IAChE,iBAAiB,EAAE,qBAAqB;IACxC,0EAA0E;IAC1E,mBAAmB,EAAE,uBAAuB;CACpC,CAAC;AACX,IAAA,wBAAU,EAAC,oBAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"route-reason.constant.js","sourceRoot":"","sources":["../../src/constants/route-reason.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C;;;;GAIG;AACU,QAAA,YAAY,GAAG;IAC1B,qDAAqD;IACrD,eAAe,EAAE,mBAAmB;IACpC,8DAA8D;IAC9D,gBAAgB,EAAE,oBAAoB;IACtC,kCAAkC;IAClC,UAAU,EAAE,aAAa;IACzB,+EAA+E;IAC/E,YAAY,EAAE,eAAe;IAC7B,sGAAsG;IACtG,eAAe,EAAE,kBAAkB;IACnC,mFAAmF;IACnF,kBAAkB,EAAE,sBAAsB;IAC1C,uEAAuE;IACvE,mBAAmB,EAAE,wBAAwB;IAC7C,qFAAqF;IACrF,YAAY,EAAE,eAAe;IAC7B,4DAA4D;IAC5D,iBAAiB,EAAE,qBAAqB;IACxC,iFAAiF;IACjF,mBAAmB,EAAE,uBAAuB;CACpC,CAAC;AACX,IAAA,wBAAU,EAAC,oBAAY,CAAC,CAAC"}
@@ -1,26 +1,26 @@
1
1
  /**
2
- * Форма токена: `v2.<полезная нагрузка base64url>.<HMAC-SHA256 base64url>`.
3
- * Нагрузка: `p:<system_identifier>:<линия времени>:<X/Y>:<выдан, мс эпохи>` или
4
- * `u:<выдан, мс эпохи>` (позицию определить не смогли). Длиннее потолка — отказ
5
- * до разбора: токен приходит из заголовка или cookie клиента, и разбирать
6
- * произвольный объём незачем. Токены `v1` (без момента выдачи) — `invalid`.
2
+ * The token form: `v2.<payload base64url>.<HMAC-SHA256 base64url>`.
3
+ * The payload: `p:<system_identifier>:<timeline>:<X/Y>:<issued, epoch ms>` or
4
+ * `u:<issued, epoch ms>` (the position could not be determined). Longer than the ceiling is a refusal
5
+ * before parsing: the token comes from a client header or cookie, and there is no point in parsing
6
+ * an arbitrary amount. `v1` tokens (without the issue moment) are `invalid`.
7
7
  */
8
8
  export declare const TOKEN_FORMAT: {
9
9
  readonly VERSION: "v2";
10
- /** Разделение доменов подписи: тот же секрет в другом месте не даёт годной подписи здесь. */
10
+ /** Domain separation of the signature: the same secret elsewhere does not give a valid signature here. */
11
11
  readonly DOMAIN: "pg-replica-sync/token/v2";
12
12
  readonly MAX_LENGTH: 256;
13
13
  readonly MIN_SECRET_BYTES: 32;
14
- /** Ключ с меньшей эмпирической энтропией гистограммы байтов (бит на весь ключ) — отказ. */
14
+ /** A key with a lower empirical entropy of the byte histogram (bits for the whole key) is a refusal. */
15
15
  readonly MIN_SECRET_HISTOGRAM_BITS: 64;
16
- /** Ключ, который deflate сжимает до меньшего числа бит, — отказ (почти-повтор). */
16
+ /** A key that deflate compresses to fewer bits is a refusal (a near-repeat). */
17
17
  readonly MIN_SECRET_COMPRESSED_BITS: 128;
18
18
  /** HMAC-SHA256. */
19
19
  readonly MAC_BYTES: 32;
20
- /** Метка нагрузки с позицией. */
20
+ /** The tag of a payload with a position. */
21
21
  readonly POSITION_TAG: "p";
22
- /** Метка нагрузки токена, выданного без позиции. */
22
+ /** The tag of the payload of a token issued without a position. */
23
23
  readonly UNRESOLVED_TAG: "u";
24
- /** Момент выдачи: десятичное без ведущих нулей, не длиннее 16 цифр (≤ 2⁵³ проверяется отдельно). */
24
+ /** The issue moment: a decimal without leading zeros, no longer than 16 digits (≤ 2⁵³ is checked separately). */
25
25
  readonly ISSUED_AT_TEXT: RegExp;
26
26
  };
@@ -1,27 +1,27 @@
1
1
  /**
2
- * Форма токена: `v2.<полезная нагрузка base64url>.<HMAC-SHA256 base64url>`.
3
- * Нагрузка: `p:<system_identifier>:<линия времени>:<X/Y>:<выдан, мс эпохи>` или
4
- * `u:<выдан, мс эпохи>` (позицию определить не смогли). Длиннее потолка — отказ
5
- * до разбора: токен приходит из заголовка или cookie клиента, и разбирать
6
- * произвольный объём незачем. Токены `v1` (без момента выдачи) — `invalid`.
2
+ * The token form: `v2.<payload base64url>.<HMAC-SHA256 base64url>`.
3
+ * The payload: `p:<system_identifier>:<timeline>:<X/Y>:<issued, epoch ms>` or
4
+ * `u:<issued, epoch ms>` (the position could not be determined). Longer than the ceiling is a refusal
5
+ * before parsing: the token comes from a client header or cookie, and there is no point in parsing
6
+ * an arbitrary amount. `v1` tokens (without the issue moment) are `invalid`.
7
7
  */
8
8
  export declare const TOKEN_FORMAT: {
9
9
  readonly VERSION: "v2";
10
- /** Разделение доменов подписи: тот же секрет в другом месте не даёт годной подписи здесь. */
10
+ /** Domain separation of the signature: the same secret elsewhere does not give a valid signature here. */
11
11
  readonly DOMAIN: "pg-replica-sync/token/v2";
12
12
  readonly MAX_LENGTH: 256;
13
13
  readonly MIN_SECRET_BYTES: 32;
14
- /** Ключ с меньшей эмпирической энтропией гистограммы байтов (бит на весь ключ) — отказ. */
14
+ /** A key with a lower empirical entropy of the byte histogram (bits for the whole key) is a refusal. */
15
15
  readonly MIN_SECRET_HISTOGRAM_BITS: 64;
16
- /** Ключ, который deflate сжимает до меньшего числа бит, — отказ (почти-повтор). */
16
+ /** A key that deflate compresses to fewer bits is a refusal (a near-repeat). */
17
17
  readonly MIN_SECRET_COMPRESSED_BITS: 128;
18
18
  /** HMAC-SHA256. */
19
19
  readonly MAC_BYTES: 32;
20
- /** Метка нагрузки с позицией. */
20
+ /** The tag of a payload with a position. */
21
21
  readonly POSITION_TAG: "p";
22
- /** Метка нагрузки токена, выданного без позиции. */
22
+ /** The tag of the payload of a token issued without a position. */
23
23
  readonly UNRESOLVED_TAG: "u";
24
- /** Момент выдачи: десятичное без ведущих нулей, не длиннее 16 цифр (≤ 2⁵³ проверяется отдельно). */
24
+ /** The issue moment: a decimal without leading zeros, no longer than 16 digits (≤ 2⁵³ is checked separately). */
25
25
  readonly ISSUED_AT_TEXT: RegExp;
26
26
  };
27
27
  //# sourceMappingURL=token-format.constant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-format.constant.d.ts","sourceRoot":"","sources":["../../src/constants/token-format.constant.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;IAEvB,6FAA6F;;;;IAI7F,2FAA2F;;IAE3F,mFAAmF;;IAEnF,mBAAmB;;IAEnB,iCAAiC;;IAEjC,oDAAoD;;IAEpD,oGAAoG;;CAE5F,CAAC"}
1
+ {"version":3,"file":"token-format.constant.d.ts","sourceRoot":"","sources":["../../src/constants/token-format.constant.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;IAEvB,0GAA0G;;;;IAI1G,wGAAwG;;IAExG,gFAAgF;;IAEhF,mBAAmB;;IAEnB,4CAA4C;;IAE5C,mEAAmE;;IAEnE,iHAAiH;;CAEzG,CAAC"}
@@ -3,29 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TOKEN_FORMAT = void 0;
4
4
  const deep_freeze_1 = require("../deep-freeze");
5
5
  /**
6
- * Форма токена: `v2.<полезная нагрузка base64url>.<HMAC-SHA256 base64url>`.
7
- * Нагрузка: `p:<system_identifier>:<линия времени>:<X/Y>:<выдан, мс эпохи>` или
8
- * `u:<выдан, мс эпохи>` (позицию определить не смогли). Длиннее потолка — отказ
9
- * до разбора: токен приходит из заголовка или cookie клиента, и разбирать
10
- * произвольный объём незачем. Токены `v1` (без момента выдачи) — `invalid`.
6
+ * The token form: `v2.<payload base64url>.<HMAC-SHA256 base64url>`.
7
+ * The payload: `p:<system_identifier>:<timeline>:<X/Y>:<issued, epoch ms>` or
8
+ * `u:<issued, epoch ms>` (the position could not be determined). Longer than the ceiling is a refusal
9
+ * before parsing: the token comes from a client header or cookie, and there is no point in parsing
10
+ * an arbitrary amount. `v1` tokens (without the issue moment) are `invalid`.
11
11
  */
12
12
  exports.TOKEN_FORMAT = {
13
13
  VERSION: 'v2',
14
- /** Разделение доменов подписи: тот же секрет в другом месте не даёт годной подписи здесь. */
14
+ /** Domain separation of the signature: the same secret elsewhere does not give a valid signature here. */
15
15
  DOMAIN: 'pg-replica-sync/token/v2',
16
16
  MAX_LENGTH: 256,
17
17
  MIN_SECRET_BYTES: 32,
18
- /** Ключ с меньшей эмпирической энтропией гистограммы байтов (бит на весь ключ) — отказ. */
18
+ /** A key with a lower empirical entropy of the byte histogram (bits for the whole key) is a refusal. */
19
19
  MIN_SECRET_HISTOGRAM_BITS: 64,
20
- /** Ключ, который deflate сжимает до меньшего числа бит, — отказ (почти-повтор). */
20
+ /** A key that deflate compresses to fewer bits is a refusal (a near-repeat). */
21
21
  MIN_SECRET_COMPRESSED_BITS: 128,
22
22
  /** HMAC-SHA256. */
23
23
  MAC_BYTES: 32,
24
- /** Метка нагрузки с позицией. */
24
+ /** The tag of a payload with a position. */
25
25
  POSITION_TAG: 'p',
26
- /** Метка нагрузки токена, выданного без позиции. */
26
+ /** The tag of the payload of a token issued without a position. */
27
27
  UNRESOLVED_TAG: 'u',
28
- /** Момент выдачи: десятичное без ведущих нулей, не длиннее 16 цифр (≤ 2⁵³ проверяется отдельно). */
28
+ /** The issue moment: a decimal without leading zeros, no longer than 16 digits (≤ 2⁵³ is checked separately). */
29
29
  ISSUED_AT_TEXT: /^(0|[1-9][0-9]{0,15})$/,
30
30
  };
31
31
  (0, deep_freeze_1.deepFreeze)(exports.TOKEN_FORMAT);
@@ -1 +1 @@
1
- {"version":3,"file":"token-format.constant.js","sourceRoot":"","sources":["../../src/constants/token-format.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C;;;;;;GAMG;AACU,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,IAAI;IACb,6FAA6F;IAC7F,MAAM,EAAE,0BAA0B;IAClC,UAAU,EAAE,GAAG;IACf,gBAAgB,EAAE,EAAE;IACpB,2FAA2F;IAC3F,yBAAyB,EAAE,EAAE;IAC7B,mFAAmF;IACnF,0BAA0B,EAAE,GAAG;IAC/B,mBAAmB;IACnB,SAAS,EAAE,EAAE;IACb,iCAAiC;IACjC,YAAY,EAAE,GAAG;IACjB,oDAAoD;IACpD,cAAc,EAAE,GAAG;IACnB,oGAAoG;IACpG,cAAc,EAAE,wBAAwB;CAChC,CAAC;AACX,IAAA,wBAAU,EAAC,oBAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"token-format.constant.js","sourceRoot":"","sources":["../../src/constants/token-format.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C;;;;;;GAMG;AACU,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,IAAI;IACb,0GAA0G;IAC1G,MAAM,EAAE,0BAA0B;IAClC,UAAU,EAAE,GAAG;IACf,gBAAgB,EAAE,EAAE;IACpB,wGAAwG;IACxG,yBAAyB,EAAE,EAAE;IAC7B,gFAAgF;IAChF,0BAA0B,EAAE,GAAG;IAC/B,mBAAmB;IACnB,SAAS,EAAE,EAAE;IACb,4CAA4C;IAC5C,YAAY,EAAE,GAAG;IACjB,mEAAmE;IACnE,cAAc,EAAE,GAAG;IACnB,iHAAiH;IACjH,cAAc,EAAE,wBAAwB;CAChC,CAAC;AACX,IAAA,wBAAU,EAAC,oBAAY,CAAC,CAAC"}
@@ -1,15 +1,15 @@
1
- /** Формы значений Postgres, которые разбирает пакет. Без флага g: регулярки общие. */
1
+ /** The forms of Postgres values that the package parses. Without the g flag: the regular expressions are shared. */
2
2
  export declare const WAL_FORMAT: {
3
- /** `pg_lsn` в тексте: `X/Y`, по 1–8 шестнадцатеричных цифр. */
3
+ /** `pg_lsn` in text: `X/Y`, 1–8 hexadecimal digits each. */
4
4
  readonly LSN_TEXT: RegExp;
5
- /** Имя WAL-файла: 8 цифр линии времени + 16 цифр сегмента. */
5
+ /** A WAL file name: 8 digits of the timeline + 16 digits of the segment. */
6
6
  readonly WAL_FILE: RegExp;
7
- /** `system_identifier` — uint64 в десятичной записи. */
7
+ /** `system_identifier` is a uint64 in decimal notation. */
8
8
  readonly SYSTEM_ID: RegExp;
9
- /** Линия времени в токене: десятичное без ведущих нулей. */
9
+ /** The timeline in a token: a decimal without leading zeros. */
10
10
  readonly TIMELINE_TEXT: RegExp;
11
11
  readonly MAX_TIMELINE: 4294967295;
12
12
  readonly MAX_LSN: bigint;
13
- /** `pg_get_wal_replay_pause_state()` вне паузы; любое другое значение — пауза. */
13
+ /** `pg_get_wal_replay_pause_state()` outside a pause; any other value is a pause. */
14
14
  readonly NOT_PAUSED: "not paused";
15
15
  };
@@ -1,16 +1,16 @@
1
- /** Формы значений Postgres, которые разбирает пакет. Без флага g: регулярки общие. */
1
+ /** The forms of Postgres values that the package parses. Without the g flag: the regular expressions are shared. */
2
2
  export declare const WAL_FORMAT: {
3
- /** `pg_lsn` в тексте: `X/Y`, по 1–8 шестнадцатеричных цифр. */
3
+ /** `pg_lsn` in text: `X/Y`, 1–8 hexadecimal digits each. */
4
4
  readonly LSN_TEXT: RegExp;
5
- /** Имя WAL-файла: 8 цифр линии времени + 16 цифр сегмента. */
5
+ /** A WAL file name: 8 digits of the timeline + 16 digits of the segment. */
6
6
  readonly WAL_FILE: RegExp;
7
- /** `system_identifier` — uint64 в десятичной записи. */
7
+ /** `system_identifier` is a uint64 in decimal notation. */
8
8
  readonly SYSTEM_ID: RegExp;
9
- /** Линия времени в токене: десятичное без ведущих нулей. */
9
+ /** The timeline in a token: a decimal without leading zeros. */
10
10
  readonly TIMELINE_TEXT: RegExp;
11
11
  readonly MAX_TIMELINE: 4294967295;
12
12
  readonly MAX_LSN: bigint;
13
- /** `pg_get_wal_replay_pause_state()` вне паузы; любое другое значение — пауза. */
13
+ /** `pg_get_wal_replay_pause_state()` outside a pause; any other value is a pause. */
14
14
  readonly NOT_PAUSED: "not paused";
15
15
  };
16
16
  //# sourceMappingURL=wal-format.constant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wal-format.constant.d.ts","sourceRoot":"","sources":["../../src/constants/wal-format.constant.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,eAAO,MAAM,UAAU;IACrB,+DAA+D;;IAE/D,8DAA8D;;IAE9D,wDAAwD;;IAExD,4DAA4D;;;;IAI5D,kFAAkF;;CAE1E,CAAC"}
1
+ {"version":3,"file":"wal-format.constant.d.ts","sourceRoot":"","sources":["../../src/constants/wal-format.constant.ts"],"names":[],"mappings":"AAEA,oHAAoH;AACpH,eAAO,MAAM,UAAU;IACrB,4DAA4D;;IAE5D,4EAA4E;;IAE5E,2DAA2D;;IAE3D,gEAAgE;;;;IAIhE,qFAAqF;;CAE7E,CAAC"}
@@ -2,19 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WAL_FORMAT = void 0;
4
4
  const deep_freeze_1 = require("../deep-freeze");
5
- /** Формы значений Postgres, которые разбирает пакет. Без флага g: регулярки общие. */
5
+ /** The forms of Postgres values that the package parses. Without the g flag: the regular expressions are shared. */
6
6
  exports.WAL_FORMAT = {
7
- /** `pg_lsn` в тексте: `X/Y`, по 1–8 шестнадцатеричных цифр. */
7
+ /** `pg_lsn` in text: `X/Y`, 1–8 hexadecimal digits each. */
8
8
  LSN_TEXT: /^([0-9A-Fa-f]{1,8})\/([0-9A-Fa-f]{1,8})$/,
9
- /** Имя WAL-файла: 8 цифр линии времени + 16 цифр сегмента. */
9
+ /** A WAL file name: 8 digits of the timeline + 16 digits of the segment. */
10
10
  WAL_FILE: /^([0-9A-F]{8})[0-9A-F]{16}$/,
11
- /** `system_identifier` — uint64 в десятичной записи. */
11
+ /** `system_identifier` is a uint64 in decimal notation. */
12
12
  SYSTEM_ID: /^[0-9]{1,20}$/,
13
- /** Линия времени в токене: десятичное без ведущих нулей. */
13
+ /** The timeline in a token: a decimal without leading zeros. */
14
14
  TIMELINE_TEXT: /^[1-9][0-9]{0,9}$/,
15
15
  MAX_TIMELINE: 0xffffffff,
16
16
  MAX_LSN: (1n << 64n) - 1n,
17
- /** `pg_get_wal_replay_pause_state()` вне паузы; любое другое значение — пауза. */
17
+ /** `pg_get_wal_replay_pause_state()` outside a pause; any other value is a pause. */
18
18
  NOT_PAUSED: 'not paused',
19
19
  };
20
20
  (0, deep_freeze_1.deepFreeze)(exports.WAL_FORMAT);