@ahoo-wang/wow-client 9.8.0 → 9.9.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 (119) hide show
  1. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs +2 -0
  2. package/dist/client/query/dataset/datasetDescriptorEndpoint.cjs.map +1 -0
  3. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.cts +8 -0
  4. package/dist/client/query/dataset/datasetDescriptorEndpoint.d.ts +8 -0
  5. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js +34 -0
  6. package/dist/client/query/dataset/datasetDescriptorEndpoint.es.js.map +1 -0
  7. package/dist/client/query/dataset/datasetDirectoryClient.cjs +2 -0
  8. package/dist/client/query/dataset/datasetDirectoryClient.cjs.map +1 -0
  9. package/dist/client/query/dataset/datasetDirectoryClient.d.cts +29 -0
  10. package/dist/client/query/dataset/datasetDirectoryClient.d.ts +29 -0
  11. package/dist/client/query/dataset/datasetDirectoryClient.es.js +25 -0
  12. package/dist/client/query/dataset/datasetDirectoryClient.es.js.map +1 -0
  13. package/dist/client/query/dataset/datasetQueryApi.d.cts +40 -0
  14. package/dist/client/query/dataset/datasetQueryApi.d.ts +40 -0
  15. package/dist/client/query/dataset/datasetQueryClient.cjs +2 -0
  16. package/dist/client/query/dataset/datasetQueryClient.cjs.map +1 -0
  17. package/dist/client/query/dataset/datasetQueryClient.d.cts +57 -0
  18. package/dist/client/query/dataset/datasetQueryClient.d.ts +57 -0
  19. package/dist/client/query/dataset/datasetQueryClient.es.js +154 -0
  20. package/dist/client/query/dataset/datasetQueryClient.es.js.map +1 -0
  21. package/dist/client/query/dataset/endpointPaths.cjs +2 -0
  22. package/dist/client/query/dataset/endpointPaths.cjs.map +1 -0
  23. package/dist/client/query/dataset/endpointPaths.d.cts +9 -0
  24. package/dist/client/query/dataset/endpointPaths.d.ts +9 -0
  25. package/dist/client/query/dataset/endpointPaths.es.js +14 -0
  26. package/dist/client/query/dataset/endpointPaths.es.js.map +1 -0
  27. package/dist/client/query/dataset/index.d.cts +3 -0
  28. package/dist/client/query/dataset/index.d.ts +3 -0
  29. package/dist/client/query/event/eventStreamQueryApi.d.cts +1 -1
  30. package/dist/client/query/event/eventStreamQueryApi.d.ts +1 -1
  31. package/dist/client/query/event/eventStreamQueryClient.cjs.map +1 -1
  32. package/dist/client/query/event/eventStreamQueryClient.d.cts +4 -1
  33. package/dist/client/query/event/eventStreamQueryClient.d.ts +4 -1
  34. package/dist/client/query/event/eventStreamQueryClient.es.js.map +1 -1
  35. package/dist/client/query/event/index.d.cts +0 -1
  36. package/dist/client/query/event/index.d.ts +0 -1
  37. package/dist/client/query/index.d.cts +1 -0
  38. package/dist/client/query/index.d.ts +1 -0
  39. package/dist/client/query/snapshot/index.d.cts +0 -1
  40. package/dist/client/query/snapshot/index.d.ts +0 -1
  41. package/dist/client/query/snapshot/snapshotQueryApi.d.cts +1 -1
  42. package/dist/client/query/snapshot/snapshotQueryApi.d.ts +1 -1
  43. package/dist/client/query/snapshot/snapshotQueryClient.cjs.map +1 -1
  44. package/dist/client/query/snapshot/snapshotQueryClient.d.cts +4 -1
  45. package/dist/client/query/snapshot/snapshotQueryClient.d.ts +4 -1
  46. package/dist/client/query/snapshot/snapshotQueryClient.es.js.map +1 -1
  47. package/dist/client/routing.cjs.map +1 -1
  48. package/dist/client/routing.d.cts +2 -2
  49. package/dist/client/routing.d.ts +2 -2
  50. package/dist/client/routing.es.js.map +1 -1
  51. package/dist/dsl/aggregation/admit.cjs +1 -1
  52. package/dist/dsl/aggregation/admit.cjs.map +1 -1
  53. package/dist/dsl/aggregation/admit.es.js +84 -65
  54. package/dist/dsl/aggregation/admit.es.js.map +1 -1
  55. package/dist/dsl/aggregation/builders.cjs +1 -1
  56. package/dist/dsl/aggregation/builders.cjs.map +1 -1
  57. package/dist/dsl/aggregation/builders.d.cts +16 -4
  58. package/dist/dsl/aggregation/builders.d.ts +16 -4
  59. package/dist/dsl/aggregation/builders.es.js +89 -78
  60. package/dist/dsl/aggregation/builders.es.js.map +1 -1
  61. package/dist/dsl/aggregation/derived.cjs +1 -1
  62. package/dist/dsl/aggregation/derived.cjs.map +1 -1
  63. package/dist/dsl/aggregation/derived.d.cts +32 -1
  64. package/dist/dsl/aggregation/derived.d.ts +32 -1
  65. package/dist/dsl/aggregation/derived.es.js +23 -1
  66. package/dist/dsl/aggregation/derived.es.js.map +1 -1
  67. package/dist/dsl/aggregation/types.cjs +1 -1
  68. package/dist/dsl/aggregation/types.cjs.map +1 -1
  69. package/dist/dsl/aggregation/types.d.cts +112 -7
  70. package/dist/dsl/aggregation/types.d.ts +112 -7
  71. package/dist/dsl/aggregation/types.es.js +19 -12
  72. package/dist/dsl/aggregation/types.es.js.map +1 -1
  73. package/dist/dsl/descriptor.cjs +1 -1
  74. package/dist/dsl/descriptor.cjs.map +1 -1
  75. package/dist/dsl/descriptor.d.cts +16 -1
  76. package/dist/dsl/descriptor.d.ts +16 -1
  77. package/dist/dsl/descriptor.es.js +2 -1
  78. package/dist/dsl/descriptor.es.js.map +1 -1
  79. package/dist/dsl.cjs +1 -1
  80. package/dist/dsl.d.cts +2 -2
  81. package/dist/dsl.d.ts +2 -2
  82. package/dist/dsl.es.js +13 -13
  83. package/dist/error/headers.cjs.map +1 -1
  84. package/dist/error/headers.d.cts +3 -2
  85. package/dist/error/headers.d.ts +3 -2
  86. package/dist/error/headers.es.js.map +1 -1
  87. package/dist/error/queryErrorCodes.cjs +1 -1
  88. package/dist/error/queryErrorCodes.cjs.map +1 -1
  89. package/dist/error/queryErrorCodes.d.cts +7 -0
  90. package/dist/error/queryErrorCodes.d.ts +7 -0
  91. package/dist/error/queryErrorCodes.es.js +2 -1
  92. package/dist/error/queryErrorCodes.es.js.map +1 -1
  93. package/dist/index.cjs +1 -1
  94. package/dist/index.es.js +35 -33
  95. package/dist/model/domainEventStream.cjs.map +1 -0
  96. package/dist/{client/query/event → model}/domainEventStream.d.cts +5 -1
  97. package/dist/{client/query/event → model}/domainEventStream.d.ts +5 -1
  98. package/dist/{client/query/event → model}/domainEventStream.es.js +1 -1
  99. package/dist/model/domainEventStream.es.js.map +1 -0
  100. package/dist/model/index.d.cts +2 -0
  101. package/dist/model/index.d.ts +2 -0
  102. package/dist/model/snapshot.cjs.map +1 -0
  103. package/dist/{client/query/snapshot → model}/snapshot.d.cts +3 -1
  104. package/dist/{client/query/snapshot → model}/snapshot.d.ts +3 -1
  105. package/dist/{client/query/snapshot → model}/snapshot.es.js +1 -1
  106. package/dist/model/snapshot.es.js.map +1 -0
  107. package/dist/transport/eventStreams.cjs +1 -1
  108. package/dist/transport/eventStreams.cjs.map +1 -1
  109. package/dist/transport/eventStreams.d.cts +3 -1
  110. package/dist/transport/eventStreams.d.ts +3 -1
  111. package/dist/transport/eventStreams.es.js +7 -4
  112. package/dist/transport/eventStreams.es.js.map +1 -1
  113. package/package.json +2 -2
  114. package/dist/client/query/event/domainEventStream.cjs.map +0 -1
  115. package/dist/client/query/event/domainEventStream.es.js.map +0 -1
  116. package/dist/client/query/snapshot/snapshot.cjs.map +0 -1
  117. package/dist/client/query/snapshot/snapshot.es.js.map +0 -1
  118. /package/dist/{client/query/event → model}/domainEventStream.cjs +0 -0
  119. /package/dist/{client/query/snapshot → model}/snapshot.cjs +0 -0
