zeed 1.3.1 → 1.5.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 (229) hide show
  1. package/AGENTS.md +50 -211
  2. package/README.md +16 -0
  3. package/dist/_experiments/bitcask.cjs +2 -2
  4. package/dist/{args-FLoL3OKJ.d.cts → args-CEjib9V9.d.mts} +1 -1
  5. package/dist/{args-WC9q5kz2.d.mts → args-DEig-jw4.d.cts} +1 -1
  6. package/dist/{clipboard-BkUO-syY.d.mts → clipboard-BusqmLLY.d.cts} +1 -1
  7. package/dist/{clipboard-Cfpr331X.d.cts → clipboard-DcuuFRwa.d.mts} +1 -1
  8. package/dist/common/exec/index.d.cts +3 -3
  9. package/dist/common/exec/index.d.mts +3 -3
  10. package/dist/common/exec/pool.d.cts +1 -1
  11. package/dist/common/exec/pool.d.mts +1 -1
  12. package/dist/common/exec/progress.d.cts +1 -1
  13. package/dist/common/exec/progress.d.mts +1 -1
  14. package/dist/common/exec/promise.d.cts +1 -1
  15. package/dist/common/exec/promise.d.mts +1 -1
  16. package/dist/common/exec/queue.d.cts +1 -1
  17. package/dist/common/exec/queue.d.mts +1 -1
  18. package/dist/common/exec/throttle-debounce.d.cts +1 -1
  19. package/dist/common/exec/throttle-debounce.d.mts +1 -1
  20. package/dist/common/index.cjs +21 -0
  21. package/dist/common/index.d.cts +15 -12
  22. package/dist/common/index.d.mts +16 -13
  23. package/dist/common/index.mjs +4 -1
  24. package/dist/common/msg/channel-debug.d.cts +1 -1
  25. package/dist/common/msg/channel-debug.d.mts +1 -1
  26. package/dist/common/msg/channel-local.d.cts +1 -1
  27. package/dist/common/msg/channel-local.d.mts +1 -1
  28. package/dist/common/msg/channel-resilient.d.cts +1 -1
  29. package/dist/common/msg/channel-resilient.d.mts +1 -1
  30. package/dist/common/msg/channel-wkwebview.d.cts +2 -1
  31. package/dist/common/msg/channel-wkwebview.d.mts +2 -1
  32. package/dist/common/msg/channel.d.cts +1 -1
  33. package/dist/common/msg/channel.d.mts +1 -1
  34. package/dist/common/msg/emitter.d.cts +1 -1
  35. package/dist/common/msg/emitter.d.mts +1 -1
  36. package/dist/common/msg/index.d.cts +1 -1
  37. package/dist/common/msg/index.d.mts +1 -1
  38. package/dist/common/msg/messages.d.cts +1 -1
  39. package/dist/common/msg/messages.d.mts +1 -1
  40. package/dist/common/msg/pubsub.d.cts +1 -1
  41. package/dist/common/msg/pubsub.d.mts +1 -1
  42. package/dist/common/msg/rpc.cjs +8 -8
  43. package/dist/common/msg/rpc.cjs.map +1 -1
  44. package/dist/common/msg/rpc.mjs +8 -8
  45. package/dist/common/msg/rpc.mjs.map +1 -1
  46. package/dist/common/schema/export-json-schema.cjs +40 -31
  47. package/dist/common/schema/export-json-schema.cjs.map +1 -1
  48. package/dist/common/schema/export-json-schema.mjs +40 -31
  49. package/dist/common/schema/export-json-schema.mjs.map +1 -1
  50. package/dist/common/schema/index.cjs +21 -0
  51. package/dist/common/schema/index.d.cts +6 -3
  52. package/dist/common/schema/index.d.mts +7 -4
  53. package/dist/common/schema/index.mjs +4 -1
  54. package/dist/common/schema/sql/expr.cjs +128 -0
  55. package/dist/common/schema/sql/expr.cjs.map +1 -0
  56. package/dist/common/schema/sql/expr.d.cts +2 -0
  57. package/dist/common/schema/sql/expr.d.mts +2 -0
  58. package/dist/common/schema/sql/expr.mjs +115 -0
  59. package/dist/common/schema/sql/expr.mjs.map +1 -0
  60. package/dist/common/schema/sql/index.cjs +23 -0
  61. package/dist/common/schema/sql/index.d.cts +4 -0
  62. package/dist/common/schema/sql/index.d.mts +4 -0
  63. package/dist/common/schema/sql/index.mjs +5 -0
  64. package/dist/common/schema/sql/select.cjs +143 -0
  65. package/dist/common/schema/sql/select.cjs.map +1 -0
  66. package/dist/common/schema/sql/select.d.cts +2 -0
  67. package/dist/common/schema/sql/select.d.mts +2 -0
  68. package/dist/common/schema/sql/select.mjs +139 -0
  69. package/dist/common/schema/sql/select.mjs.map +1 -0
  70. package/dist/common/schema/sql/table.cjs +23 -0
  71. package/dist/common/schema/sql/table.cjs.map +1 -0
  72. package/dist/common/schema/sql/table.d.cts +2 -0
  73. package/dist/common/schema/sql/table.d.mts +2 -0
  74. package/dist/common/schema/sql/table.mjs +20 -0
  75. package/dist/common/schema/sql/table.mjs.map +1 -0
  76. package/dist/common/schema/type-test.d.cts +1 -1
  77. package/dist/common/schema/type-test.d.mts +1 -1
  78. package/dist/common/schema/utils.d.cts +1 -1
  79. package/dist/common/schema/utils.d.mts +1 -1
  80. package/dist/common/schema/z.d.mts +1 -1
  81. package/dist/common/storage/index.d.cts +1 -1
  82. package/dist/common/storage/index.d.mts +1 -1
  83. package/dist/common/storage/memstorage.d.cts +1 -1
  84. package/dist/common/storage/memstorage.d.mts +1 -1
  85. package/dist/common/test.d.cts +1 -1
  86. package/dist/common/test.d.mts +1 -1
  87. package/dist/common/time.d.cts +1 -1
  88. package/dist/common/time.d.mts +1 -1
  89. package/dist/common/timeout.d.cts +1 -1
  90. package/dist/common/timeout.d.mts +1 -1
  91. package/dist/common/utils.d.cts +1 -1
  92. package/dist/common/utils.d.mts +1 -1
  93. package/dist/common/uuid.d.cts +1 -1
  94. package/dist/common/uuid.d.mts +1 -1
  95. package/dist/{crypto-CyTV7Qce.d.cts → crypto-D68rVmvU.d.mts} +1 -1
  96. package/dist/{crypto-LT7EC5_d.d.mts → crypto-KzGHoCJE.d.cts} +1 -1
  97. package/dist/{env-B3vOiVY8.d.cts → env-BJXdwBKq.d.mts} +1 -1
  98. package/dist/{env-C3npYe8w.d.mts → env-HsOnA_yK.d.cts} +1 -1
  99. package/dist/expr-CCKrqOw1.d.mts +25 -0
  100. package/dist/expr-yYgSeBZ3.d.cts +25 -0
  101. package/dist/{files-CDNKX9VI.d.mts → files-4O-PxnAC.d.cts} +1 -1
  102. package/dist/{files-DdI9UZvg.d.cts → files-BlpxqSTT.d.mts} +1 -1
  103. package/dist/{files-async-1V0bu_ca.d.cts → files-async-DFLC-Nkd.d.cts} +1 -1
  104. package/dist/{files-async-cBMkRwsu.d.mts → files-async-DfuEEDjH.d.mts} +1 -1
  105. package/dist/{filestorage-CXQ9MzeW.d.cts → filestorage-BjeBZEAs.d.cts} +1 -1
  106. package/dist/{filestorage-YzM2z9sU.d.mts → filestorage-CmfztpWm.d.mts} +1 -1
  107. package/dist/{fs-DHJ9AqUk.d.cts → fs-D837bjRT.d.cts} +1 -1
  108. package/dist/{fs-DgjZdpuF.d.mts → fs-DlYLapik.d.mts} +1 -1
  109. package/dist/{glob-Bfs7ZS_i.d.mts → glob-5yW09dkR.d.mts} +1 -1
  110. package/dist/{glob-Bt150jOY.d.cts → glob-CZaZPqiy.d.cts} +1 -1
  111. package/dist/{index-DHXVOH8h.d.cts → index-CFkMqHvX.d.cts} +1 -2
  112. package/dist/{index-DMaPyx9O.d.mts → index-C_3Y_s6f.d.mts} +1 -2
  113. package/dist/index.all.cjs +21 -0
  114. package/dist/index.all.d.cts +29 -26
  115. package/dist/index.all.d.mts +30 -27
  116. package/dist/index.all.mjs +4 -1
  117. package/dist/index.browser.cjs +21 -0
  118. package/dist/index.browser.d.cts +15 -12
  119. package/dist/index.browser.d.mts +16 -13
  120. package/dist/index.browser.mjs +4 -1
  121. package/dist/index.jsr.d.cts +4 -4
  122. package/dist/index.jsr.d.mts +4 -4
  123. package/dist/index.node.cjs +21 -0
  124. package/dist/index.node.d.cts +29 -26
  125. package/dist/index.node.d.mts +30 -27
  126. package/dist/index.node.mjs +4 -1
  127. package/dist/{log-file-bsTsc9KM.d.cts → log-file-DwEDms1F.d.cts} +2 -2
  128. package/dist/{log-file-DTuImomJ.d.mts → log-file-QV1unm3z.d.mts} +2 -2
  129. package/dist/{log-file-rotation-_YruAcNc.d.cts → log-file-rotation-BpZxXYlU.d.cts} +2 -2
  130. package/dist/{log-file-rotation-FBmtp_Uz.d.mts → log-file-rotation-DanrO_2y.d.mts} +2 -2
  131. package/dist/{log-node-DlrXl3QO.d.mts → log-node-BSn7RqAc.d.mts} +1 -1
  132. package/dist/{log-node-Dk948mHX.d.cts → log-node-D_fiJL6x.d.cts} +1 -1
  133. package/dist/{log-rotation-CkyjZbK5.d.mts → log-rotation-BdGakFya.d.cts} +1 -1
  134. package/dist/{log-rotation-_d7iRm9s.d.cts → log-rotation-Ce4e-8LN.d.mts} +1 -1
  135. package/dist/{log-util-2Ls76P-0.d.cts → log-util-C0U3zCjw.d.cts} +1 -1
  136. package/dist/{log-util-Da_d19f8.d.mts → log-util-Da_UCcmt.d.mts} +1 -1
  137. package/dist/{memstorage-D5A9FwiP.d.mts → memstorage-BhWXthO8.d.mts} +1 -1
  138. package/dist/{memstorage-BcjQLdaQ.d.cts → memstorage-tvlWDYgS.d.cts} +1 -1
  139. package/dist/node/args.cjs +1 -1
  140. package/dist/node/args.d.cts +1 -1
  141. package/dist/node/args.d.mts +1 -1
  142. package/dist/node/clipboard.d.cts +1 -1
  143. package/dist/node/clipboard.d.mts +1 -1
  144. package/dist/node/crypto.cjs +1 -1
  145. package/dist/node/crypto.d.cts +1 -1
  146. package/dist/node/crypto.d.mts +1 -1
  147. package/dist/node/env.cjs +2 -2
  148. package/dist/node/env.d.cts +1 -1
  149. package/dist/node/env.d.mts +1 -1
  150. package/dist/node/files-async.cjs +1 -1
  151. package/dist/node/files-async.d.cts +1 -1
  152. package/dist/node/files-async.d.mts +1 -1
  153. package/dist/node/files.cjs +1 -1
  154. package/dist/node/files.d.cts +1 -1
  155. package/dist/node/files.d.mts +1 -1
  156. package/dist/node/filestorage.cjs +1 -1
  157. package/dist/node/filestorage.d.cts +1 -1
  158. package/dist/node/filestorage.d.mts +1 -1
  159. package/dist/node/fs.cjs +1 -1
  160. package/dist/node/fs.d.cts +1 -1
  161. package/dist/node/fs.d.mts +1 -1
  162. package/dist/node/glob.d.cts +1 -1
  163. package/dist/node/glob.d.mts +1 -1
  164. package/dist/node/index.d.cts +14 -14
  165. package/dist/node/index.d.mts +14 -14
  166. package/dist/node/log/index.d.cts +5 -5
  167. package/dist/node/log/index.d.mts +5 -5
  168. package/dist/node/log/log-context-node.cjs +1 -1
  169. package/dist/node/log/log-file-rotation.d.cts +1 -1
  170. package/dist/node/log/log-file-rotation.d.mts +1 -1
  171. package/dist/node/log/log-file.cjs +1 -1
  172. package/dist/node/log/log-file.d.cts +1 -1
  173. package/dist/node/log/log-file.d.mts +1 -1
  174. package/dist/node/log/log-node.cjs +6 -15
  175. package/dist/node/log/log-node.cjs.map +1 -1
  176. package/dist/node/log/log-node.d.cts +1 -1
  177. package/dist/node/log/log-node.d.mts +1 -1
  178. package/dist/node/log/log-node.mjs +4 -13
  179. package/dist/node/log/log-node.mjs.map +1 -1
  180. package/dist/node/log/log-rotation.cjs +1 -1
  181. package/dist/node/log/log-rotation.d.cts +1 -1
  182. package/dist/node/log/log-rotation.d.mts +1 -1
  183. package/dist/node/log/log-util.cjs +1 -1
  184. package/dist/node/log/log-util.d.cts +1 -1
  185. package/dist/node/log/log-util.d.mts +1 -1
  186. package/dist/{promise-DGgiRckN.d.cts → promise-CU_CENbU.d.cts} +1 -1
  187. package/dist/{promise-MH3xAy4S.d.mts → promise-CoWXgo4w.d.mts} +1 -1
  188. package/dist/select-DrciHdk_.d.cts +52 -0
  189. package/dist/select-F2KpP6mo.d.mts +52 -0
  190. package/dist/table-Cr8tjDIL.d.mts +19 -0
  191. package/dist/table-IkLXirT-.d.cts +19 -0
  192. package/dist/{test-CAhm15f4.d.mts → test-DcXa0MeX.d.cts} +1 -1
  193. package/dist/{test-D2plOVHF.d.cts → test-jZsc7P2c.d.mts} +1 -1
  194. package/dist/{throttle-debounce-BLFxAZ8W.d.mts → throttle-debounce-CCh0F100.d.mts} +1 -1
  195. package/dist/{throttle-debounce-Psb0ay1r.d.cts → throttle-debounce-DyFiyoAk.d.cts} +1 -1
  196. package/dist/{time-BfKJBbym.d.cts → time-BgFZe9ys.d.cts} +1 -1
  197. package/dist/{time-DxE-vjjw.d.mts → time-DSV_k3mG.d.mts} +1 -1
  198. package/dist/{timeout-CnUk6Ruj.d.mts → timeout-DDSSNZY8.d.mts} +1 -1
  199. package/dist/{timeout-CpFcK8MD.d.cts → timeout-E3ZQbJgK.d.cts} +1 -1
  200. package/dist/{type-test-BiKyEZkc.d.mts → type-test-BvzWDJz3.d.mts} +1 -1
  201. package/dist/{type-test-sM7QpfQU.d.cts → type-test-CBK-iJ9d.d.cts} +1 -1
  202. package/dist/{utils-B8DsVgFr.d.mts → utils-1RyCGkpQ.d.mts} +1 -1
  203. package/dist/{utils-BfZkD2Pt.d.mts → utils-6Culwiaf.d.cts} +1 -1
  204. package/dist/{utils-DHQBNh-Z.d.cts → utils-CDJihcg3.d.mts} +1 -1
  205. package/dist/{utils-Bctk_WhH.d.cts → utils-nCQklGHV.d.cts} +1 -1
  206. package/dist/{uuid-Cusm2nIK.d.cts → uuid-CKFZfSff.d.mts} +1 -1
  207. package/dist/{uuid-ININPGKB.d.mts → uuid-D42A8UdP.d.cts} +1 -1
  208. package/dist/z-C0fpNWZg.d.cts +1 -0
  209. package/dist/z-D_jezYmm.d.mts +1 -0
  210. package/dist/{z-collection-BmuBin--.d.mts → z-collection-BSfgRU0Q.d.mts} +1 -1
  211. package/package.json +17 -18
  212. package/src/common/schema/README.md +247 -66
  213. package/src/common/schema/export-json-schema.spec.ts +11 -7
  214. package/src/common/schema/export-json-schema.ts +59 -52
  215. package/src/common/schema/index.ts +1 -0
  216. package/src/common/schema/sql/README.md +254 -0
  217. package/src/common/schema/sql/expr.ts +99 -0
  218. package/src/common/schema/sql/index.ts +3 -0
  219. package/src/common/schema/sql/select.spec.ts +144 -0
  220. package/src/common/schema/sql/select.ts +207 -0
  221. package/src/common/schema/sql/table.ts +36 -0
  222. package/src/common/schema/README-SCHEMA.md +0 -0
  223. /package/dist/{index-BH1nuHdZ.d.cts → index-CIABef8t.d.mts} +0 -0
  224. /package/dist/{index-BL7o4fG9.d.cts → index-CliqZ9rj.d.mts} +0 -0
  225. /package/dist/{index-CP2eJYlK.d.mts → index-D6xqj1Qx.d.cts} +0 -0
  226. /package/dist/{index-DjOaHFU3.d.mts → index-DHFfG4yr.d.cts} +0 -0
  227. /package/dist/{index-sViox9YW.d.mts → index-N-OgGgfF.d.mts} +0 -0
  228. /package/dist/{z-ClMox7qS.d.mts → index-WOw4GVZo.d.cts} +0 -0
  229. /package/dist/{z-dtM4F8Lo.d.cts → index-luywJTzJ.d.mts} +0 -0
@@ -60,7 +60,7 @@ import { n as getGlobalConsole, t as LogOriginalConsole } from "../log-console-o
60
60
  import { t as LoggerContext } from "../log-context-CV5ddxSr.cjs";
