@encore.dev/sdk 0.0.0 → 2.0.0-beta.10

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 (498) hide show
  1. package/LICENSE +362 -0
  2. package/README.md +245 -2
  3. package/app_meta.test.ts +154 -0
  4. package/app_meta.ts +226 -0
  5. package/config/config.test.ts +384 -0
  6. package/config/config.ts +236 -0
  7. package/config/mod.ts +15 -0
  8. package/config/secrets.ts +173 -0
  9. package/config/value.ts +239 -0
  10. package/cron/mod.test.ts +52 -0
  11. package/cron/mod.ts +62 -0
  12. package/dist/app_meta.d.ts +126 -0
  13. package/dist/app_meta.d.ts.map +1 -0
  14. package/dist/app_meta.js +67 -0
  15. package/dist/app_meta.js.map +1 -0
  16. package/dist/config/config.d.ts +135 -0
  17. package/dist/config/config.d.ts.map +1 -0
  18. package/dist/config/config.js +115 -0
  19. package/dist/config/config.js.map +1 -0
  20. package/dist/config/mod.d.ts +5 -0
  21. package/dist/config/mod.d.ts.map +1 -0
  22. package/dist/config/mod.js +3 -0
  23. package/dist/config/mod.js.map +1 -0
  24. package/dist/config/secrets.d.ts +124 -0
  25. package/dist/config/secrets.d.ts.map +1 -0
  26. package/dist/config/secrets.js +73 -0
  27. package/dist/config/secrets.js.map +1 -0
  28. package/dist/config/value.d.ts +54 -0
  29. package/dist/config/value.d.ts.map +1 -0
  30. package/dist/config/value.js +181 -0
  31. package/dist/config/value.js.map +1 -0
  32. package/dist/cron/mod.d.ts +57 -0
  33. package/dist/cron/mod.d.ts.map +1 -0
  34. package/dist/cron/mod.js +39 -0
  35. package/dist/cron/mod.js.map +1 -0
  36. package/dist/frontends/mod.d.ts +39 -0
  37. package/dist/frontends/mod.d.ts.map +1 -0
  38. package/dist/frontends/mod.js +47 -0
  39. package/dist/frontends/mod.js.map +1 -0
  40. package/dist/gateway/errors.d.ts +101 -0
  41. package/dist/gateway/errors.d.ts.map +1 -0
  42. package/dist/gateway/errors.js +146 -0
  43. package/dist/gateway/errors.js.map +1 -0
  44. package/dist/gateway/match.d.ts +127 -0
  45. package/dist/gateway/match.d.ts.map +1 -0
  46. package/dist/gateway/match.js +206 -0
  47. package/dist/gateway/match.js.map +1 -0
  48. package/dist/gateway/middleware.d.ts +108 -0
  49. package/dist/gateway/middleware.d.ts.map +1 -0
  50. package/dist/gateway/middleware.js +9 -0
  51. package/dist/gateway/middleware.js.map +1 -0
  52. package/dist/gateway/mod.d.ts +130 -0
  53. package/dist/gateway/mod.d.ts.map +1 -0
  54. package/dist/gateway/mod.js +188 -0
  55. package/dist/gateway/mod.js.map +1 -0
  56. package/dist/gateway/request.d.ts +304 -0
  57. package/dist/gateway/request.d.ts.map +1 -0
  58. package/dist/gateway/request.js +403 -0
  59. package/dist/gateway/request.js.map +1 -0
  60. package/dist/gateway/serve.d.ts +114 -0
  61. package/dist/gateway/serve.d.ts.map +1 -0
  62. package/dist/gateway/serve.js +510 -0
  63. package/dist/gateway/serve.js.map +1 -0
  64. package/dist/gateways/mod.d.ts +42 -0
  65. package/dist/gateways/mod.d.ts.map +1 -0
  66. package/dist/gateways/mod.js +55 -0
  67. package/dist/gateways/mod.js.map +1 -0
  68. package/dist/internal/clients/call.d.ts +171 -0
  69. package/dist/internal/clients/call.d.ts.map +1 -0
  70. package/dist/internal/clients/call.js +284 -0
  71. package/dist/internal/clients/call.js.map +1 -0
  72. package/dist/internal/clients/grpc.d.ts +108 -0
  73. package/dist/internal/clients/grpc.d.ts.map +1 -0
  74. package/dist/internal/clients/grpc.js +349 -0
  75. package/dist/internal/clients/grpc.js.map +1 -0
  76. package/dist/internal/clients/mod.d.ts +81 -0
  77. package/dist/internal/clients/mod.d.ts.map +1 -0
  78. package/dist/internal/clients/mod.js +237 -0
  79. package/dist/internal/clients/mod.js.map +1 -0
  80. package/dist/internal/fetch.d.ts +67 -0
  81. package/dist/internal/fetch.d.ts.map +1 -0
  82. package/dist/internal/fetch.js +264 -0
  83. package/dist/internal/fetch.js.map +1 -0
  84. package/dist/internal/otel/backend.d.ts +52 -0
  85. package/dist/internal/otel/backend.d.ts.map +1 -0
  86. package/dist/internal/otel/backend.js +2 -0
  87. package/dist/internal/otel/backend.js.map +1 -0
  88. package/dist/internal/otel/context.d.ts +11 -0
  89. package/dist/internal/otel/context.d.ts.map +1 -0
  90. package/dist/internal/otel/context.js +34 -0
  91. package/dist/internal/otel/context.js.map +1 -0
  92. package/dist/internal/otel/context_manager.d.ts +23 -0
  93. package/dist/internal/otel/context_manager.d.ts.map +1 -0
  94. package/dist/internal/otel/context_manager.js +120 -0
  95. package/dist/internal/otel/context_manager.js.map +1 -0
  96. package/dist/internal/otel/encode.d.ts +114 -0
  97. package/dist/internal/otel/encode.d.ts.map +1 -0
  98. package/dist/internal/otel/encode.js +290 -0
  99. package/dist/internal/otel/encode.js.map +1 -0
  100. package/dist/internal/otel/http.d.ts +11 -0
  101. package/dist/internal/otel/http.d.ts.map +1 -0
  102. package/dist/internal/otel/http.js +65 -0
  103. package/dist/internal/otel/http.js.map +1 -0
  104. package/dist/internal/otel/index.d.ts +9 -0
  105. package/dist/internal/otel/index.d.ts.map +1 -0
  106. package/dist/internal/otel/index.js +8 -0
  107. package/dist/internal/otel/index.js.map +1 -0
  108. package/dist/internal/otel/meter.d.ts +74 -0
  109. package/dist/internal/otel/meter.d.ts.map +1 -0
  110. package/dist/internal/otel/meter.js +265 -0
  111. package/dist/internal/otel/meter.js.map +1 -0
  112. package/dist/internal/otel/propagator.d.ts +15 -0
  113. package/dist/internal/otel/propagator.d.ts.map +1 -0
  114. package/dist/internal/otel/propagator.js +61 -0
  115. package/dist/internal/otel/propagator.js.map +1 -0
  116. package/dist/internal/otel/provider.d.ts +13 -0
  117. package/dist/internal/otel/provider.d.ts.map +1 -0
  118. package/dist/internal/otel/provider.js +22 -0
  119. package/dist/internal/otel/provider.js.map +1 -0
  120. package/dist/internal/otel/span.d.ts +75 -0
  121. package/dist/internal/otel/span.d.ts.map +1 -0
  122. package/dist/internal/otel/span.js +234 -0
  123. package/dist/internal/otel/span.js.map +1 -0
  124. package/dist/internal/otel/tracer.d.ts +16 -0
  125. package/dist/internal/otel/tracer.d.ts.map +1 -0
  126. package/dist/internal/otel/tracer.js +71 -0
  127. package/dist/internal/otel/tracer.js.map +1 -0
  128. package/dist/internal/reqfields.d.ts +170 -0
  129. package/dist/internal/reqfields.d.ts.map +1 -0
  130. package/dist/internal/reqfields.js +349 -0
  131. package/dist/internal/reqfields.js.map +1 -0
  132. package/dist/internal/runtime/meter.d.ts +12 -0
  133. package/dist/internal/runtime/meter.d.ts.map +1 -0
  134. package/dist/internal/runtime/meter.js +22 -0
  135. package/dist/internal/runtime/meter.js.map +1 -0
  136. package/dist/internal/runtime/mod.d.ts +18 -0
  137. package/dist/internal/runtime/mod.d.ts.map +1 -0
  138. package/dist/internal/runtime/mod.js +59 -0
  139. package/dist/internal/runtime/mod.js.map +1 -0
  140. package/dist/internal/runtime/napi/napi.cjs +308 -0
  141. package/dist/internal/runtime/napi/napi.d.cts +1251 -0
  142. package/dist/internal/runtime/shutdown.d.ts +91 -0
  143. package/dist/internal/runtime/shutdown.d.ts.map +1 -0
  144. package/dist/internal/runtime/shutdown.js +299 -0
  145. package/dist/internal/runtime/shutdown.js.map +1 -0
  146. package/dist/internal/testing/carry.d.ts +49 -0
  147. package/dist/internal/testing/carry.d.ts.map +1 -0
  148. package/dist/internal/testing/carry.js +77 -0
  149. package/dist/internal/testing/carry.js.map +1 -0
  150. package/dist/internal/testing/runner.d.ts +2 -0
  151. package/dist/internal/testing/runner.d.ts.map +1 -0
  152. package/dist/internal/testing/runner.js +10 -0
  153. package/dist/internal/testing/runner.js.map +1 -0
  154. package/dist/internal/testing/scope.d.ts +112 -0
  155. package/dist/internal/testing/scope.d.ts.map +1 -0
  156. package/dist/internal/testing/scope.js +346 -0
  157. package/dist/internal/testing/scope.js.map +1 -0
  158. package/dist/internal/testing/steps.d.ts +55 -0
  159. package/dist/internal/testing/steps.d.ts.map +1 -0
  160. package/dist/internal/testing/steps.js +295 -0
  161. package/dist/internal/testing/steps.js.map +1 -0
  162. package/dist/internal/testing/telemetry.d.ts +305 -0
  163. package/dist/internal/testing/telemetry.d.ts.map +1 -0
  164. package/dist/internal/testing/telemetry.js +188 -0
  165. package/dist/internal/testing/telemetry.js.map +1 -0
  166. package/dist/internal/utils/constraints.d.ts +10 -0
  167. package/dist/internal/utils/constraints.d.ts.map +1 -0
  168. package/dist/internal/utils/constraints.js +2 -0
  169. package/dist/internal/utils/constraints.js.map +1 -0
  170. package/dist/log/index.d.ts +40 -0
  171. package/dist/log/index.d.ts.map +1 -0
  172. package/dist/log/index.js +44 -0
  173. package/dist/log/index.js.map +1 -0
  174. package/dist/log/logger.d.ts +125 -0
  175. package/dist/log/logger.d.ts.map +1 -0
  176. package/dist/log/logger.js +203 -0
  177. package/dist/log/logger.js.map +1 -0
  178. package/dist/log/runtime.d.ts +21 -0
  179. package/dist/log/runtime.d.ts.map +1 -0
  180. package/dist/log/runtime.js +22 -0
  181. package/dist/log/runtime.js.map +1 -0
  182. package/dist/log/stderr.d.ts +10 -0
  183. package/dist/log/stderr.d.ts.map +1 -0
  184. package/dist/log/stderr.js +25 -0
  185. package/dist/log/stderr.js.map +1 -0
  186. package/dist/metrics/mod.d.ts +242 -0
  187. package/dist/metrics/mod.d.ts.map +1 -0
  188. package/dist/metrics/mod.js +353 -0
  189. package/dist/metrics/mod.js.map +1 -0
  190. package/dist/mod.d.ts +5 -0
  191. package/dist/mod.d.ts.map +1 -0
  192. package/dist/mod.js +3 -0
  193. package/dist/mod.js.map +1 -0
  194. package/dist/otel.d.ts +10 -0
  195. package/dist/otel.d.ts.map +1 -0
  196. package/dist/otel.js +13 -0
  197. package/dist/otel.js.map +1 -0
  198. package/dist/pubsub/encoding.d.ts +8 -0
  199. package/dist/pubsub/encoding.d.ts.map +1 -0
  200. package/dist/pubsub/encoding.js +18 -0
  201. package/dist/pubsub/encoding.js.map +1 -0
  202. package/dist/pubsub/mod.d.ts +7 -0
  203. package/dist/pubsub/mod.d.ts.map +1 -0
  204. package/dist/pubsub/mod.js +3 -0
  205. package/dist/pubsub/mod.js.map +1 -0
  206. package/dist/pubsub/refs.d.ts +20 -0
  207. package/dist/pubsub/refs.d.ts.map +1 -0
  208. package/dist/pubsub/refs.js +11 -0
  209. package/dist/pubsub/refs.js.map +1 -0
  210. package/dist/pubsub/subscription.d.ts +223 -0
  211. package/dist/pubsub/subscription.d.ts.map +1 -0
  212. package/dist/pubsub/subscription.js +121 -0
  213. package/dist/pubsub/subscription.js.map +1 -0
  214. package/dist/pubsub/topic.d.ts +218 -0
  215. package/dist/pubsub/topic.d.ts.map +1 -0
  216. package/dist/pubsub/topic.js +281 -0
  217. package/dist/pubsub/topic.js.map +1 -0
  218. package/dist/reqctx/mod.d.ts +174 -0
  219. package/dist/reqctx/mod.d.ts.map +1 -0
  220. package/dist/reqctx/mod.js +144 -0
  221. package/dist/reqctx/mod.js.map +1 -0
  222. package/dist/services/index.d.ts +171 -0
  223. package/dist/services/index.d.ts.map +1 -0
  224. package/dist/services/index.js +187 -0
  225. package/dist/services/index.js.map +1 -0
  226. package/dist/shutdown/mod.d.ts +60 -0
  227. package/dist/shutdown/mod.d.ts.map +1 -0
  228. package/dist/shutdown/mod.js +59 -0
  229. package/dist/shutdown/mod.js.map +1 -0
  230. package/dist/storage/clickhouse/database.d.ts +262 -0
  231. package/dist/storage/clickhouse/database.d.ts.map +1 -0
  232. package/dist/storage/clickhouse/database.js +362 -0
  233. package/dist/storage/clickhouse/database.js.map +1 -0
  234. package/dist/storage/clickhouse/errors.d.ts +67 -0
  235. package/dist/storage/clickhouse/errors.d.ts.map +1 -0
  236. package/dist/storage/clickhouse/errors.js +91 -0
  237. package/dist/storage/clickhouse/errors.js.map +1 -0
  238. package/dist/storage/clickhouse/mod.d.ts +31 -0
  239. package/dist/storage/clickhouse/mod.d.ts.map +1 -0
  240. package/dist/storage/clickhouse/mod.js +29 -0
  241. package/dist/storage/clickhouse/mod.js.map +1 -0
  242. package/dist/storage/objects/bucket.d.ts +522 -0
  243. package/dist/storage/objects/bucket.d.ts.map +1 -0
  244. package/dist/storage/objects/bucket.js +414 -0
  245. package/dist/storage/objects/bucket.js.map +1 -0
  246. package/dist/storage/objects/error.d.ts +24 -0
  247. package/dist/storage/objects/error.d.ts.map +1 -0
  248. package/dist/storage/objects/error.js +105 -0
  249. package/dist/storage/objects/error.js.map +1 -0
  250. package/dist/storage/objects/mod.d.ts +5 -0
  251. package/dist/storage/objects/mod.d.ts.map +1 -0
  252. package/dist/storage/objects/mod.js +3 -0
  253. package/dist/storage/objects/mod.js.map +1 -0
  254. package/dist/storage/objects/refs.d.ts +47 -0
  255. package/dist/storage/objects/refs.d.ts.map +1 -0
  256. package/dist/storage/objects/refs.js +26 -0
  257. package/dist/storage/objects/refs.js.map +1 -0
  258. package/dist/storage/postgres/database.d.ts +365 -0
  259. package/dist/storage/postgres/database.d.ts.map +1 -0
  260. package/dist/storage/postgres/database.js +480 -0
  261. package/dist/storage/postgres/database.js.map +1 -0
  262. package/dist/storage/postgres/errors.d.ts +120 -0
  263. package/dist/storage/postgres/errors.d.ts.map +1 -0
  264. package/dist/storage/postgres/errors.js +162 -0
  265. package/dist/storage/postgres/errors.js.map +1 -0
  266. package/dist/storage/postgres/interval.d.ts +44 -0
  267. package/dist/storage/postgres/interval.d.ts.map +1 -0
  268. package/dist/storage/postgres/interval.js +153 -0
  269. package/dist/storage/postgres/interval.js.map +1 -0
  270. package/dist/storage/postgres/mod.d.ts +5 -0
  271. package/dist/storage/postgres/mod.d.ts.map +1 -0
  272. package/dist/storage/postgres/mod.js +4 -0
  273. package/dist/storage/postgres/mod.js.map +1 -0
  274. package/dist/storage/redis/bitfield.d.ts +67 -0
  275. package/dist/storage/redis/bitfield.d.ts.map +1 -0
  276. package/dist/storage/redis/bitfield.js +114 -0
  277. package/dist/storage/redis/bitfield.js.map +1 -0
  278. package/dist/storage/redis/command.d.ts +45 -0
  279. package/dist/storage/redis/command.d.ts.map +1 -0
  280. package/dist/storage/redis/command.js +78 -0
  281. package/dist/storage/redis/command.js.map +1 -0
  282. package/dist/storage/redis/commands.d.ts +657 -0
  283. package/dist/storage/redis/commands.d.ts.map +1 -0
  284. package/dist/storage/redis/commands.js +759 -0
  285. package/dist/storage/redis/commands.js.map +1 -0
  286. package/dist/storage/redis/database.d.ts +336 -0
  287. package/dist/storage/redis/database.d.ts.map +1 -0
  288. package/dist/storage/redis/database.js +398 -0
  289. package/dist/storage/redis/database.js.map +1 -0
  290. package/dist/storage/redis/mod.d.ts +115 -0
  291. package/dist/storage/redis/mod.d.ts.map +1 -0
  292. package/dist/storage/redis/mod.js +109 -0
  293. package/dist/storage/redis/mod.js.map +1 -0
  294. package/dist/storage/redis/native.d.ts +16 -0
  295. package/dist/storage/redis/native.d.ts.map +1 -0
  296. package/dist/storage/redis/native.js +21 -0
  297. package/dist/storage/redis/native.js.map +1 -0
  298. package/dist/storage/redis/options.d.ts +90 -0
  299. package/dist/storage/redis/options.d.ts.map +1 -0
  300. package/dist/storage/redis/options.js +53 -0
  301. package/dist/storage/redis/options.js.map +1 -0
  302. package/dist/storage/redis/pubsub.d.ts +55 -0
  303. package/dist/storage/redis/pubsub.d.ts.map +1 -0
  304. package/dist/storage/redis/pubsub.js +88 -0
  305. package/dist/storage/redis/pubsub.js.map +1 -0
  306. package/dist/storage/redis/reply.d.ts +290 -0
  307. package/dist/storage/redis/reply.d.ts.map +1 -0
  308. package/dist/storage/redis/reply.js +611 -0
  309. package/dist/storage/redis/reply.js.map +1 -0
  310. package/dist/storage/redis/scan.d.ts +12 -0
  311. package/dist/storage/redis/scan.d.ts.map +1 -0
  312. package/dist/storage/redis/scan.js +76 -0
  313. package/dist/storage/redis/scan.js.map +1 -0
  314. package/dist/storage/redis/script.d.ts +92 -0
  315. package/dist/storage/redis/script.d.ts.map +1 -0
  316. package/dist/storage/redis/script.js +143 -0
  317. package/dist/storage/redis/script.js.map +1 -0
  318. package/dist/storage/redis/target.d.ts +49 -0
  319. package/dist/storage/redis/target.d.ts.map +1 -0
  320. package/dist/storage/redis/target.js +93 -0
  321. package/dist/storage/redis/target.js.map +1 -0
  322. package/dist/storage/redis/wire.d.ts +102 -0
  323. package/dist/storage/redis/wire.d.ts.map +1 -0
  324. package/dist/storage/redis/wire.js +309 -0
  325. package/dist/storage/redis/wire.js.map +1 -0
  326. package/dist/testing/bun.d.ts +8 -0
  327. package/dist/testing/bun.d.ts.map +1 -0
  328. package/dist/testing/bun.js +13 -0
  329. package/dist/testing/bun.js.map +1 -0
  330. package/dist/testing/jest.d.ts +8 -0
  331. package/dist/testing/jest.d.ts.map +1 -0
  332. package/dist/testing/jest.js +11 -0
  333. package/dist/testing/jest.js.map +1 -0
  334. package/dist/testing/mod.d.ts +183 -0
  335. package/dist/testing/mod.d.ts.map +1 -0
  336. package/dist/testing/mod.js +271 -0
  337. package/dist/testing/mod.js.map +1 -0
  338. package/dist/testing/node.d.ts +9 -0
  339. package/dist/testing/node.d.ts.map +1 -0
  340. package/dist/testing/node.js +12 -0
  341. package/dist/testing/node.js.map +1 -0
  342. package/dist/testing/playwright.d.ts +93 -0
  343. package/dist/testing/playwright.d.ts.map +1 -0
  344. package/dist/testing/playwright.js +164 -0
  345. package/dist/testing/playwright.js.map +1 -0
  346. package/dist/testing/puppeteer.d.ts +36 -0
  347. package/dist/testing/puppeteer.d.ts.map +1 -0
  348. package/dist/testing/puppeteer.js +70 -0
  349. package/dist/testing/puppeteer.js.map +1 -0
  350. package/dist/testing/system.d.ts +181 -0
  351. package/dist/testing/system.d.ts.map +1 -0
  352. package/dist/testing/system.js +255 -0
  353. package/dist/testing/system.js.map +1 -0
  354. package/dist/testing/vitest.d.ts +8 -0
  355. package/dist/testing/vitest.d.ts.map +1 -0
  356. package/dist/testing/vitest.js +13 -0
  357. package/dist/testing/vitest.js.map +1 -0
  358. package/dist/tracing/http.d.ts +11 -0
  359. package/dist/tracing/http.d.ts.map +1 -0
  360. package/dist/tracing/http.js +34 -0
  361. package/dist/tracing/http.js.map +1 -0
  362. package/dist/tracing/mod.d.ts +20 -0
  363. package/dist/tracing/mod.d.ts.map +1 -0
  364. package/dist/tracing/mod.js +47 -0
  365. package/dist/tracing/mod.js.map +1 -0
  366. package/dist/tracing/node.d.ts +10 -0
  367. package/dist/tracing/node.d.ts.map +1 -0
  368. package/dist/tracing/node.js +142 -0
  369. package/dist/tracing/node.js.map +1 -0
  370. package/dist/tsconfig.build.tsbuildinfo +1 -0
  371. package/dist/types/mod.d.ts +43 -0
  372. package/dist/types/mod.d.ts.map +1 -0
  373. package/dist/types/mod.js +65 -0
  374. package/dist/types/mod.js.map +1 -0
  375. package/frontends/mod.test.ts +51 -0
  376. package/frontends/mod.ts +50 -0
  377. package/gateway/errors.ts +172 -0
  378. package/gateway/gateway.e2e.test.ts +297 -0
  379. package/gateway/gateway.test.ts +891 -0
  380. package/gateway/match.ts +239 -0
  381. package/gateway/middleware.ts +134 -0
  382. package/gateway/mod.ts +211 -0
  383. package/gateway/request.ts +578 -0
  384. package/gateway/serve.ts +738 -0
  385. package/gateways/mod.ts +60 -0
  386. package/internal/clients/call.ts +418 -0
  387. package/internal/clients/grpc.test.ts +664 -0
  388. package/internal/clients/grpc.ts +485 -0
  389. package/internal/clients/mod.test.ts +481 -0
  390. package/internal/clients/mod.ts +337 -0
  391. package/internal/fetch.ts +305 -0
  392. package/internal/otel/backend.ts +60 -0
  393. package/internal/otel/context.test.ts +70 -0
  394. package/internal/otel/context.ts +48 -0
  395. package/internal/otel/context_manager.test.ts +154 -0
  396. package/internal/otel/context_manager.ts +141 -0
  397. package/internal/otel/encode.test.ts +266 -0
  398. package/internal/otel/encode.ts +408 -0
  399. package/internal/otel/http.ts +92 -0
  400. package/internal/otel/index.ts +14 -0
  401. package/internal/otel/meter.test.ts +231 -0
  402. package/internal/otel/meter.ts +332 -0
  403. package/internal/otel/propagator.test.ts +105 -0
  404. package/internal/otel/propagator.ts +68 -0
  405. package/internal/otel/provider.ts +26 -0
  406. package/internal/otel/span.ts +281 -0
  407. package/internal/otel/tracer.test.ts +380 -0
  408. package/internal/otel/tracer.ts +111 -0
  409. package/internal/reqfields.ts +423 -0
  410. package/internal/runtime/meter.ts +26 -0
  411. package/internal/runtime/mod.ts +81 -0
  412. package/internal/runtime/napi/napi.cjs +308 -0
  413. package/internal/runtime/napi/napi.d.cts +1251 -0
  414. package/internal/runtime/shutdown.test.ts +457 -0
  415. package/internal/runtime/shutdown.ts +350 -0
  416. package/internal/testing/carry.test.ts +242 -0
  417. package/internal/testing/carry.ts +101 -0
  418. package/internal/testing/runner.ts +10 -0
  419. package/internal/testing/scope.ts +384 -0
  420. package/internal/testing/steps.test.ts +152 -0
  421. package/internal/testing/steps.ts +342 -0
  422. package/internal/testing/telemetry.test.ts +210 -0
  423. package/internal/testing/telemetry.ts +466 -0
  424. package/internal/utils/constraints.ts +12 -0
  425. package/log/index.ts +107 -0
  426. package/log/logger.test.ts +194 -0
  427. package/log/logger.ts +308 -0
  428. package/log/runtime.test.ts +65 -0
  429. package/log/runtime.ts +40 -0
  430. package/log/stderr.test.ts +23 -0
  431. package/log/stderr.ts +24 -0
  432. package/metrics/export.test.ts +337 -0
  433. package/metrics/mod.test.ts +177 -0
  434. package/metrics/mod.ts +450 -0
  435. package/mod.ts +15 -0
  436. package/otel.test.ts +91 -0
  437. package/otel.ts +17 -0
  438. package/package.json +208 -5
  439. package/pubsub/encoding.ts +18 -0
  440. package/pubsub/mod.ts +26 -0
  441. package/pubsub/pubsub.test.ts +405 -0
  442. package/pubsub/refs.ts +38 -0
  443. package/pubsub/subscription.ts +359 -0
  444. package/pubsub/topic.test.ts +147 -0
  445. package/pubsub/topic.ts +431 -0
  446. package/reqctx/mod.ts +267 -0
  447. package/reqctx/reqctx.test.ts +216 -0
  448. package/scripts/postprocess-docs.test.ts +58 -0
  449. package/services/index.test.ts +370 -0
  450. package/services/index.ts +215 -0
  451. package/shutdown/mod.ts +78 -0
  452. package/storage/clickhouse/database.integration.test.ts +337 -0
  453. package/storage/clickhouse/database.test.ts +279 -0
  454. package/storage/clickhouse/database.ts +586 -0
  455. package/storage/clickhouse/errors.ts +130 -0
  456. package/storage/clickhouse/mod.ts +37 -0
  457. package/storage/objects/bucket.test.ts +573 -0
  458. package/storage/objects/bucket.ts +968 -0
  459. package/storage/objects/error.ts +121 -0
  460. package/storage/objects/mod.ts +50 -0
  461. package/storage/objects/refs.ts +117 -0
  462. package/storage/postgres/database.integration.test.ts +450 -0
  463. package/storage/postgres/database.test.ts +428 -0
  464. package/storage/postgres/database.ts +658 -0
  465. package/storage/postgres/errors.ts +186 -0
  466. package/storage/postgres/interval.test.ts +72 -0
  467. package/storage/postgres/interval.ts +170 -0
  468. package/storage/postgres/mod.ts +19 -0
  469. package/storage/redis/bitfield.ts +162 -0
  470. package/storage/redis/command.ts +84 -0
  471. package/storage/redis/commands.ts +1471 -0
  472. package/storage/redis/database.ts +520 -0
  473. package/storage/redis/mod.ts +171 -0
  474. package/storage/redis/native.ts +22 -0
  475. package/storage/redis/options.ts +119 -0
  476. package/storage/redis/pubsub.ts +92 -0
  477. package/storage/redis/redis.test.ts +866 -0
  478. package/storage/redis/reply.ts +780 -0
  479. package/storage/redis/runtime.test.ts +248 -0
  480. package/storage/redis/scan.ts +125 -0
  481. package/storage/redis/script.ts +162 -0
  482. package/storage/redis/target.ts +134 -0
  483. package/storage/redis/wire.ts +345 -0
  484. package/testing/bun.ts +13 -0
  485. package/testing/jest.ts +11 -0
  486. package/testing/mod.ts +393 -0
  487. package/testing/node.ts +12 -0
  488. package/testing/playwright.ts +247 -0
  489. package/testing/puppeteer.ts +101 -0
  490. package/testing/system.test.ts +108 -0
  491. package/testing/system.ts +373 -0
  492. package/testing/vitest.ts +13 -0
  493. package/tracing/http.ts +49 -0
  494. package/tracing/mod.ts +83 -0
  495. package/tracing/native.test.ts +272 -0
  496. package/tracing/node.ts +176 -0
  497. package/tracing/tracing.test.ts +953 -0
  498. package/types/mod.ts +92 -0
