@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,9 +1,9 @@
1
1
  /**
2
- * На соединении, переданном в `commitAndIssueToken`, нет открытой транзакции:
3
- * COMMIT там ничего бы не закоммитил (Postgres ответил бы предупреждением с
4
- * тегом `COMMIT`), а транзакция вызывающего — если она на другом соединении —
5
- * осталась бы открытой, и токен оказался бы выдан до её COMMIT. Так бывает с
6
- * пулом и с любой обёрткой, которая отправляет запросы на случайное соединение.
2
+ * There is no open transaction on the connection passed to `commitAndIssueToken`:
3
+ * COMMIT there would commit nothing (Postgres would answer with a warning with
4
+ * the `COMMIT` tag), and the caller's transaction — if it is on another connection —
5
+ * would stay open, and the token would be issued before its COMMIT. This happens with
6
+ * a pool and with any wrapper that sends queries to a random connection.
7
7
  */
8
8
  export declare class TransactionNotOpenError extends Error {
9
9
  readonly name = "TransactionNotOpenError";
@@ -1,9 +1,9 @@
1
1
  /**
2
- * На соединении, переданном в `commitAndIssueToken`, нет открытой транзакции:
3
- * COMMIT там ничего бы не закоммитил (Postgres ответил бы предупреждением с
4
- * тегом `COMMIT`), а транзакция вызывающего — если она на другом соединении —
5
- * осталась бы открытой, и токен оказался бы выдан до её COMMIT. Так бывает с
6
- * пулом и с любой обёрткой, которая отправляет запросы на случайное соединение.
2
+ * There is no open transaction on the connection passed to `commitAndIssueToken`:
3
+ * COMMIT there would commit nothing (Postgres would answer with a warning with
4
+ * the `COMMIT` tag), and the caller's transaction — if it is on another connection —
5
+ * would stay open, and the token would be issued before its COMMIT. This happens with
6
+ * a pool and with any wrapper that sends queries to a random connection.
7
7
  */
8
8
  export declare class TransactionNotOpenError extends Error {
9
9
  readonly name = "TransactionNotOpenError";
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TransactionNotOpenError = void 0;
4
4
  /**
5
- * На соединении, переданном в `commitAndIssueToken`, нет открытой транзакции:
6
- * COMMIT там ничего бы не закоммитил (Postgres ответил бы предупреждением с
7
- * тегом `COMMIT`), а транзакция вызывающего — если она на другом соединении —
8
- * осталась бы открытой, и токен оказался бы выдан до её COMMIT. Так бывает с
9
- * пулом и с любой обёрткой, которая отправляет запросы на случайное соединение.
5
+ * There is no open transaction on the connection passed to `commitAndIssueToken`:
6
+ * COMMIT there would commit nothing (Postgres would answer with a warning with
7
+ * the `COMMIT` tag), and the caller's transaction — if it is on another connection —
8
+ * would stay open, and the token would be issued before its COMMIT. This happens with
9
+ * a pool and with any wrapper that sends queries to a random connection.
10
10
  */
11
11
  class TransactionNotOpenError extends Error {
12
12
  name = 'TransactionNotOpenError';
13
13
  constructor() {
14
- super('commitAndIssueToken: на этом соединении нет открытой транзакции — нужен клиент той транзакции, в которой шла запись (не пул и не обёртка над пулом); запись без BEGIN — issueToken(client)');
14
+ super('commitAndIssueToken: there is no open transaction on this connection — the client of the transaction in which the write went is required (not a pool and not a wrapper over a pool); a write without BEGIN — issueToken(client)');
15
15
  }
16
16
  }
17
17
  exports.TransactionNotOpenError = TransactionNotOpenError;
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-not-open.error.js","sourceRoot":"","sources":["../src/transaction-not-open.error.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,MAAa,uBAAwB,SAAQ,KAAK;IAC9B,IAAI,GAAG,yBAAyB,CAAC;IAEnD;QACE,KAAK,CACH,4LAA4L,CAC7L,CAAC;IACJ,CAAC;CACF;AARD,0DAQC"}
1
+ {"version":3,"file":"transaction-not-open.error.js","sourceRoot":"","sources":["../src/transaction-not-open.error.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,MAAa,uBAAwB,SAAQ,KAAK;IAC9B,IAAI,GAAG,yBAAyB,CAAC;IAEnD;QACE,KAAK,CACH,iOAAiO,CAClO,CAAC;IACJ,CAAC;CACF;AARD,0DAQC"}
@@ -1,9 +1,9 @@
1
1
  import type { ProbeOutcome } from './probe-outcome.type.mjs';
2
2
  /**
3
- * Запись кэша состояния: итог зонда, момент, после которого она выселяется
4
- * (часы кэша), номер зонда (растёт с каждым зондом маршрутизатора: «снято после
5
- * начала этого чтения») и момент его начала по монотонным часам (потолок
6
- * частоты зондов) по монотонным часам.
3
+ * A state cache entry: the probe outcome, the moment after which it is evicted
4
+ * (the cache clock), the probe number (it grows with each probe of the router: "taken after
5
+ * the start of this read") and the moment of its start by the monotonic clock (the probe frequency
6
+ * ceiling).
7
7
  */
8
8
  export interface CacheEntry {
9
9
  readonly outcome: ProbeOutcome;
@@ -1,9 +1,9 @@
1
1
  import type { ProbeOutcome } from './probe-outcome.type';
2
2
  /**
3
- * Запись кэша состояния: итог зонда, момент, после которого она выселяется
4
- * (часы кэша), номер зонда (растёт с каждым зондом маршрутизатора: «снято после
5
- * начала этого чтения») и момент его начала по монотонным часам (потолок
6
- * частоты зондов) по монотонным часам.
3
+ * A state cache entry: the probe outcome, the moment after which it is evicted
4
+ * (the cache clock), the probe number (it grows with each probe of the router: "taken after
5
+ * the start of this read") and the moment of its start by the monotonic clock (the probe frequency
6
+ * ceiling).
7
7
  */
8
8
  export interface CacheEntry {
9
9
  readonly outcome: ProbeOutcome;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Источник времени (мс). Подменяется в спеках, чтобы потолки проверялись без
3
- * ожидания. Часы кэша обязаны возвращать конечное число: шаг назад или не-число
4
- * выселяют весь кэш (снятое по прежним часам больше ничего не доказывает).
2
+ * A time source (ms). It is substituted in specs so that the ceilings are checked without
3
+ * waiting. The cache clock must return a finite number: a step back or a non-number
4
+ * evict the whole cache (what was taken by the previous clock proves nothing anymore).
5
5
  */
6
6
  export type Clock = () => number;
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Источник времени (мс). Подменяется в спеках, чтобы потолки проверялись без
3
- * ожидания. Часы кэша обязаны возвращать конечное число: шаг назад или не-число
4
- * выселяют весь кэш (снятое по прежним часам больше ничего не доказывает).
2
+ * A time source (ms). It is substituted in specs so that the ceilings are checked without
3
+ * waiting. The cache clock must return a finite number: a step back or a non-number
4
+ * evict the whole cache (what was taken by the previous clock proves nothing anymore).
5
5
  */
6
6
  export type Clock = () => number;
7
7
  //# sourceMappingURL=clock.type.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import type { ExclusionReason } from './exclusion-reason.type.mjs';
2
2
  import type { RouteDecision } from './route-decision.type.mjs';
3
3
  /**
4
- * Итог `confirm` на соединении чтения. `reason` — почему сервер чтения не
5
- * подошёл (`null` — подошёл); `error` — запрос подтверждения не выполнился
6
- * (отказ, потолок времени): тогда `reason` — `unavailable`.
4
+ * The outcome of `confirm` on the read connection. `reason` is why the read server did not
5
+ * fit (`null` means it fitted); `error` means the confirmation query did not run
6
+ * (a refusal, the time ceiling): then `reason` is `unavailable`.
7
7
  */
8
8
  export interface ConfirmEvent {
9
9
  readonly decision: RouteDecision<unknown>;
@@ -1,9 +1,9 @@
1
1
  import type { ExclusionReason } from './exclusion-reason.type';
2
2
  import type { RouteDecision } from './route-decision.type';
3
3
  /**
4
- * Итог `confirm` на соединении чтения. `reason` — почему сервер чтения не
5
- * подошёл (`null` — подошёл); `error` — запрос подтверждения не выполнился
6
- * (отказ, потолок времени): тогда `reason` — `unavailable`.
4
+ * The outcome of `confirm` on the read connection. `reason` is why the read server did not
5
+ * fit (`null` means it fitted); `error` means the confirmation query did not run
6
+ * (a refusal, the time ceiling): then `reason` is `unavailable`.
7
7
  */
8
8
  export interface ConfirmEvent {
9
9
  readonly decision: RouteDecision<unknown>;
@@ -1,7 +1,7 @@
1
1
  import type { WalPosition } from './wal-position.type.mjs';
2
2
  /**
3
- * Итог разбора токена: позиция, «выдан без позиции» или отказ разбора.
4
- * `issuedAt` — момент выдачи, мс эпохи Unix по часам выдавшего процесса.
3
+ * The outcome of parsing a token: a position, "issued without a position" or a parse refusal.
4
+ * `issuedAt` is the issue moment, Unix epoch ms by the clock of the issuing process.
5
5
  */
6
6
  export type DecodedToken = {
7
7
  readonly kind: 'position';
@@ -1,7 +1,7 @@
1
1
  import type { WalPosition } from './wal-position.type';
2
2
  /**
3
- * Итог разбора токена: позиция, «выдан без позиции» или отказ разбора.
4
- * `issuedAt` — момент выдачи, мс эпохи Unix по часам выдавшего процесса.
3
+ * The outcome of parsing a token: a position, "issued without a position" or a parse refusal.
4
+ * `issuedAt` is the issue moment, Unix epoch ms by the clock of the issuing process.
5
5
  */
6
6
  export type DecodedToken = {
7
7
  readonly kind: 'position';
@@ -1,6 +1,6 @@
1
1
  import type { ExclusionReason } from './exclusion-reason.type.mjs';
2
2
  import type { ReplicaNode } from './replica-node.type.mjs';
3
- /** Реплика, рассмотренная для чтения: `reason === null` — подходит. */
3
+ /** A replica considered for a read: `reason === null` means it fits. */
4
4
  export interface Evaluated<TTarget> {
5
5
  readonly node: string;
6
6
  readonly replica: ReplicaNode<TTarget>;
@@ -1,6 +1,6 @@
1
1
  import type { ExclusionReason } from './exclusion-reason.type';
2
2
  import type { ReplicaNode } from './replica-node.type';
3
- /** Реплика, рассмотренная для чтения: `reason === null` — подходит. */
3
+ /** A replica considered for a read: `reason === null` means it fits. */
4
4
  export interface Evaluated<TTarget> {
5
5
  readonly node: string;
6
6
  readonly replica: ReplicaNode<TTarget>;
@@ -1 +1 @@
1
- {"version":3,"file":"evaluated.type.d.ts","sourceRoot":"","sources":["../../src/types/evaluated.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,uEAAuE;AACvE,MAAM,WAAW,SAAS,CAAC,OAAO;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC"}
1
+ {"version":3,"file":"evaluated.type.d.ts","sourceRoot":"","sources":["../../src/types/evaluated.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,wEAAwE;AACxE,MAAM,WAAW,SAAS,CAAC,OAAO;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC"}
@@ -1,5 +1,5 @@
1
1
  import type { ExclusionReason } from './exclusion-reason.type.mjs';
2
- /** Реплика, не подошедшая для чтения, и почему. */
2
+ /** A replica that did not fit a read, and why. */
3
3
  export interface Exclusion {
4
4
  readonly node: string;
5
5
  readonly reason: ExclusionReason;
@@ -1,5 +1,5 @@
1
1
  import type { ExclusionReason } from './exclusion-reason.type';
2
- /** Реплика, не подошедшая для чтения, и почему. */
2
+ /** A replica that did not fit a read, and why. */
3
3
  export interface Exclusion {
4
4
  readonly node: string;
5
5
  readonly reason: ExclusionReason;
@@ -1 +1 @@
1
- {"version":3,"file":"exclusion.type.d.ts","sourceRoot":"","sources":["../../src/types/exclusion.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,mDAAmD;AACnD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC"}
1
+ {"version":3,"file":"exclusion.type.d.ts","sourceRoot":"","sources":["../../src/types/exclusion.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC"}
@@ -1,31 +1,31 @@
1
1
  /**
2
- * Что зонд узнал об узле. `null` — «не смогли определить»: решение по такому
3
- * полю — исключение реплики, а не допуск.
2
+ * What the probe learned about a node. `null` means "could not determine": a decision by such a
3
+ * field is an exclusion of the replica, not an admission.
4
4
  */
5
5
  export interface NodeState {
6
6
  readonly inRecovery: boolean;
7
7
  readonly systemId: string | null;
8
8
  /**
9
- * Экземпляр сервера: `system_identifier` и момент старта postmaster. Меняется
10
- * при каждом перезапуске — состояние, снятое до него, к узлу больше не относится.
9
+ * The server instance: `system_identifier` and the postmaster start moment. It changes
10
+ * on every restart — a state taken before it no longer applies to the node.
11
11
  */
12
12
  readonly instance: string | null;
13
- /** Реплика: позиция воспроизведения; мастер: null. */
13
+ /** Replica: the replay position; primary: null. */
14
14
  readonly replayLsn: bigint | null;
15
- /** Мастер: позиция вставки; реплика: null. */
15
+ /** Primary: the insert position; replica: null. */
16
16
  readonly insertLsn: bigint | null;
17
17
  /**
18
- * Мастер: позиция для токена — позиция вставки, а если она стоит сразу за
19
- * заголовком страницы WAL (записи на странице ещё нет), то граница страницы:
20
- * конец последней записи, который реплика воспроизводит. Не определилась
21
- * раскладка WAL — позиция вставки как есть. Реплика: null.
18
+ * Primary: the position for a token — the insert position, and if it stands right after
19
+ * a WAL page header (there is no record on the page yet), the page boundary:
20
+ * the end of the last record, which the replica replays. If the WAL layout was not
21
+ * determined — the insert position as is. Replica: null.
22
22
  */
23
23
  readonly tokenLsn: bigint | null;
24
24
  readonly timeline: number | null;
25
- /** Реплика: пауза запрошена или действует; мастер: false. */
25
+ /** Replica: a pause is requested or in effect; primary: false. */
26
26
  readonly paused: boolean;
27
- /** Роль зонда видит `pg_stat_wal_receiver`. */
27
+ /** The probe role sees `pg_stat_wal_receiver`. */
28
28
  readonly hasStatsPrivilege: boolean;
29
- /** У соединения зонда открыта транзакция с записью (номер транзакции выдан, COMMIT не прошёл). */
29
+ /** The probe connection has an open transaction with a write (a transaction number is assigned, COMMIT did not go through). */
30
30
  readonly writePending: boolean;
31
31
  }
@@ -1,32 +1,32 @@
1
1
  /**
2
- * Что зонд узнал об узле. `null` — «не смогли определить»: решение по такому
3
- * полю — исключение реплики, а не допуск.
2
+ * What the probe learned about a node. `null` means "could not determine": a decision by such a
3
+ * field is an exclusion of the replica, not an admission.
4
4
  */
5
5
  export interface NodeState {
6
6
  readonly inRecovery: boolean;
7
7
  readonly systemId: string | null;
8
8
  /**
9
- * Экземпляр сервера: `system_identifier` и момент старта postmaster. Меняется
10
- * при каждом перезапуске — состояние, снятое до него, к узлу больше не относится.
9
+ * The server instance: `system_identifier` and the postmaster start moment. It changes
10
+ * on every restart — a state taken before it no longer applies to the node.
11
11
  */
12
12
  readonly instance: string | null;
13
- /** Реплика: позиция воспроизведения; мастер: null. */
13
+ /** Replica: the replay position; primary: null. */
14
14
  readonly replayLsn: bigint | null;
15
- /** Мастер: позиция вставки; реплика: null. */
15
+ /** Primary: the insert position; replica: null. */
16
16
  readonly insertLsn: bigint | null;
17
17
  /**
18
- * Мастер: позиция для токена — позиция вставки, а если она стоит сразу за
19
- * заголовком страницы WAL (записи на странице ещё нет), то граница страницы:
20
- * конец последней записи, который реплика воспроизводит. Не определилась
21
- * раскладка WAL — позиция вставки как есть. Реплика: null.
18
+ * Primary: the position for a token — the insert position, and if it stands right after
19
+ * a WAL page header (there is no record on the page yet), the page boundary:
20
+ * the end of the last record, which the replica replays. If the WAL layout was not
21
+ * determined — the insert position as is. Replica: null.
22
22
  */
23
23
  readonly tokenLsn: bigint | null;
24
24
  readonly timeline: number | null;
25
- /** Реплика: пауза запрошена или действует; мастер: false. */
25
+ /** Replica: a pause is requested or in effect; primary: false. */
26
26
  readonly paused: boolean;
27
- /** Роль зонда видит `pg_stat_wal_receiver`. */
27
+ /** The probe role sees `pg_stat_wal_receiver`. */
28
28
  readonly hasStatsPrivilege: boolean;
29
- /** У соединения зонда открыта транзакция с записью (номер транзакции выдан, COMMIT не прошёл). */
29
+ /** The probe connection has an open transaction with a write (a transaction number is assigned, COMMIT did not go through). */
30
30
  readonly writePending: boolean;
31
31
  }
32
32
  //# sourceMappingURL=node-state.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-state.type.d.ts","sourceRoot":"","sources":["../../src/types/node-state.type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,8CAA8C;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,kGAAkG;IAClG,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC"}
1
+ {"version":3,"file":"node-state.type.d.ts","sourceRoot":"","sources":["../../src/types/node-state.type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,kDAAkD;IAClD,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,+HAA+H;IAC/H,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC"}
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Отсекает пул на уровне типов: у `pg.Pool` есть счётчики соединений, у клиента
3
- * транзакции (`pg.Client`, `pg.PoolClient`) их нет. COMMIT через пул ушёл бы на
4
- * случайное соединение; в рантайме такой вызов и так отвергается
5
- * (`TransactionNotOpenError`), а здесь — уже при компиляции. Обёртка вида
6
- * `{ query }` типом не отсекается: её ловит только рантайм.
2
+ * Cuts off a pool at the type level: `pg.Pool` has connection counters, a transaction
3
+ * client (`pg.Client`, `pg.PoolClient`) does not. A COMMIT through a pool would go to
4
+ * a random connection; at runtime such a call is rejected anyway
5
+ * (`TransactionNotOpenError`), and here already at compile time. A wrapper of the form
6
+ * `{ query }` is not cut off by the type: only the runtime catches it.
7
7
  */
8
8
  export interface NotAPool {
9
9
  readonly totalCount?: never;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Отсекает пул на уровне типов: у `pg.Pool` есть счётчики соединений, у клиента
3
- * транзакции (`pg.Client`, `pg.PoolClient`) их нет. COMMIT через пул ушёл бы на
4
- * случайное соединение; в рантайме такой вызов и так отвергается
5
- * (`TransactionNotOpenError`), а здесь — уже при компиляции. Обёртка вида
6
- * `{ query }` типом не отсекается: её ловит только рантайм.
2
+ * Cuts off a pool at the type level: `pg.Pool` has connection counters, a transaction
3
+ * client (`pg.Client`, `pg.PoolClient`) does not. A COMMIT through a pool would go to
4
+ * a random connection; at runtime such a call is rejected anyway
5
+ * (`TransactionNotOpenError`), and here already at compile time. A wrapper of the form
6
+ * `{ query }` is not cut off by the type: only the runtime catches it.
7
7
  */
8
8
  export interface NotAPool {
9
9
  readonly totalCount?: never;
@@ -1,5 +1,5 @@
1
1
  import type { ProbeOutcome } from './probe-outcome.type.mjs';
2
- /** Зонд узла выполнен (для метрик: число зондов, отказы, задержка). */
2
+ /** A node probe is done (for metrics: the number of probes, refusals, the latency). */
3
3
  export interface ProbeEvent {
4
4
  readonly node: string;
5
5
  readonly outcome: ProbeOutcome;
@@ -1,5 +1,5 @@
1
1
  import type { ProbeOutcome } from './probe-outcome.type';
2
- /** Зонд узла выполнен (для метрик: число зондов, отказы, задержка). */
2
+ /** A node probe is done (for metrics: the number of probes, refusals, the latency). */
3
3
  export interface ProbeEvent {
4
4
  readonly node: string;
5
5
  readonly outcome: ProbeOutcome;
@@ -1 +1 @@
1
- {"version":3,"file":"probe-event.type.d.ts","sourceRoot":"","sources":["../../src/types/probe-event.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
1
+ {"version":3,"file":"probe-event.type.d.ts","sourceRoot":"","sources":["../../src/types/probe-event.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,uFAAuF;AACvF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
@@ -1,5 +1,5 @@
1
1
  import type { NodeState } from './node-state.type.mjs';
2
- /** Итог зонда: состояние или отказ (соединение, ошибка, потолок времени, неразборчивый ответ). */
2
+ /** The probe outcome: a state or a refusal (a connection, an error, the time ceiling, an illegible answer). */
3
3
  export type ProbeOutcome = {
4
4
  readonly ok: true;
5
5
  readonly state: NodeState;
@@ -1,5 +1,5 @@
1
1
  import type { NodeState } from './node-state.type';
2
- /** Итог зонда: состояние или отказ (соединение, ошибка, потолок времени, неразборчивый ответ). */
2
+ /** The probe outcome: a state or a refusal (a connection, an error, the time ceiling, an illegible answer). */
3
3
  export type ProbeOutcome = {
4
4
  readonly ok: true;
5
5
  readonly state: NodeState;
@@ -1 +1 @@
1
- {"version":3,"file":"probe-outcome.type.d.ts","sourceRoot":"","sources":["../../src/types/probe-outcome.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,kGAAkG;AAClG,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"probe-outcome.type.d.ts","sourceRoot":"","sources":["../../src/types/probe-outcome.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,+GAA+G;AAC/G,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { ProbeOutcome } from './probe-outcome.type.mjs';
2
- /** Итог зонда и его номер: номер больше снятого в начале чтения — зонд начат после него. */
2
+ /** The probe outcome and its number: a number greater than the one taken at the start of a read means the probe started after it. */
3
3
  export interface ProbeSample {
4
4
  readonly outcome: ProbeOutcome;
5
5
  readonly seq: number;
@@ -1,5 +1,5 @@
1
1
  import type { ProbeOutcome } from './probe-outcome.type';
2
- /** Итог зонда и его номер: номер больше снятого в начале чтения — зонд начат после него. */
2
+ /** The probe outcome and its number: a number greater than the one taken at the start of a read means the probe started after it. */
3
3
  export interface ProbeSample {
4
4
  readonly outcome: ProbeOutcome;
5
5
  readonly seq: number;
@@ -1 +1 @@
1
- {"version":3,"file":"probe-sample.type.d.ts","sourceRoot":"","sources":["../../src/types/probe-sample.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,4FAA4F;AAC5F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"probe-sample.type.d.ts","sourceRoot":"","sources":["../../src/types/probe-sample.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,qIAAqI;AACrI,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB"}
@@ -1,18 +1,18 @@
1
1
  import type { ClientConfig } from 'pg';
2
2
  /**
3
- * Узел: имя (метка метрик), адрес для зонда состояния и `target` — то, чем
4
- * вызывающий читает с этого узла (свой пул, drizzle, что угодно). Зонд ходит
5
- * СВОИМ соединением: его можно оборвать по потолку, не трогая пул приложения.
3
+ * A node: a name (a metric label), an address for the state probe and `target` — what
4
+ * the caller reads from this node with (its own pool, drizzle, anything). The probe goes
5
+ * through ITS OWN connection: it can be torn at the ceiling without touching the application pool.
6
6
  */
7
7
  export interface ReplicaNode<TTarget> {
8
8
  readonly name: string;
9
9
  readonly connection: string | ClientConfig;
10
10
  readonly target: TTarget;
11
11
  /**
12
- * Адрес ведёт не на ОДИН сервер, а на балансировщик над несколькими репликами
13
- * (сервис «только чтение», прокси, читающая точка облака). Зонд видит один
14
- * сервер, а чтение уходит на любой, поэтому решение «реплика» по такому узлу
15
- * обязано подтверждаться на соединении чтения: `decision.mustConfirm` и
12
+ * The address leads not to ONE server but to a balancer over several replicas
13
+ * (a "read only" service, a proxy, a cloud read endpoint). The probe sees one
14
+ * server, while a read goes to any of them, so a "replica" decision for such a node
15
+ * must be confirmed on the read connection: `decision.mustConfirm` and
16
16
  * `router.confirm(decision, connection)`.
17
17
  */
18
18
  readonly balanced?: boolean | undefined;
@@ -1,18 +1,18 @@
1
1
  import type { ClientConfig } from 'pg';
2
2
  /**
3
- * Узел: имя (метка метрик), адрес для зонда состояния и `target` — то, чем
4
- * вызывающий читает с этого узла (свой пул, drizzle, что угодно). Зонд ходит
5
- * СВОИМ соединением: его можно оборвать по потолку, не трогая пул приложения.
3
+ * A node: a name (a metric label), an address for the state probe and `target` — what
4
+ * the caller reads from this node with (its own pool, drizzle, anything). The probe goes
5
+ * through ITS OWN connection: it can be torn at the ceiling without touching the application pool.
6
6
  */
7
7
  export interface ReplicaNode<TTarget> {
8
8
  readonly name: string;
9
9
  readonly connection: string | ClientConfig;
10
10
  readonly target: TTarget;
11
11
  /**
12
- * Адрес ведёт не на ОДИН сервер, а на балансировщик над несколькими репликами
13
- * (сервис «только чтение», прокси, читающая точка облака). Зонд видит один
14
- * сервер, а чтение уходит на любой, поэтому решение «реплика» по такому узлу
15
- * обязано подтверждаться на соединении чтения: `decision.mustConfirm` и
12
+ * The address leads not to ONE server but to a balancer over several replicas
13
+ * (a "read only" service, a proxy, a cloud read endpoint). The probe sees one
14
+ * server, while a read goes to any of them, so a "replica" decision for such a node
15
+ * must be confirmed on the read connection: `decision.mustConfirm` and
16
16
  * `router.confirm(decision, connection)`.
17
17
  */
18
18
  readonly balanced?: boolean | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { WalPosition } from './wal-position.type.mjs';
2
2
  /**
3
- * Что требуется от реплики для этого чтения: догнать позицию токена или (без
4
- * токена) не отставать от мастера больше потолка.
3
+ * What is required from a replica for this read: catch up with the token position or (without
4
+ * a token) not lag behind the primary more than the ceiling.
5
5
  */
6
6
  export type ReplicaRequirement = {
7
7
  readonly kind: 'position';
@@ -1,7 +1,7 @@
1
1
  import type { WalPosition } from './wal-position.type';
2
2
  /**
3
- * Что требуется от реплики для этого чтения: догнать позицию токена или (без
4
- * токена) не отставать от мастера больше потолка.
3
+ * What is required from a replica for this read: catch up with the token position or (without
4
+ * a token) not lag behind the primary more than the ceiling.
5
5
  */
6
6
  export type ReplicaRequirement = {
7
7
  readonly kind: 'position';