@ahoo-wang/wow-client 10.0.0-alpha.3 → 10.0.0-alpha.5

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 (420) 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/{v10/commands.d.cts → commands.d.cts} +21 -3
  6. package/dist/{v10/commands.d.ts → commands.d.ts} +21 -3
  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 +1 -1
  19. package/dist/dsl/descriptor.d.ts +1 -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/{v10/http.d.cts → http.d.cts} +16 -7
  48. package/dist/{v10/http.d.ts → http.d.ts} +16 -7
  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.map +1 -0
  56. package/dist/{v10/manifest.es.js → manifest.es.js} +1 -1
  57. package/dist/manifest.es.js.map +1 -0
  58. package/dist/problem.cjs +2 -0
  59. package/dist/problem.cjs.map +1 -0
  60. package/dist/{v10/problem.d.cts → problem.d.cts} +51 -4
  61. package/dist/{v10/problem.d.ts → problem.d.ts} +51 -4
  62. package/dist/{v10/problem.es.js → problem.es.js} +30 -11
  63. package/dist/problem.es.js.map +1 -0
  64. package/dist/queries.cjs +2 -0
  65. package/dist/queries.cjs.map +1 -0
  66. package/dist/{v10/queries.d.cts → queries.d.cts} +63 -17
  67. package/dist/{v10/queries.d.ts → queries.d.ts} +63 -17
  68. package/dist/queries.es.js +112 -0
  69. package/dist/queries.es.js.map +1 -0
  70. package/dist/state.cjs +2 -0
  71. package/dist/state.cjs.map +1 -0
  72. package/dist/{v10/state.d.cts → state.d.cts} +26 -4
  73. package/dist/{v10/state.d.ts → state.d.ts} +26 -4
  74. package/dist/state.es.js +70 -0
  75. package/dist/state.es.js.map +1 -0
  76. package/dist/streams.cjs +2 -0
  77. package/dist/streams.cjs.map +1 -0
  78. package/dist/streams.d.cts +74 -0
  79. package/dist/streams.d.ts +74 -0
  80. package/dist/streams.es.js +103 -0
  81. package/dist/streams.es.js.map +1 -0
  82. package/dist/wait.cjs.map +1 -0
  83. package/dist/{v10/wait.es.js → wait.es.js} +1 -1
  84. package/dist/wait.es.js.map +1 -0
  85. package/dist/wire.cjs.map +1 -0
  86. package/dist/{v10/wire.d.cts → wire.d.cts} +32 -7
  87. package/dist/{v10/wire.d.ts → wire.d.ts} +32 -7
  88. package/dist/{v10/wire.es.js → wire.es.js} +1 -1
  89. package/dist/wire.es.js.map +1 -0
  90. package/package.json +4 -26
  91. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs +0 -1
  92. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js +0 -9
  93. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs +0 -1
  94. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js +0 -6
  95. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs +0 -1
  96. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js +0 -8
  97. package/dist/client/bindMethods.cjs +0 -2
  98. package/dist/client/bindMethods.cjs.map +0 -1
  99. package/dist/client/bindMethods.d.cts +0 -13
  100. package/dist/client/bindMethods.d.ts +0 -13
  101. package/dist/client/bindMethods.es.js +0 -19
  102. package/dist/client/bindMethods.es.js.map +0 -1
  103. package/dist/client/command/commandClient.cjs +0 -2
  104. package/dist/client/command/commandClient.cjs.map +0 -1
  105. package/dist/client/command/commandClient.d.cts +0 -67
  106. package/dist/client/command/commandClient.d.ts +0 -67
  107. package/dist/client/command/commandClient.es.js +0 -38
  108. package/dist/client/command/commandClient.es.js.map +0 -1
  109. package/dist/client/command/commandHeaders.cjs +0 -2
  110. package/dist/client/command/commandHeaders.cjs.map +0 -1
  111. package/dist/client/command/commandHeaders.d.cts +0 -75
  112. package/dist/client/command/commandHeaders.d.ts +0 -75
  113. package/dist/client/command/commandHeaders.es.js +0 -31
  114. package/dist/client/command/commandHeaders.es.js.map +0 -1
  115. package/dist/client/command/commandRequest.cjs +0 -2
  116. package/dist/client/command/commandRequest.cjs.map +0 -1
  117. package/dist/client/command/commandRequest.d.cts +0 -180
  118. package/dist/client/command/commandRequest.d.ts +0 -180
  119. package/dist/client/command/commandRequest.es.js +0 -31
  120. package/dist/client/command/commandRequest.es.js.map +0 -1
  121. package/dist/client/command/commandResult.d.cts +0 -15
  122. package/dist/client/command/commandResult.d.ts +0 -15
  123. package/dist/client/command/index.d.cts +0 -5
  124. package/dist/client/command/index.d.ts +0 -5
  125. package/dist/client/command/types.d.cts +0 -71
  126. package/dist/client/command/types.d.ts +0 -71
  127. package/dist/client/metadata/index.d.cts +0 -2
  128. package/dist/client/metadata/index.d.ts +0 -2
  129. package/dist/client/metadata/wowMetadata.d.cts +0 -48
  130. package/dist/client/metadata/wowMetadata.d.ts +0 -48
  131. package/dist/client/metadata/wowMetadataClient.cjs +0 -2
  132. package/dist/client/metadata/wowMetadataClient.cjs.map +0 -1
  133. package/dist/client/metadata/wowMetadataClient.d.cts +0 -23
  134. package/dist/client/metadata/wowMetadataClient.d.ts +0 -23
  135. package/dist/client/metadata/wowMetadataClient.es.js +0 -25
  136. package/dist/client/metadata/wowMetadataClient.es.js.map +0 -1
  137. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs +0 -2
  138. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs.map +0 -1
  139. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.cts +0 -8
  140. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.ts +0 -8
  141. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js +0 -34
  142. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js.map +0 -1
  143. package/dist/client/query/dataset/datasetDirectoryClient.cjs +0 -2
  144. package/dist/client/query/dataset/datasetDirectoryClient.cjs.map +0 -1
  145. package/dist/client/query/dataset/datasetDirectoryClient.d.cts +0 -29
  146. package/dist/client/query/dataset/datasetDirectoryClient.d.ts +0 -29
  147. package/dist/client/query/dataset/datasetDirectoryClient.es.js +0 -25
  148. package/dist/client/query/dataset/datasetDirectoryClient.es.js.map +0 -1
  149. package/dist/client/query/dataset/datasetQueryApi.d.cts +0 -40
  150. package/dist/client/query/dataset/datasetQueryApi.d.ts +0 -40
  151. package/dist/client/query/dataset/datasetQueryClient.cjs +0 -2
  152. package/dist/client/query/dataset/datasetQueryClient.cjs.map +0 -1
  153. package/dist/client/query/dataset/datasetQueryClient.d.cts +0 -57
  154. package/dist/client/query/dataset/datasetQueryClient.d.ts +0 -57
  155. package/dist/client/query/dataset/datasetQueryClient.es.js +0 -154
  156. package/dist/client/query/dataset/datasetQueryClient.es.js.map +0 -1
  157. package/dist/client/query/dataset/endpointPaths.cjs +0 -2
  158. package/dist/client/query/dataset/endpointPaths.cjs.map +0 -1
  159. package/dist/client/query/dataset/endpointPaths.d.cts +0 -9
  160. package/dist/client/query/dataset/endpointPaths.d.ts +0 -9
  161. package/dist/client/query/dataset/endpointPaths.es.js +0 -14
  162. package/dist/client/query/dataset/endpointPaths.es.js.map +0 -1
  163. package/dist/client/query/dataset/index.d.cts +0 -3
  164. package/dist/client/query/dataset/index.d.ts +0 -3
  165. package/dist/client/query/descriptor/descriptorEndpoints.cjs +0 -2
  166. package/dist/client/query/descriptor/descriptorEndpoints.cjs.map +0 -1
  167. package/dist/client/query/descriptor/descriptorEndpoints.d.cts +0 -29
  168. package/dist/client/query/descriptor/descriptorEndpoints.d.ts +0 -29
  169. package/dist/client/query/descriptor/descriptorEndpoints.es.js +0 -69
  170. package/dist/client/query/descriptor/descriptorEndpoints.es.js.map +0 -1
  171. package/dist/client/query/descriptor/endpointPaths.cjs +0 -2
  172. package/dist/client/query/descriptor/endpointPaths.cjs.map +0 -1
  173. package/dist/client/query/descriptor/endpointPaths.d.cts +0 -4
  174. package/dist/client/query/descriptor/endpointPaths.d.ts +0 -4
  175. package/dist/client/query/descriptor/endpointPaths.es.js +0 -9
  176. package/dist/client/query/descriptor/endpointPaths.es.js.map +0 -1
  177. package/dist/client/query/descriptor/index.d.cts +0 -2
  178. package/dist/client/query/descriptor/index.d.ts +0 -2
  179. package/dist/client/query/descriptor/queryDescriptorApi.d.cts +0 -58
  180. package/dist/client/query/descriptor/queryDescriptorApi.d.ts +0 -58
  181. package/dist/client/query/descriptor/queryDescriptorClient.cjs +0 -2
  182. package/dist/client/query/descriptor/queryDescriptorClient.cjs.map +0 -1
  183. package/dist/client/query/descriptor/queryDescriptorClient.d.cts +0 -61
  184. package/dist/client/query/descriptor/queryDescriptorClient.d.ts +0 -61
  185. package/dist/client/query/descriptor/queryDescriptorClient.es.js +0 -20
  186. package/dist/client/query/descriptor/queryDescriptorClient.es.js.map +0 -1
  187. package/dist/client/query/event/endpointPaths.cjs +0 -2
  188. package/dist/client/query/event/endpointPaths.cjs.map +0 -1
  189. package/dist/client/query/event/endpointPaths.d.cts +0 -8
  190. package/dist/client/query/event/endpointPaths.d.ts +0 -8
  191. package/dist/client/query/event/endpointPaths.es.js +0 -13
  192. package/dist/client/query/event/endpointPaths.es.js.map +0 -1
  193. package/dist/client/query/event/eventStreamQueryApi.d.cts +0 -29
  194. package/dist/client/query/event/eventStreamQueryApi.d.ts +0 -29
  195. package/dist/client/query/event/eventStreamQueryClient.cjs +0 -2
  196. package/dist/client/query/event/eventStreamQueryClient.cjs.map +0 -1
  197. package/dist/client/query/event/eventStreamQueryClient.d.cts +0 -193
  198. package/dist/client/query/event/eventStreamQueryClient.d.ts +0 -193
  199. package/dist/client/query/event/eventStreamQueryClient.es.js +0 -160
  200. package/dist/client/query/event/eventStreamQueryClient.es.js.map +0 -1
  201. package/dist/client/query/event/index.d.cts +0 -2
  202. package/dist/client/query/event/index.d.ts +0 -2
  203. package/dist/client/query/factory.cjs +0 -2
  204. package/dist/client/query/factory.cjs.map +0 -1
  205. package/dist/client/query/factory.d.cts +0 -165
  206. package/dist/client/query/factory.d.ts +0 -165
  207. package/dist/client/query/factory.es.js +0 -45
  208. package/dist/client/query/factory.es.js.map +0 -1
  209. package/dist/client/query/index.d.cts +0 -7
  210. package/dist/client/query/index.d.ts +0 -7
  211. package/dist/client/query/queryApi.d.cts +0 -68
  212. package/dist/client/query/queryApi.d.ts +0 -68
  213. package/dist/client/query/requests.d.cts +0 -24
  214. package/dist/client/query/requests.d.ts +0 -24
  215. package/dist/client/query/snapshot/endpointPaths.cjs +0 -2
  216. package/dist/client/query/snapshot/endpointPaths.cjs.map +0 -1
  217. package/dist/client/query/snapshot/endpointPaths.d.cts +0 -12
  218. package/dist/client/query/snapshot/endpointPaths.d.ts +0 -12
  219. package/dist/client/query/snapshot/endpointPaths.es.js +0 -17
  220. package/dist/client/query/snapshot/endpointPaths.es.js.map +0 -1
  221. package/dist/client/query/snapshot/index.d.cts +0 -2
  222. package/dist/client/query/snapshot/index.d.ts +0 -2
  223. package/dist/client/query/snapshot/snapshotQueryApi.d.cts +0 -101
  224. package/dist/client/query/snapshot/snapshotQueryApi.d.ts +0 -101
  225. package/dist/client/query/snapshot/snapshotQueryClient.cjs +0 -2
  226. package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +0 -1
  227. package/dist/client/query/snapshot/snapshotQueryClient.d.cts +0 -372
  228. package/dist/client/query/snapshot/snapshotQueryClient.d.ts +0 -372
  229. package/dist/client/query/snapshot/snapshotQueryClient.es.js +0 -239
  230. package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +0 -1
  231. package/dist/client/query/state/endpointPaths.cjs +0 -2
  232. package/dist/client/query/state/endpointPaths.cjs.map +0 -1
  233. package/dist/client/query/state/endpointPaths.d.cts +0 -10
  234. package/dist/client/query/state/endpointPaths.d.ts +0 -10
  235. package/dist/client/query/state/endpointPaths.es.js +0 -14
  236. package/dist/client/query/state/endpointPaths.es.js.map +0 -1
  237. package/dist/client/query/state/index.d.cts +0 -4
  238. package/dist/client/query/state/index.d.ts +0 -4
  239. package/dist/client/query/state/loadOwnerStateAggregateApi.d.cts +0 -36
  240. package/dist/client/query/state/loadOwnerStateAggregateApi.d.ts +0 -36
  241. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs +0 -2
  242. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs.map +0 -1
  243. package/dist/client/query/state/loadOwnerStateAggregateClient.d.cts +0 -58
  244. package/dist/client/query/state/loadOwnerStateAggregateClient.d.ts +0 -58
  245. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js +0 -56
  246. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js.map +0 -1
  247. package/dist/client/query/state/loadStateAggregateApi.d.cts +0 -37
  248. package/dist/client/query/state/loadStateAggregateApi.d.ts +0 -37
  249. package/dist/client/query/state/loadStateAggregateClient.cjs +0 -2
  250. package/dist/client/query/state/loadStateAggregateClient.cjs.map +0 -1
  251. package/dist/client/query/state/loadStateAggregateClient.d.cts +0 -62
  252. package/dist/client/query/state/loadStateAggregateClient.d.ts +0 -62
  253. package/dist/client/query/state/loadStateAggregateClient.es.js +0 -65
  254. package/dist/client/query/state/loadStateAggregateClient.es.js.map +0 -1
  255. package/dist/client/routing.cjs +0 -2
  256. package/dist/client/routing.cjs.map +0 -1
  257. package/dist/client/routing.d.cts +0 -47
  258. package/dist/client/routing.d.ts +0 -47
  259. package/dist/client/routing.es.js +0 -8
  260. package/dist/client/routing.es.js.map +0 -1
  261. package/dist/error/errorInfo.cjs +0 -2
  262. package/dist/error/errorInfo.cjs.map +0 -1
  263. package/dist/error/errorInfo.d.cts +0 -139
  264. package/dist/error/errorInfo.d.ts +0 -139
  265. package/dist/error/errorInfo.es.js +0 -32
  266. package/dist/error/errorInfo.es.js.map +0 -1
  267. package/dist/error/headers.cjs +0 -2
  268. package/dist/error/headers.cjs.map +0 -1
  269. package/dist/error/headers.d.cts +0 -39
  270. package/dist/error/headers.d.ts +0 -39
  271. package/dist/error/headers.es.js +0 -10
  272. package/dist/error/headers.es.js.map +0 -1
  273. package/dist/error/index.d.cts +0 -21
  274. package/dist/error/index.d.ts +0 -21
  275. package/dist/error/queryErrorCodes.cjs +0 -2
  276. package/dist/error/queryErrorCodes.es.js.map +0 -1
  277. package/dist/error/wowError.cjs +0 -2
  278. package/dist/error/wowError.cjs.map +0 -1
  279. package/dist/error/wowError.d.cts +0 -99
  280. package/dist/error/wowError.d.ts +0 -99
  281. package/dist/error/wowError.es.js +0 -53
  282. package/dist/error/wowError.es.js.map +0 -1
  283. package/dist/legacy/condition.cjs +0 -2
  284. package/dist/legacy/condition.cjs.map +0 -1
  285. package/dist/legacy/condition.d.cts +0 -517
  286. package/dist/legacy/condition.d.ts +0 -517
  287. package/dist/legacy/condition.es.js +0 -338
  288. package/dist/legacy/condition.es.js.map +0 -1
  289. package/dist/legacy/index.d.cts +0 -16
  290. package/dist/legacy/index.d.ts +0 -16
  291. package/dist/legacy/locale/en_US.cjs +0 -2
  292. package/dist/legacy/locale/en_US.cjs.map +0 -1
  293. package/dist/legacy/locale/en_US.d.cts +0 -7
  294. package/dist/legacy/locale/en_US.d.ts +0 -7
  295. package/dist/legacy/locale/en_US.es.js +0 -50
  296. package/dist/legacy/locale/en_US.es.js.map +0 -1
  297. package/dist/legacy/locale/operatorLocale.d.cts +0 -10
  298. package/dist/legacy/locale/operatorLocale.d.ts +0 -10
  299. package/dist/legacy/locale/zh_CN.cjs +0 -2
  300. package/dist/legacy/locale/zh_CN.cjs.map +0 -1
  301. package/dist/legacy/locale/zh_CN.d.cts +0 -7
  302. package/dist/legacy/locale/zh_CN.d.ts +0 -7
  303. package/dist/legacy/locale/zh_CN.es.js +0 -50
  304. package/dist/legacy/locale/zh_CN.es.js.map +0 -1
  305. package/dist/legacy/operator.cjs +0 -2
  306. package/dist/legacy/operator.cjs.map +0 -1
  307. package/dist/legacy/operator.d.cts +0 -218
  308. package/dist/legacy/operator.d.ts +0 -218
  309. package/dist/legacy/operator.es.js +0 -25
  310. package/dist/legacy/operator.es.js.map +0 -1
  311. package/dist/legacy/queryable.cjs +0 -2
  312. package/dist/legacy/queryable.cjs.map +0 -1
  313. package/dist/legacy/queryable.d.cts +0 -61
  314. package/dist/legacy/queryable.d.ts +0 -61
  315. package/dist/legacy/queryable.es.js +0 -34
  316. package/dist/legacy/queryable.es.js.map +0 -1
  317. package/dist/legacy.cjs +0 -1
  318. package/dist/legacy.es.js +0 -6
  319. package/dist/model/abac.cjs +0 -2
  320. package/dist/model/abac.cjs.map +0 -1
  321. package/dist/model/abac.d.cts +0 -33
  322. package/dist/model/abac.d.ts +0 -33
  323. package/dist/model/abac.es.js +0 -6
  324. package/dist/model/abac.es.js.map +0 -1
  325. package/dist/model/bi.cjs +0 -2
  326. package/dist/model/bi.cjs.map +0 -1
  327. package/dist/model/bi.d.cts +0 -12
  328. package/dist/model/bi.d.ts +0 -12
  329. package/dist/model/bi.es.js +0 -8
  330. package/dist/model/bi.es.js.map +0 -1
  331. package/dist/model/command.cjs +0 -2
  332. package/dist/model/command.cjs.map +0 -1
  333. package/dist/model/command.d.cts +0 -137
  334. package/dist/model/command.d.ts +0 -137
  335. package/dist/model/command.es.js +0 -8
  336. package/dist/model/command.es.js.map +0 -1
  337. package/dist/model/common.d.cts +0 -19
  338. package/dist/model/common.d.ts +0 -19
  339. package/dist/model/domainEventStream.cjs +0 -2
  340. package/dist/model/domainEventStream.cjs.map +0 -1
  341. package/dist/model/domainEventStream.d.cts +0 -109
  342. package/dist/model/domainEventStream.d.ts +0 -109
  343. package/dist/model/domainEventStream.es.js +0 -23
  344. package/dist/model/domainEventStream.es.js.map +0 -1
  345. package/dist/model/function.cjs +0 -2
  346. package/dist/model/function.cjs.map +0 -1
  347. package/dist/model/function.d.cts +0 -41
  348. package/dist/model/function.d.ts +0 -41
  349. package/dist/model/function.es.js +0 -8
  350. package/dist/model/function.es.js.map +0 -1
  351. package/dist/model/index.d.cts +0 -24
  352. package/dist/model/index.d.ts +0 -24
  353. package/dist/model/messaging.d.cts +0 -5
  354. package/dist/model/messaging.d.ts +0 -5
  355. package/dist/model/modeling.d.cts +0 -145
  356. package/dist/model/modeling.d.ts +0 -145
  357. package/dist/model/naming.d.cts +0 -27
  358. package/dist/model/naming.d.ts +0 -27
  359. package/dist/model/snapshot.cjs +0 -2
  360. package/dist/model/snapshot.cjs.map +0 -1
  361. package/dist/model/snapshot.d.cts +0 -53
  362. package/dist/model/snapshot.d.ts +0 -53
  363. package/dist/model/snapshot.es.js +0 -20
  364. package/dist/model/snapshot.es.js.map +0 -1
  365. package/dist/transport/endpoints.cjs +0 -2
  366. package/dist/transport/endpoints.cjs.map +0 -1
  367. package/dist/transport/endpoints.d.cts +0 -79
  368. package/dist/transport/endpoints.d.ts +0 -79
  369. package/dist/transport/endpoints.es.js +0 -14
  370. package/dist/transport/endpoints.es.js.map +0 -1
  371. package/dist/transport/eventStreams.cjs +0 -2
  372. package/dist/transport/eventStreams.cjs.map +0 -1
  373. package/dist/transport/eventStreams.d.cts +0 -25
  374. package/dist/transport/eventStreams.d.ts +0 -25
  375. package/dist/transport/eventStreams.es.js +0 -21
  376. package/dist/transport/eventStreams.es.js.map +0 -1
  377. package/dist/transport/index.d.cts +0 -1
  378. package/dist/transport/index.d.ts +0 -1
  379. package/dist/v10/commands.cjs +0 -2
  380. package/dist/v10/commands.cjs.map +0 -1
  381. package/dist/v10/commands.es.js +0 -68
  382. package/dist/v10/commands.es.js.map +0 -1
  383. package/dist/v10/http.cjs +0 -2
  384. package/dist/v10/http.cjs.map +0 -1
  385. package/dist/v10/http.es.js +0 -73
  386. package/dist/v10/http.es.js.map +0 -1
  387. package/dist/v10/index.d.cts +0 -19
  388. package/dist/v10/index.d.ts +0 -19
  389. package/dist/v10/manifest.cjs.map +0 -1
  390. package/dist/v10/manifest.es.js.map +0 -1
  391. package/dist/v10/problem.cjs +0 -2
  392. package/dist/v10/problem.cjs.map +0 -1
  393. package/dist/v10/problem.es.js.map +0 -1
  394. package/dist/v10/queries.cjs +0 -2
  395. package/dist/v10/queries.cjs.map +0 -1
  396. package/dist/v10/queries.es.js +0 -88
  397. package/dist/v10/queries.es.js.map +0 -1
  398. package/dist/v10/state.cjs +0 -2
  399. package/dist/v10/state.cjs.map +0 -1
  400. package/dist/v10/state.es.js +0 -51
  401. package/dist/v10/state.es.js.map +0 -1
  402. package/dist/v10/streams.cjs +0 -2
  403. package/dist/v10/streams.cjs.map +0 -1
  404. package/dist/v10/streams.d.cts +0 -14
  405. package/dist/v10/streams.d.ts +0 -14
  406. package/dist/v10/streams.es.js +0 -22
  407. package/dist/v10/streams.es.js.map +0 -1
  408. package/dist/v10/wait.cjs.map +0 -1
  409. package/dist/v10/wait.es.js.map +0 -1
  410. package/dist/v10/wire.cjs.map +0 -1
  411. package/dist/v10/wire.es.js.map +0 -1
  412. package/dist/v10.cjs +0 -1
  413. package/dist/v10.es.js +0 -9
  414. /package/dist/{v10/manifest.cjs → manifest.cjs} +0 -0
  415. /package/dist/{v10/manifest.d.cts → manifest.d.cts} +0 -0
  416. /package/dist/{v10/manifest.d.ts → manifest.d.ts} +0 -0
  417. /package/dist/{v10/wait.cjs → wait.cjs} +0 -0
  418. /package/dist/{v10/wait.d.cts → wait.d.cts} +0 -0
  419. /package/dist/{v10/wait.d.ts → wait.d.ts} +0 -0
  420. /package/dist/{v10/wire.cjs → wire.cjs} +0 -0
