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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/README.md +85 -230
  2. package/README.zh-CN.md +74 -209
  3. package/dist/commands.cjs +2 -0
  4. package/dist/commands.cjs.map +1 -0
  5. package/dist/commands.d.cts +123 -0
  6. package/dist/commands.d.ts +123 -0
  7. package/dist/commands.es.js +96 -0
  8. package/dist/commands.es.js.map +1 -0
  9. package/dist/dsl/aggregation/types.cjs.map +1 -1
  10. package/dist/dsl/aggregation/types.d.cts +1 -1
  11. package/dist/dsl/aggregation/types.d.ts +1 -1
  12. package/dist/dsl/aggregation/types.es.js.map +1 -1
  13. package/dist/dsl/cursorQuery.cjs.map +1 -1
  14. package/dist/dsl/cursorQuery.d.cts +7 -8
  15. package/dist/dsl/cursorQuery.d.ts +7 -8
  16. package/dist/dsl/cursorQuery.es.js.map +1 -1
  17. package/dist/dsl/descriptor.cjs.map +1 -1
  18. package/dist/dsl/descriptor.d.cts +8 -1
  19. package/dist/dsl/descriptor.d.ts +8 -1
  20. package/dist/dsl/descriptor.es.js.map +1 -1
  21. package/dist/dsl/documents.d.cts +1 -1
  22. package/dist/dsl/documents.d.ts +1 -1
  23. package/dist/dsl/filter/types.d.cts +2 -1
  24. package/dist/dsl/filter/types.d.ts +2 -1
  25. package/dist/dsl/projection.cjs.map +1 -1
  26. package/dist/dsl/projection.d.cts +22 -0
  27. package/dist/dsl/projection.d.ts +22 -0
  28. package/dist/dsl/projection.es.js.map +1 -1
  29. package/dist/dsl/queryErrorCodes.cjs +2 -0
  30. package/dist/dsl/queryErrorCodes.cjs.map +1 -0
  31. package/dist/{error → dsl}/queryErrorCodes.d.cts +25 -24
  32. package/dist/{error → dsl}/queryErrorCodes.d.ts +25 -24
  33. package/dist/{error → dsl}/queryErrorCodes.es.js +2 -1
  34. package/dist/{error/queryErrorCodes.cjs.map → dsl/queryErrorCodes.es.js.map} +1 -1
  35. package/dist/dsl.cjs +1 -1
  36. package/dist/dsl.d.cts +1 -2
  37. package/dist/dsl.d.ts +1 -2
  38. package/dist/dsl.es.js +2 -3
  39. package/dist/exactJson.cjs +3 -0
  40. package/dist/exactJson.cjs.map +1 -0
  41. package/dist/exactJson.d.cts +54 -0
  42. package/dist/exactJson.d.ts +54 -0
  43. package/dist/exactJson.es.js +213 -0
  44. package/dist/exactJson.es.js.map +1 -0
  45. package/dist/http.cjs +2 -0
  46. package/dist/http.cjs.map +1 -0
  47. package/dist/http.d.cts +96 -0
  48. package/dist/http.d.ts +96 -0
  49. package/dist/http.es.js +77 -0
  50. package/dist/http.es.js.map +1 -0
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.cts +19 -17
  53. package/dist/index.d.ts +19 -17
  54. package/dist/index.es.js +10 -36
  55. package/dist/manifest.cjs +2 -0
  56. package/dist/manifest.cjs.map +1 -0
  57. package/dist/manifest.d.cts +109 -0
  58. package/dist/manifest.d.ts +109 -0
  59. package/dist/manifest.es.js +14 -0
  60. package/dist/manifest.es.js.map +1 -0
  61. package/dist/problem.cjs +2 -0
  62. package/dist/problem.cjs.map +1 -0
  63. package/dist/problem.d.cts +211 -0
  64. package/dist/problem.d.ts +211 -0
  65. package/dist/problem.es.js +138 -0
  66. package/dist/problem.es.js.map +1 -0
  67. package/dist/queries.cjs +2 -0
  68. package/dist/queries.cjs.map +1 -0
  69. package/dist/queries.d.cts +182 -0
  70. package/dist/queries.d.ts +182 -0
  71. package/dist/queries.es.js +112 -0
  72. package/dist/queries.es.js.map +1 -0
  73. package/dist/state.cjs +2 -0
  74. package/dist/state.cjs.map +1 -0
  75. package/dist/state.d.cts +75 -0
  76. package/dist/state.d.ts +75 -0
  77. package/dist/state.es.js +70 -0
  78. package/dist/state.es.js.map +1 -0
  79. package/dist/streams.cjs +2 -0
  80. package/dist/streams.cjs.map +1 -0
  81. package/dist/streams.d.cts +74 -0
  82. package/dist/streams.d.ts +74 -0
  83. package/dist/streams.es.js +103 -0
  84. package/dist/streams.es.js.map +1 -0
  85. package/dist/wait.cjs +2 -0
  86. package/dist/wait.cjs.map +1 -0
  87. package/dist/wait.d.cts +61 -0
  88. package/dist/wait.d.ts +61 -0
  89. package/dist/wait.es.js +44 -0
  90. package/dist/wait.es.js.map +1 -0
  91. package/dist/wire.cjs +2 -0
  92. package/dist/wire.cjs.map +1 -0
  93. package/dist/wire.d.cts +326 -0
  94. package/dist/wire.d.ts +326 -0
  95. package/dist/wire.es.js +10 -0
  96. package/dist/wire.es.js.map +1 -0
  97. package/package.json +4 -16
  98. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs +0 -1
  99. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js +0 -9
  100. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs +0 -1
  101. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js +0 -6
  102. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs +0 -1
  103. package/dist/_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js +0 -8
  104. package/dist/client/bindMethods.cjs +0 -2
  105. package/dist/client/bindMethods.cjs.map +0 -1
  106. package/dist/client/bindMethods.d.cts +0 -13
  107. package/dist/client/bindMethods.d.ts +0 -13
  108. package/dist/client/bindMethods.es.js +0 -19
  109. package/dist/client/bindMethods.es.js.map +0 -1
  110. package/dist/client/command/commandClient.cjs +0 -2
  111. package/dist/client/command/commandClient.cjs.map +0 -1
  112. package/dist/client/command/commandClient.d.cts +0 -67
  113. package/dist/client/command/commandClient.d.ts +0 -67
  114. package/dist/client/command/commandClient.es.js +0 -38
  115. package/dist/client/command/commandClient.es.js.map +0 -1
  116. package/dist/client/command/commandHeaders.cjs +0 -2
  117. package/dist/client/command/commandHeaders.cjs.map +0 -1
  118. package/dist/client/command/commandHeaders.d.cts +0 -75
  119. package/dist/client/command/commandHeaders.d.ts +0 -75
  120. package/dist/client/command/commandHeaders.es.js +0 -31
  121. package/dist/client/command/commandHeaders.es.js.map +0 -1
  122. package/dist/client/command/commandRequest.cjs +0 -2
  123. package/dist/client/command/commandRequest.cjs.map +0 -1
  124. package/dist/client/command/commandRequest.d.cts +0 -180
  125. package/dist/client/command/commandRequest.d.ts +0 -180
  126. package/dist/client/command/commandRequest.es.js +0 -31
  127. package/dist/client/command/commandRequest.es.js.map +0 -1
  128. package/dist/client/command/commandResult.d.cts +0 -15
  129. package/dist/client/command/commandResult.d.ts +0 -15
  130. package/dist/client/command/index.d.cts +0 -5
  131. package/dist/client/command/index.d.ts +0 -5
  132. package/dist/client/command/types.d.cts +0 -71
  133. package/dist/client/command/types.d.ts +0 -71
  134. package/dist/client/metadata/index.d.cts +0 -2
  135. package/dist/client/metadata/index.d.ts +0 -2
  136. package/dist/client/metadata/wowMetadata.d.cts +0 -48
  137. package/dist/client/metadata/wowMetadata.d.ts +0 -48
  138. package/dist/client/metadata/wowMetadataClient.cjs +0 -2
  139. package/dist/client/metadata/wowMetadataClient.cjs.map +0 -1
  140. package/dist/client/metadata/wowMetadataClient.d.cts +0 -23
  141. package/dist/client/metadata/wowMetadataClient.d.ts +0 -23
  142. package/dist/client/metadata/wowMetadataClient.es.js +0 -25
  143. package/dist/client/metadata/wowMetadataClient.es.js.map +0 -1
  144. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs +0 -2
  145. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs.map +0 -1
  146. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.cts +0 -8
  147. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.ts +0 -8
  148. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js +0 -34
  149. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js.map +0 -1
  150. package/dist/client/query/dataset/datasetDirectoryClient.cjs +0 -2
  151. package/dist/client/query/dataset/datasetDirectoryClient.cjs.map +0 -1
  152. package/dist/client/query/dataset/datasetDirectoryClient.d.cts +0 -29
  153. package/dist/client/query/dataset/datasetDirectoryClient.d.ts +0 -29
  154. package/dist/client/query/dataset/datasetDirectoryClient.es.js +0 -25
  155. package/dist/client/query/dataset/datasetDirectoryClient.es.js.map +0 -1
  156. package/dist/client/query/dataset/datasetQueryApi.d.cts +0 -40
  157. package/dist/client/query/dataset/datasetQueryApi.d.ts +0 -40
  158. package/dist/client/query/dataset/datasetQueryClient.cjs +0 -2
  159. package/dist/client/query/dataset/datasetQueryClient.cjs.map +0 -1
  160. package/dist/client/query/dataset/datasetQueryClient.d.cts +0 -57
  161. package/dist/client/query/dataset/datasetQueryClient.d.ts +0 -57
  162. package/dist/client/query/dataset/datasetQueryClient.es.js +0 -154
  163. package/dist/client/query/dataset/datasetQueryClient.es.js.map +0 -1
  164. package/dist/client/query/dataset/endpointPaths.cjs +0 -2
  165. package/dist/client/query/dataset/endpointPaths.cjs.map +0 -1
  166. package/dist/client/query/dataset/endpointPaths.d.cts +0 -9
  167. package/dist/client/query/dataset/endpointPaths.d.ts +0 -9
  168. package/dist/client/query/dataset/endpointPaths.es.js +0 -14
  169. package/dist/client/query/dataset/endpointPaths.es.js.map +0 -1
  170. package/dist/client/query/dataset/index.d.cts +0 -3
  171. package/dist/client/query/dataset/index.d.ts +0 -3
  172. package/dist/client/query/descriptor/descriptorEndpoints.cjs +0 -2
  173. package/dist/client/query/descriptor/descriptorEndpoints.cjs.map +0 -1
  174. package/dist/client/query/descriptor/descriptorEndpoints.d.cts +0 -29
  175. package/dist/client/query/descriptor/descriptorEndpoints.d.ts +0 -29
  176. package/dist/client/query/descriptor/descriptorEndpoints.es.js +0 -69
  177. package/dist/client/query/descriptor/descriptorEndpoints.es.js.map +0 -1
  178. package/dist/client/query/descriptor/endpointPaths.cjs +0 -2
  179. package/dist/client/query/descriptor/endpointPaths.cjs.map +0 -1
  180. package/dist/client/query/descriptor/endpointPaths.d.cts +0 -4
  181. package/dist/client/query/descriptor/endpointPaths.d.ts +0 -4
  182. package/dist/client/query/descriptor/endpointPaths.es.js +0 -9
  183. package/dist/client/query/descriptor/endpointPaths.es.js.map +0 -1
  184. package/dist/client/query/descriptor/index.d.cts +0 -2
  185. package/dist/client/query/descriptor/index.d.ts +0 -2
  186. package/dist/client/query/descriptor/queryDescriptorApi.d.cts +0 -58
  187. package/dist/client/query/descriptor/queryDescriptorApi.d.ts +0 -58
  188. package/dist/client/query/descriptor/queryDescriptorClient.cjs +0 -2
  189. package/dist/client/query/descriptor/queryDescriptorClient.cjs.map +0 -1
  190. package/dist/client/query/descriptor/queryDescriptorClient.d.cts +0 -61
  191. package/dist/client/query/descriptor/queryDescriptorClient.d.ts +0 -61
  192. package/dist/client/query/descriptor/queryDescriptorClient.es.js +0 -20
  193. package/dist/client/query/descriptor/queryDescriptorClient.es.js.map +0 -1
  194. package/dist/client/query/event/endpointPaths.cjs +0 -2
  195. package/dist/client/query/event/endpointPaths.cjs.map +0 -1
  196. package/dist/client/query/event/endpointPaths.d.cts +0 -8
  197. package/dist/client/query/event/endpointPaths.d.ts +0 -8
  198. package/dist/client/query/event/endpointPaths.es.js +0 -13
  199. package/dist/client/query/event/endpointPaths.es.js.map +0 -1
  200. package/dist/client/query/event/eventStreamQueryApi.d.cts +0 -29
  201. package/dist/client/query/event/eventStreamQueryApi.d.ts +0 -29
  202. package/dist/client/query/event/eventStreamQueryClient.cjs +0 -2
  203. package/dist/client/query/event/eventStreamQueryClient.cjs.map +0 -1
  204. package/dist/client/query/event/eventStreamQueryClient.d.cts +0 -193
  205. package/dist/client/query/event/eventStreamQueryClient.d.ts +0 -193
  206. package/dist/client/query/event/eventStreamQueryClient.es.js +0 -160
  207. package/dist/client/query/event/eventStreamQueryClient.es.js.map +0 -1
  208. package/dist/client/query/event/index.d.cts +0 -2
  209. package/dist/client/query/event/index.d.ts +0 -2
  210. package/dist/client/query/factory.cjs +0 -2
  211. package/dist/client/query/factory.cjs.map +0 -1
  212. package/dist/client/query/factory.d.cts +0 -165
  213. package/dist/client/query/factory.d.ts +0 -165
  214. package/dist/client/query/factory.es.js +0 -45
  215. package/dist/client/query/factory.es.js.map +0 -1
  216. package/dist/client/query/index.d.cts +0 -7
  217. package/dist/client/query/index.d.ts +0 -7
  218. package/dist/client/query/queryApi.d.cts +0 -68
  219. package/dist/client/query/queryApi.d.ts +0 -68
  220. package/dist/client/query/requests.d.cts +0 -24
  221. package/dist/client/query/requests.d.ts +0 -24
  222. package/dist/client/query/snapshot/endpointPaths.cjs +0 -2
  223. package/dist/client/query/snapshot/endpointPaths.cjs.map +0 -1
  224. package/dist/client/query/snapshot/endpointPaths.d.cts +0 -12
  225. package/dist/client/query/snapshot/endpointPaths.d.ts +0 -12
  226. package/dist/client/query/snapshot/endpointPaths.es.js +0 -17
  227. package/dist/client/query/snapshot/endpointPaths.es.js.map +0 -1
  228. package/dist/client/query/snapshot/index.d.cts +0 -2
  229. package/dist/client/query/snapshot/index.d.ts +0 -2
  230. package/dist/client/query/snapshot/snapshotQueryApi.d.cts +0 -101
  231. package/dist/client/query/snapshot/snapshotQueryApi.d.ts +0 -101
  232. package/dist/client/query/snapshot/snapshotQueryClient.cjs +0 -2
  233. package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +0 -1
  234. package/dist/client/query/snapshot/snapshotQueryClient.d.cts +0 -372
  235. package/dist/client/query/snapshot/snapshotQueryClient.d.ts +0 -372
  236. package/dist/client/query/snapshot/snapshotQueryClient.es.js +0 -239
  237. package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +0 -1
  238. package/dist/client/query/state/endpointPaths.cjs +0 -2
  239. package/dist/client/query/state/endpointPaths.cjs.map +0 -1
  240. package/dist/client/query/state/endpointPaths.d.cts +0 -10
  241. package/dist/client/query/state/endpointPaths.d.ts +0 -10
  242. package/dist/client/query/state/endpointPaths.es.js +0 -14
  243. package/dist/client/query/state/endpointPaths.es.js.map +0 -1
  244. package/dist/client/query/state/index.d.cts +0 -4
  245. package/dist/client/query/state/index.d.ts +0 -4
  246. package/dist/client/query/state/loadOwnerStateAggregateApi.d.cts +0 -36
  247. package/dist/client/query/state/loadOwnerStateAggregateApi.d.ts +0 -36
  248. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs +0 -2
  249. package/dist/client/query/state/loadOwnerStateAggregateClient.cjs.map +0 -1
  250. package/dist/client/query/state/loadOwnerStateAggregateClient.d.cts +0 -58
  251. package/dist/client/query/state/loadOwnerStateAggregateClient.d.ts +0 -58
  252. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js +0 -56
  253. package/dist/client/query/state/loadOwnerStateAggregateClient.es.js.map +0 -1
  254. package/dist/client/query/state/loadStateAggregateApi.d.cts +0 -37
  255. package/dist/client/query/state/loadStateAggregateApi.d.ts +0 -37
  256. package/dist/client/query/state/loadStateAggregateClient.cjs +0 -2
  257. package/dist/client/query/state/loadStateAggregateClient.cjs.map +0 -1
  258. package/dist/client/query/state/loadStateAggregateClient.d.cts +0 -62
  259. package/dist/client/query/state/loadStateAggregateClient.d.ts +0 -62
  260. package/dist/client/query/state/loadStateAggregateClient.es.js +0 -65
  261. package/dist/client/query/state/loadStateAggregateClient.es.js.map +0 -1
  262. package/dist/client/routing.cjs +0 -2
  263. package/dist/client/routing.cjs.map +0 -1
  264. package/dist/client/routing.d.cts +0 -47
  265. package/dist/client/routing.d.ts +0 -47
  266. package/dist/client/routing.es.js +0 -8
  267. package/dist/client/routing.es.js.map +0 -1
  268. package/dist/error/errorInfo.cjs +0 -2
  269. package/dist/error/errorInfo.cjs.map +0 -1
  270. package/dist/error/errorInfo.d.cts +0 -139
  271. package/dist/error/errorInfo.d.ts +0 -139
  272. package/dist/error/errorInfo.es.js +0 -32
  273. package/dist/error/errorInfo.es.js.map +0 -1
  274. package/dist/error/headers.cjs +0 -2
  275. package/dist/error/headers.cjs.map +0 -1
  276. package/dist/error/headers.d.cts +0 -39
  277. package/dist/error/headers.d.ts +0 -39
  278. package/dist/error/headers.es.js +0 -10
  279. package/dist/error/headers.es.js.map +0 -1
  280. package/dist/error/index.d.cts +0 -21
  281. package/dist/error/index.d.ts +0 -21
  282. package/dist/error/queryErrorCodes.cjs +0 -2
  283. package/dist/error/queryErrorCodes.es.js.map +0 -1
  284. package/dist/error/wowError.cjs +0 -2
  285. package/dist/error/wowError.cjs.map +0 -1
  286. package/dist/error/wowError.d.cts +0 -99
  287. package/dist/error/wowError.d.ts +0 -99
  288. package/dist/error/wowError.es.js +0 -53
  289. package/dist/error/wowError.es.js.map +0 -1
  290. package/dist/legacy/condition.cjs +0 -2
  291. package/dist/legacy/condition.cjs.map +0 -1
  292. package/dist/legacy/condition.d.cts +0 -517
  293. package/dist/legacy/condition.d.ts +0 -517
  294. package/dist/legacy/condition.es.js +0 -338
  295. package/dist/legacy/condition.es.js.map +0 -1
  296. package/dist/legacy/index.d.cts +0 -16
  297. package/dist/legacy/index.d.ts +0 -16
  298. package/dist/legacy/locale/en_US.cjs +0 -2
  299. package/dist/legacy/locale/en_US.cjs.map +0 -1
  300. package/dist/legacy/locale/en_US.d.cts +0 -7
  301. package/dist/legacy/locale/en_US.d.ts +0 -7
  302. package/dist/legacy/locale/en_US.es.js +0 -50
  303. package/dist/legacy/locale/en_US.es.js.map +0 -1
  304. package/dist/legacy/locale/operatorLocale.d.cts +0 -10
  305. package/dist/legacy/locale/operatorLocale.d.ts +0 -10
  306. package/dist/legacy/locale/zh_CN.cjs +0 -2
  307. package/dist/legacy/locale/zh_CN.cjs.map +0 -1
  308. package/dist/legacy/locale/zh_CN.d.cts +0 -7
  309. package/dist/legacy/locale/zh_CN.d.ts +0 -7
  310. package/dist/legacy/locale/zh_CN.es.js +0 -50
  311. package/dist/legacy/locale/zh_CN.es.js.map +0 -1
  312. package/dist/legacy/operator.cjs +0 -2
  313. package/dist/legacy/operator.cjs.map +0 -1
  314. package/dist/legacy/operator.d.cts +0 -218
  315. package/dist/legacy/operator.d.ts +0 -218
  316. package/dist/legacy/operator.es.js +0 -25
  317. package/dist/legacy/operator.es.js.map +0 -1
  318. package/dist/legacy/queryable.cjs +0 -2
  319. package/dist/legacy/queryable.cjs.map +0 -1
  320. package/dist/legacy/queryable.d.cts +0 -61
  321. package/dist/legacy/queryable.d.ts +0 -61
  322. package/dist/legacy/queryable.es.js +0 -34
  323. package/dist/legacy/queryable.es.js.map +0 -1
  324. package/dist/legacy.cjs +0 -1
  325. package/dist/legacy.es.js +0 -6
  326. package/dist/model/abac.cjs +0 -2
  327. package/dist/model/abac.cjs.map +0 -1
  328. package/dist/model/abac.d.cts +0 -33
  329. package/dist/model/abac.d.ts +0 -33
  330. package/dist/model/abac.es.js +0 -6
  331. package/dist/model/abac.es.js.map +0 -1
  332. package/dist/model/bi.cjs +0 -2
  333. package/dist/model/bi.cjs.map +0 -1
  334. package/dist/model/bi.d.cts +0 -12
  335. package/dist/model/bi.d.ts +0 -12
  336. package/dist/model/bi.es.js +0 -8
  337. package/dist/model/bi.es.js.map +0 -1
  338. package/dist/model/command.cjs +0 -2
  339. package/dist/model/command.cjs.map +0 -1
  340. package/dist/model/command.d.cts +0 -137
  341. package/dist/model/command.d.ts +0 -137
  342. package/dist/model/command.es.js +0 -8
  343. package/dist/model/command.es.js.map +0 -1
  344. package/dist/model/common.d.cts +0 -19
  345. package/dist/model/common.d.ts +0 -19
  346. package/dist/model/domainEventStream.cjs +0 -2
  347. package/dist/model/domainEventStream.cjs.map +0 -1
  348. package/dist/model/domainEventStream.d.cts +0 -109
  349. package/dist/model/domainEventStream.d.ts +0 -109
  350. package/dist/model/domainEventStream.es.js +0 -23
  351. package/dist/model/domainEventStream.es.js.map +0 -1
  352. package/dist/model/function.cjs +0 -2
  353. package/dist/model/function.cjs.map +0 -1
  354. package/dist/model/function.d.cts +0 -41
  355. package/dist/model/function.d.ts +0 -41
  356. package/dist/model/function.es.js +0 -8
  357. package/dist/model/function.es.js.map +0 -1
  358. package/dist/model/index.d.cts +0 -24
  359. package/dist/model/index.d.ts +0 -24
  360. package/dist/model/messaging.d.cts +0 -5
  361. package/dist/model/messaging.d.ts +0 -5
  362. package/dist/model/modeling.d.cts +0 -145
  363. package/dist/model/modeling.d.ts +0 -145
  364. package/dist/model/naming.d.cts +0 -27
  365. package/dist/model/naming.d.ts +0 -27
  366. package/dist/model/snapshot.cjs +0 -2
  367. package/dist/model/snapshot.cjs.map +0 -1
  368. package/dist/model/snapshot.d.cts +0 -53
  369. package/dist/model/snapshot.d.ts +0 -53
  370. package/dist/model/snapshot.es.js +0 -20
  371. package/dist/model/snapshot.es.js.map +0 -1
  372. package/dist/transport/endpoints.cjs +0 -2
  373. package/dist/transport/endpoints.cjs.map +0 -1
  374. package/dist/transport/endpoints.d.cts +0 -79
  375. package/dist/transport/endpoints.d.ts +0 -79
  376. package/dist/transport/endpoints.es.js +0 -14
  377. package/dist/transport/endpoints.es.js.map +0 -1
  378. package/dist/transport/eventStreams.cjs +0 -2
  379. package/dist/transport/eventStreams.cjs.map +0 -1
  380. package/dist/transport/eventStreams.d.cts +0 -25
  381. package/dist/transport/eventStreams.d.ts +0 -25
  382. package/dist/transport/eventStreams.es.js +0 -21
  383. package/dist/transport/eventStreams.es.js.map +0 -1
  384. package/dist/transport/index.d.cts +0 -1
  385. package/dist/transport/index.d.ts +0 -1