@@ -0,0 +1,21 @@
1
+ import * as runtime from '../../internal/runtime/mod.js';
2
+ import { currentScope } from '../../internal/testing/scope.js';
3
+ /**
4
+ * The native handle of the database `name`: where the SDK meets the runtime,
5
+ * and what its tests stand in for.
6
+ *
7
+ * @internal
8
+ */
9
+ export function openDatabase(name) {
10
+ return runtime.RT.redisDatabase(name);
11
+ }
12
+ /**
13
+ * The current test's instance of the database `name`, in test mode; `null`
14
+ * for the process's own.
15
+ *
16
+ * @internal
17
+ */
18
+ export function testDatabase(name) {
19
+ return currentScope()?.redisDatabase(name) ?? null;
20
+ }
21
+ //# sourceMappingURL=native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.js","sourceRoot":"","sources":["../../../storage/redis/native.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,OAAO,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,YAAY,EAAE,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACrD,CAAC"}
@@ -0,0 +1,90 @@
1
+ import type { RedisArg } from './wire.js';
2
+ /**
3
+ * When a key `setOptions` sets expires: in seconds (`ex`) or milliseconds
4
+ * (`px`), at a Unix time in seconds (`exAt`) or milliseconds (`pxAt`), or
5
+ * keeping the expiry it has.
6
+ */
7
+ export type SetExpiry = {
8
+ ex: number;
9
+ } | {
10
+ px: number;
11
+ } | {
12
+ exAt: number;
13
+ } | {
14
+ pxAt: number;
15
+ } | {
16
+ keepTtl: true;
17
+ };
18
+ /** How `setOptions` sets a key. */
19
+ export interface SetOptions {
20
+ /**
21
+ * When to set the key: only if it does not exist (`"nx"`), or only if it
22
+ * does (`"xx"`).
23
+ */
24
+ condition?: 'nx' | 'xx';
25
+ /** Reply with the key's old value, or nil if it had none. */
26
+ get?: boolean;
27
+ /**
28
+ * When the key expires. Without one it never does, and loses any expiry it
29
+ * had.
30
+ */
31
+ expiry?: SetExpiry;
32
+ }
33
+ /**
34
+ * How `getEx` changes a key's expiry: as {@link SetExpiry} says, or removing
35
+ * it.
36
+ */
37
+ export type Expiry = {
38
+ ex: number;
39
+ } | {
40
+ px: number;
41
+ } | {
42
+ exAt: number;
43
+ } | {
44
+ pxAt: number;
45
+ } | {
46
+ persist: true;
47
+ };
48
+ /** An end of a list: its head, or its tail. */
49
+ export type Direction = 'left' | 'right';
50
+ /** A unit of distance: meters, kilometers, miles or feet. */
51
+ export type Unit = 'm' | 'km' | 'mi' | 'ft';
52
+ /** What a radius search returns of each member it finds, and how many. */
53
+ export interface RadiusOptions {
54
+ /** Return each member's position. */
55
+ withCoord?: boolean;
56
+ /** Return each member's distance from the center. */
57
+ withDist?: boolean;
58
+ /** Return each member's geohash, as an integer. */
59
+ withHash?: boolean;
60
+ /** The most members to return. */
61
+ count?: number;
62
+ /** The nearest first (`"asc"`), or the farthest. In no order without. */
63
+ order?: 'asc' | 'desc';
64
+ }
65
+ /**
66
+ * The most entries a stream is trimmed to: exactly `maxlen`, or with `approx`
67
+ * about that many, never fewer, which is cheaper.
68
+ */
69
+ export interface StreamMaxlen {
70
+ maxlen: number;
71
+ approx?: boolean;
72
+ }
73
+ /** What a scan looks through, and how much at a time. */
74
+ export interface ScanOptions {
75
+ /** Only what matches a glob-style pattern: `user:*`. */
76
+ pattern?: string;
77
+ /** A hint for how many elements to look at per round trip. */
78
+ count?: number;
79
+ }
80
+ /** @internal */
81
+ export declare function expiryArgs(expiry: SetExpiry | Expiry): RedisArg[];
82
+ /** @internal */
83
+ export declare function setArgs(options: SetOptions): RedisArg[];
84
+ /** @internal */
85
+ export declare function directionArg(d: Direction): string;
86
+ /** @internal */
87
+ export declare function radiusArgs(options?: RadiusOptions): RedisArg[];
88
+ /** @internal */
89
+ export declare function maxlenArgs(m: StreamMaxlen): RedisArg[];
90
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../storage/redis/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,SAAS,GACjB;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,GACZ;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,GACZ;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GACd;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GACd;IAAC,OAAO,EAAE,IAAI,CAAA;CAAC,CAAC;AAEpB,mCAAmC;AACnC,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,6DAA6D;IAC7D,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,MAAM,MAAM,GACd;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,GACZ;IAAC,EAAE,EAAE,MAAM,CAAA;CAAC,GACZ;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GACd;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GACd;IAAC,OAAO,EAAE,IAAI,CAAA;CAAC,CAAC;AAEpB,+CAA+C;AAC/C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC,6DAA6D;AAC7D,MAAM,MAAM,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,0EAA0E;AAC1E,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,yDAAyD;AACzD,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,EAAE,CAOjE;AAED,gBAAgB;AAChB,wBAAgB,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,QAAQ,EAAE,CAOvD;AAED,gBAAgB;AAChB,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED,gBAAgB;AAChB,wBAAgB,UAAU,CAAC,OAAO,GAAE,aAAkB,GAAG,QAAQ,EAAE,CASlE;AAED,gBAAgB;AAChB,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,QAAQ,EAAE,CAEtD"}
@@ -0,0 +1,53 @@
1
+ /** @internal */
2
+ export function expiryArgs(expiry) {
3
+ if ('ex' in expiry)
4
+ return ['EX', expiry.ex];
5
+ if ('px' in expiry)
6
+ return ['PX', expiry.px];
7
+ if ('exAt' in expiry)
8
+ return ['EXAT', expiry.exAt];
9
+ if ('pxAt' in expiry)
10
+ return ['PXAT', expiry.pxAt];
11
+ if ('keepTtl' in expiry)
12
+ return ['KEEPTTL'];
13
+ return ['PERSIST'];
14
+ }
15
+ /** @internal */
16
+ export function setArgs(options) {
17
+ const out = [];
18
+ if (options.condition === 'nx')
19
+ out.push('NX');
20
+ if (options.condition === 'xx')
21
+ out.push('XX');
22
+ if (options.get)
23
+ out.push('GET');
24
+ if (options.expiry)
25
+ out.push(...expiryArgs(options.expiry));
26
+ return out;
27
+ }
28
+ /** @internal */
29
+ export function directionArg(d) {
30
+ return d === 'right' ? 'RIGHT' : 'LEFT';
31
+ }
32
+ /** @internal */
33
+ export function radiusArgs(options = {}) {
34
+ const out = [];
35
+ if (options.withCoord)
36
+ out.push('WITHCOORD');
37
+ if (options.withDist)
38
+ out.push('WITHDIST');
39
+ if (options.withHash)
40
+ out.push('WITHHASH');
41
+ if (options.count)
42
+ out.push('COUNT', options.count);
43
+ if (options.order === 'asc')
44
+ out.push('ASC');
45
+ if (options.order === 'desc')
46
+ out.push('DESC');
47
+ return out;
48
+ }
49
+ /** @internal */
50
+ export function maxlenArgs(m) {
51
+ return ['MAXLEN', m.approx ? '~' : '=', m.maxlen];
52
+ }
53
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../storage/redis/options.ts"],"names":[],"mappings":"AA8EA,gBAAgB;AAChB,MAAM,UAAU,UAAU,CAAC,MAA0B;IACnD,IAAI,IAAI,IAAI,MAAM;QAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7C,IAAI,IAAI,IAAI,MAAM;QAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7C,IAAI,MAAM,IAAI,MAAM;QAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,MAAM,IAAI,MAAM;QAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,SAAS,IAAI,MAAM;QAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5C,OAAO,CAAC,SAAS,CAAC,CAAC;AACrB,CAAC;AAED,gBAAgB;AAChB,MAA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AC,CAAC;IAC/C,OAAO,GAAG,CAAC;AACb,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,UAAU,CAAC,CAAe;IACxC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,55 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ import type * as runtime from '../../internal/runtime/mod.js';
5
+ import type { Target } from './target.js';
6
+ /**
7
+ * A message received on a {@link Subscription}.
8
+ */
9
+ export declare class Message {
10
+ /** The channel it was published to. */
11
+ readonly channel: string;
12
+ /** What was published, as it was sent. */
13
+ readonly payload: Buffer;
14
+ /** @internal */
15
+ constructor(
16
+ /** The channel it was published to. */
17
+ channel: string,
18
+ /** What was published, as it was sent. */
19
+ payload: Buffer);
20
+ /** The payload as UTF-8 text. */
21
+ text(): string;
22
+ /** The payload's text, parsed as JSON. */
23
+ json<T = unknown>(): T;
24
+ }
25
+ /**
26
+ * An open subscription, on a connection of its own: Redis's own channel
27
+ * messaging, where a message reaches whoever is subscribed at that moment and
28
+ * nobody else. For messages that are kept until they are handled, use
29
+ * `@encore.dev/sdk/pubsub`.
30
+ *
31
+ * Iterate over it for its messages. Close it when done with it, which closes
32
+ * its connection and unsubscribes; leaving a `for await` loop over it early
33
+ * closes it too.
34
+ *
35
+ * ```ts
36
+ * const sub = await EVENTS.pubsub.subscribe("orders");
37
+ * for await (const message of sub) {
38
+ * console.log(message.channel, message.text());
39
+ * }
40
+ * ```
41
+ */
42
+ export declare class Subscription implements AsyncIterable<Message>, AsyncDisposable {
43
+ private readonly impl;
44
+ /** @internal */
45
+ constructor(impl: runtime.RedisSubscription);
46
+ /** The next message, or `null` once the subscription is closed. */
47
+ next(): Promise<Message | null>;
48
+ [Symbol.asyncIterator](): AsyncGenerator<Message>;
49
+ /** Closes the subscription. Safe to call more than once. */
50
+ close(): Promise<void>;
51
+ [Symbol.asyncDispose](): Promise<void>;
52
+ }
53
+ /** Subscribes to `channels` and to the channels matching `patterns`. */
54
+ export declare function subscribe(t: Target, channels: string[], patterns: string[]): Promise<Subscription>;
55
+ //# sourceMappingURL=pubsub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pubsub.d.ts","sourceRoot":"","sources":["../../../storage/redis/pubsub.ts"],"names":[],"mappings":";;;AACA,OAAO,KAAK,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAGrC;;GAEG;AACH,qBAAa,OAAO;IAGhB,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM;IAL1B,gBAAgB;;IAEd,uCAAuC;IAC9B,OAAO,EAAE,MAAM;IACxB,0CAA0C;IACjC,OAAO,EAAE,MAAM;IAG1B,iCAAiC;IACjC,IAAI,IAAI,MAAM;IAId,0CAA0C;IAC1C,IAAI,CAAC,CAAC,GAAG,OAAO,KAAK,CAAC;CAGvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,YAAa,YAAW,aAAa,CAAC,OAAO,CAAC,EAAE,eAAe;IAE9D,OAAO,CAAC,QAAQ,CAAC,IAAI;IADjC,gBAAgB;gBACa,IAAI,EAAE,OAAO,CAAC,iBAAiB;IAE5D,mEAAmE;IAC7D,IAAI,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAM9B,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC;IAYxD,4DAA4D;IACtD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7C;AAED,wEAAwE;AACxE,wBAAsB,SAAS,CAC7B,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,YAAY,CAAC,CAQvB"}
@@ -0,0 +1,88 @@
1
+ import { activeCtxBytes } from '../../internal/otel/index.js';
2
+ import { encodeList } from './wire.js';
3
+ /**
4
+ * A message received on a {@link Subscription}.
5
+ */
6
+ export class Message {
7
+ channel;
8
+ payload;
9
+ /** @internal */
10
+ constructor(
11
+ /** The channel it was published to. */
12
+ channel,
13
+ /** What was published, as it was sent. */
14
+ payload) {
15
+ this.channel = channel;
16
+ this.payload = payload;
17
+ }
18
+ /** The payload as UTF-8 text. */
19
+ text() {
20
+ return this.payload.toString('utf8');
21
+ }
22
+ /** The payload's text, parsed as JSON. */
23
+ json() {
24
+ return JSON.parse(this.text());
25
+ }
26
+ }
27
+ /**
28
+ * An open subscription, on a connection of its own: Redis's own channel
29
+ * messaging, where a message reaches whoever is subscribed at that moment and
30
+ * nobody else. For messages that are kept until they are handled, use
31
+ * `@encore.dev/sdk/pubsub`.
32
+ *
33
+ * Iterate over it for its messages. Close it when done with it, which closes
34
+ * its connection and unsubscribes; leaving a `for await` loop over it early
35
+ * closes it too.
36
+ *
37
+ * ```ts
38
+ * const sub = await EVENTS.pubsub.subscribe("orders");
39
+ * for await (const message of sub) {
40
+ * console.log(message.channel, message.text());
41
+ * }
42
+ * ```
43
+ */
44
+ export class Subscription {
45
+ impl;
46
+ /** @internal */
47
+ constructor(impl) {
48
+ this.impl = impl;
49
+ }
50
+ /** The next message, or `null` once the subscription is closed. */
51
+ async next() {
52
+ const message = await this.impl.next();
53
+ if (message === null)
54
+ return null;
55
+ return new Message(message.channel.toString('utf8'), message.payload);
56
+ }
57
+ async *[Symbol.asyncIterator]() {
58
+ try {
59
+ for (;;) {
60
+ const message = await this.next();
61
+ if (message === null)
62
+ return;
63
+ yield message;
64
+ }
65
+ }
66
+ finally {
67
+ await this.close();
68
+ }
69
+ }
70
+ /** Closes the subscription. Safe to call more than once. */
71
+ async close() {
72
+ await this.impl.close();
73
+ }
74
+ async [Symbol.asyncDispose]() {
75
+ await this.close();
76
+ }
77
+ }
78
+ /** Subscribes to `channels` and to the channels matching `patterns`. */
79
+ export async function subscribe(t, channels, patterns) {
80
+ if (channels.length === 0 && patterns.length === 0) {
81
+ throw new TypeError('redis: subscribe to at least one channel or pattern');
82
+ }
83
+ const impl = await t
84
+ .database()
85
+ .subscribe(encodeList(channels), encodeList(patterns), activeCtxBytes());
86
+ return new Subscription(impl);
87
+ }
88
+ //# sourceMappingURL=pubsub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pubsub.js","sourceRoot":"","sources":["../../../storage/redis/pubsub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,OAAO;IAIP;IAEA;IALX,gBAAgB;IAChB;IACE,uCAAuC;IAC9B,OAAe;IACxB,0CAA0C;IACjC,OAAe;QAFf,YAAO,GAAP,OAAO,CAAQ;QAEf,YAAO,GAAP,OAAO,CAAQ;IACvB,CAAC;IAEJ,iCAAiC;IACjC,IAAI;QACF,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,0CAA0C;IAC1C,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAM,CAAC;IACtC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,YAAY;IAEM;IAD7B,gBAAgB;IAChB,YAA6B,IAA+B;QAA/B,SAAI,GAAJ,IAAI,CAA2B;IAAG,CAAC;IAEhE,mEAAmE;IACnE,KAAK,CAAC,IAAI;QACR,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC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
+ import { Value } from './wire.js';
4
+ /**
5
+ * A reply as plain values: what {@link Reply.value} returns. A string reply is
6
+ * text, an integer a `number` (a `bigint` past what a `number` holds exactly),
7
+ * a map an object keyed by its keys' text, with no prototype.
8
+ */
9
+ export type RedisValue = null | string | number | bigint | boolean | RedisValue[] | {
10
+ [key: string]: RedisValue;
11
+ };
12
+ /** A member of a sorted set, with its score. */
13
+ export interface ScoredMember {
14
+ member: string;
15
+ score: number;
16
+ }
17
+ /** A field of a hash, with its value. */
18
+ export interface FieldValue {
19
+ field: string;
20
+ value: string;
21
+ }
22
+ /** An entry of a stream: its id and its fields. */
23
+ export interface StreamEntry {
24
+ id: string;
25
+ fields: Record<string, string>;
26
+ }
27
+ /** The entries read from one stream. */
28
+ export interface Stream {
29
+ key: string;
30
+ entries: StreamEntry[];
31
+ }
32
+ /**
33
+ * The summary of what a consumer group has been given and not acknowledged,
34
+ * as `xpending` replies.
35
+ */
36
+ export interface StreamPending {
37
+ /** How many entries are pending. */
38
+ count: number;
39
+ /** The lowest pending id: `null` when nothing is pending. */
40
+ lowest: string | null;
41
+ /** The highest pending id: `null` when nothing is pending. */
42
+ highest: string | null;
43
+ /** The consumers with pending entries, and how many each has. */
44
+ consumers: {
45
+ name: string;
46
+ pending: number;
47
+ }[];
48
+ }
49
+ /** What the server knows about a stream, as `xinfoStream` replies. */
50
+ export interface StreamInfo {
51
+ length: number;
52
+ radixTreeKeys: number;
53
+ radixTreeNodes: number;
54
+ groups: number;
55
+ lastGeneratedId: string;
56
+ /** `null` for an empty stream. */
57
+ firstEntry: StreamEntry | null;
58
+ /** `null` for an empty stream. */
59
+ lastEntry: StreamEntry | null;
60
+ }
61
+ /** What `xautoclaim` replies. */
62
+ export interface StreamAutoClaim {
63
+ /**
64
+ * The id to pass as the next call's start, or `"0-0"` when the scan of
65
+ * pending entries is done.
66
+ */
67
+ next: string;
68
+ /** The entries now held by the consumer. */
69
+ claimed: StreamEntry[];
70
+ /** The ids of pending entries that no longer exist. */
71
+ deleted: string[];
72
+ }
73
+ /**
74
+ * What a blocking pop of one element replies: the key it came from, without
75
+ * the database's prefix, and the element.
76
+ */
77
+ export interface Popped {
78
+ key: string;
79
+ value: Reply;
80
+ }
81
+ /** What a blocking pop of several elements replies, in the order popped. */
82
+ export interface PoppedMany {
83
+ key: string;
84
+ values: Reply[];
85
+ }
86
+ /** What a blocking pop of a sorted set's member replies. */
87
+ export interface PoppedScored {
88
+ key: string;
89
+ member: Reply;
90
+ score: number;
91
+ }
92
+ /** What a blocking pop of several of a sorted set's members replies. */
93
+ export interface PoppedScoredMany {
94
+ key: string;
95
+ members: {
96
+ member: Reply;
97
+ score: number;
98
+ }[];
99
+ }
100
+ /** A position on Earth. */
101
+ export interface GeoPosition {
102
+ longitude: number;
103
+ latitude: number;
104
+ }
105
+ /** A member found by a radius search, with what the search asked for of it. */
106
+ export interface GeoRadiusResult {
107
+ name: string;
108
+ /** The distance from the center, with `withDist`. */
109
+ dist?: number;
110
+ /** The member's geohash as an integer, with `withHash`. */
111
+ hash?: bigint;
112
+ /** The member's position, with `withCoord`. */
113
+ coord?: GeoPosition;
114
+ }
115
+ export declare function textOf(v: Value): string;
116
+ export declare function numberOf(v: Value): number;
117
+ /** An array reply's elements; a map's keys and values in turn; none for nil. */
118
+ export declare function arrayOf(v: Value): Value[];
119
+ /** The members of a sorted set with their scores, nested in pairs or flat. */
120
+ export declare function scoredMembersOf(items: Value[]): ScoredMember[];
121
+ /**
122
+ * What Redis replied to a command, or the error the command failed with. Read
123
+ * it as what it holds: {@link Reply.text}, {@link Reply.number},
124
+ * {@link Reply.textMap}, …; each throws the command's error if it failed, and
125
+ * reads a nil reply as `null`.
126
+ */
127
+ export declare class Reply {
128
+ private readonly reply;
129
+ private readonly err?;
130
+ /** @internal */
131
+ constructor(reply: Value, err?: Error | undefined);
132
+ /** @internal A reply for a command that could not be sent. */
133
+ static failed(err: unknown): Reply;
134
+ /** The error the command failed with, if it did. A nil reply is not one. */
135
+ get error(): Error | undefined;
136
+ /** Whether the command succeeded and replied nil. */
137
+ isNull(): boolean;
138
+ /** The reply, or the error it failed with, thrown. */
139
+ private get v();
140
+ /** The reply as plain values. */
141
+ value(): RedisValue;
142
+ /** The reply as text: a string's bytes as UTF-8, or a number's digits. */
143
+ text(): string | null;
144
+ /** The reply as bytes. */
145
+ bytes(): Buffer | null;
146
+ /**
147
+ * The reply as a number, parsing a string that holds one. An integer past
148
+ * what a `number` holds exactly is rounded: read it with
149
+ * {@link Reply.bigint}.
150
+ */
151
+ number(): number | null;
152
+ /** The reply as an integer, parsing a string that holds one. */
153
+ bigint(): bigint | null;
154
+ /** The reply as a boolean: an integer is true unless 0, and `OK` is true. */
155
+ bool(): boolean | null;
156
+ /** The reply's text, parsed as JSON. */
157
+ json<T = unknown>(): T | null;
158
+ /** An array reply as each of its elements, to read each as what it holds. */
159
+ replies(): Reply[];
160
+ /**
161
+ * An array reply as text. A nil element throws; to tell missing elements
162
+ * apart, use {@link Reply.optionalTexts}.
163
+ */
164
+ texts(): string[];
165
+ /**
166
+ * An array reply as text, a nil element as `null`: what `mget` and `hmget`
167
+ * reply for a missing key or field.
168
+ */
169
+ optionalTexts(): (string | null)[];
170
+ /** An array reply as numbers. */
171
+ numbers(): number[];
172
+ /** An array reply as booleans. */
173
+ bools(): boolean[];
174
+ /**
175
+ * A map reply, or an array of keys and values in turn, as an object: what
176
+ * `hgetall` replies. The object has no prototype, so each field is its own
177
+ * key, `__proto__` too.
178
+ */
179
+ textMap(): Record<string, string>;
180
+ /**
181
+ * The members of a sorted set with their scores, as `zrangeWithscores` and
182
+ * `zpopmin` reply.
183
+ */
184
+ scoredMembers(): ScoredMember[];
185
+ /**
186
+ * The entries of a stream, as `xrange`, `xrevrange` and `xclaim` reply.
187
+ */
188
+ streamEntries(): StreamEntry[];
189
+ /**
190
+ * The entries read from each stream, as `xread` and `xreadGroup` reply. A
191
+ * read that found nothing is no streams.
192
+ */
193
+ streams(): Stream[];
194
+ /** The reply of `xpending`. */
195
+ streamPending(): StreamPending;
196
+ /** The reply of `xinfoStream`. */
197
+ streamInfo(): StreamInfo;
198
+ /** The reply of `xautoclaim`. */
199
+ streamAutoClaim(): StreamAutoClaim;
200
+ /** The position of each member, a missing one as `null`, as `geoPos` replies. */
201
+ geoPositions(): (GeoPosition | null)[];
202
+ /** The members a radius search found, as `geoRadius` replies. */
203
+ geoRadius(): GeoRadiusResult[];
204
+ }
205
+ /**
206
+ * A command's reply, on its way. Await it for the {@link Reply}, which
207
+ * rejects if the command failed; or read it as what it holds straight away:
208
+ *
209
+ * ```ts
210
+ * const name = await SESSIONS.string.get("name:1").text();
211
+ * ```
212
+ *
213
+ * The command is sent when it is called, whether or not this is awaited.
214
+ */
215
+ export declare class ReplyPromise implements PromiseLike<Reply> {
216
+ private readonly reply;
217
+ /** @internal */
218
+ constructor(reply: Promise<Reply>);
219
+ then<T = Reply, E = never>(onfulfilled?: ((value: Reply) => T | PromiseLike<T>) | null, onrejected?: ((reason: unknown) => E | PromiseLike<E>) | null): Promise<T | E>;
220
+ catch<E = never>(onrejected?: ((reason: unknown) => E | PromiseLike<E>) | null): Promise<Reply | E>;
221
+ finally(onfinally?: (() => void) | null): Promise<Reply>;
222
+ /** See {@link Reply.value}. */
223
+ value(): Promise<RedisValue>;
224
+ /** See {@link Reply.text}. */
225
+ text(): Promise<string | null>;
226
+ /** See {@link Reply.bytes}. */
227
+ bytes(): Promise<Buffer | null>;
228
+ /** See {@link Reply.number}. */
229
+ number(): Promise<number | null>;
230
+ /** See {@link Reply.bigint}. */
231
+ bigint(): Promise<bigint | null>;
232
+ /** See {@link Reply.bool}. */
233
+ bool(): Promise<boolean | null>;
234
+ /** See {@link Reply.json}. */
235
+ json<T = unknown>(): Promise<T | null>;
236
+ /** See {@link Reply.replies}. */
237
+ replies(): Promise<Reply[]>;
238
+ /** See {@link Reply.texts}. */
239
+ texts(): Promise<string[]>;
240
+ /** See {@link Reply.optionalTexts}. */
241
+ optionalTexts(): Promise<(string | null)[]>;
242
+ /** See {@link Reply.numbers}. */
243
+ numbers(): Promise<number[]>;
244
+ /** See {@link Reply.bools}. */
245
+ bools(): Promise<boolean[]>;
246
+ /** See {@link Reply.textMap}. */
247
+ textMap(): Promise<Record<string, string>>;
248
+ /** See {@link Reply.scoredMembers}. */
249
+ scoredMembers(): Promise<ScoredMember[]>;
250
+ /** See {@link Reply.streamEntries}. */
251
+ streamEntries(): Promise<StreamEntry[]>;
252
+ /** See {@link Reply.streams}. */
253
+ streams(): Promise<Stream[]>;
254
+ /** See {@link Reply.streamPending}. */
255
+ streamPending(): Promise<StreamPending>;
256
+ /** See {@link Reply.streamInfo}. */
257
+ streamInfo(): Promise<StreamInfo>;
258
+ /** See {@link Reply.streamAutoClaim}. */
259
+ streamAutoClaim(): Promise<StreamAutoClaim>;
260
+ /** See {@link Reply.geoPositions}. */
261
+ geoPositions(): Promise<(GeoPosition | null)[]>;
262
+ /** See {@link Reply.geoRadius}. */
263
+ geoRadius(): Promise<GeoRadiusResult[]>;
264
+ }
265
+ /**
266
+ * The error a pipeline or a transaction fails with when the server rejected
267
+ * some of its commands. The others ran: Redis has no rollback.
268
+ */
269
+ export declare class BatchError extends Error {
270
+ /** Every command's reply, in the order queued, each holding its own error. */
271
+ readonly replies: Reply[];
272
+ /** @internal */
273
+ constructor(replies: Reply[], first: Error);
274
+ }
275
+ /** Converters for the commands whose reply has one shape. */
276
+ export declare const as: {
277
+ /** The reply, for the caller to read. */
278
+ reply: (v: Value) => Reply;
279
+ none: (v: Value) => void;
280
+ number: (v: Value) => number;
281
+ optionalNumber: (v: Value) => number | null;
282
+ bool: (v: Value) => boolean;
283
+ text: (v: Value) => string;
284
+ bools: (v: Value) => boolean[];
285
+ popped: (v: Value) => Popped | null;
286
+ poppedMany: (v: Value) => PoppedMany | null;
287
+ poppedScored: (v: Value) => PoppedScored | null;
288
+ poppedScoredMany: (v: Value) => PoppedScoredMany | null;
289
+ };
290
+ //# sourceMappingURL=reply.d.ts.map
@@ -0,0 +1 @@
1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