package/dist/dsl.es.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { FilterOperator as e, SearchMode as t, StringComparison as n, TimeUnit as r } from "./dsl/filter/operator.es.js";
2
- import { AGGREGATION_LIMITS as i, AggregationDatePart as a, AggregationDateUnit as o, AggregationExpressionOperator as s, AggregationExpressionType as c, AggregationFunction as l, AggregationGroupType as u, AggregationMetricType as d, ComparisonOperator as f, DateDiffUnit as p, DerivedExpressionType as m, HavingExpressionType as h } from "./dsl/aggregation/types.es.js";
3
- import { DeletionState as g } from "./dsl/deletionState.es.js";
4
- import { filter as _ } from "./dsl/filter/builders.es.js";
5
- import { SortDirection as v, asc as y, desc as b } from "./dsl/sort.es.js";
6
- import { aggregation as x } from "./dsl/aggregation/builders.es.js";
7
- import { projection as S } from "./dsl/projection.es.js";
8
- import { DEFAULT_PAGINATION as C, pagination as w } from "./dsl/pagination.es.js";
9
- import { DEFAULT_CURSOR_SIZE as T, MAX_CURSOR_SIZE as E, MAX_CURSOR_SORT_FIELDS as D, cursorQuery as O } from "./dsl/cursorQuery.es.js";
10
- import { listQuery as k, pagedList as A, pagedQuery as j, singleQuery as M } from "./dsl/queryable.es.js";
11
- import { PagingMode as N, QueryConstraintTypes as P, QueryFieldRoles as F, QueryModels as I, QueryValueKind as L, QueryValueTypes as R, SensitivityLevel as z } from "./dsl/descriptor.es.js";
12
- import { DomainEventStreamMetadataFields as B } from "./client/query/event/domainEventStream.es.js";
13
- import { SnapshotMetadataFields as V } from "./client/query/snapshot/snapshot.es.js";
14
- export { i as AGGREGATION_LIMITS, a as AggregationDatePart, o as AggregationDateUnit, s as AggregationExpressionOperator, c as AggregationExpressionType, l as AggregationFunction, u as AggregationGroupType, d as AggregationMetricType, f as ComparisonOperator, T as DEFAULT_CURSOR_SIZE, C as DEFAULT_PAGINATION, p as DateDiffUnit, g as DeletionState, m as DerivedExpressionType, B as DomainEventStreamMetadataFields, e as FilterOperator, h as HavingExpressionType, E as MAX_CURSOR_SIZE, D as MAX_CURSOR_SORT_FIELDS, N as PagingMode, P as QueryConstraintTypes, F as QueryFieldRoles, I as QueryModels, L as QueryValueKind, R as QueryValueTypes, t as SearchMode, z as SensitivityLevel, V as SnapshotMetadataFields, v as SortDirection, n as StringComparison, r as TimeUnit, x as aggregation, y as asc, O as cursorQuery, b as desc, _ as filter, k as listQuery, A as pagedList, j as pagedQuery, w as pagination, S as projection, M as singleQuery };
2
+ import { AGGREGATION_LIMITS as i, AggregationDatePart as a, AggregationDateUnit as o, AggregationExpressionOperator as s, AggregationExpressionType as c, AggregationFunction as l, AggregationGroupScope as u, AggregationGroupType as d, AggregationMetricType as f, ComparisonOperator as p, DateDiffUnit as m, DerivedExpressionType as h, HavingExpressionType as g, RunningFunction as _, WindowFunction as v } from "./dsl/aggregation/types.es.js";
3
+ import { DeletionState as y } from "./dsl/deletionState.es.js";
4
+ import { filter as b } from "./dsl/filter/builders.es.js";
5
+ import { SortDirection as x, asc as S, desc as C } from "./dsl/sort.es.js";
6
+ import { aggregation as w } from "./dsl/aggregation/builders.es.js";
7
+ import { projection as T } from "./dsl/projection.es.js";
8
+ import { DEFAULT_PAGINATION as E, pagination as D } from "./dsl/pagination.es.js";
9
+ import { DEFAULT_CURSOR_SIZE as O, MAX_CURSOR_SIZE as k, MAX_CURSOR_SORT_FIELDS as A, cursorQuery as j } from "./dsl/cursorQuery.es.js";
10
+ import { listQuery as M, pagedList as N, pagedQuery as P, singleQuery as F } from "./dsl/queryable.es.js";
11
+ import { PagingMode as I, QueryConstraintTypes as L, QueryFieldRoles as R, QueryModels as z, QueryValueKind as B, QueryValueTypes as V, SensitivityLevel as H } from "./dsl/descriptor.es.js";
12
+ import { DomainEventStreamMetadataFields as U } from "./model/domainEventStream.es.js";
13
+ import { SnapshotMetadataFields as W } from "./model/snapshot.es.js";
14
+ export { i as AGGREGATION_LIMITS, a as AggregationDatePart, o as AggregationDateUnit, s as AggregationExpressionOperator, c as AggregationExpressionType, l as AggregationFunction, u as AggregationGroupScope, d as AggregationGroupType, f as AggregationMetricType, p as ComparisonOperator, O as DEFAULT_CURSOR_SIZE, E as DEFAULT_PAGINATION, m as DateDiffUnit, y as DeletionState, h as DerivedExpressionType, U as DomainEventStreamMetadataFields, e as FilterOperator, g as HavingExpressionType, k as MAX_CURSOR_SIZE, A as MAX_CURSOR_SORT_FIELDS, I as PagingMode, L as QueryConstraintTypes, R as QueryFieldRoles, z as QueryModels, B as QueryValueKind, V as QueryValueTypes, _ as RunningFunction, t as SearchMode, H as SensitivityLevel, W as SnapshotMetadataFields, x as SortDirection, n as StringComparison, r as TimeUnit, v as WindowFunction, w as aggregation, S as asc, j as cursorQuery, C as desc, b as filter, M as listQuery, N as pagedList, P as pagedQuery, D as pagination, T as projection, F as singleQuery };
@@ -1 +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 `WowHeaders` in\n * `wow-rest-contract/src/main/kotlin/me/ahoo/wow/rest/WowHeaders.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"}
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 `WowHeaders` in\n * `wow-rest-contract/src/main/kotlin/me/ahoo/wow/rest/WowHeaders.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 * path: 'owner/{ownerId}/cart/add_cart_item',\n * method: 'POST',\n * headers: { [WowHeaders.SPACE_ID]: 'store-1' },\n * body: { productId: 'p-1', quantity: 1 },\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":"AAiCA,IAAaA,EAAa,OAAO,OAAO,CAItC,mBAAoB,OASpB,SAAU,eAMV,WAAY,gBACd,CAAU"}
@@ -11,9 +11,10 @@
11
11
  * ```typescript
12
12
  * // Send a command into a space
13
13
  * await commandClient.send({
14
- * method: HttpMethod.POST,
14
+ * path: 'owner/{ownerId}/cart/add_cart_item',
15
+ * method: 'POST',
15
16
  * headers: { [WowHeaders.SPACE_ID]: 'store-1' },
16
- * body: { ... },
17
+ * body: { productId: 'p-1', quantity: 1 },
17
18
  * });
18
19
  * ```
19
20
  */
@@ -11,9 +11,10 @@
11
11
  * ```typescript
12
12
  * // Send a command into a space
13
13
  * await commandClient.send({
14
- * method: HttpMethod.POST,
14
+ * path: 'owner/{ownerId}/cart/add_cart_item',
15
+ * method: 'POST',
15
16
  * headers: { [WowHeaders.SPACE_ID]: 'store-1' },
16
- * body: { ... },
17
+ * body: { productId: 'p-1', quantity: 1 },
17
18
  * });
18
19
  * ```
19
20
  */
