@ahoo-wang/wow-client 9.9.0 → 10.0.0-alpha.4

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 (385) hide show
  1. package/README.md +85 -230
  2. package/README.zh-CN.md +74 -209
  3. package/dist/commands.cjs +2 -0
  4. package/dist/commands.cjs.map +1 -0
  5. package/dist/commands.d.cts +123 -0
  6. package/dist/commands.d.ts +123 -0
  7. package/dist/commands.es.js +96 -0
  8. package/dist/commands.es.js.map +1 -0
  9. package/dist/dsl/aggregation/types.cjs.map +1 -1
  10. package/dist/dsl/aggregation/types.d.cts +1 -1
  11. package/dist/dsl/aggregation/types.d.ts +1 -1
  12. package/dist/dsl/aggregation/types.es.js.map +1 -1
  13. package/dist/dsl/cursorQuery.cjs.map +1 -1
  14. package/dist/dsl/cursorQuery.d.cts +7 -8
  15. package/dist/dsl/cursorQuery.d.ts +7 -8
  16. package/dist/dsl/cursorQuery.es.js.map +1 -1
  17. package/dist/dsl/descriptor.cjs.map +1 -1
  18. package/dist/dsl/descriptor.d.cts +8 -1
  19. package/dist/dsl/descriptor.d.ts +8 -1
  20. package/dist/dsl/descriptor.es.js.map +1 -1
  21. package/dist/dsl/documents.d.cts +1 -1
  22. package/dist/dsl/documents.d.ts +1 -1
  23. package/dist/dsl/filter/types.d.cts +2 -1
  24. package/dist/dsl/filter/types.d.ts +2 -1
  25. package/dist/dsl/projection.cjs.map +1 -1
  26. package/dist/dsl/projection.d.cts +22 -0
  27. package/dist/dsl/projection.d.ts +22 -0
  28. package/dist/dsl/projection.es.js.map +1 -1
  29. package/dist/dsl/queryErrorCodes.cjs +2 -0
  30. package/dist/dsl/queryErrorCodes.cjs.map +1 -0
  31. package/dist/{error → dsl}/queryErrorCodes.d.cts +25 -24
  32. package/dist/{error → dsl}/queryErrorCodes.d.ts +25 -24
  33. package/dist/{error → dsl}/queryErrorCodes.es.js +2 -1
  34. package/dist/{error/queryErrorCodes.cjs.map → dsl/queryErrorCodes.es.js.map} +1 -1
  35. package/dist/dsl.cjs +1 -1
  36. package/dist/dsl.d.cts +1 -2
  37. package/dist/dsl.d.ts +1 -2
  38. package/dist/dsl.es.js +2 -3
  39. package/dist/exactJson.cjs +3 -0
  40. package/dist/exactJson.cjs.map +1 -0
  41. package/dist/exactJson.d.cts +54 -0
  42. package/dist/exactJson.d.ts +54 -0
  43. package/dist/exactJson.es.js +213 -0
  44. package/dist/exactJson.es.js.map +1 -0
  45. package/dist/http.cjs +2 -0
  46. package/dist/http.cjs.map +1 -0
  47. package/dist/http.d.cts +96 -0
  48. package/dist/http.d.ts +96 -0
  49. package/dist/http.es.js +77 -0
  50. package/dist/http.es.js.map +1 -0
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.cts +19 -17
  53. package/dist/index.d.ts +19 -17
  54. package/dist/index.es.js +10 -36
  55. package/dist/manifest.cjs +2 -0
  56. package/dist/manifest.cjs.map +1 -0
  57. package/dist/manifest.d.cts +109 -0
  58. package/dist/manifest.d.ts +109 -0
  59. package/dist/manifest.es.js +14 -0
  60. package/dist/manifest.es.js.map +1 -0
  61. package/dist/problem.cjs +2 -0
  62. package/dist/problem.cjs.map +1 -0
  63. package/dist/problem.d.cts +211 -0
  64. package/dist/problem.d.ts +211 -0
  65. package/dist/problem.es.js +138 -0
  66. package/dist/problem.es.js.map +1 -0
  67. package/dist/queries.cjs +2 -0
  68. package/dist/queries.cjs.map +1 -0
  69. package/dist/queries.d.cts +182 -0
  70. package/dist/queries.d.ts +182 -0
  71. package/dist/queries.es.js +112 -0
  72. package/dist/queries.es.js.map +1 -0
  73. package/dist/state.cjs +2 -0
  74. package/dist/state.cjs.map +1 -0
  75. package/dist/state.d.cts +75 -0
  76. package/dist/state.d.ts +75 -0
  77. package/dist/state.es.js +70 -0
  78. package/dist/state.es.js.map +1 -0
  79. package/dist/streams.cjs +2 -0
  80. package/dist/streams.cjs.map +1 -0
  81. package/dist/streams.d.cts +74 -0
  82. package/dist/streams.d.ts +74 -0
  83. package/dist/streams.es.js +103 -0
  84. package/dist/streams.es.js.map +1 -0
  85. package/dist/wait.cjs +2 -0
  86. package/dist/wait.cjs.map +1 -0
  87. package/dist/wait.d.cts +61 -0
  88. package/dist/wait.d.ts +61 -0
  89. package/dist/wait.es.js +44 -0
  90. package/dist/wait.es.js.map +1 -0
  91. package/dist/wire.cjs +2 -0
  92. package/dist/wire.cjs.map +1 -0
  93. package/dist/wire.d.cts +326 -0
  94. package/dist/wire.d.ts +326 -0
  95. package/dist/wire.es.js +10 -0
  96. package/dist/wire.es.js.map +1 -0
  97. package/package.json +4 -16
  98. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs +0 -1
  99. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js +0 -9
  100. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs +0 -1
  101. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js +0 -6
  102. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs +0 -1
  103. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js +0 -8
  104. package/dist/client/bindMethods.cjs +0 -2
  105. package/dist/client/bindMethods.cjs.map +0 -1
  106. package/dist/client/bindMethods.d.cts +0 -13
  107. package/dist/client/bindMethods.d.ts +0 -13
  108. package/dist/client/bindMethods.es.js +0 -19
  109. package/dist/client/bindMethods.es.js.map +0 -1
  110. package/dist/client/command/commandClient.cjs +0 -2
  111. package/dist/client/command/commandClient.cjs.map +0 -1
  112. package/dist/client/command/commandClient.d.cts +0 -67
  113. package/dist/client/command/commandClient.d.ts +0 -67
  114. package/dist/client/command/commandClient.es.js +0 -38
  115. package/dist/client/command/commandClient.es.js.map +0 -1
  116. package/dist/client/command/commandHeaders.cjs +0 -2
  117. package/dist/client/command/commandHeaders.cjs.map +0 -1
  118. package/dist/client/command/commandHeaders.d.cts +0 -75
  119. package/dist/client/command/commandHeaders.d.ts +0 -75
  120. package/dist/client/command/commandHeaders.es.js +0 -31
  121. package/dist/client/command/commandHeaders.es.js.map +0 -1
  122. package/dist/client/command/commandRequest.cjs +0 -2
  123. package/dist/client/command/commandRequest.cjs.map +0 -1
  124. package/dist/client/command/commandRequest.d.cts +0 -180
  125. package/dist/client/command/commandRequest.d.ts +0 -180
  126. package/dist/client/command/commandRequest.es.js +0 -31
  127. package/dist/client/command/commandRequest.es.js.map +0 -1
  128. package/dist/client/command/commandResult.d.cts +0 -15
  129. package/dist/client/command/commandResult.d.ts +0 -15
  130. package/dist/client/command/index.d.cts +0 -5
  131. package/dist/client/command/index.d.ts +0 -5
  132. package/dist/client/command/types.d.cts +0 -71
  133. package/dist/client/command/types.d.ts +0 -71
  134. package/dist/client/metadata/index.d.cts +0 -2
  135. package/dist/client/metadata/index.d.ts +0 -2
  136. package/dist/client/metadata/wowMetadata.d.cts +0 -48
  137. package/dist/client/metadata/wowMetadata.d.ts +0 -48
  138. package/dist/client/metadata/wowMetadataClient.cjs +0 -2
  139. package/dist/client/metadata/wowMetadataClient.cjs.map +0 -1
  140. package/dist/client/metadata/wowMetadataClient.d.cts +0 -23
  141. package/dist/client/metadata/wowMetadataClient.d.ts +0 -23
  142. package/dist/client/metadata/wowMetadataClient.es.js +0 -25
  143. package/dist/client/metadata/wowMetadataClient.es.js.map +0 -1
  144. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs +0 -2
  145. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs.map +0 -1
  146. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.cts +0 -8
  147. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.ts +0 -8
  148. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js +0 -34
  149. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js.map +0 -1
  150. package/dist/client/query/dataset/datasetDirectoryClient.cjs +0 -2
  151. package/dist/client/query/dataset/datasetDirectoryClient.cjs.map +0 -1
  152. package/dist/client/query/dataset/datasetDirectoryClient.d.cts +0 -29
  153. package/dist/client/query/dataset/datasetDirectoryClient.d.ts +0 -29
  154. package/dist/client/query/dataset/datasetDirectoryClient.es.js +0 -25
  155. package/dist/client/query/dataset/datasetDirectoryClient.es.js.map +0 -1
  156. package/dist/client/query/dataset/datasetQueryApi.d.cts +0 -40
  157. package/dist/client/query/dataset/datasetQueryApi.d.ts +0 -40
  158. package/dist/client/query/dataset/datasetQueryClient.cjs +0 -2
  159. package/dist/client/query/dataset/datasetQueryClient.cjs.map +0 -1
  160. package/dist/client/query/dataset/datasetQueryClient.d.cts +0 -57
  161. package/dist/client/query/dataset/datasetQueryClient.d.ts +0 -57
  162. package/dist/client/query/dataset/datasetQueryClient.es.js +0 -154
  163. package/dist/client/query/dataset/datasetQueryClient.es.js.map +0 -1
  164. package/dist/client/query/dataset/endpointPaths.cjs +0 -2
  165. package/dist/client/query/dataset/endpointPaths.cjs.map +0 -1
  166. package/dist/client/query/dataset/endpointPaths.d.cts +0 -9
  167. package/dist/client/query/dataset/endpointPaths.d.ts +0 -9
  168. package/dist/client/query/dataset/endpointPaths.es.js +0 -14
  169. package/dist/client/query/dataset/endpointPaths.es.js.map +0 -1
  170. package/dist/client/query/dataset/index.d.cts +0 -3
  171. package/dist/client/query/dataset/index.d.ts +0 -3
  172. package/dist/client/query/descriptor/descriptorEndpoints.cjs +0 -2
  173. package/dist/client/query/descriptor/descriptorEndpoints.cjs.map +0 -1
  174. package/dist/client/query/descriptor/descriptorEndpoints.d.cts +0 -29
  175. package/dist/client/query/descriptor/descriptorEndpoints.d.ts +0 -29
  176. package/dist/client/query/descriptor/descriptorEndpoints.es.js +0 -69
  177. package/dist/client/query/descriptor/descriptorEndpoints.es.js.map +0 -1
  178. package/dist/client/query/descriptor/endpointPaths.cjs +0 -2
  179. package/dist/client/query/descriptor/endpointPaths.cjs.map +0 -1
  180. package/dist/client/query/descriptor/endpointPaths.d.cts +0 -4
  181. package/dist/client/query/descriptor/endpointPaths.d.ts +0 -4
  182. package/dist/client/query/descriptor/endpointPaths.es.js +0 -9
  183. package/dist/client/query/descriptor/endpointPaths.es.js.map +0 -1
  184. package/dist/client/query/descriptor/index.d.cts +0 -2
  185. package/dist/client/query/descriptor/index.d.ts +0 -2
  186. package/dist/client/query/descriptor/queryDescriptorApi.d.cts +0 -58
  187. package/dist/client/query/descriptor/queryDescriptorApi.d.ts +0 -58
  188. package/dist/client/query/descriptor/queryDescriptorClient.cjs +0 -2
  189. package/dist/client/query/descriptor/queryDescriptorClient.cjs.map +0 -1
  190. package/dist/client/query/descriptor/queryDescriptorClient.d.cts +0 -61
  191. package/dist/client/query/descriptor/queryDescriptorClient.d.ts +0 -61
  192. package/dist/client/query/descriptor/queryDescriptorClient.es.js +0 -20
  193. package/dist/client/query/descriptor/queryDescriptorClient.es.js.map +0 -1
  194. package/dist/client/query/event/endpointPaths.cjs +0 -2
  195. package/dist/client/query/event/endpointPaths.cjs.map +0 -1
  196. package/dist/client/query/event/endpointPaths.d.cts +0 -8
  197. package/dist/client/query/event/endpointPaths.d.ts +0 -8
  198. package/dist/client/query/event/endpointPaths.es.js +0 -13
  199. package/dist/client/query/event/endpointPaths.es.js.map +0 -1
  200. package/dist/client/query/event/eventStreamQueryApi.d.cts +0 -29
  201. package/dist/client/query/event/eventStreamQueryApi.d.ts +0 -29
  202. package/dist/client/query/event/eventStreamQueryClient.cjs +0 -2
  203. package/dist/client/query/event/eventStreamQueryClient.cjs.map +0 -1
  204. package/dist/client/query/event/eventStreamQueryClient.d.cts +0 -193
  205. package/dist/client/query/event/eventStreamQueryClient.d.ts +0 -193
  206. package/dist/client/query/event/eventStreamQueryClient.es.js +0 -160
  207. package/dist/client/query/event/eventStreamQueryClient.es.js.map +0 -1
  208. package/dist/client/query/event/index.d.cts +0 -2
  209. package/dist/client/query/event/index.d.ts +0 -2
  210. package/dist/client/query/factory.cjs +0 -2
  211. package/dist/client/query/factory.cjs.map +0 -1
  212. package/dist/client/query/factory.d.cts +0 -165
  213. package/dist/client/query/factory.d.ts +0 -165
  214. package/dist/client/query/factory.es.js +0 -45
  215. package/dist/client/query/factory.es.js.map +0 -1
  216. package/dist/client/query/index.d.cts +0 -7
  217. package/dist/client/query/index.d.ts +0 -7
  218. package/dist/client/query/queryApi.d.cts +0 -68
  219. package/dist/client/query/queryApi.d.ts +0 -68
  220. package/dist/client/query/requests.d.cts +0 -24
  221. package/dist/client/query/requests.d.ts +0 -24
  222. package/dist/client/query/snapshot/endpointPaths.cjs +0 -2
  223. package/dist/client/query/snapshot/endpointPaths.cjs.map +0 -1
  224. package/dist/client/query/snapshot/endpointPaths.d.cts +0 -12
  225. package/dist/client/query/snapshot/endpointPaths.d.ts +0 -12
  226. package/dist/client/query/snapshot/endpointPaths.es.js +0 -17
  227. package/dist/client/query/snapshot/endpointPaths.es.js.map +0 -1
  228. package/dist/client/query/snapshot/index.d.cts +0 -2
  229. package/dist/client/query/snapshot/index.d.ts +0 -2
  230. package/dist/client/query/snapshot/snapshotQueryApi.d.cts +0 -101
  231. package/dist/client/query/snapshot/snapshotQueryApi.d.ts +0 -101
  232. package/dist/client/query/snapshot/snapshotQueryClient.cjs +0 -2
  233. package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +0 -1
  234. package/dist/client/query/snapshot/snapshotQueryClient.d.cts +0 -372
  235. package/dist/client/query/snapshot/snapshotQueryClient.d.ts +0 -372
  236. package/dist/client/query/snapshot/snapshotQueryClient.es.js +0 -239
  237. package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +0 -1
  238. package/dist/client/query/state/endpointPaths.cjs +0 -2
  239. package/dist/client/query/state/endpointPaths.cjs.map +0 -1
  240. package/dist/client/query/state/endpointPaths.d.cts +0 -10
  241. package/dist/client/query/state/endpointPaths.d.ts +0 -10
  242. package/dist/client/query/state/endpointPaths.es.js +0 -14
  243. package/dist/client/query/state/endpointPaths.es.js.map +0 -1
  244. package/dist/client/query/state/index.d.cts +0 -4
  245. package/dist/client/query/state/index.d.ts +0 -4
  246. package/dist/client/query/state/loadOwnerStateAggregateApi.d.cts +0 -36
  247. package/dist/client/query/state/loadOwnerStateAggregateApi.d.ts +0 -36
  248. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs +0 -2
  249. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs.map +0 -1
  250. package/dist/client/query/state/loadOwnerStateAggregateClient.d.cts +0 -58
  251. package/dist/client/query/state/loadOwnerStateAggregateClient.d.ts +0 -58
  252. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js +0 -56
  253. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js.map +0 -1
  254. package/dist/client/query/state/loadStateAggregateApi.d.cts +0 -37
  255. package/dist/client/query/state/loadStateAggregateApi.d.ts +0 -37
  256. package/dist/client/query/state/loadStateAggregateClient.cjs +0 -2
  257. package/dist/client/query/state/loadStateAggregateClient.cjs.map +0 -1
  258. package/dist/client/query/state/loadStateAggregateClient.d.cts +0 -62
  259. package/dist/client/query/state/loadStateAggregateClient.d.ts +0 -62
  260. package/dist/client/query/state/loadStateAggregateClient.es.js +0 -65
  261. package/dist/client/query/state/loadStateAggregateClient.es.js.map +0 -1
  262. package/dist/client/routing.cjs +0 -2
  263. package/dist/client/routing.cjs.map +0 -1
  264. package/dist/client/routing.d.cts +0 -47
  265. package/dist/client/routing.d.ts +0 -47
  266. package/dist/client/routing.es.js +0 -8
  267. package/dist/client/routing.es.js.map +0 -1
  268. package/dist/error/errorInfo.cjs +0 -2
  269. package/dist/error/errorInfo.cjs.map +0 -1
  270. package/dist/error/errorInfo.d.cts +0 -139
  271. package/dist/error/errorInfo.d.ts +0 -139
  272. package/dist/error/errorInfo.es.js +0 -32
  273. package/dist/error/errorInfo.es.js.map +0 -1
  274. package/dist/error/headers.cjs +0 -2
  275. package/dist/error/headers.cjs.map +0 -1
  276. package/dist/error/headers.d.cts +0 -39
  277. package/dist/error/headers.d.ts +0 -39
  278. package/dist/error/headers.es.js +0 -10
  279. package/dist/error/headers.es.js.map +0 -1
  280. package/dist/error/index.d.cts +0 -21
  281. package/dist/error/index.d.ts +0 -21
  282. package/dist/error/queryErrorCodes.cjs +0 -2
  283. package/dist/error/queryErrorCodes.es.js.map +0 -1
  284. package/dist/error/wowError.cjs +0 -2
  285. package/dist/error/wowError.cjs.map +0 -1
  286. package/dist/error/wowError.d.cts +0 -99
  287. package/dist/error/wowError.d.ts +0 -99
  288. package/dist/error/wowError.es.js +0 -53
  289. package/dist/error/wowError.es.js.map +0 -1
  290. package/dist/legacy/condition.cjs +0 -2
  291. package/dist/legacy/condition.cjs.map +0 -1
  292. package/dist/legacy/condition.d.cts +0 -517
  293. package/dist/legacy/condition.d.ts +0 -517
  294. package/dist/legacy/condition.es.js +0 -338
  295. package/dist/legacy/condition.es.js.map +0 -1
  296. package/dist/legacy/index.d.cts +0 -16
  297. package/dist/legacy/index.d.ts +0 -16
  298. package/dist/legacy/locale/en_US.cjs +0 -2
  299. package/dist/legacy/locale/en_US.cjs.map +0 -1
  300. package/dist/legacy/locale/en_US.d.cts +0 -7
  301. package/dist/legacy/locale/en_US.d.ts +0 -7
  302. package/dist/legacy/locale/en_US.es.js +0 -50
  303. package/dist/legacy/locale/en_US.es.js.map +0 -1
  304. package/dist/legacy/locale/operatorLocale.d.cts +0 -10
  305. package/dist/legacy/locale/operatorLocale.d.ts +0 -10
  306. package/dist/legacy/locale/zh_CN.cjs +0 -2
  307. package/dist/legacy/locale/zh_CN.cjs.map +0 -1
  308. package/dist/legacy/locale/zh_CN.d.cts +0 -7
  309. package/dist/legacy/locale/zh_CN.d.ts +0 -7
  310. package/dist/legacy/locale/zh_CN.es.js +0 -50
  311. package/dist/legacy/locale/zh_CN.es.js.map +0 -1
  312. package/dist/legacy/operator.cjs +0 -2
  313. package/dist/legacy/operator.cjs.map +0 -1
  314. package/dist/legacy/operator.d.cts +0 -218
  315. package/dist/legacy/operator.d.ts +0 -218
  316. package/dist/legacy/operator.es.js +0 -25
  317. package/dist/legacy/operator.es.js.map +0 -1
  318. package/dist/legacy/queryable.cjs +0 -2
  319. package/dist/legacy/queryable.cjs.map +0 -1
  320. package/dist/legacy/queryable.d.cts +0 -61
  321. package/dist/legacy/queryable.d.ts +0 -61
  322. package/dist/legacy/queryable.es.js +0 -34
  323. package/dist/legacy/queryable.es.js.map +0 -1
  324. package/dist/legacy.cjs +0 -1
  325. package/dist/legacy.es.js +0 -6
  326. package/dist/model/abac.cjs +0 -2
  327. package/dist/model/abac.cjs.map +0 -1
  328. package/dist/model/abac.d.cts +0 -33
  329. package/dist/model/abac.d.ts +0 -33
  330. package/dist/model/abac.es.js +0 -6
  331. package/dist/model/abac.es.js.map +0 -1
  332. package/dist/model/bi.cjs +0 -2
  333. package/dist/model/bi.cjs.map +0 -1
  334. package/dist/model/bi.d.cts +0 -12
  335. package/dist/model/bi.d.ts +0 -12
  336. package/dist/model/bi.es.js +0 -8
  337. package/dist/model/bi.es.js.map +0 -1
  338. package/dist/model/command.cjs +0 -2
  339. package/dist/model/command.cjs.map +0 -1
  340. package/dist/model/command.d.cts +0 -137
  341. package/dist/model/command.d.ts +0 -137
  342. package/dist/model/command.es.js +0 -8
  343. package/dist/model/command.es.js.map +0 -1
  344. package/dist/model/common.d.cts +0 -19
  345. package/dist/model/common.d.ts +0 -19
  346. package/dist/model/domainEventStream.cjs +0 -2
  347. package/dist/model/domainEventStream.cjs.map +0 -1
  348. package/dist/model/domainEventStream.d.cts +0 -109
  349. package/dist/model/domainEventStream.d.ts +0 -109
  350. package/dist/model/domainEventStream.es.js +0 -23
  351. package/dist/model/domainEventStream.es.js.map +0 -1
  352. package/dist/model/function.cjs +0 -2
  353. package/dist/model/function.cjs.map +0 -1
  354. package/dist/model/function.d.cts +0 -41
  355. package/dist/model/function.d.ts +0 -41
  356. package/dist/model/function.es.js +0 -8
  357. package/dist/model/function.es.js.map +0 -1
  358. package/dist/model/index.d.cts +0 -24
  359. package/dist/model/index.d.ts +0 -24
  360. package/dist/model/messaging.d.cts +0 -5
  361. package/dist/model/messaging.d.ts +0 -5
  362. package/dist/model/modeling.d.cts +0 -145
  363. package/dist/model/modeling.d.ts +0 -145
  364. package/dist/model/naming.d.cts +0 -27
  365. package/dist/model/naming.d.ts +0 -27
  366. package/dist/model/snapshot.cjs +0 -2
  367. package/dist/model/snapshot.cjs.map +0 -1
  368. package/dist/model/snapshot.d.cts +0 -53
  369. package/dist/model/snapshot.d.ts +0 -53
  370. package/dist/model/snapshot.es.js +0 -20
  371. package/dist/model/snapshot.es.js.map +0 -1
  372. package/dist/transport/endpoints.cjs +0 -2
  373. package/dist/transport/endpoints.cjs.map +0 -1
  374. package/dist/transport/endpoints.d.cts +0 -79
  375. package/dist/transport/endpoints.d.ts +0 -79
  376. package/dist/transport/endpoints.es.js +0 -14
  377. package/dist/transport/endpoints.es.js.map +0 -1
  378. package/dist/transport/eventStreams.cjs +0 -2
  379. package/dist/transport/eventStreams.cjs.map +0 -1
  380. package/dist/transport/eventStreams.d.cts +0 -25
  381. package/dist/transport/eventStreams.d.ts +0 -25
  382. package/dist/transport/eventStreams.es.js +0 -21
  383. package/dist/transport/eventStreams.es.js.map +0 -1
  384. package/dist/transport/index.d.cts +0 -1
  385. package/dist/transport/index.d.ts +0 -1