61
61
  import { a as useLevelFilter, i as parseLogLevel, n as getNamespaceFilterString, o as useNamespaceFilter, r as joinLogStrings, t as NamespaceFilter } from "../log-filter-DL8kjJv_.cjs";
62
62
  import { n as logMessageFromCompact, t as LoggerMemoryHandler } from "../log-memory-CwRu7A3J.cjs";
63
- import { A as Channel, C as MessagesOptions, D as LocalChannel, E as ResillientChannel, F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, O as createLocalChannelPair, P as EmitterAllHandler, R as ZeedGlobalEmitter, S as MessagesMethods, T as useMessageHub, _ as MessageAction, a as PoolTask, b as MessageResult, c as PoolTaskIdConflictResolution, d as Progress, f as ProgressOptions, g as Message, h as usePubSub, i as PoolConfig, j as ChannelMessageEvent, k as DebugChannel, l as PoolTaskState, m as PubSubConfig, n as TaskEvents, o as PoolTaskEvents, p as PubSub, r as TaskFn, s as PoolTaskFn, t as SerialQueue, u as usePool, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub, z as getGlobalEmitter } from "../index-DHXVOH8h.cjs";
63
+ import { A as Channel, C as MessagesOptions, D as LocalChannel, E as ResillientChannel, F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, O as createLocalChannelPair, P as EmitterAllHandler, R as ZeedGlobalEmitter, S as MessagesMethods, T as useMessageHub, _ as MessageAction, a as PoolTask, b as MessageResult, c as PoolTaskIdConflictResolution, d as Progress, f as ProgressOptions, g as Message, h as usePubSub, i as PoolConfig, j as ChannelMessageEvent, k as DebugChannel, l as PoolTaskState, m as PubSubConfig, n as TaskEvents, o as PoolTaskEvents, p as PubSub, r as TaskFn, s as PoolTaskFn, t as SerialQueue, u as usePool, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub, z as getGlobalEmitter } from "../index-CFkMqHvX.cjs";
64
64
  import { a as RPCOptions, c as ReturnType, d as useRPCHub, i as RPCMode, l as UseRPCHubType, n as RPCFn, o as RPCOptionsBasic, r as RPCMessage, s as RPCReturn, t as ArgumentsType, u as useRPC } from "../rpc-5Ln_Xp7t.cjs";
65
65
  import { a as fetchOptionsFormURLEncoded, c as fetchText, i as fetchOptionsBasicAuth, l as httpMethod, n as fetchJson, o as fetchOptionsJson, r as fetchOptionType, s as fetchOptionsType, t as fetchBasic, u as parseBasicAuth } from "../network-B9L87z99.cjs";
66
66
  import { a as getWindow, i as getNavigator, n as getGlobal, o as isBrowser, r as getLocalStorage, s as useExitHandler, t as detect } from "../platform-dMHkbfcr.cjs";
