@ahoo-wang/wow-client 10.0.0-beta.1 → 10.0.0-beta.2

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 (233) hide show
  1. package/README.md +4 -2
  2. package/README.zh-CN.md +1 -1
  3. package/dist/commands.cjs +1 -1
  4. package/dist/commands.cjs.map +1 -1
  5. package/dist/commands.d.cts +1 -8
  6. package/dist/commands.d.ts +1 -8
  7. package/dist/commands.es.js +45 -51
  8. package/dist/commands.es.js.map +1 -1
  9. package/dist/dsl/aggregation/admit.cjs +1 -1
  10. package/dist/dsl/aggregation/admit.cjs.map +1 -1
  11. package/dist/dsl/aggregation/admit.es.js +73 -69
  12. package/dist/dsl/aggregation/admit.es.js.map +1 -1
  13. package/dist/dsl/aggregation/aliases.cjs +2 -0
  14. package/dist/dsl/aggregation/aliases.cjs.map +1 -0
  15. package/dist/dsl/aggregation/aliases.d.cts +2 -0
  16. package/dist/dsl/aggregation/aliases.d.ts +2 -0
  17. package/dist/dsl/aggregation/aliases.es.js +13 -0
  18. package/dist/dsl/aggregation/aliases.es.js.map +1 -0
  19. package/dist/dsl/aggregation/builders.cjs +1 -1
  20. package/dist/dsl/aggregation/builders.cjs.map +1 -1
  21. package/dist/dsl/aggregation/builders.d.cts +17 -243
  22. package/dist/dsl/aggregation/builders.d.ts +17 -243
  23. package/dist/dsl/aggregation/builders.es.js +36 -171
  24. package/dist/dsl/aggregation/builders.es.js.map +1 -1
  25. package/dist/dsl/aggregation/derived.cjs +1 -1
  26. package/dist/dsl/aggregation/derived.cjs.map +1 -1
  27. package/dist/dsl/aggregation/derived.d.cts +123 -1
  28. package/dist/dsl/aggregation/derived.d.ts +123 -1
  29. package/dist/dsl/aggregation/derived.es.js +43 -28
  30. package/dist/dsl/aggregation/derived.es.js.map +1 -1
  31. package/dist/dsl/aggregation/groups.cjs +2 -0
  32. package/dist/dsl/aggregation/groups.cjs.map +1 -0
  33. package/dist/dsl/aggregation/groups.d.cts +325 -0
  34. package/dist/dsl/aggregation/groups.d.ts +325 -0
  35. package/dist/dsl/aggregation/groups.es.js +80 -0
  36. package/dist/dsl/aggregation/groups.es.js.map +1 -0
  37. package/dist/dsl/aggregation/having.cjs +1 -1
  38. package/dist/dsl/aggregation/having.cjs.map +1 -1
  39. package/dist/dsl/aggregation/having.d.cts +63 -1
  40. package/dist/dsl/aggregation/having.d.ts +63 -1
  41. package/dist/dsl/aggregation/having.es.js +33 -30
  42. package/dist/dsl/aggregation/having.es.js.map +1 -1
  43. package/dist/dsl/aggregation/index.d.cts +4 -2
  44. package/dist/dsl/aggregation/index.d.ts +4 -2
  45. package/dist/dsl/aggregation/metrics.cjs +2 -0
  46. package/dist/dsl/aggregation/metrics.cjs.map +1 -0
  47. package/dist/dsl/aggregation/metrics.d.cts +279 -0
  48. package/dist/dsl/aggregation/metrics.d.ts +279 -0
  49. package/dist/dsl/aggregation/metrics.es.js +75 -0
  50. package/dist/dsl/aggregation/metrics.es.js.map +1 -0
  51. package/dist/dsl/aggregation/types.cjs +1 -1
  52. package/dist/dsl/aggregation/types.cjs.map +1 -1
  53. package/dist/dsl/aggregation/types.d.cts +4 -524
  54. package/dist/dsl/aggregation/types.d.ts +4 -524
  55. package/dist/dsl/aggregation/types.es.js +5 -25
  56. package/dist/dsl/aggregation/types.es.js.map +1 -1
  57. package/dist/dsl/cursorQuery.cjs +1 -1
  58. package/dist/dsl/cursorQuery.cjs.map +1 -1
  59. package/dist/dsl/cursorQuery.d.cts +18 -7
  60. package/dist/dsl/cursorQuery.d.ts +18 -7
  61. package/dist/dsl/cursorQuery.es.js +13 -12
  62. package/dist/dsl/cursorQuery.es.js.map +1 -1
  63. package/dist/dsl/descriptor.cjs +1 -1
  64. package/dist/dsl/descriptor.cjs.map +1 -1
  65. package/dist/dsl/descriptor.d.cts +17 -379
  66. package/dist/dsl/descriptor.d.ts +17 -379
  67. package/dist/dsl/descriptor.es.js +4 -31
  68. package/dist/dsl/descriptor.es.js.map +1 -1
  69. package/dist/dsl/fieldDescriptor.cjs +2 -0
  70. package/dist/dsl/fieldDescriptor.cjs.map +1 -0
  71. package/dist/dsl/fieldDescriptor.d.cts +246 -0
  72. package/dist/dsl/fieldDescriptor.d.ts +246 -0
  73. package/dist/dsl/fieldDescriptor.es.js +24 -0
  74. package/dist/dsl/fieldDescriptor.es.js.map +1 -0
  75. package/dist/dsl/filter/builders.cjs +1 -1
  76. package/dist/dsl/filter/builders.cjs.map +1 -1
  77. package/dist/dsl/filter/builders.d.cts +7 -949
  78. package/dist/dsl/filter/builders.d.ts +7 -949
  79. package/dist/dsl/filter/builders.es.js +14 -285
  80. package/dist/dsl/filter/builders.es.js.map +1 -1
  81. package/dist/dsl/filter/expressionFilter.cjs +2 -0
  82. package/dist/dsl/filter/expressionFilter.cjs.map +1 -0
  83. package/dist/dsl/filter/expressionFilter.d.cts +35 -0
  84. package/dist/dsl/filter/expressionFilter.d.ts +35 -0
  85. package/dist/dsl/filter/expressionFilter.es.js +18 -0
  86. package/dist/dsl/filter/expressionFilter.es.js.map +1 -0
  87. package/dist/dsl/filter/fieldFilters.cjs +2 -0
  88. package/dist/dsl/filter/fieldFilters.cjs.map +1 -0
  89. package/dist/dsl/filter/fieldFilters.d.cts +297 -0
  90. package/dist/dsl/filter/fieldFilters.d.ts +297 -0
  91. package/dist/dsl/filter/fieldFilters.es.js +110 -0
  92. package/dist/dsl/filter/fieldFilters.es.js.map +1 -0
  93. package/dist/dsl/filter/index.d.cts +2 -1
  94. package/dist/dsl/filter/index.d.ts +2 -1
  95. package/dist/dsl/filter/logicalFilters.cjs +2 -0
  96. package/dist/dsl/filter/logicalFilters.cjs.map +1 -0
  97. package/dist/dsl/filter/logicalFilters.d.cts +109 -0
  98. package/dist/dsl/filter/logicalFilters.d.ts +109 -0
  99. package/dist/dsl/filter/logicalFilters.es.js +36 -0
  100. package/dist/dsl/filter/logicalFilters.es.js.map +1 -0
  101. package/dist/dsl/filter/metadataFilters.cjs +2 -0
  102. package/dist/dsl/filter/metadataFilters.cjs.map +1 -0
  103. package/dist/dsl/filter/metadataFilters.d.cts +132 -0
  104. package/dist/dsl/filter/metadataFilters.d.ts +132 -0
  105. package/dist/dsl/filter/metadataFilters.es.js +56 -0
  106. package/dist/dsl/filter/metadataFilters.es.js.map +1 -0
  107. package/dist/dsl/filter/operator.cjs +1 -1
  108. package/dist/dsl/filter/operator.cjs.map +1 -1
  109. package/dist/dsl/filter/operator.d.cts +11 -9
  110. package/dist/dsl/filter/operator.d.ts +11 -9
  111. package/dist/dsl/filter/operator.es.js +1 -1
  112. package/dist/dsl/filter/operator.es.js.map +1 -1
  113. package/dist/dsl/filter/searchFilter.cjs +2 -0
  114. package/dist/dsl/filter/searchFilter.cjs.map +1 -0
  115. package/dist/dsl/filter/searchFilter.d.cts +39 -0
  116. package/dist/dsl/filter/searchFilter.d.ts +39 -0
  117. package/dist/dsl/filter/searchFilter.es.js +19 -0
  118. package/dist/dsl/filter/searchFilter.es.js.map +1 -0
  119. package/dist/dsl/filter/timeFilters.cjs +2 -0
  120. package/dist/dsl/filter/timeFilters.cjs.map +1 -0
  121. package/dist/dsl/filter/timeFilters.d.cts +290 -0
  122. package/dist/dsl/filter/timeFilters.d.ts +290 -0
  123. package/dist/dsl/filter/timeFilters.es.js +89 -0
  124. package/dist/dsl/filter/timeFilters.es.js.map +1 -0
  125. package/dist/dsl/filter/types.d.cts +4 -14
  126. package/dist/dsl/filter/types.d.ts +4 -14
  127. package/dist/dsl/filter/validate.cjs +1 -1
  128. package/dist/dsl/filter/validate.cjs.map +1 -1
  129. package/dist/dsl/filter/validate.d.cts +2 -4
  130. package/dist/dsl/filter/validate.d.ts +2 -4
  131. package/dist/dsl/filter/validate.es.js +25 -31
  132. package/dist/dsl/filter/validate.es.js.map +1 -1
  133. package/dist/dsl/queryErrorCodes.cjs +1 -1
  134. package/dist/dsl/queryErrorCodes.cjs.map +1 -1
  135. package/dist/dsl/queryErrorCodes.d.cts +0 -2
  136. package/dist/dsl/queryErrorCodes.d.ts +0 -2
  137. package/dist/dsl/queryErrorCodes.es.js +0 -1
  138. package/dist/dsl/queryErrorCodes.es.js.map +1 -1
  139. package/dist/dsl/queryFilter.cjs +2 -0
  140. package/dist/dsl/queryFilter.cjs.map +1 -0
  141. package/dist/dsl/queryFilter.d.cts +3 -0
  142. package/dist/dsl/queryFilter.d.ts +3 -0
  143. package/dist/dsl/queryFilter.es.js +9 -0
  144. package/dist/dsl/queryFilter.es.js.map +1 -0
  145. package/dist/dsl/queryable.cjs +1 -1
  146. package/dist/dsl/queryable.cjs.map +1 -1
  147. package/dist/dsl/queryable.es.js +12 -16
  148. package/dist/dsl/queryable.es.js.map +1 -1
  149. package/dist/dsl/semanticTypes.cjs +2 -0
  150. package/dist/dsl/semanticTypes.cjs.map +1 -0
  151. package/dist/dsl/semanticTypes.d.cts +128 -0
  152. package/dist/dsl/semanticTypes.d.ts +128 -0
  153. package/dist/dsl/semanticTypes.es.js +13 -0
  154. package/dist/dsl/semanticTypes.es.js.map +1 -0
  155. package/dist/dsl.cjs +1 -1
  156. package/dist/dsl.d.cts +2 -0
  157. package/dist/dsl.d.ts +2 -0
  158. package/dist/dsl.es.js +14 -8
  159. package/dist/exactJson.cjs +2 -2
  160. package/dist/exactJson.cjs.map +1 -1
  161. package/dist/exactJson.d.cts +41 -16
  162. package/dist/exactJson.d.ts +41 -16
  163. package/dist/exactJson.es.js +104 -102
  164. package/dist/exactJson.es.js.map +1 -1
  165. package/dist/frameworkErrors.cjs.map +1 -1
  166. package/dist/frameworkErrors.d.cts +4 -4
  167. package/dist/frameworkErrors.d.ts +4 -4
  168. package/dist/frameworkErrors.es.js.map +1 -1
  169. package/dist/http.cjs +1 -1
  170. package/dist/http.cjs.map +1 -1
  171. package/dist/http.d.cts +29 -9
  172. package/dist/http.d.ts +29 -9
  173. package/dist/http.es.js +24 -19
  174. package/dist/http.es.js.map +1 -1
  175. package/dist/index.cjs +1 -1
  176. package/dist/index.d.cts +3 -3
  177. package/dist/index.d.ts +3 -3
  178. package/dist/index.es.js +12 -12
  179. package/dist/manifest.cjs +1 -1
  180. package/dist/manifest.cjs.map +1 -1
  181. package/dist/manifest.d.cts +24 -0
  182. package/dist/manifest.d.ts +24 -0
  183. package/dist/manifest.es.js +34 -6
  184. package/dist/manifest.es.js.map +1 -1
  185. package/dist/manifestTypes.d.cts +16 -1
  186. package/dist/manifestTypes.d.ts +16 -1
  187. package/dist/queries.cjs +1 -1
  188. package/dist/queries.cjs.map +1 -1
  189. package/dist/queries.d.cts +18 -8
  190. package/dist/queries.d.ts +18 -8
  191. package/dist/queries.es.js +46 -35
  192. package/dist/queries.es.js.map +1 -1
  193. package/dist/routes.cjs +1 -1
  194. package/dist/routes.cjs.map +1 -1
  195. package/dist/routes.d.cts +16 -3
  196. package/dist/routes.d.ts +16 -3
  197. package/dist/routes.es.js +24 -25
  198. package/dist/routes.es.js.map +1 -1
  199. package/dist/state.cjs +1 -1
  200. package/dist/state.cjs.map +1 -1
  201. package/dist/state.d.cts +21 -19
  202. package/dist/state.d.ts +21 -19
  203. package/dist/state.es.js +27 -22
  204. package/dist/state.es.js.map +1 -1
  205. package/dist/streams.cjs +1 -1
  206. package/dist/streams.cjs.map +1 -1
  207. package/dist/streams.d.cts +14 -7
  208. package/dist/streams.d.ts +14 -7
  209. package/dist/streams.es.js +65 -50
  210. package/dist/streams.es.js.map +1 -1
  211. package/dist/testing/wire.cjs +1 -1
  212. package/dist/testing/wire.cjs.map +1 -1
  213. package/dist/testing/wire.es.js +1 -1
  214. package/dist/testing/wire.es.js.map +1 -1
  215. package/dist/wait.cjs +1 -1
  216. package/dist/wait.cjs.map +1 -1
  217. package/dist/wait.d.cts +17 -4
  218. package/dist/wait.d.ts +17 -4
  219. package/dist/wait.es.js +36 -34
  220. package/dist/wait.es.js.map +1 -1
  221. package/dist/wire.cjs +1 -1
  222. package/dist/wire.cjs.map +1 -1
  223. package/dist/wire.d.cts +75 -31
  224. package/dist/wire.d.ts +75 -31
  225. package/dist/wire.es.js +1 -3
  226. package/dist/wire.es.js.map +1 -1
  227. package/package.json +5 -5
  228. package/dist/dsl/filter/datePattern.cjs +0 -2
  229. package/dist/dsl/filter/datePattern.cjs.map +0 -1
  230. package/dist/dsl/filter/datePattern.d.cts +0 -8
  231. package/dist/dsl/filter/datePattern.d.ts +0 -8
  232. package/dist/dsl/filter/datePattern.es.js +0 -96
  233. package/dist/dsl/filter/datePattern.es.js.map +0 -1
