@ahoo-wang/wow-client 9.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +291 -0
  3. package/README.zh-CN.md +267 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.cjs +1 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorate.es.js +9 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.cjs +1 -0
  7. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateMetadata.es.js +6 -0
  8. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.cjs +1 -0
  9. package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/decorateParam.es.js +8 -0
  10. package/dist/client/bindMethods.cjs +2 -0
  11. package/dist/client/bindMethods.cjs.map +1 -0
  12. package/dist/client/bindMethods.d.cts +13 -0
  13. package/dist/client/bindMethods.d.ts +13 -0
  14. package/dist/client/bindMethods.es.js +19 -0
  15. package/dist/client/bindMethods.es.js.map +1 -0
  16. package/dist/client/command/commandClient.cjs +2 -0
  17. package/dist/client/command/commandClient.cjs.map +1 -0
  18. package/dist/client/command/commandClient.d.cts +67 -0
  19. package/dist/client/command/commandClient.d.ts +67 -0
  20. package/dist/client/command/commandClient.es.js +38 -0
  21. package/dist/client/command/commandClient.es.js.map +1 -0
  22. package/dist/client/command/commandHeaders.cjs +2 -0
  23. package/dist/client/command/commandHeaders.cjs.map +1 -0
  24. package/dist/client/command/commandHeaders.d.cts +75 -0
  25. package/dist/client/command/commandHeaders.d.ts +75 -0
  26. package/dist/client/command/commandHeaders.es.js +31 -0
  27. package/dist/client/command/commandHeaders.es.js.map +1 -0
  28. package/dist/client/command/commandRequest.cjs +2 -0
  29. package/dist/client/command/commandRequest.cjs.map +1 -0
  30. package/dist/client/command/commandRequest.d.cts +180 -0
  31. package/dist/client/command/commandRequest.d.ts +180 -0
  32. package/dist/client/command/commandRequest.es.js +31 -0
  33. package/dist/client/command/commandRequest.es.js.map +1 -0
  34. package/dist/client/command/commandResult.d.cts +15 -0
  35. package/dist/client/command/commandResult.d.ts +15 -0
  36. package/dist/client/command/index.d.cts +5 -0
  37. package/dist/client/command/index.d.ts +5 -0
  38. package/dist/client/command/types.d.cts +71 -0
  39. package/dist/client/command/types.d.ts +71 -0
  40. package/dist/client/metadata/index.d.cts +2 -0
  41. package/dist/client/metadata/index.d.ts +2 -0
  42. package/dist/client/metadata/wowMetadata.d.cts +48 -0
  43. package/dist/client/metadata/wowMetadata.d.ts +48 -0
  44. package/dist/client/metadata/wowMetadataClient.cjs +2 -0
  45. package/dist/client/metadata/wowMetadataClient.cjs.map +1 -0
  46. package/dist/client/metadata/wowMetadataClient.d.cts +23 -0
  47. package/dist/client/metadata/wowMetadataClient.d.ts +23 -0
  48. package/dist/client/metadata/wowMetadataClient.es.js +25 -0
  49. package/dist/client/metadata/wowMetadataClient.es.js.map +1 -0
  50. package/dist/client/query/descriptor/descriptorEndpoints.cjs +2 -0
  51. package/dist/client/query/descriptor/descriptorEndpoints.cjs.map +1 -0
  52. package/dist/client/query/descriptor/descriptorEndpoints.d.cts +29 -0
  53. package/dist/client/query/descriptor/descriptorEndpoints.d.ts +29 -0
  54. package/dist/client/query/descriptor/descriptorEndpoints.es.js +69 -0
  55. package/dist/client/query/descriptor/descriptorEndpoints.es.js.map +1 -0
  56. package/dist/client/query/descriptor/endpointPaths.cjs +2 -0
  57. package/dist/client/query/descriptor/endpointPaths.cjs.map +1 -0
  58. package/dist/client/query/descriptor/endpointPaths.d.cts +4 -0
  59. package/dist/client/query/descriptor/endpointPaths.d.ts +4 -0
  60. package/dist/client/query/descriptor/endpointPaths.es.js +9 -0
  61. package/dist/client/query/descriptor/endpointPaths.es.js.map +1 -0
  62. package/dist/client/query/descriptor/index.d.cts +2 -0
  63. package/dist/client/query/descriptor/index.d.ts +2 -0
  64. package/dist/client/query/descriptor/queryDescriptorApi.d.cts +58 -0
  65. package/dist/client/query/descriptor/queryDescriptorApi.d.ts +58 -0
  66. package/dist/client/query/descriptor/queryDescriptorClient.cjs +2 -0
  67. package/dist/client/query/descriptor/queryDescriptorClient.cjs.map +1 -0
  68. package/dist/client/query/descriptor/queryDescriptorClient.d.cts +61 -0
  69. package/dist/client/query/descriptor/queryDescriptorClient.d.ts +61 -0
  70. package/dist/client/query/descriptor/queryDescriptorClient.es.js +20 -0
  71. package/dist/client/query/descriptor/queryDescriptorClient.es.js.map +1 -0
  72. package/dist/client/query/event/domainEventStream.cjs +2 -0
  73. package/dist/client/query/event/domainEventStream.cjs.map +1 -0
  74. package/dist/client/query/event/domainEventStream.d.cts +105 -0
  75. package/dist/client/query/event/domainEventStream.d.ts +105 -0
  76. package/dist/client/query/event/domainEventStream.es.js +23 -0
  77. package/dist/client/query/event/domainEventStream.es.js.map +1 -0
  78. package/dist/client/query/event/endpointPaths.cjs +2 -0
  79. package/dist/client/query/event/endpointPaths.cjs.map +1 -0
  80. package/dist/client/query/event/endpointPaths.d.cts +8 -0
  81. package/dist/client/query/event/endpointPaths.d.ts +8 -0
  82. package/dist/client/query/event/endpointPaths.es.js +13 -0
  83. package/dist/client/query/event/endpointPaths.es.js.map +1 -0
  84. package/dist/client/query/event/eventStreamQueryApi.d.cts +29 -0
  85. package/dist/client/query/event/eventStreamQueryApi.d.ts +29 -0
  86. package/dist/client/query/event/eventStreamQueryClient.cjs +2 -0
  87. package/dist/client/query/event/eventStreamQueryClient.cjs.map +1 -0
  88. package/dist/client/query/event/eventStreamQueryClient.d.cts +190 -0
  89. package/dist/client/query/event/eventStreamQueryClient.d.ts +190 -0
  90. package/dist/client/query/event/eventStreamQueryClient.es.js +160 -0
  91. package/dist/client/query/event/eventStreamQueryClient.es.js.map +1 -0
  92. package/dist/client/query/event/index.d.cts +3 -0
  93. package/dist/client/query/event/index.d.ts +3 -0
  94. package/dist/client/query/factory.cjs +2 -0
  95. package/dist/client/query/factory.cjs.map +1 -0
  96. package/dist/client/query/factory.d.cts +165 -0
  97. package/dist/client/query/factory.d.ts +165 -0
  98. package/dist/client/query/factory.es.js +45 -0
  99. package/dist/client/query/factory.es.js.map +1 -0
  100. package/dist/client/query/index.d.cts +6 -0
  101. package/dist/client/query/index.d.ts +6 -0
  102. package/dist/client/query/queryApi.d.cts +68 -0
  103. package/dist/client/query/queryApi.d.ts +68 -0
  104. package/dist/client/query/requests.d.cts +24 -0
  105. package/dist/client/query/requests.d.ts +24 -0
  106. package/dist/client/query/snapshot/endpointPaths.cjs +2 -0
  107. package/dist/client/query/snapshot/endpointPaths.cjs.map +1 -0
  108. package/dist/client/query/snapshot/endpointPaths.d.cts +12 -0
  109. package/dist/client/query/snapshot/endpointPaths.d.ts +12 -0
  110. package/dist/client/query/snapshot/endpointPaths.es.js +17 -0
  111. package/dist/client/query/snapshot/endpointPaths.es.js.map +1 -0
  112. package/dist/client/query/snapshot/index.d.cts +3 -0
  113. package/dist/client/query/snapshot/index.d.ts +3 -0
  114. package/dist/client/query/snapshot/snapshot.cjs +2 -0
  115. package/dist/client/query/snapshot/snapshot.cjs.map +1 -0
  116. package/dist/client/query/snapshot/snapshot.d.cts +51 -0
  117. package/dist/client/query/snapshot/snapshot.d.ts +51 -0
  118. package/dist/client/query/snapshot/snapshot.es.js +20 -0
  119. package/dist/client/query/snapshot/snapshot.es.js.map +1 -0
  120. package/dist/client/query/snapshot/snapshotQueryApi.d.cts +101 -0
  121. package/dist/client/query/snapshot/snapshotQueryApi.d.ts +101 -0
  122. package/dist/client/query/snapshot/snapshotQueryClient.cjs +2 -0
  123. package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +1 -0
  124. package/dist/client/query/snapshot/snapshotQueryClient.d.cts +369 -0
  125. package/dist/client/query/snapshot/snapshotQueryClient.d.ts +369 -0
  126. package/dist/client/query/snapshot/snapshotQueryClient.es.js +239 -0
  127. package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +1 -0
  128. package/dist/client/query/state/endpointPaths.cjs +2 -0
  129. package/dist/client/query/state/endpointPaths.cjs.map +1 -0
  130. package/dist/client/query/state/endpointPaths.d.cts +10 -0
  131. package/dist/client/query/state/endpointPaths.d.ts +10 -0
  132. package/dist/client/query/state/endpointPaths.es.js +14 -0
  133. package/dist/client/query/state/endpointPaths.es.js.map +1 -0
  134. package/dist/client/query/state/index.d.cts +4 -0
  135. package/dist/client/query/state/index.d.ts +4 -0
  136. package/dist/client/query/state/loadOwnerStateAggregateApi.d.cts +36 -0
  137. package/dist/client/query/state/loadOwnerStateAggregateApi.d.ts +36 -0
  138. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs +2 -0
  139. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs.map +1 -0
  140. package/dist/client/query/state/loadOwnerStateAggregateClient.d.cts +58 -0
  141. package/dist/client/query/state/loadOwnerStateAggregateClient.d.ts +58 -0
  142. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js +56 -0
  143. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js.map +1 -0
  144. package/dist/client/query/state/loadStateAggregateApi.d.cts +37 -0
  145. package/dist/client/query/state/loadStateAggregateApi.d.ts +37 -0
  146. package/dist/client/query/state/loadStateAggregateClient.cjs +2 -0
  147. package/dist/client/query/state/loadStateAggregateClient.cjs.map +1 -0
  148. package/dist/client/query/state/loadStateAggregateClient.d.cts +62 -0
  149. package/dist/client/query/state/loadStateAggregateClient.d.ts +62 -0
  150. package/dist/client/query/state/loadStateAggregateClient.es.js +65 -0
  151. package/dist/client/query/state/loadStateAggregateClient.es.js.map +1 -0
  152. package/dist/client/routing.cjs +2 -0
  153. package/dist/client/routing.cjs.map +1 -0
  154. package/dist/client/routing.d.cts +47 -0
  155. package/dist/client/routing.d.ts +47 -0
  156. package/dist/client/routing.es.js +8 -0
  157. package/dist/client/routing.es.js.map +1 -0
  158. package/dist/dsl/aggregation/admit.cjs +2 -0
  159. package/dist/dsl/aggregation/admit.cjs.map +1 -0
  160. package/dist/dsl/aggregation/admit.d.cts +6 -0
  161. package/dist/dsl/aggregation/admit.d.ts +6 -0
  162. package/dist/dsl/aggregation/admit.es.js +142 -0
  163. package/dist/dsl/aggregation/admit.es.js.map +1 -0
  164. package/dist/dsl/aggregation/builders.cjs +2 -0
  165. package/dist/dsl/aggregation/builders.cjs.map +1 -0
  166. package/dist/dsl/aggregation/builders.d.cts +309 -0
  167. package/dist/dsl/aggregation/builders.d.ts +309 -0
  168. package/dist/dsl/aggregation/builders.es.js +188 -0
  169. package/dist/dsl/aggregation/builders.es.js.map +1 -0
  170. package/dist/dsl/aggregation/derived.cjs +2 -0
  171. package/dist/dsl/aggregation/derived.cjs.map +1 -0
  172. package/dist/dsl/aggregation/derived.d.cts +33 -0
  173. package/dist/dsl/aggregation/derived.d.ts +33 -0
  174. package/dist/dsl/aggregation/derived.es.js +31 -0
  175. package/dist/dsl/aggregation/derived.es.js.map +1 -0
  176. package/dist/dsl/aggregation/expressionTrees.cjs +2 -0
  177. package/dist/dsl/aggregation/expressionTrees.cjs.map +1 -0
  178. package/dist/dsl/aggregation/expressionTrees.d.cts +10 -0
  179. package/dist/dsl/aggregation/expressionTrees.d.ts +10 -0
  180. package/dist/dsl/aggregation/expressionTrees.es.js +44 -0
  181. package/dist/dsl/aggregation/expressionTrees.es.js.map +1 -0
  182. package/dist/dsl/aggregation/having.cjs +2 -0
  183. package/dist/dsl/aggregation/having.cjs.map +1 -0
  184. package/dist/dsl/aggregation/having.d.cts +94 -0
  185. package/dist/dsl/aggregation/having.d.ts +94 -0
  186. package/dist/dsl/aggregation/having.es.js +62 -0
  187. package/dist/dsl/aggregation/having.es.js.map +1 -0
  188. package/dist/dsl/aggregation/index.d.cts +4 -0
  189. package/dist/dsl/aggregation/index.d.ts +4 -0
  190. package/dist/dsl/aggregation/sort.cjs +2 -0
  191. package/dist/dsl/aggregation/sort.cjs.map +1 -0
  192. package/dist/dsl/aggregation/sort.d.cts +7 -0
  193. package/dist/dsl/aggregation/sort.d.ts +7 -0
  194. package/dist/dsl/aggregation/sort.es.js +10 -0
  195. package/dist/dsl/aggregation/sort.es.js.map +1 -0
  196. package/dist/dsl/aggregation/types.cjs +2 -0
  197. package/dist/dsl/aggregation/types.cjs.map +1 -0
  198. package/dist/dsl/aggregation/types.d.cts +608 -0
  199. package/dist/dsl/aggregation/types.d.ts +608 -0
  200. package/dist/dsl/aggregation/types.es.js +37 -0
  201. package/dist/dsl/aggregation/types.es.js.map +1 -0
  202. package/dist/dsl/cursorQuery.cjs +2 -0
  203. package/dist/dsl/cursorQuery.cjs.map +1 -0
  204. package/dist/dsl/cursorQuery.d.cts +69 -0
  205. package/dist/dsl/cursorQuery.d.ts +69 -0
  206. package/dist/dsl/cursorQuery.es.js +19 -0
  207. package/dist/dsl/cursorQuery.es.js.map +1 -0
  208. package/dist/dsl/deletionState.cjs +2 -0
  209. package/dist/dsl/deletionState.cjs.map +1 -0
  210. package/dist/dsl/deletionState.d.cts +19 -0
  211. package/dist/dsl/deletionState.d.ts +19 -0
  212. package/dist/dsl/deletionState.es.js +8 -0
  213. package/dist/dsl/deletionState.es.js.map +1 -0
  214. package/dist/dsl/descriptor.cjs +2 -0
  215. package/dist/dsl/descriptor.cjs.map +1 -0
  216. package/dist/dsl/descriptor.d.cts +629 -0
  217. package/dist/dsl/descriptor.d.ts +629 -0
  218. package/dist/dsl/descriptor.es.js +37 -0
  219. package/dist/dsl/descriptor.es.js.map +1 -0
  220. package/dist/dsl/documents.d.cts +8 -0
  221. package/dist/dsl/documents.d.ts +8 -0
  222. package/dist/dsl/field.cjs +2 -0
  223. package/dist/dsl/field.cjs.map +1 -0
  224. package/dist/dsl/field.d.cts +2 -0
  225. package/dist/dsl/field.d.ts +2 -0
  226. package/dist/dsl/field.es.js +10 -0
  227. package/dist/dsl/field.es.js.map +1 -0
  228. package/dist/dsl/filter/builders.cjs +2 -0
  229. package/dist/dsl/filter/builders.cjs.map +1 -0
  230. package/dist/dsl/filter/builders.d.cts +962 -0
  231. package/dist/dsl/filter/builders.d.ts +962 -0
  232. package/dist/dsl/filter/builders.es.js +289 -0
  233. package/dist/dsl/filter/builders.es.js.map +1 -0
  234. package/dist/dsl/filter/datePattern.cjs +2 -0
  235. package/dist/dsl/filter/datePattern.cjs.map +1 -0
  236. package/dist/dsl/filter/datePattern.d.cts +8 -0
  237. package/dist/dsl/filter/datePattern.d.ts +8 -0
  238. package/dist/dsl/filter/datePattern.es.js +100 -0
  239. package/dist/dsl/filter/datePattern.es.js.map +1 -0
  240. package/dist/dsl/filter/index.d.cts +3 -0
  241. package/dist/dsl/filter/index.d.ts +3 -0
  242. package/dist/dsl/filter/operator.cjs +2 -0
  243. package/dist/dsl/filter/operator.cjs.map +1 -0
  244. package/dist/dsl/filter/operator.d.cts +113 -0
  245. package/dist/dsl/filter/operator.d.ts +113 -0
  246. package/dist/dsl/filter/operator.es.js +14 -0
  247. package/dist/dsl/filter/operator.es.js.map +1 -0
  248. package/dist/dsl/filter/scope.cjs +2 -0
  249. package/dist/dsl/filter/scope.cjs.map +1 -0
  250. package/dist/dsl/filter/scope.d.cts +15 -0
  251. package/dist/dsl/filter/scope.d.ts +15 -0
  252. package/dist/dsl/filter/scope.es.js +32 -0
  253. package/dist/dsl/filter/scope.es.js.map +1 -0
  254. package/dist/dsl/filter/types.d.cts +274 -0
  255. package/dist/dsl/filter/types.d.ts +274 -0
  256. package/dist/dsl/filter/validate.cjs +2 -0
  257. package/dist/dsl/filter/validate.cjs.map +1 -0
  258. package/dist/dsl/filter/validate.d.cts +18 -0
  259. package/dist/dsl/filter/validate.d.ts +18 -0
  260. package/dist/dsl/filter/validate.es.js +56 -0
  261. package/dist/dsl/filter/validate.es.js.map +1 -0
  262. package/dist/dsl/pagination.cjs +2 -0
  263. package/dist/dsl/pagination.cjs.map +1 -0
  264. package/dist/dsl/pagination.d.cts +28 -0
  265. package/dist/dsl/pagination.d.ts +28 -0
  266. package/dist/dsl/pagination.es.js +15 -0
  267. package/dist/dsl/pagination.es.js.map +1 -0
  268. package/dist/dsl/projection.cjs +2 -0
  269. package/dist/dsl/projection.cjs.map +1 -0
  270. package/dist/dsl/projection.d.cts +27 -0
  271. package/dist/dsl/projection.d.ts +27 -0
  272. package/dist/dsl/projection.es.js +12 -0
  273. package/dist/dsl/projection.es.js.map +1 -0
  274. package/dist/dsl/queryable.cjs +2 -0
  275. package/dist/dsl/queryable.cjs.map +1 -0
  276. package/dist/dsl/queryable.d.cts +101 -0
  277. package/dist/dsl/queryable.d.ts +101 -0
  278. package/dist/dsl/queryable.es.js +40 -0
  279. package/dist/dsl/queryable.es.js.map +1 -0
  280. package/dist/dsl/sort.cjs +2 -0
  281. package/dist/dsl/sort.cjs.map +1 -0
  282. package/dist/dsl/sort.d.cts +33 -0
  283. package/dist/dsl/sort.d.ts +33 -0
  284. package/dist/dsl/sort.es.js +21 -0
  285. package/dist/dsl/sort.es.js.map +1 -0
  286. package/dist/dsl.cjs +1 -0
  287. package/dist/dsl.d.cts +23 -0
  288. package/dist/dsl.d.ts +23 -0
  289. package/dist/dsl.es.js +14 -0
  290. package/dist/error/errorInfo.cjs +2 -0
  291. package/dist/error/errorInfo.cjs.map +1 -0
  292. package/dist/error/errorInfo.d.cts +139 -0
  293. package/dist/error/errorInfo.d.ts +139 -0
  294. package/dist/error/errorInfo.es.js +32 -0
  295. package/dist/error/errorInfo.es.js.map +1 -0
  296. package/dist/error/headers.cjs +2 -0
  297. package/dist/error/headers.cjs.map +1 -0
  298. package/dist/error/headers.d.cts +38 -0
  299. package/dist/error/headers.d.ts +38 -0
  300. package/dist/error/headers.es.js +10 -0
  301. package/dist/error/headers.es.js.map +1 -0
  302. package/dist/error/index.d.cts +21 -0
  303. package/dist/error/index.d.ts +21 -0
  304. package/dist/error/queryErrorCodes.cjs +2 -0
  305. package/dist/error/queryErrorCodes.cjs.map +1 -0
  306. package/dist/error/queryErrorCodes.d.cts +199 -0
  307. package/dist/error/queryErrorCodes.d.ts +199 -0
  308. package/dist/error/queryErrorCodes.es.js +53 -0
  309. package/dist/error/queryErrorCodes.es.js.map +1 -0
  310. package/dist/error/wowError.cjs +2 -0
  311. package/dist/error/wowError.cjs.map +1 -0
  312. package/dist/error/wowError.d.cts +99 -0
  313. package/dist/error/wowError.d.ts +99 -0
  314. package/dist/error/wowError.es.js +53 -0
  315. package/dist/error/wowError.es.js.map +1 -0
  316. package/dist/index.cjs +1 -0
  317. package/dist/index.d.cts +17 -0
  318. package/dist/index.d.ts +17 -0
  319. package/dist/index.es.js +34 -0
  320. package/dist/legacy/condition.cjs +2 -0
  321. package/dist/legacy/condition.cjs.map +1 -0
  322. package/dist/legacy/condition.d.cts +517 -0
  323. package/dist/legacy/condition.d.ts +517 -0
  324. package/dist/legacy/condition.es.js +338 -0
  325. package/dist/legacy/condition.es.js.map +1 -0
  326. package/dist/legacy/index.d.cts +16 -0
  327. package/dist/legacy/index.d.ts +16 -0
  328. package/dist/legacy/locale/en_US.cjs +2 -0
  329. package/dist/legacy/locale/en_US.cjs.map +1 -0
  330. package/dist/legacy/locale/en_US.d.cts +7 -0
  331. package/dist/legacy/locale/en_US.d.ts +7 -0
  332. package/dist/legacy/locale/en_US.es.js +50 -0
  333. package/dist/legacy/locale/en_US.es.js.map +1 -0
  334. package/dist/legacy/locale/operatorLocale.d.cts +10 -0
  335. package/dist/legacy/locale/operatorLocale.d.ts +10 -0
  336. package/dist/legacy/locale/zh_CN.cjs +2 -0
  337. package/dist/legacy/locale/zh_CN.cjs.map +1 -0
  338. package/dist/legacy/locale/zh_CN.d.cts +7 -0
  339. package/dist/legacy/locale/zh_CN.d.ts +7 -0
  340. package/dist/legacy/locale/zh_CN.es.js +50 -0
  341. package/dist/legacy/locale/zh_CN.es.js.map +1 -0
  342. package/dist/legacy/operator.cjs +2 -0
  343. package/dist/legacy/operator.cjs.map +1 -0
  344. package/dist/legacy/operator.d.cts +218 -0
  345. package/dist/legacy/operator.d.ts +218 -0
  346. package/dist/legacy/operator.es.js +25 -0
  347. package/dist/legacy/operator.es.js.map +1 -0
  348. package/dist/legacy/queryable.cjs +2 -0
  349. package/dist/legacy/queryable.cjs.map +1 -0
  350. package/dist/legacy/queryable.d.cts +61 -0
  351. package/dist/legacy/queryable.d.ts +61 -0
  352. package/dist/legacy/queryable.es.js +34 -0
  353. package/dist/legacy/queryable.es.js.map +1 -0
  354. package/dist/legacy.cjs +1 -0
  355. package/dist/legacy.es.js +6 -0
  356. package/dist/model/abac.cjs +2 -0
  357. package/dist/model/abac.cjs.map +1 -0
  358. package/dist/model/abac.d.cts +33 -0
  359. package/dist/model/abac.d.ts +33 -0
  360. package/dist/model/abac.es.js +6 -0
  361. package/dist/model/abac.es.js.map +1 -0
  362. package/dist/model/bi.cjs +2 -0
  363. package/dist/model/bi.cjs.map +1 -0
  364. package/dist/model/bi.d.cts +12 -0
  365. package/dist/model/bi.d.ts +12 -0
  366. package/dist/model/bi.es.js +8 -0
  367. package/dist/model/bi.es.js.map +1 -0
  368. package/dist/model/command.cjs +2 -0
  369. package/dist/model/command.cjs.map +1 -0
  370. package/dist/model/command.d.cts +137 -0
  371. package/dist/model/command.d.ts +137 -0
  372. package/dist/model/command.es.js +8 -0
  373. package/dist/model/command.es.js.map +1 -0
  374. package/dist/model/common.d.cts +19 -0
  375. package/dist/model/common.d.ts +19 -0
  376. package/dist/model/function.cjs +2 -0
  377. package/dist/model/function.cjs.map +1 -0
  378. package/dist/model/function.d.cts +41 -0
  379. package/dist/model/function.d.ts +41 -0
  380. package/dist/model/function.es.js +8 -0
  381. package/dist/model/function.es.js.map +1 -0
  382. package/dist/model/index.d.cts +22 -0
  383. package/dist/model/index.d.ts +22 -0
  384. package/dist/model/messaging.d.cts +5 -0
  385. package/dist/model/messaging.d.ts +5 -0
  386. package/dist/model/modeling.d.cts +145 -0
  387. package/dist/model/modeling.d.ts +145 -0
  388. package/dist/model/naming.d.cts +27 -0
  389. package/dist/model/naming.d.ts +27 -0
  390. package/dist/transport/endpoints.cjs +2 -0
  391. package/dist/transport/endpoints.cjs.map +1 -0
  392. package/dist/transport/endpoints.d.cts +79 -0
  393. package/dist/transport/endpoints.d.ts +79 -0
  394. package/dist/transport/endpoints.es.js +14 -0
  395. package/dist/transport/endpoints.es.js.map +1 -0
  396. package/dist/transport/eventStreams.cjs +2 -0
  397. package/dist/transport/eventStreams.cjs.map +1 -0
  398. package/dist/transport/eventStreams.d.cts +23 -0
  399. package/dist/transport/eventStreams.d.ts +23 -0
  400. package/dist/transport/eventStreams.es.js +22 -0
  401. package/dist/transport/eventStreams.es.js.map +1 -0
  402. package/dist/transport/index.d.cts +1 -0
  403. package/dist/transport/index.d.ts +1 -0
  404. package/package.json +110 -0