@@ -73,14 +73,17 @@ import { i as stringFromSchemaEnv, n as SchemaEnvType, r as parseSchemaEnv, t as
73
73
  import { i as schemaValidateObject, n as schemaCreateObject, r as schemaParseObject, t as SchemaValidateMessage } from "../parse-object-D_fCDXxd.cjs";
74
74
  import { t as StandardSchemaV1 } from "../schema-standard-BxRHxZeM.cjs";
75
75
  import { n as deserializeSchema, r as serializeSchema, t as SerializedType } from "../serialize-9GhlcFMv.cjs";
76
- import { n as IsEqual, t as Expect } from "../type-test-sM7QpfQU.cjs";
77
- import { a as isSchemaPrimitive, i as isSchemaOptional, n as isSchemaObject, r as isSchemaObjectFlat, t as isSchemaDefault } from "../utils-Bctk_WhH.cjs";
78
- import { n as MemStorageOptions, t as MemStorage } from "../memstorage-BcjQLdaQ.cjs";
79
- import { t as setTestMode } from "../test-D2plOVHF.cjs";
80
- import { C as parseDate, E as timestampSecondsToMilliseconds, S as getTimestampInSeconds, T as timestampMillisecondsToSeconds, _ as formatMilliseconds, a as TIME_MINUTE_MS, b as getSecondsFromBuildNumber, c as TIME_MONTH_S, d as TIME_YEAR_MS, f as TIME_YEAR_S, g as duration, h as datetimeToUTC, i as TIME_HOUR_S, l as TIME_WEEK_MS, m as datetimeToLocal, n as TIME_DAY_S, o as TIME_MINUTE_S, p as dateFromSeconds, r as TIME_HOUR_MS, s as TIME_MONTH_MS, t as TIME_DAY_MS, u as TIME_WEEK_S, v as getBuildNumber, w as setTimestampTest, x as getTimestamp, y as getPerformanceTimestamp } from "../time-BfKJBbym.cjs";
81
- import { t as safeTimeout } from "../timeout-CpFcK8MD.cjs";
82
- import { t as noop } from "../utils-DHQBNh-Z.cjs";
83
- import { C as uuidv4, S as uuidIsValid, _ as uuidDecodeV4, a as suidBytesDate, b as uuidEncodeB62, c as unameReset, d as uuidB32, f as uuidB62, g as uuidDecodeB62, h as uuidDecodeB32, i as suidBytes, l as uuid, m as uuidDecode, n as setUuidDefaultEncoding, o as suidDate, p as uuidBytes, r as suid, s as uname, t as qid, u as uuid32bit, v as uuidEncode, x as uuidEncodeV4, y as uuidEncodeB32 } from "../uuid-Cusm2nIK.cjs";
84
- import { a as isTimeout, c as timeout, i as isPromise, l as tryTimeout, n as createPromise, o as promisify, r as immediate, s as sleep, t as AsyncReturnType, u as waitOn } from "../promise-DGgiRckN.cjs";
85
- import { n as throttle, t as debounce } from "../throttle-debounce-Psb0ay1r.cjs";
86
- export { ArgumentsType, AsyncMutex, AsyncReturnType, BaseXAlphabet, BaseXAsChain, BaseXChain, BaseXDecodeFunction, BaseXEncodeFunction, BaseXFirst, BaseXInput, BaseXLast, BaseXOutput, BaseXTail, Bech32, Bech32Decoded, Bech32DecodedWithArray, BinInput, BinaryEncoder, BytesCoder, CRYPTO_DEFAULT_ALG, CRYPTO_DEFAULT_DERIVE_ALG, CRYPTO_DEFAULT_DERIVE_ITERATIONS, CRYPTO_DEFAULT_HASH_ALG, CRYPTO_DEFAULT_IV_LENGTH, Channel, ChannelMessageEvent, Coder, CryptoEncoder, DAY_MS, Day, DayInput, DayInputLegacy, DayValue, DebugChannel, DecimalInput, DecimalValue, DefaultListener, DefaultLogger, DiffOptions, Difference, DifferenceType, Disposer, DisposerFunction, Emitter, EmitterAllHandler, EmitterHandler, EmitterSubscriberOptions, Encoder, Expect, FilterFunction, Infer, IsEqual, Json, JsonEncoder, JsonEntryProcessor, LinkifyOptions, ListenerSignature, LocalChannel, LogConfig, LogHandler, LogHandlerOptions, LogLevel, LogLevelAlias, LogLevelAliasKey, LogLevelAliasType, LogLevelAll, LogLevelDebug, LogLevelError, LogLevelFatal, LogLevelInfo, LogLevelOff, LogLevelWarn, LogMessage, LogMessageCompact, LogOriginalConsole, LoggerConsoleHandler, LoggerContext, LoggerContextInterface, LoggerInterface, LoggerMemoryHandler, MapperFunction, MemStorage, MemStorageOptions, Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, Mutex, NamespaceFilter, NestedArray, NoopEncoder, ObjectStorage, PoolConfig, PoolTask, PoolTaskEvents, PoolTaskFn, PoolTaskIdConflictResolution, PoolTaskState, Primitive, Progress, ProgressOptions, PubSub, PubSubConfig, RPCFn, RPCMessage, RPCMode, RPCOptions, RPCOptionsBasic, RPCReturn, RX_URL, RenderMessagesOptions, ResillientChannel, ReturnType, RoundingMode, SchemaEnvOptions, SchemaEnvType, SchemaValidateMessage, SerialQueue, SerializedType, Signal, SignalWatcher, SortableItem, StandardSchemaV1, TIME_DAY_MS, TIME_DAY_S, TIME_HOUR_MS, TIME_HOUR_S, TIME_MINUTE_MS, TIME_MINUTE_S, TIME_MONTH_MS, TIME_MONTH_S, TIME_WEEK_MS, TIME_WEEK_S, TIME_YEAR_MS, TIME_YEAR_S, TaskEvents, TaskFn, TimerExecFunction, Type, TypeArray, TypeArrayOutput, TypeLiterals, TypeMeta, TypeObjectFixOptional, TypeTuple, TypeUnion, Uint8ArrayToDataUri, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, Uint8ArrayToWords, UseDefer, UseDispose, UseDisposeConfig, UseDisposeWithUtils, UseRPCHubType, UseStringHashPool, XRX, ZeedGlobalContext, ZeedGlobalEmitter, _decodeUtf8Polyfill, _encodeUtf8Polyfill, _useBase, any, array, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetArrayInPlace, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, assert, assertCondition, assertNumber, avg, base16, base32, base32ToNumber, base32agnoster, base32crockford, base32hex, base32hexnopad, base32nopad, base58, base58check, base58flickr, base58xmr, base58xrp, base64, base64nopad, base64url, base64urlnopad, bech32, bech32m, between, bitfield, blobToArrayBuffer, blobToDataUri, blobToUint8Array, boolean, browserSelectColorByName, bytes, bytesToString, cloneJsonObject, cloneObject, cmp, composeOrderby, createArray, createBase58check, createBinaryStreamDecoder, createBinaryStreamEncoder, createLocalChannelPair, createPromise, createPromiseProxy, csvParse, csvParseToObjects, csvStringify, dataUriToBlob, dataUriToMimeType, dataUriToUint8Array, dateFromSeconds, dateStringToDays, datetimeToLocal, datetimeToUTC, day, dayDay, dayDaysInMonth, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromDateUTC, dayFromParts, dayFromString, dayFromTimestamp, dayFromTimestampSeconds, dayFromToday, dayIterator, dayMonth, dayMonthOffset, dayMonthStart, dayOffset, dayRange, dayToDate, dayToDateGMT, dayToDateUTC, dayToParts, dayToString, dayToTimestamp, dayToTimestampSeconds, dayYear, dayYearOffset, dayYearStart, debounce, deburr, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeJson, decrypt, decryptAesGcm, decryptXAES, deepEqual, deepMerge, deepStripUndefinedInPlace, deriveKeyPbkdf2, deriveKeyPbkdf2CBC, deserializeSchema, detect, diffObjects, digest, distributedFilePath, double, duration, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeJson, encodeQuery, encrypt, encryptAesGcm, encryptXAES, endSortWeight, ensureKey, ensureKeyAsync, ensureUint8Array, equalBinary, escapeHTML, escapeRegExp, estimateSizeForBase, exportKeyXAES, fatal, fetchBasic, fetchJson, fetchOptionType, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchOptionsType, fetchText, first, fixBrokenUtf8String, float, forEachDay, forTimes, formatBytesToHumanBase1000, formatBytesToHumanBase1024, formatMessages, formatMilliseconds, formatSecondsToTime, fromBase64, fromBase64String, fromCamelCase, fromHex, func, generateKeyXAES, getBuildNumber, getGlobal, getGlobalConsole, getGlobalContext, getGlobalEmitter, getGlobalLogger, getGlobalLoggerIfExists, getLocalStorage, getNamespaceFilterString, getNavigator, getPerformanceTimestamp, getSecondsFromBuildNumber, getSecureRandom, getSecureRandomIfPossible, getTimestamp, getTimestampInSeconds, getWindow, globalAny, helpSchemaArgs, hex, httpMethod, immediate, importKeyXAES, int, isArray, isBinaryArray, isBoolean, isBrowser, isEmpty, isEven, isFunction, isHalf, isInteger, isLocalHost, isNotEmpty, isNotNull, isNull, isNullOrUndefined, isNumber, isObject, isPrime, isPrimeRX, isPrimitive, isPromise, isRecord, isRecordPlain, isSafeInteger, isSchemaDefault, isSchemaObject, isSchemaObjectFlat, isSchemaOptional, isSchemaPrimitive, isString, isSymbol, isTimeout, isTruthy, isUint8Array, isValue, joinLogStrings, joinToUint8Array, jsonParse, jsonStringify, jsonStringifySafe, jsonStringifySorted, jsonToUint8Array, last, linkifyPlainText, linkifyPlainTextSimple, linkifyPlainTextWithLineBreaks, listDistinctUnion, listGroupBy, listOfKey, listQuery, literal, logCaptureConsole, logMessageFromCompact, memoize, memoizeAsync, moveSortWeight, none, noop, noopDisposer, number, numberToBase32, object, objectAssignDeepInPlace, objectAssignDescriptionInPlace, objectDescribeChange, objectFilter, objectInclusivePick, objectIsEmpty, objectMap, objectMergeDisposable, objectOmit, objectPick, objectPlain, parseBasicAuth, parseDate, parseFloat, parseInt, parseLogLevel, parseOrderby, parseQuery, parseSchemaArgs, parseSchemaEnv, polyfillUsing, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, real, record, regExpEscape, regExpString, renderMessages, roundArrayOfNumbersToMatchSum, roundArrayOfObjectsToMatchSum, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, rpc, safeTimeout, schemaCreateObject, schemaExportJsonSchema, schemaExportJsonSchemaString, schemaExportSwiftStruct, schemaExportTypescriptInterface, schemaParseObject, schemaValidateObject, seededRandom, serializeSchema, setDayTest, setTestMode, setTimestampTest, setUuidDefaultEncoding, size, sleep, sortedItems, sortedOrderby, startSortWeight, str, string, stringFromSchemaEnv, stringHashFNV1a, stringLiterals, stringToBoolean, stringToBytes, stringToFloat, stringToInteger, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, throttle, timeout, timestampMillisecondsToSeconds, timestampSecondsToMilliseconds, toArrayBuffer, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableUrl, toInt, toString, toUint8Array, toValidFilename, today, tryTimeout, tuple, uname, unameReset, unescapeHTML, union, useAsyncMutex, useBase, useDefer, useDispose, useDisposeWithUtils, useEventListener, useEventListenerOnce, useExitHandler, useInterval, useIntervalPause, useLevelFilter, useMessageHub, useMutex, useNamespaceFilter, usePool, usePubSub, useRPC, useRPCHub, useSignal, useSorted, useStringHashPool, useTimeout, utf8, utils, uuid, uuid32bit, uuidB32, uuidB62, uuidBytes, uuidDecode, uuidDecodeB32, uuidDecodeB62, uuidDecodeV4, uuidEncode, uuidEncodeB32, uuidEncodeB62, uuidEncodeV4, uuidIsValid, uuidv4, valueToBoolean, valueToBooleanNotFalse, valueToFloat, valueToInteger, valueToString, waitOn, wordsToUint8Array, z_collection_d_exports as z };
76
+ import { a as table, i as isColumn, n as TableColumns, r as TableShape, t as Column } from "../table-IkLXirT-.cjs";
77
+ import { a as gte, c as lt, d as not, f as or, i as gt, l as lte, m as sqlIsNull, n as and, o as inArray, p as sqlIsNotNull, r as eq, s as like, t as Expr, u as ne } from "../expr-yYgSeBZ3.cjs";
78
+ import { a as RowFromTable, c as select, i as RowFromSelection, n as InferRow, o as SelectBuilder, r as QueryDependencies, s as from, t as CompiledQuery } from "../select-DrciHdk_.cjs";
79
+ import { n as IsEqual, t as Expect } from "../type-test-CBK-iJ9d.cjs";
80
+ import { a as isSchemaPrimitive, i as isSchemaOptional, n as isSchemaObject, r as isSchemaObjectFlat, t as isSchemaDefault } from "../utils-nCQklGHV.cjs";
81
+ import { n as MemStorageOptions, t as MemStorage } from "../memstorage-tvlWDYgS.cjs";
82
+ import { t as setTestMode } from "../test-DcXa0MeX.cjs";
83
+ import { C as parseDate, E as timestampSecondsToMilliseconds, S as getTimestampInSeconds, T as timestampMillisecondsToSeconds, _ as formatMilliseconds, a as TIME_MINUTE_MS, b as getSecondsFromBuildNumber, c as TIME_MONTH_S, d as TIME_YEAR_MS, f as TIME_YEAR_S, g as duration, h as datetimeToUTC, i as TIME_HOUR_S, l as TIME_WEEK_MS, m as datetimeToLocal, n as TIME_DAY_S, o as TIME_MINUTE_S, p as dateFromSeconds, r as TIME_HOUR_MS, s as TIME_MONTH_MS, t as TIME_DAY_MS, u as TIME_WEEK_S, v as getBuildNumber, w as setTimestampTest, x as getTimestamp, y as getPerformanceTimestamp } from "../time-BgFZe9ys.cjs";
84
+ import { t as safeTimeout } from "../timeout-E3ZQbJgK.cjs";
85
+ import { t as noop } from "../utils-6Culwiaf.cjs";
86
+ import { C as uuidv4, S as uuidIsValid, _ as uuidDecodeV4, a as suidBytesDate, b as uuidEncodeB62, c as unameReset, d as uuidB32, f as uuidB62, g as uuidDecodeB62, h as uuidDecodeB32, i as suidBytes, l as uuid, m as uuidDecode, n as setUuidDefaultEncoding, o as suidDate, p as uuidBytes, r as suid, s as uname, t as qid, u as uuid32bit, v as uuidEncode, x as uuidEncodeV4, y as uuidEncodeB32 } from "../uuid-D42A8UdP.cjs";
87
+ import { a as isTimeout, c as timeout, i as isPromise, l as tryTimeout, n as createPromise, o as promisify, r as immediate, s as sleep, t as AsyncReturnType, u as waitOn } from "../promise-CU_CENbU.cjs";
88
+ import { n as throttle, t as debounce } from "../throttle-debounce-DyFiyoAk.cjs";
89
+ export { ArgumentsType, AsyncMutex, AsyncReturnType, BaseXAlphabet, BaseXAsChain, BaseXChain, BaseXDecodeFunction, BaseXEncodeFunction, BaseXFirst, BaseXInput, BaseXLast, BaseXOutput, BaseXTail, Bech32, Bech32Decoded, Bech32DecodedWithArray, BinInput, BinaryEncoder, BytesCoder, CRYPTO_DEFAULT_ALG, CRYPTO_DEFAULT_DERIVE_ALG, CRYPTO_DEFAULT_DERIVE_ITERATIONS, CRYPTO_DEFAULT_HASH_ALG, CRYPTO_DEFAULT_IV_LENGTH, Channel, ChannelMessageEvent, Coder, Column, CompiledQuery, CryptoEncoder, DAY_MS, Day, DayInput, DayInputLegacy, DayValue, DebugChannel, DecimalInput, DecimalValue, DefaultListener, DefaultLogger, DiffOptions, Difference, DifferenceType, Disposer, DisposerFunction, Emitter, EmitterAllHandler, EmitterHandler, EmitterSubscriberOptions, Encoder, Expect, Expr, FilterFunction, Infer, InferRow, IsEqual, Json, JsonEncoder, JsonEntryProcessor, LinkifyOptions, ListenerSignature, LocalChannel, LogConfig, LogHandler, LogHandlerOptions, LogLevel, LogLevelAlias, LogLevelAliasKey, LogLevelAliasType, LogLevelAll, LogLevelDebug, LogLevelError, LogLevelFatal, LogLevelInfo, LogLevelOff, LogLevelWarn, LogMessage, LogMessageCompact, LogOriginalConsole, LoggerConsoleHandler, LoggerContext, LoggerContextInterface, LoggerInterface, LoggerMemoryHandler, MapperFunction, MemStorage, MemStorageOptions, Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, Mutex, NamespaceFilter, NestedArray, NoopEncoder, ObjectStorage, PoolConfig, PoolTask, PoolTaskEvents, PoolTaskFn, PoolTaskIdConflictResolution, PoolTaskState, Primitive, Progress, ProgressOptions, PubSub, PubSubConfig, QueryDependencies, RPCFn, RPCMessage, RPCMode, RPCOptions, RPCOptionsBasic, RPCReturn, RX_URL, RenderMessagesOptions, ResillientChannel, ReturnType, RoundingMode, RowFromSelection, RowFromTable, SchemaEnvOptions, SchemaEnvType, SchemaValidateMessage, SelectBuilder, SerialQueue, SerializedType, Signal, SignalWatcher, SortableItem, StandardSchemaV1, TIME_DAY_MS, TIME_DAY_S, TIME_HOUR_MS, TIME_HOUR_S, TIME_MINUTE_MS, TIME_MINUTE_S, TIME_MONTH_MS, TIME_MONTH_S, TIME_WEEK_MS, TIME_WEEK_S, TIME_YEAR_MS, TIME_YEAR_S, TableColumns, TableShape, TaskEvents, TaskFn, TimerExecFunction, Type, TypeArray, TypeArrayOutput, TypeLiterals, TypeMeta, TypeObjectFixOptional, TypeTuple, TypeUnion, Uint8ArrayToDataUri, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, Uint8ArrayToWords, UseDefer, UseDispose, UseDisposeConfig, UseDisposeWithUtils, UseRPCHubType, UseStringHashPool, XRX, ZeedGlobalContext, ZeedGlobalEmitter, _decodeUtf8Polyfill, _encodeUtf8Polyfill, _useBase, and, any, array, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetArrayInPlace, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, assert, assertCondition, assertNumber, avg, base16, base32, base32ToNumber, base32agnoster, base32crockford, base32hex, base32hexnopad, base32nopad, base58, base58check, base58flickr, base58xmr, base58xrp, base64, base64nopad, base64url, base64urlnopad, bech32, bech32m, between, bitfield, blobToArrayBuffer, blobToDataUri, blobToUint8Array, boolean, browserSelectColorByName, bytes, bytesToString, cloneJsonObject, cloneObject, cmp, composeOrderby, createArray, createBase58check, createBinaryStreamDecoder, createBinaryStreamEncoder, createLocalChannelPair, createPromise, createPromiseProxy, csvParse, csvParseToObjects, csvStringify, dataUriToBlob, dataUriToMimeType, dataUriToUint8Array, dateFromSeconds, dateStringToDays, datetimeToLocal, datetimeToUTC, day, dayDay, dayDaysInMonth, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromDateUTC, dayFromParts, dayFromString, dayFromTimestamp, dayFromTimestampSeconds, dayFromToday, dayIterator, dayMonth, dayMonthOffset, dayMonthStart, dayOffset, dayRange, dayToDate, dayToDateGMT, dayToDateUTC, dayToParts, dayToString, dayToTimestamp, dayToTimestampSeconds, dayYear, dayYearOffset, dayYearStart, debounce, deburr, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeJson, decrypt, decryptAesGcm, decryptXAES, deepEqual, deepMerge, deepStripUndefinedInPlace, deriveKeyPbkdf2, deriveKeyPbkdf2CBC, deserializeSchema, detect, diffObjects, digest, distributedFilePath, double, duration, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeJson, encodeQuery, encrypt, encryptAesGcm, encryptXAES, endSortWeight, ensureKey, ensureKeyAsync, ensureUint8Array, eq, equalBinary, escapeHTML, escapeRegExp, estimateSizeForBase, exportKeyXAES, fatal, fetchBasic, fetchJson, fetchOptionType, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchOptionsType, fetchText, first, fixBrokenUtf8String, float, forEachDay, forTimes, formatBytesToHumanBase1000, formatBytesToHumanBase1024, formatMessages, formatMilliseconds, formatSecondsToTime, from, fromBase64, fromBase64String, fromCamelCase, fromHex, func, generateKeyXAES, getBuildNumber, getGlobal, getGlobalConsole, getGlobalContext, getGlobalEmitter, getGlobalLogger, getGlobalLoggerIfExists, getLocalStorage, getNamespaceFilterString, getNavigator, getPerformanceTimestamp, getSecondsFromBuildNumber, getSecureRandom, getSecureRandomIfPossible, getTimestamp, getTimestampInSeconds, getWindow, globalAny, gt, gte, helpSchemaArgs, hex, httpMethod, immediate, importKeyXAES, inArray, int, isArray, isBinaryArray, isBoolean, isBrowser, isColumn, isEmpty, isEven, isFunction, isHalf, isInteger, isLocalHost, isNotEmpty, isNotNull, isNull, isNullOrUndefined, isNumber, isObject, isPrime, isPrimeRX, isPrimitive, isPromise, isRecord, isRecordPlain, isSafeInteger, isSchemaDefault, isSchemaObject, isSchemaObjectFlat, isSchemaOptional, isSchemaPrimitive, isString, isSymbol, isTimeout, isTruthy, isUint8Array, isValue, joinLogStrings, joinToUint8Array, jsonParse, jsonStringify, jsonStringifySafe, jsonStringifySorted, jsonToUint8Array, last, like, linkifyPlainText, linkifyPlainTextSimple, linkifyPlainTextWithLineBreaks, listDistinctUnion, listGroupBy, listOfKey, listQuery, literal, logCaptureConsole, logMessageFromCompact, lt, lte, memoize, memoizeAsync, moveSortWeight, ne, none, noop, noopDisposer, not, number, numberToBase32, object, objectAssignDeepInPlace, objectAssignDescriptionInPlace, objectDescribeChange, objectFilter, objectInclusivePick, objectIsEmpty, objectMap, objectMergeDisposable, objectOmit, objectPick, objectPlain, or, parseBasicAuth, parseDate, parseFloat, parseInt, parseLogLevel, parseOrderby, parseQuery, parseSchemaArgs, parseSchemaEnv, polyfillUsing, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, real, record, regExpEscape, regExpString, renderMessages, roundArrayOfNumbersToMatchSum, roundArrayOfObjectsToMatchSum, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, rpc, safeTimeout, schemaCreateObject, schemaExportJsonSchema, schemaExportJsonSchemaString, schemaExportSwiftStruct, schemaExportTypescriptInterface, schemaParseObject, schemaValidateObject, seededRandom, select, serializeSchema, setDayTest, setTestMode, setTimestampTest, setUuidDefaultEncoding, size, sleep, sortedItems, sortedOrderby, sqlIsNotNull, sqlIsNull, startSortWeight, str, string, stringFromSchemaEnv, stringHashFNV1a, stringLiterals, stringToBoolean, stringToBytes, stringToFloat, stringToInteger, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, table, throttle, timeout, timestampMillisecondsToSeconds, timestampSecondsToMilliseconds, toArrayBuffer, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableUrl, toInt, toString, toUint8Array, toValidFilename, today, tryTimeout, tuple, uname, unameReset, unescapeHTML, union, useAsyncMutex, useBase, useDefer, useDispose, useDisposeWithUtils, useEventListener, useEventListenerOnce, useExitHandler, useInterval, useIntervalPause, useLevelFilter, useMessageHub, useMutex, useNamespaceFilter, usePool, usePubSub, useRPC, useRPCHub, useSignal, useSorted, useStringHashPool, useTimeout, utf8, utils, uuid, uuid32bit, uuidB32, uuidB62, uuidBytes, uuidDecode, uuidDecodeB32, uuidDecodeB62, uuidDecodeV4, uuidEncode, uuidEncodeB32, uuidEncodeB62, uuidEncodeV4, uuidIsValid, uuidv4, valueToBoolean, valueToBooleanNotFalse, valueToFloat, valueToInteger, valueToString, waitOn, wordsToUint8Array, z_collection_d_exports as z };
@@ -59,7 +59,7 @@ import { n as getGlobalConsole, t as LogOriginalConsole } from "../log-console-o
59
59
  import { t as LoggerContext } from "../log-context-BgwUIe6z.mjs";
60
60
  import { a as useLevelFilter, i as parseLogLevel, n as getNamespaceFilterString, o as useNamespaceFilter, r as joinLogStrings, t as NamespaceFilter } from "../log-filter-eLfbaMpx.mjs";
61
61
  import { n as logMessageFromCompact, t as LoggerMemoryHandler } from "../log-memory-BIHcgKB5.mjs";
62
- import { A as Channel, C as MessagesOptions, D as LocalChannel, E as ResillientChannel, F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, O as createLocalChannelPair, P as EmitterAllHandler, R as ZeedGlobalEmitter, S as MessagesMethods, T as useMessageHub, _ as MessageAction, a as PoolTask, b as MessageResult, c as PoolTaskIdConflictResolution, d as Progress, f as ProgressOptions, g as Message, h as usePubSub, i as PoolConfig, j as ChannelMessageEvent, k as DebugChannel, l as PoolTaskState, m as PubSubConfig, n as TaskEvents, o as PoolTaskEvents, p as PubSub, r as TaskFn, s as PoolTaskFn, t as SerialQueue, u as usePool, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub, z as getGlobalEmitter } from "../index-DMaPyx9O.mjs";
62
+ import { A as Channel, C as MessagesOptions, D as LocalChannel, E as ResillientChannel, F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, O as createLocalChannelPair, P as EmitterAllHandler, R as ZeedGlobalEmitter, S as MessagesMethods, T as useMessageHub, _ as MessageAction, a as PoolTask, b as MessageResult, c as PoolTaskIdConflictResolution, d as Progress, f as ProgressOptions, g as Message, h as usePubSub, i as PoolConfig, j as ChannelMessageEvent, k as DebugChannel, l as PoolTaskState, m as PubSubConfig, n as TaskEvents, o as PoolTaskEvents, p as PubSub, r as TaskFn, s as PoolTaskFn, t as SerialQueue, u as usePool, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub, z as getGlobalEmitter } from "../index-C_3Y_s6f.mjs";
63
63
  import { a as RPCOptions, c as ReturnType, d as useRPCHub, i as RPCMode, l as UseRPCHubType, n as RPCFn, o as RPCOptionsBasic, r as RPCMessage, s as RPCReturn, t as ArgumentsType, u as useRPC } from "../rpc-DX1FYLVn.mjs";
64
64
  import { a as fetchOptionsFormURLEncoded, c as fetchText, i as fetchOptionsBasicAuth, l as httpMethod, n as fetchJson, o as fetchOptionsJson, r as fetchOptionType, s as fetchOptionsType, t as fetchBasic, u as parseBasicAuth } from "../network-BAUAZ5kG.mjs";
65
65
  import { a as getWindow, i as getNavigator, n as getGlobal, o as isBrowser, r as getLocalStorage, s as useExitHandler, t as detect } from "../platform-BhOXtNrQ.mjs";
@@ -72,15 +72,18 @@ import { i as stringFromSchemaEnv, n as SchemaEnvType, r as parseSchemaEnv, t as
72
72
  import { i as schemaValidateObject, n as schemaCreateObject, r as schemaParseObject, t as SchemaValidateMessage } from "../parse-object-BRWSD2uh.mjs";
73
73
  import { t as StandardSchemaV1 } from "../schema-standard-Q-bdIO6s.mjs";
74
74
  import { n as deserializeSchema, r as serializeSchema, t as SerializedType } from "../serialize-rRk9F-zH.mjs";
75
- import { n as IsEqual, t as Expect } from "../type-test-BiKyEZkc.mjs";
76
- import { a as isSchemaPrimitive, i as isSchemaOptional, n as isSchemaObject, r as isSchemaObjectFlat, t as isSchemaDefault } from "../utils-B8DsVgFr.mjs";
77
- import { t as z_collection_d_exports } from "../z-collection-BmuBin--.mjs";
78
- import { n as MemStorageOptions, t as MemStorage } from "../memstorage-D5A9FwiP.mjs";
79
- import { t as setTestMode } from "../test-CAhm15f4.mjs";
80
- import { C as parseDate, E as timestampSecondsToMilliseconds, S as getTimestampInSeconds, T as timestampMillisecondsToSeconds, _ as formatMilliseconds, a as TIME_MINUTE_MS, b as getSecondsFromBuildNumber, c as TIME_MONTH_S, d as TIME_YEAR_MS, f as TIME_YEAR_S, g as duration, h as datetimeToUTC, i as TIME_HOUR_S, l as TIME_WEEK_MS, m as datetimeToLocal, n as TIME_DAY_S, o as TIME_MINUTE_S, p as dateFromSeconds, r as TIME_HOUR_MS, s as TIME_MONTH_MS, t as TIME_DAY_MS, u as TIME_WEEK_S, v as getBuildNumber, w as setTimestampTest, x as getTimestamp, y as getPerformanceTimestamp } from "../time-DxE-vjjw.mjs";
81
- import { t as safeTimeout } from "../timeout-CnUk6Ruj.mjs";
82
- import { t as noop } from "../utils-BfZkD2Pt.mjs";
83
- import { C as uuidv4, S as uuidIsValid, _ as uuidDecodeV4, a as suidBytesDate, b as uuidEncodeB62, c as unameReset, d as uuidB32, f as uuidB62, g as uuidDecodeB62, h as uuidDecodeB32, i as suidBytes, l as uuid, m as uuidDecode, n as setUuidDefaultEncoding, o as suidDate, p as uuidBytes, r as suid, s as uname, t as qid, u as uuid32bit, v as uuidEncode, x as uuidEncodeV4, y as uuidEncodeB32 } from "../uuid-ININPGKB.mjs";
84
- import { a as isTimeout, c as timeout, i as isPromise, l as tryTimeout, n as createPromise, o as promisify, r as immediate, s as sleep, t as AsyncReturnType, u as waitOn } from "../promise-MH3xAy4S.mjs";
85
- import { n as throttle, t as debounce } from "../throttle-debounce-BLFxAZ8W.mjs";
86
- export { ArgumentsType, AsyncMutex, AsyncReturnType, BaseXAlphabet, BaseXAsChain, BaseXChain, BaseXDecodeFunction, BaseXEncodeFunction, BaseXFirst, BaseXInput, BaseXLast, BaseXOutput, BaseXTail, Bech32, Bech32Decoded, Bech32DecodedWithArray, BinInput, BinaryEncoder, BytesCoder, CRYPTO_DEFAULT_ALG, CRYPTO_DEFAULT_DERIVE_ALG, CRYPTO_DEFAULT_DERIVE_ITERATIONS, CRYPTO_DEFAULT_HASH_ALG, CRYPTO_DEFAULT_IV_LENGTH, Channel, ChannelMessageEvent, Coder, CryptoEncoder, DAY_MS, Day, DayInput, DayInputLegacy, DayValue, DebugChannel, DecimalInput, DecimalValue, DefaultListener, DefaultLogger, DiffOptions, Difference, DifferenceType, Disposer, DisposerFunction, Emitter, EmitterAllHandler, EmitterHandler, EmitterSubscriberOptions, Encoder, Expect, FilterFunction, Infer, IsEqual, Json, JsonEncoder, JsonEntryProcessor, LinkifyOptions, ListenerSignature, LocalChannel, LogConfig, LogHandler, LogHandlerOptions, LogLevel, LogLevelAlias, LogLevelAliasKey, LogLevelAliasType, LogLevelAll, LogLevelDebug, LogLevelError, LogLevelFatal, LogLevelInfo, LogLevelOff, LogLevelWarn, LogMessage, LogMessageCompact, LogOriginalConsole, LoggerConsoleHandler, LoggerContext, LoggerContextInterface, LoggerInterface, LoggerMemoryHandler, MapperFunction, MemStorage, MemStorageOptions, Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, Mutex, NamespaceFilter, NestedArray, NoopEncoder, ObjectStorage, PoolConfig, PoolTask, PoolTaskEvents, PoolTaskFn, PoolTaskIdConflictResolution, PoolTaskState, Primitive, Progress, ProgressOptions, PubSub, PubSubConfig, RPCFn, RPCMessage, RPCMode, RPCOptions, RPCOptionsBasic, RPCReturn, RX_URL, RenderMessagesOptions, ResillientChannel, ReturnType, RoundingMode, SchemaEnvOptions, SchemaEnvType, SchemaValidateMessage, SerialQueue, SerializedType, Signal, SignalWatcher, SortableItem, StandardSchemaV1, TIME_DAY_MS, TIME_DAY_S, TIME_HOUR_MS, TIME_HOUR_S, TIME_MINUTE_MS, TIME_MINUTE_S, TIME_MONTH_MS, TIME_MONTH_S, TIME_WEEK_MS, TIME_WEEK_S, TIME_YEAR_MS, TIME_YEAR_S, TaskEvents, TaskFn, TimerExecFunction, Type, TypeArray, TypeArrayOutput, TypeLiterals, TypeMeta, TypeObjectFixOptional, TypeTuple, TypeUnion, Uint8ArrayToDataUri, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, Uint8ArrayToWords, UseDefer, UseDispose, UseDisposeConfig, UseDisposeWithUtils, UseRPCHubType, UseStringHashPool, XRX, ZeedGlobalContext, ZeedGlobalEmitter, _decodeUtf8Polyfill, _encodeUtf8Polyfill, _useBase, any, array, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetArrayInPlace, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, assert, assertCondition, assertNumber, avg, base16, base32, base32ToNumber, base32agnoster, base32crockford, base32hex, base32hexnopad, base32nopad, base58, base58check, base58flickr, base58xmr, base58xrp, base64, base64nopad, base64url, base64urlnopad, bech32, bech32m, between, bitfield, blobToArrayBuffer, blobToDataUri, blobToUint8Array, boolean, browserSelectColorByName, bytes, bytesToString, cloneJsonObject, cloneObject, cmp, composeOrderby, createArray, createBase58check, createBinaryStreamDecoder, createBinaryStreamEncoder, createLocalChannelPair, createPromise, createPromiseProxy, csvParse, csvParseToObjects, csvStringify, dataUriToBlob, dataUriToMimeType, dataUriToUint8Array, dateFromSeconds, dateStringToDays, datetimeToLocal, datetimeToUTC, day, dayDay, dayDaysInMonth, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromDateUTC, dayFromParts, dayFromString, dayFromTimestamp, dayFromTimestampSeconds, dayFromToday, dayIterator, dayMonth, dayMonthOffset, dayMonthStart, dayOffset, dayRange, dayToDate, dayToDateGMT, dayToDateUTC, dayToParts, dayToString, dayToTimestamp, dayToTimestampSeconds, dayYear, dayYearOffset, dayYearStart, debounce, deburr, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeJson, decrypt, decryptAesGcm, decryptXAES, deepEqual, deepMerge, deepStripUndefinedInPlace, deriveKeyPbkdf2, deriveKeyPbkdf2CBC, deserializeSchema, detect, diffObjects, digest, distributedFilePath, double, duration, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeJson, encodeQuery, encrypt, encryptAesGcm, encryptXAES, endSortWeight, ensureKey, ensureKeyAsync, ensureUint8Array, equalBinary, escapeHTML, escapeRegExp, estimateSizeForBase, exportKeyXAES, fatal, fetchBasic, fetchJson, fetchOptionType, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchOptionsType, fetchText, first, fixBrokenUtf8String, float, forEachDay, forTimes, formatBytesToHumanBase1000, formatBytesToHumanBase1024, formatMessages, formatMilliseconds, formatSecondsToTime, fromBase64, fromBase64String, fromCamelCase, fromHex, func, generateKeyXAES, getBuildNumber, getGlobal, getGlobalConsole, getGlobalContext, getGlobalEmitter, getGlobalLogger, getGlobalLoggerIfExists, getLocalStorage, getNamespaceFilterString, getNavigator, getPerformanceTimestamp, getSecondsFromBuildNumber, getSecureRandom, getSecureRandomIfPossible, getTimestamp, getTimestampInSeconds, getWindow, globalAny, helpSchemaArgs, hex, httpMethod, immediate, importKeyXAES, int, isArray, isBinaryArray, isBoolean, isBrowser, isEmpty, isEven, isFunction, isHalf, isInteger, isLocalHost, isNotEmpty, isNotNull, isNull, isNullOrUndefined, isNumber, isObject, isPrime, isPrimeRX, isPrimitive, isPromise, isRecord, isRecordPlain, isSafeInteger, isSchemaDefault, isSchemaObject, isSchemaObjectFlat, isSchemaOptional, isSchemaPrimitive, isString, isSymbol, isTimeout, isTruthy, isUint8Array, isValue, joinLogStrings, joinToUint8Array, jsonParse, jsonStringify, jsonStringifySafe, jsonStringifySorted, jsonToUint8Array, last, linkifyPlainText, linkifyPlainTextSimple, linkifyPlainTextWithLineBreaks, listDistinctUnion, listGroupBy, listOfKey, listQuery, literal, logCaptureConsole, logMessageFromCompact, memoize, memoizeAsync, moveSortWeight, none, noop, noopDisposer, number, numberToBase32, object, objectAssignDeepInPlace, objectAssignDescriptionInPlace, objectDescribeChange, objectFilter, objectInclusivePick, objectIsEmpty, objectMap, objectMergeDisposable, objectOmit, objectPick, objectPlain, parseBasicAuth, parseDate, parseFloat, parseInt, parseLogLevel, parseOrderby, parseQuery, parseSchemaArgs, parseSchemaEnv, polyfillUsing, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, real, record, regExpEscape, regExpString, renderMessages, roundArrayOfNumbersToMatchSum, roundArrayOfObjectsToMatchSum, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, rpc, safeTimeout, schemaCreateObject, schemaExportJsonSchema, schemaExportJsonSchemaString, schemaExportSwiftStruct, schemaExportTypescriptInterface, schemaParseObject, schemaValidateObject, seededRandom, serializeSchema, setDayTest, setTestMode, setTimestampTest, setUuidDefaultEncoding, size, sleep, sortedItems, sortedOrderby, startSortWeight, str, string, stringFromSchemaEnv, stringHashFNV1a, stringLiterals, stringToBoolean, stringToBytes, stringToFloat, stringToInteger, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, throttle, timeout, timestampMillisecondsToSeconds, timestampSecondsToMilliseconds, toArrayBuffer, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableUrl, toInt, toString, toUint8Array, toValidFilename, today, tryTimeout, tuple, uname, unameReset, unescapeHTML, union, useAsyncMutex, useBase, useDefer, useDispose, useDisposeWithUtils, useEventListener, useEventListenerOnce, useExitHandler, useInterval, useIntervalPause, useLevelFilter, useMessageHub, useMutex, useNamespaceFilter, usePool, usePubSub, useRPC, useRPCHub, useSignal, useSorted, useStringHashPool, useTimeout, utf8, utils, uuid, uuid32bit, uuidB32, uuidB62, uuidBytes, uuidDecode, uuidDecodeB32, uuidDecodeB62, uuidDecodeV4, uuidEncode, uuidEncodeB32, uuidEncodeB62, uuidEncodeV4, uuidIsValid, uuidv4, valueToBoolean, valueToBooleanNotFalse, valueToFloat, valueToInteger, valueToString, waitOn, wordsToUint8Array, z_collection_d_exports as z };
75
+ import { a as table, i as isColumn, n as TableColumns, r as TableShape, t as Column } from "../table-Cr8tjDIL.mjs";
76
+ import { a as gte, c as lt, d as not, f as or, i as gt, l as lte, m as sqlIsNull, n as and, o as inArray, p as sqlIsNotNull, r as eq, s as like, t as Expr, u as ne } from "../expr-CCKrqOw1.mjs";
77
+ import { a as RowFromTable, c as select, i as RowFromSelection, n as InferRow, o as SelectBuilder, r as QueryDependencies, s as from, t as CompiledQuery } from "../select-F2KpP6mo.mjs";
78
+ import { n as IsEqual, t as Expect } from "../type-test-BvzWDJz3.mjs";
79
+ import { a as isSchemaPrimitive, i as isSchemaOptional, n as isSchemaObject, r as isSchemaObjectFlat, t as isSchemaDefault } from "../utils-1RyCGkpQ.mjs";
80
+ import { t as z_collection_d_exports } from "../z-collection-BSfgRU0Q.mjs";
81
+ import { n as MemStorageOptions, t as MemStorage } from "../memstorage-BhWXthO8.mjs";
82
+ import { t as setTestMode } from "../test-jZsc7P2c.mjs";
83
+ import { C as parseDate, E as timestampSecondsToMilliseconds, S as getTimestampInSeconds, T as timestampMillisecondsToSeconds, _ as formatMilliseconds, a as TIME_MINUTE_MS, b as getSecondsFromBuildNumber, c as TIME_MONTH_S, d as TIME_YEAR_MS, f as TIME_YEAR_S, g as duration, h as datetimeToUTC, i as TIME_HOUR_S, l as TIME_WEEK_MS, m as datetimeToLocal, n as TIME_DAY_S, o as TIME_MINUTE_S, p as dateFromSeconds, r as TIME_HOUR_MS, s as TIME_MONTH_MS, t as TIME_DAY_MS, u as TIME_WEEK_S, v as getBuildNumber, w as setTimestampTest, x as getTimestamp, y as getPerformanceTimestamp } from "../time-DSV_k3mG.mjs";
84
+ import { t as safeTimeout } from "../timeout-DDSSNZY8.mjs";
85
+ import { t as noop } from "../utils-CDJihcg3.mjs";
86
+ import { C as uuidv4, S as uuidIsValid, _ as uuidDecodeV4, a as suidBytesDate, b as uuidEncodeB62, c as unameReset, d as uuidB32, f as uuidB62, g as uuidDecodeB62, h as uuidDecodeB32, i as suidBytes, l as uuid, m as uuidDecode, n as setUuidDefaultEncoding, o as suidDate, p as uuidBytes, r as suid, s as uname, t as qid, u as uuid32bit, v as uuidEncode, x as uuidEncodeV4, y as uuidEncodeB32 } from "../uuid-CKFZfSff.mjs";
87
+ import { a as isTimeout, c as timeout, i as isPromise, l as tryTimeout, n as createPromise, o as promisify, r as immediate, s as sleep, t as AsyncReturnType, u as waitOn } from "../promise-CoWXgo4w.mjs";
88
+ import { n as throttle, t as debounce } from "../throttle-debounce-CCh0F100.mjs";
89
+ export { ArgumentsType, AsyncMutex, AsyncReturnType, BaseXAlphabet, BaseXAsChain, BaseXChain, BaseXDecodeFunction, BaseXEncodeFunction, BaseXFirst, BaseXInput, BaseXLast, BaseXOutput, BaseXTail, Bech32, Bech32Decoded, Bech32DecodedWithArray, BinInput, BinaryEncoder, BytesCoder, CRYPTO_DEFAULT_ALG, CRYPTO_DEFAULT_DERIVE_ALG, CRYPTO_DEFAULT_DERIVE_ITERATIONS, CRYPTO_DEFAULT_HASH_ALG, CRYPTO_DEFAULT_IV_LENGTH, Channel, ChannelMessageEvent, Coder, Column, CompiledQuery, CryptoEncoder, DAY_MS, Day, DayInput, DayInputLegacy, DayValue, DebugChannel, DecimalInput, DecimalValue, DefaultListener, DefaultLogger, DiffOptions, Difference, DifferenceType, Disposer, DisposerFunction, Emitter, EmitterAllHandler, EmitterHandler, EmitterSubscriberOptions, Encoder, Expect, Expr, FilterFunction, Infer, InferRow, IsEqual, Json, JsonEncoder, JsonEntryProcessor, LinkifyOptions, ListenerSignature, LocalChannel, LogConfig, LogHandler, LogHandlerOptions, LogLevel, LogLevelAlias, LogLevelAliasKey, LogLevelAliasType, LogLevelAll, LogLevelDebug, LogLevelError, LogLevelFatal, LogLevelInfo, LogLevelOff, LogLevelWarn, LogMessage, LogMessageCompact, LogOriginalConsole, LoggerConsoleHandler, LoggerContext, LoggerContextInterface, LoggerInterface, LoggerMemoryHandler, MapperFunction, MemStorage, MemStorageOptions, Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, Mutex, NamespaceFilter, NestedArray, NoopEncoder, ObjectStorage, PoolConfig, PoolTask, PoolTaskEvents, PoolTaskFn, PoolTaskIdConflictResolution, PoolTaskState, Primitive, Progress, ProgressOptions, PubSub, PubSubConfig, QueryDependencies, RPCFn, RPCMessage, RPCMode, RPCOptions, RPCOptionsBasic, RPCReturn, RX_URL, RenderMessagesOptions, ResillientChannel, ReturnType, RoundingMode, RowFromSelection, RowFromTable, SchemaEnvOptions, SchemaEnvType, SchemaValidateMessage, SelectBuilder, SerialQueue, SerializedType, Signal, SignalWatcher, SortableItem, StandardSchemaV1, TIME_DAY_MS, TIME_DAY_S, TIME_HOUR_MS, TIME_HOUR_S, TIME_MINUTE_MS, TIME_MINUTE_S, TIME_MONTH_MS, TIME_MONTH_S, TIME_WEEK_MS, TIME_WEEK_S, TIME_YEAR_MS, TIME_YEAR_S, TableColumns, TableShape, TaskEvents, TaskFn, TimerExecFunction, Type, TypeArray, TypeArrayOutput, TypeLiterals, TypeMeta, TypeObjectFixOptional, TypeTuple, TypeUnion, Uint8ArrayToDataUri, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, Uint8ArrayToWords, UseDefer, UseDispose, UseDisposeConfig, UseDisposeWithUtils, UseRPCHubType, UseStringHashPool, XRX, ZeedGlobalContext, ZeedGlobalEmitter, _decodeUtf8Polyfill, _encodeUtf8Polyfill, _useBase, and, any, array, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetArrayInPlace, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, assert, assertCondition, assertNumber, avg, base16, base32, base32ToNumber, base32agnoster, base32crockford, base32hex, base32hexnopad, base32nopad, base58, base58check, base58flickr, base58xmr, base58xrp, base64, base64nopad, base64url, base64urlnopad, bech32, bech32m, between, bitfield, blobToArrayBuffer, blobToDataUri, blobToUint8Array, boolean, browserSelectColorByName, bytes, bytesToString, cloneJsonObject, cloneObject, cmp, composeOrderby, createArray, createBase58check, createBinaryStreamDecoder, createBinaryStreamEncoder, createLocalChannelPair, createPromise, createPromiseProxy, csvParse, csvParseToObjects, csvStringify, dataUriToBlob, dataUriToMimeType, dataUriToUint8Array, dateFromSeconds, dateStringToDays, datetimeToLocal, datetimeToUTC, day, dayDay, dayDaysInMonth, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromDateUTC, dayFromParts, dayFromString, dayFromTimestamp, dayFromTimestampSeconds, dayFromToday, dayIterator, dayMonth, dayMonthOffset, dayMonthStart, dayOffset, dayRange, dayToDate, dayToDateGMT, dayToDateUTC, dayToParts, dayToString, dayToTimestamp, dayToTimestampSeconds, dayYear, dayYearOffset, dayYearStart, debounce, deburr, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeJson, decrypt, decryptAesGcm, decryptXAES, deepEqual, deepMerge, deepStripUndefinedInPlace, deriveKeyPbkdf2, deriveKeyPbkdf2CBC, deserializeSchema, detect, diffObjects, digest, distributedFilePath, double, duration, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeJson, encodeQuery, encrypt, encryptAesGcm, encryptXAES, endSortWeight, ensureKey, ensureKeyAsync, ensureUint8Array, eq, equalBinary, escapeHTML, escapeRegExp, estimateSizeForBase, exportKeyXAES, fatal, fetchBasic, fetchJson, fetchOptionType, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchOptionsType, fetchText, first, fixBrokenUtf8String, float, forEachDay, forTimes, formatBytesToHumanBase1000, formatBytesToHumanBase1024, formatMessages, formatMilliseconds, formatSecondsToTime, from, fromBase64, fromBase64String, fromCamelCase, fromHex, func, generateKeyXAES, getBuildNumber, getGlobal, getGlobalConsole, getGlobalContext, getGlobalEmitter, getGlobalLogger, getGlobalLoggerIfExists, getLocalStorage, getNamespaceFilterString, getNavigator, getPerformanceTimestamp, getSecondsFromBuildNumber, getSecureRandom, getSecureRandomIfPossible, getTimestamp, getTimestampInSeconds, getWindow, globalAny, gt, gte, helpSchemaArgs, hex, httpMethod, immediate, importKeyXAES, inArray, int, isArray, isBinaryArray, isBoolean, isBrowser, isColumn, isEmpty, isEven, isFunction, isHalf, isInteger, isLocalHost, isNotEmpty, isNotNull, isNull, isNullOrUndefined, isNumber, isObject, isPrime, isPrimeRX, isPrimitive, isPromise, isRecord, isRecordPlain, isSafeInteger, isSchemaDefault, isSchemaObject, isSchemaObjectFlat, isSchemaOptional, isSchemaPrimitive, isString, isSymbol, isTimeout, isTruthy, isUint8Array, isValue, joinLogStrings, joinToUint8Array, jsonParse, jsonStringify, jsonStringifySafe, jsonStringifySorted, jsonToUint8Array, last, like, linkifyPlainText, linkifyPlainTextSimple, linkifyPlainTextWithLineBreaks, listDistinctUnion, listGroupBy, listOfKey, listQuery, literal, logCaptureConsole, logMessageFromCompact, lt, lte, memoize, memoizeAsync, moveSortWeight, ne, none, noop, noopDisposer, not, number, numberToBase32, object, objectAssignDeepInPlace, objectAssignDescriptionInPlace, objectDescribeChange, objectFilter, objectInclusivePick, objectIsEmpty, objectMap, objectMergeDisposable, objectOmit, objectPick, objectPlain, or, parseBasicAuth, parseDate, parseFloat, parseInt, parseLogLevel, parseOrderby, parseQuery, parseSchemaArgs, parseSchemaEnv, polyfillUsing, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, real, record, regExpEscape, regExpString, renderMessages, roundArrayOfNumbersToMatchSum, roundArrayOfObjectsToMatchSum, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, rpc, safeTimeout, schemaCreateObject, schemaExportJsonSchema, schemaExportJsonSchemaString, schemaExportSwiftStruct, schemaExportTypescriptInterface, schemaParseObject, schemaValidateObject, seededRandom, select, serializeSchema, setDayTest, setTestMode, setTimestampTest, setUuidDefaultEncoding, size, sleep, sortedItems, sortedOrderby, sqlIsNotNull, sqlIsNull, startSortWeight, str, string, stringFromSchemaEnv, stringHashFNV1a, stringLiterals, stringToBoolean, stringToBytes, stringToFloat, stringToInteger, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, table, throttle, timeout, timestampMillisecondsToSeconds, timestampSecondsToMilliseconds, toArrayBuffer, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableUrl, toInt, toString, toUint8Array, toValidFilename, today, tryTimeout, tuple, uname, unameReset, unescapeHTML, union, useAsyncMutex, useBase, useDefer, useDispose, useDisposeWithUtils, useEventListener, useEventListenerOnce, useExitHandler, useInterval, useIntervalPause, useLevelFilter, useMessageHub, useMutex, useNamespaceFilter, usePool, usePubSub, useRPC, useRPCHub, useSignal, useSorted, useStringHashPool, useTimeout, utf8, utils, uuid, uuid32bit, uuidB32, uuidB62, uuidBytes, uuidDecode, uuidDecodeB32, uuidDecodeB62, uuidDecodeV4, uuidEncode, uuidEncodeB32, uuidEncodeB62, uuidEncodeV4, uuidIsValid, uuidv4, valueToBoolean, valueToBooleanNotFalse, valueToFloat, valueToInteger, valueToString, waitOn, wordsToUint8Array, z_collection_d_exports as z };
@@ -81,9 +81,12 @@ import { helpSchemaArgs, parseSchemaArgs } from "./schema/parse-args.mjs";
81
81
  import { parseSchemaEnv, stringFromSchemaEnv } from "./schema/parse-env.mjs";
82
82
  import { Type, any, array, boolean, double, float, func, int, literal, none, number, object, real, record, rpc, string, stringLiterals, tuple, union } from "./schema/schema.mjs";
83
83
  import { deserializeSchema, serializeSchema } from "./schema/serialize.mjs";
84
+ import { isColumn, table } from "./schema/sql/table.mjs";
85
+ import { and, eq, gt, gte, inArray, like, lt, lte, ne, not, or, sqlIsNotNull, sqlIsNull } from "./schema/sql/expr.mjs";
86
+ import { SelectBuilder, from, select } from "./schema/sql/select.mjs";
84
87
  import { t as z_collection_exports } from "./schema/z-collection.mjs";
85
88
  import { MemStorage } from "./storage/memstorage.mjs";
86
89
  import { setTestMode } from "./test.mjs";
87
90
  import { noop } from "./utils.mjs";
88
91
 
89
- export { BinaryEncoder, CRYPTO_DEFAULT_ALG, CRYPTO_DEFAULT_DERIVE_ALG, CRYPTO_DEFAULT_DERIVE_ITERATIONS, CRYPTO_DEFAULT_HASH_ALG, CRYPTO_DEFAULT_IV_LENGTH, Channel, CryptoEncoder, DAY_MS, Day, DebugChannel, DefaultLogger, Emitter, JsonEncoder, LocalChannel, LogLevelAlias, LogLevelAll, LogLevelDebug, LogLevelError, LogLevelFatal, LogLevelInfo, LogLevelOff, LogLevelWarn, LoggerConsoleHandler, LoggerContext, LoggerMemoryHandler, MemStorage, NoopEncoder, Progress, PubSub, RPCMode, RX_URL, ResillientChannel, SerialQueue, TIME_DAY_MS, TIME_DAY_S, TIME_HOUR_MS, TIME_HOUR_S, TIME_MINUTE_MS, TIME_MINUTE_S, TIME_MONTH_MS, TIME_MONTH_S, TIME_WEEK_MS, TIME_WEEK_S, TIME_YEAR_MS, TIME_YEAR_S, Type, Uint8ArrayToDataUri, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, Uint8ArrayToWords, XRX, _decodeUtf8Polyfill, _encodeUtf8Polyfill, _useBase, any, array, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetArrayInPlace, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, assert, assertCondition, assertNumber, avg, base16, base32, base32ToNumber, base32agnoster, base32crockford, base32hex, base32hexnopad, base32nopad, base58, base58check, base58flickr, base58xmr, base58xrp, base64, base64nopad, base64url, base64urlnopad, bech32, bech32m, between, bitfield, blobToArrayBuffer, blobToDataUri, blobToUint8Array, boolean, browserSelectColorByName, bytes, bytesToString, cloneJsonObject, cloneObject, cmp, composeOrderby, createArray, createBase58check, createBinaryStreamDecoder, createBinaryStreamEncoder, createLocalChannelPair, createPromise, createPromiseProxy, csvParse, csvParseToObjects, csvStringify, dataUriToBlob, dataUriToMimeType, dataUriToUint8Array, dateFromSeconds, dateStringToDays, datetimeToLocal, datetimeToUTC, day, dayDay, dayDaysInMonth, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromDateUTC, dayFromParts, dayFromString, dayFromTimestamp, dayFromTimestampSeconds, dayFromToday, dayIterator, dayMonth, dayMonthOffset, dayMonthStart, dayOffset, dayRange, dayToDate, dayToDateGMT, dayToDateUTC, dayToParts, dayToString, dayToTimestamp, dayToTimestampSeconds, dayYear, dayYearOffset, dayYearStart, debounce, deburr, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeJson, decrypt, decryptAesGcm, decryptXAES, deepEqual, deepMerge, deepStripUndefinedInPlace, deriveKeyPbkdf2, deriveKeyPbkdf2CBC, deserializeSchema, detect, diffObjects, digest, distributedFilePath, double, duration, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeJson, encodeQuery, encrypt, encryptAesGcm, encryptXAES, endSortWeight, ensureKey, ensureKeyAsync, ensureUint8Array, equalBinary, escapeHTML, escapeRegExp, estimateSizeForBase, exportKeyXAES, fatal, fetchBasic, fetchJson, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchText, first, fixBrokenUtf8String, float, forEachDay, forTimes, formatBytesToHumanBase1000, formatBytesToHumanBase1024, formatMessages, formatMilliseconds, formatSecondsToTime, fromBase64, fromBase64String, fromCamelCase, fromHex, func, generateKeyXAES, getBuildNumber, getGlobal, getGlobalConsole, getGlobalContext, getGlobalEmitter, getGlobalLogger, getGlobalLoggerIfExists, getLocalStorage, getNamespaceFilterString, getNavigator, getPerformanceTimestamp, getSecondsFromBuildNumber, getSecureRandom, getSecureRandomIfPossible, getTimestamp, getTimestampInSeconds, getWindow, globalAny, helpSchemaArgs, hex, immediate, importKeyXAES, int, isArray, isBinaryArray, isBoolean, isBrowser, isEmpty, isEven, isFunction, isHalf, isInteger, isLocalHost, isNotEmpty, isNotNull, isNull, isNullOrUndefined, isNumber, isObject, isPrime, isPrimeRX, isPrimitive, isPromise, isRecord, isRecordPlain, isSafeInteger, isSchemaDefault, isSchemaObject, isSchemaObjectFlat, isSchemaOptional, isSchemaPrimitive, isString, isSymbol, isTimeout, isTruthy, isUint8Array, isValue, joinLogStrings, joinToUint8Array, jsonParse, jsonStringify, jsonStringifySafe, jsonStringifySorted, jsonToUint8Array, last, linkifyPlainText, linkifyPlainTextSimple, linkifyPlainTextWithLineBreaks, listDistinctUnion, listGroupBy, listOfKey, listQuery, literal, logCaptureConsole, logMessageFromCompact, memoize, memoizeAsync, moveSortWeight, none, noop, noopDisposer, number, numberToBase32, object, objectAssignDeepInPlace, objectAssignDescriptionInPlace, objectDescribeChange, objectFilter, objectInclusivePick, objectIsEmpty, objectMap, objectMergeDisposable, objectOmit, objectPick, objectPlain, parseBasicAuth, parseDate, parseFloat, parseInt, parseLogLevel, parseOrderby, parseQuery, parseSchemaArgs, parseSchemaEnv, polyfillUsing, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, real, record, regExpEscape, regExpString, renderMessages, roundArrayOfNumbersToMatchSum, roundArrayOfObjectsToMatchSum, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, rpc, safeTimeout, schemaCreateObject, schemaExportJsonSchema, schemaExportJsonSchemaString, schemaExportSwiftStruct, schemaExportTypescriptInterface, schemaParseObject, schemaValidateObject, seededRandom, serializeSchema, setDayTest, setTestMode, setTimestampTest, setUuidDefaultEncoding, size, sleep, sortedItems, sortedOrderby, startSortWeight, str, string, stringFromSchemaEnv, stringHashFNV1a, stringLiterals, stringToBoolean, stringToBytes, stringToFloat, stringToInteger, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, throttle, timeout, timestampMillisecondsToSeconds, timestampSecondsToMilliseconds, toArrayBuffer, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableUrl, toInt, toString, toUint8Array, toValidFilename, today, tryTimeout, tuple, uname, unameReset, unescapeHTML, union, useAsyncMutex, useBase, useDefer, useDispose, useDisposeWithUtils, useEventListener, useEventListenerOnce, useExitHandler, useInterval, useIntervalPause, useLevelFilter, useMessageHub, useMutex, useNamespaceFilter, usePool, usePubSub, useRPC, useRPCHub, useSignal, useSorted, useStringHashPool, useTimeout, utf8, utils, uuid, uuid32bit, uuidB32, uuidB62, uuidBytes, uuidDecode, uuidDecodeB32, uuidDecodeB62, uuidDecodeV4, uuidEncode, uuidEncodeB32, uuidEncodeB62, uuidEncodeV4, uuidIsValid, uuidv4, valueToBoolean, valueToBooleanNotFalse, valueToFloat, valueToInteger, valueToString, waitOn, wordsToUint8Array, z_collection_exports as z };
92
+ export { BinaryEncoder, CRYPTO_DEFAULT_ALG, CRYPTO_DEFAULT_DERIVE_ALG, CRYPTO_DEFAULT_DERIVE_ITERATIONS, CRYPTO_DEFAULT_HASH_ALG, CRYPTO_DEFAULT_IV_LENGTH, Channel, CryptoEncoder, DAY_MS, Day, DebugChannel, DefaultLogger, Emitter, JsonEncoder, LocalChannel, LogLevelAlias, LogLevelAll, LogLevelDebug, LogLevelError, LogLevelFatal, LogLevelInfo, LogLevelOff, LogLevelWarn, LoggerConsoleHandler, LoggerContext, LoggerMemoryHandler, MemStorage, NoopEncoder, Progress, PubSub, RPCMode, RX_URL, ResillientChannel, SelectBuilder, SerialQueue, TIME_DAY_MS, TIME_DAY_S, TIME_HOUR_MS, TIME_HOUR_S, TIME_MINUTE_MS, TIME_MINUTE_S, TIME_MONTH_MS, TIME_MONTH_S, TIME_WEEK_MS, TIME_WEEK_S, TIME_YEAR_MS, TIME_YEAR_S, Type, Uint8ArrayToDataUri, Uint8ArrayToHexDump, Uint8ArrayToJson, Uint8ArrayToString, Uint8ArrayToWords, XRX, _decodeUtf8Polyfill, _encodeUtf8Polyfill, _useBase, and, any, array, arrayAvg, arrayBatches, arrayEmptyInPlace, arrayFilterInPlace, arrayFlatten, arrayIntersection, arrayIsEqual, arrayMax, arrayMin, arrayMinus, arrayRandomElement, arrayRemoveElement, arraySetArrayInPlace, arraySetElement, arrayShuffle, arrayShuffleForce, arrayShuffleInPlace, arraySorted, arraySortedNumbers, arraySum, arraySymmetricDifference, arrayToggleInPlace, arrayUnion, arrayUnique, assert, assertCondition, assertNumber, avg, base16, base32, base32ToNumber, base32agnoster, base32crockford, base32hex, base32hexnopad, base32nopad, base58, base58check, base58flickr, base58xmr, base58xrp, base64, base64nopad, base64url, base64urlnopad, bech32, bech32m, between, bitfield, blobToArrayBuffer, blobToDataUri, blobToUint8Array, boolean, browserSelectColorByName, bytes, bytesToString, cloneJsonObject, cloneObject, cmp, composeOrderby, createArray, createBase58check, createBinaryStreamDecoder, createBinaryStreamEncoder, createLocalChannelPair, createPromise, createPromiseProxy, csvParse, csvParseToObjects, csvStringify, dataUriToBlob, dataUriToMimeType, dataUriToUint8Array, dateFromSeconds, dateStringToDays, datetimeToLocal, datetimeToUTC, day, dayDay, dayDaysInMonth, dayDiff, dayFromAny, dayFromDate, dayFromDateGMT, dayFromDateUTC, dayFromParts, dayFromString, dayFromTimestamp, dayFromTimestampSeconds, dayFromToday, dayIterator, dayMonth, dayMonthOffset, dayMonthStart, dayOffset, dayRange, dayToDate, dayToDateGMT, dayToDateUTC, dayToParts, dayToString, dayToTimestamp, dayToTimestampSeconds, dayYear, dayYearOffset, dayYearStart, debounce, deburr, decimal, decimalCentsPart, decimalFromCents, decimalToCents, decodeBase16, decodeBase32, decodeBase58, decodeBase62, decodeJson, decrypt, decryptAesGcm, decryptXAES, deepEqual, deepMerge, deepStripUndefinedInPlace, deriveKeyPbkdf2, deriveKeyPbkdf2CBC, deserializeSchema, detect, diffObjects, digest, distributedFilePath, double, duration, empty, encodeBase16, encodeBase32, encodeBase58, encodeBase62, encodeJson, encodeQuery, encrypt, encryptAesGcm, encryptXAES, endSortWeight, ensureKey, ensureKeyAsync, ensureUint8Array, eq, equalBinary, escapeHTML, escapeRegExp, estimateSizeForBase, exportKeyXAES, fatal, fetchBasic, fetchJson, fetchOptionsBasicAuth, fetchOptionsFormURLEncoded, fetchOptionsJson, fetchText, first, fixBrokenUtf8String, float, forEachDay, forTimes, formatBytesToHumanBase1000, formatBytesToHumanBase1024, formatMessages, formatMilliseconds, formatSecondsToTime, from, fromBase64, fromBase64String, fromCamelCase, fromHex, func, generateKeyXAES, getBuildNumber, getGlobal, getGlobalConsole, getGlobalContext, getGlobalEmitter, getGlobalLogger, getGlobalLoggerIfExists, getLocalStorage, getNamespaceFilterString, getNavigator, getPerformanceTimestamp, getSecondsFromBuildNumber, getSecureRandom, getSecureRandomIfPossible, getTimestamp, getTimestampInSeconds, getWindow, globalAny, gt, gte, helpSchemaArgs, hex, immediate, importKeyXAES, inArray, int, isArray, isBinaryArray, isBoolean, isBrowser, isColumn, isEmpty, isEven, isFunction, isHalf, isInteger, isLocalHost, isNotEmpty, isNotNull, isNull, isNullOrUndefined, isNumber, isObject, isPrime, isPrimeRX, isPrimitive, isPromise, isRecord, isRecordPlain, isSafeInteger, isSchemaDefault, isSchemaObject, isSchemaObjectFlat, isSchemaOptional, isSchemaPrimitive, isString, isSymbol, isTimeout, isTruthy, isUint8Array, isValue, joinLogStrings, joinToUint8Array, jsonParse, jsonStringify, jsonStringifySafe, jsonStringifySorted, jsonToUint8Array, last, like, linkifyPlainText, linkifyPlainTextSimple, linkifyPlainTextWithLineBreaks, listDistinctUnion, listGroupBy, listOfKey, listQuery, literal, logCaptureConsole, logMessageFromCompact, lt, lte, memoize, memoizeAsync, moveSortWeight, ne, none, noop, noopDisposer, not, number, numberToBase32, object, objectAssignDeepInPlace, objectAssignDescriptionInPlace, objectDescribeChange, objectFilter, objectInclusivePick, objectIsEmpty, objectMap, objectMergeDisposable, objectOmit, objectPick, objectPlain, or, parseBasicAuth, parseDate, parseFloat, parseInt, parseLogLevel, parseOrderby, parseQuery, parseSchemaArgs, parseSchemaEnv, polyfillUsing, promisify, qid, randomBoolean, randomFloat, randomInt, randomUint8Array, real, record, regExpEscape, regExpString, renderMessages, roundArrayOfNumbersToMatchSum, roundArrayOfObjectsToMatchSum, roundDown, roundHalfAwayFromZero, roundHalfDown, roundHalfEven, roundHalfOdd, roundHalfTowardsZero, roundHalfUp, roundUp, rpc, safeTimeout, schemaCreateObject, schemaExportJsonSchema, schemaExportJsonSchemaString, schemaExportSwiftStruct, schemaExportTypescriptInterface, schemaParseObject, schemaValidateObject, seededRandom, select, serializeSchema, setDayTest, setTestMode, setTimestampTest, setUuidDefaultEncoding, size, sleep, sortedItems, sortedOrderby, sqlIsNotNull, sqlIsNull, startSortWeight, str, string, stringFromSchemaEnv, stringHashFNV1a, stringLiterals, stringToBoolean, stringToBytes, stringToFloat, stringToInteger, stringToUInt8Array, suid, suidBytes, suidBytesDate, suidDate, sum, table, throttle, timeout, timestampMillisecondsToSeconds, timestampSecondsToMilliseconds, toArrayBuffer, toBase64, toBase64Url, toBool, toCamelCase, toCapitalize, toCapitalizeWords, toFloat, toHex, toHumanReadableUrl, toInt, toString, toUint8Array, toValidFilename, today, tryTimeout, tuple, uname, unameReset, unescapeHTML, union, useAsyncMutex, useBase, useDefer, useDispose, useDisposeWithUtils, useEventListener, useEventListenerOnce, useExitHandler, useInterval, useIntervalPause, useLevelFilter, useMessageHub, useMutex, useNamespaceFilter, usePool, usePubSub, useRPC, useRPCHub, useSignal, useSorted, useStringHashPool, useTimeout, utf8, utils, uuid, uuid32bit, uuidB32, uuidB62, uuidBytes, uuidDecode, uuidDecodeB32, uuidDecodeB62, uuidDecodeV4, uuidEncode, uuidEncodeB32, uuidEncodeB62, uuidEncodeV4, uuidIsValid, uuidv4, valueToBoolean, valueToBooleanNotFalse, valueToFloat, valueToInteger, valueToString, waitOn, wordsToUint8Array, z_collection_exports as z };
@@ -1,2 +1,2 @@
1
- import { k as DebugChannel } from "../../index-DHXVOH8h.cjs";
1
+ import { k as DebugChannel } from "../../index-CFkMqHvX.cjs";
2
2
  export { DebugChannel };
@@ -1,2 +1,2 @@
1
- import { k as DebugChannel } from "../../index-DMaPyx9O.mjs";
1
+ import { k as DebugChannel } from "../../index-C_3Y_s6f.mjs";
2
2
  export { DebugChannel };
@@ -1,2 +1,2 @@
1
- import { D as LocalChannel, O as createLocalChannelPair } from "../../index-DHXVOH8h.cjs";
1
+ import { D as LocalChannel, O as createLocalChannelPair } from "../../index-CFkMqHvX.cjs";
2
2
  export { LocalChannel, createLocalChannelPair };
@@ -1,2 +1,2 @@
1
- import { D as LocalChannel, O as createLocalChannelPair } from "../../index-DMaPyx9O.mjs";
1
+ import { D as LocalChannel, O as createLocalChannelPair } from "../../index-C_3Y_s6f.mjs";
2
2
  export { LocalChannel, createLocalChannelPair };
@@ -1,2 +1,2 @@
1
- import { E as ResillientChannel } from "../../index-DHXVOH8h.cjs";
1
+ import { E as ResillientChannel } from "../../index-CFkMqHvX.cjs";
2
2
  export { ResillientChannel };
@@ -1,2 +1,2 @@
1
- import { E as ResillientChannel } from "../../index-DMaPyx9O.mjs";
1
+ import { E as ResillientChannel } from "../../index-C_3Y_s6f.mjs";
2
2
  export { ResillientChannel };
@@ -1,4 +1,5 @@
1
- import { A as Channel } from "../../index-DHXVOH8h.cjs";
1
+ import { A as Channel } from "../../index-CFkMqHvX.cjs";
2
+
2
3
  //#region src/common/msg/channel-wkwebview.d.ts
3
4
  declare class WKWebViewChannel extends Channel {
4
5
  private bridgeName;
@@ -1,4 +1,5 @@
1
- import { A as Channel } from "../../index-DMaPyx9O.mjs";
1
+ import { A as Channel } from "../../index-C_3Y_s6f.mjs";
2
+
2
3
  //#region src/common/msg/channel-wkwebview.d.ts
3
4
  declare class WKWebViewChannel extends Channel {
4
5
  private bridgeName;
@@ -1,2 +1,2 @@
1
- import { A as Channel, j as ChannelMessageEvent } from "../../index-DHXVOH8h.cjs";
1
+ import { A as Channel, j as ChannelMessageEvent } from "../../index-CFkMqHvX.cjs";
2
2
  export { Channel, ChannelMessageEvent };
@@ -1,2 +1,2 @@
1
- import { A as Channel, j as ChannelMessageEvent } from "../../index-DMaPyx9O.mjs";
1
+ import { A as Channel, j as ChannelMessageEvent } from "../../index-C_3Y_s6f.mjs";
2
2
  export { Channel, ChannelMessageEvent };
@@ -1,2 +1,2 @@
1
- import { F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, P as EmitterAllHandler, R as ZeedGlobalEmitter, z as getGlobalEmitter } from "../../index-DHXVOH8h.cjs";
1
+ import { F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, P as EmitterAllHandler, R as ZeedGlobalEmitter, z as getGlobalEmitter } from "../../index-CFkMqHvX.cjs";
2
2
  export { DefaultListener, Emitter, EmitterAllHandler, EmitterHandler, EmitterSubscriberOptions, ListenerSignature, ZeedGlobalEmitter, getGlobalEmitter };
@@ -1,2 +1,2 @@
1
- import { F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, P as EmitterAllHandler, R as ZeedGlobalEmitter, z as getGlobalEmitter } from "../../index-DMaPyx9O.mjs";
1
+ import { F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, P as EmitterAllHandler, R as ZeedGlobalEmitter, z as getGlobalEmitter } from "../../index-C_3Y_s6f.mjs";
2
2
  export { DefaultListener, Emitter, EmitterAllHandler, EmitterHandler, EmitterSubscriberOptions, ListenerSignature, ZeedGlobalEmitter, getGlobalEmitter };
@@ -1,4 +1,4 @@
1
1
  import { i as NoopEncoder, n as Encoder, r as JsonEncoder, t as CryptoEncoder } from "../../encoder-7xERHWCp.cjs";
2
- import { A as Channel, C as MessagesOptions, D as LocalChannel, E as ResillientChannel, F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, O as createLocalChannelPair, P as EmitterAllHandler, R as ZeedGlobalEmitter, S as MessagesMethods, T as useMessageHub, _ as MessageAction, b as MessageResult, g as Message, h as usePubSub, j as ChannelMessageEvent, k as DebugChannel, m as PubSubConfig, p as PubSub, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub, z as getGlobalEmitter } from "../../index-DHXVOH8h.cjs";
2
+ import { A as Channel, C as MessagesOptions, D as LocalChannel, E as ResillientChannel, F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, O as createLocalChannelPair, P as EmitterAllHandler, R as ZeedGlobalEmitter, S as MessagesMethods, T as useMessageHub, _ as MessageAction, b as MessageResult, g as Message, h as usePubSub, j as ChannelMessageEvent, k as DebugChannel, m as PubSubConfig, p as PubSub, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub, z as getGlobalEmitter } from "../../index-CFkMqHvX.cjs";
3
3
  import { a as RPCOptions, c as ReturnType, d as useRPCHub, i as RPCMode, l as UseRPCHubType, n as RPCFn, o as RPCOptionsBasic, r as RPCMessage, s as RPCReturn, t as ArgumentsType, u as useRPC } from "../../rpc-5Ln_Xp7t.cjs";
4
4
  export { ArgumentsType, Channel, ChannelMessageEvent, CryptoEncoder, DebugChannel, DefaultListener, Emitter, EmitterAllHandler, EmitterHandler, EmitterSubscriberOptions, Encoder, JsonEncoder, ListenerSignature, LocalChannel, Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, NoopEncoder, PubSub, PubSubConfig, RPCFn, RPCMessage, RPCMode, RPCOptions, RPCOptionsBasic, RPCReturn, ResillientChannel, ReturnType, UseRPCHubType, ZeedGlobalEmitter, createLocalChannelPair, createPromiseProxy, getGlobalEmitter, useMessageHub, usePubSub, useRPC, useRPCHub };
@@ -1,4 +1,4 @@
1
1
  import { i as NoopEncoder, n as Encoder, r as JsonEncoder, t as CryptoEncoder } from "../../encoder-BcdNE4uv.mjs";
2
- import { A as Channel, C as MessagesOptions, D as LocalChannel, E as ResillientChannel, F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, O as createLocalChannelPair, P as EmitterAllHandler, R as ZeedGlobalEmitter, S as MessagesMethods, T as useMessageHub, _ as MessageAction, b as MessageResult, g as Message, h as usePubSub, j as ChannelMessageEvent, k as DebugChannel, m as PubSubConfig, p as PubSub, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub, z as getGlobalEmitter } from "../../index-DMaPyx9O.mjs";
2
+ import { A as Channel, C as MessagesOptions, D as LocalChannel, E as ResillientChannel, F as EmitterHandler, I as EmitterSubscriberOptions, L as ListenerSignature, M as DefaultListener, N as Emitter, O as createLocalChannelPair, P as EmitterAllHandler, R as ZeedGlobalEmitter, S as MessagesMethods, T as useMessageHub, _ as MessageAction, b as MessageResult, g as Message, h as usePubSub, j as ChannelMessageEvent, k as DebugChannel, m as PubSubConfig, p as PubSub, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub, z as getGlobalEmitter } from "../../index-C_3Y_s6f.mjs";
3
3
  import { a as RPCOptions, c as ReturnType, d as useRPCHub, i as RPCMode, l as UseRPCHubType, n as RPCFn, o as RPCOptionsBasic, r as RPCMessage, s as RPCReturn, t as ArgumentsType, u as useRPC } from "../../rpc-DX1FYLVn.mjs";
4
4
  export { ArgumentsType, Channel, ChannelMessageEvent, CryptoEncoder, DebugChannel, DefaultListener, Emitter, EmitterAllHandler, EmitterHandler, EmitterSubscriberOptions, Encoder, JsonEncoder, ListenerSignature, LocalChannel, Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, NoopEncoder, PubSub, PubSubConfig, RPCFn, RPCMessage, RPCMode, RPCOptions, RPCOptionsBasic, RPCReturn, ResillientChannel, ReturnType, UseRPCHubType, ZeedGlobalEmitter, createLocalChannelPair, createPromiseProxy, getGlobalEmitter, useMessageHub, usePubSub, useRPC, useRPCHub };
@@ -1,2 +1,2 @@
1
- import { C as MessagesOptions, S as MessagesMethods, T as useMessageHub, _ as MessageAction, b as MessageResult, g as Message, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub } from "../../index-DHXVOH8h.cjs";
1
+ import { C as MessagesOptions, S as MessagesMethods, T as useMessageHub, _ as MessageAction, b as MessageResult, g as Message, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub } from "../../index-CFkMqHvX.cjs";
2
2
  export { Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, createPromiseProxy, useMessageHub };
@@ -1,2 +1,2 @@
1
- import { C as MessagesOptions, S as MessagesMethods, T as useMessageHub, _ as MessageAction, b as MessageResult, g as Message, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub } from "../../index-DMaPyx9O.mjs";
1
+ import { C as MessagesOptions, S as MessagesMethods, T as useMessageHub, _ as MessageAction, b as MessageResult, g as Message, v as MessageDefinitions, w as createPromiseProxy, x as MessagesDefaultMethods, y as MessageHub } from "../../index-C_3Y_s6f.mjs";
2
2
  export { Message, MessageAction, MessageDefinitions, MessageHub, MessageResult, MessagesDefaultMethods, MessagesMethods, MessagesOptions, createPromiseProxy, useMessageHub };
@@ -1,2 +1,2 @@
1
- import { h as usePubSub, m as PubSubConfig, p as PubSub } from "../../index-DHXVOH8h.cjs";
1
+ import { h as usePubSub, m as PubSubConfig, p as PubSub } from "../../index-CFkMqHvX.cjs";
2
2
  export { PubSub, PubSubConfig, usePubSub };
@@ -1,2 +1,2 @@
1
- import { h as usePubSub, m as PubSubConfig, p as PubSub } from "../../index-DMaPyx9O.mjs";
1
+ import { h as usePubSub, m as PubSubConfig, p as PubSub } from "../../index-C_3Y_s6f.mjs";
2
2
  export { PubSub, PubSubConfig, usePubSub };
@@ -30,10 +30,10 @@ function setupRPCBasic(options, functions, eventNames = []) {
30
30
  try {
31
31
  const msg = await deserialize(data);
32
32
  const mode = msg?.[0];
33
- const id = mode === RPCMode.event ? 0 : msg?.[1];
34
- const [method, ...args] = msg.slice(mode === RPCMode.event ? 1 : 2);
33
+ const id = mode === 2 ? 0 : msg?.[1];
34
+ const [method, ...args] = msg.slice(mode === 2 ? 1 : 2);
35
35
  const methodName = stringHashPool?.stringForHash(method) ?? method;
36
- if (mode === RPCMode.request || mode === RPCMode.event) {
36
+ if (mode === 1 || mode === 2) {
37
37
  let result, error;
38
38
  if (method != null) try {
39
39
  const fn = functions[methodName];
@@ -47,11 +47,11 @@ function setupRPCBasic(options, functions, eventNames = []) {
47
47
  onError?.(error, method ?? "", args);
48
48
  }
49
49
  if (id > 0) await post(await serialize(error ? [
50
- RPCMode.reject,
50
+ 4,
51
51
  id,
52
52
  error
53
53
  ] : [
54
- RPCMode.resolve,
54
+ 3,
55
55
  id,
56
56
  result
57
57
  ]));
@@ -59,7 +59,7 @@ function setupRPCBasic(options, functions, eventNames = []) {
59
59
  const promise = rpcPromiseMap.get(id);
60
60
  if (promise != null) {
61
61
  clearTimeout(promise.timeoutId);
62
- if (mode === RPCMode.reject && exceptions === true) promise.reject(method);
62
+ if (mode === 4 && exceptions === true) promise.reject(method);
63
63
  else promise.resolve(method);
64
64
  }
65
65
  rpcPromiseMap.delete(id);
@@ -75,7 +75,7 @@ function setupRPCBasic(options, functions, eventNames = []) {
75
75
  proxyHandler: { get(_, methodName) {
76
76
  const method = stringHashPool?.hash(methodName) ?? methodName;
77
77
  const sendEvent = async (...args) => await post(await serialize([
78
- RPCMode.event,
78
+ 2,
79
79
  method,
80
80
  ...args
81
81
  ]));
@@ -105,7 +105,7 @@ function setupRPCBasic(options, functions, eventNames = []) {
105
105
  timeoutId
106
106
  });
107
107
  await post(await serialize([
108
- RPCMode.request,
108
+ 1,
109
109
  id,
110
110
  method,
111
111
  ...args
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.cjs","names":["createPromise"],"sources":["../../../src/common/msg/rpc.ts"],"sourcesContent":["// From https://github.com/antfu/birpc/blob/main/src/index.ts MIT\n\nimport type { UseStringHashPool } from '../data/string-hash-pool'\nimport type { LoggerInterface } from '../log/log-base'\nimport type { Pipe } from './pipe'\nimport { createPromise } from '../exec/promise'\n\nexport type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never\nexport type ReturnType<T> = T extends (...args: any) => infer R ? R : never\n\nexport interface RPCOptionsBasic extends Pipe {\n /** No return values expected */\n onlyEvents?: boolean\n /** Maximum timeout for waiting for response, in milliseconds */\n timeout?: number\n /** Custom logger */\n log?: LoggerInterface\n /** Custom error handler */\n onError?: (error: Error, functionName: string, args: any[]) => boolean | void\n /** Custom error handler for timeouts */\n onTimeoutError?: (functionName: string, args: any[]) => boolean | void\n /** Throw execptions. Default: true */\n exceptions?: boolean\n /** */\n stringHashPool?: UseStringHashPool\n}\n\nexport interface RPCOptions<Remote> extends RPCOptionsBasic {\n // /** No return values expected */\n // onlyEvents?: boolean\n /** Names of remote functions that do not need response. */\n eventNames?: (keyof Remote)[]\n}\n\nexport interface RPCFn<T> {\n /** Call the remote function and wait for the result. */\n (...args: ArgumentsType<T>): Promise<Awaited<ReturnType<T>>>\n /** Send event without asking for response */\n asEvent: (...args: ArgumentsType<T>) => void\n}\n\nexport type RPCReturn<RemoteFunctions> = {\n [K in keyof RemoteFunctions]: RPCFn<RemoteFunctions[K]>\n}\n\nlet rpcCounter = 1\n\nexport enum RPCMode {\n request = 1,\n event = 2,\n resolve = 3,\n reject = 4,\n}\n\nexport type RPCMessage = [\n mode: RPCMode,\n id: number,\n method: string | number | any,\n ...any,\n]\n\nconst defaultSerialize = (i: any) => i\nconst defaultDeserialize = defaultSerialize\n\nfunction setupRPCBasic(options: RPCOptionsBasic, functions: Record<string, (...args: any) => Promise<any>>, eventNames: string[] = []) {\n const {\n log,\n post,\n on,\n serialize = defaultSerialize,\n deserialize = defaultDeserialize,\n timeout = 60e3,\n onError,\n onTimeoutError,\n onlyEvents = false,\n exceptions = true,\n stringHashPool,\n } = options\n\n if (stringHashPool) {\n Object.keys(functions).forEach(stringHashPool.hash)\n }\n\n function checkEventNames(eventNames: string[]) {\n // eventNames.forEach((n) => {\n // if (functions[n] == null)\n // throw new Error(`event name ${n} has no registered function`)\n // })\n }\n\n checkEventNames(eventNames)\n\n function registerFunctions(additionalFunctions: any) {\n Object.assign(functions, additionalFunctions ?? {})\n if (stringHashPool)\n Object.keys(additionalFunctions).forEach(stringHashPool.hash)\n }\n\n function registerEventNames(additionalEventNames: string[]) {\n checkEventNames(additionalEventNames)\n eventNames.push(...additionalEventNames)\n }\n\n const rpcPromiseMap = new Map<number, {\n resolve: (...args: any) => any\n reject: (...args: any) => any\n timeoutId: Parameters<typeof clearTimeout>[0]\n }>()\n\n on(async (data) => {\n try {\n const msg = await deserialize(data) as RPCMessage\n const mode = msg?.[0]\n const id = mode === RPCMode.event ? 0 : msg?.[1]\n const [method, ...args] = msg.slice(mode === RPCMode.event ? 1 : 2)\n const methodName = stringHashPool?.stringForHash(method) ?? method\n if (mode === RPCMode.request || mode === RPCMode.event) {\n let result, error: any\n if (method != null) {\n try {\n const fn = functions[methodName]\n result = await fn(...args)\n }\n catch (e) {\n error = String(e)\n }\n }\n else {\n error = 'Method implementation missing'\n }\n if (error) {\n log?.warn('error', msg, error)\n onError?.(error, method ?? '', args)\n }\n if (id > 0) {\n const data = await serialize(error\n ? [RPCMode.reject, id, error]\n : [RPCMode.resolve, id, result])\n await post(data)\n }\n }\n else if (id) {\n const promise = rpcPromiseMap.get(id)\n if (promise != null) {\n clearTimeout(promise.timeoutId)\n if (mode === RPCMode.reject && exceptions === true)\n promise.reject(method)\n else\n promise.resolve(method)\n }\n rpcPromiseMap.delete(id)\n }\n }\n catch (err) {\n log?.warn('Error on handling RPC data. Invalid?', err, data)\n }\n })\n\n const proxyHandler = {\n get(_: any, methodName: string) {\n const method = stringHashPool?.hash(methodName) ?? methodName\n const sendEvent = async (...args: any[]) => await post(await serialize([RPCMode.event, method, ...args]))\n\n if (onlyEvents || eventNames.includes(methodName)) {\n sendEvent.asEvent = sendEvent\n return sendEvent\n }\n\n const sendCall = async (...args: any[]) => {\n const [promise, resolve, reject] = createPromise()\n const id = rpcCounter++\n\n let timeoutId: any\n if (timeout >= 0) {\n timeoutId = setTimeout(() => {\n try {\n // Custom onTimeoutError handler can throw its own error too\n onTimeoutError?.(methodName, args)\n throw new Error(`rpc timeout on calling \"${methodName}\"`)\n }\n catch (e) {\n if (exceptions === true)\n reject(e)\n else\n resolve(undefined)\n }\n rpcPromiseMap.delete(id)\n\n // Garbage Collection https://jakearchibald.com/2024/garbage-collection-and-closures/\n clearTimeout(timeoutId)\n timeoutId = undefined\n }, timeout).unref?.()\n }\n\n rpcPromiseMap.set(id, { resolve, reject, timeoutId })\n const data = await serialize([RPCMode.request, id, method, ...args])\n await post(data)\n return promise\n }\n sendCall.asEvent = sendEvent\n return sendCall\n },\n }\n\n return {\n post,\n serialize,\n rpcPromiseMap,\n proxyHandler,\n registerFunctions,\n registerEventNames,\n }\n}\n\nexport function useRPC<LocalFunctions, RemoteFunctions = LocalFunctions>(\n functions: LocalFunctions,\n options: RPCOptions<RemoteFunctions>,\n): RPCReturn<RemoteFunctions> {\n const { eventNames = [] } = options\n\n const { proxyHandler } = setupRPCBasic(options, functions as any, eventNames as any)\n\n return new Proxy({}, proxyHandler)\n}\n\nexport function useRPCHub(options: RPCOptionsBasic) {\n const eventNames: string[] = []\n const functions: Record<string, any> = {}\n\n const {\n proxyHandler,\n registerFunctions,\n registerEventNames,\n } = setupRPCBasic(options, functions, eventNames)\n\n function createRPCProxy() {\n return new Proxy({}, proxyHandler)\n }\n\n return function<LocalFunctions, RemoteFunctions = LocalFunctions>(\n additionalFunctions?: LocalFunctions,\n additionalEventNames: string[] = [],\n ): RPCReturn<RemoteFunctions> {\n registerFunctions(additionalFunctions ?? {})\n registerEventNames(additionalEventNames)\n return createRPCProxy()\n }\n}\n\nexport type UseRPCHubType = ReturnType<typeof useRPCHub>\n\n// Syntax test case\n// async function _demo() {\n// const hub: UseRPCHubType = {} as any\n// const x = hub({\n// test(name: string): string {\n// return name\n// },\n// })\n// await x.test('dsd')\n// }\n"],"mappings":";;;;AA6CA,IAAI,aAAa;AAEjB,IAAY,UA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UAAO;KAEV;EAOC;EACA;EACD;;AAGH,SAAgB,OACd,WACA,SAC4B;CAC5B,MAAM,EAAE,aAAa,EAAE,KAAK;CAE5B,MAAM,EAAE,iBAAiB,cAAc,SAAS,WAAkB,WAAkB;AAEpF,QAAO,IAAI,MAAM,EAAE,EAAE,aAAa;;AAGpC,SAAgB,UAAU,SAA0B;CAIlD,MAAM,EACJ,cACA,mBACA,uBACE,cAAc,SANqB,EAAE,EADZ,EAAE,CAOkB;CAEjD,SAAS,iBAAiB;AACxB,SAAO,IAAI,MAAM,EAAE,EAAE,aAAa;;AAGpC,QAAO,SACL,qBACA,uBAAiC,EAAE,EACP;AAC5B,oBAAkB,uBAAuB,EAAE,CAAC;AAC5C,qBAAmB,qBAAqB;AACxC,SAAO,gBAAgB"}
1
+ {"version":3,"file":"rpc.cjs","names":["createPromise"],"sources":["../../../src/common/msg/rpc.ts"],"sourcesContent":["// From https://github.com/antfu/birpc/blob/main/src/index.ts MIT\n\nimport type { UseStringHashPool } from '../data/string-hash-pool'\nimport type { LoggerInterface } from '../log/log-base'\nimport type { Pipe } from './pipe'\nimport { createPromise } from '../exec/promise'\n\nexport type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never\nexport type ReturnType<T> = T extends (...args: any) => infer R ? R : never\n\nexport interface RPCOptionsBasic extends Pipe {\n /** No return values expected */\n onlyEvents?: boolean\n /** Maximum timeout for waiting for response, in milliseconds */\n timeout?: number\n /** Custom logger */\n log?: LoggerInterface\n /** Custom error handler */\n onError?: (error: Error, functionName: string, args: any[]) => boolean | void\n /** Custom error handler for timeouts */\n onTimeoutError?: (functionName: string, args: any[]) => boolean | void\n /** Throw execptions. Default: true */\n exceptions?: boolean\n /** */\n stringHashPool?: UseStringHashPool\n}\n\nexport interface RPCOptions<Remote> extends RPCOptionsBasic {\n // /** No return values expected */\n // onlyEvents?: boolean\n /** Names of remote functions that do not need response. */\n eventNames?: (keyof Remote)[]\n}\n\nexport interface RPCFn<T> {\n /** Call the remote function and wait for the result. */\n (...args: ArgumentsType<T>): Promise<Awaited<ReturnType<T>>>\n /** Send event without asking for response */\n asEvent: (...args: ArgumentsType<T>) => void\n}\n\nexport type RPCReturn<RemoteFunctions> = {\n [K in keyof RemoteFunctions]: RPCFn<RemoteFunctions[K]>\n}\n\nlet rpcCounter = 1\n\nexport enum RPCMode {\n request = 1,\n event = 2,\n resolve = 3,\n reject = 4,\n}\n\nexport type RPCMessage = [\n mode: RPCMode,\n id: number,\n method: string | number | any,\n ...any,\n]\n\nconst defaultSerialize = (i: any) => i\nconst defaultDeserialize = defaultSerialize\n\nfunction setupRPCBasic(options: RPCOptionsBasic, functions: Record<string, (...args: any) => Promise<any>>, eventNames: string[] = []) {\n const {\n log,\n post,\n on,\n serialize = defaultSerialize,\n deserialize = defaultDeserialize,\n timeout = 60e3,\n onError,\n onTimeoutError,\n onlyEvents = false,\n exceptions = true,\n stringHashPool,\n } = options\n\n if (stringHashPool) {\n Object.keys(functions).forEach(stringHashPool.hash)\n }\n\n function checkEventNames(eventNames: string[]) {\n // eventNames.forEach((n) => {\n // if (functions[n] == null)\n // throw new Error(`event name ${n} has no registered function`)\n // })\n }\n\n checkEventNames(eventNames)\n\n function registerFunctions(additionalFunctions: any) {\n Object.assign(functions, additionalFunctions ?? {})\n if (stringHashPool)\n Object.keys(additionalFunctions).forEach(stringHashPool.hash)\n }\n\n function registerEventNames(additionalEventNames: string[]) {\n checkEventNames(additionalEventNames)\n eventNames.push(...additionalEventNames)\n }\n\n const rpcPromiseMap = new Map<number, {\n resolve: (...args: any) => any\n reject: (...args: any) => any\n timeoutId: Parameters<typeof clearTimeout>[0]\n }>()\n\n on(async (data) => {\n try {\n const msg = await deserialize(data) as RPCMessage\n const mode = msg?.[0]\n const id = mode === RPCMode.event ? 0 : msg?.[1]\n const [method, ...args] = msg.slice(mode === RPCMode.event ? 1 : 2)\n const methodName = stringHashPool?.stringForHash(method) ?? method\n if (mode === RPCMode.request || mode === RPCMode.event) {\n let result, error: any\n if (method != null) {\n try {\n const fn = functions[methodName]\n result = await fn(...args)\n }\n catch (e) {\n error = String(e)\n }\n }\n else {\n error = 'Method implementation missing'\n }\n if (error) {\n log?.warn('error', msg, error)\n onError?.(error, method ?? '', args)\n }\n if (id > 0) {\n const data = await serialize(error\n ? [RPCMode.reject, id, error]\n : [RPCMode.resolve, id, result])\n await post(data)\n }\n }\n else if (id) {\n const promise = rpcPromiseMap.get(id)\n if (promise != null) {\n clearTimeout(promise.timeoutId)\n if (mode === RPCMode.reject && exceptions === true)\n promise.reject(method)\n else\n promise.resolve(method)\n }\n rpcPromiseMap.delete(id)\n }\n }\n catch (err) {\n log?.warn('Error on handling RPC data. Invalid?', err, data)\n }\n })\n\n const proxyHandler = {\n get(_: any, methodName: string) {\n const method = stringHashPool?.hash(methodName) ?? methodName\n const sendEvent = async (...args: any[]) => await post(await serialize([RPCMode.event, method, ...args]))\n\n if (onlyEvents || eventNames.includes(methodName)) {\n sendEvent.asEvent = sendEvent\n return sendEvent\n }\n\n const sendCall = async (...args: any[]) => {\n const [promise, resolve, reject] = createPromise()\n const id = rpcCounter++\n\n let timeoutId: any\n if (timeout >= 0) {\n timeoutId = setTimeout(() => {\n try {\n // Custom onTimeoutError handler can throw its own error too\n onTimeoutError?.(methodName, args)\n throw new Error(`rpc timeout on calling \"${methodName}\"`)\n }\n catch (e) {\n if (exceptions === true)\n reject(e)\n else\n resolve(undefined)\n }\n rpcPromiseMap.delete(id)\n\n // Garbage Collection https://jakearchibald.com/2024/garbage-collection-and-closures/\n clearTimeout(timeoutId)\n timeoutId = undefined\n }, timeout).unref?.()\n }\n\n rpcPromiseMap.set(id, { resolve, reject, timeoutId })\n const data = await serialize([RPCMode.request, id, method, ...args])\n await post(data)\n return promise\n }\n sendCall.asEvent = sendEvent\n return sendCall\n },\n }\n\n return {\n post,\n serialize,\n rpcPromiseMap,\n proxyHandler,\n registerFunctions,\n registerEventNames,\n }\n}\n\nexport function useRPC<LocalFunctions, RemoteFunctions = LocalFunctions>(\n functions: LocalFunctions,\n options: RPCOptions<RemoteFunctions>,\n): RPCReturn<RemoteFunctions> {\n const { eventNames = [] } = options\n\n const { proxyHandler } = setupRPCBasic(options, functions as any, eventNames as any)\n\n return new Proxy({}, proxyHandler)\n}\n\nexport function useRPCHub(options: RPCOptionsBasic) {\n const eventNames: string[] = []\n const functions: Record<string, any> = {}\n\n const {\n proxyHandler,\n registerFunctions,\n registerEventNames,\n } = setupRPCBasic(options, functions, eventNames)\n\n function createRPCProxy() {\n return new Proxy({}, proxyHandler)\n }\n\n return function<LocalFunctions, RemoteFunctions = LocalFunctions>(\n additionalFunctions?: LocalFunctions,\n additionalEventNames: string[] = [],\n ): RPCReturn<RemoteFunctions> {\n registerFunctions(additionalFunctions ?? {})\n registerEventNames(additionalEventNames)\n return createRPCProxy()\n }\n}\n\nexport type UseRPCHubType = ReturnType<typeof useRPCHub>\n\n// Syntax test case\n// async function _demo() {\n// const hub: UseRPCHubType = {} as any\n// const x = hub({\n// test(name: string): string {\n// return name\n// },\n// })\n// await x.test('dsd')\n// }\n"],"mappings":";;;;AA6CA,IAAI,aAAa;AAEjB,IAAY,UAAL;AACL;AACA;AACA;AACA;;KACD;AASD,MAAM,oBAAoB,MAAW;AACrC,MAAM,qBAAqB;AAE3B,SAAS,cAAc,SAA0B,WAA2D,aAAuB,EAAE,EAAE;CACrI,MAAM,EACJ,KACA,MACA,IACA,YAAY,kBACZ,cAAc,oBACd,UAAU,KACV,SACA,gBACA,aAAa,OACb,aAAa,MACb,mBACE;AAEJ,KAAI,eACF,QAAO,KAAK,UAAU,CAAC,QAAQ,eAAe,KAAK;CAGrD,SAAS,gBAAgB,YAAsB;AAO/C,iBAAgB,WAAW;CAE3B,SAAS,kBAAkB,qBAA0B;AACnD,SAAO,OAAO,WAAW,uBAAuB,EAAE,CAAC;AACnD,MAAI,eACF,QAAO,KAAK,oBAAoB,CAAC,QAAQ,eAAe,KAAK;;CAGjE,SAAS,mBAAmB,sBAAgC;AAC1D,kBAAgB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AAW,EAAE;AACjD,cAAU,UAAU;AACpB,WAAO;;GAGT,MAAM,WAAW,OAAO,GAAG,SAAgB;IACzC,MAAM,CAAC,SAAS,SAAS,UAAUA,2CAAe;IAClD,MAAM,KAAK;IAEX,IAAI;AACJ,QAAI,WAAW,EACb,aAAY,iBAAiB;AAC3B,SAAI;AAEF,uBAAiB,YAAY,KAAK;AAClC,YAAM,IAAI,MAAM,2BAA2B,WAAW,GAAG;cAEpD,GAAG;AACR,UAAI,eAAe,KACjB,QAAO,EAAE;UAET,SAAQ,OAAU;;AAEtB,mBAAc,OAAO,GAAG;AAGxB,kBAAa,UAAU;AACvB,iBAAY;OACX,QAAQ,CAAC,SAAS;AAGvB,kBAAc,IAAI,IAAI;KAAE;KAAS;KAAQ;KAAW,CAAC;AAErD,UAAM,KADO,MAAM,UAAU;;KAAkB;KAAI;KAAQ,GAAG;KAAK,CAAC,CACpD;AAChB,WAAO;;AAET,YAAS,UAAU;AACnB,UAAO;KAEV;EAOC;EACA;EACD;;AAGH,SAAgB,OACd,WACA,SAC4B;CAC5B,MAAM,EAAE,aAAa,EAAE,KAAK;CAE5B,MAAM,EAAE,iBAAiB,cAAc,SAAS,WAAkB,WAAkB;AAEpF,QAAO,IAAI,MAAM,EAAE,EAAE,aAAa;;AAGpC,SAAgB,UAAU,SAA0B;CAIlD,MAAM,EACJ,cACA,mBACA,uBACE,cAAc,SANqB,EAAE,EADZ,EAAE,CAOkB;CAEjD,SAAS,iBAAiB;AACxB,SAAO,IAAI,MAAM,EAAE,EAAE,aAAa;;AAGpC,QAAO,SACL,qBACA,uBAAiC,EAAE,EACP;AAC5B,oBAAkB,uBAAuB,EAAE,CAAC;AAC5C,qBAAmB,qBAAqB;AACxC,SAAO,gBAAgB"}
@@ -29,10 +29,10 @@ function setupRPCBasic(options, functions, eventNames = []) {
29
29
  try {
30
30
  const msg = await deserialize(data);
31
31
  const mode = msg?.[0];
32
- const id = mode === RPCMode.event ? 0 : msg?.[1];
33
- const [method, ...args] = msg.slice(mode === RPCMode.event ? 1 : 2);
32
+ const id = mode === 2 ? 0 : msg?.[1];
33
+ const [method, ...args] = msg.slice(mode === 2 ? 1 : 2);
34
34
  const methodName = stringHashPool?.stringForHash(method) ?? method;
35
- if (mode === RPCMode.request || mode === RPCMode.event) {
35
+ if (mode === 1 || mode === 2) {
36
36
  let result, error;
37
37
  if (method != null) try {
38
38
  const fn = functions[methodName];
@@ -46,11 +46,11 @@ function setupRPCBasic(options, functions, eventNames = []) {
46
46
  onError?.(error, method ?? "", args);
47
47
  }
48
48
  if (id > 0) await post(await serialize(error ? [
49
- RPCMode.reject,
49
+ 4,
50
50
  id,
51
51
  error
52
52
  ] : [
53
- RPCMode.resolve,
53
+ 3,
54
54
  id,
55
55
  result
56
56
  ]));
@@ -58,7 +58,7 @@ function setupRPCBasic(options, functions, eventNames = []) {
58
58
  const promise = rpcPromiseMap.get(id);
59
59
  if (promise != null) {
60
60
  clearTimeout(promise.timeoutId);
61
- if (mode === RPCMode.reject && exceptions === true) promise.reject(method);
61
+ if (mode === 4 && exceptions === true) promise.reject(method);
62
62
  else promise.resolve(method);
63
63
  }
64
64
  rpcPromiseMap.delete(id);
@@ -74,7 +74,7 @@ function setupRPCBasic(options, functions, eventNames = []) {
74
74
  proxyHandler: { get(_, methodName) {
75
75
  const method = stringHashPool?.hash(methodName) ?? methodName;
76
76
  const sendEvent = async (...args) => await post(await serialize([
77
- RPCMode.event,
77
+ 2,
78
78
  method,
79
79
  ...args
80
80
  ]));
@@ -104,7 +104,7 @@ function setupRPCBasic(options, functions, eventNames = []) {
104
104
  timeoutId
105
105
  });
106
106
  await post(await serialize([
107
- RPCMode.request,
107
+ 1,
108
108
  id,
109
109
  method,
110
110
  ...args
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.mjs","names":[],"sources":["../../../src/common/msg/rpc.ts"],"sourcesContent":["// From https://github.com/antfu/birpc/blob/main/src/index.ts MIT\n\nimport type { UseStringHashPool } from '../data/string-hash-pool'\nimport type { LoggerInterface } from '../log/log-base'\nimport type { Pipe } from './pipe'\nimport { createPromise } from '../exec/promise'\n\nexport type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never\nexport type ReturnType<T> = T extends (...args: any) => infer R ? R : never\n\nexport interface RPCOptionsBasic extends Pipe {\n /** No return values expected */\n onlyEvents?: boolean\n /** Maximum timeout for waiting for response, in milliseconds */\n timeout?: number\n /** Custom logger */\n log?: LoggerInterface\n /** Custom error handler */\n onError?: (error: Error, functionName: string, args: any[]) => boolean | void\n /** Custom error handler for timeouts */\n onTimeoutError?: (functionName: string, args: any[]) => boolean | void\n /** Throw execptions. Default: true */\n exceptions?: boolean\n /** */\n stringHashPool?: UseStringHashPool\n}\n\nexport interface RPCOptions<Remote> extends RPCOptionsBasic {\n // /** No return values expected */\n // onlyEvents?: boolean\n /** Names of remote functions that do not need response. */\n eventNames?: (keyof Remote)[]\n}\n\nexport interface RPCFn<T> {\n /** Call the remote function and wait for the result. */\n (...args: ArgumentsType<T>): Promise<Awaited<ReturnType<T>>>\n /** Send event without asking for response */\n asEvent: (...args: ArgumentsType<T>) => void\n}\n\nexport type RPCReturn<RemoteFunctions> = {\n [K in keyof RemoteFunctions]: RPCFn<RemoteFunctions[K]>\n}\n\nlet rpcCounter = 1\n\nexport enum RPCMode {\n request = 1,\n event = 2,\n resolve = 3,\n reject = 4,\n}\n\nexport type RPCMessage = [\n mode: RPCMode,\n id: number,\n method: string | number | any,\n ...any,\n]\n\nconst defaultSerialize = (i: any) => i\nconst defaultDeserialize = defaultSerialize\n\nfunction setupRPCBasic(options: RPCOptionsBasic, functions: Record<string, (...args: any) => Promise<any>>, eventNames: string[] = []) {\n const {\n log,\n post,\n on,\n serialize = defaultSerialize,\n deserialize = defaultDeserialize,\n timeout = 60e3,\n onError,\n onTimeoutError,\n onlyEvents = false,\n exceptions = true,\n stringHashPool,\n } = options\n\n if (stringHashPool) {\n Object.keys(functions).forEach(stringHashPool.hash)\n }\n\n function checkEventNames(eventNames: string[]) {\n // eventNames.forEach((n) => {\n // if (functions[n] == null)\n // throw new Error(`event name ${n} has no registered function`)\n // })\n }\n\n checkEventNames(eventNames)\n\n function registerFunctions(additionalFunctions: any) {\n Object.assign(functions, additionalFunctions ?? {})\n if (stringHashPool)\n Object.keys(additionalFunctions).forEach(stringHashPool.hash)\n }\n\n function registerEventNames(additionalEventNames: string[]) {\n checkEventNames(additionalEventNames)\n eventNames.push(...additionalEventNames)\n }\n\n const rpcPromiseMap = new Map<number, {\n resolve: (...args: any) => any\n reject: (...args: any) => any\n timeoutId: Parameters<typeof clearTimeout>[0]\n }>()\n\n on(async (data) => {\n try {\n const msg = await deserialize(data) as RPCMessage\n const mode = msg?.[0]\n const id = mode === RPCMode.event ? 0 : msg?.[1]\n const [method, ...args] = msg.slice(mode === RPCMode.event ? 1 : 2)\n const methodName = stringHashPool?.stringForHash(method) ?? method\n if (mode === RPCMode.request || mode === RPCMode.event) {\n let result, error: any\n if (method != null) {\n try {\n const fn = functions[methodName]\n result = await fn(...args)\n }\n catch (e) {\n error = String(e)\n }\n }\n else {\n error = 'Method implementation missing'\n }\n if (error) {\n log?.warn('error', msg, error)\n onError?.(error, method ?? '', args)\n }\n if (id > 0) {\n const data = await serialize(error\n ? [RPCMode.reject, id, error]\n : [RPCMode.resolve, id, result])\n await post(data)\n }\n }\n else if (id) {\n const promise = rpcPromiseMap.get(id)\n if (promise != null) {\n clearTimeout(promise.timeoutId)\n if (mode === RPCMode.reject && exceptions === true)\n promise.reject(method)\n else\n promise.resolve(method)\n }\n rpcPromiseMap.delete(id)\n }\n }\n catch (err) {\n log?.warn('Error on handling RPC data. Invalid?', err, data)\n }\n })\n\n const proxyHandler = {\n get(_: any, methodName: string) {\n const method = stringHashPool?.hash(methodName) ?? methodName\n const sendEvent = async (...args: any[]) => await post(await serialize([RPCMode.event, method, ...args]))\n\n if (onlyEvents || eventNames.includes(methodName)) {\n sendEvent.asEvent = sendEvent\n return sendEvent\n }\n\n const sendCall = async (...args: any[]) => {\n const [promise, resolve, reject] = createPromise()\n const id = rpcCounter++\n\n let timeoutId: any\n if (timeout >= 0) {\n timeoutId = setTimeout(() => {\n try {\n // Custom onTimeoutError handler can throw its own error too\n onTimeoutError?.(methodName, args)\n throw new Error(`rpc timeout on calling \"${methodName}\"`)\n }\n catch (e) {\n if (exceptions === true)\n reject(e)\n else\n resolve(undefined)\n }\n rpcPromiseMap.delete(id)\n\n // Garbage Collection https://jakearchibald.com/2024/garbage-collection-and-closures/\n clearTimeout(timeoutId)\n timeoutId = undefined\n }, timeout).unref?.()\n }\n\n rpcPromiseMap.set(id, { resolve, reject, timeoutId })\n const data = await serialize([RPCMode.request, id, method, ...args])\n await post(data)\n return promise\n }\n sendCall.asEvent = sendEvent\n return sendCall\n },\n }\n\n return {\n post,\n serialize,\n rpcPromiseMap,\n proxyHandler,\n registerFunctions,\n registerEventNames,\n }\n}\n\nexport function useRPC<LocalFunctions, RemoteFunctions = LocalFunctions>(\n functions: LocalFunctions,\n options: RPCOptions<RemoteFunctions>,\n): RPCReturn<RemoteFunctions> {\n const { eventNames = [] } = options\n\n const { proxyHandler } = setupRPCBasic(options, functions as any, eventNames as any)\n\n return new Proxy({}, proxyHandler)\n}\n\nexport function useRPCHub(options: RPCOptionsBasic) {\n const eventNames: string[] = []\n const functions: Record<string, any> = {}\n\n const {\n proxyHandler,\n registerFunctions,\n registerEventNames,\n } = setupRPCBasic(options, functions, eventNames)\n\n function createRPCProxy() {\n return new Proxy({}, proxyHandler)\n }\n\n return function<LocalFunctions, RemoteFunctions = LocalFunctions>(\n additionalFunctions?: LocalFunctions,\n additionalEventNames: string[] = [],\n ): RPCReturn<RemoteFunctions> {\n registerFunctions(additionalFunctions ?? {})\n registerEventNames(additionalEventNames)\n return createRPCProxy()\n }\n}\n\nexport type UseRPCHubType = ReturnType<typeof useRPCHub>\n\n// Syntax test case\n// async function _demo() {\n// const hub: UseRPCHubType = {} as any\n// const x = hub({\n// test(name: string): string {\n// return name\n// },\n// })\n// await x.test('d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;KAAK,CAAC,CACpD;AAChB,WAAO;;AAET,YAAS,UAAU;AACnB,UAAO;KAEV;EAOC;EACA;EACD;;AAGH,SAAgB,OACd,WACA,SAC4B;CAC5B,MAAM,EAAE,aAAa,EAAE,KAAK;CAE5B,MAAM,EAAE,iBAAiB,cAAc,SAAS,WAAkB,WAAkB;AAEpF,QAAO,IAAI,MAAM,EAAE,EAAE,aAAa;;AAGpC,SAAgB,UAAU,SAA0B;CAIlD,MAAM,EACJ,cACA,mBACA,uBACE,cAAc,SANqB,EAAE,EADZ,EAAE,CAOkB;CAEjD,SAAS,iBAAiB;AACxB,SAAO,IAAI,MAAM,EAAE,EAAE,aAAa;;AAGpC,QAAO,SACL,qBACA,uBAAiC,EAAE,EACP;AAC5B,oBAAkB,uBAAuB,EAAE,CAAC;AAC5C,qBAAmB,qBAAqB;AACxC,SAAO,gBAAgB"}
1
+ {"version":3,"file":"rpc.mjs","names":[],"sources":["../../../src/common/msg/rpc.ts"],"sourcesContent":["// From https://github.com/antfu/birpc/blob/main/src/index.ts MIT\n\nimport type { UseStringHashPool } from '../data/string-hash-pool'\nimport type { LoggerInterface } from '../log/log-base'\nimport type { Pipe } from './pipe'\nimport { createPromise } from '../exec/promise'\n\nexport type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never\nexport type ReturnType<T> = T extends (...args: any) => infer R ? R : never\n\nexport interface RPCOptionsBasic extends Pipe {\n /** No return values expected */\n onlyEvents?: boolean\n /** Maximum timeout for waiting for response, in milliseconds */\n timeout?: number\n /** Custom logger */\n log?: LoggerInterface\n /** Custom error handler */\n onError?: (error: Error, functionName: string, args: any[]) => boolean | void\n /** Custom error handler for timeouts */\n onTimeoutError?: (functionName: string, args: any[]) => boolean | void\n /** Throw execptions. Default: true */\n exceptions?: boolean\n /** */\n stringHashPool?: UseStringHashPool\n}\n\nexport interface RPCOptions<Remote> extends RPCOptionsBasic {\n // /** No return values expected */\n // onlyEvents?: boolean\n /** Names of remote functions that do not need response. */\n eventNames?: (keyof Remote)[]\n}\n\nexport interface RPCFn<T> {\n /** Call the remote function and wait for the result. */\n (...args: ArgumentsType<T>): Promise<Awaited<ReturnType<T>>>\n /** Send event without asking for response */\n asEvent: (...args: ArgumentsType<T>) => void\n}\n\nexport type RPCReturn<RemoteFunctions> = {\n [K in keyof RemoteFunctions]: RPCFn<RemoteFunctions[K]>\n}\n\nlet rpcCounter = 1\n\nexport enum RPCMode {\n request = 1,\n event = 2,\n resolve = 3,\n reject = 4,\n}\n\nexport type RPCMessage = [\n mode: RPCMode,\n id: number,\n method: string | number | any,\n ...any,\n]\n\nconst defaultSerialize = (i: any) => i\nconst defaultDeserialize = defaultSerialize\n\nfunction setupRPCBasic(options: RPCOptionsBasic, functions: Record<string, (...args: any) => Promise<any>>, eventNames: string[] = []) {\n const {\n log,\n post,\n on,\n serialize = defaultSerialize,\n deserialize = defaultDeserialize,\n timeout = 60e3,\n onError,\n onTimeoutError,\n onlyEvents = false,\n exceptions = true,\n stringHashPool,\n } = options\n\n if (stringHashPool) {\n Object.keys(functions).forEach(stringHashPool.hash)\n }\n\n function checkEventNames(eventNames: string[]) {\n // eventNames.forEach((n) => {\n // if (functions[n] == null)\n // throw new Error(`event name ${n} has no registered function`)\n // })\n }\n\n checkEventNames(eventNames)\n\n function registerFunctions(additionalFunctions: any) {\n Object.assign(functions, additionalFunctions ?? {})\n if (stringHashPool)\n Object.keys(additionalFunctions).forEach(stringHashPool.hash)\n }\n\n function registerEventNames(additionalEventNames: string[]) {\n checkEventNames(additionalEventNames)\n eventNames.push(...additionalEventNames)\n }\n\n const rpcPromiseMap = new Map<number, {\n resolve: (...args: any) => any\n reject: (...args: any) => any\n timeoutId: Parameters<typeof clearTimeout>[0]\n }>()\n\n on(async (data) => {\n try {\n const msg = await deserialize(data) as RPCMessage\n const mode = msg?.[0]\n const id = mode === RPCMode.event ? 0 : msg?.[1]\n const [method, ...args] = msg.slice(mode === RPCMode.event ? 1 : 2)\n const methodName = stringHashPool?.stringForHash(method) ?? method\n if (mode === RPCMode.request || mode === RPCMode.event) {\n let result, error: any\n if (method != null) {\n try {\n const fn = functions[methodName]\n result = await fn(...args)\n }\n catch (e) {\n error = String(e)\n }\n }\n else {\n error = 'Method implementation missing'\n }\n if (error) {\n log?.warn('error', msg, error)\n onError?.(error, method ?? '', args)\n }\n if (id > 0) {\n const data = await serialize(error\n ? [RPCMode.reject, id, error]\n : [RPCMode.resolve, id, result])\n await post(data)\n }\n }\n else if (id) {\n const promise = rpcPromiseMap.get(id)\n if (promise != null) {\n clearTimeout(promise.timeoutId)\n if (mode === RPCMode.reject && exceptions === true)\n promise.reject(method)\n else\n promise.resolve(method)\n }\n rpcPromiseMap.delete(id)\n }\n }\n catch (err) {\n log?.warn('Error on handling RPC data. Invalid?', err, data)\n }\n })\n\n const proxyHandler = {\n get(_: any, methodName: string) {\n const method = stringHashPool?.hash(methodName) ?? methodName\n const sendEvent = async (...args: any[]) => await post(await serialize([RPCMode.event, method, ...args]))\n\n if (onlyEvents || eventNames.includes(methodName)) {\n sendEvent.asEvent = sendEvent\n return sendEvent\n }\n\n const sendCall = async (...args: any[]) => {\n const [promise, resolve, reject] = createPromise()\n const id = rpcCounter++\n\n let timeoutId: any\n if (timeout >= 0) {\n timeoutId = setTimeout(() => {\n try {\n // Custom onTimeoutError handler can throw its own error too\n onTimeoutError?.(methodName, args)\n throw new Error(`rpc timeout on calling \"${methodName}\"`)\n }\n catch (e) {\n if (exceptions === true)\n reject(e)\n else\n resolve(undefined)\n }\n rpcPromiseMap.delete(id)\n\n // Garbage Collection https://jakearchibald.com/2024/garbage-collection-and-closures/\n clearTimeout(timeoutId)\n timeoutId = undefined\n }, timeout).unref?.()\n }\n\n rpcPromiseMap.set(id, { resolve, reject, timeoutId })\n const data = await serialize([RPCMode.request, id, method, ...args])\n await post(data)\n return promise\n }\n sendCall.asEvent = sendEvent\n return sendCall\n },\n }\n\n return {\n post,\n serialize,\n rpcPromiseMap,\n proxyHandler,\n registerFunctions,\n registerEventNames,\n }\n}\n\nexport function useRPC<LocalFunctions, RemoteFunctions = LocalFunctions>(\n functions: LocalFunctions,\n options: RPCOptions<RemoteFunctions>,\n): RPCReturn<RemoteFunctions> {\n const { eventNames = [] } = options\n\n const { proxyHandler } = setupRPCBasic(options, functions as any, eventNames as any)\n\n return new Proxy({}, proxyHandler)\n}\n\nexport function useRPCHub(options: RPCOptionsBasic) {\n const eventNames: string[] = []\n const functions: Record<string, any> = {}\n\n const {\n proxyHandler,\n registerFunctions,\n registerEventNames,\n } = setupRPCBasic(options, functions, eventNames)\n\n function createRPCProxy() {\n return new Proxy({}, proxyHandler)\n }\n\n return function<LocalFunctions, RemoteFunctions = LocalFunctions>(\n additionalFunctions?: LocalFunctions,\n additionalEventNames: string[] = [],\n ): RPCReturn<RemoteFunctions> {\n registerFunctions(additionalFunctions ?? {})\n registerEventNames(additionalEventNames)\n return createRPCProxy()\n }\n}\n\nexport type UseRPCHubType = ReturnType<typeof useRPCHub>\n\n// Syntax test case\n// async function _demo() {\n// const hub: UseRPCHubType = {} as any\n// const x = hub({\n// test(name: string): string {\n// return name\n// },\n// })\n// await x.test('dsd')\n// }\n"],"mappings":";;;AA6CA,IAAI,aAAa;AAEjB,IAAY,UAAL;AACL;AACA;AACA;AACA;;KACD;AASD,MAAM,oBAAoB,MAAW;AACrC,MAAM,qBAAqB;AAE3B,SAAS,cAAc,SAA0B,WAA2D,aAAuB,EAAE,EAAE;CACrI,MAAM,EACJ,KACA,MACA,IACA,YAAY,kBACZ,cAAc,oBACd,UAAU,KACV,SACA,gBACA,aAAa,OACb,aAAa,MACb,mBACE;AAEJ,KAAI,eACF,QAAO,KAAK,UAAU,CAAC,QAAQ,eAAe,KAAK;CAGrD,SAAS,gBAAgB,YAAsB;AAO/C,iBAAgB,WAAW;CAE3B,SAAS,kBAAkB,qBAA0B;AACnD,SAAO,OAAO,WAAW,uBAAuB,EAAE,CAAC;AACnD,MAAI,eACF,QAAO,KAAK,oBAAoB,CAAC,QAAQ,eAAe,KAA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