@@ -0,0 +1,297 @@
1
+ import { StringComparison } from './operator.cjs';
2
+ import { BetweenFilter, CollectionFilter, ComparableFilterLiteral, ComparisonFilter, EqualityFilter, EqualityFilterValue, FieldPresenceFilter, StringFilter } from './types.cjs';
3
+ /** The filters on a field's value: equality, order, text, collections, ranges and presence. */
4
+ export declare const fieldFilters: {
5
+ /**
6
+ * Matches records whose `field` equals `value`.
7
+ *
8
+ * @param field - Query field path, e.g. `state.status`.
9
+ * @param value - JSON scalar. `null` is sent as is; the server rewrites it
10
+ * to `IS_NULL`.
11
+ * @returns `{ op: 'eq', field, value }`.
12
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not
13
+ * `null`, a string, a boolean or a finite number.
14
+ * @example
15
+ * ```typescript
16
+ * filter.eq('state.status', 'PAID');
17
+ * ```
18
+ */
19
+ eq<FIELDS extends string>(field: FIELDS, value: EqualityFilterValue): EqualityFilter<FIELDS>;
20
+ /**
21
+ * Matches records whose `field` does not equal `value`.
22
+ *
23
+ * @param field - Query field path, e.g. `state.status`.
24
+ * @param value - JSON scalar. `null` is sent as is; the server rewrites it
25
+ * to `IS_NOT_NULL`.
26
+ * @returns `{ op: 'ne', field, value }`.
27
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not
28
+ * `null`, a string, a boolean or a finite number.
29
+ * @example
30
+ * ```typescript
31
+ * filter.ne('state.status', 'CANCELLED');
32
+ * ```
33
+ */
34
+ ne<FIELDS extends string>(field: FIELDS, value: EqualityFilterValue): EqualityFilter<FIELDS>;
35
+ /**
36
+ * Matches records whose `field` is greater than `value` (`field > value`).
37
+ * Numbers compare at the backend's stored precision.
38
+ *
39
+ * @param field - Query field path, e.g. `state.status`.
40
+ * @param value - Non-null JSON scalar.
41
+ * @returns `{ op: 'gt', field, value }`.
42
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not a
43
+ * string, a boolean or a finite number.
44
+ * @example
45
+ * ```typescript
46
+ * filter.gt('state.total', 100);
47
+ * ```
48
+ */
49
+ gt<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
50
+ /**
51
+ * Matches records whose `field` is greater than or equal to `value` (`field >= value`).
52
+ * Numbers compare at the backend's stored precision.
53
+ *
54
+ * @param field - Query field path, e.g. `state.status`.
55
+ * @param value - Non-null JSON scalar.
56
+ * @returns `{ op: 'gte', field, value }`.
57
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not a
58
+ * string, a boolean or a finite number.
59
+ * @example
60
+ * ```typescript
61
+ * filter.gte('state.total', 100);
62
+ * ```
63
+ */
64
+ gte<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
65
+ /**
66
+ * Matches records whose `field` is less than `value` (`field < value`).
67
+ * Numbers compare at the backend's stored precision.
68
+ *
69
+ * @param field - Query field path, e.g. `state.status`.
70
+ * @param value - Non-null JSON scalar.
71
+ * @returns `{ op: 'lt', field, value }`.
72
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not a
73
+ * string, a boolean or a finite number.
74
+ * @example
75
+ * ```typescript
76
+ * filter.lt('state.total', 100);
77
+ * ```
78
+ */
79
+ lt<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
80
+ /**
81
+ * Matches records whose `field` is less than or equal to `value` (`field <= value`).
82
+ * Numbers compare at the backend's stored precision.
83
+ *
84
+ * @param field - Query field path, e.g. `state.status`.
85
+ * @param value - Non-null JSON scalar.
86
+ * @returns `{ op: 'lte', field, value }`.
87
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not a
88
+ * string, a boolean or a finite number.
89
+ * @example
90
+ * ```typescript
91
+ * filter.lte('state.total', 100);
92
+ * ```
93
+ */
94
+ lte<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
95
+ /**
96
+ * Matches records whose string `field` contains `value` literally. No
97
+ * full-text analyzer is applied.
98
+ *
99
+ * @param field - Query field path, e.g. `state.status`.
100
+ * @param value - Literal text.
101
+ * @param stringComparison - Case handling. Defaults to
102
+ * `StringComparison.CASE_SENSITIVE`.
103
+ * @returns `{ op: 'contains', field, value, stringComparison }`.
104
+ * @throws TypeError If `stringComparison` is not a {@link StringComparison}
105
+ * member, `field` is not a valid query field path, or `value` is not a string.
106
+ * @example
107
+ * ```typescript
108
+ * filter.contains('state.note', 'vip', StringComparison.CASE_INSENSITIVE);
109
+ * ```
110
+ */
111
+ contains<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
112
+ /**
113
+ * Matches records whose string `field` starts with `value` literally. No
114
+ * full-text analyzer is applied.
115
+ *
116
+ * @param field - Query field path, e.g. `state.status`.
117
+ * @param value - Literal text.
118
+ * @param stringComparison - Case handling. Defaults to
119
+ * `StringComparison.CASE_SENSITIVE`.
120
+ * @returns `{ op: 'starts-with', field, value, stringComparison }`.
121
+ * @throws TypeError If `stringComparison` is not a {@link StringComparison}
122
+ * member, `field` is not a valid query field path, or `value` is not a string.
123
+ * @example
124
+ * ```typescript
125
+ * filter.startsWith('state.note', 'VIP-', StringComparison.CASE_INSENSITIVE);
126
+ * ```
127
+ */
128
+ startsWith<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
129
+ /**
130
+ * Matches records whose string `field` ends with `value` literally. No
131
+ * full-text analyzer is applied.
132
+ *
133
+ * @param field - Query field path, e.g. `state.status`.
134
+ * @param value - Literal text.
135
+ * @param stringComparison - Case handling. Defaults to
136
+ * `StringComparison.CASE_SENSITIVE`.
137
+ * @returns `{ op: 'ends-with', field, value, stringComparison }`.
138
+ * @throws TypeError If `stringComparison` is not a {@link StringComparison}
139
+ * member, `field` is not a valid query field path, or `value` is not a string.
140
+ * @example
141
+ * ```typescript
142
+ * filter.endsWith('state.note', '.pdf', StringComparison.CASE_INSENSITIVE);
143
+ * ```
144
+ */
145
+ endsWith<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
146
+ /**
147
+ * Matches records whose `field` equals one of `values`.
148
+ *
149
+ * @param field - Query field path, e.g. `state.status`.
150
+ * @param values - Non-empty list of non-null JSON scalars.
151
+ * @returns `{ op: 'in', field, values }` with a copy of `values`.
152
+ * @throws TypeError If `values` is empty, contains `null` or `undefined`,
153
+ * or contains a value that is not a string, a boolean or a finite
154
+ * number, or if `field` is not a valid query field path.
155
+ * @example
156
+ * ```typescript
157
+ * filter.isIn('state.status', ['PAID', 'SHIPPED']);
158
+ * ```
159
+ */
160
+ isIn<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
161
+ /**
162
+ * Matches records whose `field` equals none of `values`.
163
+ *
164
+ * @param field - Query field path, e.g. `state.status`.
165
+ * @param values - Non-empty list of non-null JSON scalars.
166
+ * @returns `{ op: 'not-in', field, values }` with a copy of `values`.
167
+ * @throws TypeError If `values` is empty, contains `null` or `undefined`,
168
+ * or contains a value that is not a string, a boolean or a finite
169
+ * number, or if `field` is not a valid query field path.
170
+ * @example
171
+ * ```typescript
172
+ * filter.notIn('state.status', ['CANCELLED', 'REFUNDED']);
173
+ * ```
174
+ */
175
+ notIn<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
176
+ /**
177
+ * Matches records whose array `field` contains every value in `values`.
178
+ *
179
+ * @param field - Query field path, e.g. `state.status`.
180
+ * @param values - Non-empty list of non-null JSON scalars.
181
+ * @returns `{ op: 'contains-all', field, values }` with a copy of `values`.
182
+ * @throws TypeError If `values` is empty, contains `null` or `undefined`,
183
+ * or contains a value that is not a string, a boolean or a finite
184
+ * number, or if `field` is not a valid query field path.
185
+ * @example
186
+ * ```typescript
187
+ * filter.containsAll('access.teams', ['sales', 'support']);
188
+ * ```
189
+ */
190
+ containsAll<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
191
+ /**
192
+ * Matches records whose `field` lies in the inclusive range
193
+ * `lowerBound <= field <= upperBound`.
194
+ *
195
+ * @param field - Query field path, e.g. `state.status`.
196
+ * @param lowerBound - Inclusive lower bound; non-null JSON scalar.
197
+ * @param upperBound - Inclusive upper bound; non-null JSON scalar.
198
+ * @returns `{ op: 'between', field, lowerBound, upperBound }`.
199
+ * @throws TypeError If `field` is not a valid query field path, or either bound is not a
200
+ * string, a boolean or a finite number.
201
+ * @example
202
+ * ```typescript
203
+ * filter.between('state.total', 100, 200);
204
+ * ```
205
+ */
206
+ between<FIELDS extends string>(field: FIELDS, lowerBound: ComparableFilterLiteral, upperBound: ComparableFilterLiteral): BetweenFilter<FIELDS>;
207
+ /**
208
+ * Matches records whose array `field` is empty. On Elasticsearch it may also
209
+ * match a missing or `null` field.
210
+ *
211
+ * @param field - Query field path, e.g. `state.status`.
212
+ * @returns `{ op: 'is-empty', field }`.
213
+ * @throws TypeError If `field` is not a valid query field path.
214
+ * @example
215
+ * ```typescript
216
+ * filter.isEmpty('state.items');
217
+ * ```
218
+ */
219
+ isEmpty<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
220
+ /**
221
+ * Matches records whose string `field` equals `""`. Whitespace-only
222
+ * strings do not match.
223
+ *
224
+ * @param field - Query field path, e.g. `state.status`.
225
+ * @returns `{ op: 'is-empty-string', field }`.
226
+ * @throws TypeError If `field` is not a valid query field path.
227
+ * @example
228
+ * ```typescript
229
+ * filter.isEmptyString('state.note');
230
+ * ```
231
+ */
232
+ isEmptyString<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
233
+ /**
234
+ * Matches records whose string `field` exists, is not `null` and is not
235
+ * `""`.
236
+ *
237
+ * @param field - Query field path, e.g. `state.status`.
238
+ * @returns `{ op: 'is-not-empty-string', field }`.
239
+ * @throws TypeError If `field` is not a valid query field path.
240
+ * @example
241
+ * ```typescript
242
+ * filter.isNotEmptyString('state.note');
243
+ * ```
244
+ */
245
+ isNotEmptyString<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
246
+ /**
247
+ * Matches records whose `field` is `null` or missing, following the
248
+ * backend's null semantics.
249
+ *
250
+ * @param field - Query field path, e.g. `state.status`.
251
+ * @returns `{ op: 'is-null', field }`.
252
+ * @throws TypeError If `field` is not a valid query field path.
253
+ * @example
254
+ * ```typescript
255
+ * filter.isNull('state.note');
256
+ * ```
257
+ */
258
+ isNull<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
259
+ /**
260
+ * Matches records whose `field` exists and is not `null`, following the
261
+ * backend's null semantics.
262
+ *
263
+ * @param field - Query field path, e.g. `state.status`.
264
+ * @returns `{ op: 'is-not-null', field }`.
265
+ * @throws TypeError If `field` is not a valid query field path.
266
+ * @example
267
+ * ```typescript
268
+ * filter.isNotNull('state.note');
269
+ * ```
270
+ */
271
+ isNotNull<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
272
+ /**
273
+ * Matches records where `field` exists. On MongoDB this includes a `null`
274
+ * value.
275
+ *
276
+ * @param field - Query field path, e.g. `state.status`.
277
+ * @returns `{ op: 'exists', field }`.
278
+ * @throws TypeError If `field` is not a valid query field path.
279
+ * @example
280
+ * ```typescript
281
+ * filter.exists('state.note');
282
+ * ```
283
+ */
284
+ exists<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
285
+ /**
286
+ * Matches records where `field` is missing.
287
+ *
288
+ * @param field - Query field path, e.g. `state.status`.
289
+ * @returns `{ op: 'not-exists', field }`.
290
+ * @throws TypeError If `field` is not a valid query field path.
291
+ * @example
292
+ * ```typescript
293
+ * filter.notExists('state.note');
294
+ * ```
295
+ */
296
+ notExists<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
297
+ };
@@ -0,0 +1,297 @@
1
+ import { StringComparison } from './operator.js';
2
+ import { BetweenFilter, CollectionFilter, ComparableFilterLiteral, ComparisonFilter, EqualityFilter, EqualityFilterValue, FieldPresenceFilter, StringFilter } from './types.js';
3
+ /** The filters on a field's value: equality, order, text, collections, ranges and presence. */
4
+ export declare const fieldFilters: {
5
+ /**
6
+ * Matches records whose `field` equals `value`.
7
+ *
8
+ * @param field - Query field path, e.g. `state.status`.
9
+ * @param value - JSON scalar. `null` is sent as is; the server rewrites it
10
+ * to `IS_NULL`.
11
+ * @returns `{ op: 'eq', field, value }`.
12
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not
13
+ * `null`, a string, a boolean or a finite number.
14
+ * @example
15
+ * ```typescript
16
+ * filter.eq('state.status', 'PAID');
17
+ * ```
18
+ */
19
+ eq<FIELDS extends string>(field: FIELDS, value: EqualityFilterValue): EqualityFilter<FIELDS>;
20
+ /**
21
+ * Matches records whose `field` does not equal `value`.
22
+ *
23
+ * @param field - Query field path, e.g. `state.status`.
24
+ * @param value - JSON scalar. `null` is sent as is; the server rewrites it
25
+ * to `IS_NOT_NULL`.
26
+ * @returns `{ op: 'ne', field, value }`.
27
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not
28
+ * `null`, a string, a boolean or a finite number.
29
+ * @example
30
+ * ```typescript
31
+ * filter.ne('state.status', 'CANCELLED');
32
+ * ```
33
+ */
34
+ ne<FIELDS extends string>(field: FIELDS, value: EqualityFilterValue): EqualityFilter<FIELDS>;
35
+ /**
36
+ * Matches records whose `field` is greater than `value` (`field > value`).
37
+ * Numbers compare at the backend's stored precision.
38
+ *
39
+ * @param field - Query field path, e.g. `state.status`.
40
+ * @param value - Non-null JSON scalar.
41
+ * @returns `{ op: 'gt', field, value }`.
42
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not a
43
+ * string, a boolean or a finite number.
44
+ * @example
45
+ * ```typescript
46
+ * filter.gt('state.total', 100);
47
+ * ```
48
+ */
49
+ gt<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
50
+ /**
51
+ * Matches records whose `field` is greater than or equal to `value` (`field >= value`).
52
+ * Numbers compare at the backend's stored precision.
53
+ *
54
+ * @param field - Query field path, e.g. `state.status`.
55
+ * @param value - Non-null JSON scalar.
56
+ * @returns `{ op: 'gte', field, value }`.
57
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not a
58
+ * string, a boolean or a finite number.
59
+ * @example
60
+ * ```typescript
61
+ * filter.gte('state.total', 100);
62
+ * ```
63
+ */
64
+ gte<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
65
+ /**
66
+ * Matches records whose `field` is less than `value` (`field < value`).
67
+ * Numbers compare at the backend's stored precision.
68
+ *
69
+ * @param field - Query field path, e.g. `state.status`.
70
+ * @param value - Non-null JSON scalar.
71
+ * @returns `{ op: 'lt', field, value }`.
72
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not a
73
+ * string, a boolean or a finite number.
74
+ * @example
75
+ * ```typescript
76
+ * filter.lt('state.total', 100);
77
+ * ```
78
+ */
79
+ lt<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
80
+ /**
81
+ * Matches records whose `field` is less than or equal to `value` (`field <= value`).
82
+ * Numbers compare at the backend's stored precision.
83
+ *
84
+ * @param field - Query field path, e.g. `state.status`.
85
+ * @param value - Non-null JSON scalar.
86
+ * @returns `{ op: 'lte', field, value }`.
87
+ * @throws TypeError If `field` is not a valid query field path, or `value` is not a
88
+ * string, a boolean or a finite number.
89
+ * @example
90
+ * ```typescript
91
+ * filter.lte('state.total', 100);
92
+ * ```
93
+ */
94
+ lte<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
95
+ /**
96
+ * Matches records whose string `field` contains `value` literally. No
97
+ * full-text analyzer is applied.
98
+ *
99
+ * @param field - Query field path, e.g. `state.status`.
100
+ * @param value - Literal text.
101
+ * @param stringComparison - Case handling. Defaults to
102
+ * `StringComparison.CASE_SENSITIVE`.
103
+ * @returns `{ op: 'contains', field, value, stringComparison }`.
104
+ * @throws TypeError If `stringComparison` is not a {@link StringComparison}
105
+ * member, `field` is not a valid query field path, or `value` is not a string.
106
+ * @example
107
+ * ```typescript
108
+ * filter.contains('state.note', 'vip', StringComparison.CASE_INSENSITIVE);
109
+ * ```
110
+ */
111
+ contains<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
112
+ /**
113
+ * Matches records whose string `field` starts with `value` literally. No
114
+ * full-text analyzer is applied.
115
+ *
116
+ * @param field - Query field path, e.g. `state.status`.
117
+ * @param value - Literal text.
118
+ * @param stringComparison - Case handling. Defaults to
119
+ * `StringComparison.CASE_SENSITIVE`.
120
+ * @returns `{ op: 'starts-with', field, value, stringComparison }`.
121
+ * @throws TypeError If `stringComparison` is not a {@link StringComparison}
122
+ * member, `field` is not a valid query field path, or `value` is not a string.
123
+ * @example
124
+ * ```typescript
125
+ * filter.startsWith('state.note', 'VIP-', StringComparison.CASE_INSENSITIVE);
126
+ * ```
127
+ */
128
+ startsWith<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
129
+ /**
130
+ * Matches records whose string `field` ends with `value` literally. No
131
+ * full-text analyzer is applied.
132
+ *
133
+ * @param field - Query field path, e.g. `state.status`.
134
+ * @param value - Literal text.
135
+ * @param stringComparison - Case handling. Defaults to
136
+ * `StringComparison.CASE_SENSITIVE`.
137
+ * @returns `{ op: 'ends-with', field, value, stringComparison }`.
138
+ * @throws TypeError If `stringComparison` is not a {@link StringComparison}
139
+ * member, `field` is not a valid query field path, or `value` is not a string.
140
+ * @example
141
+ * ```typescript
142
+ * filter.endsWith('state.note', '.pdf', StringComparison.CASE_INSENSITIVE);
143
+ * ```
144
+ */
145
+ endsWith<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
146
+ /**
147
+ * Matches records whose `field` equals one of `values`.
148
+ *
149
+ * @param field - Query field path, e.g. `state.status`.
150
+ * @param values - Non-empty list of non-null JSON scalars.
151
+ * @returns `{ op: 'in', field, values }` with a copy of `values`.
152
+ * @throws TypeError If `values` is empty, contains `null` or `undefined`,
153
+ * or contains a value that is not a string, a boolean or a finite
154
+ * number, or if `field` is not a valid query field path.
155
+ * @example
156
+ * ```typescript
157
+ * filter.isIn('state.status', ['PAID', 'SHIPPED']);
158
+ * ```
159
+ */
160
+ isIn<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
161
+ /**
162
+ * Matches records whose `field` equals none of `values`.
163
+ *
164
+ * @param field - Query field path, e.g. `state.status`.
165
+ * @param values - Non-empty list of non-null JSON scalars.
166
+ * @returns `{ op: 'not-in', field, values }` with a copy of `values`.
167
+ * @throws TypeError If `values` is empty, contains `null` or `undefined`,
168
+ * or contains a value that is not a string, a boolean or a finite
169
+ * number, or if `field` is not a valid query field path.
170
+ * @example
171
+ * ```typescript
172
+ * filter.notIn('state.status', ['CANCELLED', 'REFUNDED']);
173
+ * ```
174
+ */
175
+ notIn<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
176
+ /**
177
+ * Matches records whose array `field` contains every value in `values`.
178
+ *
179
+ * @param field - Query field path, e.g. `state.status`.
180
+ * @param values - Non-empty list of non-null JSON scalars.
181
+ * @returns `{ op: 'contains-all', field, values }` with a copy of `values`.
182
+ * @throws TypeError If `values` is empty, contains `null` or `undefined`,
183
+ * or contains a value that is not a string, a boolean or a finite
184
+ * number, or if `field` is not a valid query field path.
185
+ * @example
186
+ * ```typescript
187
+ * filter.containsAll('access.teams', ['sales', 'support']);
188
+ * ```
189
+ */
190
+ containsAll<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
191
+ /**
192
+ * Matches records whose `field` lies in the inclusive range
193
+ * `lowerBound <= field <= upperBound`.
194
+ *
195
+ * @param field - Query field path, e.g. `state.status`.
196
+ * @param lowerBound - Inclusive lower bound; non-null JSON scalar.
197
+ * @param upperBound - Inclusive upper bound; non-null JSON scalar.
198
+ * @returns `{ op: 'between', field, lowerBound, upperBound }`.
199
+ * @throws TypeError If `field` is not a valid query field path, or either bound is not a
200
+ * string, a boolean or a finite number.
201
+ * @example
202
+ * ```typescript
203
+ * filter.between('state.total', 100, 200);
204
+ * ```
205
+ */
206
+ between<FIELDS extends string>(field: FIELDS, lowerBound: ComparableFilterLiteral, upperBound: ComparableFilterLiteral): BetweenFilter<FIELDS>;
207
+ /**
208
+ * Matches records whose array `field` is empty. On Elasticsearch it may also
209
+ * match a missing or `null` field.
210
+ *
211
+ * @param field - Query field path, e.g. `state.status`.
212
+ * @returns `{ op: 'is-empty', field }`.
213
+ * @throws TypeError If `field` is not a valid query field path.
214
+ * @example
215
+ * ```typescript
216
+ * filter.isEmpty('state.items');
217
+ * ```
218
+ */
219
+ isEmpty<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
220
+ /**
221
+ * Matches records whose string `field` equals `""`. Whitespace-only
222
+ * strings do not match.
223
+ *
224
+ * @param field - Query field path, e.g. `state.status`.
225
+ * @returns `{ op: 'is-empty-string', field }`.
226
+ * @throws TypeError If `field` is not a valid query field path.
227
+ * @example
228
+ * ```typescript
229
+ * filter.isEmptyString('state.note');
230
+ * ```
231
+ */
232
+ isEmptyString<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
233
+ /**
234
+ * Matches records whose string `field` exists, is not `null` and is not
235
+ * `""`.
236
+ *
237
+ * @param field - Query field path, e.g. `state.status`.
238
+ * @returns `{ op: 'is-not-empty-string', field }`.
239
+ * @throws TypeError If `field` is not a valid query field path.
240
+ * @example
241
+ * ```typescript
242
+ * filter.isNotEmptyString('state.note');
243
+ * ```
244
+ */
245
+ isNotEmptyString<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
246
+ /**
247
+ * Matches records whose `field` is `null` or missing, following the
248
+ * backend's null semantics.
249
+ *
250
+ * @param field - Query field path, e.g. `state.status`.
251
+ * @returns `{ op: 'is-null', field }`.
252
+ * @throws TypeError If `field` is not a valid query field path.
253
+ * @example
254
+ * ```typescript
255
+ * filter.isNull('state.note');
256
+ * ```
257
+ */
258
+ isNull<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
259
+ /**
260
+ * Matches records whose `field` exists and is not `null`, following the
261
+ * backend's null semantics.
262
+ *
263
+ * @param field - Query field path, e.g. `state.status`.
264
+ * @returns `{ op: 'is-not-null', field }`.
265
+ * @throws TypeError If `field` is not a valid query field path.
266
+ * @example
267
+ * ```typescript
268
+ * filter.isNotNull('state.note');
269
+ * ```
270
+ */
271
+ isNotNull<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
272
+ /**
273
+ * Matches records where `field` exists. On MongoDB this includes a `null`
274
+ * value.
275
+ *
276
+ * @param field - Query field path, e.g. `state.status`.
277
+ * @returns `{ op: 'exists', field }`.
278
+ * @throws TypeError If `field` is not a valid query field path.
279
+ * @example
280
+ * ```typescript
281
+ * filter.exists('state.note');
282
+ * ```
283
+ */
284
+ exists<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
285
+ /**
286
+ * Matches records where `field` is missing.
287
+ *
288
+ * @param field - Query field path, e.g. `state.status`.
289
+ * @returns `{ op: 'not-exists', field }`.
290
+ * @throws TypeError If `field` is not a valid query field path.
291
+ * @example
292
+ * ```typescript
293
+ * filter.notExists('state.note');
294
+ * ```
295
+ */
296
+ notExists<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
297
+ };