package/README.md CHANGED
@@ -1,128 +1,76 @@
1
1
  # `@ahoo-wang/wow-client`
2
2
 
3
- Typed Fetcher clients and contracts for Wow commands, snapshots, domain events,
4
- filters, pagination, and aggregation. Use it only against Wow HTTP endpoints.
3
+ The TypeScript client of a Wow service's routes, built on Fetcher: commands
4
+ with their waits, state reads, snapshot, event and dataset queries, the
5
+ Manifest, and the RFC 9457 problems the service answers with. The query DSL
6
+ (`filter`, `aggregation`, sort, projection, pagination) is on its own entry,
7
+ `@ahoo-wang/wow-client/dsl`.
5
8
 
6
- Supported servers: Wow 8.11 and later through the `filter` API; Wow 8.10
7
- through [`/legacy`](#wow-810-servers-ahoo-wangwow-clientlegacy). CI tests the
8
- client against a server of the same version and smoke-tests it against Wow
9
- 8.11.5, 9.1.3 and 9.1.5; for 8.10.8 it type-checks generated code only. Node `>=22.12.0` or a
10
- current browser. TypeScript 6 or later: CI tests 6.0 through the latest 7.x. See the
11
- [compatibility matrix](https://wow.ahoo.me/guide/typescript/compatibility).
12
-
13
- Released with Wow 9.2.0, from the same tag and with the same version.
9
+ Node `>=22.12.0` or a current browser. TypeScript 6 or later: CI tests 6.0
10
+ through the latest 7.x. Released with Wow, from the same tag and with the
11
+ same version.
14
12
 
15
13
  ## Install
16
14
 
17
15
  ```bash
18
- pnpm add @ahoo-wang/fetcher @ahoo-wang/fetcher-decorator \
19
- @ahoo-wang/fetcher-eventstream @ahoo-wang/wow-client
16
+ pnpm add @ahoo-wang/fetcher @ahoo-wang/fetcher-eventstream @ahoo-wang/wow-client
20
17
  ```
21
18
 
22
- The version follows Wow, so a minor release may contain breaking changes: keep the Wow packages on one minor with `save-prefix=~` or `--save-exact`, as [version ranges](https://wow.ahoo.me/guide/typescript/compatibility#version-ranges) explains.
19
+ The version follows Wow, so a minor release may contain breaking changes: keep the Wow packages on one minor with `save-prefix=~` or `--save-exact`, as [version ranges](https://wow.ahoo.me/typescript/compatibility#version-ranges) explains.
20
+
21
+ Peer dependencies: `@ahoo-wang/fetcher` and `@ahoo-wang/fetcher-eventstream`.
23
22
 
24
- Peer dependencies: `fetcher`, `fetcher-decorator`, and `fetcher-eventstream`.
23
+ Most applications use the clients `wow-generator` writes from a service's
24
+ Manifest, which build on the classes below; every class also serves any
25
+ route by hand.
25
26
 
26
27
  ## Query
27
28
 
29
+ An aggregate's snapshots are queried at `/{context}/{aggregate}/snapshot/query`.
30
+ The body names the operation in its `kind`; the client sets it.
31
+
28
32
  ```ts
29
33
  import { Fetcher } from '@ahoo-wang/fetcher';
30
- import { SnapshotQueryClient, filter, listQuery } from '@ahoo-wang/wow-client';
34
+ import { SnapshotQueryClient } from '@ahoo-wang/wow-client';
35
+ import { filter, listQuery } from '@ahoo-wang/wow-client/dsl';
31
36
 
32
37
  interface CartState {
33
38
  status: 'ACTIVE' | 'CHECKED_OUT';
34
39
  }
35
40
 
36
41
  const fetcher = new Fetcher({ baseURL: 'https://api.example.com' });
37
- const snapshots = new SnapshotQueryClient<CartState>({
38
- fetcher,
39
- basePath: 'cart',
40
- });
41
-
42
- const carts = await snapshots.listState(
43
- listQuery({
44
- filter: filter.and([
45
- filter.ownerId('u-42'),
46
- filter.eq('state.status', 'ACTIVE'),
47
- ]),
48
- limit: 50,
49
- }),
42
+ const carts = new SnapshotQueryClient<CartState>(
43
+ { context: 'shop', name: 'cart' },
44
+ { fetcher },
45
+ );
46
+
47
+ const active = await carts.list(
48
+ listQuery({ filter: filter.eq('state.status', 'ACTIVE'), limit: 50 }),
50
49
  );
51
50
  ```
52
51
 
53
- `listQuery()`, `pagedQuery()` and `singleQuery()` match everything when no
54
- filter is given. `listQuery()` sends no `limit` unless you give one, and what
55
- the server does without it depends on its version:
52
+ `single`, `list`, `paged`, `cursor`, `count` and `aggregate` each answer one
53
+ operation; `listStream` reads a list as server-sent events and resumes a
54
+ stream the service cut off where it stopped. `describe(version?)` reads the
55
+ query model's capability descriptor (`GET` on the same route): the fields
56
+ with the operators, sorts and aggregation each admits, and the limits;
57
+ pass the version you hold and a 304 answers `{ notModified: true, version }`.
58
+ `EventQueryClient` queries an aggregate's event streams the same way,
59
+ `QueryModelClient` any query route, and `DatasetClient` lists the service's
60
+ datasets (`GET /wow/dataset`).
56
61
 
57
- - Wow 9.1.5 and later apply the server's default list size (100 unless
58
- configured otherwise).
59
- - Wow 8.11 to 9.1.3 reject the query with `IllegalArgument`
60
- (`limit[0] must be between 1 and 1000`): HTTP 400 for a list, the error
61
- event that ends a list stream. Pass `limit` explicitly against
62
- those servers; the `WowError` of that rejection says so.
62
+ Every method takes `RequestOptions` last: the `scope` and `space` to act in,
63
+ more `headers`, and the `signal` that cancels the request.
63
64
 
64
- Relative time is resolved by the server, never by the browser's clock.
65
- `filter.beforeNow` and `filter.afterNow` compare a time field strictly with
66
- the server's now plus an ISO-8601 `offset` (default `PT0S`; a negative one
67
- looks back), read once per query, so a saved view means the same thing on
68
- every client:
65
+ Relative time is resolved by the server, never by the browser's clock:
69
66
 
70
67
  ```ts
71
- import { filter } from '@ahoo-wang/wow-client';
68
+ import { filter } from '@ahoo-wang/wow-client/dsl';
72
69
 
73
70
  const overdue = filter.beforeNow('state.timeoutAt');
74
71
  const lastHalfHour = filter.afterNow('state.createTime', '-PT30M');
75
72
  ```
76
73
 
77
- `BEFORE_NOW` and `AFTER_NOW` need Wow 9.2.0 or later; an earlier server
78
- rejects the query.
79
-
80
- ## What the server can query: the capability descriptor
81
-
82
- `QueryDescriptorClient` reads `GET {aggregate}/snapshot/schema` and
83
- `GET {aggregate}/event/schema` (Wow 9.2.0 and later): a
84
- `QueryModelDescriptor` listing every queryable field with the filter
85
- operators, sorts and aggregation it admits, which metrics are estimates and
86
- which date-histogram units, date parts and date-difference units apply, what `FIRST` and `LAST`
87
- order by when they name no field, the paging modes, full-text
88
- search (on the record, and inside an element where the storage grants it), and
89
- the entry's limits. Every capability it lists is admitted when
90
- used alone; anything it does not list is rejected. Use it to offer only what
91
- the server accepts, instead of hard-coding operator tables and limits.
92
-
93
- <!-- typecheck-context
94
- import type { Fetcher } from '@ahoo-wang/fetcher';
95
- declare const fetcher: Fetcher;
96
- -->
97
-
98
- ```ts
99
- import { FilterOperator, QueryDescriptorClient } from '@ahoo-wang/wow-client';
100
-
101
- // The schema routes have no tenant or owner segment.
102
- const descriptors = new QueryDescriptorClient({ fetcher, basePath: 'cart' });
103
-
104
- const first = await descriptors.describeSnapshot();
105
- if (!first.notModified) {
106
- const productId = first.descriptor.fields.find(
107
- field => field.path === 'state.items.productId',
108
- );
109
- const canSearchByPrefix = productId?.filter.operators.includes(
110
- FilterOperator.STARTS_WITH,
111
- );
112
- }
113
-
114
- // Revalidate the copy you hold: 304 answers { notModified: true, version }.
115
- const again = await descriptors.describeSnapshot(first.version);
116
- ```
117
-
118
- The descriptor does not depend on the caller and its `version` is also the
119
- ETag, so hold it and pass its version (or the ETag) back: the method sends
120
- `If-None-Match` and resolves to `{ notModified: true, version }` on a 304.
121
- `QueryClientFactory.createQueryDescriptorClient()` builds the base path
122
- without the factory's resource attribution. The server reloads a schema
123
- every few minutes, so a long-lived page revalidates rather than caching
124
- forever.
125
-
126
74
  ## Send a command
127
75
 
128
76
  <!-- typecheck-context
@@ -131,161 +79,68 @@ declare const fetcher: Fetcher;
131
79
  -->
132
80
 
133
81
  ```ts
134
- import {
135
- CommandClient,
136
- CommandStage,
137
- commandHeaders,
138
- waitStrategy,
139
- } from '@ahoo-wang/wow-client';
140
-
141
- const commands = new CommandClient({ fetcher, basePath: 'cart' });
142
- const result = await commands.send({
143
- path: 'add_cart_item',
144
- method: 'POST',
145
- headers: {
146
- ...commandHeaders({ ownerId: 'u-42', requestId: crypto.randomUUID() }),
147
- ...waitStrategy({ stage: CommandStage.SNAPSHOT, timeoutMs: 10_000 }),
148
- },
149
- body: { productId: 'p-1', quantity: 1 },
150
- });
151
- ```
152
-
153
- `CommandRequestHeaders` types every command header by what the server parses:
154
- a stage must be a `CommandStage`, a timeout whole milliseconds. `waitStrategy()`
155
- also builds Wow's wait chain (`SAGA_HANDLED` plus a `tail`).
156
- `sendAndWaitStream()` yields one `CommandResult` per stage the command reaches.
82
+ import { CommandGateway, wait } from '@ahoo-wang/wow-client';
157
83
 
158
- ## Errors
84
+ const commands = new CommandGateway({ fetcher });
85
+ const result = await commands.send(
86
+ '/shop/cart/{id}/add-cart-item',
87
+ { productId: 'p-1', quantity: 1 },
88
+ { id: 'cart-42', wait: { plan: [wait.snapshot()], timeout: 10_000 } },
89
+ );
90
+ ```
159
91
 
160
- A server error is a `WowError`, carrying the server's `ErrorInfo`
161
- (`errorCode`, `errorMsg`, `bindingErrors`) and the HTTP status. Match
162
- `errorCode` against `ErrorCodes`. Wow answers a refused request, including a
163
- command whose handler failed, with an HTTP error status, so the call rejects.
92
+ The route is `POST /{context}/{aggregate}/{id}/{command}`; a command that may
93
+ create its aggregate leaves `{id}` out. `wait` says how far the command
94
+ goes before the call answers (`accepted`, `committed`, `snapshot`, or a
95
+ subscription's `handled`, also across a saga's derived commands); `stream`
96
+ answers one `CommandResult` per hop. Every command carries a request id
97
+ (`Wow-Request-Id`), given or generated: a retry with the same one is answered
98
+ as the first commit's duplicate, and `requestIdOf(error)` hands back the one
99
+ a failure was sent with. `lifecycle` sends the lifecycle commands an
100
+ aggregate lists (delete, restore, transfer, tags).
164
101
 
165
- ```ts
166
- import {
167
- ErrorCodes,
168
- toWowError,
169
- type SnapshotQueryClient,
170
- } from '@ahoo-wang/wow-client';
171
-
172
- async function findCart(snapshots: SnapshotQueryClient<unknown>, id: string) {
173
- try {
174
- return await snapshots.getStateById(id);
175
- } catch (error) {
176
- const wowError = await toWowError(error);
177
- if (wowError?.errorCode === ErrorCodes.NOT_FOUND) return undefined;
178
- throw wowError ?? error;
179
- }
180
- }
181
- ```
102
+ `StateClient` reads an aggregate's state, at a version or a time, and its
103
+ trace; `fetchManifest` reads the service's Manifest (`GET /wow/manifest`).
182
104
 
183
- - A failed request rejects with the fetcher's error. `toWowError()` reads the
184
- response's `ErrorInfo` body, or failing that its `Wow-Error-Code` header, and
185
- returns `undefined` when the Wow server did not answer (network failure,
186
- timeout, abort, a proxy's own error page).
187
- - A stream (`listStream`, `aggregateStream`, `sendAndWaitStream`, …) that
188
- fails midway errors with a `WowError`, so `for await` throws it. The server
189
- answered HTTP 200 and sends the error as the last event. Without this the
190
- error would look like a row.
191
- - A rejected query (`IllegalArgument` while decoding, `QuerySchemaValidation`
192
- at admission) says which rule it broke and where: `wowError.violation` is
193
- `{ code, path, message }`, `code` one of `QueryErrorCodes` and `path` the
194
- JSON path (`filter.state`) or the logical field (`state.items.sku`). The
195
- list of codes only grows, so fall back to `errorMsg` for one you do not
196
- handle. From Wow 9.2 budget and gate rejections carry a code too
197
- (`SIZE_OUT_OF_RANGE`, `EXPENSIVE_OPERATOR_DISABLED`, …); older servers
198
- answer them with text alone (`HTTP list query limit[...]`). A failure of
199
- the server itself answers HTTP 500 `InternalServerError`, without a code.
105
+ ## Errors
200
106
 
201
- <!-- typecheck-context
202
- import type { WowError } from '@ahoo-wang/wow-client';
203
- declare const wowError: WowError;
204
- declare function markField(path: string, message: string): void;
205
- -->
107
+ The service answers a refusal with an RFC 9457 problem, and the call rejects
108
+ with a `WowProblemError`: the `problem` as written, its `status`, its Wow
109
+ `code` and its `violations`. A command that did not succeed carries its
110
+ `CommandResult` too, and `resolveRejected: true` resolves that result
111
+ instead. A stream that fails midway errors with the same error, so a
112
+ `for await` throws it.
206
113
 
207
114
  ```ts
208
- import { QueryErrorCodes } from '@ahoo-wang/wow-client';
209
-
210
- const violation = wowError.violation;
211
- if (violation?.code === QueryErrorCodes.UNKNOWN_FIELD) {
212
- markField(violation.path, violation.message);
115
+ import { FrameworkErrorCodes, WowProblemError } from '@ahoo-wang/wow-client';
116
+
117
+ declare const error: unknown;
118
+ if (
119
+ error instanceof WowProblemError &&
120
+ error.code === FrameworkErrorCodes.AGGREGATE_NOT_FOUND
121
+ ) {
122
+ // …
213
123
  }
214
124
  ```
215
125
 
216
- ## Cancel
217
-
218
- Every query method takes an `AbortController` or an `AbortSignal` as its last
219
- argument, after the interceptor attributes:
220
-
221
- <!-- typecheck-context
222
- import type { FilterPagedQuery, SnapshotQueryClient } from '@ahoo-wang/wow-client';
223
- declare const snapshots: SnapshotQueryClient<unknown>;
224
- declare const query: FilterPagedQuery;
225
- -->
226
-
227
- ```ts
228
- const page = await snapshots.pagedState(
229
- query,
230
- undefined,
231
- AbortSignal.timeout(5_000),
232
- );
233
- ```
126
+ A rejected query names the rule it broke in each violation: `code` one of
127
+ `QueryErrorCodes` (from `/dsl`), `path` the JSON path or the field, and a
128
+ `message`. The list of codes only grows, so fall back to the problem's
129
+ `detail` for one you do not handle. An error's `retry` says whether and
130
+ when the request may be retried, and whether with the same request id.
234
131
 
235
132
  ## Build queries without HTTP: `@ahoo-wang/wow-client/dsl`
236
133
 
237
134
  `filter`, `aggregation`, sort, projection, pagination, cursor queries, the
238
- query factories and the capability descriptor types, without the clients: no Fetcher, no decorators, no
239
- `reflect-metadata`, and none of the stream patches `fetcher-eventstream`
240
- installs. Use it where a bundle only builds queries.
241
-
242
- ## Wow 8.10 servers: `@ahoo-wang/wow-client/legacy`
243
-
244
- The root entry speaks only `FilterExpression`, which Wow 8.11 and later
245
- accept. Wow 8.10 understands only the deprecated Condition model, which this
246
- package keeps on its own subpath until v10:
247
-
248
- <!-- typecheck-context
249
- import type { SnapshotQueryClient } from '@ahoo-wang/wow-client';
250
- declare const snapshots: SnapshotQueryClient<unknown>;
251
- -->
252
-
253
- ```ts
254
- import { and, eq, listQuery, ownerId } from '@ahoo-wang/wow-client/legacy';
255
-
256
- const carts = await snapshots.listState(
257
- listQuery({ condition: and(ownerId('u-42'), eq('state.status', 'ACTIVE')) }),
258
- );
259
- ```
260
-
261
- The query clients accept both kinds of query. Everything else comes from the
262
- root entry. The subpath is removed in v10.
263
-
264
- ## Core capabilities
265
-
266
- - Command results and streaming wait stages.
267
- - Snapshot, domain-event, load-state, and owner-state clients; event streams by
268
- version range (`EventStreamQueryClient.load`); server metadata
269
- (`WowMetadataClient`); query capability descriptors with conditional GET
270
- (`QueryDescriptorClient`).
271
- - Array-first `FilterExpression` builders with early validation.
272
- - Single, list, paged, cursor, count, and stream query contracts.
273
- - Projection, sorting, nested aggregation, modeling, ABAC, and metadata types.
274
- - `aggregation.query()` admits a whole aggregation against the same rules
275
- Wow enforces on arrival, so a bad query fails where it was built.
276
-
277
- Not covered by a client yet: `GET {id}/snapshot`, `GET {id}/state/tracing`
278
- and the `/wow/command/send` route (send it with `CommandClient` and the
279
- `COMMAND_AGGREGATE_CONTEXT`, `COMMAND_AGGREGATE_NAME` and `COMMAND_TYPE`
280
- headers).
135
+ query factories, the capability descriptor's types and `QueryErrorCodes`,
136
+ without the clients: no Fetcher, and none of the stream patches
137
+ `fetcher-eventstream` installs. Use it where a bundle only builds queries.
138
+ `aggregation.query()` admits a whole aggregation against the rules Wow
139
+ enforces on arrival, so a bad query fails where it was built.
281
140
 
282
141
  ## Documentation
283
142
 
284
- - [Quick start: call a Wow service](https://wow.ahoo.me/guide/typescript/quick-start)
285
- - [Error handling](https://wow.ahoo.me/guide/typescript/error-handling) and
286
- [authentication](https://wow.ahoo.me/guide/typescript/authentication)
287
- - [TypeScript guide](https://wow.ahoo.me/guide/typescript/)
288
- - [wow-client reference](https://wow.ahoo.me/reference/typescript/wow-client/)
143
+ - [TypeScript guide](https://wow.ahoo.me/typescript/)
289
144
  - [Interactive query stories](https://wow.ahoo.me/storybook/)
290
145
 
291
146
  [中文](./README.zh-CN.md) · [License](https://github.com/Ahoo-Wang/Wow/blob/main/LICENSE)