@axiumine/koa-utils 8.0.0 → 9.1.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 (431) hide show
  1. package/LICENSE +658 -228
  2. package/README.md +8 -4
  3. package/dist/dataSources/PostgreSQL.mjs +5 -5
  4. package/dist/email/SocketLabsLib.d.mts +2 -1
  5. package/dist/email/SocketLabsLib.mjs +5 -3
  6. package/dist/files/storeUploadAsTemp.mjs +2 -0
  7. package/dist/graphQL/schema/mutations/emailChangeHashVerify.mjs +2 -1
  8. package/dist/graphQL/schema/mutations/logout.mjs +1 -1
  9. package/dist/graphQL/schema/mutations/resetPwd.mjs +3 -1
  10. package/dist/koa/middleware/authenticatedAuthorizationHandler/index.d.mts +1 -1
  11. package/dist/koa/middleware/authenticatedAuthorizationHandler/verifySignedRefreshToken.mjs +12 -9
  12. package/dist/koa/middleware/authenticatedLogoutHandler/index.d.mts +1 -1
  13. package/dist/koa/middleware/authenticatedResourceHandler/index.d.mts +1 -1
  14. package/dist/koa/middleware/debug/index.d.mts +1 -1
  15. package/dist/lib/ArrayLib.d.mts +0 -1
  16. package/dist/lib/ArrayLib.mjs +0 -1
  17. package/dist/lib/DateLib.mjs +1 -1
  18. package/dist/lib/MariaDB/throwSqlErrors.mjs +3 -1
  19. package/dist/lib/MongoDB/IMongoDBError.d.mts +2 -3
  20. package/dist/lib/MongoDB/throwIfMongoErr.mjs +4 -2
  21. package/dist/lib/NumLib.d.mts +0 -1
  22. package/dist/lib/NumLib.mjs +1 -1
  23. package/dist/lib/PostgreSQL/clock/CLOCK_SQL.d.mts +7 -0
  24. package/dist/lib/PostgreSQL/clock/CLOCK_SQL.mjs +8 -0
  25. package/dist/lib/PostgreSQL/clock/DB_NOW_SQL.d.mts +5 -0
  26. package/dist/lib/PostgreSQL/clock/DB_NOW_SQL.mjs +6 -0
  27. package/dist/lib/PostgreSQL/clock/IClock.d.mts +4 -0
  28. package/dist/lib/PostgreSQL/clock/IClock.mjs +2 -0
  29. package/dist/lib/PostgreSQL/clock/IDbClock.d.mts +11 -0
  30. package/dist/lib/PostgreSQL/clock/IDbClock.mjs +2 -0
  31. package/dist/lib/PostgreSQL/clock/IDbClockOptions.d.mts +11 -0
  32. package/dist/lib/PostgreSQL/clock/IDbClockOptions.mjs +2 -0
  33. package/dist/lib/PostgreSQL/clock/IDbClockSeam.d.mts +10 -0
  34. package/dist/lib/PostgreSQL/clock/IDbClockSeam.mjs +2 -0
  35. package/dist/lib/PostgreSQL/clock/createDbClock.d.mts +23 -0
  36. package/dist/lib/PostgreSQL/clock/createDbClock.mjs +54 -0
  37. package/dist/lib/PostgreSQL/clock/lockTaken.d.mts +11 -0
  38. package/dist/lib/PostgreSQL/clock/lockTaken.mjs +17 -0
  39. package/dist/lib/PostgreSQL/counter/IDbCounter.d.mts +9 -0
  40. package/dist/lib/PostgreSQL/counter/IDbCounter.mjs +2 -0
  41. package/dist/lib/PostgreSQL/error/DB_CLOCK_REASONS.d.mts +12 -0
  42. package/dist/lib/PostgreSQL/error/DB_CLOCK_REASONS.mjs +20 -0
  43. package/dist/lib/PostgreSQL/error/DB_CONNECT_REASONS.d.mts +11 -0
  44. package/dist/lib/PostgreSQL/error/DB_CONNECT_REASONS.mjs +12 -0
  45. package/dist/lib/PostgreSQL/error/DB_INTERNAL_REASONS.d.mts +23 -0
  46. package/dist/lib/PostgreSQL/error/DB_INTERNAL_REASONS.mjs +35 -0
  47. package/dist/lib/PostgreSQL/error/DB_PARSE_REASONS.d.mts +13 -0
  48. package/dist/lib/PostgreSQL/error/DB_PARSE_REASONS.mjs +14 -0
  49. package/dist/lib/PostgreSQL/error/DB_STATE_REASONS.d.mts +7 -0
  50. package/dist/lib/PostgreSQL/error/DB_STATE_REASONS.mjs +8 -0
  51. package/dist/lib/PostgreSQL/error/DB_TX_REASONS.d.mts +9 -0
  52. package/dist/lib/PostgreSQL/error/DB_TX_REASONS.mjs +10 -0
  53. package/dist/lib/PostgreSQL/error/DbClockError.d.mts +6 -0
  54. package/dist/lib/PostgreSQL/error/DbClockError.mjs +27 -0
  55. package/dist/lib/PostgreSQL/error/DbConnectError.d.mts +11 -0
  56. package/dist/lib/PostgreSQL/error/DbConnectError.mjs +18 -0
  57. package/dist/lib/PostgreSQL/error/DbParseError.d.mts +11 -0
  58. package/dist/lib/PostgreSQL/error/DbParseError.mjs +16 -0
  59. package/dist/lib/PostgreSQL/error/DbStateError.d.mts +10 -0
  60. package/dist/lib/PostgreSQL/error/DbStateError.mjs +14 -0
  61. package/dist/lib/PostgreSQL/error/DbTxError.d.mts +6 -0
  62. package/dist/lib/PostgreSQL/error/DbTxError.mjs +10 -0
  63. package/dist/lib/PostgreSQL/error/IConstraintEntry.d.mts +17 -0
  64. package/dist/lib/PostgreSQL/error/IConstraintEntry.mjs +2 -0
  65. package/dist/lib/PostgreSQL/error/IConstraintEntryBuilder.d.mts +20 -0
  66. package/dist/lib/PostgreSQL/error/IConstraintEntryBuilder.mjs +2 -0
  67. package/dist/lib/PostgreSQL/error/IConstraintTable.d.mts +7 -0
  68. package/dist/lib/PostgreSQL/error/IConstraintTable.mjs +2 -0
  69. package/dist/lib/PostgreSQL/error/IDbClockReason.d.mts +3 -0
  70. package/dist/lib/PostgreSQL/error/IDbClockReason.mjs +2 -0
  71. package/dist/lib/PostgreSQL/error/IDbConnectReason.d.mts +3 -0
  72. package/dist/lib/PostgreSQL/error/IDbConnectReason.mjs +2 -0
  73. package/dist/lib/PostgreSQL/error/IDbErrorCounter.d.mts +4 -0
  74. package/dist/lib/PostgreSQL/error/IDbErrorCounter.mjs +2 -0
  75. package/dist/lib/PostgreSQL/error/IDbErrorCounterName.d.mts +7 -0
  76. package/dist/lib/PostgreSQL/error/IDbErrorCounterName.mjs +2 -0
  77. package/dist/lib/PostgreSQL/error/IDbErrorFactory.d.mts +16 -0
  78. package/dist/lib/PostgreSQL/error/IDbErrorFactory.mjs +2 -0
  79. package/dist/lib/PostgreSQL/error/IDbInternalReason.d.mts +3 -0
  80. package/dist/lib/PostgreSQL/error/IDbInternalReason.mjs +2 -0
  81. package/dist/lib/PostgreSQL/error/IDbParseReason.d.mts +3 -0
  82. package/dist/lib/PostgreSQL/error/IDbParseReason.mjs +2 -0
  83. package/dist/lib/PostgreSQL/error/IDbStateReason.d.mts +3 -0
  84. package/dist/lib/PostgreSQL/error/IDbStateReason.mjs +2 -0
  85. package/dist/lib/PostgreSQL/error/IDbTxReason.d.mts +3 -0
  86. package/dist/lib/PostgreSQL/error/IDbTxReason.mjs +2 -0
  87. package/dist/lib/PostgreSQL/error/ILockOrderReason.d.mts +3 -0
  88. package/dist/lib/PostgreSQL/error/ILockOrderReason.mjs +2 -0
  89. package/dist/lib/PostgreSQL/error/IMapDbErrorOptions.d.mts +22 -0
  90. package/dist/lib/PostgreSQL/error/IMapDbErrorOptions.mjs +2 -0
  91. package/dist/lib/PostgreSQL/error/IRoleAssertionReason.d.mts +3 -0
  92. package/dist/lib/PostgreSQL/error/IRoleAssertionReason.mjs +2 -0
  93. package/dist/lib/PostgreSQL/error/IRoleAssertionSubject.d.mts +12 -0
  94. package/dist/lib/PostgreSQL/error/IRoleAssertionSubject.mjs +2 -0
  95. package/dist/lib/PostgreSQL/error/LOCK_ORDER_REASONS.d.mts +11 -0
  96. package/dist/lib/PostgreSQL/error/LOCK_ORDER_REASONS.mjs +12 -0
  97. package/dist/lib/PostgreSQL/error/LockOrderError.d.mts +6 -0
  98. package/dist/lib/PostgreSQL/error/LockOrderError.mjs +10 -0
  99. package/dist/lib/PostgreSQL/error/ROLE_ASSERT_REASONS.d.mts +21 -0
  100. package/dist/lib/PostgreSQL/error/ROLE_ASSERT_REASONS.mjs +35 -0
  101. package/dist/lib/PostgreSQL/error/RoleAssertionError.d.mts +19 -0
  102. package/dist/lib/PostgreSQL/error/RoleAssertionError.mjs +58 -0
  103. package/dist/lib/PostgreSQL/error/buildConstraintEntry.d.mts +15 -0
  104. package/dist/lib/PostgreSQL/error/buildConstraintEntry.mjs +16 -0
  105. package/dist/lib/PostgreSQL/error/constraintNameOf.d.mts +6 -0
  106. package/dist/lib/PostgreSQL/error/constraintNameOf.mjs +17 -0
  107. package/dist/lib/PostgreSQL/error/errorNameOf.d.mts +5 -0
  108. package/dist/lib/PostgreSQL/error/errorNameOf.mjs +12 -0
  109. package/dist/lib/PostgreSQL/error/lookupConstraint.d.mts +7 -0
  110. package/dist/lib/PostgreSQL/error/lookupConstraint.mjs +8 -0
  111. package/dist/lib/PostgreSQL/error/mapDbError.d.mts +28 -0
  112. package/dist/lib/PostgreSQL/error/mapDbError.mjs +52 -0
  113. package/dist/lib/PostgreSQL/error/sqlstateField.d.mts +4 -0
  114. package/dist/lib/PostgreSQL/error/sqlstateField.mjs +5 -0
  115. package/dist/lib/PostgreSQL/error/sqlstateOf.d.mts +5 -0
  116. package/dist/lib/PostgreSQL/error/sqlstateOf.mjs +12 -0
  117. package/dist/lib/PostgreSQL/guard/IAffectedResult.d.mts +4 -0
  118. package/dist/lib/PostgreSQL/guard/IAffectedResult.mjs +2 -0
  119. package/dist/lib/PostgreSQL/guard/IGuardCounter.d.mts +3 -0
  120. package/dist/lib/PostgreSQL/guard/IGuardCounter.mjs +2 -0
  121. package/dist/lib/PostgreSQL/guard/IVersionGuardCode.d.mts +5 -0
  122. package/dist/lib/PostgreSQL/guard/IVersionGuardCode.mjs +2 -0
  123. package/dist/lib/PostgreSQL/guard/IVersionGuardField.d.mts +3 -0
  124. package/dist/lib/PostgreSQL/guard/IVersionGuardField.mjs +2 -0
  125. package/dist/lib/PostgreSQL/guard/IVersionGuardInput.d.mts +29 -0
  126. package/dist/lib/PostgreSQL/guard/IVersionGuardInput.mjs +2 -0
  127. package/dist/lib/PostgreSQL/guard/VERSION_GUARD_FIELDS.d.mts +2 -0
  128. package/dist/lib/PostgreSQL/guard/VERSION_GUARD_FIELDS.mjs +3 -0
  129. package/dist/lib/PostgreSQL/guard/assertAffected.d.mts +10 -0
  130. package/dist/lib/PostgreSQL/guard/assertAffected.mjs +17 -0
  131. package/dist/lib/PostgreSQL/guard/guardVersion.d.mts +21 -0
  132. package/dist/lib/PostgreSQL/guard/guardVersion.mjs +47 -0
  133. package/dist/lib/PostgreSQL/lock/CLAIM_LIMIT_MAX.d.mts +2 -0
  134. package/dist/lib/PostgreSQL/lock/CLAIM_LIMIT_MAX.mjs +3 -0
  135. package/dist/lib/PostgreSQL/lock/IClaimRegistry.d.mts +6 -0
  136. package/dist/lib/PostgreSQL/lock/IClaimRegistry.mjs +2 -0
  137. package/dist/lib/PostgreSQL/lock/IClaimRequest.d.mts +7 -0
  138. package/dist/lib/PostgreSQL/lock/IClaimRequest.mjs +2 -0
  139. package/dist/lib/PostgreSQL/lock/ILockAdmission.d.mts +4 -0
  140. package/dist/lib/PostgreSQL/lock/ILockAdmission.mjs +2 -0
  141. package/dist/lib/PostgreSQL/lock/ILockOrderSpec.d.mts +19 -0
  142. package/dist/lib/PostgreSQL/lock/ILockOrderSpec.mjs +2 -0
  143. package/dist/lib/PostgreSQL/lock/ILockOrderTracker.d.mts +41 -0
  144. package/dist/lib/PostgreSQL/lock/ILockOrderTracker.mjs +2 -0
  145. package/dist/lib/PostgreSQL/lock/ILockTrackerConfig.d.mts +5 -0
  146. package/dist/lib/PostgreSQL/lock/ILockTrackerConfig.mjs +2 -0
  147. package/dist/lib/PostgreSQL/lock/ILockTrackerOptions.d.mts +7 -0
  148. package/dist/lib/PostgreSQL/lock/ILockTrackerOptions.mjs +2 -0
  149. package/dist/lib/PostgreSQL/lock/IRowLockMode.d.mts +3 -0
  150. package/dist/lib/PostgreSQL/lock/IRowLockMode.mjs +2 -0
  151. package/dist/lib/PostgreSQL/lock/ROW_LOCK_MODES.d.mts +2 -0
  152. package/dist/lib/PostgreSQL/lock/ROW_LOCK_MODES.mjs +3 -0
  153. package/dist/lib/PostgreSQL/lock/claimRowsSkipLocked.d.mts +16 -0
  154. package/dist/lib/PostgreSQL/lock/claimRowsSkipLocked.mjs +32 -0
  155. package/dist/lib/PostgreSQL/lock/createLockOrderTracker.d.mts +14 -0
  156. package/dist/lib/PostgreSQL/lock/createLockOrderTracker.mjs +60 -0
  157. package/dist/lib/PostgreSQL/lock/lockedRow.d.mts +7 -0
  158. package/dist/lib/PostgreSQL/lock/lockedRow.mjs +12 -0
  159. package/dist/lib/PostgreSQL/lock/lockedRows.d.mts +3 -0
  160. package/dist/lib/PostgreSQL/lock/lockedRows.mjs +8 -0
  161. package/dist/lib/PostgreSQL/lock/rowLockModeOf.d.mts +3 -0
  162. package/dist/lib/PostgreSQL/lock/rowLockModeOf.mjs +9 -0
  163. package/dist/lib/PostgreSQL/lock/uuidOf.d.mts +2 -0
  164. package/dist/lib/PostgreSQL/lock/uuidOf.mjs +10 -0
  165. package/dist/lib/PostgreSQL/lock/uuidsOf.d.mts +5 -0
  166. package/dist/lib/PostgreSQL/lock/uuidsOf.mjs +13 -0
  167. package/dist/lib/PostgreSQL/parse/IArrayParser.d.mts +2 -0
  168. package/dist/lib/PostgreSQL/parse/IArrayParser.mjs +2 -0
  169. package/dist/lib/PostgreSQL/parse/IDriverTypes.d.mts +4 -0
  170. package/dist/lib/PostgreSQL/parse/IDriverTypes.mjs +2 -0
  171. package/dist/lib/PostgreSQL/parse/IStringParser.d.mts +2 -0
  172. package/dist/lib/PostgreSQL/parse/IStringParser.mjs +2 -0
  173. package/dist/lib/PostgreSQL/parse/ITypeParserEntry.d.mts +9 -0
  174. package/dist/lib/PostgreSQL/parse/ITypeParserEntry.mjs +2 -0
  175. package/dist/lib/PostgreSQL/parse/TYPE_PARSERS.d.mts +12 -0
  176. package/dist/lib/PostgreSQL/parse/TYPE_PARSERS.mjs +38 -0
  177. package/dist/lib/PostgreSQL/parse/arrayOf.d.mts +7 -0
  178. package/dist/lib/PostgreSQL/parse/arrayOf.mjs +50 -0
  179. package/dist/lib/PostgreSQL/parse/createTypeRegistry.d.mts +13 -0
  180. package/dist/lib/PostgreSQL/parse/createTypeRegistry.mjs +26 -0
  181. package/dist/lib/PostgreSQL/parse/parseDate.d.mts +7 -0
  182. package/dist/lib/PostgreSQL/parse/parseDate.mjs +19 -0
  183. package/dist/lib/PostgreSQL/parse/parseInt8.d.mts +6 -0
  184. package/dist/lib/PostgreSQL/parse/parseInt8.mjs +17 -0
  185. package/dist/lib/PostgreSQL/parse/parseTime.d.mts +7 -0
  186. package/dist/lib/PostgreSQL/parse/parseTime.mjs +24 -0
  187. package/dist/lib/PostgreSQL/parse/parseTimestamptz.d.mts +17 -0
  188. package/dist/lib/PostgreSQL/parse/parseTimestamptz.mjs +79 -0
  189. package/dist/lib/PostgreSQL/parse/parseUuid.d.mts +3 -0
  190. package/dist/lib/PostgreSQL/parse/parseUuid.mjs +9 -0
  191. package/dist/lib/PostgreSQL/pool/DEFAULT_CONNECT_TIMEOUT_MS.d.mts +2 -0
  192. package/dist/lib/PostgreSQL/pool/DEFAULT_CONNECT_TIMEOUT_MS.mjs +3 -0
  193. package/dist/lib/PostgreSQL/pool/DEFAULT_KEEPALIVE_INITIAL_DELAY_MS.d.mts +2 -0
  194. package/dist/lib/PostgreSQL/pool/DEFAULT_KEEPALIVE_INITIAL_DELAY_MS.mjs +3 -0
  195. package/dist/lib/PostgreSQL/pool/ICreatePoolOptions.d.mts +28 -0
  196. package/dist/lib/PostgreSQL/pool/ICreatePoolOptions.mjs +2 -0
  197. package/dist/lib/PostgreSQL/pool/IDbDriver.d.mts +12 -0
  198. package/dist/lib/PostgreSQL/pool/IDbDriver.mjs +2 -0
  199. package/dist/lib/PostgreSQL/pool/IPoolCounter.d.mts +4 -0
  200. package/dist/lib/PostgreSQL/pool/IPoolCounter.mjs +2 -0
  201. package/dist/lib/PostgreSQL/pool/IPoolCounterName.d.mts +7 -0
  202. package/dist/lib/PostgreSQL/pool/IPoolCounterName.mjs +2 -0
  203. package/dist/lib/PostgreSQL/pool/IPoolEvents.d.mts +4 -0
  204. package/dist/lib/PostgreSQL/pool/IPoolEvents.mjs +2 -0
  205. package/dist/lib/PostgreSQL/pool/IPoolLogger.d.mts +8 -0
  206. package/dist/lib/PostgreSQL/pool/IPoolLogger.mjs +2 -0
  207. package/dist/lib/PostgreSQL/pool/REQUIRED_SESSION_TIME_ZONE.d.mts +2 -0
  208. package/dist/lib/PostgreSQL/pool/REQUIRED_SESSION_TIME_ZONE.mjs +3 -0
  209. package/dist/lib/PostgreSQL/pool/createPool.d.mts +31 -0
  210. package/dist/lib/PostgreSQL/pool/createPool.mjs +67 -0
  211. package/dist/lib/PostgreSQL/role/IAssertRoleOptions.d.mts +10 -0
  212. package/dist/lib/PostgreSQL/role/IAssertRoleOptions.mjs +2 -0
  213. package/dist/lib/PostgreSQL/role/IRoleAssertion.d.mts +6 -0
  214. package/dist/lib/PostgreSQL/role/IRoleAssertion.mjs +2 -0
  215. package/dist/lib/PostgreSQL/role/IRoleGrant.d.mts +19 -0
  216. package/dist/lib/PostgreSQL/role/IRoleGrant.mjs +2 -0
  217. package/dist/lib/PostgreSQL/role/IRolePool.d.mts +6 -0
  218. package/dist/lib/PostgreSQL/role/IRolePool.mjs +2 -0
  219. package/dist/lib/PostgreSQL/role/assertRole.d.mts +36 -0
  220. package/dist/lib/PostgreSQL/role/assertRole.mjs +54 -0
  221. package/dist/lib/PostgreSQL/tx/DEFAULT_LOCK_TIMEOUT_MS.d.mts +2 -0
  222. package/dist/lib/PostgreSQL/tx/DEFAULT_LOCK_TIMEOUT_MS.mjs +3 -0
  223. package/dist/lib/PostgreSQL/tx/IRetryDelay.d.mts +2 -0
  224. package/dist/lib/PostgreSQL/tx/IRetryDelay.mjs +2 -0
  225. package/dist/lib/PostgreSQL/tx/ITx.d.mts +9 -0
  226. package/dist/lib/PostgreSQL/tx/ITx.mjs +2 -0
  227. package/dist/lib/PostgreSQL/tx/ITxClient.d.mts +12 -0
  228. package/dist/lib/PostgreSQL/tx/ITxClient.mjs +2 -0
  229. package/dist/lib/PostgreSQL/tx/ITxCounter.d.mts +4 -0
  230. package/dist/lib/PostgreSQL/tx/ITxCounter.mjs +2 -0
  231. package/dist/lib/PostgreSQL/tx/ITxCounterName.d.mts +10 -0
  232. package/dist/lib/PostgreSQL/tx/ITxCounterName.mjs +2 -0
  233. package/dist/lib/PostgreSQL/tx/ITxFailureReason.d.mts +3 -0
  234. package/dist/lib/PostgreSQL/tx/ITxFailureReason.mjs +2 -0
  235. package/dist/lib/PostgreSQL/tx/ITxIsolation.d.mts +3 -0
  236. package/dist/lib/PostgreSQL/tx/ITxIsolation.mjs +2 -0
  237. package/dist/lib/PostgreSQL/tx/ITxOptions.d.mts +27 -0
  238. package/dist/lib/PostgreSQL/tx/ITxOptions.mjs +2 -0
  239. package/dist/lib/PostgreSQL/tx/ITxPool.d.mts +5 -0
  240. package/dist/lib/PostgreSQL/tx/ITxPool.mjs +2 -0
  241. package/dist/lib/PostgreSQL/tx/ITxResult.d.mts +6 -0
  242. package/dist/lib/PostgreSQL/tx/ITxResult.mjs +2 -0
  243. package/dist/lib/PostgreSQL/tx/MAX_LOCK_TIMEOUT_MS.d.mts +2 -0
  244. package/dist/lib/PostgreSQL/tx/MAX_LOCK_TIMEOUT_MS.mjs +3 -0
  245. package/dist/lib/PostgreSQL/tx/TX_FAILURE_REASONS.d.mts +7 -0
  246. package/dist/lib/PostgreSQL/tx/TX_FAILURE_REASONS.mjs +8 -0
  247. package/dist/lib/PostgreSQL/tx/TX_ISOLATION_LEVELS.d.mts +2 -0
  248. package/dist/lib/PostgreSQL/tx/TX_ISOLATION_LEVELS.mjs +3 -0
  249. package/dist/lib/PostgreSQL/tx/TX_RETRY_BASE_DELAY_MS.d.mts +2 -0
  250. package/dist/lib/PostgreSQL/tx/TX_RETRY_BASE_DELAY_MS.mjs +3 -0
  251. package/dist/lib/PostgreSQL/tx/TX_RETRY_MAX.d.mts +2 -0
  252. package/dist/lib/PostgreSQL/tx/TX_RETRY_MAX.mjs +3 -0
  253. package/dist/lib/PostgreSQL/tx/TX_RETRY_MAX_CEILING.d.mts +2 -0
  254. package/dist/lib/PostgreSQL/tx/TX_RETRY_MAX_CEILING.mjs +3 -0
  255. package/dist/lib/PostgreSQL/tx/defaultRetryDelay.d.mts +3 -0
  256. package/dist/lib/PostgreSQL/tx/defaultRetryDelay.mjs +4 -0
  257. package/dist/lib/PostgreSQL/tx/jitteredDelay.d.mts +7 -0
  258. package/dist/lib/PostgreSQL/tx/jitteredDelay.mjs +16 -0
  259. package/dist/lib/PostgreSQL/tx/withTx.d.mts +39 -0
  260. package/dist/lib/PostgreSQL/tx/withTx.mjs +41 -0
  261. package/dist/lib/PostgreSQL/url/IDatabaseUrlOptions.d.mts +10 -0
  262. package/dist/lib/PostgreSQL/url/IDatabaseUrlOptions.mjs +2 -0
  263. package/dist/lib/PostgreSQL/url/IDatabaseUrlReason.d.mts +14 -0
  264. package/dist/lib/PostgreSQL/url/IDatabaseUrlReason.mjs +2 -0
  265. package/dist/lib/PostgreSQL/url/LOOPBACK_HOSTS.d.mts +2 -0
  266. package/dist/lib/PostgreSQL/url/LOOPBACK_HOSTS.mjs +3 -0
  267. package/dist/lib/PostgreSQL/url/databaseUrlReason.d.mts +20 -0
  268. package/dist/lib/PostgreSQL/url/databaseUrlReason.mjs +99 -0
  269. package/dist/lib/PostgreSQL/url/isAbsolutePath.d.mts +2 -0
  270. package/dist/lib/PostgreSQL/url/isAbsolutePath.mjs +14 -0
  271. package/dist/lib/PostgreSQL/url/isValidHost.d.mts +6 -0
  272. package/dist/lib/PostgreSQL/url/isValidHost.mjs +20 -0
  273. package/dist/lib/StringLib.d.mts +0 -1
  274. package/dist/lib/StringLib.mjs +0 -1
  275. package/dist/lib/db/log/logGraphql.d.mts +8 -6
  276. package/dist/lib/db/log/logGraphql.mjs +9 -23
  277. package/dist/lib/db/log/logThrow.d.mts +9 -0
  278. package/dist/lib/db/log/logThrow.mjs +11 -11
  279. package/dist/lib/hash.mjs +1 -6
  280. package/dist/lib/isSessionBlocked.d.mts +1 -1
  281. package/dist/lib/throwIfNotValidEnumValue.mjs +1 -0
  282. package/dist/lib/tryCatchRethrow.mjs +5 -3
  283. package/dist/private/files/reEncode.mjs +2 -0
  284. package/dist/private/lib/PostgreSQL/ICivilDate.d.mts +6 -0
  285. package/dist/private/lib/PostgreSQL/ICivilDate.mjs +2 -0
  286. package/dist/private/lib/PostgreSQL/IClientConstructor.d.mts +3 -0
  287. package/dist/private/lib/PostgreSQL/IClientConstructor.mjs +2 -0
  288. package/dist/private/lib/PostgreSQL/IClientShape.d.mts +10 -0
  289. package/dist/private/lib/PostgreSQL/IClientShape.mjs +2 -0
  290. package/dist/private/lib/PostgreSQL/IClockSlot.d.mts +11 -0
  291. package/dist/private/lib/PostgreSQL/IClockSlot.mjs +2 -0
  292. package/dist/private/lib/PostgreSQL/IConnectCallback.d.mts +2 -0
  293. package/dist/private/lib/PostgreSQL/IConnectCallback.mjs +2 -0
  294. package/dist/private/lib/PostgreSQL/IConnectSettings.d.mts +8 -0
  295. package/dist/private/lib/PostgreSQL/IConnectSettings.mjs +2 -0
  296. package/dist/private/lib/PostgreSQL/IHelperRank.d.mts +5 -0
  297. package/dist/private/lib/PostgreSQL/IHelperRank.mjs +2 -0
  298. package/dist/private/lib/PostgreSQL/IInternalSink.d.mts +9 -0
  299. package/dist/private/lib/PostgreSQL/IInternalSink.mjs +2 -0
  300. package/dist/private/lib/PostgreSQL/ILockOrderPlan.d.mts +8 -0
  301. package/dist/private/lib/PostgreSQL/ILockOrderPlan.mjs +2 -0
  302. package/dist/private/lib/PostgreSQL/IModeOrder.d.mts +7 -0
  303. package/dist/private/lib/PostgreSQL/IModeOrder.mjs +2 -0
  304. package/dist/private/lib/PostgreSQL/IPostgresState.d.mts +9 -0
  305. package/dist/private/lib/PostgreSQL/IPostgresState.mjs +2 -0
  306. package/dist/private/lib/PostgreSQL/IRoleCheck.d.mts +4 -0
  307. package/dist/private/lib/PostgreSQL/IRoleCheck.mjs +2 -0
  308. package/dist/private/lib/PostgreSQL/IRoleColumnCheck.d.mts +7 -0
  309. package/dist/private/lib/PostgreSQL/IRoleColumnCheck.mjs +2 -0
  310. package/dist/private/lib/PostgreSQL/IRoleObjectCheck.d.mts +6 -0
  311. package/dist/private/lib/PostgreSQL/IRoleObjectCheck.mjs +2 -0
  312. package/dist/private/lib/PostgreSQL/IRolePlan.d.mts +7 -0
  313. package/dist/private/lib/PostgreSQL/IRolePlan.mjs +2 -0
  314. package/dist/private/lib/PostgreSQL/IRoleRow.d.mts +2 -0
  315. package/dist/private/lib/PostgreSQL/IRoleRow.mjs +2 -0
  316. package/dist/private/lib/PostgreSQL/ITrackerState.d.mts +10 -0
  317. package/dist/private/lib/PostgreSQL/ITrackerState.mjs +2 -0
  318. package/dist/private/lib/PostgreSQL/ITxHandleState.d.mts +6 -0
  319. package/dist/private/lib/PostgreSQL/ITxHandleState.mjs +2 -0
  320. package/dist/private/lib/PostgreSQL/ITxSettings.d.mts +14 -0
  321. package/dist/private/lib/PostgreSQL/ITxSettings.mjs +2 -0
  322. package/dist/private/lib/PostgreSQL/POSTGRES_STATE_KEY.d.mts +5 -0
  323. package/dist/private/lib/PostgreSQL/POSTGRES_STATE_KEY.mjs +6 -0
  324. package/dist/private/lib/PostgreSQL/POSTGRES_STATE_LAYOUT.d.mts +6 -0
  325. package/dist/private/lib/PostgreSQL/POSTGRES_STATE_LAYOUT.mjs +7 -0
  326. package/dist/private/lib/PostgreSQL/ROLE_ATTRIBUTES.d.mts +2 -0
  327. package/dist/private/lib/PostgreSQL/ROLE_ATTRIBUTES.mjs +9 -0
  328. package/dist/private/lib/PostgreSQL/ROLE_CATALOG_SQL.d.mts +26 -0
  329. package/dist/private/lib/PostgreSQL/ROLE_CATALOG_SQL.mjs +84 -0
  330. package/dist/private/lib/PostgreSQL/ROLE_PRIVILEGES.d.mts +2 -0
  331. package/dist/private/lib/PostgreSQL/ROLE_PRIVILEGES.mjs +7 -0
  332. package/dist/private/lib/PostgreSQL/TX_BEGIN_STATEMENTS.d.mts +7 -0
  333. package/dist/private/lib/PostgreSQL/TX_BEGIN_STATEMENTS.mjs +11 -0
  334. package/dist/private/lib/PostgreSQL/admitLock.d.mts +10 -0
  335. package/dist/private/lib/PostgreSQL/admitLock.mjs +33 -0
  336. package/dist/private/lib/PostgreSQL/assertPoolOptions.d.mts +12 -0
  337. package/dist/private/lib/PostgreSQL/assertPoolOptions.mjs +19 -0
  338. package/dist/private/lib/PostgreSQL/assertVersionGuardInput.d.mts +6 -0
  339. package/dist/private/lib/PostgreSQL/assertVersionGuardInput.mjs +14 -0
  340. package/dist/private/lib/PostgreSQL/catalogFlag.d.mts +2 -0
  341. package/dist/private/lib/PostgreSQL/catalogFlag.mjs +7 -0
  342. package/dist/private/lib/PostgreSQL/catalogRow.d.mts +4 -0
  343. package/dist/private/lib/PostgreSQL/catalogRow.mjs +11 -0
  344. package/dist/private/lib/PostgreSQL/catalogRows.d.mts +8 -0
  345. package/dist/private/lib/PostgreSQL/catalogRows.mjs +12 -0
  346. package/dist/private/lib/PostgreSQL/catalogText.d.mts +2 -0
  347. package/dist/private/lib/PostgreSQL/catalogText.mjs +7 -0
  348. package/dist/private/lib/PostgreSQL/checkRoleOnClient.d.mts +10 -0
  349. package/dist/private/lib/PostgreSQL/checkRoleOnClient.mjs +31 -0
  350. package/dist/private/lib/PostgreSQL/checkedClient.d.mts +8 -0
  351. package/dist/private/lib/PostgreSQL/checkedClient.mjs +22 -0
  352. package/dist/private/lib/PostgreSQL/civilCalendar.d.mts +13 -0
  353. package/dist/private/lib/PostgreSQL/civilCalendar.mjs +48 -0
  354. package/dist/private/lib/PostgreSQL/clockInstant.d.mts +11 -0
  355. package/dist/private/lib/PostgreSQL/clockInstant.mjs +18 -0
  356. package/dist/private/lib/PostgreSQL/clockSlot.d.mts +3 -0
  357. package/dist/private/lib/PostgreSQL/clockSlot.mjs +11 -0
  358. package/dist/private/lib/PostgreSQL/clockStatement.d.mts +6 -0
  359. package/dist/private/lib/PostgreSQL/clockStatement.mjs +22 -0
  360. package/dist/private/lib/PostgreSQL/connectAndCheck.d.mts +8 -0
  361. package/dist/private/lib/PostgreSQL/connectAndCheck.mjs +47 -0
  362. package/dist/private/lib/PostgreSQL/constraintDetails.d.mts +7 -0
  363. package/dist/private/lib/PostgreSQL/constraintDetails.mjs +21 -0
  364. package/dist/private/lib/PostgreSQL/constraintField.d.mts +4 -0
  365. package/dist/private/lib/PostgreSQL/constraintField.mjs +5 -0
  366. package/dist/private/lib/PostgreSQL/errorCodeOf.d.mts +2 -0
  367. package/dist/private/lib/PostgreSQL/errorCodeOf.mjs +7 -0
  368. package/dist/private/lib/PostgreSQL/internalFailure.d.mts +9 -0
  369. package/dist/private/lib/PostgreSQL/internalFailure.mjs +10 -0
  370. package/dist/private/lib/PostgreSQL/isNameList.d.mts +2 -0
  371. package/dist/private/lib/PostgreSQL/isNameList.mjs +6 -0
  372. package/dist/private/lib/PostgreSQL/isOneOf.d.mts +2 -0
  373. package/dist/private/lib/PostgreSQL/isOneOf.mjs +5 -0
  374. package/dist/private/lib/PostgreSQL/isQualifiedName.d.mts +2 -0
  375. package/dist/private/lib/PostgreSQL/isQualifiedName.mjs +7 -0
  376. package/dist/private/lib/PostgreSQL/isRoleName.d.mts +2 -0
  377. package/dist/private/lib/PostgreSQL/isRoleName.mjs +7 -0
  378. package/dist/private/lib/PostgreSQL/lockOrderPlan.d.mts +8 -0
  379. package/dist/private/lib/PostgreSQL/lockOrderPlan.mjs +66 -0
  380. package/dist/private/lib/PostgreSQL/mapTypedError.d.mts +3 -0
  381. package/dist/private/lib/PostgreSQL/mapTypedError.mjs +28 -0
  382. package/dist/private/lib/PostgreSQL/mapViolation.d.mts +3 -0
  383. package/dist/private/lib/PostgreSQL/mapViolation.mjs +32 -0
  384. package/dist/private/lib/PostgreSQL/membershipOutsider.d.mts +7 -0
  385. package/dist/private/lib/PostgreSQL/membershipOutsider.mjs +17 -0
  386. package/dist/private/lib/PostgreSQL/missingColumn.d.mts +9 -0
  387. package/dist/private/lib/PostgreSQL/missingColumn.mjs +15 -0
  388. package/dist/private/lib/PostgreSQL/missingGrant.d.mts +5 -0
  389. package/dist/private/lib/PostgreSQL/missingGrant.mjs +7 -0
  390. package/dist/private/lib/PostgreSQL/missingObject.d.mts +10 -0
  391. package/dist/private/lib/PostgreSQL/missingObject.mjs +14 -0
  392. package/dist/private/lib/PostgreSQL/poolUrlSecrets.d.mts +8 -0
  393. package/dist/private/lib/PostgreSQL/poolUrlSecrets.mjs +41 -0
  394. package/dist/private/lib/PostgreSQL/postgresState.d.mts +7 -0
  395. package/dist/private/lib/PostgreSQL/postgresState.mjs +32 -0
  396. package/dist/private/lib/PostgreSQL/rankCheckOption.d.mts +2 -0
  397. package/dist/private/lib/PostgreSQL/rankCheckOption.mjs +7 -0
  398. package/dist/private/lib/PostgreSQL/readField.d.mts +5 -0
  399. package/dist/private/lib/PostgreSQL/readField.mjs +10 -0
  400. package/dist/private/lib/PostgreSQL/roleCheckOf.d.mts +7 -0
  401. package/dist/private/lib/PostgreSQL/roleCheckOf.mjs +39 -0
  402. package/dist/private/lib/PostgreSQL/roleFailureSubject.d.mts +7 -0
  403. package/dist/private/lib/PostgreSQL/roleFailureSubject.mjs +12 -0
  404. package/dist/private/lib/PostgreSQL/rolePlan.d.mts +7 -0
  405. package/dist/private/lib/PostgreSQL/rolePlan.mjs +26 -0
  406. package/dist/private/lib/PostgreSQL/runRoleChecks.d.mts +17 -0
  407. package/dist/private/lib/PostgreSQL/runRoleChecks.mjs +48 -0
  408. package/dist/private/lib/PostgreSQL/runTxAttempt.d.mts +12 -0
  409. package/dist/private/lib/PostgreSQL/runTxAttempt.mjs +50 -0
  410. package/dist/private/lib/PostgreSQL/runTxBody.d.mts +11 -0
  411. package/dist/private/lib/PostgreSQL/runTxBody.mjs +19 -0
  412. package/dist/private/lib/PostgreSQL/runTxWithRetries.d.mts +10 -0
  413. package/dist/private/lib/PostgreSQL/runTxWithRetries.mjs +31 -0
  414. package/dist/private/lib/PostgreSQL/scrubSecrets.d.mts +2 -0
  415. package/dist/private/lib/PostgreSQL/scrubSecrets.mjs +6 -0
  416. package/dist/private/lib/PostgreSQL/txFailure.d.mts +4 -0
  417. package/dist/private/lib/PostgreSQL/txFailure.mjs +7 -0
  418. package/dist/private/lib/PostgreSQL/txHandle.d.mts +9 -0
  419. package/dist/private/lib/PostgreSQL/txHandle.mjs +26 -0
  420. package/dist/private/lib/PostgreSQL/txSettings.d.mts +7 -0
  421. package/dist/private/lib/PostgreSQL/txSettings.mjs +48 -0
  422. package/dist/private/lib/PostgreSQL/versionText.d.mts +5 -0
  423. package/dist/private/lib/PostgreSQL/versionText.mjs +12 -0
  424. package/dist/private/lib/access/db/abandonUser.mjs +2 -3
  425. package/dist/private/lib/access/db/getResetPwd.mjs +4 -2
  426. package/dist/private/lib/access/db/setEmailHash.mjs +3 -1
  427. package/dist/private/lib/access/db/userData4VerifyEmail.d.mts +1 -1
  428. package/dist/private/lib/access/db/userData4VerifyEmail.mjs +4 -2
  429. package/dist/private/lib/access/handleIfHashBad.mjs +1 -0
  430. package/dist/private/lib/access/pathTools.mjs +2 -5
  431. package/package.json +504 -4