@@ -1 +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 `WowHeaders` in\n * `wow-rest-contract/src/main/kotlin/me/ahoo/wow/rest/WowHeaders.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"}
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 `WowHeaders` in\n * `wow-rest-contract/src/main/kotlin/me/ahoo/wow/rest/WowHeaders.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 * path: 'owner/{ownerId}/cart/add_cart_item',\n * method: 'POST',\n * headers: { [WowHeaders.SPACE_ID]: 'store-1' },\n * body: { productId: 'p-1', quantity: 1 },\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":";AAiCA,IAAaA,IAAa,OAAO,OAAO;CAItC,oBAAoB;CASpB,UAAU;CAMV,YAAY;AACd,CAAU"}
@@ -1,2 +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;
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`,PREVIOUS_UNSHIFTABLE:`PREVIOUS_UNSHIFTABLE`});exports.QueryErrorCodes=e;
2
2
  //# sourceMappingURL=queryErrorCodes.cjs.map
@@ -1 +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"}
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 /**\n * A `PREVIOUS` window steps along a date group whose field the filter\n * conditions where its range cannot be shifted to the earlier period:\n * outside the top-level `AND`, or with a value that is not an instant;\n * `path` is the field.\n */\n PREVIOUS_UNSHIFTABLE: 'PREVIOUS_UNSHIFTABLE',\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,sBAOrB,qBAAsB,sBACxB,CAAU"}
@@ -172,6 +172,13 @@ export declare const QueryErrorCodes: Readonly<{
172
172
  * say); `path` is the field, or `''`.
173
173
  */
174
174
  readonly STORAGE_UNSUPPORTED: "STORAGE_UNSUPPORTED";
175
+ /**
176
+ * A `PREVIOUS` window steps along a date group whose field the filter
177
+ * conditions where its range cannot be shifted to the earlier period:
178
+ * outside the top-level `AND`, or with a value that is not an instant;
179
+ * `path` is the field.
180
+ */
181
+ readonly PREVIOUS_UNSHIFTABLE: "PREVIOUS_UNSHIFTABLE";
175
182
  }>;
176
183
  /** One of the codes this package knows; see {@link QueryErrorCodes}. */
177
184
  export type KnownQueryErrorCode = (typeof QueryErrorCodes)[keyof typeof QueryErrorCodes];
@@ -172,6 +172,13 @@ export declare const QueryErrorCodes: Readonly<{
172
172
  * say); `path` is the field, or `''`.
173
173
  */
174
174
  readonly STORAGE_UNSUPPORTED: "STORAGE_UNSUPPORTED";
175
+ /**
176
+ * A `PREVIOUS` window steps along a date group whose field the filter
177
+ * conditions where its range cannot be shifted to the earlier period:
178
+ * outside the top-level `AND`, or with a value that is not an instant;
179
+ * `path` is the field.
180
+ */
181
+ readonly PREVIOUS_UNSHIFTABLE: "PREVIOUS_UNSHIFTABLE";
175
182
  }>;
176
183
  /** One of the codes this package knows; see {@link QueryErrorCodes}. */
177
184
  export type KnownQueryErrorCode = (typeof QueryErrorCodes)[keyof typeof QueryErrorCodes];
@@ -45,7 +45,8 @@ var e = Object.freeze({
45
45
  SORT_TOO_MANY: "SORT_TOO_MANY",
46
46
  SORT_FIELD_DUPLICATE: "SORT_FIELD_DUPLICATE",
47
47
  IDENTITY_UNDEFINED: "IDENTITY_UNDEFINED",
48
- STORAGE_UNSUPPORTED: "STORAGE_UNSUPPORTED"
48
+ STORAGE_UNSUPPORTED: "STORAGE_UNSUPPORTED",
49
+ PREVIOUS_UNSHIFTABLE: "PREVIOUS_UNSHIFTABLE"
49
50
  });
50
51
  //#endregion
51
52
  export { e as QueryErrorCodes };
@@ -1 +1 @@
1
- {"version":3,"file":"queryErrorCodes.es.js","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,IAAkB,OAAO,OAAO;CAE3C,cAAc;CAEd,iBAAiB;CAEjB,YAAY;CAEZ,kBAAkB;CAElB,cAAc;CAEd,eAAe;CAEf,eAAe;CAEf,iBAAiB;CAEjB,uBAAuB;CAEvB,sBAAsB;CAKtB,gBAAgB;CAMhB,mBAAmB;CAKnB,kBAAkB;CAOlB,6BAA6B;CAK7B,uBAAuB;CAMvB,0BAA0B;CAK1B,yBAAyB;CAEzB,eAAe;CAEf,wBAAwB;CAExB,wBAAwB;CAExB,gBAAgB;CAEhB,gBAAgB;CAEhB,mBAAmB;CAEnB,0BAA0B;CAE1B,oBAAoB;CAEpB,uBAAuB;CAMvB,sBAAsB;CAEtB,6BAA6B;CAE7B,2BAA2B;CAE3B,uBAAuB;CAEvB,sBAAsB;CAEtB,6BAA6B;CAE7B,2BAA2B;CAE3B,iBAAiB;CAEjB,gCAAgC;CAEhC,kCAAkC;CAElC,iCAAiC;CAMjC,qBAAqB;CAMrB,gBAAgB;CAKhB,kCAAkC;CAMlC,8BAA8B;CAM9B,kCAAkC;CAElC,eAAe;CAEf,sBAAsB;CAKtB,oBAAoB;CAMpB,qBAAqB;AACvB,CAAU"}
1
+ {"version":3,"file":"queryErrorCodes.es.js","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 /**\n * A `PREVIOUS` window steps along a date group whose field the filter\n * conditions where its range cannot be shifted to the earlier period:\n * outside the top-level `AND`, or with a value that is not an instant;\n * `path` is the field.\n */\n PREVIOUS_UNSHIFTABLE: 'PREVIOUS_UNSHIFTABLE',\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,IAAkB,OAAO,OAAO;CAE3C,cAAc;CAEd,iBAAiB;CAEjB,YAAY;CAEZ,kBAAkB;CAElB,cAAc;CAEd,eAAe;CAEf,eAAe;CAEf,iBAAiB;CAEjB,uBAAuB;CAEvB,sBAAsB;CAKtB,gBAAgB;CAMhB,mBAAmB;CAKnB,kBAAkB;CAOlB,6BAA6B;CAK7B,uBAAuB;CAMvB,0BAA0B;CAK1B,yBAAyB;CAEzB,eAAe;CAEf,wBAAwB;CAExB,wBAAwB;CAExB,gBAAgB;CAEhB,gBAAgB;CAEhB,mBAAmB;CAEnB,0BAA0B;CAE1B,oBAAoB;CAEpB,uBAAuB;CAMvB,sBAAsB;CAEtB,6BAA6B;CAE7B,2BAA2B;CAE3B,uBAAuB;CAEvB,sBAAsB;CAEtB,6BAA6B;CAE7B,2BAA2B;CAE3B,iBAAiB;CAEjB,gCAAgC;CAEhC,kCAAkC;CAElC,iCAAiC;CAMjC,qBAAqB;CAMrB,gBAAgB;CAKhB,kCAAkC;CAMlC,8BAA8B;CAM9B,kCAAkC;CAElC,eAAe;CAEf,sBAAsB;CAKtB,oBAAoB;CAMpB,qBAAqB;CAOrB,sBAAsB;AACxB,CAAU"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./dsl/filter/operator.cjs"),t=require("./dsl/aggregation/types.cjs"),n=require("./dsl/deletionState.cjs"),r=require("./dsl/filter/builders.cjs"),i=require("./dsl/sort.cjs"),a=require("./dsl/aggregation/builders.cjs"),o=require("./dsl/projection.cjs"),s=require("./dsl/pagination.cjs"),c=require("./dsl/cursorQuery.cjs"),l=require("./dsl/queryable.cjs"),u=require("./dsl/descriptor.cjs"),d=require("./error/errorInfo.cjs"),f=require("./error/headers.cjs"),p=require("./error/wowError.cjs"),m=require("./model/command.cjs"),h=require("./transport/endpoints.cjs"),g=require("./client/command/commandClient.cjs"),_=require("./client/command/commandHeaders.cjs"),v=require("./model/abac.cjs"),y=require("./model/bi.cjs"),b=require("./model/function.cjs"),x=require("./client/command/commandRequest.cjs"),S=require("./client/metadata/wowMetadataClient.cjs"),C=require("./client/query/event/domainEventStream.cjs"),w=require("./client/query/event/eventStreamQueryClient.cjs"),T=require("./client/query/snapshot/snapshot.cjs"),E=require("./client/query/snapshot/snapshotQueryClient.cjs"),D=require("./client/query/state/loadStateAggregateClient.cjs"),O=require("./client/query/state/loadOwnerStateAggregateClient.cjs"),k=require("./client/query/descriptor/queryDescriptorClient.cjs"),A=require("./client/query/factory.cjs"),j=require("./client/routing.cjs"),M=require("./error/queryErrorCodes.cjs");exports.AGGREGATION_LIMITS=t.AGGREGATION_LIMITS,exports.AggregationDatePart=t.AggregationDatePart,exports.AggregationDateUnit=t.AggregationDateUnit,exports.AggregationExpressionOperator=t.AggregationExpressionOperator,exports.AggregationExpressionType=t.AggregationExpressionType,exports.AggregationFunction=t.AggregationFunction,exports.AggregationGroupType=t.AggregationGroupType,exports.AggregationMetricType=t.AggregationMetricType,exports.COMMAND_STREAM_ENDPOINT=h.COMMAND_STREAM_ENDPOINT,Object.defineProperty(exports,"CommandClient",{enumerable:!0,get:function(){return g.CommandClient}}),exports.CommandHeaders=_.CommandHeaders,exports.CommandStage=m.CommandStage,exports.ComparisonOperator=t.ComparisonOperator,exports.DEFAULT_CURSOR_SIZE=c.DEFAULT_CURSOR_SIZE,exports.DEFAULT_PAGINATION=s.DEFAULT_PAGINATION,exports.DateDiffUnit=t.DateDiffUnit,exports.DeletionState=n.DeletionState,exports.DerivedExpressionType=t.DerivedExpressionType,exports.DomainEventStreamMetadataFields=C.DomainEventStreamMetadataFields,exports.EMPTY_ABAC_TAGS=v.EMPTY_ABAC_TAGS,exports.ErrorCodes=d.ErrorCodes,Object.defineProperty(exports,"EventStreamQueryClient",{enumerable:!0,get:function(){return w.EventStreamQueryClient}}),exports.FilterOperator=e.FilterOperator,exports.FunctionKind=b.FunctionKind,exports.HavingExpressionType=t.HavingExpressionType,Object.defineProperty(exports,"LoadOwnerStateAggregateClient",{enumerable:!0,get:function(){return O.LoadOwnerStateAggregateClient}}),Object.defineProperty(exports,"LoadStateAggregateClient",{enumerable:!0,get:function(){return D.LoadStateAggregateClient}}),exports.MAX_CURSOR_SIZE=c.MAX_CURSOR_SIZE,exports.MAX_CURSOR_SORT_FIELDS=c.MAX_CURSOR_SORT_FIELDS,exports.MessageHeaderSqlType=y.MessageHeaderSqlType,exports.PagingMode=u.PagingMode,exports.QUERY_STREAM_ENDPOINT=h.QUERY_STREAM_ENDPOINT,exports.QueryClientFactory=A.QueryClientFactory,exports.QueryConstraintTypes=u.QueryConstraintTypes,exports.QueryDescriptorClient=k.QueryDescriptorClient,exports.QueryErrorCodes=M.QueryErrorCodes,exports.QueryFieldRoles=u.QueryFieldRoles,exports.QueryModels=u.QueryModels,exports.QueryValueKind=u.QueryValueKind,exports.QueryValueTypes=u.QueryValueTypes,exports.RecoverableType=d.RecoverableType,exports.ResourceAttributionPathSpec=j.ResourceAttributionPathSpec,exports.SearchMode=e.SearchMode,exports.SensitivityLevel=u.SensitivityLevel,exports.SnapshotMetadataFields=T.SnapshotMetadataFields,Object.defineProperty(exports,"SnapshotQueryClient",{enumerable:!0,get:function(){return E.SnapshotQueryClient}}),exports.SortDirection=i.SortDirection,exports.StringComparison=e.StringComparison,exports.TimeUnit=e.TimeUnit,exports.WILDCARD_ABAC_TAG_VALUES=v.WILDCARD_ABAC_TAG_VALUES,exports.WowError=p.WowError,exports.WowHeaders=f.WowHeaders,Object.defineProperty(exports,"WowMetadataClient",{enumerable:!0,get:function(){return S.WowMetadataClient}}),exports.aggregation=a.aggregation,exports.asc=i.asc,exports.commandHeaders=x.commandHeaders,exports.cursorQuery=c.cursorQuery,exports.desc=i.desc,exports.filter=r.filter,exports.isErrorInfo=p.isErrorInfo,exports.listQuery=l.listQuery,exports.pagedList=l.pagedList,exports.pagedQuery=l.pagedQuery,exports.pagination=s.pagination,exports.projection=o.projection,exports.singleQuery=l.singleQuery,exports.toWowError=p.toWowError,exports.waitStrategy=x.waitStrategy;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./dsl/filter/operator.cjs"),t=require("./dsl/aggregation/types.cjs"),n=require("./dsl/deletionState.cjs"),r=require("./dsl/filter/builders.cjs"),i=require("./dsl/sort.cjs"),a=require("./dsl/aggregation/builders.cjs"),o=require("./dsl/projection.cjs"),s=require("./dsl/pagination.cjs"),c=require("./dsl/cursorQuery.cjs"),l=require("./dsl/queryable.cjs"),u=require("./dsl/descriptor.cjs"),d=require("./error/errorInfo.cjs"),f=require("./error/headers.cjs"),p=require("./error/wowError.cjs"),m=require("./model/command.cjs"),h=require("./transport/endpoints.cjs"),g=require("./client/command/commandClient.cjs"),_=require("./client/command/commandHeaders.cjs"),v=require("./model/abac.cjs"),y=require("./model/bi.cjs"),b=require("./model/domainEventStream.cjs"),x=require("./model/function.cjs"),S=require("./model/snapshot.cjs"),C=require("./client/command/commandRequest.cjs"),w=require("./client/metadata/wowMetadataClient.cjs"),T=require("./client/query/event/eventStreamQueryClient.cjs"),E=require("./client/query/snapshot/snapshotQueryClient.cjs"),D=require("./client/query/state/loadStateAggregateClient.cjs"),O=require("./client/query/state/loadOwnerStateAggregateClient.cjs"),k=require("./client/query/descriptor/queryDescriptorClient.cjs"),A=require("./client/routing.cjs"),j=require("./client/query/dataset/datasetQueryClient.cjs"),M=require("./client/query/dataset/datasetDirectoryClient.cjs"),N=require("./client/query/factory.cjs"),P=require("./error/queryErrorCodes.cjs");exports.AGGREGATION_LIMITS=t.AGGREGATION_LIMITS,exports.AggregationDatePart=t.AggregationDatePart,exports.AggregationDateUnit=t.AggregationDateUnit,exports.AggregationExpressionOperator=t.AggregationExpressionOperator,exports.AggregationExpressionType=t.AggregationExpressionType,exports.AggregationFunction=t.AggregationFunction,exports.AggregationGroupScope=t.AggregationGroupScope,exports.AggregationGroupType=t.AggregationGroupType,exports.AggregationMetricType=t.AggregationMetricType,exports.COMMAND_STREAM_ENDPOINT=h.COMMAND_STREAM_ENDPOINT,Object.defineProperty(exports,"CommandClient",{enumerable:!0,get:function(){return g.CommandClient}}),exports.CommandHeaders=_.CommandHeaders,exports.CommandStage=m.CommandStage,exports.ComparisonOperator=t.ComparisonOperator,exports.DEFAULT_CURSOR_SIZE=c.DEFAULT_CURSOR_SIZE,exports.DEFAULT_PAGINATION=s.DEFAULT_PAGINATION,Object.defineProperty(exports,"DatasetDirectoryClient",{enumerable:!0,get:function(){return M.DatasetDirectoryClient}}),Object.defineProperty(exports,"DatasetQueryClient",{enumerable:!0,get:function(){return j.DatasetQueryClient}}),exports.DateDiffUnit=t.DateDiffUnit,exports.DeletionState=n.DeletionState,exports.DerivedExpressionType=t.DerivedExpressionType,exports.DomainEventStreamMetadataFields=b.DomainEventStreamMetadataFields,exports.EMPTY_ABAC_TAGS=v.EMPTY_ABAC_TAGS,exports.ErrorCodes=d.ErrorCodes,Object.defineProperty(exports,"EventStreamQueryClient",{enumerable:!0,get:function(){return T.EventStreamQueryClient}}),exports.FilterOperator=e.FilterOperator,exports.FunctionKind=x.FunctionKind,exports.HavingExpressionType=t.HavingExpressionType,Object.defineProperty(exports,"LoadOwnerStateAggregateClient",{enumerable:!0,get:function(){return O.LoadOwnerStateAggregateClient}}),Object.defineProperty(exports,"LoadStateAggregateClient",{enumerable:!0,get:function(){return D.LoadStateAggregateClient}}),exports.MAX_CURSOR_SIZE=c.MAX_CURSOR_SIZE,exports.MAX_CURSOR_SORT_FIELDS=c.MAX_CURSOR_SORT_FIELDS,exports.MessageHeaderSqlType=y.MessageHeaderSqlType,exports.PagingMode=u.PagingMode,exports.QUERY_STREAM_ENDPOINT=h.QUERY_STREAM_ENDPOINT,exports.QueryClientFactory=N.QueryClientFactory,exports.QueryConstraintTypes=u.QueryConstraintTypes,exports.QueryDescriptorClient=k.QueryDescriptorClient,exports.QueryErrorCodes=P.QueryErrorCodes,exports.QueryFieldRoles=u.QueryFieldRoles,exports.QueryModels=u.QueryModels,exports.QueryValueKind=u.QueryValueKind,exports.QueryValueTypes=u.QueryValueTypes,exports.RecoverableType=d.RecoverableType,exports.ResourceAttributionPathSpec=A.ResourceAttributionPathSpec,exports.RunningFunction=t.RunningFunction,exports.SearchMode=e.SearchMode,exports.SensitivityLevel=u.SensitivityLevel,exports.SnapshotMetadataFields=S.SnapshotMetadataFields,Object.defineProperty(exports,"SnapshotQueryClient",{enumerable:!0,get:function(){return E.SnapshotQueryClient}}),exports.SortDirection=i.SortDirection,exports.StringComparison=e.StringComparison,exports.TimeUnit=e.TimeUnit,exports.WILDCARD_ABAC_TAG_VALUES=v.WILDCARD_ABAC_TAG_VALUES,exports.WindowFunction=t.WindowFunction,exports.WowError=p.WowError,exports.WowHeaders=f.WowHeaders,Object.defineProperty(exports,"WowMetadataClient",{enumerable:!0,get:function(){return w.WowMetadataClient}}),exports.aggregation=a.aggregation,exports.asc=i.asc,exports.commandHeaders=C.commandHeaders,exports.cursorQuery=c.cursorQuery,exports.datasetBasePath=j.datasetBasePath,exports.desc=i.desc,exports.filter=r.filter,exports.isErrorInfo=p.isErrorInfo,exports.listQuery=l.listQuery,exports.pagedList=l.pagedList,exports.pagedQuery=l.pagedQuery,exports.pagination=s.pagination,exports.projection=o.projection,exports.singleQuery=l.singleQuery,exports.toWowError=p.toWowError,exports.waitStrategy=C.waitStrategy;
package/dist/index.es.js CHANGED
@@ -1,34 +1,36 @@
1
1
  import { FilterOperator as e, SearchMode as t, StringComparison as n, TimeUnit as r } from "./dsl/filter/operator.es.js";
2
- import { AGGREGATION_LIMITS as i, AggregationDatePart as a, AggregationDateUnit as o, AggregationExpressionOperator as s, AggregationExpressionType as c, AggregationFunction as l, AggregationGroupType as u, AggregationMetricType as d, ComparisonOperator as f, DateDiffUnit as p, DerivedExpressionType as m, HavingExpressionType as h } from "./dsl/aggregation/types.es.js";
3
- import { DeletionState as g } from "./dsl/deletionState.es.js";
4
- import { filter as _ } from "./dsl/filter/builders.es.js";
5
- import { SortDirection as v, asc as y, desc as b } from "./dsl/sort.es.js";
6
- import { aggregation as x } from "./dsl/aggregation/builders.es.js";
7
- import { projection as S } from "./dsl/projection.es.js";
8
- import { DEFAULT_PAGINATION as C, pagination as w } from "./dsl/pagination.es.js";
9
- import { DEFAULT_CURSOR_SIZE as T, MAX_CURSOR_SIZE as E, MAX_CURSOR_SORT_FIELDS as D, cursorQuery as O } from "./dsl/cursorQuery.es.js";
10
- import { listQuery as k, pagedList as A, pagedQuery as j, singleQuery as M } from "./dsl/queryable.es.js";
11
- import { PagingMode as N, QueryConstraintTypes as P, QueryFieldRoles as F, QueryModels as I, QueryValueKind as L, QueryValueTypes as R, SensitivityLevel as z } from "./dsl/descriptor.es.js";
12
- import { ErrorCodes as B, RecoverableType as V } from "./error/errorInfo.es.js";
13
- import { WowHeaders as H } from "./error/headers.es.js";
14
- import { WowError as U, isErrorInfo as W, toWowError as G } from "./error/wowError.es.js";
15
- import { CommandStage as K } from "./model/command.es.js";
16
- import { COMMAND_STREAM_ENDPOINT as q, QUERY_STREAM_ENDPOINT as J } from "./transport/endpoints.es.js";
17
- import { CommandClient as Y } from "./client/command/commandClient.es.js";
18
- import { CommandHeaders as X } from "./client/command/commandHeaders.es.js";
19
- import { EMPTY_ABAC_TAGS as Z, WILDCARD_ABAC_TAG_VALUES as Q } from "./model/abac.es.js";
20
- import { MessageHeaderSqlType as $ } from "./model/bi.es.js";
21
- import { FunctionKind as ee } from "./model/function.es.js";
22
- import { commandHeaders as te, waitStrategy as ne } from "./client/command/commandRequest.es.js";
23
- import { WowMetadataClient as re } from "./client/metadata/wowMetadataClient.es.js";
24
- import { DomainEventStreamMetadataFields as ie } from "./client/query/event/domainEventStream.es.js";
25
- import { EventStreamQueryClient as ae } from "./client/query/event/eventStreamQueryClient.es.js";
26
- import { SnapshotMetadataFields as oe } from "./client/query/snapshot/snapshot.es.js";
27
- import { SnapshotQueryClient as se } from "./client/query/snapshot/snapshotQueryClient.es.js";
28
- import { LoadStateAggregateClient as ce } from "./client/query/state/loadStateAggregateClient.es.js";
29
- import { LoadOwnerStateAggregateClient as le } from "./client/query/state/loadOwnerStateAggregateClient.es.js";
30
- import { QueryDescriptorClient as ue } from "./client/query/descriptor/queryDescriptorClient.es.js";
31
- import { QueryClientFactory as de } from "./client/query/factory.es.js";
32
- import { ResourceAttributionPathSpec as fe } from "./client/routing.es.js";
33
- import { QueryErrorCodes as pe } from "./error/queryErrorCodes.es.js";
34
- export { i as AGGREGATION_LIMITS, a as AggregationDatePart, o as AggregationDateUnit, s as AggregationExpressionOperator, c as AggregationExpressionType, l as AggregationFunction, u as AggregationGroupType, d as AggregationMetricType, q as COMMAND_STREAM_ENDPOINT, Y as CommandClient, X as CommandHeaders, K as CommandStage, f as ComparisonOperator, T as DEFAULT_CURSOR_SIZE, C as DEFAULT_PAGINATION, p as DateDiffUnit, g as DeletionState, m as DerivedExpressionType, ie as DomainEventStreamMetadataFields, Z as EMPTY_ABAC_TAGS, B as ErrorCodes, ae as EventStreamQueryClient, e as FilterOperator, ee as FunctionKind, h as HavingExpressionType, le as LoadOwnerStateAggregateClient, ce as LoadStateAggregateClient, E as MAX_CURSOR_SIZE, D as MAX_CURSOR_SORT_FIELDS, $ as MessageHeaderSqlType, N as PagingMode, J as QUERY_STREAM_ENDPOINT, de as QueryClientFactory, P as QueryConstraintTypes, ue as QueryDescriptorClient, pe as QueryErrorCodes, F as QueryFieldRoles, I as QueryModels, L as QueryValueKind, R as QueryValueTypes, V as RecoverableType, fe as ResourceAttributionPathSpec, t as SearchMode, z as SensitivityLevel, oe as SnapshotMetadataFields, se as SnapshotQueryClient, v as SortDirection, n as StringComparison, r as TimeUnit, Q as WILDCARD_ABAC_TAG_VALUES, U as WowError, H as WowHeaders, re as WowMetadataClient, x as aggregation, y as asc, te as commandHeaders, O as cursorQuery, b as desc, _ as filter, W as isErrorInfo, k as listQuery, A as pagedList, j as pagedQuery, w as pagination, S as projection, M as singleQuery, G as toWowError, ne as waitStrategy };
2
+ import { AGGREGATION_LIMITS as i, AggregationDatePart as a, AggregationDateUnit as o, AggregationExpressionOperator as s, AggregationExpressionType as c, AggregationFunction as l, AggregationGroupScope as u, AggregationGroupType as d, AggregationMetricType as f, ComparisonOperator as p, DateDiffUnit as m, DerivedExpressionType as h, HavingExpressionType as g, RunningFunction as _, WindowFunction as v } from "./dsl/aggregation/types.es.js";
3
+ import { DeletionState as y } from "./dsl/deletionState.es.js";
4
+ import { filter as b } from "./dsl/filter/builders.es.js";
5
+ import { SortDirection as x, asc as S, desc as C } from "./dsl/sort.es.js";
6
+ import { aggregation as w } from "./dsl/aggregation/builders.es.js";
7
+ import { projection as T } from "./dsl/projection.es.js";
8
+ import { DEFAULT_PAGINATION as E, pagination as D } from "./dsl/pagination.es.js";
9
+ import { DEFAULT_CURSOR_SIZE as O, MAX_CURSOR_SIZE as k, MAX_CURSOR_SORT_FIELDS as A, cursorQuery as j } from "./dsl/cursorQuery.es.js";
10
+ import { listQuery as M, pagedList as N, pagedQuery as P, singleQuery as F } from "./dsl/queryable.es.js";
11
+ import { PagingMode as I, QueryConstraintTypes as L, QueryFieldRoles as R, QueryModels as z, QueryValueKind as B, QueryValueTypes as V, SensitivityLevel as H } from "./dsl/descriptor.es.js";
12
+ import { ErrorCodes as U, RecoverableType as W } from "./error/errorInfo.es.js";
13
+ import { WowHeaders as G } from "./error/headers.es.js";
14
+ import { WowError as K, isErrorInfo as q, toWowError as J } from "./error/wowError.es.js";
15
+ import { CommandStage as Y } from "./model/command.es.js";
16
+ import { COMMAND_STREAM_ENDPOINT as X, QUERY_STREAM_ENDPOINT as Z } from "./transport/endpoints.es.js";
17
+ import { CommandClient as Q } from "./client/command/commandClient.es.js";
18
+ import { CommandHeaders as $ } from "./client/command/commandHeaders.es.js";
19
+ import { EMPTY_ABAC_TAGS as ee, WILDCARD_ABAC_TAG_VALUES as te } from "./model/abac.es.js";
20
+ import { MessageHeaderSqlType as ne } from "./model/bi.es.js";
21
+ import { DomainEventStreamMetadataFields as re } from "./model/domainEventStream.es.js";
22
+ import { FunctionKind as ie } from "./model/function.es.js";
23
+ import { SnapshotMetadataFields as ae } from "./model/snapshot.es.js";
24
+ import { commandHeaders as oe, waitStrategy as se } from "./client/command/commandRequest.es.js";
25
+ import { WowMetadataClient as ce } from "./client/metadata/wowMetadataClient.es.js";
26
+ import { EventStreamQueryClient as le } from "./client/query/event/eventStreamQueryClient.es.js";
27
+ import { SnapshotQueryClient as ue } from "./client/query/snapshot/snapshotQueryClient.es.js";
28
+ import { LoadStateAggregateClient as de } from "./client/query/state/loadStateAggregateClient.es.js";
29
+ import { LoadOwnerStateAggregateClient as fe } from "./client/query/state/loadOwnerStateAggregateClient.es.js";
30
+ import { QueryDescriptorClient as pe } from "./client/query/descriptor/queryDescriptorClient.es.js";
31
+ import { ResourceAttributionPathSpec as me } from "./client/routing.es.js";
32
+ import { DatasetQueryClient as he, datasetBasePath as ge } from "./client/query/dataset/datasetQueryClient.es.js";
33
+ import { DatasetDirectoryClient as _e } from "./client/query/dataset/datasetDirectoryClient.es.js";
34
+ import { QueryClientFactory as ve } from "./client/query/factory.es.js";
35
+ import { QueryErrorCodes as ye } from "./error/queryErrorCodes.es.js";
36
+ export { i as AGGREGATION_LIMITS, a as AggregationDatePart, o as AggregationDateUnit, s as AggregationExpressionOperator, c as AggregationExpressionType, l as AggregationFunction, u as AggregationGroupScope, d as AggregationGroupType, f as AggregationMetricType, X as COMMAND_STREAM_ENDPOINT, Q as CommandClient, $ as CommandHeaders, Y as CommandStage, p as ComparisonOperator, O as DEFAULT_CURSOR_SIZE, E as DEFAULT_PAGINATION, _e as DatasetDirectoryClient, he as DatasetQueryClient, m as DateDiffUnit, y as DeletionState, h as DerivedExpressionType, re as DomainEventStreamMetadataFields, ee as EMPTY_ABAC_TAGS, U as ErrorCodes, le as EventStreamQueryClient, e as FilterOperator, ie as FunctionKind, g as HavingExpressionType, fe as LoadOwnerStateAggregateClient, de as LoadStateAggregateClient, k as MAX_CURSOR_SIZE, A as MAX_CURSOR_SORT_FIELDS, ne as MessageHeaderSqlType, I as PagingMode, Z as QUERY_STREAM_ENDPOINT, ve as QueryClientFactory, L as QueryConstraintTypes, pe as QueryDescriptorClient, ye as QueryErrorCodes, R as QueryFieldRoles, z as QueryModels, B as QueryValueKind, V as QueryValueTypes, W as RecoverableType, me as ResourceAttributionPathSpec, _ as RunningFunction, t as SearchMode, H as SensitivityLevel, ae as SnapshotMetadataFields, ue as SnapshotQueryClient, x as SortDirection, n as StringComparison, r as TimeUnit, te as WILDCARD_ABAC_TAG_VALUES, v as WindowFunction, K as WowError, G as WowHeaders, ce as WowMetadataClient, w as aggregation, S as asc, oe as commandHeaders, j as cursorQuery, ge as datasetBasePath, C as desc, b as filter, q as isErrorInfo, M as listQuery, N as pagedList, P as pagedQuery, D as pagination, T as projection, F as singleQuery, J as toWowError, se as waitStrategy };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domainEventStream.cjs","names":["DomainEventStreamMetadataFields"],"sources":["../../src/model/domainEventStream.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 { CommandId, CommandStage, RequestId } from './command.js';\nimport type { Identifier, Version } from './common.js';\nimport type { BodyCapable } from './messaging.js';\nimport type {\n AggregateId,\n CreateTimeCapable,\n DeletedCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n OwnerId,\n SpaceIdCapable,\n StateCapable,\n} from './modeling.js';\nimport type { Named } from './naming.js';\n\n/**\n * Represents a domain event with a specific body type.\n * Extends Identifier, Named, and BodyCapable interfaces to provide identification,\n * naming, and body capabilities for the domain event.\n * @template BODY - The type of the event content for this domain event\n */\nexport interface DomainEvent<BODY>\n extends Identifier, Named, BodyCapable<BODY> {\n /**\n * The type of the event content.\n */\n bodyType: string;\n /**\n * The revision of the domain event.\n */\n revision: string;\n}\n\n/**\n * Represents the header information for a domain event stream.\n * Contains metadata about the event stream such as command information,\n * network details, and tracing information.\n */\nexport interface DomainEventStreamHeader {\n /**\n * The operator that executed the command.\n */\n command_operator?: string;\n /**\n * The endpoint to wait for command completion.\n */\n command_wait_endpoint?: string;\n /**\n * The stage to wait for in command execution.\n */\n command_wait_stage?: CommandStage;\n /**\n * Whether the command could be processed locally, `'true'` or `'false'`.\n */\n local_first?: string;\n /**\n * The IP address of the remote client.\n */\n remote_ip?: string;\n /**\n * The user agent of the client.\n */\n user_agent?: string;\n /**\n * The trace identifier for distributed tracing.\n */\n trace_id?: string;\n\n /**\n * Index signature for additional custom header properties.\n * Allows for any additional string key-value pairs to be included as header properties.\n */\n [key: string]: string | undefined;\n}\n\n/**\n * Represents a stream of domain events.\n * Combines multiple interfaces to provide a complete domain event stream,\n * including identification, aggregation, ownership, command information,\n * versioning, and the actual event data.\n */\nexport interface DomainEventStream<DomainEventBody = unknown>\n extends\n Identifier,\n AggregateId,\n OwnerId,\n SpaceIdCapable,\n CommandId,\n CreateTimeCapable,\n RequestId,\n Version,\n BodyCapable<DomainEvent<DomainEventBody>[]> {\n /**\n * The header information for the domain event stream.\n */\n header: DomainEventStreamHeader;\n}\n\n/**\n * A domain event stream together with the aggregate state after it was\n * applied: what Wow publishes on its state event bus. Wow's OpenAPI document\n * derives an `…StateEvent` schema from each aggregate's state, which\n * generated code maps to this type.\n *\n * @template DomainEventBody - The type of the event bodies\n * @template S - The type of the aggregate state\n */\nexport interface StateEvent<DomainEventBody = unknown, S = unknown>\n extends\n DomainEventStream<DomainEventBody>,\n StateCapable<S>,\n FirstOperatorCapable,\n FirstEventTimeCapable,\n DeletedCapable {}\n\n/**\n * The field names of a domain event stream, for filters, sorts and\n * projections over event streams (`body.name`, `header.command_operator`, …).\n *\n * A frozen name table: read `DomainEventStreamMetadataFields.BODY_NAME`; each\n * value is a string literal type.\n */\nexport const DomainEventStreamMetadataFields = Object.freeze({\n HEADER: 'header',\n COMMAND_OPERATOR: 'header.command_operator',\n AGGREGATE_ID: 'aggregateId',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n COMMAND_ID: 'commandId',\n REQUEST_ID: 'requestId',\n VERSION: 'version',\n BODY: 'body',\n BODY_ID: 'body.id',\n BODY_NAME: 'body.name',\n BODY_TYPE: 'body.bodyType',\n BODY_REVISION: 'body.revision',\n BODY_BODY: 'body.body',\n CREATE_TIME: 'createTime',\n} as const);\n"],"mappings":"AAuIA,IAAaA,EAAkC,OAAO,OAAO,CAC3D,OAAQ,SACR,iBAAkB,0BAClB,aAAc,cACd,UAAW,WACX,SAAU,UACV,SAAU,UACV,WAAY,YACZ,WAAY,YACZ,QAAS,UACT,KAAM,OACN,QAAS,UACT,UAAW,YACX,UAAW,gBACX,cAAe,gBACf,UAAW,YACX,YAAa,YACf,CAAU"}
@@ -1,4 +1,8 @@
1
- import { AggregateId, CreateTimeCapable, DeletedCapable, FirstEventTimeCapable, FirstOperatorCapable, Identifier, Named, OwnerId, SpaceIdCapable, StateCapable, Version, BodyCapable, CommandId, CommandStage, RequestId } from '../../../model/index.cjs';
1
+ import { CommandId, CommandStage, RequestId } from './command.cjs';
2
+ import { Identifier, Version } from './common.cjs';
3
+ import { BodyCapable } from './messaging.cjs';
4
+ import { AggregateId, CreateTimeCapable, DeletedCapable, FirstEventTimeCapable, FirstOperatorCapable, OwnerId, SpaceIdCapable, StateCapable } from './modeling.cjs';
5
+ import { Named } from './naming.cjs';
2
6
  /**
3
7
  * Represents a domain event with a specific body type.
4
8
  * Extends Identifier, Named, and BodyCapable interfaces to provide identification,
@@ -1,4 +1,8 @@
1
- import { AggregateId, CreateTimeCapable, DeletedCapable, FirstEventTimeCapable, FirstOperatorCapable, Identifier, Named, OwnerId, SpaceIdCapable, StateCapable, Version, BodyCapable, CommandId, CommandStage, RequestId } from '../../../model/index.js';
1
+ import { CommandId, CommandStage, RequestId } from './command.js';
2
+ import { Identifier, Version } from './common.js';
3
+ import { BodyCapable } from './messaging.js';
4
+ import { AggregateId, CreateTimeCapable, DeletedCapable, FirstEventTimeCapable, FirstOperatorCapable, OwnerId, SpaceIdCapable, StateCapable } from './modeling.js';
5
+ import { Named } from './naming.js';
2
6
  /**
3
7
  * Represents a domain event with a specific body type.
4
8
  * Extends Identifier, Named, and BodyCapable interfaces to provide identification,
@@ -1,4 +1,4 @@
1
- //#region src/client/query/event/domainEventStream.ts
1
+ //#region src/model/domainEventStream.ts
2
2
  var e = Object.freeze({
3
3
  HEADER: "header",
4
4
  COMMAND_OPERATOR: "header.command_operator",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domainEventStream.es.js","names":["DomainEventStreamMetadataFields"],"sources":["../../src/model/domainEventStream.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 { CommandId, CommandStage, RequestId } from './command.js';\nimport type { Identifier, Version } from './common.js';\nimport type { BodyCapable } from './messaging.js';\nimport type {\n AggregateId,\n CreateTimeCapable,\n DeletedCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n OwnerId,\n SpaceIdCapable,\n StateCapable,\n} from './modeling.js';\nimport type { Named } from './naming.js';\n\n/**\n * Represents a domain event with a specific body type.\n * Extends Identifier, Named, and BodyCapable interfaces to provide identification,\n * naming, and body capabilities for the domain event.\n * @template BODY - The type of the event content for this domain event\n */\nexport interface DomainEvent<BODY>\n extends Identifier, Named, BodyCapable<BODY> {\n /**\n * The type of the event content.\n */\n bodyType: string;\n /**\n * The revision of the domain event.\n */\n revision: string;\n}\n\n/**\n * Represents the header information for a domain event stream.\n * Contains metadata about the event stream such as command information,\n * network details, and tracing information.\n */\nexport interface DomainEventStreamHeader {\n /**\n * The operator that executed the command.\n */\n command_operator?: string;\n /**\n * The endpoint to wait for command completion.\n */\n command_wait_endpoint?: string;\n /**\n * The stage to wait for in command execution.\n */\n command_wait_stage?: CommandStage;\n /**\n * Whether the command could be processed locally, `'true'` or `'false'`.\n */\n local_first?: string;\n /**\n * The IP address of the remote client.\n */\n remote_ip?: string;\n /**\n * The user agent of the client.\n */\n user_agent?: string;\n /**\n * The trace identifier for distributed tracing.\n */\n trace_id?: string;\n\n /**\n * Index signature for additional custom header properties.\n * Allows for any additional string key-value pairs to be included as header properties.\n */\n [key: string]: string | undefined;\n}\n\n/**\n * Represents a stream of domain events.\n * Combines multiple interfaces to provide a complete domain event stream,\n * including identification, aggregation, ownership, command information,\n * versioning, and the actual event data.\n */\nexport interface DomainEventStream<DomainEventBody = unknown>\n extends\n Identifier,\n AggregateId,\n OwnerId,\n SpaceIdCapable,\n CommandId,\n CreateTimeCapable,\n RequestId,\n Version,\n BodyCapable<DomainEvent<DomainEventBody>[]> {\n /**\n * The header information for the domain event stream.\n */\n header: DomainEventStreamHeader;\n}\n\n/**\n * A domain event stream together with the aggregate state after it was\n * applied: what Wow publishes on its state event bus. Wow's OpenAPI document\n * derives an `…StateEvent` schema from each aggregate's state, which\n * generated code maps to this type.\n *\n * @template DomainEventBody - The type of the event bodies\n * @template S - The type of the aggregate state\n */\nexport interface StateEvent<DomainEventBody = unknown, S = unknown>\n extends\n DomainEventStream<DomainEventBody>,\n StateCapable<S>,\n FirstOperatorCapable,\n FirstEventTimeCapable,\n DeletedCapable {}\n\n/**\n * The field names of a domain event stream, for filters, sorts and\n * projections over event streams (`body.name`, `header.command_operator`, …).\n *\n * A frozen name table: read `DomainEventStreamMetadataFields.BODY_NAME`; each\n * value is a string literal type.\n */\nexport const DomainEventStreamMetadataFields = Object.freeze({\n HEADER: 'header',\n COMMAND_OPERATOR: 'header.command_operator',\n AGGREGATE_ID: 'aggregateId',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n COMMAND_ID: 'commandId',\n REQUEST_ID: 'requestId',\n VERSION: 'version',\n BODY: 'body',\n BODY_ID: 'body.id',\n BODY_NAME: 'body.name',\n BODY_TYPE: 'body.bodyType',\n BODY_REVISION: 'body.revision',\n BODY_BODY: 'body.body',\n CREATE_TIME: 'createTime',\n} as const);\n"],"mappings":";AAuIA,IAAaA,IAAkC,OAAO,OAAO;CAC3D,QAAQ;CACR,kBAAkB;CAClB,cAAc;CACd,WAAW;CACX,UAAU;CACV,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,SAAS;CACT,MAAM;CACN,SAAS;CACT,WAAW;CACX,WAAW;CACX,eAAe;CACf,WAAW;CACX,aAAa;AACf,CAAU"}
@@ -15,8 +15,10 @@
15
15
  export * from './abac.cjs';
16
16
  export * from './bi.cjs';
17
17
  export * from './command.cjs';
18
+ export * from './domainEventStream.cjs';
18
19
  export * from './common.cjs';
19
20
  export * from './function.cjs';
20
21
  export * from './messaging.cjs';
21
22
  export * from './modeling.cjs';
22
23
  export * from './naming.cjs';
24
+ export * from './snapshot.cjs';
@@ -15,8 +15,10 @@
15
15
  export * from './abac.js';
16
16
  export * from './bi.js';
17
17
  export * from './command.js';
18
+ export * from './domainEventStream.js';
18
19
  export * from './common.js';
19
20
  export * from './function.js';
20
21
  export * from './messaging.js';
21
22
  export * from './modeling.js';
22
23
  export * from './naming.js';
24
+ export * from './snapshot.js';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.cjs","names":["SnapshotMetadataFields"],"sources":["../../src/model/snapshot.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AbacTaggable } from './abac.js';\nimport type { Version } from './common.js';\nimport type {\n AggregateId,\n DeletedCapable,\n EventIdCapable,\n EventTimeCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n OperatorCapable,\n OwnerId,\n SnapshotTimeCapable,\n SpaceIdCapable,\n StateCapable,\n TenantId,\n} from './modeling.js';\n\n/**\n * Interface for materialized snapshots with full capabilities.\n */\nexport interface MaterializedSnapshot<S>\n extends\n StateCapable<S>,\n AggregateId,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n SnapshotTimeCapable,\n AbacTaggable,\n DeletedCapable {}\n\n/**\n * Interface for materialized snapshots with medium capabilities.\n *\n * Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance.\n * This interface is designed to be generic, capable of holding state data of any type.\n * Each snapshot corresponds to a specific version of the state within a tenant and owner context,\n * and records information such as event IDs and operation times to support tracing and auditing.\n *\n * Mirrors `MediumMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/MediumMaterializedSnapshot.kt`.\n */\nexport interface MediumMaterializedSnapshot<S>\n extends\n StateCapable<S>,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n AbacTaggable {}\n\n/**\n * Interface for simplified materialized snapshots with generic state.\n *\n * This interface implements multiple interfaces to provide version, materialization, first event time, and state information.\n *\n * Mirrors `SmallMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/SmallMaterializedSnapshot.kt`.\n */\nexport interface SmallMaterializedSnapshot<S>\n extends StateCapable<S>, Version, FirstEventTimeCapable {}\n\n/**\n * The field names of a materialized snapshot, for filters, sorts and\n * projections over snapshots (`tenantId`, `state`, `deleted`, …).\n *\n * A frozen name table: read `SnapshotMetadataFields.TENANT_ID`; each value is\n * a string literal type.\n */\nexport const SnapshotMetadataFields = Object.freeze({\n VERSION: 'version',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n EVENT_ID: 'eventId',\n FIRST_EVENT_TIME: 'firstEventTime',\n EVENT_TIME: 'eventTime',\n FIRST_OPERATOR: 'firstOperator',\n OPERATOR: 'operator',\n SNAPSHOT_TIME: 'snapshotTime',\n TAGS: 'tags',\n DELETED: 'deleted',\n STATE: 'state',\n} as const);\n"],"mappings":"AA6FA,IAAaA,EAAyB,OAAO,OAAO,CAClD,QAAS,UACT,UAAW,WACX,SAAU,UACV,SAAU,UACV,SAAU,UACV,iBAAkB,iBAClB,WAAY,YACZ,eAAgB,gBAChB,SAAU,WACV,cAAe,eACf,KAAM,OACN,QAAS,UACT,MAAO,OACT,CAAU"}
@@ -1,4 +1,6 @@
1
- import { AbacTaggable, AggregateId, DeletedCapable, EventIdCapable, EventTimeCapable, FirstEventTimeCapable, FirstOperatorCapable, OperatorCapable, OwnerId, SnapshotTimeCapable, SpaceIdCapable, StateCapable, TenantId, Version } from '../../../model/index.cjs';
1
+ import { AbacTaggable } from './abac.cjs';
2
+ import { Version } from './common.cjs';
3
+ import { AggregateId, DeletedCapable, EventIdCapable, EventTimeCapable, FirstEventTimeCapable, FirstOperatorCapable, OperatorCapable, OwnerId, SnapshotTimeCapable, SpaceIdCapable, StateCapable, TenantId } from './modeling.cjs';
2
4
  /**
3
5
  * Interface for materialized snapshots with full capabilities.
4
6
  */
@@ -1,4 +1,6 @@
1
- import { AbacTaggable, AggregateId, DeletedCapable, EventIdCapable, EventTimeCapable, FirstEventTimeCapable, FirstOperatorCapable, OperatorCapable, OwnerId, SnapshotTimeCapable, SpaceIdCapable, StateCapable, TenantId, Version } from '../../../model/index.js';
1
+ import { AbacTaggable } from './abac.js';
2
+ import { Version } from './common.js';
3
+ import { AggregateId, DeletedCapable, EventIdCapable, EventTimeCapable, FirstEventTimeCapable, FirstOperatorCapable, OperatorCapable, OwnerId, SnapshotTimeCapable, SpaceIdCapable, StateCapable, TenantId } from './modeling.js';
2
4
  /**
3
5
  * Interface for materialized snapshots with full capabilities.
4
6
  */
@@ -1,4 +1,4 @@
1
- //#region src/client/query/snapshot/snapshot.ts
1
+ //#region src/model/snapshot.ts
2
2
  var e = Object.freeze({
3
3
  VERSION: "version",
4
4
  TENANT_ID: "tenantId",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.es.js","names":["SnapshotMetadataFields"],"sources":["../../src/model/snapshot.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { AbacTaggable } from './abac.js';\nimport type { Version } from './common.js';\nimport type {\n AggregateId,\n DeletedCapable,\n EventIdCapable,\n EventTimeCapable,\n FirstEventTimeCapable,\n FirstOperatorCapable,\n OperatorCapable,\n OwnerId,\n SnapshotTimeCapable,\n SpaceIdCapable,\n StateCapable,\n TenantId,\n} from './modeling.js';\n\n/**\n * Interface for materialized snapshots with full capabilities.\n */\nexport interface MaterializedSnapshot<S>\n extends\n StateCapable<S>,\n AggregateId,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n SnapshotTimeCapable,\n AbacTaggable,\n DeletedCapable {}\n\n/**\n * Interface for materialized snapshots with medium capabilities.\n *\n * Represents a materialized snapshot for medium data, implementing multiple capabilities through inheritance.\n * This interface is designed to be generic, capable of holding state data of any type.\n * Each snapshot corresponds to a specific version of the state within a tenant and owner context,\n * and records information such as event IDs and operation times to support tracing and auditing.\n *\n * Mirrors `MediumMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/MediumMaterializedSnapshot.kt`.\n */\nexport interface MediumMaterializedSnapshot<S>\n extends\n StateCapable<S>,\n TenantId,\n OwnerId,\n SpaceIdCapable,\n Version,\n EventIdCapable,\n FirstOperatorCapable,\n OperatorCapable,\n FirstEventTimeCapable,\n EventTimeCapable,\n AbacTaggable {}\n\n/**\n * Interface for simplified materialized snapshots with generic state.\n *\n * This interface implements multiple interfaces to provide version, materialization, first event time, and state information.\n *\n * Mirrors `SmallMaterializedSnapshot` in\n * `wow-api/src/main/kotlin/me/ahoo/wow/api/query/SmallMaterializedSnapshot.kt`.\n */\nexport interface SmallMaterializedSnapshot<S>\n extends StateCapable<S>, Version, FirstEventTimeCapable {}\n\n/**\n * The field names of a materialized snapshot, for filters, sorts and\n * projections over snapshots (`tenantId`, `state`, `deleted`, …).\n *\n * A frozen name table: read `SnapshotMetadataFields.TENANT_ID`; each value is\n * a string literal type.\n */\nexport const SnapshotMetadataFields = Object.freeze({\n VERSION: 'version',\n TENANT_ID: 'tenantId',\n OWNER_ID: 'ownerId',\n SPACE_ID: 'spaceId',\n EVENT_ID: 'eventId',\n FIRST_EVENT_TIME: 'firstEventTime',\n EVENT_TIME: 'eventTime',\n FIRST_OPERATOR: 'firstOperator',\n OPERATOR: 'operator',\n SNAPSHOT_TIME: 'snapshotTime',\n TAGS: 'tags',\n DELETED: 'deleted',\n STATE: 'state',\n} as const);\n"],"mappings":";AA6FA,IAAaA,IAAyB,OAAO,OAAO;CAClD,SAAS;CACT,WAAW;CACX,UAAU;CACV,UAAU;CACV,UAAU;CACV,kBAAkB;CAClB,YAAY;CACZ,gBAAgB;CAChB,UAAU;CACV,eAAe;CACf,MAAM;CACN,SAAS;CACT,OAAO;AACT,CAAU"}
@@ -1,2 +1,2 @@
1
- const e=require("../error/wowError.cjs"),t=require("../model/command.cjs");let n=require("@ahoo-wang/fetcher-eventstream");var r=`message`,i=new Set(Object.values(t.CommandStage));function a(t){return new TransformStream({transform(n,r){t(n.event)?r.enqueue(n.data):r.error(new e.WowError(e.isErrorInfo(n.data)?n.data:{errorCode:n.event,errorMsg:``}))}})}var o=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(a(e=>e===r)),s=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(a(e=>i.has(e)));exports.CommandResultEventStreamResultExtractor=s,exports.QueryEventStreamResultExtractor=o;
1
+ const e=require("../error/wowError.cjs"),t=require("../model/command.cjs");let n=require("@ahoo-wang/fetcher-eventstream");var r=`message`,i=new Set(Object.values(t.CommandStage));function a(e){return typeof e==`object`&&!!e&&typeof e.stage==`string`}function o(t){return new TransformStream({transform(n,r){t(n)?r.enqueue(n.data):r.error(new e.WowError(e.isErrorInfo(n.data)?n.data:{errorCode:n.event,errorMsg:``}))}})}var s=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(o(e=>e.event===r)),c=async e=>(await(0,n.JsonEventStreamResultExtractor)(e)).pipeThrough(o(e=>i.has(e.event)||a(e.data)));exports.CommandResultEventStreamResultExtractor=c,exports.QueryEventStreamResultExtractor=s;
2
2
  //# sourceMappingURL=eventStreams.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventStreams.cjs","names":["CommandStage","WowError","isErrorInfo","JsonEventStreamResultExtractor","require_wowError","require_command","_ahoo_wang_fetcher_eventstream","ROW_EVENT","COMMAND_STAGES","rowsUntilErrorEvent","isData","event","controller","QueryEventStreamResultExtractor","exchange","eventName","CommandResultEventStreamResultExtractor"],"sources":["../../src/transport/eventStreams.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ResultExtractor } from '@ahoo-wang/fetcher';\nimport {\n JsonEventStreamResultExtractor,\n type JsonServerSentEvent,\n} from '@ahoo-wang/fetcher-eventstream';\nimport { isErrorInfo, WowError } from '../error/wowError.js';\nimport { type CommandResult, CommandStage } from '../model/command.js';\n\n/**\n * The event name the server gives the rows of a query stream. Wow sends them\n * without an `event:` field, which the event-stream parser reads as\n * `message`.\n */\nconst ROW_EVENT = 'message';\n\nconst COMMAND_STAGES: ReadonlySet<string> = new Set(\n Object.values(CommandStage),\n);\n\n/**\n * Unwraps the events `isData` accepts to their data, and errors the stream\n * with a `WowError` at the first one it does not.\n *\n * Wow's `event`, `id` and `retry` fields carry nothing an application reads:\n * a query row always arrives as `message`, a command result names its stage\n * in `stage`, and Wow does not resume a stream. So the stream a client\n * answers is the rows themselves.\n *\n * When a server-sent event stream fails midway, Wow still answers HTTP 200\n * and sends one last event whose name is the error code and whose data is\n * the `ErrorInfo`, then closes the stream (`WebFluxResponseStrategy`,\n * `errorResume`). Read as data it would pass for a row or a command result;\n * here it ends the stream the way a failed request ends a call.\n */\nfunction rowsUntilErrorEvent<T>(\n isData: (eventName: string) => boolean,\n): TransformStream<JsonServerSentEvent<unknown>, T> {\n return new TransformStream({\n transform(event, controller) {\n if (isData(event.event)) {\n controller.enqueue(event.data as T);\n return;\n }\n controller.error(\n new WowError(\n isErrorInfo(event.data)\n ? event.data\n : { errorCode: event.event, errorMsg: '' },\n ),\n );\n },\n });\n}\n\n/**\n * Internal: applications and generated code take the two extractors below\n * through the endpoint presets `QUERY_STREAM_ENDPOINT` and\n * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.\n *\n * The result extractor of the query streams (`listStream`,\n * `listStateStream`, `aggregateStream`, `loadStream`): the response as a\n * stream of rows, one per server-sent event, which errors with a\n * {@link WowError} when the server sends an error event.\n */\nexport const QueryEventStreamResultExtractor: ResultExtractor<\n ReadableStream<unknown>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent(eventName => eventName === ROW_EVENT),\n );\n\n/**\n * The result extractor of `sendAndWaitStream`: the command results, one per\n * stage the command reached, which errors with a {@link WowError} when the\n * server sends an error event. A command result whose own `errorCode` is not\n * `Ok` is still a result — the command failed in its processing — and is\n * passed on as one.\n *\n * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.\n */\nexport const CommandResultEventStreamResultExtractor: ResultExtractor<\n ReadableStream<CommandResult>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent<CommandResult>(eventName =>\n COMMAND_STAGES.has(eventName),\n ),\n );\n"],"mappings":"2HA0BA,IAAMO,EAAY,UAEZC,EAAsC,IAAI,IAC9C,OAAO,OAAOR,EAAAA,YAAY,CAC5B,EAiBA,SAASS,EACP,EACkD,CAClD,OAAO,IAAI,gBAAgB,CACzB,UAAU,EAAO,EAAY,CACvBC,EAAOC,EAAM,KAAK,EACpBC,EAAW,QAAQD,EAAM,IAAS,EAGpCC,EAAW,MACT,IAAIX,EAAAA,SACFC,EAAAA,YAAYS,EAAM,IAAI,EAClBA,EAAM,KACN,CAAE,UAAWA,EAAM,MAAO,SAAU,EAAG,CAC7C,CACF,CACF,CACF,CAAC,CACH,CAYA,IAAaE,EAET,KAAM,KACP,MAAA,EAAMV,EAAAA,+BAAAA,CAA+BW,CAAQ,EAAA,CAAG,YAC/CL,EAAoB,GAAaM,IAAcR,CAAS,CAC1D,EAWWS,EAET,KAAM,KACP,MAAA,EAAMb,EAAAA,+BAAAA,CAA+BW,CAAQ,EAAA,CAAG,YAC/CL,EAAmC,GACjCD,EAAe,IAAIO,CAAS,CAC9B,CACF"}
1
+ {"version":3,"file":"eventStreams.cjs","names":["CommandStage","WowError","isErrorInfo","JsonEventStreamResultExtractor","require_wowError","require_command","_ahoo_wang_fetcher_eventstream","ROW_EVENT","COMMAND_STAGES","namesStage","data","rowsUntilErrorEvent","isData","event","controller","QueryEventStreamResultExtractor","exchange","CommandResultEventStreamResultExtractor"],"sources":["../../src/transport/eventStreams.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ResultExtractor } from '@ahoo-wang/fetcher';\nimport {\n JsonEventStreamResultExtractor,\n type JsonServerSentEvent,\n} from '@ahoo-wang/fetcher-eventstream';\nimport { isErrorInfo, WowError } from '../error/wowError.js';\nimport { type CommandResult, CommandStage } from '../model/command.js';\n\n/**\n * The event name the server gives the rows of a query stream. Wow sends them\n * without an `event:` field, which the event-stream parser reads as\n * `message`.\n */\nconst ROW_EVENT = 'message';\n\nconst COMMAND_STAGES: ReadonlySet<string> = new Set(\n Object.values(CommandStage),\n);\n\n/** True when the data is a command result: it names the stage it reports. */\nfunction namesStage(data: unknown): boolean {\n return (\n typeof data === 'object' &&\n data !== null &&\n typeof (data as { stage?: unknown }).stage === 'string'\n );\n}\n\n/**\n * Unwraps the events `isData` accepts to their data, and errors the stream\n * with a `WowError` at the first one it does not.\n *\n * Wow's `event`, `id` and `retry` fields carry nothing an application reads:\n * a query row always arrives as `message`, a command result names its stage\n * in `stage`, and Wow does not resume a stream. So the stream a client\n * answers is the rows themselves.\n *\n * When a server-sent event stream fails midway, Wow still answers HTTP 200\n * and sends one last event whose name is the error code and whose data is\n * the `ErrorInfo`, then closes the stream (`WebFluxResponseStrategy`,\n * `errorResume`). Read as data it would pass for a row or a command result;\n * here it ends the stream the way a failed request ends a call.\n */\nfunction rowsUntilErrorEvent<T>(\n isData: (event: JsonServerSentEvent<unknown>) => boolean,\n): TransformStream<JsonServerSentEvent<unknown>, T> {\n return new TransformStream({\n transform(event, controller) {\n if (isData(event)) {\n controller.enqueue(event.data as T);\n return;\n }\n controller.error(\n new WowError(\n isErrorInfo(event.data)\n ? event.data\n : { errorCode: event.event, errorMsg: '' },\n ),\n );\n },\n });\n}\n\n/**\n * Internal: applications and generated code take the two extractors below\n * through the endpoint presets `QUERY_STREAM_ENDPOINT` and\n * `COMMAND_STREAM_ENDPOINT` (`endpoints.ts`); this file is not re-exported.\n *\n * The result extractor of the query streams (`listStream`,\n * `listStateStream`, `aggregateStream`, `loadStream`): the response as a\n * stream of rows, one per server-sent event, which errors with a\n * {@link WowError} when the server sends an error event.\n */\nexport const QueryEventStreamResultExtractor: ResultExtractor<\n ReadableStream<unknown>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent(event => event.event === ROW_EVENT),\n );\n\n/**\n * The result extractor of `sendAndWaitStream`: the command results, one per\n * stage the command reached, which errors with a {@link WowError} when the\n * server sends an error event. A command result whose own `errorCode` is not\n * `Ok` is still a result — the command failed in its processing — and is\n * passed on as one. So is a result from a stage this version does not know:\n * a command result names its stage in `stage`, the error event's `ErrorInfo`\n * does not, so a newer server's stage is not read as an error.\n *\n * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.\n */\nexport const CommandResultEventStreamResultExtractor: ResultExtractor<\n ReadableStream<CommandResult>\n> = async exchange =>\n (await JsonEventStreamResultExtractor(exchange)).pipeThrough(\n rowsUntilErrorEvent<CommandResult>(\n event => COMMAND_STAGES.has(event.event) || namesStage(event.data),\n ),\n );\n"],"mappings":"2HA0BA,IAAMO,EAAY,UAEZC,EAAsC,IAAI,IAC9C,OAAO,OAAOR,EAAAA,YAAY,CAC5B,EAGA,SAASS,EAAW,EAAwB,CAC1C,OACE,OAAOC,GAAS,YAChBA,GACA,OAAQA,EAA6B,OAAU,QAEnD,CAiBA,SAASC,EACP,EACkD,CAClD,OAAO,IAAI,gBAAgB,CACzB,UAAU,EAAO,EAAY,CACvBC,EAAOC,CAAK,EACdC,EAAW,QAAQD,EAAM,IAAS,EAGpCC,EAAW,MACT,IAAIb,EAAAA,SACFC,EAAAA,YAAYW,EAAM,IAAI,EAClBA,EAAM,KACN,CAAE,UAAWA,EAAM,MAAO,SAAU,EAAG,CAC7C,CACF,CACF,CACF,CAAC,CACH,CAYA,IAAaE,EAET,KAAM,KACP,MAAA,EAAMZ,EAAAA,+BAAAA,CAA+Ba,CAAQ,EAAA,CAAG,YAC/CL,EAAoB,GAASE,EAAM,QAAUN,CAAS,CACxD,EAaWU,EAET,KAAM,KACP,MAAA,EAAMd,EAAAA,+BAAAA,CAA+Ba,CAAQ,EAAA,CAAG,YAC/CL,EACE,GAASH,EAAe,IAAIK,EAAM,KAAK,GAAKJ,EAAWI,EAAM,IAAI,CACnE,CACF"}
@@ -16,7 +16,9 @@ export declare const QueryEventStreamResultExtractor: ResultExtractor<ReadableSt
16
16
  * stage the command reached, which errors with a {@link WowError} when the
17
17
  * server sends an error event. A command result whose own `errorCode` is not
18
18
  * `Ok` is still a result — the command failed in its processing — and is
19
- * passed on as one.
19
+ * passed on as one. So is a result from a stage this version does not know:
20
+ * a command result names its stage in `stage`, the error event's `ErrorInfo`
21
+ * does not, so a newer server's stage is not read as an error.
20
22
  *
21
23
  * Generated command clients take it through `COMMAND_STREAM_ENDPOINT`.
22
24
  */