@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,139 @@
1
+ import { QueryErrorCode } from './queryErrorCodes.js';
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 & {});
@@ -0,0 +1,32 @@
1
+ //#region src/error/errorInfo.ts
2
+ var e = /* @__PURE__ */ function(e) {
3
+ return e.RECOVERABLE = "RECOVERABLE", e.UNKNOWN = "UNKNOWN", e.UNRECOVERABLE = "UNRECOVERABLE", e;
4
+ }({}), t = Object.freeze({
5
+ SUCCEEDED: "Ok",
6
+ NOT_FOUND: "NotFound",
7
+ BAD_REQUEST: "BadRequest",
8
+ ILLEGAL_ARGUMENT: "IllegalArgument",
9
+ ILLEGAL_STATE: "IllegalState",
10
+ REQUEST_TIMEOUT: "RequestTimeout",
11
+ TOO_MANY_REQUESTS: "TooManyRequests",
12
+ DUPLICATE_REQUEST_ID: "DuplicateRequestId",
13
+ COMMAND_VALIDATION: "CommandValidation",
14
+ REWRITE_NO_COMMAND: "RewriteNoCommand",
15
+ EVENT_VERSION_CONFLICT: "EventVersionConflict",
16
+ DUPLICATE_AGGREGATE_ID: "DuplicateAggregateId",
17
+ COMMAND_EXPECT_VERSION_CONFLICT: "CommandExpectVersionConflict",
18
+ SOURCING_VERSION_CONFLICT: "SourcingVersionConflict",
19
+ ILLEGAL_ACCESS_DELETED_AGGREGATE: "IllegalAccessDeletedAggregate",
20
+ ILLEGAL_ACCESS_OWNER_AGGREGATE: "IllegalAccessOwnerAggregate",
21
+ ILLEGAL_ACCESS_SPACE_AGGREGATE: "IllegalAccessSpaceAggregate",
22
+ ILLEGAL_ACCESS_QUERY_SCOPE: "IllegalAccessQueryScope",
23
+ INTERNAL_SERVER_ERROR: "InternalServerError",
24
+ QUERY_SCHEMA_VALIDATION: "QuerySchemaValidation",
25
+ QUERY_SCHEMA_CONFLICT: "QuerySchemaConflict",
26
+ QUERY_SCHEMA_UNAVAILABLE: "QuerySchemaUnavailable",
27
+ BATCH_TASK_ERROR: "BatchTaskError"
28
+ });
29
+ //#endregion
30
+ export { t as ErrorCodes, e as RecoverableType };
31
+
32
+ //# sourceMappingURL=errorInfo.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorInfo.es.js","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,IAAL,yBAAA,GAAA;QASL,EAAAC,cAAA,eAKA,EAAAC,UAAA,WASA,EAAAC,gBAAA;AACF,EAAA,CAAA,CAAA,GAuDaC,IAAa,OAAO,OAAO;CAEtC,WAAW;CAEX,WAAW;CAEX,aAAa;CAEb,kBAAkB;CAElB,eAAe;CAEf,iBAAiB;CAEjB,mBAAmB;CAEnB,sBAAsB;CAEtB,oBAAoB;CAEpB,oBAAoB;CAEpB,wBAAwB;CAExB,wBAAwB;CAExB,iCAAiC;CAEjC,2BAA2B;CAE3B,kCAAkC;CAElC,gCAAgC;CAEhC,gCAAgC;CAEhC,4BAA4B;CAE5B,uBAAuB;CAEvB,yBAAyB;CAEzB,uBAAuB;CAEvB,0BAA0B;CAE1B,kBAAkB;AACpB,CAAU"}
@@ -0,0 +1,2 @@
1
+ var e=Object.freeze({WOW_HEADERS_PREFIX:`Wow-`,SPACE_ID:`Wow-Space-Id`,ERROR_CODE:`Wow-Error-Code`});exports.WowHeaders=e;
2
+ //# sourceMappingURL=headers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.cjs","names":["WowHeaders"],"sources":["../../src/error/headers.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\n/**\n * HTTP headers the Wow server shares across commands and queries.\n *\n * Mirrors `CommonComponent.Header` in\n * `wow-openapi/src/main/kotlin/me/ahoo/wow/openapi/CommonComponent.kt`.\n * These headers carry the `Wow-` prefix, not the `Command-` prefix of\n * {@link CommandHeaders}. Each value is a string literal type, so a header\n * object keyed by it is checked like one keyed by the literal.\n *\n * @example\n * ```typescript\n * // Send a command into a space\n * await commandClient.send({\n * method: HttpMethod.POST,\n * headers: { [WowHeaders.SPACE_ID]: 'store-1' },\n * body: { ... },\n * });\n * ```\n */\nexport const WowHeaders = Object.freeze({\n /**\n * Prefix of the headers shared across commands and queries\n */\n WOW_HEADERS_PREFIX: 'Wow-',\n\n /**\n * Space identifier request header.\n *\n * On a command route it sets the command's space; on a query route it adds\n * a space filter. It is routing data, not proof that the caller may use\n * that space. The server ignores a blank value.\n */\n SPACE_ID: 'Wow-Space-Id',\n\n /**\n * Error code response header, `Ok` when the request succeeded. A failed\n * request carries the `errorCode` of its `ErrorInfo` body here too.\n */\n ERROR_CODE: 'Wow-Error-Code',\n} as const);\n"],"mappings":"AAgCA,IAAaA,EAAa,OAAO,OAAO,CAItC,mBAAoB,OASpB,SAAU,eAMV,WAAY,gBACd,CAAU"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * HTTP headers the Wow server shares across commands and queries.
3
+ *
4
+ * Mirrors `CommonComponent.Header` in
5
+ * `wow-openapi/src/main/kotlin/me/ahoo/wow/openapi/CommonComponent.kt`.
6
+ * These headers carry the `Wow-` prefix, not the `Command-` prefix of
7
+ * {@link CommandHeaders}. Each value is a string literal type, so a header
8
+ * object keyed by it is checked like one keyed by the literal.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Send a command into a space
13
+ * await commandClient.send({
14
+ * method: HttpMethod.POST,
15
+ * headers: { [WowHeaders.SPACE_ID]: 'store-1' },
16
+ * body: { ... },
17
+ * });
18
+ * ```
19
+ */
20
+ export declare const WowHeaders: Readonly<{
21
+ /**
22
+ * Prefix of the headers shared across commands and queries
23
+ */
24
+ readonly WOW_HEADERS_PREFIX: "Wow-";
25
+ /**
26
+ * Space identifier request header.
27
+ *
28
+ * On a command route it sets the command's space; on a query route it adds
29
+ * a space filter. It is routing data, not proof that the caller may use
30
+ * that space. The server ignores a blank value.
31
+ */
32
+ readonly SPACE_ID: "Wow-Space-Id";
33
+ /**
34
+ * Error code response header, `Ok` when the request succeeded. A failed
35
+ * request carries the `errorCode` of its `ErrorInfo` body here too.
36
+ */
37
+ readonly ERROR_CODE: "Wow-Error-Code";
38
+ }>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * HTTP headers the Wow server shares across commands and queries.
3
+ *
4
+ * Mirrors `CommonComponent.Header` in
5
+ * `wow-openapi/src/main/kotlin/me/ahoo/wow/openapi/CommonComponent.kt`.
6
+ * These headers carry the `Wow-` prefix, not the `Command-` prefix of
7
+ * {@link CommandHeaders}. Each value is a string literal type, so a header
8
+ * object keyed by it is checked like one keyed by the literal.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Send a command into a space
13
+ * await commandClient.send({
14
+ * method: HttpMethod.POST,
15
+ * headers: { [WowHeaders.SPACE_ID]: 'store-1' },
16
+ * body: { ... },
17
+ * });
18
+ * ```
19
+ */
20
+ export declare const WowHeaders: Readonly<{
21
+ /**
22
+ * Prefix of the headers shared across commands and queries
23
+ */
24
+ readonly WOW_HEADERS_PREFIX: "Wow-";
25
+ /**
26
+ * Space identifier request header.
27
+ *
28
+ * On a command route it sets the command's space; on a query route it adds
29
+ * a space filter. It is routing data, not proof that the caller may use
30
+ * that space. The server ignores a blank value.
31
+ */
32
+ readonly SPACE_ID: "Wow-Space-Id";
33
+ /**
34
+ * Error code response header, `Ok` when the request succeeded. A failed
35
+ * request carries the `errorCode` of its `ErrorInfo` body here too.
36
+ */
37
+ readonly ERROR_CODE: "Wow-Error-Code";
38
+ }>;
@@ -0,0 +1,10 @@
1
+ //#region src/error/headers.ts
2
+ var e = Object.freeze({
3
+ WOW_HEADERS_PREFIX: "Wow-",
4
+ SPACE_ID: "Wow-Space-Id",
5
+ ERROR_CODE: "Wow-Error-Code"
6
+ });
7
+ //#endregion
8
+ export { e as WowHeaders };
9
+
10
+ //# sourceMappingURL=headers.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.es.js","names":["WowHeaders"],"sources":["../../src/error/headers.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\n/**\n * HTTP headers the Wow server shares across commands and queries.\n *\n * Mirrors `CommonComponent.Header` in\n * `wow-openapi/src/main/kotlin/me/ahoo/wow/openapi/CommonComponent.kt`.\n * These headers carry the `Wow-` prefix, not the `Command-` prefix of\n * {@link CommandHeaders}. Each value is a string literal type, so a header\n * object keyed by it is checked like one keyed by the literal.\n *\n * @example\n * ```typescript\n * // Send a command into a space\n * await commandClient.send({\n * method: HttpMethod.POST,\n * headers: { [WowHeaders.SPACE_ID]: 'store-1' },\n * body: { ... },\n * });\n * ```\n */\nexport const WowHeaders = Object.freeze({\n /**\n * Prefix of the headers shared across commands and queries\n */\n WOW_HEADERS_PREFIX: 'Wow-',\n\n /**\n * Space identifier request header.\n *\n * On a command route it sets the command's space; on a query route it adds\n * a space filter. It is routing data, not proof that the caller may use\n * that space. The server ignores a blank value.\n */\n SPACE_ID: 'Wow-Space-Id',\n\n /**\n * Error code response header, `Ok` when the request succeeded. A failed\n * request carries the `errorCode` of its `ErrorInfo` body here too.\n */\n ERROR_CODE: 'Wow-Error-Code',\n} as const);\n"],"mappings":";AAgCA,IAAaA,IAAa,OAAO,OAAO;CAItC,oBAAoB;CASpB,UAAU;CAMV,YAAY;AACd,CAAU"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The one shape a Wow server's error takes in an application: `WowError`,
3
+ * carrying the server's `ErrorInfo` (`errorCode`, `errorMsg`,
4
+ * `bindingErrors`) and the HTTP status.
5
+ *
6
+ * It arrives two ways, which meet in `toWowError`:
7
+ * - a server-sent event stream errors with a `WowError` itself when the
8
+ * server sends an error event midway (the extractors of `transport/`);
9
+ * - any other failed request rejects with the fetcher's `ExchangeError`,
10
+ * because the fetcher validates the status before a result extractor runs;
11
+ * `toWowError(error)` reads the `ErrorInfo` body, or the `Wow-Error-Code`
12
+ * header, from a clone of its response.
13
+ *
14
+ * `toWowError` accepts both, so an application handles every server error
15
+ * after one `await toWowError(error)`. Nothing here imports a fetcher
16
+ * package: `toWowError` reads the fetcher error by its shape.
17
+ */
18
+ export * from './errorInfo.cjs';
19
+ export * from './queryErrorCodes.cjs';
20
+ export * from './wowError.cjs';
21
+ export * from './headers.cjs';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The one shape a Wow server's error takes in an application: `WowError`,
3
+ * carrying the server's `ErrorInfo` (`errorCode`, `errorMsg`,
4
+ * `bindingErrors`) and the HTTP status.
5
+ *
6
+ * It arrives two ways, which meet in `toWowError`:
7
+ * - a server-sent event stream errors with a `WowError` itself when the
8
+ * server sends an error event midway (the extractors of `transport/`);
9
+ * - any other failed request rejects with the fetcher's `ExchangeError`,
10
+ * because the fetcher validates the status before a result extractor runs;
11
+ * `toWowError(error)` reads the `ErrorInfo` body, or the `Wow-Error-Code`
12
+ * header, from a clone of its response.
13
+ *
14
+ * `toWowError` accepts both, so an application handles every server error
15
+ * after one `await toWowError(error)`. Nothing here imports a fetcher
16
+ * package: `toWowError` reads the fetcher error by its shape.
17
+ */
18
+ export * from './errorInfo.js';
19
+ export * from './queryErrorCodes.js';
20
+ export * from './wowError.js';
21
+ export * from './headers.js';
@@ -0,0 +1,2 @@
1
+ var e=Object.freeze({INVALID_JSON:`INVALID_JSON`,BODY_NOT_OBJECT:`BODY_NOT_OBJECT`,EMPTY_BODY:`EMPTY_BODY`,UNKNOWN_PROPERTY:`UNKNOWN_PROPERTY`,UNKNOWN_TYPE:`UNKNOWN_TYPE`,UNKNOWN_VALUE:`UNKNOWN_VALUE`,INVALID_VALUE:`INVALID_VALUE`,INVALID_REQUEST:`INVALID_REQUEST`,CURSOR_SORT_DUPLICATE:`CURSOR_SORT_DUPLICATE`,CURSOR_SORT_TOO_MANY:`CURSOR_SORT_TOO_MANY`,INVALID_CURSOR:`INVALID_CURSOR`,SIZE_OUT_OF_RANGE:`SIZE_OUT_OF_RANGE`,FILTER_TOO_LARGE:`FILTER_TOO_LARGE`,EXPENSIVE_OPERATOR_DISABLED:`EXPENSIVE_OPERATOR_DISABLED`,COUNT_REQUIRES_FILTER:`COUNT_REQUIRES_FILTER`,RESIDUAL_GROUPS_EXCEEDED:`RESIDUAL_GROUPS_EXCEEDED`,EXPLICIT_ENTRY_REQUIRED:`EXPLICIT_ENTRY_REQUIRED`,UNKNOWN_FIELD:`UNKNOWN_FIELD`,UNSUPPORTED_CAPABILITY:`UNSUPPORTED_CAPABILITY`,ELEMENT_SCOPE_REQUIRED:`ELEMENT_SCOPE_REQUIRED`,VALUE_MISMATCH:`VALUE_MISMATCH`,NOT_COLLECTION:`NOT_COLLECTION`,NOT_SINGLE_STRING:`NOT_SINGLE_STRING`,MODEL_SEARCH_UNSUPPORTED:`MODEL_SEARCH_UNSUPPORTED`,CURSOR_NOT_ALLOWED:`CURSOR_NOT_ALLOWED`,PROTECTED_AGGREGATION:`PROTECTED_AGGREGATION`,PROTECTED_COMPARISON:`PROTECTED_COMPARISON`,MISSING_KEY_REQUIRES_STRING:`MISSING_KEY_REQUIRES_STRING`,ANY_REQUIRES_SINGLE_VALUE:`ANY_REQUIRES_SINGLE_VALUE`,INCOMPLETE_PROJECTION:`INCOMPLETE_PROJECTION`,METRIC_FILTER_SEARCH:`METRIC_FILTER_SEARCH`,METRIC_FILTER_ELEMENT_MATCH:`METRIC_FILTER_ELEMENT_MATCH`,METRIC_FILTER_ARRAY_FIELD:`METRIC_FILTER_ARRAY_FIELD`,NOT_PROJECTABLE:`NOT_PROJECTABLE`,EVENT_PROJECTION_TYPE_REQUIRED:`EVENT_PROJECTION_TYPE_REQUIRED`,TEMPORAL_REPRESENTATION_REQUIRED:`TEMPORAL_REPRESENTATION_REQUIRED`,TEMPORAL_CONFIGURATION_CONFLICT:`TEMPORAL_CONFIGURATION_CONFLICT`,PARALLEL_ARRAY_SORT:`PARALLEL_ARRAY_SORT`,ARRAY_EQUALITY:`ARRAY_EQUALITY`,FIRST_LAST_REQUIRES_SINGLE_VALUE:`FIRST_LAST_REQUIRES_SINGLE_VALUE`,FIRST_LAST_REQUIRES_ORDER_BY:`FIRST_LAST_REQUIRES_ORDER_BY`,TEMPORAL_AGGREGATION_UNSUPPORTED:`TEMPORAL_AGGREGATION_UNSUPPORTED`,SORT_TOO_MANY:`SORT_TOO_MANY`,SORT_FIELD_DUPLICATE:`SORT_FIELD_DUPLICATE`,IDENTITY_UNDEFINED:`IDENTITY_UNDEFINED`,STORAGE_UNSUPPORTED:`STORAGE_UNSUPPORTED`});exports.QueryErrorCodes=e;
2
+ //# sourceMappingURL=queryErrorCodes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryErrorCodes.cjs","names":["QueryErrorCodes"],"sources":["../../src/error/queryErrorCodes.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\n/**\n * The codes a rejected query carries as `BindingError.code`: which rule the\n * request broke, stable where the human text (`errorMsg`) is not.\n *\n * Mirrors `QueryErrorCodes` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/QueryErrorCodes.kt`, which the\n * server also publishes as the `BindingError.code` enum of its OpenAPI\n * document. The list is open: Wow adds codes and never renames or reuses one,\n * so a client treats a code it does not know as a generic rejection and shows\n * `errorMsg`. {@link QueryErrorCode} admits those codes too.\n *\n * Three groups, which `BindingError.name` locates differently:\n * - decoding the request body (`errorCode` `IllegalArgument`): `name` is the\n * JSON path of the offending value, such as `filter.state` or `metrics[0]`,\n * or `body` for the body as a whole;\n * - the entry's budget and gates (`errorCode` `IllegalArgument`): `name` is\n * the part of the request the rule bounds, such as `limit` or `filter`;\n * - admission against the query model (`errorCode` `QuerySchemaValidation`):\n * `name` is the absolute logical field path, such as `state.items.sku`, or\n * `''` when the rule is about the model rather than one field.\n *\n * Budget and gate rejections carry a code from Wow 9.2 on; an older server\n * answers them with text alone (`HTTP list query limit[...] must be …`). A\n * failure of the server itself is no rejection: it answers HTTP 500\n * `InternalServerError` without a binding error.\n */\nexport const QueryErrorCodes = Object.freeze({\n /** The body is not valid JSON. */\n INVALID_JSON: 'INVALID_JSON',\n /** The body is JSON but not an object. */\n BODY_NOT_OBJECT: 'BODY_NOT_OBJECT',\n /** The body is empty. */\n EMPTY_BODY: 'EMPTY_BODY',\n /** The body has a property the query type does not declare. */\n UNKNOWN_PROPERTY: 'UNKNOWN_PROPERTY',\n /** An `op`, metric or other type discriminator names no known type. */\n UNKNOWN_TYPE: 'UNKNOWN_TYPE',\n /** An enum value is not one the server knows. */\n UNKNOWN_VALUE: 'UNKNOWN_VALUE',\n /** A value is missing or has the wrong JSON type. */\n INVALID_VALUE: 'INVALID_VALUE',\n /** Any other request rule; the message names it. */\n INVALID_REQUEST: 'INVALID_REQUEST',\n /** A cursor sort names a field twice; `path` is the repeated field. */\n CURSOR_SORT_DUPLICATE: 'CURSOR_SORT_DUPLICATE',\n /** A cursor sort has too many fields once the identity tie-breaker is appended. */\n CURSOR_SORT_TOO_MANY: 'CURSOR_SORT_TOO_MANY',\n /**\n * The cursor token was not issued for this model and effective sort, or\n * does not decode; `path` is `cursor`. Start again from the first page.\n */\n INVALID_CURSOR: 'INVALID_CURSOR',\n /**\n * The entry's budget: a list or aggregation `limit`, a page's index, size,\n * window or offset, or a cursor page's `size` is out of range; `path` names\n * which (`limit`, `pagination.size`, `size`, …).\n */\n SIZE_OUT_OF_RANGE: 'SIZE_OUT_OF_RANGE',\n /**\n * The entry's budget: the filter or `having` has too many nodes or values;\n * `path` is `filter` or `having`.\n */\n FILTER_TOO_LARGE: 'FILTER_TOO_LARGE',\n /**\n * The entry does not allow expensive operators, and the query uses one: an\n * operator, an element expansion, a metric sort, an arithmetic or\n * expression group, a date part, a dense fill or FIRST / LAST; `path` names\n * the part (`filter`, `elements`, `sort`, `metrics`, `groupBy`).\n */\n EXPENSIVE_OPERATOR_DISABLED: 'EXPENSIVE_OPERATOR_DISABLED',\n /**\n * A counting query (count, or a paged query's total) would match every\n * record, which the entry refuses; `path` is `filter`.\n */\n COUNT_REQUIRES_FILTER: 'COUNT_REQUIRES_FILTER',\n /**\n * A `having` or metric sort the storage evaluates after grouping read more\n * groups than the server allows; `path` is `body`. It may end a stream\n * partway through.\n */\n RESIDUAL_GROUPS_EXCEEDED: 'RESIDUAL_GROUPS_EXCEEDED',\n /**\n * An in-process query named no entry where one is required. Never\n * answered over HTTP; listed so the mirror stays complete.\n */\n EXPLICIT_ENTRY_REQUIRED: 'EXPLICIT_ENTRY_REQUIRED',\n /** The model has no such logical field. */\n UNKNOWN_FIELD: 'UNKNOWN_FIELD',\n /** The field does not offer the capability the query uses (sort, range, …). */\n UNSUPPORTED_CAPABILITY: 'UNSUPPORTED_CAPABILITY',\n /** The field is an element field and must be queried inside its element scope. */\n ELEMENT_SCOPE_REQUIRED: 'ELEMENT_SCOPE_REQUIRED',\n /** A filter value falls outside the field's declared domain. */\n VALUE_MISMATCH: 'VALUE_MISMATCH',\n /** The field is not a known collection (for example under `isEmpty`). */\n NOT_COLLECTION: 'NOT_COLLECTION',\n /** The field is not a single string. */\n NOT_SINGLE_STRING: 'NOT_SINGLE_STRING',\n /** The model does not support search. */\n MODEL_SEARCH_UNSUPPORTED: 'MODEL_SEARCH_UNSUPPORTED',\n /** The field cannot be used for a cursor. */\n CURSOR_NOT_ALLOWED: 'CURSOR_NOT_ALLOWED',\n /** The field is protected and cannot be aggregated. */\n PROTECTED_AGGREGATION: 'PROTECTED_AGGREGATION',\n /**\n * The field is protected and cannot be filtered or sorted: its descriptor\n * says `sensitivity.comparable: false`. A search that names it is refused\n * the same way.\n */\n PROTECTED_COMPARISON: 'PROTECTED_COMPARISON',\n /** A terms group's `missingKey` needs a single-valued string field. */\n MISSING_KEY_REQUIRES_STRING: 'MISSING_KEY_REQUIRES_STRING',\n /** `ANY` needs a single value. */\n ANY_REQUIRES_SINGLE_VALUE: 'ANY_REQUIRES_SINGLE_VALUE',\n /** The storage cannot deliver a complete projection; select fields explicitly. */\n INCOMPLETE_PROJECTION: 'INCOMPLETE_PROJECTION',\n /** A metric filter uses a search filter. */\n METRIC_FILTER_SEARCH: 'METRIC_FILTER_SEARCH',\n /** A metric filter uses `ELEMENT_MATCH`. */\n METRIC_FILTER_ELEMENT_MATCH: 'METRIC_FILTER_ELEMENT_MATCH',\n /** A metric filter names an array field; it must be scalar. */\n METRIC_FILTER_ARRAY_FIELD: 'METRIC_FILTER_ARRAY_FIELD',\n /** The field cannot be projected. */\n NOT_PROJECTABLE: 'NOT_PROJECTABLE',\n /** An event projection that keeps payloads must keep their `bodyType`. */\n EVENT_PROJECTION_TYPE_REQUIRED: 'EVENT_PROJECTION_TYPE_REQUIRED',\n /** A relative-time filter needs a field with a known temporal representation. */\n TEMPORAL_REPRESENTATION_REQUIRED: 'TEMPORAL_REPRESENTATION_REQUIRED',\n /** A relative-time filter's zone, pattern or unit conflicts with the field's definition. */\n TEMPORAL_CONFIGURATION_CONFLICT: 'TEMPORAL_CONFIGURATION_CONFLICT',\n /**\n * A sort names two array fields on independent arrays, which the storage\n * cannot order by together; `path` is the second of them. The descriptor\n * lists such fields under a `PARALLEL_ARRAY_SORT` constraint.\n */\n PARALLEL_ARRAY_SORT: 'PARALLEL_ARRAY_SORT',\n /**\n * An `EQ` or `NE` compares the field to an array, which the storage cannot\n * do: it takes only a scalar operand. The descriptor says so with an\n * `ARRAY_EQUALITY` constraint.\n */\n ARRAY_EQUALITY: 'ARRAY_EQUALITY',\n /**\n * A `FIRST` or `LAST` metric names a field that may hold several values;\n * it needs a single-valued one (`aggregate.firstLast` in the descriptor).\n */\n FIRST_LAST_REQUIRES_SINGLE_VALUE: 'FIRST_LAST_REQUIRES_SINGLE_VALUE',\n /**\n * A `FIRST` or `LAST` metric names no `orderBy` where there is no event\n * time to order by, such as inside an element or on a model whose\n * descriptor has no `analysis.firstLastOrderBy`; `path` is its field.\n */\n FIRST_LAST_REQUIRES_ORDER_BY: 'FIRST_LAST_REQUIRES_ORDER_BY',\n /**\n * A date group or date difference names a field that stores neither a\n * date nor an epoch (a formatted string, say), so it cannot be aggregated\n * by time.\n */\n TEMPORAL_AGGREGATION_UNSUPPORTED: 'TEMPORAL_AGGREGATION_UNSUPPORTED',\n /** The sort has more fields than the protocol allows; `path` is `''`. */\n SORT_TOO_MANY: 'SORT_TOO_MANY',\n /** Two sort fields name the same stored field; `path` is the second. */\n SORT_FIELD_DUPLICATE: 'SORT_FIELD_DUPLICATE',\n /**\n * An identity filter or a cursor on a model that defines no record\n * identity; `path` is `''`.\n */\n IDENTITY_UNDEFINED: 'IDENTITY_UNDEFINED',\n /**\n * The storage does not support the feature the query uses, or its native\n * query language cannot express it (a MongoDB PHRASE search with a quote,\n * say); `path` is the field, or `''`.\n */\n STORAGE_UNSUPPORTED: 'STORAGE_UNSUPPORTED',\n} as const);\n\n/** One of the codes this package knows; see {@link QueryErrorCodes}. */\nexport type KnownQueryErrorCode =\n (typeof QueryErrorCodes)[keyof typeof QueryErrorCodes];\n\n/**\n * The code of a rejected query: one this package knows, which editors\n * complete, or one a newer server added.\n */\nexport type QueryErrorCode = KnownQueryErrorCode | (string & {});\n\n/**\n * Why the server rejected a request, read from its first binding error that\n * carries a code: which rule failed, where, and the server's words.\n */\nexport interface QueryViolation {\n /** Which rule failed; switch on it against {@link QueryErrorCodes}. */\n code: QueryErrorCode;\n /**\n * Where: the JSON path of the offending value for a decoding error\n * (`filter.state`, `metrics[0]`, `body`), the absolute logical field path\n * for an admission error (`state.items.sku`), or `''` when the rule is about\n * the model rather than a field.\n */\n path: string;\n /** The server's words, the same as the error's `errorMsg`. */\n message: string;\n}\n"],"mappings":"AAuCA,IAAaA,EAAkB,OAAO,OAAO,CAE3C,aAAc,eAEd,gBAAiB,kBAEjB,WAAY,aAEZ,iBAAkB,mBAElB,aAAc,eAEd,cAAe,gBAEf,cAAe,gBAEf,gBAAiB,kBAEjB,sBAAuB,wBAEvB,qBAAsB,uBAKtB,eAAgB,iBAMhB,kBAAmB,oBAKnB,iBAAkB,mBAOlB,4BAA6B,8BAK7B,sBAAuB,wBAMvB,yBAA0B,2BAK1B,wBAAyB,0BAEzB,cAAe,gBAEf,uBAAwB,yBAExB,uBAAwB,yBAExB,eAAgB,iBAEhB,eAAgB,iBAEhB,kBAAmB,oBAEnB,yBAA0B,2BAE1B,mBAAoB,qBAEpB,sBAAuB,wBAMvB,qBAAsB,uBAEtB,4BAA6B,8BAE7B,0BAA2B,4BAE3B,sBAAuB,wBAEvB,qBAAsB,uBAEtB,4BAA6B,8BAE7B,0BAA2B,4BAE3B,gBAAiB,kBAEjB,+BAAgC,iCAEhC,iCAAkC,mCAElC,gCAAiC,kCAMjC,oBAAqB,sBAMrB,eAAgB,iBAKhB,iCAAkC,mCAMlC,6BAA8B,+BAM9B,iCAAkC,mCAElC,cAAe,gBAEf,qBAAsB,uBAKtB,mBAAoB,qBAMpB,oBAAqB,qBACvB,CAAU"}
@@ -0,0 +1,199 @@
1
+ /**
2
+ * The codes a rejected query carries as `BindingError.code`: which rule the
3
+ * request broke, stable where the human text (`errorMsg`) is not.
4
+ *
5
+ * Mirrors `QueryErrorCodes` in
6
+ * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/QueryErrorCodes.kt`, which the
7
+ * server also publishes as the `BindingError.code` enum of its OpenAPI
8
+ * document. The list is open: Wow adds codes and never renames or reuses one,
9
+ * so a client treats a code it does not know as a generic rejection and shows
10
+ * `errorMsg`. {@link QueryErrorCode} admits those codes too.
11
+ *
12
+ * Three groups, which `BindingError.name` locates differently:
13
+ * - decoding the request body (`errorCode` `IllegalArgument`): `name` is the
14
+ * JSON path of the offending value, such as `filter.state` or `metrics[0]`,
15
+ * or `body` for the body as a whole;
16
+ * - the entry's budget and gates (`errorCode` `IllegalArgument`): `name` is
17
+ * the part of the request the rule bounds, such as `limit` or `filter`;
18
+ * - admission against the query model (`errorCode` `QuerySchemaValidation`):
19
+ * `name` is the absolute logical field path, such as `state.items.sku`, or
20
+ * `''` when the rule is about the model rather than one field.
21
+ *
22
+ * Budget and gate rejections carry a code from Wow 9.2 on; an older server
23
+ * answers them with text alone (`HTTP list query limit[...] must be …`). A
24
+ * failure of the server itself is no rejection: it answers HTTP 500
25
+ * `InternalServerError` without a binding error.
26
+ */
27
+ export declare const QueryErrorCodes: Readonly<{
28
+ /** The body is not valid JSON. */
29
+ readonly INVALID_JSON: "INVALID_JSON";
30
+ /** The body is JSON but not an object. */
31
+ readonly BODY_NOT_OBJECT: "BODY_NOT_OBJECT";
32
+ /** The body is empty. */
33
+ readonly EMPTY_BODY: "EMPTY_BODY";
34
+ /** The body has a property the query type does not declare. */
35
+ readonly UNKNOWN_PROPERTY: "UNKNOWN_PROPERTY";
36
+ /** An `op`, metric or other type discriminator names no known type. */
37
+ readonly UNKNOWN_TYPE: "UNKNOWN_TYPE";
38
+ /** An enum value is not one the server knows. */
39
+ readonly UNKNOWN_VALUE: "UNKNOWN_VALUE";
40
+ /** A value is missing or has the wrong JSON type. */
41
+ readonly INVALID_VALUE: "INVALID_VALUE";
42
+ /** Any other request rule; the message names it. */
43
+ readonly INVALID_REQUEST: "INVALID_REQUEST";
44
+ /** A cursor sort names a field twice; `path` is the repeated field. */
45
+ readonly CURSOR_SORT_DUPLICATE: "CURSOR_SORT_DUPLICATE";
46
+ /** A cursor sort has too many fields once the identity tie-breaker is appended. */
47
+ readonly CURSOR_SORT_TOO_MANY: "CURSOR_SORT_TOO_MANY";
48
+ /**
49
+ * The cursor token was not issued for this model and effective sort, or
50
+ * does not decode; `path` is `cursor`. Start again from the first page.
51
+ */
52
+ readonly INVALID_CURSOR: "INVALID_CURSOR";
53
+ /**
54
+ * The entry's budget: a list or aggregation `limit`, a page's index, size,
55
+ * window or offset, or a cursor page's `size` is out of range; `path` names
56
+ * which (`limit`, `pagination.size`, `size`, …).
57
+ */
58
+ readonly SIZE_OUT_OF_RANGE: "SIZE_OUT_OF_RANGE";
59
+ /**
60
+ * The entry's budget: the filter or `having` has too many nodes or values;
61
+ * `path` is `filter` or `having`.
62
+ */
63
+ readonly FILTER_TOO_LARGE: "FILTER_TOO_LARGE";
64
+ /**
65
+ * The entry does not allow expensive operators, and the query uses one: an
66
+ * operator, an element expansion, a metric sort, an arithmetic or
67
+ * expression group, a date part, a dense fill or FIRST / LAST; `path` names
68
+ * the part (`filter`, `elements`, `sort`, `metrics`, `groupBy`).
69
+ */
70
+ readonly EXPENSIVE_OPERATOR_DISABLED: "EXPENSIVE_OPERATOR_DISABLED";
71
+ /**
72
+ * A counting query (count, or a paged query's total) would match every
73
+ * record, which the entry refuses; `path` is `filter`.
74
+ */
75
+ readonly COUNT_REQUIRES_FILTER: "COUNT_REQUIRES_FILTER";
76
+ /**
77
+ * A `having` or metric sort the storage evaluates after grouping read more
78
+ * groups than the server allows; `path` is `body`. It may end a stream
79
+ * partway through.
80
+ */
81
+ readonly RESIDUAL_GROUPS_EXCEEDED: "RESIDUAL_GROUPS_EXCEEDED";
82
+ /**
83
+ * An in-process query named no entry where one is required. Never
84
+ * answered over HTTP; listed so the mirror stays complete.
85
+ */
86
+ readonly EXPLICIT_ENTRY_REQUIRED: "EXPLICIT_ENTRY_REQUIRED";
87
+ /** The model has no such logical field. */
88
+ readonly UNKNOWN_FIELD: "UNKNOWN_FIELD";
89
+ /** The field does not offer the capability the query uses (sort, range, …). */
90
+ readonly UNSUPPORTED_CAPABILITY: "UNSUPPORTED_CAPABILITY";
91
+ /** The field is an element field and must be queried inside its element scope. */
92
+ readonly ELEMENT_SCOPE_REQUIRED: "ELEMENT_SCOPE_REQUIRED";
93
+ /** A filter value falls outside the field's declared domain. */
94
+ readonly VALUE_MISMATCH: "VALUE_MISMATCH";
95
+ /** The field is not a known collection (for example under `isEmpty`). */
96
+ readonly NOT_COLLECTION: "NOT_COLLECTION";
97
+ /** The field is not a single string. */
98
+ readonly NOT_SINGLE_STRING: "NOT_SINGLE_STRING";
99
+ /** The model does not support search. */
100
+ readonly MODEL_SEARCH_UNSUPPORTED: "MODEL_SEARCH_UNSUPPORTED";
101
+ /** The field cannot be used for a cursor. */
102
+ readonly CURSOR_NOT_ALLOWED: "CURSOR_NOT_ALLOWED";
103
+ /** The field is protected and cannot be aggregated. */
104
+ readonly PROTECTED_AGGREGATION: "PROTECTED_AGGREGATION";
105
+ /**
106
+ * The field is protected and cannot be filtered or sorted: its descriptor
107
+ * says `sensitivity.comparable: false`. A search that names it is refused
108
+ * the same way.
109
+ */
110
+ readonly PROTECTED_COMPARISON: "PROTECTED_COMPARISON";
111
+ /** A terms group's `missingKey` needs a single-valued string field. */
112
+ readonly MISSING_KEY_REQUIRES_STRING: "MISSING_KEY_REQUIRES_STRING";
113
+ /** `ANY` needs a single value. */
114
+ readonly ANY_REQUIRES_SINGLE_VALUE: "ANY_REQUIRES_SINGLE_VALUE";
115
+ /** The storage cannot deliver a complete projection; select fields explicitly. */
116
+ readonly INCOMPLETE_PROJECTION: "INCOMPLETE_PROJECTION";
117
+ /** A metric filter uses a search filter. */
118
+ readonly METRIC_FILTER_SEARCH: "METRIC_FILTER_SEARCH";
119
+ /** A metric filter uses `ELEMENT_MATCH`. */
120
+ readonly METRIC_FILTER_ELEMENT_MATCH: "METRIC_FILTER_ELEMENT_MATCH";
121
+ /** A metric filter names an array field; it must be scalar. */
122
+ readonly METRIC_FILTER_ARRAY_FIELD: "METRIC_FILTER_ARRAY_FIELD";
123
+ /** The field cannot be projected. */
124
+ readonly NOT_PROJECTABLE: "NOT_PROJECTABLE";
125
+ /** An event projection that keeps payloads must keep their `bodyType`. */
126
+ readonly EVENT_PROJECTION_TYPE_REQUIRED: "EVENT_PROJECTION_TYPE_REQUIRED";
127
+ /** A relative-time filter needs a field with a known temporal representation. */
128
+ readonly TEMPORAL_REPRESENTATION_REQUIRED: "TEMPORAL_REPRESENTATION_REQUIRED";
129
+ /** A relative-time filter's zone, pattern or unit conflicts with the field's definition. */
130
+ readonly TEMPORAL_CONFIGURATION_CONFLICT: "TEMPORAL_CONFIGURATION_CONFLICT";
131
+ /**
132
+ * A sort names two array fields on independent arrays, which the storage
133
+ * cannot order by together; `path` is the second of them. The descriptor
134
+ * lists such fields under a `PARALLEL_ARRAY_SORT` constraint.
135
+ */
136
+ readonly PARALLEL_ARRAY_SORT: "PARALLEL_ARRAY_SORT";
137
+ /**
138
+ * An `EQ` or `NE` compares the field to an array, which the storage cannot
139
+ * do: it takes only a scalar operand. The descriptor says so with an
140
+ * `ARRAY_EQUALITY` constraint.
141
+ */
142
+ readonly ARRAY_EQUALITY: "ARRAY_EQUALITY";
143
+ /**
144
+ * A `FIRST` or `LAST` metric names a field that may hold several values;
145
+ * it needs a single-valued one (`aggregate.firstLast` in the descriptor).
146
+ */
147
+ readonly FIRST_LAST_REQUIRES_SINGLE_VALUE: "FIRST_LAST_REQUIRES_SINGLE_VALUE";
148
+ /**
149
+ * A `FIRST` or `LAST` metric names no `orderBy` where there is no event
150
+ * time to order by, such as inside an element or on a model whose
151
+ * descriptor has no `analysis.firstLastOrderBy`; `path` is its field.
152
+ */
153
+ readonly FIRST_LAST_REQUIRES_ORDER_BY: "FIRST_LAST_REQUIRES_ORDER_BY";
154
+ /**
155
+ * A date group or date difference names a field that stores neither a
156
+ * date nor an epoch (a formatted string, say), so it cannot be aggregated
157
+ * by time.
158
+ */
159
+ readonly TEMPORAL_AGGREGATION_UNSUPPORTED: "TEMPORAL_AGGREGATION_UNSUPPORTED";
160
+ /** The sort has more fields than the protocol allows; `path` is `''`. */
161
+ readonly SORT_TOO_MANY: "SORT_TOO_MANY";
162
+ /** Two sort fields name the same stored field; `path` is the second. */
163
+ readonly SORT_FIELD_DUPLICATE: "SORT_FIELD_DUPLICATE";
164
+ /**
165
+ * An identity filter or a cursor on a model that defines no record
166
+ * identity; `path` is `''`.
167
+ */
168
+ readonly IDENTITY_UNDEFINED: "IDENTITY_UNDEFINED";
169
+ /**
170
+ * The storage does not support the feature the query uses, or its native
171
+ * query language cannot express it (a MongoDB PHRASE search with a quote,
172
+ * say); `path` is the field, or `''`.
173
+ */
174
+ readonly STORAGE_UNSUPPORTED: "STORAGE_UNSUPPORTED";
175
+ }>;
176
+ /** One of the codes this package knows; see {@link QueryErrorCodes}. */
177
+ export type KnownQueryErrorCode = (typeof QueryErrorCodes)[keyof typeof QueryErrorCodes];
178
+ /**
179
+ * The code of a rejected query: one this package knows, which editors
180
+ * complete, or one a newer server added.
181
+ */
182
+ export type QueryErrorCode = KnownQueryErrorCode | (string & {});
183
+ /**
184
+ * Why the server rejected a request, read from its first binding error that
185
+ * carries a code: which rule failed, where, and the server's words.
186
+ */
187
+ export interface QueryViolation {
188
+ /** Which rule failed; switch on it against {@link QueryErrorCodes}. */
189
+ code: QueryErrorCode;
190
+ /**
191
+ * Where: the JSON path of the offending value for a decoding error
192
+ * (`filter.state`, `metrics[0]`, `body`), the absolute logical field path
193
+ * for an admission error (`state.items.sku`), or `''` when the rule is about
194
+ * the model rather than a field.
195
+ */
196
+ path: string;
197
+ /** The server's words, the same as the error's `errorMsg`. */
198
+ message: string;
199
+ }