@@ -0,0 +1,10 @@
1
+ import type { IConnectCallback } from './IConnectCallback.mjs';
2
+ /** The members of the driver's client that the checked subclass uses. */
3
+ export interface IClientShape {
4
+ connect(): Promise<unknown>;
5
+ connect(callback: IConnectCallback): void;
6
+ query(text: string): Promise<{
7
+ rows: Record<string, unknown>[];
8
+ }>;
9
+ end(): Promise<void>;
10
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IClientShape.mjs.map
@@ -0,0 +1,11 @@
1
+ /** What is known about the clock of one transaction. */
2
+ export interface IClockSlot {
3
+ /** True once a lock helper has taken a lock in this transaction. */
4
+ locked: boolean;
5
+ /** The instant, in epoch milliseconds, once it was read. */
6
+ instant: number | undefined;
7
+ /** The read that is under way, so that concurrent callers share one statement. */
8
+ pending: Promise<number> | undefined;
9
+ /** Set by `createDbClock`: reads the instant (once) with the statement of that clock. */
10
+ read: (() => Promise<number>) | undefined;
11
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IClockSlot.mjs.map
@@ -0,0 +1,2 @@
1
+ /** The callback form of the driver client's `connect`, which pg-pool uses. */
2
+ export type IConnectCallback = (error?: Error | null) => void;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IConnectCallback.mjs.map
@@ -0,0 +1,8 @@
1
+ import type { IPoolCounter } from "../../../lib/PostgreSQL/pool/IPoolCounter.mjs";
2
+ import type { IPoolLogger } from "../../../lib/PostgreSQL/pool/IPoolLogger.mjs";
3
+ /** What the connect of one client needs besides the client. */
4
+ export interface IConnectSettings {
5
+ readonly connectTimeoutMs: number;
6
+ readonly logger: IPoolLogger;
7
+ readonly count: IPoolCounter;
8
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IConnectSettings.mjs.map
@@ -0,0 +1,5 @@
1
+ /** The rank a helper takes in one mode: its name in the order, and its position counted from 1. */
2
+ export interface IHelperRank {
3
+ readonly name: string;
4
+ readonly rank: number;
5
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IHelperRank.mjs.map
@@ -0,0 +1,9 @@
1
+ import type { IDbCounter } from "../../../lib/PostgreSQL/counter/IDbCounter.mjs";
2
+ import type { IDbErrorFactory } from "../../../lib/PostgreSQL/error/IDbErrorFactory.mjs";
3
+ import type { IPoolLogger } from "../../../lib/PostgreSQL/pool/IPoolLogger.mjs";
4
+ /** What `internalFailure` needs: the factory's `internal`, a logger with `error`, and an optional counter over the names it emits. */
5
+ export interface IInternalSink<TError extends Error, TName extends string> {
6
+ readonly errors: Pick<IDbErrorFactory<TError>, 'internal'>;
7
+ readonly logger: Pick<IPoolLogger, 'error'>;
8
+ readonly counter?: IDbCounter<TName>;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IInternalSink.mjs.map
@@ -0,0 +1,8 @@
1
+ import type { IModeOrder } from './IModeOrder.mjs';
2
+ /** A lock-order spec after the check and the copy: what a tracker reads, and no more. */
3
+ export interface ILockOrderPlan {
4
+ readonly defaultOrder: IModeOrder;
5
+ readonly orders: ReadonlyMap<string, IModeOrder>;
6
+ /** The helpers the spec names. */
7
+ readonly helpers: ReadonlySet<string>;
8
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ILockOrderPlan.mjs.map
@@ -0,0 +1,7 @@
1
+ import type { IHelperRank } from './IHelperRank.mjs';
2
+ /** The order of one mode, after the spec was checked: the ranks lowest first, and the rank each helper takes in it. */
3
+ export interface IModeOrder {
4
+ readonly mode: string;
5
+ readonly names: readonly string[];
6
+ readonly ranks: Map<string, IHelperRank>;
7
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IModeOrder.mjs.map
@@ -0,0 +1,9 @@
1
+ import type { IClockSlot } from './IClockSlot.mjs';
2
+ /**
3
+ * What every copy of the package shares: the per-transaction clock slots, keyed by the transaction handle. The registry
4
+ * is frozen and holds no secret and no driver object: a flag, an epoch number, a promise and a function per handle.
5
+ */
6
+ export interface IPostgresState {
7
+ readonly layout: number;
8
+ readonly slots: WeakMap<object, IClockSlot>;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IPostgresState.mjs.map
@@ -0,0 +1,4 @@
1
+ import type { IRoleColumnCheck } from './IRoleColumnCheck.mjs';
2
+ import type { IRoleObjectCheck } from './IRoleObjectCheck.mjs';
3
+ /** One expected grant after its shape was checked. */
4
+ export type IRoleCheck = IRoleColumnCheck | IRoleObjectCheck;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IRoleCheck.mjs.map
@@ -0,0 +1,7 @@
1
+ /** A column-level grant, checked with one catalog row per column. */
2
+ export interface IRoleColumnCheck {
3
+ readonly kind: 'columns';
4
+ readonly object: string;
5
+ readonly privilege: string;
6
+ readonly columns: readonly string[];
7
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IRoleColumnCheck.mjs.map
@@ -0,0 +1,6 @@
1
+ /** A grant on a schema, a function, or a table, view or sequence, checked with one call of a catalog function. */
2
+ export interface IRoleObjectCheck {
3
+ readonly kind: 'schema' | 'function' | 'relation';
4
+ readonly object: string;
5
+ readonly privilege: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IRoleObjectCheck.mjs.map
@@ -0,0 +1,7 @@
1
+ import type { IRoleCheck } from './IRoleCheck.mjs';
2
+ /** The options of `assertRole` after validation: nothing in it needs another look at the caller's input. */
3
+ export interface IRolePlan {
4
+ readonly role: string;
5
+ readonly allowed: ReadonlySet<string>;
6
+ readonly checks: readonly IRoleCheck[];
7
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IRolePlan.mjs.map
@@ -0,0 +1,2 @@
1
+ /** One row of a catalog answer: an object whose fields are read and checked one by one. */
2
+ export type IRoleRow = Readonly<Record<string, unknown>>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IRoleRow.mjs.map
@@ -0,0 +1,10 @@
1
+ import type { IModeOrder } from './IModeOrder.mjs';
2
+ /** What a tracker knows about one transaction. */
3
+ export interface ITrackerState {
4
+ order: IModeOrder;
5
+ rankCheck: boolean;
6
+ /** The highest rank recorded in this transaction, 0 when none. */
7
+ rank: number;
8
+ /** The strength of the locks recorded with `hold`, by key. */
9
+ held: Map<string, number>;
10
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITrackerState.mjs.map
@@ -0,0 +1,6 @@
1
+ /** What the handle of one attempt shares with the attempt: whether it still works, and its first failed statement. */
2
+ export interface ITxHandleState {
3
+ open: boolean;
4
+ failed: boolean;
5
+ failure: unknown;
6
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITxHandleState.mjs.map
@@ -0,0 +1,14 @@
1
+ import type { IDbErrorFactory } from "../../../lib/PostgreSQL/error/IDbErrorFactory.mjs";
2
+ import type { IPoolLogger } from "../../../lib/PostgreSQL/pool/IPoolLogger.mjs";
3
+ import type { IRetryDelay } from "../../../lib/PostgreSQL/tx/IRetryDelay.mjs";
4
+ import type { ITxCounter } from "../../../lib/PostgreSQL/tx/ITxCounter.mjs";
5
+ /** The options of `withTx` after the checks: every default applied and the two opening statements built. */
6
+ export interface ITxSettings {
7
+ readonly logger: IPoolLogger;
8
+ readonly errors: Pick<IDbErrorFactory, 'internal'>;
9
+ readonly count: ITxCounter;
10
+ readonly begin: string;
11
+ readonly setLockTimeout: string;
12
+ readonly retryMax: number;
13
+ readonly retryDelay: IRetryDelay;
14
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ITxSettings.mjs.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The key under which every copy of this package finds the registry of the PostgreSQL kit on `globalThis`. A registry
3
+ * symbol, so two copies loaded from two places agree on it without sharing a module.
4
+ */
5
+ export declare const POSTGRES_STATE_KEY: unique symbol;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The key under which every copy of this package finds the registry of the PostgreSQL kit on `globalThis`. A registry
3
+ * symbol, so two copies loaded from two places agree on it without sharing a module.
4
+ */
5
+ export const POSTGRES_STATE_KEY = Symbol.for('@axiumine/koa-utils/postgres-state');
6
+ //# sourceMappingURL=POSTGRES_STATE_KEY.mjs.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The layout of the shared registry. It changes only when the shape of {@link IPostgresState} or of a slot changes in a
3
+ * way that an older copy cannot read: copies with the same layout share one registry, copies with another refuse each
4
+ * other with `DbStateError` instead of splitting the state.
5
+ */
6
+ export declare const POSTGRES_STATE_LAYOUT = 1;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The layout of the shared registry. It changes only when the shape of {@link IPostgresState} or of a slot changes in a
3
+ * way that an older copy cannot read: copies with the same layout share one registry, copies with another refuse each
4
+ * other with `DbStateError` instead of splitting the state.
5
+ */
6
+ export const POSTGRES_STATE_LAYOUT = 1;
7
+ //# sourceMappingURL=POSTGRES_STATE_LAYOUT.mjs.map
@@ -0,0 +1,2 @@
1
+ /** Which attribute flag of the identity row gives which reason, in the order they are tested. */
2
+ export declare const ROLE_ATTRIBUTES: readonly [readonly ["superuser", "ROLE_SUPERUSER"], readonly ["createrole", "ROLE_CREATEROLE"], readonly ["createdb", "ROLE_CREATEDB"], readonly ["bypassrls", "ROLE_BYPASSRLS"], readonly ["replication", "ROLE_REPLICATION"]];
@@ -0,0 +1,9 @@
1
+ /** Which attribute flag of the identity row gives which reason, in the order they are tested. */
2
+ export const ROLE_ATTRIBUTES = [
3
+ ['superuser', 'ROLE_SUPERUSER'],
4
+ ['createrole', 'ROLE_CREATEROLE'],
5
+ ['createdb', 'ROLE_CREATEDB'],
6
+ ['bypassrls', 'ROLE_BYPASSRLS'],
7
+ ['replication', 'ROLE_REPLICATION']
8
+ ];
9
+ //# sourceMappingURL=ROLE_ATTRIBUTES.mjs.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The statements `assertRole` sends, all read-only catalog queries about `current_user`. A name or a privilege reaches
3
+ * them only as a bound parameter (`$1`, `$2`, `$3`), never in the text.
4
+ *
5
+ * - `identity`: the effective and the login role, and the five attribute flags of the effective role.
6
+ * - `ownsObjects`: whether `pg_shdepend`, the shared dependency catalog, holds one `o` (owner) row for the role. It lists
7
+ * every object of every database of the cluster that a role owns, so one read answers for tables, functions, schemas,
8
+ * types, databases and the rest, with no list of catalogs to keep.
9
+ * - `memberships`: the roles `current_user` is a member of, directly or through a chain, walked with a recursive query.
10
+ * - `grant.schema` (`$1` schema, `$2` privilege), `grant.function` (`$1` schema, `$2` function name), `grant.relation`
11
+ * (`$1` qualified name, `$2` privilege) and `grant.columns` (`$1` qualified name, `$2` privilege, `$3` column names):
12
+ * the catalog privilege functions for `current_user`. A relation that does not exist, or a privilege the kind of
13
+ * relation cannot hold (`USAGE` on a table, `DELETE` on a sequence), answers no row, `NULL` or `false`, which is a
14
+ * missing grant and never a pass.
15
+ */
16
+ export declare const ROLE_CATALOG_SQL: {
17
+ readonly identity: "\nSELECT current_user::text AS effective_role,\n session_user::text AS login_role,\n r.rolsuper AS superuser,\n r.rolcreaterole AS createrole,\n r.rolcreatedb AS createdb,\n r.rolbypassrls AS bypassrls,\n r.rolreplication AS replication\nFROM pg_catalog.pg_roles r\nWHERE r.rolname = current_user";
18
+ readonly ownsObjects: "\nSELECT EXISTS (\n SELECT 1\n FROM pg_catalog.pg_shdepend d\n JOIN pg_catalog.pg_roles r ON r.oid = d.refobjid\n WHERE d.refclassid = 'pg_catalog.pg_authid'::regclass\n AND d.deptype = 'o'\n AND r.rolname = current_user\n) AS owns";
19
+ readonly memberships: "\nWITH RECURSIVE membership (role_oid) AS (\n SELECT a.roleid\n FROM pg_catalog.pg_auth_members a\n JOIN pg_catalog.pg_roles me ON me.oid = a.member\n WHERE me.rolname = current_user\n UNION\n SELECT a.roleid\n FROM pg_catalog.pg_auth_members a\n JOIN membership m ON a.member = m.role_oid\n)\nSELECT r.rolname::text AS member_of\nFROM membership m\nJOIN pg_catalog.pg_roles r ON r.oid = m.role_oid";
20
+ readonly grant: {
21
+ readonly schema: "\nSELECT CASE\n WHEN s.oid IS NULL THEN NULL\n ELSE pg_catalog.has_schema_privilege(current_user, s.oid, $2::text)\nEND AS held\nFROM (SELECT pg_catalog.to_regnamespace($1::text)::oid AS oid) s";
22
+ readonly function: "\nSELECT pg_catalog.bool_and(pg_catalog.has_function_privilege(current_user, p.oid, 'EXECUTE')) AS held\nFROM pg_catalog.pg_proc p\nWHERE p.pronamespace = pg_catalog.to_regnamespace($1::text)::oid\n AND p.proname = $2::text";
23
+ readonly relation: "\nSELECT CASE\n WHEN c.relkind = 'S' THEN\n CASE WHEN $2::text IN ('USAGE', 'SELECT', 'UPDATE')\n THEN pg_catalog.has_sequence_privilege(current_user, c.oid, $2::text)\n ELSE false\n END\n WHEN $2::text = 'USAGE' THEN false\n ELSE pg_catalog.has_table_privilege(current_user, c.oid, $2::text)\nEND AS held\nFROM pg_catalog.pg_class c\nWHERE c.oid = pg_catalog.to_regclass($1::text)::oid";
24
+ readonly columns: "\nSELECT a.attname::text AS name,\n pg_catalog.has_column_privilege(current_user, a.attrelid, a.attname::text, $2::text) AS held\nFROM pg_catalog.pg_attribute a\nWHERE a.attrelid = pg_catalog.to_regclass($1::text)::oid\n AND a.attname = ANY ($3::text[])\n AND a.attnum > 0\n AND NOT a.attisdropped";
25
+ };
26
+ };
@@ -0,0 +1,84 @@
1
+ /**
2
+ * The statements `assertRole` sends, all read-only catalog queries about `current_user`. A name or a privilege reaches
3
+ * them only as a bound parameter (`$1`, `$2`, `$3`), never in the text.
4
+ *
5
+ * - `identity`: the effective and the login role, and the five attribute flags of the effective role.
6
+ * - `ownsObjects`: whether `pg_shdepend`, the shared dependency catalog, holds one `o` (owner) row for the role. It lists
7
+ * every object of every database of the cluster that a role owns, so one read answers for tables, functions, schemas,
8
+ * types, databases and the rest, with no list of catalogs to keep.
9
+ * - `memberships`: the roles `current_user` is a member of, directly or through a chain, walked with a recursive query.
10
+ * - `grant.schema` (`$1` schema, `$2` privilege), `grant.function` (`$1` schema, `$2` function name), `grant.relation`
11
+ * (`$1` qualified name, `$2` privilege) and `grant.columns` (`$1` qualified name, `$2` privilege, `$3` column names):
12
+ * the catalog privilege functions for `current_user`. A relation that does not exist, or a privilege the kind of
13
+ * relation cannot hold (`USAGE` on a table, `DELETE` on a sequence), answers no row, `NULL` or `false`, which is a
14
+ * missing grant and never a pass.
15
+ */
16
+ export const ROLE_CATALOG_SQL = {
17
+ identity: `
18
+ SELECT current_user::text AS effective_role,
19
+ session_user::text AS login_role,
20
+ r.rolsuper AS superuser,
21
+ r.rolcreaterole AS createrole,
22
+ r.rolcreatedb AS createdb,
23
+ r.rolbypassrls AS bypassrls,
24
+ r.rolreplication AS replication
25
+ FROM pg_catalog.pg_roles r
26
+ WHERE r.rolname = current_user`,
27
+ ownsObjects: `
28
+ SELECT EXISTS (
29
+ SELECT 1
30
+ FROM pg_catalog.pg_shdepend d
31
+ JOIN pg_catalog.pg_roles r ON r.oid = d.refobjid
32
+ WHERE d.refclassid = 'pg_catalog.pg_authid'::regclass
33
+ AND d.deptype = 'o'
34
+ AND r.rolname = current_user
35
+ ) AS owns`,
36
+ memberships: `
37
+ WITH RECURSIVE membership (role_oid) AS (
38
+ SELECT a.roleid
39
+ FROM pg_catalog.pg_auth_members a
40
+ JOIN pg_catalog.pg_roles me ON me.oid = a.member
41
+ WHERE me.rolname = current_user
42
+ UNION
43
+ SELECT a.roleid
44
+ FROM pg_catalog.pg_auth_members a
45
+ JOIN membership m ON a.member = m.role_oid
46
+ )
47
+ SELECT r.rolname::text AS member_of
48
+ FROM membership m
49
+ JOIN pg_catalog.pg_roles r ON r.oid = m.role_oid`,
50
+ grant: {
51
+ schema: `
52
+ SELECT CASE
53
+ WHEN s.oid IS NULL THEN NULL
54
+ ELSE pg_catalog.has_schema_privilege(current_user, s.oid, $2::text)
55
+ END AS held
56
+ FROM (SELECT pg_catalog.to_regnamespace($1::text)::oid AS oid) s`,
57
+ function: `
58
+ SELECT pg_catalog.bool_and(pg_catalog.has_function_privilege(current_user, p.oid, 'EXECUTE')) AS held
59
+ FROM pg_catalog.pg_proc p
60
+ WHERE p.pronamespace = pg_catalog.to_regnamespace($1::text)::oid
61
+ AND p.proname = $2::text`,
62
+ relation: `
63
+ SELECT CASE
64
+ WHEN c.relkind = 'S' THEN
65
+ CASE WHEN $2::text IN ('USAGE', 'SELECT', 'UPDATE')
66
+ THEN pg_catalog.has_sequence_privilege(current_user, c.oid, $2::text)
67
+ ELSE false
68
+ END
69
+ WHEN $2::text = 'USAGE' THEN false
70
+ ELSE pg_catalog.has_table_privilege(current_user, c.oid, $2::text)
71
+ END AS held
72
+ FROM pg_catalog.pg_class c
73
+ WHERE c.oid = pg_catalog.to_regclass($1::text)::oid`,
74
+ columns: `
75
+ SELECT a.attname::text AS name,
76
+ pg_catalog.has_column_privilege(current_user, a.attrelid, a.attname::text, $2::text) AS held
77
+ FROM pg_catalog.pg_attribute a
78
+ WHERE a.attrelid = pg_catalog.to_regclass($1::text)::oid
79
+ AND a.attname = ANY ($3::text[])
80
+ AND a.attnum > 0
81
+ AND NOT a.attisdropped`
82
+ }
83
+ };
84
+ //# sourceMappingURL=ROLE_CATALOG_SQL.mjs.map
@@ -0,0 +1,2 @@
1
+ /** The privileges `assertRole` accepts, by the kind of object they are asked on. */
2
+ export declare const ROLE_PRIVILEGES: Readonly<Record<'schema' | 'relation' | 'column', readonly string[]>>;
@@ -0,0 +1,7 @@
1
+ /** The privileges `assertRole` accepts, by the kind of object they are asked on. */
2
+ export const ROLE_PRIVILEGES = {
3
+ schema: ['USAGE', 'CREATE'],
4
+ relation: ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'TRUNCATE', 'REFERENCES', 'TRIGGER', 'USAGE'],
5
+ column: ['SELECT', 'INSERT', 'UPDATE', 'REFERENCES']
6
+ };
7
+ //# sourceMappingURL=ROLE_PRIVILEGES.mjs.map
@@ -0,0 +1,7 @@
1
+ import type { ITxIsolation } from "../../../lib/PostgreSQL/tx/ITxIsolation.mjs";
2
+ /**
3
+ * The statement that opens a transaction, by isolation level: read-write first, read-only second. Literals on
4
+ * purpose: nothing is interpolated into a `BEGIN`. A `Map`, so that a key that is not an own entry (`toString`) finds
5
+ * nothing.
6
+ */
7
+ export declare const TX_BEGIN_STATEMENTS: ReadonlyMap<ITxIsolation, readonly [string, string]>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The statement that opens a transaction, by isolation level: read-write first, read-only second. Literals on
3
+ * purpose: nothing is interpolated into a `BEGIN`. A `Map`, so that a key that is not an own entry (`toString`) finds
4
+ * nothing.
5
+ */
6
+ export const TX_BEGIN_STATEMENTS = new Map([
7
+ ['READ COMMITTED', ['BEGIN ISOLATION LEVEL READ COMMITTED', 'BEGIN ISOLATION LEVEL READ COMMITTED READ ONLY']],
8
+ ['REPEATABLE READ', ['BEGIN ISOLATION LEVEL REPEATABLE READ', 'BEGIN ISOLATION LEVEL REPEATABLE READ READ ONLY']],
9
+ ['SERIALIZABLE', ['BEGIN ISOLATION LEVEL SERIALIZABLE', 'BEGIN ISOLATION LEVEL SERIALIZABLE READ ONLY']]
10
+ ]);
11
+ //# sourceMappingURL=TX_BEGIN_STATEMENTS.mjs.map
@@ -0,0 +1,10 @@
1
+ import type { ILockAdmission } from "../../../lib/PostgreSQL/lock/ILockAdmission.mjs";
2
+ import type { ILockOrderPlan } from './ILockOrderPlan.mjs';
3
+ import type { ITrackerState } from './ITrackerState.mjs';
4
+ /**
5
+ * Checks the request of a helper against the order of the mode of the transaction, and answers the rank to record, or
6
+ * nothing when the helper has no rank in this mode and the check is off. Nothing is recorded here. The same rank again
7
+ * passes; a lower one is `RANK_INVERSION`; a helper outside the mode is `MODE_REQUIRED` (the transaction is in the default
8
+ * mode) or `NOT_IN_MODE_ORDER`. With the check off none of them throws. A `TypeError` for a helper the spec does not name.
9
+ */
10
+ export declare function admitLock(plan: ILockOrderPlan, state: ITrackerState, helper: string): ILockAdmission | undefined;
@@ -0,0 +1,33 @@
1
+ import { LockOrderError } from "../../../lib/PostgreSQL/error/LockOrderError.mjs";
2
+ /** The error for a helper that has no rank in the mode of the transaction. */
3
+ function modeMistake(plan, state, helper) {
4
+ if (state.order === plan.defaultOrder) {
5
+ const homes = [...plan.orders.values()].filter((order) => order.ranks.has(helper)).map((order) => order.mode);
6
+ return new LockOrderError('MODE_REQUIRED', `${helper} belongs to the ${homes.join(' or ')} order: set that mode on the transaction before its first lock`);
7
+ }
8
+ return new LockOrderError('NOT_IN_MODE_ORDER', `${helper} is not one of the locks of the ${state.order.mode} order (${state.order.names.join(', ')})`);
9
+ }
10
+ /** The error for a rank lower than one already recorded; it names both ranks. */
11
+ function rankInversion(state, helper, taken) {
12
+ return new LockOrderError('RANK_INVERSION', `lock order violated: ${helper} takes rank ${String(taken.rank)} (${taken.name}) after rank ${String(state.rank)} (${String(state.order.names[state.rank - 1])}) in the ${state.order.mode} order`);
13
+ }
14
+ /**
15
+ * Checks the request of a helper against the order of the mode of the transaction, and answers the rank to record, or
16
+ * nothing when the helper has no rank in this mode and the check is off. Nothing is recorded here. The same rank again
17
+ * passes; a lower one is `RANK_INVERSION`; a helper outside the mode is `MODE_REQUIRED` (the transaction is in the default
18
+ * mode) or `NOT_IN_MODE_ORDER`. With the check off none of them throws. A `TypeError` for a helper the spec does not name.
19
+ */
20
+ export function admitLock(plan, state, helper) {
21
+ if (!plan.helpers.has(helper))
22
+ throw new TypeError('helper is not named in the lock order spec');
23
+ const taken = state.order.ranks.get(helper);
24
+ if (taken === undefined) {
25
+ if (state.rankCheck)
26
+ throw modeMistake(plan, state, helper);
27
+ return undefined;
28
+ }
29
+ if (state.rankCheck && taken.rank < state.rank)
30
+ throw rankInversion(state, helper, taken);
31
+ return { rank: taken.rank };
32
+ }
33
+ //# sourceMappingURL=admitLock.mjs.map
@@ -0,0 +1,12 @@
1
+ interface IPoolNumbers {
2
+ readonly max: number;
3
+ readonly applicationName: string;
4
+ readonly connectTimeoutMs: number;
5
+ readonly keepAliveInitialDelayMs: number;
6
+ }
7
+ /**
8
+ * Throws a `TypeError` for a parameter of `createPool` that is out of range, before anything is created. The checks
9
+ * run in the order of the parameters.
10
+ */
11
+ export declare function assertPoolOptions(options: IPoolNumbers): void;
12
+ export {};
@@ -0,0 +1,19 @@
1
+ const APPLICATION_NAME = /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,62}$/;
2
+ /**
3
+ * Throws a `TypeError` for a parameter of `createPool` that is out of range, before anything is created. The checks
4
+ * run in the order of the parameters.
5
+ */
6
+ export function assertPoolOptions(options) {
7
+ if (!Number.isInteger(options.max) || options.max < 1)
8
+ throw new TypeError('max must be a whole number from 1');
9
+ if (!APPLICATION_NAME.test(options.applicationName)) {
10
+ throw new TypeError('applicationName must be 1 to 63 characters of letters, digits, underscore, dot, colon and hyphen, starting with a letter or digit');
11
+ }
12
+ if (!Number.isInteger(options.connectTimeoutMs) || options.connectTimeoutMs < 1) {
13
+ throw new TypeError('connectTimeoutMs must be a whole number of milliseconds from 1');
14
+ }
15
+ if (!Number.isInteger(options.keepAliveInitialDelayMs) || options.keepAliveInitialDelayMs < 0) {
16
+ throw new TypeError('keepAliveInitialDelayMs must be a whole number of milliseconds from 0');
17
+ }
18
+ }
19
+ //# sourceMappingURL=assertPoolOptions.mjs.map
@@ -0,0 +1,6 @@
1
+ /** The shape checks of `guardVersion`, in the order field, expected, entity. Each is a `TypeError`; no statement ran before them. */
2
+ export declare function assertVersionGuardInput(input: {
3
+ readonly field: string;
4
+ readonly expected: number;
5
+ readonly entity: string;
6
+ }): void;
@@ -0,0 +1,14 @@
1
+ import { VERSION_GUARD_FIELDS } from "../../../lib/PostgreSQL/guard/VERSION_GUARD_FIELDS.mjs";
2
+ /** The shape checks of `guardVersion`, in the order field, expected, entity. Each is a `TypeError`; no statement ran before them. */
3
+ export function assertVersionGuardInput(input) {
4
+ if (!VERSION_GUARD_FIELDS.includes(input.field)) {
5
+ throw new TypeError(`field must be one of ${VERSION_GUARD_FIELDS.join(', ')}`);
6
+ }
7
+ if (!Number.isSafeInteger(input.expected)) {
8
+ throw new TypeError('expected must be a whole number');
9
+ }
10
+ if (typeof input.entity !== 'string' || input.entity === '') {
11
+ throw new TypeError('entity must be a non-empty string');
12
+ }
13
+ }
14
+ //# sourceMappingURL=assertVersionGuardInput.mjs.map
@@ -0,0 +1,2 @@
1
+ /** A catalog flag. Only a real boolean counts; anything else is a malformed answer, never a pass. */
2
+ export declare function catalogFlag(value: unknown): boolean;
@@ -0,0 +1,7 @@
1
+ /** A catalog flag. Only a real boolean counts; anything else is a malformed answer, never a pass. */
2
+ export function catalogFlag(value) {
3
+ if (typeof value !== 'boolean')
4
+ throw new TypeError('the catalog answered a value of another type');
5
+ return value;
6
+ }
7
+ //# sourceMappingURL=catalogFlag.mjs.map
@@ -0,0 +1,4 @@
1
+ import type { ITxClient } from "../../../lib/PostgreSQL/tx/ITxClient.mjs";
2
+ import type { IRoleRow } from './IRoleRow.mjs';
3
+ /** The one row of a statement that must answer exactly one, and an object. Anything else throws. */
4
+ export declare function catalogRow(client: ITxClient, text: string, values?: readonly unknown[]): Promise<IRoleRow>;
@@ -0,0 +1,11 @@
1
+ import { catalogRows } from './catalogRows.mjs';
2
+ /** The one row of a statement that must answer exactly one, and an object. Anything else throws. */
3
+ export async function catalogRow(client, text, values) {
4
+ const rows = await catalogRows(client, text, values);
5
+ const row = rows[0];
6
+ if (rows.length !== 1 || typeof row !== 'object' || row === null) {
7
+ throw new TypeError('the catalog answered an unexpected number of rows');
8
+ }
9
+ return row;
10
+ }
11
+ //# sourceMappingURL=catalogRow.mjs.map
@@ -0,0 +1,8 @@
1
+ import type { ITxClient } from "../../../lib/PostgreSQL/tx/ITxClient.mjs";
2
+ import type { IRoleRow } from './IRoleRow.mjs';
3
+ /**
4
+ * Sends one catalog statement and answers its rows. The statement goes with its values when it has any and without a
5
+ * second argument when it has none. An answer without a list of rows is a malformed answer: it throws, and the check
6
+ * that asked fails, never passes.
7
+ */
8
+ export declare function catalogRows(client: ITxClient, text: string, values?: readonly unknown[]): Promise<IRoleRow[]>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Sends one catalog statement and answers its rows. The statement goes with its values when it has any and without a
3
+ * second argument when it has none. An answer without a list of rows is a malformed answer: it throws, and the check
4
+ * that asked fails, never passes.
5
+ */
6
+ export async function catalogRows(client, text, values) {
7
+ const answer = values === undefined ? await client.query(text) : await client.query(text, values);
8
+ if (!Array.isArray(answer.rows))
9
+ throw new TypeError('the catalog answer has no rows');
10
+ return answer.rows;
11
+ }
12
+ //# sourceMappingURL=catalogRows.mjs.map
@@ -0,0 +1,2 @@
1
+ /** A catalog value that must be text. Anything else is a malformed answer and throws. */
2
+ export declare function catalogText(value: unknown): string;
@@ -0,0 +1,7 @@
1
+ /** A catalog value that must be text. Anything else is a malformed answer and throws. */
2
+ export function catalogText(value) {
3
+ if (typeof value !== 'string')
4
+ throw new TypeError('the catalog answered a value of another type');
5
+ return value;
6
+ }
7
+ //# sourceMappingURL=catalogText.mjs.map
@@ -0,0 +1,10 @@
1
+ import type { IRoleAssertion } from "../../../lib/PostgreSQL/role/IRoleAssertion.mjs";
2
+ import type { IRolePool } from "../../../lib/PostgreSQL/role/IRolePool.mjs";
3
+ import type { IRolePlan } from './IRolePlan.mjs';
4
+ /**
5
+ * Checks out one connection, runs the checks on it and gives it back. A connection that emitted an error, or that
6
+ * failed in the middle of a query, is destroyed instead of returned to the pool; one that only failed an assertion is
7
+ * returned. The listener for the connection's `error` event is removed before the release, so a connection never goes
8
+ * back to the pool with it.
9
+ */
10
+ export declare function checkRoleOnClient(pool: IRolePool, plan: IRolePlan): Promise<IRoleAssertion>;