@@ -1,145 +0,0 @@
1
- import { AliasBoundedContext, NamedBoundedContext } from './naming.js';
2
- /**
3
- * Interface for classes that have a creation time.
4
- */
5
- export interface CreateTimeCapable {
6
- /**
7
- * Gets the creation time in milliseconds since the Unix epoch.
8
- */
9
- createTime: number;
10
- }
11
- /**
12
- * Interface for objects that track deletion status.
13
- */
14
- export interface DeletedCapable {
15
- /**
16
- * Whether the aggregate is deleted.
17
- */
18
- deleted: boolean;
19
- }
20
- /**
21
- * Interface for objects that track event IDs.
22
- */
23
- export interface EventIdCapable {
24
- /**
25
- * The event id of the aggregate.
26
- */
27
- eventId: string;
28
- }
29
- /**
30
- * Interface for objects that track event times.
31
- */
32
- export interface EventTimeCapable {
33
- /**
34
- * The last event time of the aggregate, represented as a Unix timestamp in milliseconds.
35
- */
36
- eventTime: number;
37
- }
38
- /**
39
- * Interface for objects that track the first event time.
40
- */
41
- export interface FirstEventTimeCapable {
42
- /**
43
- * The first event time of the aggregate, represented as a Unix timestamp in milliseconds.
44
- */
45
- firstEventTime: number;
46
- }
47
- /**
48
- * Interface for objects that track the first operator.
49
- */
50
- export interface FirstOperatorCapable {
51
- /**
52
- * The first operator of the aggregate.
53
- */
54
- firstOperator: string;
55
- }
56
- /**
57
- * Interface for objects that have an aggregate name.
58
- */
59
- export interface AggregateNameCapable {
60
- /**
61
- * The name of the aggregate.
62
- */
63
- aggregateName: string;
64
- }
65
- /**
66
- * Interface for named aggregates that belong to a bounded context.
67
- */
68
- export interface NamedAggregate extends NamedBoundedContext, AggregateNameCapable {
69
- }
70
- /**
71
- * An aggregate named by its bounded context's alias rather than its context
72
- * name, as in a client's route (`QueryClientFactory`'s `contextAlias` and
73
- * `aggregateName`).
74
- */
75
- export interface AliasAggregate extends AliasBoundedContext, AggregateNameCapable {
76
- }
77
- /**
78
- * Interface for aggregate IDs that combine tenant and named aggregate information.
79
- */
80
- export interface AggregateId extends TenantId, NamedAggregate {
81
- aggregateId: string;
82
- }
83
- /**
84
- * Interface that provides the capability to contain an aggregate identifier.
85
- *
86
- * This interface is implemented by objects that need to reference an aggregate instance
87
- * through its unique identifier, which includes tenant, context, aggregate name and the
88
- * actual aggregate ID.
89
- */
90
- export interface AggregateIdCapable {
91
- /**
92
- * The unique identifier of the aggregate instance.
93
- *
94
- * Contains information about the tenant, bounded context, aggregate name and the
95
- * actual aggregate ID string.
96
- */
97
- aggregateId: AggregateId;
98
- }
99
- /**
100
- * Interface for objects that track the last operator.
101
- */
102
- export interface OperatorCapable {
103
- /**
104
- * The last operator of the aggregate.
105
- */
106
- operator: string;
107
- }
108
- /**
109
- * Interface for identifying resource owners.
110
- */
111
- export interface OwnerId {
112
- /**
113
- * Unique identifier of the resource owner.
114
- */
115
- ownerId: string;
116
- }
117
- /**
118
- * Something that lives in a space: a partition of data under a tenant, which
119
- * commands and queries select with the `Wow-Space-Id` header.
120
- */
121
- export interface SpaceIdCapable {
122
- /** The space; an empty string is the tenant's default space. */
123
- spaceId: string;
124
- }
125
- /**
126
- * Interface for objects that track snapshot times.
127
- */
128
- export interface SnapshotTimeCapable {
129
- /**
130
- * The snapshot time of the aggregate, represented as a Unix timestamp in milliseconds.
131
- */
132
- snapshotTime: number;
133
- }
134
- /**
135
- * Interface for objects that have a tenant ID.
136
- */
137
- export interface TenantId {
138
- tenantId: string;
139
- }
140
- /**
141
- * Interface for objects that hold state.
142
- */
143
- export interface StateCapable<S> {
144
- state: S;
145
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * Interface for named bounded contexts.
3
- */
4
- export interface NamedBoundedContext {
5
- contextName: string;
6
- }
7
- /** A bounded context named by its alias; see `BoundedContext.alias`. */
8
- export interface AliasBoundedContext {
9
- /** The alias of the bounded context. */
10
- contextAlias: string;
11
- }
12
- /**
13
- * Interface for named entities.
14
- */
15
- export interface Named {
16
- name: string;
17
- }
18
- /**
19
- * Interface for entities that have a description.
20
- *
21
- * This interface defines a contract for objects that can provide a descriptive text.
22
- * It is commonly used in conjunction with other naming interfaces to provide additional
23
- * context or information about an entity.
24
- */
25
- export interface DescriptionCapable {
26
- description: string;
27
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * Interface for named bounded contexts.
3
- */
4
- export interface NamedBoundedContext {
5
- contextName: string;
6
- }
7
- /** A bounded context named by its alias; see `BoundedContext.alias`. */
8
- export interface AliasBoundedContext {
9
- /** The alias of the bounded context. */
10
- contextAlias: string;
11
- }
12
- /**
13
- * Interface for named entities.
14
- */
15
- export interface Named {
16
- name: string;
17
- }
18
- /**
19
- * Interface for entities that have a description.
20
- *
21
- * This interface defines a contract for objects that can provide a descriptive text.
22
- * It is commonly used in conjunction with other naming interfaces to provide additional
23
- * context or information about an entity.
24
- */
25
- export interface DescriptionCapable {
26
- description: string;
27
- }
@@ -1,2 +0,0 @@
1
- var e=Object.freeze({VERSION:`version`,TENANT_ID:`tenantId`,OWNER_ID:`ownerId`,SPACE_ID:`spaceId`,EVENT_ID:`eventId`,FIRST_EVENT_TIME:`firstEventTime`,EVENT_TIME:`eventTime`,FIRST_OPERATOR:`firstOperator`,OPERATOR:`operator`,SNAPSHOT_TIME:`snapshotTime`,TAGS:`tags`,DELETED:`deleted`,STATE:`state`});exports.SnapshotMetadataFields=e;
2
- //# sourceMappingURL=snapshot.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.cjs","names":["SnapshotMetadataFields"],"sources":["../../src/model/snapshot.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AbacTaggable } from './abac.js';\nimport type { Version } from './common.js';\nimport type {\n AggregateId,\n DeletedCapable,\n EventIdCapable,\n EventTimeCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n OperatorCapable,\n OwnerId,\n SnapshotTimeCapable,\n SpaceIdCapable,\n StateCapable,\n TenantId,\n} from './modeling.js';\n\n/**\n * Interface for materialized snapshots with full capabilities.\n */\nexport interface MaterializedSnapshot<S>\n extends\n StateCapable<S>,\n AggregateId,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n SnapshotTimeCapable,\n AbacTaggable,\n DeletedCapable {}\n\n/**\n * Interface for materialized snapshots with medium capabilities.\n *\n * Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance.\n * This interface is designed to be generic, capable of holding state data of any type.\n * Each snapshot corresponds to a specific version of the state within a tenant and owner context,\n * and records information such as event IDs and operation times to support tracing and auditing.\n *\n * Mirrors `MediumMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/MediumMaterializedSnapshot.kt`.\n */\nexport interface MediumMaterializedSnapshot<S>\n extends\n StateCapable<S>,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n AbacTaggable {}\n\n/**\n * Interface for simplified materialized snapshots with generic state.\n *\n * This interface implements multiple interfaces to provide version, materialization, first event time, and state information.\n *\n * Mirrors `SmallMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/SmallMaterializedSnapshot.kt`.\n */\nexport interface SmallMaterializedSnapshot<S>\n extends StateCapable<S>, Version, FirstEventTimeCapable {}\n\n/**\n * The field names of a materialized snapshot, for filters, sorts and\n * projections over snapshots (`tenantId`, `state`, `deleted`, …).\n *\n * A frozen name table: read `SnapshotMetadataFields.TENANT_ID`; each value is\n * a string literal type.\n */\nexport const SnapshotMetadataFields = Object.freeze({\n VERSION: 'version',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n EVENT_ID: 'eventId',\n FIRST_EVENT_TIME: 'firstEventTime',\n EVENT_TIME: 'eventTime',\n FIRST_OPERATOR: 'firstOperator',\n OPERATOR: 'operator',\n SNAPSHOT_TIME: 'snapshotTime',\n TAGS: 'tags',\n DELETED: 'deleted',\n STATE: 'state',\n} as const);\n"],"mappings":"AA6FA,IAAaA,EAAyB,OAAO,OAAO,CAClD,QAAS,UACT,UAAW,WACX,SAAU,UACV,SAAU,UACV,SAAU,UACV,iBAAkB,iBAClB,WAAY,YACZ,eAAgB,gBAChB,SAAU,WACV,cAAe,eACf,KAAM,OACN,QAAS,UACT,MAAO,OACT,CAAU"}
@@ -1,53 +0,0 @@
1
- import { AbacTaggable } from './abac.cjs';
2
- import { Version } from './common.cjs';
3
- import { AggregateId, DeletedCapable, EventIdCapable, EventTimeCapable, FirstEventTimeCapable, FirstOperatorCapable, OperatorCapable, OwnerId, SnapshotTimeCapable, SpaceIdCapable, StateCapable, TenantId } from './modeling.cjs';
4
- /**
5
- * Interface for materialized snapshots with full capabilities.
6
- */
7
- export interface MaterializedSnapshot<S> extends StateCapable<S>, AggregateId, TenantId, OwnerId, SpaceIdCapable, Version, EventIdCapable, FirstOperatorCapable, OperatorCapable, FirstEventTimeCapable, EventTimeCapable, SnapshotTimeCapable, AbacTaggable, DeletedCapable {
8
- }
9
- /**
10
- * Interface for materialized snapshots with medium capabilities.
11
- *
12
- * Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance.
13
- * This interface is designed to be generic, capable of holding state data of any type.
14
- * Each snapshot corresponds to a specific version of the state within a tenant and owner context,
15
- * and records information such as event IDs and operation times to support tracing and auditing.
16
- *
17
- * Mirrors `MediumMaterializedSnapshot` in
18
- * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/MediumMaterializedSnapshot.kt`.
19
- */
20
- export interface MediumMaterializedSnapshot<S> extends StateCapable<S>, TenantId, OwnerId, SpaceIdCapable, Version, EventIdCapable, FirstOperatorCapable, OperatorCapable, FirstEventTimeCapable, EventTimeCapable, AbacTaggable {
21
- }
22
- /**
23
- * Interface for simplified materialized snapshots with generic state.
24
- *
25
- * This interface implements multiple interfaces to provide version, materialization, first event time, and state information.
26
- *
27
- * Mirrors `SmallMaterializedSnapshot` in
28
- * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/SmallMaterializedSnapshot.kt`.
29
- */
30
- export interface SmallMaterializedSnapshot<S> extends StateCapable<S>, Version, FirstEventTimeCapable {
31
- }
32
- /**
33
- * The field names of a materialized snapshot, for filters, sorts and
34
- * projections over snapshots (`tenantId`, `state`, `deleted`, …).
35
- *
36
- * A frozen name table: read `SnapshotMetadataFields.TENANT_ID`; each value is
37
- * a string literal type.
38
- */
39
- export declare const SnapshotMetadataFields: Readonly<{
40
- readonly VERSION: "version";
41
- readonly TENANT_ID: "tenantId";
42
- readonly OWNER_ID: "ownerId";
43
- readonly SPACE_ID: "spaceId";
44
- readonly EVENT_ID: "eventId";
45
- readonly FIRST_EVENT_TIME: "firstEventTime";
46
- readonly EVENT_TIME: "eventTime";
47
- readonly FIRST_OPERATOR: "firstOperator";
48
- readonly OPERATOR: "operator";
49
- readonly SNAPSHOT_TIME: "snapshotTime";
50
- readonly TAGS: "tags";
51
- readonly DELETED: "deleted";
52
- readonly STATE: "state";
53
- }>;
@@ -1,53 +0,0 @@
1
- import { AbacTaggable } from './abac.js';
2
- import { Version } from './common.js';
3
- import { AggregateId, DeletedCapable, EventIdCapable, EventTimeCapable, FirstEventTimeCapable, FirstOperatorCapable, OperatorCapable, OwnerId, SnapshotTimeCapable, SpaceIdCapable, StateCapable, TenantId } from './modeling.js';
4
- /**
5
- * Interface for materialized snapshots with full capabilities.
6
- */
7
- export interface MaterializedSnapshot<S> extends StateCapable<S>, AggregateId, TenantId, OwnerId, SpaceIdCapable, Version, EventIdCapable, FirstOperatorCapable, OperatorCapable, FirstEventTimeCapable, EventTimeCapable, SnapshotTimeCapable, AbacTaggable, DeletedCapable {
8
- }
9
- /**
10
- * Interface for materialized snapshots with medium capabilities.
11
- *
12
- * Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance.
13
- * This interface is designed to be generic, capable of holding state data of any type.
14
- * Each snapshot corresponds to a specific version of the state within a tenant and owner context,
15
- * and records information such as event IDs and operation times to support tracing and auditing.
16
- *
17
- * Mirrors `MediumMaterializedSnapshot` in
18
- * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/MediumMaterializedSnapshot.kt`.
19
- */
20
- export interface MediumMaterializedSnapshot<S> extends StateCapable<S>, TenantId, OwnerId, SpaceIdCapable, Version, EventIdCapable, FirstOperatorCapable, OperatorCapable, FirstEventTimeCapable, EventTimeCapable, AbacTaggable {
21
- }
22
- /**
23
- * Interface for simplified materialized snapshots with generic state.
24
- *
25
- * This interface implements multiple interfaces to provide version, materialization, first event time, and state information.
26
- *
27
- * Mirrors `SmallMaterializedSnapshot` in
28
- * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/SmallMaterializedSnapshot.kt`.
29
- */
30
- export interface SmallMaterializedSnapshot<S> extends StateCapable<S>, Version, FirstEventTimeCapable {
31
- }
32
- /**
33
- * The field names of a materialized snapshot, for filters, sorts and
34
- * projections over snapshots (`tenantId`, `state`, `deleted`, …).
35
- *
36
- * A frozen name table: read `SnapshotMetadataFields.TENANT_ID`; each value is
37
- * a string literal type.
38
- */
39
- export declare const SnapshotMetadataFields: Readonly<{
40
- readonly VERSION: "version";
41
- readonly TENANT_ID: "tenantId";
42
- readonly OWNER_ID: "ownerId";
43
- readonly SPACE_ID: "spaceId";
44
- readonly EVENT_ID: "eventId";
45
- readonly FIRST_EVENT_TIME: "firstEventTime";
46
- readonly EVENT_TIME: "eventTime";
47
- readonly FIRST_OPERATOR: "firstOperator";
48
- readonly OPERATOR: "operator";
49
- readonly SNAPSHOT_TIME: "snapshotTime";
50
- readonly TAGS: "tags";
51
- readonly DELETED: "deleted";
52
- readonly STATE: "state";
53
- }>;
@@ -1,20 +0,0 @@
1
- //#region src/model/snapshot.ts
2
- var e = Object.freeze({
3
- VERSION: "version",
4
- TENANT_ID: "tenantId",
5
- OWNER_ID: "ownerId",
6
- SPACE_ID: "spaceId",
7
- EVENT_ID: "eventId",
8
- FIRST_EVENT_TIME: "firstEventTime",
9
- EVENT_TIME: "eventTime",
10
- FIRST_OPERATOR: "firstOperator",
11
- OPERATOR: "operator",
12
- SNAPSHOT_TIME: "snapshotTime",
13
- TAGS: "tags",
14
- DELETED: "deleted",
15
- STATE: "state"
16
- });
17
- //#endregion
18
- export { e as SnapshotMetadataFields };
19
-
20
- //# sourceMappingURL=snapshot.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.es.js","names":["SnapshotMetadataFields"],"sources":["../../src/model/snapshot.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AbacTaggable } from './abac.js';\nimport type { Version } from './common.js';\nimport type {\n AggregateId,\n DeletedCapable,\n EventIdCapable,\n EventTimeCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n OperatorCapable,\n OwnerId,\n SnapshotTimeCapable,\n SpaceIdCapable,\n StateCapable,\n TenantId,\n} from './modeling.js';\n\n/**\n * Interface for materialized snapshots with full capabilities.\n */\nexport interface MaterializedSnapshot<S>\n extends\n StateCapable<S>,\n AggregateId,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n SnapshotTimeCapable,\n AbacTaggable,\n DeletedCapable {}\n\n/**\n * Interface for materialized snapshots with medium capabilities.\n *\n * Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance.\n * This interface is designed to be generic, capable of holding state data of any type.\n * Each snapshot corresponds to a specific version of the state within a tenant and owner context,\n * and records information such as event IDs and operation times to support tracing and auditing.\n *\n * Mirrors `MediumMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/MediumMaterializedSnapshot.kt`.\n */\nexport interface MediumMaterializedSnapshot<S>\n extends\n StateCapable<S>,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n AbacTaggable {}\n\n/**\n * Interface for simplified materialized snapshots with generic state.\n *\n * This interface implements multiple interfaces to provide version, materialization, first event time, and state information.\n *\n * Mirrors `SmallMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/SmallMaterializedSnapshot.kt`.\n */\nexport interface SmallMaterializedSnapshot<S>\n extends StateCapable<S>, Version, FirstEventTimeCapable {}\n\n/**\n * The field names of a materialized snapshot, for filters, sorts and\n * projections over snapshots (`tenantId`, `state`, `deleted`, …).\n *\n * A frozen name table: read `SnapshotMetadataFields.TENANT_ID`; each value is\n * a string literal type.\n */\nexport const SnapshotMetadataFields = Object.freeze({\n VERSION: 'version',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n EVENT_ID: 'eventId',\n FIRST_EVENT_TIME: 'firstEventTime',\n EVENT_TIME: 'eventTime',\n FIRST_OPERATOR: 'firstOperator',\n OPERATOR: 'operator',\n SNAPSHOT_TIME: 'snapshotTime',\n TAGS: 'tags',\n DELETED: 'deleted',\n STATE: 'state',\n} as const);\n"],"mappings":";AA6FA,IAAaA,IAAyB,OAAO,OAAO;CAClD,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,UAAU;CACV,kBAAkB;CAClB,YAAY;CACZ,gBAAgB;CAChB,UAAU;CACV,eAAe;CACf,MAAM;CACN,SAAS;CACT,OAAO;AACT,CAAU"}
@@ -1,2 +0,0 @@
1
- const e=require("./eventStreams.cjs");let t=require("@ahoo-wang/fetcher");var n=Object.freeze({headers:Object.freeze({Accept:t.ContentTypeValues.TEXT_EVENT_STREAM}),resultExtractor:e.CommandResultEventStreamResultExtractor}),r=Object.freeze({headers:Object.freeze({Accept:t.ContentTypeValues.TEXT_EVENT_STREAM}),resultExtractor:e.QueryEventStreamResultExtractor});exports.COMMAND_STREAM_ENDPOINT=n,exports.QUERY_STREAM_ENDPOINT=r;
2
- //# sourceMappingURL=endpoints.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoints.cjs","names":["ContentTypeValues","CommandResultEventStreamResultExtractor","QueryEventStreamResultExtractor","require_eventStreams","_ahoo_wang_fetcher","COMMAND_STREAM_ENDPOINT","QUERY_STREAM_ENDPOINT"],"sources":["../../src/transport/endpoints.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ContentTypeValues, type ResultExtractor } from '@ahoo-wang/fetcher';\nimport type { CommandResult } from '../model/command.js';\nimport {\n CommandResultEventStreamResultExtractor,\n QueryEventStreamResultExtractor,\n} from './eventStreams.js';\n\n/**\n * The endpoint options of a command whose answer is a server-sent event\n * stream: `Accept: text/event-stream`, and a result extractor that answers\n * the command results, one per stage the command reached, and errors the\n * stream with a {@link WowError} at the server's error event.\n * `CommandClient.sendAndWaitStream` uses it.\n *\n * A decorated command client that streams, hand-written or generated, takes\n * it whole instead of spelling out the header and the extractor, so the\n * transport is defined in one place. It fits both `@api` and the endpoint\n * decorators. It is frozen; spread it to add options.\n *\n * @example\n * ```typescript\n * import { api, autoGeneratedError, post, request } from '@ahoo-wang/fetcher-decorator';\n *\n * interface AddCartItem {\n * productId: string;\n * }\n *\n * // Every endpoint of the class streams.\n * @api('cart', COMMAND_STREAM_ENDPOINT)\n * class CartStreamCommandClient {\n * @post('add_cart_item')\n * addCartItem(\n * @request() command: CommandRequest<AddCartItem>,\n * ): Promise<CommandResultEventStream> {\n * throw autoGeneratedError(command);\n * }\n * }\n *\n * // One endpoint streams.\n * @api('cart')\n * class CartCommandClient {\n * @post('add_cart_item', COMMAND_STREAM_ENDPOINT)\n * addCartItemStream(\n * @request() command: CommandRequest<AddCartItem>,\n * ): Promise<CommandResultEventStream> {\n * throw autoGeneratedError(command);\n * }\n * }\n * ```\n */\nexport const COMMAND_STREAM_ENDPOINT: {\n readonly headers: { readonly Accept: 'text/event-stream' };\n readonly resultExtractor: ResultExtractor<ReadableStream<CommandResult>>;\n} = Object.freeze({\n headers: Object.freeze({ Accept: ContentTypeValues.TEXT_EVENT_STREAM }),\n resultExtractor: CommandResultEventStreamResultExtractor,\n});\n\n/**\n * The endpoint options of a query whose answer is a server-sent event\n * stream: `Accept: text/event-stream`, and a result extractor that answers\n * the rows, one per event, and errors the stream with a {@link WowError} at\n * the server's error event. The `*Stream` methods of the query clients use\n * it. Frozen, like {@link COMMAND_STREAM_ENDPOINT}.\n *\n * @example\n * ```typescript\n * import { api, autoGeneratedError, body, post } from '@ahoo-wang/fetcher-decorator';\n *\n * @api('cart')\n * class CartReportClient {\n * @post('report/list', QUERY_STREAM_ENDPOINT)\n * listStream(\n * @body() query: FilterListQuery,\n * ): Promise<ReadableStream<{ total: number }>> {\n * throw autoGeneratedError(query);\n * }\n * }\n * ```\n */\nexport const QUERY_STREAM_ENDPOINT: {\n readonly headers: { readonly Accept: 'text/event-stream' };\n readonly resultExtractor: ResultExtractor<ReadableStream<unknown>>;\n} = Object.freeze({\n headers: Object.freeze({ Accept: ContentTypeValues.TEXT_EVENT_STREAM }),\n resultExtractor: QueryEventStreamResultExtractor,\n});\n"],"mappings":"0EA+DA,IAAaK,EAGT,OAAO,OAAO,CAChB,QAAS,OAAO,OAAO,CAAE,OAAQL,EAAAA,kBAAkB,iBAAkB,CAAC,EACtE,gBAAiBC,EAAAA,uCACnB,CAAC,EAwBYK,EAGT,OAAO,OAAO,CAChB,QAAS,OAAO,OAAO,CAAE,OAAQN,EAAAA,kBAAkB,iBAAkB,CAAC,EACtE,gBAAiBE,EAAAA,+BACnB,CAAC"}
@@ -1,79 +0,0 @@
1
- import { ResultExtractor } from '@ahoo-wang/fetcher';
2
- import { CommandResult } from '../model/command.cjs';
3
- /**
4
- * The endpoint options of a command whose answer is a server-sent event
5
- * stream: `Accept: text/event-stream`, and a result extractor that answers
6
- * the command results, one per stage the command reached, and errors the
7
- * stream with a {@link WowError} at the server's error event.
8
- * `CommandClient.sendAndWaitStream` uses it.
9
- *
10
- * A decorated command client that streams, hand-written or generated, takes
11
- * it whole instead of spelling out the header and the extractor, so the
12
- * transport is defined in one place. It fits both `@api` and the endpoint
13
- * decorators. It is frozen; spread it to add options.
14
- *
15
- * @example
16
- * ```typescript
17
- * import { api, autoGeneratedError, post, request } from '@ahoo-wang/fetcher-decorator';
18
- *
19
- * interface AddCartItem {
20
- * productId: string;
21
- * }
22
- *
23
- * // Every endpoint of the class streams.
24
- * @api('cart', COMMAND_STREAM_ENDPOINT)
25
- * class CartStreamCommandClient {
26
- * @post('add_cart_item')
27
- * addCartItem(
28
- * @request() command: CommandRequest<AddCartItem>,
29
- * ): Promise<CommandResultEventStream> {
30
- * throw autoGeneratedError(command);
31
- * }
32
- * }
33
- *
34
- * // One endpoint streams.
35
- * @api('cart')
36
- * class CartCommandClient {
37
- * @post('add_cart_item', COMMAND_STREAM_ENDPOINT)
38
- * addCartItemStream(
39
- * @request() command: CommandRequest<AddCartItem>,
40
- * ): Promise<CommandResultEventStream> {
41
- * throw autoGeneratedError(command);
42
- * }
43
- * }
44
- * ```
45
- */
46
- export declare const COMMAND_STREAM_ENDPOINT: {
47
- readonly headers: {
48
- readonly Accept: 'text/event-stream';
49
- };
50
- readonly resultExtractor: ResultExtractor<ReadableStream<CommandResult>>;
51
- };
52
- /**
53
- * The endpoint options of a query whose answer is a server-sent event
54
- * stream: `Accept: text/event-stream`, and a result extractor that answers
55
- * the rows, one per event, and errors the stream with a {@link WowError} at
56
- * the server's error event. The `*Stream` methods of the query clients use
57
- * it. Frozen, like {@link COMMAND_STREAM_ENDPOINT}.
58
- *
59
- * @example
60
- * ```typescript
61
- * import { api, autoGeneratedError, body, post } from '@ahoo-wang/fetcher-decorator';
62
- *
63
- * @api('cart')
64
- * class CartReportClient {
65
- * @post('report/list', QUERY_STREAM_ENDPOINT)
66
- * listStream(
67
- * @body() query: FilterListQuery,
68
- * ): Promise<ReadableStream<{ total: number }>> {
69
- * throw autoGeneratedError(query);
70
- * }
71
- * }
72
- * ```
73
- */
74
- export declare const QUERY_STREAM_ENDPOINT: {
75
- readonly headers: {
76
- readonly Accept: 'text/event-stream';
77
- };
78
- readonly resultExtractor: ResultExtractor<ReadableStream<unknown>>;
79
- };
@@ -1,79 +0,0 @@
1
- import { ResultExtractor } from '@ahoo-wang/fetcher';
2
- import { CommandResult } from '../model/command.js';
3
- /**
4
- * The endpoint options of a command whose answer is a server-sent event
5
- * stream: `Accept: text/event-stream`, and a result extractor that answers
6
- * the command results, one per stage the command reached, and errors the
7
- * stream with a {@link WowError} at the server's error event.
8
- * `CommandClient.sendAndWaitStream` uses it.
9
- *
10
- * A decorated command client that streams, hand-written or generated, takes
11
- * it whole instead of spelling out the header and the extractor, so the
12
- * transport is defined in one place. It fits both `@api` and the endpoint
13
- * decorators. It is frozen; spread it to add options.
14
- *
15
- * @example
16
- * ```typescript
17
- * import { api, autoGeneratedError, post, request } from '@ahoo-wang/fetcher-decorator';
18
- *
19
- * interface AddCartItem {
20
- * productId: string;
21
- * }
22
- *
23
- * // Every endpoint of the class streams.
24
- * @api('cart', COMMAND_STREAM_ENDPOINT)
25
- * class CartStreamCommandClient {
26
- * @post('add_cart_item')
27
- * addCartItem(
28
- * @request() command: CommandRequest<AddCartItem>,
29
- * ): Promise<CommandResultEventStream> {
30
- * throw autoGeneratedError(command);
31
- * }
32
- * }
33
- *
34
- * // One endpoint streams.
35
- * @api('cart')
36
- * class CartCommandClient {
37
- * @post('add_cart_item', COMMAND_STREAM_ENDPOINT)
38
- * addCartItemStream(
39
- * @request() command: CommandRequest<AddCartItem>,
40
- * ): Promise<CommandResultEventStream> {
41
- * throw autoGeneratedError(command);
42
- * }
43
- * }
44
- * ```
45
- */
46
- export declare const COMMAND_STREAM_ENDPOINT: {
47
- readonly headers: {
48
- readonly Accept: 'text/event-stream';
49
- };
50
- readonly resultExtractor: ResultExtractor<ReadableStream<CommandResult>>;
51
- };
52
- /**
53
- * The endpoint options of a query whose answer is a server-sent event
54
- * stream: `Accept: text/event-stream`, and a result extractor that answers
55
- * the rows, one per event, and errors the stream with a {@link WowError} at
56
- * the server's error event. The `*Stream` methods of the query clients use
57
- * it. Frozen, like {@link COMMAND_STREAM_ENDPOINT}.
58
- *
59
- * @example
60
- * ```typescript
61
- * import { api, autoGeneratedError, body, post } from '@ahoo-wang/fetcher-decorator';
62
- *
63
- * @api('cart')
64
- * class CartReportClient {
65
- * @post('report/list', QUERY_STREAM_ENDPOINT)
66
- * listStream(
67
- * @body() query: FilterListQuery,
68
- * ): Promise<ReadableStream<{ total: number }>> {
69
- * throw autoGeneratedError(query);
70
- * }
71
- * }
72
- * ```
73
- */
74
- export declare const QUERY_STREAM_ENDPOINT: {
75
- readonly headers: {
76
- readonly Accept: 'text/event-stream';
77
- };
78
- readonly resultExtractor: ResultExtractor<ReadableStream<unknown>>;
79
- };
@@ -1,14 +0,0 @@
1
- import { CommandResultEventStreamResultExtractor as e, QueryEventStreamResultExtractor as t } from "./eventStreams.es.js";
2
- import { ContentTypeValues as n } from "@ahoo-wang/fetcher";
3
- //#region src/transport/endpoints.ts
4
- var r = Object.freeze({
5
- headers: Object.freeze({ Accept: n.TEXT_EVENT_STREAM }),
6
- resultExtractor: e
7
- }), i = Object.freeze({
8
- headers: Object.freeze({ Accept: n.TEXT_EVENT_STREAM }),
9
- resultExtractor: t
10
- });
11
- //#endregion
12
- export { r as COMMAND_STREAM_ENDPOINT, i as QUERY_STREAM_ENDPOINT };
13
-
14
- //# sourceMappingURL=endpoints.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoints.es.js","names":["COMMAND_STREAM_ENDPOINT","ContentTypeValues","CommandResultEventStreamResultExtractor","QUERY_STREAM_ENDPOINT","QueryEventStreamResultExtractor"],"sources":["../../src/transport/endpoints.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ContentTypeValues, type ResultExtractor } from '@ahoo-wang/fetcher';\nimport type { CommandResult } from '../model/command.js';\nimport {\n CommandResultEventStreamResultExtractor,\n QueryEventStreamResultExtractor,\n} from './eventStreams.js';\n\n/**\n * The endpoint options of a command whose answer is a server-sent event\n * stream: `Accept: text/event-stream`, and a result extractor that answers\n * the command results, one per stage the command reached, and errors the\n * stream with a {@link WowError} at the server's error event.\n * `CommandClient.sendAndWaitStream` uses it.\n *\n * A decorated command client that streams, hand-written or generated, takes\n * it whole instead of spelling out the header and the extractor, so the\n * transport is defined in one place. It fits both `@api` and the endpoint\n * decorators. It is frozen; spread it to add options.\n *\n * @example\n * ```typescript\n * import { api, autoGeneratedError, post, request } from '@ahoo-wang/fetcher-decorator';\n *\n * interface AddCartItem {\n * productId: string;\n * }\n *\n * // Every endpoint of the class streams.\n * @api('cart', COMMAND_STREAM_ENDPOINT)\n * class CartStreamCommandClient {\n * @post('add_cart_item')\n * addCartItem(\n * @request() command: CommandRequest<AddCartItem>,\n * ): Promise<CommandResultEventStream> {\n * throw autoGeneratedError(command);\n * }\n * }\n *\n * // One endpoint streams.\n * @api('cart')\n * class CartCommandClient {\n * @post('add_cart_item', COMMAND_STREAM_ENDPOINT)\n * addCartItemStream(\n * @request() command: CommandRequest<AddCartItem>,\n * ): Promise<CommandResultEventStream> {\n * throw autoGeneratedError(command);\n * }\n * }\n * ```\n */\nexport const COMMAND_STREAM_ENDPOINT: {\n readonly headers: { readonly Accept: 'text/event-stream' };\n readonly resultExtractor: ResultExtractor<ReadableStream<CommandResult>>;\n} = Object.freeze({\n headers: Object.freeze({ Accept: ContentTypeValues.TEXT_EVENT_STREAM }),\n resultExtractor: CommandResultEventStreamResultExtractor,\n});\n\n/**\n * The endpoint options of a query whose answer is a server-sent event\n * stream: `Accept: text/event-stream`, and a result extractor that answers\n * the rows, one per event, and errors the stream with a {@link WowError} at\n * the server's error event. The `*Stream` methods of the query clients use\n * it. Frozen, like {@link COMMAND_STREAM_ENDPOINT}.\n *\n * @example\n * ```typescript\n * import { api, autoGeneratedError, body, post } from '@ahoo-wang/fetcher-decorator';\n *\n * @api('cart')\n * class CartReportClient {\n * @post('report/list', QUERY_STREAM_ENDPOINT)\n * listStream(\n * @body() query: FilterListQuery,\n * ): Promise<ReadableStream<{ total: number }>> {\n * throw autoGeneratedError(query);\n * }\n * }\n * ```\n */\nexport const QUERY_STREAM_ENDPOINT: {\n readonly headers: { readonly Accept: 'text/event-stream' };\n readonly resultExtractor: ResultExtractor<ReadableStream<unknown>>;\n} = Object.freeze({\n headers: Object.freeze({ Accept: ContentTypeValues.TEXT_EVENT_STREAM }),\n resultExtractor: QueryEventStreamResultExtractor,\n});\n"],"mappings":";;;AA+DA,IAAaA,IAGT,OAAO,OAAO;CAChB,SAAS,OAAO,OAAO,EAAE,QAAQC,EAAkB,kBAAkB,CAAC;CACtE,iBAAiBC;AACnB,CAAC,GAwBYC,IAGT,OAAO,OAAO;CAChB,SAAS,OAAO,OAAO,EAAE,QAAQF,EAAkB,kBAAkB,CAAC;CACtE,iBAAiBG;AACnB,CAAC"}
@@ -1,2 +0,0 @@
1
- const e=require("../error/wowError.cjs"),t=require("../model/command.cjs");let n=require("@ahoo-wang/fetcher-eventstream");var r=`message`,i=new Set(Object.values(t.CommandStage));function a(e){return typeof e==`object`&&!!e&&typeof e.stage==`string`}function o(t){return new TransformStream({transform(n,r){t(n)?r.enqueue(n.data):r.error(new e.WowError(e.isErrorInfo(n.data)?n.data:{errorCode:n.event,errorMsg:``}))}})}var s=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(o(e=>e.event===r)),c=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(o(e=>i.has(e.event)||a(e.data)));exports.CommandResultEventStreamResultExtractor=c,exports.QueryEventStreamResultExtractor=s;
2
- //# sourceMappingURL=eventStreams.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eventStreams.cjs","names":["CommandStage","WowError","isErrorInfo","JsonEventStreamResultExtractor","require_wowError","require_command","_ahoo_wang_fetcher_eventstream","ROW_EVENT","COMMAND_STAGES","namesStage","data","rowsUntilErrorEvent","isData","event","controller","QueryEventStreamResultExtractor","exchange","CommandResultEventStreamResultExtractor"],"sources":["../../src/transport/eventStreams.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ResultExtractor } from '@ahoo-wang/fetcher';\nimport {\n JsonEventStreamResultExtractor,\n type JsonServerSentEvent,\n} from '@ahoo-wang/fetcher-eventstream';\nimport { isErrorInfo, WowError } from '../error/wowError.js';\nimport { type CommandResult, CommandStage } from '../model/command.js';\n\n/**\n * The event name the server gives the rows of a query stream. Wow sends them\n * without an `event:` field, which the event-stream parser reads as\n * `message`.\n */\nconst ROW_EVENT = 'message';\n\nconst COMMAND_STAGES: ReadonlySet<string> = new Set(\n Object.values(CommandStage),\n);\n\n/** True when the data is a command result: it names the stage it reports. */\nfunction namesStage(data: unknown): boolean {\n return (\n typeof data === 'object' &&\n data !== null &&\n typeof (data as { stage?: unknown }).stage === 'string'\n );\n}\n\n/**\n * Unwraps the events `isData` accepts to their data, and errors the stream\n * with a `WowError` at the first one it does not.\n *\n * Wow's `event`, `id` and `retry` fields carry nothing an application reads:\n * a query row always arrives as `message`, a command result names its stage\n * in `stage`, and Wow does not resume a stream. So the stream a client\n * answers is the rows themselves.\n *\n * When a server-sent event stream fails midway, Wow still answers HTTP 200\n * and sends one last event whose name is the error code and whose data is\n * the `ErrorInfo`, then closes the stream (`WebFluxResponseStrategy`,\n * `errorResume`). Read as data it would pass for a row or a command result;\n * here it ends the stream the way a failed request ends a call.\n */\nfunction rowsUntilErrorEvent<T>(\n isData: (event: JsonServerSentEvent<unknown>) => boolean,\n): TransformStream<JsonServerSentEvent<unknown>, T> {\n return new TransformStream({\n transform(event, controller) {\n if (isData(event)) {\n controller.enqueue(event.data as T);\n return;\n }\n controller.error(\n new WowError(\n isErrorInfo(event.data)\n ? event.data\n : { errorCode: event.event, errorMsg: '' },\n ),\n );\n },\n });\n}\n\n/**\n * Internal: applications and generated code take the two extractors below\n * through the endpoint presets `QUERY_STREAM_ENDPOINT` and\n * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.\n *\n * The result extractor of the query streams (`listStream`,\n * `listStateStream`, `aggregateStream`, `loadStream`): the response as a\n * stream of rows, one per server-sent event, which errors with a\n * {@link WowError} when the server sends an error event.\n */\nexport const QueryEventStreamResultExtractor: ResultExtractor<\n ReadableStream<unknown>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent(event => event.event === ROW_EVENT),\n );\n\n/**\n * The result extractor of `sendAndWaitStream`: the command results, one per\n * stage the command reached, which errors with a {@link WowError} when the\n * server sends an error event. A command result whose own `errorCode` is not\n * `Ok` is still a result — the command failed in its processing — and is\n * passed on as one. So is a result from a stage this version does not know:\n * a command result names its stage in `stage`, the error event's `ErrorInfo`\n * does not, so a newer server's stage is not read as an error.\n *\n * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.\n */\nexport const CommandResultEventStreamResultExtractor: ResultExtractor<\n ReadableStream<CommandResult>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent<CommandResult>(\n event => COMMAND_STAGES.has(event.event) || namesStage(event.data),\n ),\n );\n"],"mappings":"2HA0BA,IAAMO,EAAY,UAEZC,EAAsC,IAAI,IAC9C,OAAO,OAAOR,EAAAA,YAAY,CAC5B,EAGA,SAASS,EAAW,EAAwB,CAC1C,OACE,OAAOC,GAAS,YAChBA,GACA,OAAQA,EAA6B,OAAU,QAEnD,CAiBA,SAASC,EACP,EACkD,CAClD,OAAO,IAAI,gBAAgB,CACzB,UAAU,EAAO,EAAY,CACvBC,EAAOC,CAAK,EACdC,EAAW,QAAQD,EAAM,IAAS,EAGpCC,EAAW,MACT,IAAIb,EAAAA,SACFC,EAAAA,YAAYW,EAAM,IAAI,EAClBA,EAAM,KACN,CAAE,UAAWA,EAAM,MAAO,SAAU,EAAG,CAC7C,CACF,CACF,CACF,CAAC,CACH,CAYA,IAAaE,EAET,KAAM,KACP,MAAA,EAAMZ,EAAAA,+BAAAA,CAA+Ba,CAAQ,EAAA,CAAG,YAC/CL,EAAoB,GAASE,EAAM,QAAUN,CAAS,CACxD,EAaWU,EAET,KAAM,KACP,MAAA,EAAMd,EAAAA,+BAAAA,CAA+Ba,CAAQ,EAAA,CAAG,YAC/CL,EACE,GAASH,EAAe,IAAIK,EAAM,KAAK,GAAKJ,EAAWI,EAAM,IAAI,CACnE,CACF"}
@@ -1,25 +0,0 @@
1
- import { ResultExtractor } from '@ahoo-wang/fetcher';
2
- import { CommandResult } from '../model/command.cjs';
3
- /**
4
- * Internal: applications and generated code take the two extractors below
5
- * through the endpoint presets `QUERY_STREAM_ENDPOINT` and
6
- * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.
7
- *
8
- * The result extractor of the query streams (`listStream`,
9
- * `listStateStream`, `aggregateStream`, `loadStream`): the response as a
10
- * stream of rows, one per server-sent event, which errors with a
11
- * {@link WowError} when the server sends an error event.
12
- */
13
- export declare const QueryEventStreamResultExtractor: ResultExtractor<ReadableStream<unknown>>;
14
- /**
15
- * The result extractor of `sendAndWaitStream`: the command results, one per
16
- * stage the command reached, which errors with a {@link WowError} when the
17
- * server sends an error event. A command result whose own `errorCode` is not
18
- * `Ok` is still a result — the command failed in its processing — and is
19
- * passed on as one. So is a result from a stage this version does not know:
20
- * a command result names its stage in `stage`, the error event's `ErrorInfo`
21
- * does not, so a newer server's stage is not read as an error.
22
- *
23
- * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.
24
- */
25
- export declare const CommandResultEventStreamResultExtractor: ResultExtractor<ReadableStream<CommandResult>>;
@@ -1,25 +0,0 @@
1
- import { ResultExtractor } from '@ahoo-wang/fetcher';
2
- import { CommandResult } from '../model/command.js';
3
- /**
4
- * Internal: applications and generated code take the two extractors below
5
- * through the endpoint presets `QUERY_STREAM_ENDPOINT` and
6
- * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.
7
- *
8
- * The result extractor of the query streams (`listStream`,
9
- * `listStateStream`, `aggregateStream`, `loadStream`): the response as a
10
- * stream of rows, one per server-sent event, which errors with a
11
- * {@link WowError} when the server sends an error event.
12
- */
13
- export declare const QueryEventStreamResultExtractor: ResultExtractor<ReadableStream<unknown>>;
14
- /**
15
- * The result extractor of `sendAndWaitStream`: the command results, one per
16
- * stage the command reached, which errors with a {@link WowError} when the
17
- * server sends an error event. A command result whose own `errorCode` is not
18
- * `Ok` is still a result — the command failed in its processing — and is
19
- * passed on as one. So is a result from a stage this version does not know:
20
- * a command result names its stage in `stage`, the error event's `ErrorInfo`
21
- * does not, so a newer server's stage is not read as an error.
22
- *
23
- * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.
24
- */
25
- export declare const CommandResultEventStreamResultExtractor: ResultExtractor<ReadableStream<CommandResult>>;
@@ -1,21 +0,0 @@
1
- import { WowError as e, isErrorInfo as t } from "../error/wowError.es.js";
2
- import { CommandStage as n } from "../model/command.es.js";
3
- import { JsonEventStreamResultExtractor as r } from "@ahoo-wang/fetcher-eventstream";
4
- //#region src/transport/eventStreams.ts
5
- var i = "message", a = new Set(Object.values(n));
6
- function o(e) {
7
- return typeof e == "object" && !!e && typeof e.stage == "string";
8
- }
9
- function s(n) {
10
- return new TransformStream({ transform(r, i) {
11
- n(r) ? i.enqueue(r.data) : i.error(new e(t(r.data) ? r.data : {
12
- errorCode: r.event,
13
- errorMsg: ""
14
- }));
15
- } });
16
- }
17
- var c = async (e) => (await r(e)).pipeThrough(s((e) => e.event === i)), l = async (e) => (await r(e)).pipeThrough(s((e) => a.has(e.event) || o(e.data)));
18
- //#endregion
19
- export { l as CommandResultEventStreamResultExtractor, c as QueryEventStreamResultExtractor };
20
-
21
- //# sourceMappingURL=eventStreams.es.js.map