@@ -1,9 +0,0 @@
1
- export declare const DatasetQueryEndpointPaths: Readonly<{
2
- readonly SCHEMA: "schema";
3
- readonly AGGREGATION: "aggregation";
4
- readonly COUNT: "count";
5
- readonly LIST: "list";
6
- readonly PAGED: "paged";
7
- readonly CURSOR: "cursor";
8
- readonly SINGLE: "single";
9
- }>;
@@ -1,9 +0,0 @@
1
- export declare const DatasetQueryEndpointPaths: Readonly<{
2
- readonly SCHEMA: "schema";
3
- readonly AGGREGATION: "aggregation";
4
- readonly COUNT: "count";
5
- readonly LIST: "list";
6
- readonly PAGED: "paged";
7
- readonly CURSOR: "cursor";
8
- readonly SINGLE: "single";
9
- }>;
@@ -1,14 +0,0 @@
1
- //#region src/client/query/dataset/endpointPaths.ts
2
- var e = Object.freeze({
3
- SCHEMA: "schema",
4
- AGGREGATION: "aggregation",
5
- COUNT: "count",
6
- LIST: "list",
7
- PAGED: "paged",
8
- CURSOR: "cursor",
9
- SINGLE: "single"
10
- });
11
- //#endregion
12
- export { e as DatasetQueryEndpointPaths };
13
-
14
- //# sourceMappingURL=endpointPaths.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpointPaths.es.js","names":["DatasetQueryEndpointPaths"],"sources":["../../../../src/client/query/dataset/endpointPaths.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// Internal: the index of this folder does not re-export this file. The\n// paths are relative to the client's base path, `dataset/{context}/{dataset}`.\nexport const DatasetQueryEndpointPaths = Object.freeze({\n SCHEMA: 'schema',\n AGGREGATION: 'aggregation',\n COUNT: 'count',\n LIST: 'list',\n PAGED: 'paged',\n CURSOR: 'cursor',\n SINGLE: 'single',\n} as const);\n"],"mappings":";AAeA,IAAaA,IAA4B,OAAO,OAAO;CACrD,QAAQ;CACR,aAAa;CACb,OAAO;CACP,MAAM;CACN,OAAO;CACP,QAAQ;CACR,QAAQ;AACV,CAAU"}
@@ -1,3 +0,0 @@
1
- export * from './datasetQueryApi.cjs';
2
- export * from './datasetQueryClient.cjs';
3
- export * from './datasetDirectoryClient.cjs';
@@ -1,3 +0,0 @@
1
- export * from './datasetQueryApi.js';
2
- export * from './datasetQueryClient.js';
3
- export * from './datasetDirectoryClient.js';
@@ -1,2 +0,0 @@
1
- const e=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.cjs"),t=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.cjs"),n=require("../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.cjs"),r=require("./endpointPaths.cjs");let i=require("@ahoo-wang/fetcher"),a=require("@ahoo-wang/fetcher-decorator");var o=Object.freeze({resultExtractor:i.ExchangeResultExtractor,attributes:Object.freeze({[i.IGNORE_VALIDATE_STATUS]:!0})}),s=class{constructor(e){this.apiMetadata=e}snapshot(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}eventStream(e,t,n){throw(0,a.autoGeneratedError)(e,t,n)}};n.default([(0,a.get)(r.QueryDescriptorEndpointPaths.SNAPSHOT,o),t.default(0,(0,a.header)(`If-None-Match`)),t.default(1,(0,a.attribute)()),e.default(`design:type`,Function),e.default(`design:paramtypes`,[String,typeof Record>`u`?Object:Record,Object]),e.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`snapshot`,null),n.default([(0,a.get)(r.QueryDescriptorEndpointPaths.EVENT_STREAM,o),t.default(0,(0,a.header)(`If-None-Match`)),t.default(1,(0,a.attribute)()),e.default(`design:type`,Function),e.default(`design:paramtypes`,[String,typeof Record>`u`?Object:Record,Object]),e.default(`design:returntype`,typeof Promise>`u`?Object:Promise)],s.prototype,`eventStream`,null),s=n.default([(0,a.api)(),e.default(`design:paramtypes`,[Object])],s);function c(e){return e?.trim().replace(/^W\//,``).replace(/^"(.*)"$/,`$1`)||void 0}function l(e){return e===void 0?void 0:`"${e}"`}async function u(e,t){let n=e.requiredResponse;if(n.status===304&&t!==void 0)return{notModified:!0,version:t};if(!n.ok)throw new i.HttpStatusValidationError(e);let r=await n.json();return{notModified:!1,descriptor:r,version:r.version}}Object.defineProperty(exports,"QueryDescriptorEndpoints",{enumerable:!0,get:function(){return s}}),exports.descriptorVersion=c,exports.ifNoneMatch=l,exports.readDescriptor=u;
2
- //# sourceMappingURL=descriptorEndpoints.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"descriptorEndpoints.cjs","names":["ExchangeResultExtractor","IGNORE_VALIDATE_STATUS","autoGeneratedError","_decorate","get","QueryDescriptorEndpointPaths","_decorateParam","header","attribute","_decorateMetadata","api","HttpStatusValidationError","require_decorateMetadata","require_decorateParam","require_decorate","require_endpointPaths","_ahoo_wang_fetcher","_ahoo_wang_fetcher_decorator","DESCRIPTOR_ENDPOINT","QueryDescriptorEndpoints","apiMetadata","ifNoneMatch","attributes","abort","descriptorVersion","previous","version","readDescriptor","response","exchange","descriptor"],"sources":["../../../../src/client/query/descriptor/descriptorEndpoints.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// Internal: the index of this folder does not re-export this file.\n\nimport {\n ExchangeResultExtractor,\n type FetchExchange,\n HttpStatusValidationError,\n IGNORE_VALIDATE_STATUS,\n} from '@ahoo-wang/fetcher';\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n header,\n} from '@ahoo-wang/fetcher-decorator';\nimport type { QueryModelDescriptor } from '../../../dsl/descriptor.js';\nimport type { QueryDescriptorResult } from './queryDescriptorApi.js';\nimport { QueryDescriptorEndpointPaths } from './endpointPaths.js';\n\n/**\n * The endpoints answer the exchange with its status unchecked, so a 304 is\n * not an error; {@link readDescriptor} checks the status instead.\n */\nconst DESCRIPTOR_ENDPOINT = Object.freeze({\n resultExtractor: ExchangeResultExtractor,\n attributes: Object.freeze({ [IGNORE_VALIDATE_STATUS]: true }),\n});\n\n/**\n * The decorated requests behind `QueryDescriptorClient`, which turns the\n * version it is given into an ETag before they run.\n */\n@api()\nexport class QueryDescriptorEndpoints implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {}\n\n @get(QueryDescriptorEndpointPaths.SNAPSHOT, DESCRIPTOR_ENDPOINT)\n /* v8 ignore start */\n snapshot(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n\n @get(QueryDescriptorEndpointPaths.EVENT_STREAM, DESCRIPTOR_ENDPOINT)\n /* v8 ignore start */\n eventStream(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n}\n\n/**\n * The version a descriptor version or an ETag names: `sha256:…`,\n * `\"sha256:…\"` and `W/\"sha256:…\"` all name `sha256:…`. `undefined` for\n * nothing, or only blanks.\n */\nexport function descriptorVersion(previous?: string): string | undefined {\n const version = previous\n ?.trim()\n .replace(/^W\\//, '')\n .replace(/^\"(.*)\"$/, '$1');\n return version ? version : undefined;\n}\n\n/**\n * The `If-None-Match` value for `version`: the ETag the server sends, which it\n * compares as it is.\n */\nexport function ifNoneMatch(version?: string): string | undefined {\n return version === undefined ? undefined : `\"${version}\"`;\n}\n\n/**\n * What an exchange answers: 304 means the version sent is current; any other\n * status outside 2xx rejects with the error the fetcher would have thrown.\n */\nexport async function readDescriptor(\n exchange: FetchExchange,\n version: string | undefined,\n): Promise<QueryDescriptorResult> {\n const response = exchange.requiredResponse;\n if (response.status === 304 && version !== undefined)\n return { notModified: true, version };\n if (!response.ok) throw new HttpStatusValidationError(exchange);\n const descriptor = (await response.json()) as QueryModelDescriptor;\n return { notModified: false, descriptor, version: descriptor.version };\n}\n"],"mappings":"oYAwCA,IAAMkB,EAAsB,OAAO,OAAO,CACxC,gBAAiBlB,EAAAA,wBACjB,WAAY,OAAO,OAAO,EAAGC,EAAAA,wBAAyB,EAAK,CAAC,CAC9D,CAAC,EAOYkB,EAAN,KAA6D,CAClE,YAAY,EAA2C,CAA3B,KAAA,YAAAC,CAA4B,CAExD,SAGE,EACA,EACA,EACwB,CACxB,MAAA,EAAMlB,EAAAA,mBAAAA,CAAmBmB,EAAaC,EAAYC,CAAK,CACzD,CAGA,YAGE,EACA,EACA,EACwB,CACxB,MAAA,EAAMrB,EAAAA,mBAAAA,CAAmBmB,EAAaC,EAAYC,CAAK,CACzD,CAEF,cArBGnB,EAAAA,EAAAA,IAAAA,CAAIC,EAAAA,6BAA6B,SAAUa,CAAmB,EAG5DZ,EAAAA,QAAA,GAAA,EAAAC,EAAAA,OAAAA,CAAO,eAAe,CAAA,EACtBD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,8NAOZJ,EAAAA,EAAAA,IAAAA,CAAIC,EAAAA,6BAA6B,aAAca,CAAmB,EAGhEZ,EAAAA,QAAA,GAAA,EAAAC,EAAAA,OAAAA,CAAO,eAAe,CAAA,EACtBD,EAAAA,QAAA,GAAA,EAAAE,EAAAA,UAAAA,CAAU,CAAA,qNAnBd,EAAAL,EAAAA,QAAA,EAAA,EAAAO,EAAAA,IAAAA,CAAI,EAAAD,EAAAA,QAAA,oBAAA,CAAA,MAAA,CAAA,CAAA,EAAAU,CAAA,EAgCL,SAAgBK,EAAkB,EAAuC,CAKvE,OAJgBC,GACZ,KAAK,CAAC,CACP,QAAQ,OAAQ,EAAE,CAAC,CACnB,QAAQ,WAAY,IAAI,GACA,IAAA,EAC7B,CAMA,SAAgBJ,EAAY,EAAsC,CAChE,OAAOK,IAAY,IAAA,GAAY,IAAA,GAAY,IAAIA,EAAQ,EACzD,CAMA,eAAsBC,EACpB,EACA,EACgC,CAChC,IAAMC,EAAWC,EAAS,iBAC1B,GAAID,EAAS,SAAW,KAAOF,IAAY,IAAA,GACzC,MAAO,CAAE,YAAa,GAAM,SAAQ,EACtC,GAAI,CAACE,EAAS,GAAI,MAAM,IAAIjB,EAAAA,0BAA0BkB,CAAQ,EAC9D,IAAMC,EAAc,MAAMF,EAAS,KAAK,EACxC,MAAO,CAAE,YAAa,GAAO,aAAY,QAASE,EAAW,OAAQ,CACvE"}
@@ -1,29 +0,0 @@
1
- import { FetchExchange } from '@ahoo-wang/fetcher';
2
- import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
3
- import { QueryDescriptorResult } from './queryDescriptorApi.cjs';
4
- /**
5
- * The decorated requests behind `QueryDescriptorClient`, which turns the
6
- * version it is given into an ETag before they run.
7
- */
8
- export declare class QueryDescriptorEndpoints implements ApiMetadataCapable {
9
- readonly apiMetadata?: ApiMetadata | undefined;
10
- constructor(apiMetadata?: ApiMetadata | undefined);
11
- snapshot(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
12
- eventStream(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
13
- }
14
- /**
15
- * The version a descriptor version or an ETag names: `sha256:…`,
16
- * `"sha256:…"` and `W/"sha256:…"` all name `sha256:…`. `undefined` for
17
- * nothing, or only blanks.
18
- */
19
- export declare function descriptorVersion(previous?: string): string | undefined;
20
- /**
21
- * The `If-None-Match` value for `version`: the ETag the server sends, which it
22
- * compares as it is.
23
- */
24
- export declare function ifNoneMatch(version?: string): string | undefined;
25
- /**
26
- * What an exchange answers: 304 means the version sent is current; any other
27
- * status outside 2xx rejects with the error the fetcher would have thrown.
28
- */
29
- export declare function readDescriptor(exchange: FetchExchange, version: string | undefined): Promise<QueryDescriptorResult>;
@@ -1,29 +0,0 @@
1
- import { FetchExchange } from '@ahoo-wang/fetcher';
2
- import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
3
- import { QueryDescriptorResult } from './queryDescriptorApi.js';
4
- /**
5
- * The decorated requests behind `QueryDescriptorClient`, which turns the
6
- * version it is given into an ETag before they run.
7
- */
8
- export declare class QueryDescriptorEndpoints implements ApiMetadataCapable {
9
- readonly apiMetadata?: ApiMetadata | undefined;
10
- constructor(apiMetadata?: ApiMetadata | undefined);
11
- snapshot(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
12
- eventStream(ifNoneMatch?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<FetchExchange>;
13
- }
14
- /**
15
- * The version a descriptor version or an ETag names: `sha256:…`,
16
- * `"sha256:…"` and `W/"sha256:…"` all name `sha256:…`. `undefined` for
17
- * nothing, or only blanks.
18
- */
19
- export declare function descriptorVersion(previous?: string): string | undefined;
20
- /**
21
- * The `If-None-Match` value for `version`: the ETag the server sends, which it
22
- * compares as it is.
23
- */
24
- export declare function ifNoneMatch(version?: string): string | undefined;
25
- /**
26
- * What an exchange answers: 304 means the version sent is current; any other
27
- * status outside 2xx rejects with the error the fetcher would have thrown.
28
- */
29
- export declare function readDescriptor(exchange: FetchExchange, version: string | undefined): Promise<QueryDescriptorResult>;
@@ -1,69 +0,0 @@
1
- import e from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateMetadata.es.js";
2
- import t from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorateParam.es.js";
3
- import n from "../../../_virtual/_@oxc-project_runtime@0.153.0/helpers/esm/decorate.es.js";
4
- import { QueryDescriptorEndpointPaths as r } from "./endpointPaths.es.js";
5
- import { ExchangeResultExtractor as i, HttpStatusValidationError as a, IGNORE_VALIDATE_STATUS as o } from "@ahoo-wang/fetcher";
6
- import { api as s, attribute as c, autoGeneratedError as l, get as u, header as d } from "@ahoo-wang/fetcher-decorator";
7
- //#region src/client/query/descriptor/descriptorEndpoints.ts
8
- var f = Object.freeze({
9
- resultExtractor: i,
10
- attributes: Object.freeze({ [o]: !0 })
11
- }), p = class {
12
- constructor(e) {
13
- this.apiMetadata = e;
14
- }
15
- snapshot(e, t, n) {
16
- throw l(e, t, n);
17
- }
18
- /* v8 ignore stop */
19
- eventStream(e, t, n) {
20
- throw l(e, t, n);
21
- }
22
- };
23
- n([
24
- u(r.SNAPSHOT, f),
25
- t(0, d("If-None-Match")),
26
- t(1, c()),
27
- e("design:type", Function),
28
- e("design:paramtypes", [
29
- String,
30
- typeof Record > "u" ? Object : Record,
31
- Object
32
- ]),
33
- e("design:returntype", typeof Promise > "u" ? Object : Promise)
34
- ], p.prototype, "snapshot", null), n([
35
- u(r.EVENT_STREAM, f),
36
- t(0, d("If-None-Match")),
37
- t(1, c()),
38
- e("design:type", Function),
39
- e("design:paramtypes", [
40
- String,
41
- typeof Record > "u" ? Object : Record,
42
- Object
43
- ]),
44
- e("design:returntype", typeof Promise > "u" ? Object : Promise)
45
- ], p.prototype, "eventStream", null), p = n([s(), e("design:paramtypes", [Object])], p);
46
- function m(e) {
47
- return e?.trim().replace(/^W\//, "").replace(/^"(.*)"$/, "$1") || void 0;
48
- }
49
- function h(e) {
50
- return e === void 0 ? void 0 : `"${e}"`;
51
- }
52
- async function g(e, t) {
53
- let n = e.requiredResponse;
54
- if (n.status === 304 && t !== void 0) return {
55
- notModified: !0,
56
- version: t
57
- };
58
- if (!n.ok) throw new a(e);
59
- let r = await n.json();
60
- return {
61
- notModified: !1,
62
- descriptor: r,
63
- version: r.version
64
- };
65
- }
66
- //#endregion
67
- export { p as QueryDescriptorEndpoints, m as descriptorVersion, h as ifNoneMatch, g as readDescriptor };
68
-
69
- //# sourceMappingURL=descriptorEndpoints.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"descriptorEndpoints.es.js","names":["_decorate","_decorateParam","_decorateMetadata","__decorateMetadata","__decorateParam","__decorate","DESCRIPTOR_ENDPOINT","ExchangeResultExtractor","IGNORE_VALIDATE_STATUS","QueryDescriptorEndpoints","apiMetadata","autoGeneratedError","ifNoneMatch","attributes","abort","get","QueryDescriptorEndpointPaths","header","attribute","api","descriptorVersion","previous","version","readDescriptor","response","exchange","HttpStatusValidationError","descriptor"],"sources":["../../../../src/client/query/descriptor/descriptorEndpoints.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// Internal: the index of this folder does not re-export this file.\n\nimport {\n ExchangeResultExtractor,\n type FetchExchange,\n HttpStatusValidationError,\n IGNORE_VALIDATE_STATUS,\n} from '@ahoo-wang/fetcher';\nimport type {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport {\n api,\n attribute,\n autoGeneratedError,\n get,\n header,\n} from '@ahoo-wang/fetcher-decorator';\nimport type { QueryModelDescriptor } from '../../../dsl/descriptor.js';\nimport type { QueryDescriptorResult } from './queryDescriptorApi.js';\nimport { QueryDescriptorEndpointPaths } from './endpointPaths.js';\n\n/**\n * The endpoints answer the exchange with its status unchecked, so a 304 is\n * not an error; {@link readDescriptor} checks the status instead.\n */\nconst DESCRIPTOR_ENDPOINT = Object.freeze({\n resultExtractor: ExchangeResultExtractor,\n attributes: Object.freeze({ [IGNORE_VALIDATE_STATUS]: true }),\n});\n\n/**\n * The decorated requests behind `QueryDescriptorClient`, which turns the\n * version it is given into an ETag before they run.\n */\n@api()\nexport class QueryDescriptorEndpoints implements ApiMetadataCapable {\n constructor(public readonly apiMetadata?: ApiMetadata) {}\n\n @get(QueryDescriptorEndpointPaths.SNAPSHOT, DESCRIPTOR_ENDPOINT)\n /* v8 ignore start */\n snapshot(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n\n @get(QueryDescriptorEndpointPaths.EVENT_STREAM, DESCRIPTOR_ENDPOINT)\n /* v8 ignore start */\n eventStream(\n @header('If-None-Match') ifNoneMatch?: string,\n @attribute() attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<FetchExchange> {\n throw autoGeneratedError(ifNoneMatch, attributes, abort);\n }\n /* v8 ignore stop */\n}\n\n/**\n * The version a descriptor version or an ETag names: `sha256:…`,\n * `\"sha256:…\"` and `W/\"sha256:…\"` all name `sha256:…`. `undefined` for\n * nothing, or only blanks.\n */\nexport function descriptorVersion(previous?: string): string | undefined {\n const version = previous\n ?.trim()\n .replace(/^W\\//, '')\n .replace(/^\"(.*)\"$/, '$1');\n return version ? version : undefined;\n}\n\n/**\n * The `If-None-Match` value for `version`: the ETag the server sends, which it\n * compares as it is.\n */\nexport function ifNoneMatch(version?: string): string | undefined {\n return version === undefined ? undefined : `\"${version}\"`;\n}\n\n/**\n * What an exchange answers: 304 means the version sent is current; any other\n * status outside 2xx rejects with the error the fetcher would have thrown.\n */\nexport async function readDescriptor(\n exchange: FetchExchange,\n version: string | undefined,\n): Promise<QueryDescriptorResult> {\n const response = exchange.requiredResponse;\n if (response.status === 304 && version !== undefined)\n return { notModified: true, version };\n if (!response.ok) throw new HttpStatusValidationError(exchange);\n const descriptor = (await response.json()) as QueryModelDescriptor;\n return { notModified: false, descriptor, version: descriptor.version };\n}\n"],"mappings":";;;;;;;AAwCA,IAAMM,IAAsB,OAAO,OAAO;CACxC,iBAAiBC;CACjB,YAAY,OAAO,OAAO,GAAGC,IAAyB,GAAK,CAAC;AAC9D,CAAC,GAOYC,IAAN,MAA6D;CAClE,YAAY,GAA2C;EAA3B,KAAA,cAAAC;CAA4B;CAExD,SAGE,GACA,GACA,GACwB;EACxB,MAAMC,EAAmBC,GAAaC,GAAYC,CAAK;CACzD;;CAGA,YAGE,GACA,GACA,GACwB;EACxB,MAAMH,EAAmBC,GAAaC,GAAYC,CAAK;CACzD;AAEF;;CArBGC,EAAIC,EAA6B,UAAUV,CAAmB;CAG5DL,EAAA,GAAAgB,EAAO,eAAe,CAAA;CACtBhB,EAAA,GAAAiB,EAAU,CAAA;;;;;;;;;CAOZH,EAAIC,EAA6B,cAAcV,CAAmB;CAGhEL,EAAA,GAAAgB,EAAO,eAAe,CAAA;CACtBhB,EAAA,GAAAiB,EAAU,CAAA;;;;;;;;sCAnBd,IAAAlB,EAAA,CAAAmB,EAAI,GAAAjB,EAAA,qBAAA,CAAA,MAAA,CAAA,CAAA,GAAAO,CAAA;AAgCL,SAAgBW,EAAkB,GAAuC;CAKvE,OAJgBC,GACZ,KAAK,CAAC,CACP,QAAQ,QAAQ,EAAE,CAAC,CACnB,QAAQ,YAAY,IAAI,KACA,KAAA;AAC7B;AAMA,SAAgBT,EAAY,GAAsC;CAChE,OAAOU,MAAY,KAAA,IAAY,KAAA,IAAY,IAAIA,EAAQ;AACzD;AAMA,eAAsBC,EACpB,GACA,GACgC;CAChC,IAAMC,IAAWC,EAAS;CAC1B,IAAID,EAAS,WAAW,OAAOF,MAAY,KAAA,GACzC,OAAO;EAAE,aAAa;EAAM;CAAQ;CACtC,IAAI,CAACE,EAAS,IAAI,MAAM,IAAIE,EAA0BD,CAAQ;CAC9D,IAAME,IAAc,MAAMH,EAAS,KAAK;CACxC,OAAO;EAAE,aAAa;EAAO;EAAY,SAASG,EAAW;CAAQ;AACvE"}
@@ -1,2 +0,0 @@
1
- var e=Object.freeze({SNAPSHOT:`snapshot/schema`,EVENT_STREAM:`event/schema`});exports.QueryDescriptorEndpointPaths=e;
2
- //# sourceMappingURL=endpointPaths.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpointPaths.cjs","names":["QueryDescriptorEndpointPaths"],"sources":["../../../../src/client/query/descriptor/endpointPaths.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// Internal: the index of this folder does not re-export this file. The\n// paths are relative to the client's base path, which names the aggregate\n// without a tenant or owner segment: the schema routes have neither.\nexport const QueryDescriptorEndpointPaths = Object.freeze({\n SNAPSHOT: 'snapshot/schema',\n EVENT_STREAM: 'event/schema',\n} as const);\n"],"mappings":"AAgBA,IAAaA,EAA+B,OAAO,OAAO,CACxD,SAAU,kBACV,aAAc,cAChB,CAAU"}
@@ -1,4 +0,0 @@
1
- export declare const QueryDescriptorEndpointPaths: Readonly<{
2
- readonly SNAPSHOT: "snapshot/schema";
3
- readonly EVENT_STREAM: "event/schema";
4
- }>;
@@ -1,4 +0,0 @@
1
- export declare const QueryDescriptorEndpointPaths: Readonly<{
2
- readonly SNAPSHOT: "snapshot/schema";
3
- readonly EVENT_STREAM: "event/schema";
4
- }>;
@@ -1,9 +0,0 @@
1
- //#region src/client/query/descriptor/endpointPaths.ts
2
- var e = Object.freeze({
3
- SNAPSHOT: "snapshot/schema",
4
- EVENT_STREAM: "event/schema"
5
- });
6
- //#endregion
7
- export { e as QueryDescriptorEndpointPaths };
8
-
9
- //# sourceMappingURL=endpointPaths.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpointPaths.es.js","names":["QueryDescriptorEndpointPaths"],"sources":["../../../../src/client/query/descriptor/endpointPaths.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// Internal: the index of this folder does not re-export this file. The\n// paths are relative to the client's base path, which names the aggregate\n// without a tenant or owner segment: the schema routes have neither.\nexport const QueryDescriptorEndpointPaths = Object.freeze({\n SNAPSHOT: 'snapshot/schema',\n EVENT_STREAM: 'event/schema',\n} as const);\n"],"mappings":";AAgBA,IAAaA,IAA+B,OAAO,OAAO;CACxD,UAAU;CACV,cAAc;AAChB,CAAU"}
@@ -1,2 +0,0 @@
1
- export * from './queryDescriptorApi.cjs';
2
- export * from './queryDescriptorClient.cjs';
@@ -1,2 +0,0 @@
1
- export * from './queryDescriptorApi.js';
2
- export * from './queryDescriptorClient.js';
@@ -1,58 +0,0 @@
1
- import { QueryModelDescriptor } from '../../../dsl/descriptor.cjs';
2
- /** The descriptor was read in full: the server had none matching the version sent, or none was sent. */
3
- export interface QueryDescriptorRead {
4
- /** `false`: `descriptor` holds the descriptor. */
5
- notModified: false;
6
- /** The descriptor the server answered with. */
7
- descriptor: QueryModelDescriptor;
8
- /** Its version, the same as `descriptor.version`; send it next time. */
9
- version: string;
10
- }
11
- /**
12
- * The server answered 304 Not Modified: the descriptor still has the version
13
- * sent, so the copy the caller holds is current.
14
- */
15
- export interface QueryDescriptorNotModified {
16
- /** `true`: keep the descriptor already held. */
17
- notModified: true;
18
- /** The version sent, without ETag quotes. */
19
- version: string;
20
- }
21
- /**
22
- * What {@link QueryDescriptorApi} answers: the descriptor, or word that the
23
- * one the caller holds is current. Branch on `notModified`.
24
- */
25
- export type QueryDescriptorResult = QueryDescriptorRead | QueryDescriptorNotModified;
26
- /**
27
- * Reads an aggregate's query capability descriptors: what its snapshot and
28
- * event stream query models admit (fields, operators, sort, paging,
29
- * aggregation, limits). {@link QueryDescriptorClient} implements it; code
30
- * written against the interface can take a test double.
31
- *
32
- * Each method takes the version of a descriptor already held, as
33
- * `descriptor.version` or as the ETag the server sent (quoted, or weak), and
34
- * sends it as `If-None-Match`: an unchanged descriptor then answers 304
35
- * without a body, and the method resolves to
36
- * `{ notModified: true, version }`. Any other failure rejects as the query
37
- * methods do; `toWowError` reads it.
38
- */
39
- export interface QueryDescriptorApi {
40
- /**
41
- * Reads the descriptor of the snapshot query model,
42
- * `GET {aggregate}/snapshot/schema`.
43
- *
44
- * @param previous - The version or ETag of the descriptor already held; omit it to read in full.
45
- * @param attributes - Optional shared attributes for the interceptors
46
- * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
47
- */
48
- describeSnapshot(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
49
- /**
50
- * Reads the descriptor of the event stream query model,
51
- * `GET {aggregate}/event/schema`.
52
- *
53
- * @param previous - The version or ETag of the descriptor already held; omit it to read in full.
54
- * @param attributes - Optional shared attributes for the interceptors
55
- * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
56
- */
57
- describeEventStream(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
58
- }
@@ -1,58 +0,0 @@
1
- import { QueryModelDescriptor } from '../../../dsl/descriptor.js';
2
- /** The descriptor was read in full: the server had none matching the version sent, or none was sent. */
3
- export interface QueryDescriptorRead {
4
- /** `false`: `descriptor` holds the descriptor. */
5
- notModified: false;
6
- /** The descriptor the server answered with. */
7
- descriptor: QueryModelDescriptor;
8
- /** Its version, the same as `descriptor.version`; send it next time. */
9
- version: string;
10
- }
11
- /**
12
- * The server answered 304 Not Modified: the descriptor still has the version
13
- * sent, so the copy the caller holds is current.
14
- */
15
- export interface QueryDescriptorNotModified {
16
- /** `true`: keep the descriptor already held. */
17
- notModified: true;
18
- /** The version sent, without ETag quotes. */
19
- version: string;
20
- }
21
- /**
22
- * What {@link QueryDescriptorApi} answers: the descriptor, or word that the
23
- * one the caller holds is current. Branch on `notModified`.
24
- */
25
- export type QueryDescriptorResult = QueryDescriptorRead | QueryDescriptorNotModified;
26
- /**
27
- * Reads an aggregate's query capability descriptors: what its snapshot and
28
- * event stream query models admit (fields, operators, sort, paging,
29
- * aggregation, limits). {@link QueryDescriptorClient} implements it; code
30
- * written against the interface can take a test double.
31
- *
32
- * Each method takes the version of a descriptor already held, as
33
- * `descriptor.version` or as the ETag the server sent (quoted, or weak), and
34
- * sends it as `If-None-Match`: an unchanged descriptor then answers 304
35
- * without a body, and the method resolves to
36
- * `{ notModified: true, version }`. Any other failure rejects as the query
37
- * methods do; `toWowError` reads it.
38
- */
39
- export interface QueryDescriptorApi {
40
- /**
41
- * Reads the descriptor of the snapshot query model,
42
- * `GET {aggregate}/snapshot/schema`.
43
- *
44
- * @param previous - The version or ETag of the descriptor already held; omit it to read in full.
45
- * @param attributes - Optional shared attributes for the interceptors
46
- * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
47
- */
48
- describeSnapshot(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
49
- /**
50
- * Reads the descriptor of the event stream query model,
51
- * `GET {aggregate}/event/schema`.
52
- *
53
- * @param previous - The version or ETag of the descriptor already held; omit it to read in full.
54
- * @param attributes - Optional shared attributes for the interceptors
55
- * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
56
- */
57
- describeEventStream(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
58
- }
@@ -1,2 +0,0 @@
1
- const e=require("../../bindMethods.cjs"),t=require("./descriptorEndpoints.cjs");var n=class{constructor(t){this.apiMetadata=t,e.bindMethods(this)}async describeSnapshot(e,n,r){let i=t.descriptorVersion(e),a=await new t.QueryDescriptorEndpoints(this.apiMetadata).snapshot(t.ifNoneMatch(i),n,r);return t.readDescriptor(a,i)}async describeEventStream(e,n,r){let i=t.descriptorVersion(e),a=await new t.QueryDescriptorEndpoints(this.apiMetadata).eventStream(t.ifNoneMatch(i),n,r);return t.readDescriptor(a,i)}};exports.QueryDescriptorClient=n;
2
- //# sourceMappingURL=queryDescriptorClient.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryDescriptorClient.cjs","names":["descriptorVersion","QueryDescriptorEndpoints","ifNoneMatch","readDescriptor","require_bindMethods","require_descriptorEndpoints","QueryDescriptorClient","apiMetadata","version","previous","exchange","attributes","abort"],"sources":["../../../../src/client/query/descriptor/queryDescriptorClient.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 {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport type {\n QueryDescriptorApi,\n QueryDescriptorResult,\n} from './queryDescriptorApi.js';\nimport {\n descriptorVersion,\n ifNoneMatch,\n QueryDescriptorEndpoints,\n readDescriptor,\n} from './descriptorEndpoints.js';\nimport { bindMethods } from '../../bindMethods.js';\n\n/**\n * Reads an aggregate's query capability descriptors,\n * `GET {aggregate}/snapshot/schema` and `GET {aggregate}/event/schema`: what\n * each query model admits, as a `QueryModelDescriptor`. A view or form reads\n * it to offer only the fields, operators, sorts and paging the server\n * accepts, and to know the limits.\n *\n * The base path names the aggregate (`{contextAlias}/{aggregateName}`) with\n * no tenant or owner segment: the schema routes have neither, whatever\n * routes the aggregate's queries take. `QueryClientFactory.createQueryDescriptorClient`\n * builds it that way. Headers such as `Wow-Space-Id` come from the\n * `ApiMetadata` as for the other clients.\n *\n * A descriptor does not depend on the caller and changes only when the\n * server's model or configuration does, so hold it and revalidate: pass the\n * version held, and a 304 answers `{ notModified: true }` without a body.\n *\n * @example\n * ```typescript\n * const descriptors = new QueryDescriptorClient({ basePath: 'example/cart' });\n *\n * const first = await descriptors.describeSnapshot();\n * if (!first.notModified) {\n * const sku = first.descriptor.fields.find(f => f.path === 'state.items.productId');\n * console.log(sku?.filter.operators);\n * }\n *\n * // Later: revalidate the copy held.\n * const again = await descriptors.describeSnapshot(first.version);\n * console.log(again.notModified); // true while the model is unchanged\n * ```\n */\nexport class QueryDescriptorClient\n implements QueryDescriptorApi, ApiMetadataCapable\n{\n /**\n * @param apiMetadata - The fetcher, the base path naming the aggregate, and any shared headers.\n */\n constructor(public readonly apiMetadata?: ApiMetadata) {\n bindMethods(this);\n }\n\n /**\n * Reads the descriptor of the snapshot query model,\n * `GET {aggregate}/snapshot/schema`.\n *\n * @param previous - The version or ETag of the descriptor already held; omit it to read in full.\n * @param attributes - Optional shared attributes for the interceptors\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns The descriptor, or `{ notModified: true, version }` when `previous` is current.\n */\n async describeSnapshot(\n previous?: string,\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<QueryDescriptorResult> {\n const version = descriptorVersion(previous);\n const exchange = await new QueryDescriptorEndpoints(\n this.apiMetadata,\n ).snapshot(ifNoneMatch(version), attributes, abort);\n return readDescriptor(exchange, version);\n }\n\n /**\n * Reads the descriptor of the event stream query model,\n * `GET {aggregate}/event/schema`.\n *\n * @param previous - The version or ETag of the descriptor already held; omit it to read in full.\n * @param attributes - Optional shared attributes for the interceptors\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns The descriptor, or `{ notModified: true, version }` when `previous` is current.\n */\n async describeEventStream(\n previous?: string,\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<QueryDescriptorResult> {\n const version = descriptorVersion(previous);\n const exchange = await new QueryDescriptorEndpoints(\n this.apiMetadata,\n ).eventStream(ifNoneMatch(version), attributes, abort);\n return readDescriptor(exchange, version);\n }\n}\n"],"mappings":"gFA6DA,IAAaM,EAAb,KAEA,CAIE,YAAY,EAA2C,CAA3B,KAAA,YAAAC,EAC1BH,EAAA,YAAY,IAAI,CAClB,CAWA,MAAM,iBACJ,EACA,EACA,EACgC,CAChC,IAAMI,EAAUR,EAAAA,kBAAkBS,CAAQ,EACpCC,EAAW,MAAM,IAAIT,EAAAA,yBACzB,KAAK,WACP,CAAC,CAAC,SAASC,EAAAA,YAAYM,CAAO,EAAGG,EAAYC,CAAK,EAClD,OAAOT,EAAAA,eAAeO,EAAUF,CAAO,CACzC,CAWA,MAAM,oBACJ,EACA,EACA,EACgC,CAChC,IAAMA,EAAUR,EAAAA,kBAAkBS,CAAQ,EACpCC,EAAW,MAAM,IAAIT,EAAAA,yBACzB,KAAK,WACP,CAAC,CAAC,YAAYC,EAAAA,YAAYM,CAAO,EAAGG,EAAYC,CAAK,EACrD,OAAOT,EAAAA,eAAeO,EAAUF,CAAO,CACzC,CACF"}
@@ -1,61 +0,0 @@
1
- import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
2
- import { QueryDescriptorApi, QueryDescriptorResult } from './queryDescriptorApi.cjs';
3
- /**
4
- * Reads an aggregate's query capability descriptors,
5
- * `GET {aggregate}/snapshot/schema` and `GET {aggregate}/event/schema`: what
6
- * each query model admits, as a `QueryModelDescriptor`. A view or form reads
7
- * it to offer only the fields, operators, sorts and paging the server
8
- * accepts, and to know the limits.
9
- *
10
- * The base path names the aggregate (`{contextAlias}/{aggregateName}`) with
11
- * no tenant or owner segment: the schema routes have neither, whatever
12
- * routes the aggregate's queries take. `QueryClientFactory.createQueryDescriptorClient`
13
- * builds it that way. Headers such as `Wow-Space-Id` come from the
14
- * `ApiMetadata` as for the other clients.
15
- *
16
- * A descriptor does not depend on the caller and changes only when the
17
- * server's model or configuration does, so hold it and revalidate: pass the
18
- * version held, and a 304 answers `{ notModified: true }` without a body.
19
- *
20
- * @example
21
- * ```typescript
22
- * const descriptors = new QueryDescriptorClient({ basePath: 'example/cart' });
23
- *
24
- * const first = await descriptors.describeSnapshot();
25
- * if (!first.notModified) {
26
- * const sku = first.descriptor.fields.find(f => f.path === 'state.items.productId');
27
- * console.log(sku?.filter.operators);
28
- * }
29
- *
30
- * // Later: revalidate the copy held.
31
- * const again = await descriptors.describeSnapshot(first.version);
32
- * console.log(again.notModified); // true while the model is unchanged
33
- * ```
34
- */
35
- export declare class QueryDescriptorClient implements QueryDescriptorApi, ApiMetadataCapable {
36
- readonly apiMetadata?: ApiMetadata | undefined;
37
- /**
38
- * @param apiMetadata - The fetcher, the base path naming the aggregate, and any shared headers.
39
- */
40
- constructor(apiMetadata?: ApiMetadata | undefined);
41
- /**
42
- * Reads the descriptor of the snapshot query model,
43
- * `GET {aggregate}/snapshot/schema`.
44
- *
45
- * @param previous - The version or ETag of the descriptor already held; omit it to read in full.
46
- * @param attributes - Optional shared attributes for the interceptors
47
- * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
48
- * @returns The descriptor, or `{ notModified: true, version }` when `previous` is current.
49
- */
50
- describeSnapshot(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
51
- /**
52
- * Reads the descriptor of the event stream query model,
53
- * `GET {aggregate}/event/schema`.
54
- *
55
- * @param previous - The version or ETag of the descriptor already held; omit it to read in full.
56
- * @param attributes - Optional shared attributes for the interceptors
57
- * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
58
- * @returns The descriptor, or `{ notModified: true, version }` when `previous` is current.
59
- */
60
- describeEventStream(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
61
- }
@@ -1,61 +0,0 @@
1
- import { ApiMetadata, ApiMetadataCapable } from '@ahoo-wang/fetcher-decorator';
2
- import { QueryDescriptorApi, QueryDescriptorResult } from './queryDescriptorApi.js';
3
- /**
4
- * Reads an aggregate's query capability descriptors,
5
- * `GET {aggregate}/snapshot/schema` and `GET {aggregate}/event/schema`: what
6
- * each query model admits, as a `QueryModelDescriptor`. A view or form reads
7
- * it to offer only the fields, operators, sorts and paging the server
8
- * accepts, and to know the limits.
9
- *
10
- * The base path names the aggregate (`{contextAlias}/{aggregateName}`) with
11
- * no tenant or owner segment: the schema routes have neither, whatever
12
- * routes the aggregate's queries take. `QueryClientFactory.createQueryDescriptorClient`
13
- * builds it that way. Headers such as `Wow-Space-Id` come from the
14
- * `ApiMetadata` as for the other clients.
15
- *
16
- * A descriptor does not depend on the caller and changes only when the
17
- * server's model or configuration does, so hold it and revalidate: pass the
18
- * version held, and a 304 answers `{ notModified: true }` without a body.
19
- *
20
- * @example
21
- * ```typescript
22
- * const descriptors = new QueryDescriptorClient({ basePath: 'example/cart' });
23
- *
24
- * const first = await descriptors.describeSnapshot();
25
- * if (!first.notModified) {
26
- * const sku = first.descriptor.fields.find(f => f.path === 'state.items.productId');
27
- * console.log(sku?.filter.operators);
28
- * }
29
- *
30
- * // Later: revalidate the copy held.
31
- * const again = await descriptors.describeSnapshot(first.version);
32
- * console.log(again.notModified); // true while the model is unchanged
33
- * ```
34
- */
35
- export declare class QueryDescriptorClient implements QueryDescriptorApi, ApiMetadataCapable {
36
- readonly apiMetadata?: ApiMetadata | undefined;
37
- /**
38
- * @param apiMetadata - The fetcher, the base path naming the aggregate, and any shared headers.
39
- */
40
- constructor(apiMetadata?: ApiMetadata | undefined);
41
- /**
42
- * Reads the descriptor of the snapshot query model,
43
- * `GET {aggregate}/snapshot/schema`.
44
- *
45
- * @param previous - The version or ETag of the descriptor already held; omit it to read in full.
46
- * @param attributes - Optional shared attributes for the interceptors
47
- * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
48
- * @returns The descriptor, or `{ notModified: true, version }` when `previous` is current.
49
- */
50
- describeSnapshot(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
51
- /**
52
- * Reads the descriptor of the event stream query model,
53
- * `GET {aggregate}/event/schema`.
54
- *
55
- * @param previous - The version or ETag of the descriptor already held; omit it to read in full.
56
- * @param attributes - Optional shared attributes for the interceptors
57
- * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.
58
- * @returns The descriptor, or `{ notModified: true, version }` when `previous` is current.
59
- */
60
- describeEventStream(previous?: string, attributes?: Record<string, unknown>, abort?: AbortController | AbortSignal): Promise<QueryDescriptorResult>;
61
- }
@@ -1,20 +0,0 @@
1
- import { bindMethods as e } from "../../bindMethods.es.js";
2
- import { QueryDescriptorEndpoints as t, descriptorVersion as n, ifNoneMatch as r, readDescriptor as i } from "./descriptorEndpoints.es.js";
3
- //#region src/client/query/descriptor/queryDescriptorClient.ts
4
- var a = class {
5
- constructor(t) {
6
- this.apiMetadata = t, e(this);
7
- }
8
- async describeSnapshot(e, a, o) {
9
- let s = n(e), c = await new t(this.apiMetadata).snapshot(r(s), a, o);
10
- return i(c, s);
11
- }
12
- async describeEventStream(e, a, o) {
13
- let s = n(e), c = await new t(this.apiMetadata).eventStream(r(s), a, o);
14
- return i(c, s);
15
- }
16
- };
17
- //#endregion
18
- export { a as QueryDescriptorClient };
19
-
20
- //# sourceMappingURL=queryDescriptorClient.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryDescriptorClient.es.js","names":["QueryDescriptorClient","apiMetadata","bindMethods","version","descriptorVersion","previous","exchange","QueryDescriptorEndpoints","ifNoneMatch","attributes","abort","readDescriptor"],"sources":["../../../../src/client/query/descriptor/queryDescriptorClient.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 {\n ApiMetadata,\n ApiMetadataCapable,\n} from '@ahoo-wang/fetcher-decorator';\nimport type {\n QueryDescriptorApi,\n QueryDescriptorResult,\n} from './queryDescriptorApi.js';\nimport {\n descriptorVersion,\n ifNoneMatch,\n QueryDescriptorEndpoints,\n readDescriptor,\n} from './descriptorEndpoints.js';\nimport { bindMethods } from '../../bindMethods.js';\n\n/**\n * Reads an aggregate's query capability descriptors,\n * `GET {aggregate}/snapshot/schema` and `GET {aggregate}/event/schema`: what\n * each query model admits, as a `QueryModelDescriptor`. A view or form reads\n * it to offer only the fields, operators, sorts and paging the server\n * accepts, and to know the limits.\n *\n * The base path names the aggregate (`{contextAlias}/{aggregateName}`) with\n * no tenant or owner segment: the schema routes have neither, whatever\n * routes the aggregate's queries take. `QueryClientFactory.createQueryDescriptorClient`\n * builds it that way. Headers such as `Wow-Space-Id` come from the\n * `ApiMetadata` as for the other clients.\n *\n * A descriptor does not depend on the caller and changes only when the\n * server's model or configuration does, so hold it and revalidate: pass the\n * version held, and a 304 answers `{ notModified: true }` without a body.\n *\n * @example\n * ```typescript\n * const descriptors = new QueryDescriptorClient({ basePath: 'example/cart' });\n *\n * const first = await descriptors.describeSnapshot();\n * if (!first.notModified) {\n * const sku = first.descriptor.fields.find(f => f.path === 'state.items.productId');\n * console.log(sku?.filter.operators);\n * }\n *\n * // Later: revalidate the copy held.\n * const again = await descriptors.describeSnapshot(first.version);\n * console.log(again.notModified); // true while the model is unchanged\n * ```\n */\nexport class QueryDescriptorClient\n implements QueryDescriptorApi, ApiMetadataCapable\n{\n /**\n * @param apiMetadata - The fetcher, the base path naming the aggregate, and any shared headers.\n */\n constructor(public readonly apiMetadata?: ApiMetadata) {\n bindMethods(this);\n }\n\n /**\n * Reads the descriptor of the snapshot query model,\n * `GET {aggregate}/snapshot/schema`.\n *\n * @param previous - The version or ETag of the descriptor already held; omit it to read in full.\n * @param attributes - Optional shared attributes for the interceptors\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns The descriptor, or `{ notModified: true, version }` when `previous` is current.\n */\n async describeSnapshot(\n previous?: string,\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<QueryDescriptorResult> {\n const version = descriptorVersion(previous);\n const exchange = await new QueryDescriptorEndpoints(\n this.apiMetadata,\n ).snapshot(ifNoneMatch(version), attributes, abort);\n return readDescriptor(exchange, version);\n }\n\n /**\n * Reads the descriptor of the event stream query model,\n * `GET {aggregate}/event/schema`.\n *\n * @param previous - The version or ETag of the descriptor already held; omit it to read in full.\n * @param attributes - Optional shared attributes for the interceptors\n * @param abort - Cancels the request: an `AbortController`, or an `AbortSignal` such as `AbortSignal.timeout(ms)` or the `signal` a data-fetching library passes.\n * @returns The descriptor, or `{ notModified: true, version }` when `previous` is current.\n */\n async describeEventStream(\n previous?: string,\n attributes?: Record<string, unknown>,\n abort?: AbortController | AbortSignal,\n ): Promise<QueryDescriptorResult> {\n const version = descriptorVersion(previous);\n const exchange = await new QueryDescriptorEndpoints(\n this.apiMetadata,\n ).eventStream(ifNoneMatch(version), attributes, abort);\n return readDescriptor(exchange, version);\n }\n}\n"],"mappings":";;;AA6DA,IAAaA,IAAb,MAEA;CAIE,YAAY,GAA2C;EACrD,AAD0B,KAAA,cAAAC,GAC1BC,EAAY,IAAI;CAClB;CAWA,MAAM,iBACJ,GACA,GACA,GACgC;EAChC,IAAMC,IAAUC,EAAkBC,CAAQ,GACpCC,IAAW,MAAM,IAAIC,EACzB,KAAK,WACP,CAAC,CAAC,SAASC,EAAYL,CAAO,GAAGM,GAAYC,CAAK;EAClD,OAAOC,EAAeL,GAAUH,CAAO;CACzC;CAWA,MAAM,oBACJ,GACA,GACA,GACgC;EAChC,IAAMA,IAAUC,EAAkBC,CAAQ,GACpCC,IAAW,MAAM,IAAIC,EACzB,KAAK,WACP,CAAC,CAAC,YAAYC,EAAYL,CAAO,GAAGM,GAAYC,CAAK;EACrD,OAAOC,EAAeL,GAAUH,CAAO;CACzC;AACF"}
@@ -1,2 +0,0 @@
1
- var e=Object.freeze({AGGREGATION:`event/aggregation`,COUNT:`event/count`,LIST:`event/list`,PAGED:`event/paged`,CURSOR:`event/cursor`,LOAD:`{id}/event/{headVersion}/{tailVersion}`});exports.EventStreamQueryEndpointPaths=e;
2
- //# sourceMappingURL=endpointPaths.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpointPaths.cjs","names":["EventStreamQueryEndpointPaths"],"sources":["../../../../src/client/query/event/endpointPaths.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// Internal: the index of this folder does not re-export this file. The\n// paths are relative to the client's base path.\nexport const EventStreamQueryEndpointPaths = Object.freeze({\n AGGREGATION: 'event/aggregation',\n COUNT: 'event/count',\n LIST: 'event/list',\n PAGED: 'event/paged',\n CURSOR: 'event/cursor',\n LOAD: '{id}/event/{headVersion}/{tailVersion}',\n} as const);\n"],"mappings":"AAeA,IAAaA,EAAgC,OAAO,OAAO,CACzD,YAAa,oBACb,MAAO,cACP,KAAM,aACN,MAAO,cACP,OAAQ,eACR,KAAM,wCACR,CAAU"}
@@ -1,8 +0,0 @@
1
- export declare const EventStreamQueryEndpointPaths: Readonly<{
2
- readonly AGGREGATION: "event/aggregation";
3
- readonly COUNT: "event/count";
4
- readonly LIST: "event/list";
5
- readonly PAGED: "event/paged";
6
- readonly CURSOR: "event/cursor";
7
- readonly LOAD: "{id}/event/{headVersion}/{tailVersion}";
8
- }>;
@@ -1,8 +0,0 @@
1
- export declare const EventStreamQueryEndpointPaths: Readonly<{
2
- readonly AGGREGATION: "event/aggregation";
3
- readonly COUNT: "event/count";
4
- readonly LIST: "event/list";
5
- readonly PAGED: "event/paged";
6
- readonly CURSOR: "event/cursor";
7
- readonly LOAD: "{id}/event/{headVersion}/{tailVersion}";
8
- }>;
@@ -1,13 +0,0 @@
1
- //#region src/client/query/event/endpointPaths.ts
2
- var e = Object.freeze({
3
- AGGREGATION: "event/aggregation",
4
- COUNT: "event/count",
5
- LIST: "event/list",
6
- PAGED: "event/paged",
7
- CURSOR: "event/cursor",
8
- LOAD: "{id}/event/{headVersion}/{tailVersion}"
9
- });
10
- //#endregion
11
- export { e as EventStreamQueryEndpointPaths };
12
-
13
- //# sourceMappingURL=endpointPaths.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpointPaths.es.js","names":["EventStreamQueryEndpointPaths"],"sources":["../../../../src/client/query/event/endpointPaths.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// Internal: the index of this folder does not re-export this file. The\n// paths are relative to the client's base path.\nexport const EventStreamQueryEndpointPaths = Object.freeze({\n AGGREGATION: 'event/aggregation',\n COUNT: 'event/count',\n LIST: 'event/list',\n PAGED: 'event/paged',\n CURSOR: 'event/cursor',\n LOAD: '{id}/event/{headVersion}/{tailVersion}',\n} as const);\n"],"mappings":";AAeA,IAAaA,IAAgC,OAAO,OAAO;CACzD,aAAa;CACb,OAAO;CACP,MAAM;CACN,OAAO;CACP,QAAQ;CACR,MAAM;AACR,CAAU"}