@@ -0,0 +1,101 @@
1
+ import { FilterCapable } from './filter/index.cjs';
2
+ import { SortCapable } from './sort.cjs';
3
+ import { Pagination } from './pagination.cjs';
4
+ import { ProjectionCapable } from './projection.cjs';
5
+ /** A query that filters, projects and sorts with Wow's `FilterExpression`. */
6
+ export interface FilterQueryable<FIELDS extends string = string> extends FilterCapable<FIELDS>, ProjectionCapable<FIELDS>, SortCapable<FIELDS> {
7
+ }
8
+ /** The body of a `single` query: the first match of the filter, or nothing. */
9
+ export interface FilterSingleQuery<FIELDS extends string = string> extends FilterQueryable<FIELDS> {
10
+ }
11
+ /** The body of a `list` or `listStream` query. */
12
+ export interface FilterListQuery<FIELDS extends string = string> extends FilterQueryable<FIELDS> {
13
+ /**
14
+ * The most rows to return. The client sends no default: absent (or 0)
15
+ * leaves the choice to the server, and what the server does depends on its
16
+ * version.
17
+ *
18
+ * - Wow 9.1.5 and later apply the server's default list size over HTTP
19
+ * (100 unless the server configures another).
20
+ * - Wow 8.11 to 9.1.3 reject the query with `IllegalArgument: HTTP list
21
+ * query limit[0] must be between 1 and …` (HTTP 400 for a list, the error
22
+ * event that ends a list stream), so pass `limit` explicitly against
23
+ * those servers.
24
+ *
25
+ * Wow 8.11 and later also refuse a value above the server's maximum list
26
+ * size (1000 by default).
27
+ */
28
+ limit?: number;
29
+ }
30
+ /** The body of a `paged` query. */
31
+ export interface FilterPagedQuery<FIELDS extends string = string> extends FilterQueryable<FIELDS> {
32
+ pagination?: Pagination;
33
+ }
34
+ /** What `singleQuery`, `listQuery` and `pagedQuery` take in common. */
35
+ type QueryOptions<FIELDS extends string = string> = Partial<FilterQueryable<FIELDS>>;
36
+ /**
37
+ * Builds the body of a `single` query.
38
+ *
39
+ * @param options.filter - What to match. Defaults to `filter.matchAll()`.
40
+ * @param options.projection - Which fields to return. Optional.
41
+ * @param options.sort - Which match counts as the first. Optional.
42
+ * @throws TypeError when `filter` is `null`.
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * singleQuery({ filter: filter.eq('status', 'ACTIVE') });
47
+ * ```
48
+ */
49
+ export declare function singleQuery<FIELDS extends string = string>({ filter, projection, sort, }?: QueryOptions<FIELDS>): FilterSingleQuery<FIELDS>;
50
+ /**
51
+ * Builds the body of a `list` or `listStream` query.
52
+ *
53
+ * @param options.filter - What to match. Defaults to `filter.matchAll()`.
54
+ * @param options.projection - Which fields to return. Optional.
55
+ * @param options.sort - The order of the rows. Optional.
56
+ * @param options.limit - The most rows to return. Absent is sent as absent:
57
+ * Wow 9.1.5 and later apply the server's default list size, Wow 8.11 to
58
+ * 9.1.3 reject the query, so pass it for those servers; see
59
+ * {@link FilterListQuery.limit}.
60
+ * @throws TypeError when `filter` is `null`.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * listQuery({ filter: filter.eq('status', 'ACTIVE'), limit: 20 });
65
+ * ```
66
+ */
67
+ export declare function listQuery<FIELDS extends string = string>({ filter, projection, sort, limit, }?: QueryOptions<FIELDS> & {
68
+ limit?: number;
69
+ }): FilterListQuery<FIELDS>;
70
+ /**
71
+ * Builds the body of a `paged` query.
72
+ *
73
+ * @param options.filter - What to match. Defaults to `filter.matchAll()`.
74
+ * @param options.projection - Which fields to return. Optional.
75
+ * @param options.sort - The order of the rows. Optional.
76
+ * @param options.pagination - Which page. Defaults to a copy of
77
+ * {@link DEFAULT_PAGINATION}: the first page of ten.
78
+ * @throws TypeError when `filter` is `null`.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * pagedQuery({ filter: filter.matchAll(), pagination: { index: 2, size: 20 } });
83
+ * ```
84
+ */
85
+ export declare function pagedQuery<FIELDS extends string = string>({ filter, projection, sort, pagination, }?: QueryOptions<FIELDS> & {
86
+ pagination?: Pagination;
87
+ }): FilterPagedQuery<FIELDS>;
88
+ /** One page of a `paged` query: its rows, and how many match in total. */
89
+ export interface PagedList<T> {
90
+ total: number;
91
+ list: T[];
92
+ }
93
+ /**
94
+ * Builds a `PagedList`, for a placeholder page or a test double.
95
+ *
96
+ * @param options.total - How many rows match in total. Defaults to the length
97
+ * of `list`.
98
+ * @param options.list - The rows of this page. Defaults to a new empty array.
99
+ */
100
+ export declare function pagedList<T>({ total, list, }?: Partial<PagedList<T>>): PagedList<T>;
101
+ export {};
@@ -0,0 +1,101 @@
1
+ import { FilterCapable } from './filter/index.js';
2
+ import { SortCapable } from './sort.js';
3
+ import { Pagination } from './pagination.js';
4
+ import { ProjectionCapable } from './projection.js';
5
+ /** A query that filters, projects and sorts with Wow's `FilterExpression`. */
6
+ export interface FilterQueryable<FIELDS extends string = string> extends FilterCapable<FIELDS>, ProjectionCapable<FIELDS>, SortCapable<FIELDS> {
7
+ }
8
+ /** The body of a `single` query: the first match of the filter, or nothing. */
9
+ export interface FilterSingleQuery<FIELDS extends string = string> extends FilterQueryable<FIELDS> {
10
+ }
11
+ /** The body of a `list` or `listStream` query. */
12
+ export interface FilterListQuery<FIELDS extends string = string> extends FilterQueryable<FIELDS> {
13
+ /**
14
+ * The most rows to return. The client sends no default: absent (or 0)
15
+ * leaves the choice to the server, and what the server does depends on its
16
+ * version.
17
+ *
18
+ * - Wow 9.1.5 and later apply the server's default list size over HTTP
19
+ * (100 unless the server configures another).
20
+ * - Wow 8.11 to 9.1.3 reject the query with `IllegalArgument: HTTP list
21
+ * query limit[0] must be between 1 and …` (HTTP 400 for a list, the error
22
+ * event that ends a list stream), so pass `limit` explicitly against
23
+ * those servers.
24
+ *
25
+ * Wow 8.11 and later also refuse a value above the server's maximum list
26
+ * size (1000 by default).
27
+ */
28
+ limit?: number;
29
+ }
30
+ /** The body of a `paged` query. */
31
+ export interface FilterPagedQuery<FIELDS extends string = string> extends FilterQueryable<FIELDS> {
32
+ pagination?: Pagination;
33
+ }
34
+ /** What `singleQuery`, `listQuery` and `pagedQuery` take in common. */
35
+ type QueryOptions<FIELDS extends string = string> = Partial<FilterQueryable<FIELDS>>;
36
+ /**
37
+ * Builds the body of a `single` query.
38
+ *
39
+ * @param options.filter - What to match. Defaults to `filter.matchAll()`.
40
+ * @param options.projection - Which fields to return. Optional.
41
+ * @param options.sort - Which match counts as the first. Optional.
42
+ * @throws TypeError when `filter` is `null`.
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * singleQuery({ filter: filter.eq('status', 'ACTIVE') });
47
+ * ```
48
+ */
49
+ export declare function singleQuery<FIELDS extends string = string>({ filter, projection, sort, }?: QueryOptions<FIELDS>): FilterSingleQuery<FIELDS>;
50
+ /**
51
+ * Builds the body of a `list` or `listStream` query.
52
+ *
53
+ * @param options.filter - What to match. Defaults to `filter.matchAll()`.
54
+ * @param options.projection - Which fields to return. Optional.
55
+ * @param options.sort - The order of the rows. Optional.
56
+ * @param options.limit - The most rows to return. Absent is sent as absent:
57
+ * Wow 9.1.5 and later apply the server's default list size, Wow 8.11 to
58
+ * 9.1.3 reject the query, so pass it for those servers; see
59
+ * {@link FilterListQuery.limit}.
60
+ * @throws TypeError when `filter` is `null`.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * listQuery({ filter: filter.eq('status', 'ACTIVE'), limit: 20 });
65
+ * ```
66
+ */
67
+ export declare function listQuery<FIELDS extends string = string>({ filter, projection, sort, limit, }?: QueryOptions<FIELDS> & {
68
+ limit?: number;
69
+ }): FilterListQuery<FIELDS>;
70
+ /**
71
+ * Builds the body of a `paged` query.
72
+ *
73
+ * @param options.filter - What to match. Defaults to `filter.matchAll()`.
74
+ * @param options.projection - Which fields to return. Optional.
75
+ * @param options.sort - The order of the rows. Optional.
76
+ * @param options.pagination - Which page. Defaults to a copy of
77
+ * {@link DEFAULT_PAGINATION}: the first page of ten.
78
+ * @throws TypeError when `filter` is `null`.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * pagedQuery({ filter: filter.matchAll(), pagination: { index: 2, size: 20 } });
83
+ * ```
84
+ */
85
+ export declare function pagedQuery<FIELDS extends string = string>({ filter, projection, sort, pagination, }?: QueryOptions<FIELDS> & {
86
+ pagination?: Pagination;
87
+ }): FilterPagedQuery<FIELDS>;
88
+ /** One page of a `paged` query: its rows, and how many match in total. */
89
+ export interface PagedList<T> {
90
+ total: number;
91
+ list: T[];
92
+ }
93
+ /**
94
+ * Builds a `PagedList`, for a placeholder page or a test double.
95
+ *
96
+ * @param options.total - How many rows match in total. Defaults to the length
97
+ * of `list`.
98
+ * @param options.list - The rows of this page. Defaults to a new empty array.
99
+ */
100
+ export declare function pagedList<T>({ total, list, }?: Partial<PagedList<T>>): PagedList<T>;
101
+ export {};
@@ -0,0 +1,40 @@
1
+ import { filter as e } from "./filter/builders.es.js";
2
+ import { DEFAULT_PAGINATION as t } from "./pagination.es.js";
3
+ //#region src/dsl/queryable.ts
4
+ function n(t) {
5
+ if (t === null) throw TypeError("filter cannot be null.");
6
+ return t ?? e.matchAll();
7
+ }
8
+ function r({ filter: e, projection: t, sort: r } = {}) {
9
+ return {
10
+ filter: n(e),
11
+ projection: t,
12
+ sort: r
13
+ };
14
+ }
15
+ function i({ filter: e, projection: t, sort: r, limit: i } = {}) {
16
+ return {
17
+ filter: n(e),
18
+ projection: t,
19
+ sort: r,
20
+ limit: i
21
+ };
22
+ }
23
+ function a({ filter: e, projection: r, sort: i, pagination: a = { ...t } } = {}) {
24
+ return {
25
+ filter: n(e),
26
+ projection: r,
27
+ sort: i,
28
+ pagination: a
29
+ };
30
+ }
31
+ function o({ total: e, list: t = [] } = {}) {
32
+ return {
33
+ total: e ?? t.length,
34
+ list: t
35
+ };
36
+ }
37
+ //#endregion
38
+ export { i as listQuery, o as pagedList, a as pagedQuery, r as singleQuery };
39
+
40
+ //# sourceMappingURL=queryable.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryable.es.js","names":["filter","filters","queryFilter","filter$1","filter","singleQuery","listQuery","pagedQuery","DEFAULT_PAGINATION","pagedList","total","list"],"sources":["../../src/dsl/queryable.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 {\n filter as filters,\n type FilterCapable,\n type FilterExpression,\n} from './filter/index.js';\nimport { type SortCapable } from './sort.js';\nimport { DEFAULT_PAGINATION, type Pagination } from './pagination.js';\nimport { type ProjectionCapable } from './projection.js';\n\n/** A query that filters, projects and sorts with Wow's `FilterExpression`. */\nexport interface FilterQueryable<FIELDS extends string = string>\n extends\n FilterCapable<FIELDS>,\n ProjectionCapable<FIELDS>,\n SortCapable<FIELDS> {}\n\n/** The body of a `single` query: the first match of the filter, or nothing. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface FilterSingleQuery<\n FIELDS extends string = string,\n> extends FilterQueryable<FIELDS> {}\n\n/** The body of a `list` or `listStream` query. */\nexport interface FilterListQuery<\n FIELDS extends string = string,\n> extends FilterQueryable<FIELDS> {\n /**\n * The most rows to return. The client sends no default: absent (or 0)\n * leaves the choice to the server, and what the server does depends on its\n * version.\n *\n * - Wow 9.1.5 and later apply the server's default list size over HTTP\n * (100 unless the server configures another).\n * - Wow 8.11 to 9.1.3 reject the query with `IllegalArgument: HTTP list\n * query limit[0] must be between 1 and …` (HTTP 400 for a list, the error\n * event that ends a list stream), so pass `limit` explicitly against\n * those servers.\n *\n * Wow 8.11 and later also refuse a value above the server's maximum list\n * size (1000 by default).\n */\n limit?: number;\n}\n\n/** The body of a `paged` query. */\nexport interface FilterPagedQuery<\n FIELDS extends string = string,\n> extends FilterQueryable<FIELDS> {\n pagination?: Pagination;\n}\n\n/** What `singleQuery`, `listQuery` and `pagedQuery` take in common. */\ntype QueryOptions<FIELDS extends string = string> = Partial<\n FilterQueryable<FIELDS>\n>;\n\nfunction queryFilter<FIELDS extends string>(\n filter: FilterExpression<FIELDS> | undefined,\n): FilterExpression<FIELDS> {\n if (filter === null) {\n throw new TypeError('filter cannot be null.');\n }\n return filter ?? filters.matchAll();\n}\n\n/**\n * Builds the body of a `single` query.\n *\n * @param options.filter - What to match. Defaults to `filter.matchAll()`.\n * @param options.projection - Which fields to return. Optional.\n * @param options.sort - Which match counts as the first. Optional.\n * @throws TypeError when `filter` is `null`.\n *\n * @example\n * ```typescript\n * singleQuery({ filter: filter.eq('status', 'ACTIVE') });\n * ```\n */\nexport function singleQuery<FIELDS extends string = string>({\n filter,\n projection,\n sort,\n}: QueryOptions<FIELDS> = {}): FilterSingleQuery<FIELDS> {\n return { filter: queryFilter(filter), projection, sort };\n}\n\n/**\n * Builds the body of a `list` or `listStream` query.\n *\n * @param options.filter - What to match. Defaults to `filter.matchAll()`.\n * @param options.projection - Which fields to return. Optional.\n * @param options.sort - The order of the rows. Optional.\n * @param options.limit - The most rows to return. Absent is sent as absent:\n * Wow 9.1.5 and later apply the server's default list size, Wow 8.11 to\n * 9.1.3 reject the query, so pass it for those servers; see\n * {@link FilterListQuery.limit}.\n * @throws TypeError when `filter` is `null`.\n *\n * @example\n * ```typescript\n * listQuery({ filter: filter.eq('status', 'ACTIVE'), limit: 20 });\n * ```\n */\nexport function listQuery<FIELDS extends string = string>({\n filter,\n projection,\n sort,\n limit,\n}: QueryOptions<FIELDS> & { limit?: number } = {}): FilterListQuery<FIELDS> {\n return { filter: queryFilter(filter), projection, sort, limit };\n}\n\n/**\n * Builds the body of a `paged` query.\n *\n * @param options.filter - What to match. Defaults to `filter.matchAll()`.\n * @param options.projection - Which fields to return. Optional.\n * @param options.sort - The order of the rows. Optional.\n * @param options.pagination - Which page. Defaults to a copy of\n * {@link DEFAULT_PAGINATION}: the first page of ten.\n * @throws TypeError when `filter` is `null`.\n *\n * @example\n * ```typescript\n * pagedQuery({ filter: filter.matchAll(), pagination: { index: 2, size: 20 } });\n * ```\n */\nexport function pagedQuery<FIELDS extends string = string>({\n filter,\n projection,\n sort,\n pagination = { ...DEFAULT_PAGINATION },\n}: QueryOptions<FIELDS> & {\n pagination?: Pagination;\n} = {}): FilterPagedQuery<FIELDS> {\n return { filter: queryFilter(filter), projection, sort, pagination };\n}\n\n/** One page of a `paged` query: its rows, and how many match in total. */\nexport interface PagedList<T> {\n total: number;\n list: T[];\n}\n\n/**\n * Builds a `PagedList`, for a placeholder page or a test double.\n *\n * @param options.total - How many rows match in total. Defaults to the length\n * of `list`.\n * @param options.list - The rows of this page. Defaults to a new empty array.\n */\nexport function pagedList<T>({\n total,\n list = [],\n}: Partial<PagedList<T>> = {}): PagedList<T> {\n return { total: total ?? list.length, list };\n}\n"],"mappings":";;;AAqEA,SAASE,EACP,GAC0B;CAC1B,IAAIF,MAAW,MACb,MAAU,UAAU,wBAAwB;CAE9C,OAAOA,KAAUC,EAAQ,SAAS;AACpC;AAeA,SAAgBI,EAA4C,EAC1D,WACA,eACA,YACwB,CAAC,GAA8B;CACvD,OAAO;EAAE,QAAQH,EAAYE,CAAM;EAAG;EAAY;CAAK;AACzD;AAmBA,SAAgBE,EAA0C,EACxD,WACA,eACA,SACA,aAC6C,CAAC,GAA4B;CAC1E,OAAO;EAAE,QAAQJ,EAAYE,CAAM;EAAG;EAAY;EAAM;CAAM;AAChE;AAiBA,SAAgBG,EAA2C,EACzD,WACA,eACA,SACA,gBAAa,EAAE,GAAGC,EAAmB,MAGnC,CAAC,GAA6B;CAChC,OAAO;EAAE,QAAQN,EAAYE,CAAM;EAAG;EAAY;EAAM;CAAW;AACrE;AAeA,SAAgBK,EAAa,EAC3B,UACA,UAAO,CAAC,MACiB,CAAC,GAAiB;CAC3C,OAAO;EAAE,OAAOC,KAASC,EAAK;EAAQ;CAAK;AAC7C"}
@@ -0,0 +1,2 @@
1
+ const e=require("./field.cjs");var t=function(e){return e.ASC=`ASC`,e.DESC=`DESC`,e}({});function n(t){return{field:e.queryField(t),direction:`ASC`}}function r(t){return{field:e.queryField(t),direction:`DESC`}}exports.SortDirection=t,exports.asc=n,exports.desc=r;
2
+ //# sourceMappingURL=sort.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.cjs","names":["queryField","require_field","SortDirection","\"ASC\"","\"DESC\"","asc","field","desc"],"sources":["../../src/dsl/sort.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 { queryField } from './field.js';\n\n/**\n * Enumeration of sort directions.\n * ASC for ascending order, DESC for descending order.\n */\nexport enum SortDirection {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/**\n * Interface for sort criteria.\n */\nexport interface FieldSort<FIELDS extends string = string> {\n field: FIELDS;\n direction: SortDirection;\n}\n\n/**\n * Creates a sort object with ascending direction for the specified field.\n * @param field - The field to sort by\n * @returns A Sort object with the specified field and ascending direction\n */\nexport function asc<FIELDS extends string = string>(\n field: FIELDS,\n): FieldSort<FIELDS> {\n return {\n field: queryField(field),\n direction: SortDirection.ASC,\n };\n}\n\n/**\n * Creates a sort object with descending direction for the specified field.\n * @param field - The field to sort by\n * @returns A Sort object with the specified field and descending direction\n */\nexport function desc<FIELDS extends string = string>(\n field: FIELDS,\n): FieldSort<FIELDS> {\n return {\n field: queryField(field),\n direction: SortDirection.DESC,\n };\n}\n\n/**\n * Interface for objects that support sorting.\n */\nexport interface SortCapable<FIELDS extends string = string> {\n sort?: FieldSort<FIELDS>[];\n}\n"],"mappings":"+BAmBA,IAAYE,EAAL,SAAA,EAAA,OACL,GAAAC,IAAA,MACA,EAAAC,KAAA,QACF,EAAA,CAAA,CAAA,EAeA,SAAgBC,EACd,EACmB,CACnB,MAAO,CACL,MAAOL,EAAAA,WAAWM,CAAK,EACvB,UAAA,KACF,CACF,CAOA,SAAgBC,EACd,EACmB,CACnB,MAAO,CACL,MAAOP,EAAAA,WAAWM,CAAK,EACvB,UAAA,MACF,CACF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Enumeration of sort directions.
3
+ * ASC for ascending order, DESC for descending order.
4
+ */
5
+ export declare enum SortDirection {
6
+ ASC = "ASC",
7
+ DESC = "DESC"
8
+ }
9
+ /**
10
+ * Interface for sort criteria.
11
+ */
12
+ export interface FieldSort<FIELDS extends string = string> {
13
+ field: FIELDS;
14
+ direction: SortDirection;
15
+ }
16
+ /**
17
+ * Creates a sort object with ascending direction for the specified field.
18
+ * @param field - The field to sort by
19
+ * @returns A Sort object with the specified field and ascending direction
20
+ */
21
+ export declare function asc<FIELDS extends string = string>(field: FIELDS): FieldSort<FIELDS>;
22
+ /**
23
+ * Creates a sort object with descending direction for the specified field.
24
+ * @param field - The field to sort by
25
+ * @returns A Sort object with the specified field and descending direction
26
+ */
27
+ export declare function desc<FIELDS extends string = string>(field: FIELDS): FieldSort<FIELDS>;
28
+ /**
29
+ * Interface for objects that support sorting.
30
+ */
31
+ export interface SortCapable<FIELDS extends string = string> {
32
+ sort?: FieldSort<FIELDS>[];
33
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Enumeration of sort directions.
3
+ * ASC for ascending order, DESC for descending order.
4
+ */
5
+ export declare enum SortDirection {
6
+ ASC = "ASC",
7
+ DESC = "DESC"
8
+ }
9
+ /**
10
+ * Interface for sort criteria.
11
+ */
12
+ export interface FieldSort<FIELDS extends string = string> {
13
+ field: FIELDS;
14
+ direction: SortDirection;
15
+ }
16
+ /**
17
+ * Creates a sort object with ascending direction for the specified field.
18
+ * @param field - The field to sort by
19
+ * @returns A Sort object with the specified field and ascending direction
20
+ */
21
+ export declare function asc<FIELDS extends string = string>(field: FIELDS): FieldSort<FIELDS>;
22
+ /**
23
+ * Creates a sort object with descending direction for the specified field.
24
+ * @param field - The field to sort by
25
+ * @returns A Sort object with the specified field and descending direction
26
+ */
27
+ export declare function desc<FIELDS extends string = string>(field: FIELDS): FieldSort<FIELDS>;
28
+ /**
29
+ * Interface for objects that support sorting.
30
+ */
31
+ export interface SortCapable<FIELDS extends string = string> {
32
+ sort?: FieldSort<FIELDS>[];
33
+ }
@@ -0,0 +1,21 @@
1
+ import { queryField as e } from "./field.es.js";
2
+ //#region src/dsl/sort.ts
3
+ var t = /* @__PURE__ */ function(e) {
4
+ return e.ASC = "ASC", e.DESC = "DESC", e;
5
+ }({});
6
+ function n(t) {
7
+ return {
8
+ field: e(t),
9
+ direction: "ASC"
10
+ };
11
+ }
12
+ function r(t) {
13
+ return {
14
+ field: e(t),
15
+ direction: "DESC"
16
+ };
17
+ }
18
+ //#endregion
19
+ export { t as SortDirection, n as asc, r as desc };
20
+
21
+ //# sourceMappingURL=sort.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.es.js","names":["SortDirection","\"ASC\"","\"DESC\"","asc","queryField","field","desc"],"sources":["../../src/dsl/sort.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 { queryField } from './field.js';\n\n/**\n * Enumeration of sort directions.\n * ASC for ascending order, DESC for descending order.\n */\nexport enum SortDirection {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/**\n * Interface for sort criteria.\n */\nexport interface FieldSort<FIELDS extends string = string> {\n field: FIELDS;\n direction: SortDirection;\n}\n\n/**\n * Creates a sort object with ascending direction for the specified field.\n * @param field - The field to sort by\n * @returns A Sort object with the specified field and ascending direction\n */\nexport function asc<FIELDS extends string = string>(\n field: FIELDS,\n): FieldSort<FIELDS> {\n return {\n field: queryField(field),\n direction: SortDirection.ASC,\n };\n}\n\n/**\n * Creates a sort object with descending direction for the specified field.\n * @param field - The field to sort by\n * @returns A Sort object with the specified field and descending direction\n */\nexport function desc<FIELDS extends string = string>(\n field: FIELDS,\n): FieldSort<FIELDS> {\n return {\n field: queryField(field),\n direction: SortDirection.DESC,\n };\n}\n\n/**\n * Interface for objects that support sorting.\n */\nexport interface SortCapable<FIELDS extends string = string> {\n sort?: FieldSort<FIELDS>[];\n}\n"],"mappings":";;AAmBA,IAAYA,IAAL,yBAAA,GAAA;QACL,EAAAC,MAAA,OACA,EAAAC,OAAA;AACF,EAAA,CAAA,CAAA;AAeA,SAAgBC,EACd,GACmB;CACnB,OAAO;EACL,OAAOC,EAAWC,CAAK;EACvB,WAAA;CACF;AACF;AAOA,SAAgBC,EACd,GACmB;CACnB,OAAO;EACL,OAAOF,EAAWC,CAAK;EACvB,WAAA;CACF;AACF"}
package/dist/dsl.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./dsl/filter/operator.cjs"),t=require("./dsl/aggregation/types.cjs"),n=require("./dsl/deletionState.cjs"),r=require("./dsl/filter/builders.cjs"),i=require("./dsl/sort.cjs"),a=require("./dsl/aggregation/builders.cjs"),o=require("./dsl/projection.cjs"),s=require("./dsl/pagination.cjs"),c=require("./dsl/cursorQuery.cjs"),l=require("./dsl/queryable.cjs"),u=require("./dsl/descriptor.cjs"),d=require("./client/query/event/domainEventStream.cjs"),f=require("./client/query/snapshot/snapshot.cjs");exports.AGGREGATION_LIMITS=t.AGGREGATION_LIMITS,exports.AggregationDatePart=t.AggregationDatePart,exports.AggregationDateUnit=t.AggregationDateUnit,exports.AggregationExpressionOperator=t.AggregationExpressionOperator,exports.AggregationExpressionType=t.AggregationExpressionType,exports.AggregationFunction=t.AggregationFunction,exports.AggregationGroupType=t.AggregationGroupType,exports.AggregationMetricType=t.AggregationMetricType,exports.ComparisonOperator=t.ComparisonOperator,exports.DEFAULT_CURSOR_SIZE=c.DEFAULT_CURSOR_SIZE,exports.DEFAULT_PAGINATION=s.DEFAULT_PAGINATION,exports.DateDiffUnit=t.DateDiffUnit,exports.DeletionState=n.DeletionState,exports.DerivedExpressionType=t.DerivedExpressionType,exports.DomainEventStreamMetadataFields=d.DomainEventStreamMetadataFields,exports.FilterOperator=e.FilterOperator,exports.HavingExpressionType=t.HavingExpressionType,exports.MAX_CURSOR_SIZE=c.MAX_CURSOR_SIZE,exports.MAX_CURSOR_SORT_FIELDS=c.MAX_CURSOR_SORT_FIELDS,exports.PagingMode=u.PagingMode,exports.QueryConstraintTypes=u.QueryConstraintTypes,exports.QueryFieldRoles=u.QueryFieldRoles,exports.QueryModels=u.QueryModels,exports.QueryValueKind=u.QueryValueKind,exports.QueryValueTypes=u.QueryValueTypes,exports.SearchMode=e.SearchMode,exports.SensitivityLevel=u.SensitivityLevel,exports.SnapshotMetadataFields=f.SnapshotMetadataFields,exports.SortDirection=i.SortDirection,exports.StringComparison=e.StringComparison,exports.TimeUnit=e.TimeUnit,exports.aggregation=a.aggregation,exports.asc=i.asc,exports.cursorQuery=c.cursorQuery,exports.desc=i.desc,exports.filter=r.filter,exports.listQuery=l.listQuery,exports.pagedList=l.pagedList,exports.pagedQuery=l.pagedQuery,exports.pagination=s.pagination,exports.projection=o.projection,exports.singleQuery=l.singleQuery;
package/dist/dsl.d.cts ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `@ahoo-wang/wow-client/dsl`: the query DSL alone — `filter.*`,
3
+ * `aggregation.*`, sort, projection, pagination, cursor queries, the query
4
+ * factories and their types, the metadata field names of snapshots and event
5
+ * streams, and the types of the query capability descriptor.
6
+ *
7
+ * It loads no HTTP code: no Fetcher, no decorators, no `reflect-metadata`,
8
+ * and none of the global stream patches `@ahoo-wang/fetcher-eventstream`
9
+ * installs. An application that only builds queries — and sends them through
10
+ * a client of its own — imports this. The root entry exports all of it too.
11
+ */
12
+ export * from './dsl/filter/index.cjs';
13
+ export * from './dsl/aggregation/index.cjs';
14
+ export * from './dsl/sort.cjs';
15
+ export * from './dsl/projection.cjs';
16
+ export * from './dsl/pagination.cjs';
17
+ export * from './dsl/cursorQuery.cjs';
18
+ export * from './dsl/queryable.cjs';
19
+ export * from './dsl/deletionState.cjs';
20
+ export * from './dsl/documents.cjs';
21
+ export * from './dsl/descriptor.cjs';
22
+ export { SnapshotMetadataFields } from './client/query/snapshot/snapshot.cjs';
23
+ export { DomainEventStreamMetadataFields } from './client/query/event/domainEventStream.cjs';
package/dist/dsl.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * `@ahoo-wang/wow-client/dsl`: the query DSL alone — `filter.*`,
3
+ * `aggregation.*`, sort, projection, pagination, cursor queries, the query
4
+ * factories and their types, the metadata field names of snapshots and event
5
+ * streams, and the types of the query capability descriptor.
6
+ *
7
+ * It loads no HTTP code: no Fetcher, no decorators, no `reflect-metadata`,
8
+ * and none of the global stream patches `@ahoo-wang/fetcher-eventstream`
9
+ * installs. An application that only builds queries — and sends them through
10
+ * a client of its own — imports this. The root entry exports all of it too.
11
+ */
12
+ export * from './dsl/filter/index.js';
13
+ export * from './dsl/aggregation/index.js';
14
+ export * from './dsl/sort.js';
15
+ export * from './dsl/projection.js';
16
+ export * from './dsl/pagination.js';
17
+ export * from './dsl/cursorQuery.js';
18
+ export * from './dsl/queryable.js';
19
+ export * from './dsl/deletionState.js';
20
+ export * from './dsl/documents.js';
21
+ export * from './dsl/descriptor.js';
22
+ export { SnapshotMetadataFields } from './client/query/snapshot/snapshot.js';
23
+ export { DomainEventStreamMetadataFields } from './client/query/event/domainEventStream.js';
package/dist/dsl.es.js ADDED
@@ -0,0 +1,14 @@
1
+ import { FilterOperator as e, SearchMode as t, StringComparison as n, TimeUnit as r } from "./dsl/filter/operator.es.js";
2
+ import { AGGREGATION_LIMITS as i, AggregationDatePart as a, AggregationDateUnit as o, AggregationExpressionOperator as s, AggregationExpressionType as c, AggregationFunction as l, AggregationGroupType as u, AggregationMetricType as d, ComparisonOperator as f, DateDiffUnit as p, DerivedExpressionType as m, HavingExpressionType as h } from "./dsl/aggregation/types.es.js";
3
+ import { DeletionState as g } from "./dsl/deletionState.es.js";
4
+ import { filter as _ } from "./dsl/filter/builders.es.js";
5
+ import { SortDirection as v, asc as y, desc as b } from "./dsl/sort.es.js";
6
+ import { aggregation as x } from "./dsl/aggregation/builders.es.js";
7
+ import { projection as S } from "./dsl/projection.es.js";
8
+ import { DEFAULT_PAGINATION as C, pagination as w } from "./dsl/pagination.es.js";
9
+ import { DEFAULT_CURSOR_SIZE as T, MAX_CURSOR_SIZE as E, MAX_CURSOR_SORT_FIELDS as D, cursorQuery as O } from "./dsl/cursorQuery.es.js";
10
+ import { listQuery as k, pagedList as A, pagedQuery as j, singleQuery as M } from "./dsl/queryable.es.js";
11
+ import { PagingMode as N, QueryConstraintTypes as P, QueryFieldRoles as F, QueryModels as I, QueryValueKind as L, QueryValueTypes as R, SensitivityLevel as z } from "./dsl/descriptor.es.js";
12
+ import { DomainEventStreamMetadataFields as B } from "./client/query/event/domainEventStream.es.js";
13
+ import { SnapshotMetadataFields as V } from "./client/query/snapshot/snapshot.es.js";
14
+ export { i as AGGREGATION_LIMITS, a as AggregationDatePart, o as AggregationDateUnit, s as AggregationExpressionOperator, c as AggregationExpressionType, l as AggregationFunction, u as AggregationGroupType, d as AggregationMetricType, f as ComparisonOperator, T as DEFAULT_CURSOR_SIZE, C as DEFAULT_PAGINATION, p as DateDiffUnit, g as DeletionState, m as DerivedExpressionType, B as DomainEventStreamMetadataFields, e as FilterOperator, h as HavingExpressionType, E as MAX_CURSOR_SIZE, D as MAX_CURSOR_SORT_FIELDS, N as PagingMode, P as QueryConstraintTypes, F as QueryFieldRoles, I as QueryModels, L as QueryValueKind, R as QueryValueTypes, t as SearchMode, z as SensitivityLevel, V as SnapshotMetadataFields, v as SortDirection, n as StringComparison, r as TimeUnit, x as aggregation, y as asc, O as cursorQuery, b as desc, _ as filter, k as listQuery, A as pagedList, j as pagedQuery, w as pagination, S as projection, M as singleQuery };
@@ -0,0 +1,2 @@
1
+ var e=function(e){return e.RECOVERABLE=`RECOVERABLE`,e.UNKNOWN=`UNKNOWN`,e.UNRECOVERABLE=`UNRECOVERABLE`,e}({}),t=Object.freeze({SUCCEEDED:`Ok`,NOT_FOUND:`NotFound`,BAD_REQUEST:`BadRequest`,ILLEGAL_ARGUMENT:`IllegalArgument`,ILLEGAL_STATE:`IllegalState`,REQUEST_TIMEOUT:`RequestTimeout`,TOO_MANY_REQUESTS:`TooManyRequests`,DUPLICATE_REQUEST_ID:`DuplicateRequestId`,COMMAND_VALIDATION:`CommandValidation`,REWRITE_NO_COMMAND:`RewriteNoCommand`,EVENT_VERSION_CONFLICT:`EventVersionConflict`,DUPLICATE_AGGREGATE_ID:`DuplicateAggregateId`,COMMAND_EXPECT_VERSION_CONFLICT:`CommandExpectVersionConflict`,SOURCING_VERSION_CONFLICT:`SourcingVersionConflict`,ILLEGAL_ACCESS_DELETED_AGGREGATE:`IllegalAccessDeletedAggregate`,ILLEGAL_ACCESS_OWNER_AGGREGATE:`IllegalAccessOwnerAggregate`,ILLEGAL_ACCESS_SPACE_AGGREGATE:`IllegalAccessSpaceAggregate`,ILLEGAL_ACCESS_QUERY_SCOPE:`IllegalAccessQueryScope`,INTERNAL_SERVER_ERROR:`InternalServerError`,QUERY_SCHEMA_VALIDATION:`QuerySchemaValidation`,QUERY_SCHEMA_CONFLICT:`QuerySchemaConflict`,QUERY_SCHEMA_UNAVAILABLE:`QuerySchemaUnavailable`,BATCH_TASK_ERROR:`BatchTaskError`});exports.ErrorCodes=t,exports.RecoverableType=e;
2
+ //# sourceMappingURL=errorInfo.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorInfo.cjs","names":["RecoverableType","\"RECOVERABLE\"","\"UNKNOWN\"","\"UNRECOVERABLE\"","ErrorCodes"],"sources":["../../src/error/errorInfo.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 { QueryErrorCode } from './queryErrorCodes.js';\n\n/**\n * Enumerates the types of recoverability for errors or operations, allowing for classification and handling based on whether an error is transient and can be resolved by retrying.\n *\n * The [RecoverableType] enum provides a way to categorize errors into three distinct categories: [RECOVERABLE], [UNRECOVERABLE], and [UNKNOWN].\n * This categorization is essential for implementing robust error handling and retry mechanisms in applications,\n * ensuring that temporary issues are retried while permanent or unknown issues are handled appropriately.\n *\n */\nexport enum RecoverableType {\n /**\n * Represents an error type that indicates the operation or error can be retried.\n *\n * This enum value is used to classify errors in a way that allows for the implementation of retry logic. When an error\n * is marked as [RECOVERABLE], it signifies that the error condition is temporary and might be resolved upon retrying the\n * operation. This is particularly useful in scenarios where network issues, transient server errors, or other temporary\n * conditions may cause an operation to fail, but with a high likelihood of success on subsequent attempts.\n */\n RECOVERABLE = 'RECOVERABLE',\n /**\n * Represents an unknown type of recoverability for an error or operation.\n * This is used when the recoverability of an error cannot be determined or is not specified.\n */\n UNKNOWN = 'UNKNOWN',\n\n /**\n * Represents an error type that indicates the operation or error cannot be retried.\n *\n * This enum value is used to classify errors in a way that signifies the error condition is permanent and retrying the operation will not resolve the issue. It is particularly\n * useful for handling errors where the underlying problem is fundamental and cannot be resolved by simply retrying, such as invalid input, resource exhaustion, or other non-transient\n * issues.\n */\n UNRECOVERABLE = 'UNRECOVERABLE',\n}\n\n/**\n * Represents an error that occurs during the binding process, typically when data is being mapped to or from an object.\n * This class extends the [Named] interface, inheriting the `name` property which can be used to identify the source or context of the error.\n *\n * @param name The name or identifier for the context in which the error occurred.\n * @param msg A message describing the error.\n * @param code A stable, machine-readable code of the failed rule, when the server states one.\n */\nexport interface BindingError {\n name: string;\n msg: string;\n /**\n * A stable, machine-readable code of the rule that failed, when the server\n * states one: a rejected query carries one of {@link QueryErrorCodes}.\n * Absent otherwise, as for a command's validation errors.\n */\n code?: QueryErrorCode;\n}\n\n/**\n * Represents the information about an error, including whether the operation succeeded, the error code, and any associated messages or binding errors.\n *\n * This interface is designed to provide a standardized way of handling and representing errors across different parts of an application. It includes methods to check if the operation was successful, retrieve the error code\n * , and access any additional error details such as messages or binding errors.\n */\nexport interface ErrorInfo {\n /**\n * Represents the error code associated with an error. This value is used to identify the type of error that has occurred,\n * which can be useful for debugging, logging, and handling errors in a standardized way.\n */\n errorCode: ErrorCode;\n /**\n * Represents the message associated with an error. This message provides a human-readable description of the error, which can be used for logging, debugging, or displaying to the user\n * .\n */\n errorMsg: string;\n /**\n * Provides a list of [BindingError] instances that occurred during the binding process.\n * Each [BindingError] contains information about the error, including its name and a message describing the issue.\n * This property returns an empty list if no binding errors are present.\n */\n bindingErrors?: BindingError[];\n}\n\n/**\n * The error codes Wow itself answers with, as `ErrorInfo.errorCode`, as the\n * `Wow-Error-Code` response header, and as the event name of an error in a\n * server-sent event stream.\n *\n * Mirrors `ErrorCodes` in `wow-core/src/main/kotlin/me/ahoo/wow/exception/ErrorCodes.kt`\n * and the query schema and batch codes the server registers beside it.\n * Applications add their own codes; {@link ErrorCode} admits those too.\n */\nexport const ErrorCodes = Object.freeze({\n /** The request succeeded. */\n SUCCEEDED: 'Ok',\n /** The requested resource does not exist (HTTP 404). */\n NOT_FOUND: 'NotFound',\n /** The request is malformed (HTTP 400). */\n BAD_REQUEST: 'BadRequest',\n /** An argument is invalid (HTTP 400). */\n ILLEGAL_ARGUMENT: 'IllegalArgument',\n /** The aggregate is in a state that refuses the command (HTTP 400). */\n ILLEGAL_STATE: 'IllegalState',\n /** The wait timed out (HTTP 408). */\n REQUEST_TIMEOUT: 'RequestTimeout',\n /** The server is rate limiting (HTTP 429). */\n TOO_MANY_REQUESTS: 'TooManyRequests',\n /** The command's request id was used before (HTTP 400). */\n DUPLICATE_REQUEST_ID: 'DuplicateRequestId',\n /** The command failed validation (HTTP 400); see `bindingErrors`. */\n COMMAND_VALIDATION: 'CommandValidation',\n /** A command rewriter produced no command. */\n REWRITE_NO_COMMAND: 'RewriteNoCommand',\n /** Another command changed the aggregate first (HTTP 409). */\n EVENT_VERSION_CONFLICT: 'EventVersionConflict',\n /** The aggregate id already exists (HTTP 400). */\n DUPLICATE_AGGREGATE_ID: 'DuplicateAggregateId',\n /** The aggregate is not at the version the command expected (HTTP 409). */\n COMMAND_EXPECT_VERSION_CONFLICT: 'CommandExpectVersionConflict',\n /** The event stream is not at the version sourcing expected (HTTP 409). */\n SOURCING_VERSION_CONFLICT: 'SourcingVersionConflict',\n /** The aggregate is deleted (HTTP 410). */\n ILLEGAL_ACCESS_DELETED_AGGREGATE: 'IllegalAccessDeletedAggregate',\n /** The aggregate belongs to another owner (HTTP 403). */\n ILLEGAL_ACCESS_OWNER_AGGREGATE: 'IllegalAccessOwnerAggregate',\n /** The aggregate belongs to another space. */\n ILLEGAL_ACCESS_SPACE_AGGREGATE: 'IllegalAccessSpaceAggregate',\n /** A query lacks the authenticated tenant scope the server requires (HTTP 403). */\n ILLEGAL_ACCESS_QUERY_SCOPE: 'IllegalAccessQueryScope',\n /** An unexpected server failure (HTTP 500). */\n INTERNAL_SERVER_ERROR: 'InternalServerError',\n /** A query does not fit the aggregate's query schema (HTTP 400). */\n QUERY_SCHEMA_VALIDATION: 'QuerySchemaValidation',\n /** The query schema conflicts with the stored one (HTTP 500). */\n QUERY_SCHEMA_CONFLICT: 'QuerySchemaConflict',\n /** The query schema is not available yet (HTTP 503). */\n QUERY_SCHEMA_UNAVAILABLE: 'QuerySchemaUnavailable',\n /** A batch task failed. */\n BATCH_TASK_ERROR: 'BatchTaskError',\n} as const);\n\n/** One of the error codes Wow itself defines; see {@link ErrorCodes}. */\nexport type WowErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];\n\n/**\n * An error code: one of Wow's own, which editors complete, or any other an\n * application defines.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type ErrorCode = WowErrorCode | (string & {});\n"],"mappings":"AAuBA,IAAYA,EAAL,SAAA,EAAA,OASL,GAAAC,YAAA,cAKA,EAAAC,QAAA,UASA,EAAAC,cAAA,iBACF,EAAA,CAAA,CAAA,EAuDaC,EAAa,OAAO,OAAO,CAEtC,UAAW,KAEX,UAAW,WAEX,YAAa,aAEb,iBAAkB,kBAElB,cAAe,eAEf,gBAAiB,iBAEjB,kBAAmB,kBAEnB,qBAAsB,qBAEtB,mBAAoB,oBAEpB,mBAAoB,mBAEpB,uBAAwB,uBAExB,uBAAwB,uBAExB,gCAAiC,+BAEjC,0BAA2B,0BAE3B,iCAAkC,gCAElC,+BAAgC,8BAEhC,+BAAgC,8BAEhC,2BAA4B,0BAE5B,sBAAuB,sBAEvB,wBAAyB,wBAEzB,sBAAuB,sBAEvB,yBAA0B,yBAE1B,iBAAkB,gBACpB,CAAU"}
@@ -0,0 +1,139 @@
1
+ import { QueryErrorCode } from './queryErrorCodes.cjs';
2
+ /**
3
+ * Enumerates the types of recoverability for errors or operations, allowing for classification and handling based on whether an error is transient and can be resolved by retrying.
4
+ *
5
+ * The [RecoverableType] enum provides a way to categorize errors into three distinct categories: [RECOVERABLE], [UNRECOVERABLE], and [UNKNOWN].
6
+ * This categorization is essential for implementing robust error handling and retry mechanisms in applications,
7
+ * ensuring that temporary issues are retried while permanent or unknown issues are handled appropriately.
8
+ *
9
+ */
10
+ export declare enum RecoverableType {
11
+ /**
12
+ * Represents an error type that indicates the operation or error can be retried.
13
+ *
14
+ * This enum value is used to classify errors in a way that allows for the implementation of retry logic. When an error
15
+ * is marked as [RECOVERABLE], it signifies that the error condition is temporary and might be resolved upon retrying the
16
+ * operation. This is particularly useful in scenarios where network issues, transient server errors, or other temporary
17
+ * conditions may cause an operation to fail, but with a high likelihood of success on subsequent attempts.
18
+ */
19
+ RECOVERABLE = "RECOVERABLE",
20
+ /**
21
+ * Represents an unknown type of recoverability for an error or operation.
22
+ * This is used when the recoverability of an error cannot be determined or is not specified.
23
+ */
24
+ UNKNOWN = "UNKNOWN",
25
+ /**
26
+ * Represents an error type that indicates the operation or error cannot be retried.
27
+ *
28
+ * This enum value is used to classify errors in a way that signifies the error condition is permanent and retrying the operation will not resolve the issue. It is particularly
29
+ * useful for handling errors where the underlying problem is fundamental and cannot be resolved by simply retrying, such as invalid input, resource exhaustion, or other non-transient
30
+ * issues.
31
+ */
32
+ UNRECOVERABLE = "UNRECOVERABLE"
33
+ }
34
+ /**
35
+ * Represents an error that occurs during the binding process, typically when data is being mapped to or from an object.
36
+ * This class extends the [Named] interface, inheriting the `name` property which can be used to identify the source or context of the error.
37
+ *
38
+ * @param name The name or identifier for the context in which the error occurred.
39
+ * @param msg A message describing the error.
40
+ * @param code A stable, machine-readable code of the failed rule, when the server states one.
41
+ */
42
+ export interface BindingError {
43
+ name: string;
44
+ msg: string;
45
+ /**
46
+ * A stable, machine-readable code of the rule that failed, when the server
47
+ * states one: a rejected query carries one of {@link QueryErrorCodes}.
48
+ * Absent otherwise, as for a command's validation errors.
49
+ */
50
+ code?: QueryErrorCode;
51
+ }
52
+ /**
53
+ * Represents the information about an error, including whether the operation succeeded, the error code, and any associated messages or binding errors.
54
+ *
55
+ * This interface is designed to provide a standardized way of handling and representing errors across different parts of an application. It includes methods to check if the operation was successful, retrieve the error code
56
+ * , and access any additional error details such as messages or binding errors.
57
+ */
58
+ export interface ErrorInfo {
59
+ /**
60
+ * Represents the error code associated with an error. This value is used to identify the type of error that has occurred,
61
+ * which can be useful for debugging, logging, and handling errors in a standardized way.
62
+ */
63
+ errorCode: ErrorCode;
64
+ /**
65
+ * Represents the message associated with an error. This message provides a human-readable description of the error, which can be used for logging, debugging, or displaying to the user
66
+ * .
67
+ */
68
+ errorMsg: string;
69
+ /**
70
+ * Provides a list of [BindingError] instances that occurred during the binding process.
71
+ * Each [BindingError] contains information about the error, including its name and a message describing the issue.
72
+ * This property returns an empty list if no binding errors are present.
73
+ */
74
+ bindingErrors?: BindingError[];
75
+ }
76
+ /**
77
+ * The error codes Wow itself answers with, as `ErrorInfo.errorCode`, as the
78
+ * `Wow-Error-Code` response header, and as the event name of an error in a
79
+ * server-sent event stream.
80
+ *
81
+ * Mirrors `ErrorCodes` in `wow-core/src/main/kotlin/me/ahoo/wow/exception/ErrorCodes.kt`
82
+ * and the query schema and batch codes the server registers beside it.
83
+ * Applications add their own codes; {@link ErrorCode} admits those too.
84
+ */
85
+ export declare const ErrorCodes: Readonly<{
86
+ /** The request succeeded. */
87
+ readonly SUCCEEDED: "Ok";
88
+ /** The requested resource does not exist (HTTP 404). */
89
+ readonly NOT_FOUND: "NotFound";
90
+ /** The request is malformed (HTTP 400). */
91
+ readonly BAD_REQUEST: "BadRequest";
92
+ /** An argument is invalid (HTTP 400). */
93
+ readonly ILLEGAL_ARGUMENT: "IllegalArgument";
94
+ /** The aggregate is in a state that refuses the command (HTTP 400). */
95
+ readonly ILLEGAL_STATE: "IllegalState";
96
+ /** The wait timed out (HTTP 408). */
97
+ readonly REQUEST_TIMEOUT: "RequestTimeout";
98
+ /** The server is rate limiting (HTTP 429). */
99
+ readonly TOO_MANY_REQUESTS: "TooManyRequests";
100
+ /** The command's request id was used before (HTTP 400). */
101
+ readonly DUPLICATE_REQUEST_ID: "DuplicateRequestId";
102
+ /** The command failed validation (HTTP 400); see `bindingErrors`. */
103
+ readonly COMMAND_VALIDATION: "CommandValidation";
104
+ /** A command rewriter produced no command. */
105
+ readonly REWRITE_NO_COMMAND: "RewriteNoCommand";
106
+ /** Another command changed the aggregate first (HTTP 409). */
107
+ readonly EVENT_VERSION_CONFLICT: "EventVersionConflict";
108
+ /** The aggregate id already exists (HTTP 400). */
109
+ readonly DUPLICATE_AGGREGATE_ID: "DuplicateAggregateId";
110
+ /** The aggregate is not at the version the command expected (HTTP 409). */
111
+ readonly COMMAND_EXPECT_VERSION_CONFLICT: "CommandExpectVersionConflict";
112
+ /** The event stream is not at the version sourcing expected (HTTP 409). */
113
+ readonly SOURCING_VERSION_CONFLICT: "SourcingVersionConflict";
114
+ /** The aggregate is deleted (HTTP 410). */
115
+ readonly ILLEGAL_ACCESS_DELETED_AGGREGATE: "IllegalAccessDeletedAggregate";
116
+ /** The aggregate belongs to another owner (HTTP 403). */
117
+ readonly ILLEGAL_ACCESS_OWNER_AGGREGATE: "IllegalAccessOwnerAggregate";
118
+ /** The aggregate belongs to another space. */
119
+ readonly ILLEGAL_ACCESS_SPACE_AGGREGATE: "IllegalAccessSpaceAggregate";
120
+ /** A query lacks the authenticated tenant scope the server requires (HTTP 403). */
121
+ readonly ILLEGAL_ACCESS_QUERY_SCOPE: "IllegalAccessQueryScope";
122
+ /** An unexpected server failure (HTTP 500). */
123
+ readonly INTERNAL_SERVER_ERROR: "InternalServerError";
124
+ /** A query does not fit the aggregate's query schema (HTTP 400). */
125
+ readonly QUERY_SCHEMA_VALIDATION: "QuerySchemaValidation";
126
+ /** The query schema conflicts with the stored one (HTTP 500). */
127
+ readonly QUERY_SCHEMA_CONFLICT: "QuerySchemaConflict";
128
+ /** The query schema is not available yet (HTTP 503). */
129
+ readonly QUERY_SCHEMA_UNAVAILABLE: "QuerySchemaUnavailable";
130
+ /** A batch task failed. */
131
+ readonly BATCH_TASK_ERROR: "BatchTaskError";
132
+ }>;
133
+ /** One of the error codes Wow itself defines; see {@link ErrorCodes}. */
134
+ export type WowErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
135
+ /**
136
+ * An error code: one of Wow's own, which editors complete, or any other an
137
+ * application defines.
138
+ */
139
+ export type ErrorCode = WowErrorCode | (string & {});