@ahoo-wang/wow-client 10.0.0-alpha.7 → 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 +8 -5
  2. package/README.zh-CN.md +4 -3
  3. package/dist/commands.cjs +1 -1
  4. package/dist/commands.cjs.map +1 -1
  5. package/dist/commands.d.cts +9 -13
  6. package/dist/commands.d.ts +9 -13
  7. package/dist/commands.es.js +60 -54
  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 +24 -379
  66. package/dist/dsl/descriptor.d.ts +24 -379
  67. package/dist/dsl/descriptor.es.js +6 -32
  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 +5 -5
  167. package/dist/frameworkErrors.d.ts +5 -5
  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 +30 -2
  182. package/dist/manifest.d.ts +30 -2
  183. package/dist/manifest.es.js +34 -6
  184. package/dist/manifest.es.js.map +1 -1
  185. package/dist/manifestTypes.d.cts +21 -4
  186. package/dist/manifestTypes.d.ts +21 -4
  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 +18 -5
  218. package/dist/wait.d.ts +18 -5
  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 +76 -31
  224. package/dist/wire.d.ts +76 -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
@@ -1,6 +1,10 @@
1
- import { AggregationDatePart, AggregationDateUnit, DateDiffUnit, AggregationFunction, AggregationGroupType, AggregationMetricType, WindowFunction } from './aggregation/types.cjs';
1
+ import { WindowFunction } from './aggregation/derived.cjs';
2
+ import { AggregationDatePart, AggregationDateUnit } from './aggregation/groups.cjs';
3
+ import { AggregationMetricType } from './aggregation/metrics.cjs';
4
+ import { DateDiffUnit } from './aggregation/types.cjs';
2
5
  import { DeletionState } from './deletionState.cjs';
3
- import { FilterOperator, SearchMode, TimeUnit } from './filter/index.cjs';
6
+ import { DynamicFieldDescriptor, FieldDescriptor } from './fieldDescriptor.cjs';
7
+ import { FilterOperator, SearchMode } from './filter/index.cjs';
4
8
  /**
5
9
  * A query model's capability descriptor and its version, the `ETag` of
6
10
  * `GET …/query`; `notModified` when the version given is still current.
@@ -28,39 +32,6 @@ export declare const QueryModels: Readonly<{
28
32
  }>;
29
33
  /** A query model's name: one of {@link QueryModels}, or one a server added. */
30
34
  export type QueryModel = (typeof QueryModels)[keyof typeof QueryModels] | (string & {});
31
- /**
32
- * The value types Wow names in a field's `types`. The set is open, like
33
- * {@link QueryModels}.
34
- */
35
- export declare const QueryValueTypes: Readonly<{
36
- /** A JSON string. */
37
- readonly STRING: "string";
38
- /** A whole number. */
39
- readonly INTEGER: "integer";
40
- /** A number with a fraction. */
41
- readonly DECIMAL: "decimal";
42
- /** `true` or `false`. */
43
- readonly BOOLEAN: "boolean";
44
- /** A JSON object. */
45
- readonly OBJECT: "object";
46
- }>;
47
- /** A field's value type: one of {@link QueryValueTypes}, or one a server added. */
48
- export type QueryValueType = (typeof QueryValueTypes)[keyof typeof QueryValueTypes] | (string & {});
49
- /** The structural shape of a field's value, sent as its `kind`. */
50
- export declare enum QueryValueKind {
51
- /** Wow could not tell. */
52
- UNKNOWN = "unknown",
53
- /** Always `null`. */
54
- NULL = "null",
55
- /** A single string, number or boolean. */
56
- SCALAR = "scalar",
57
- /** An object. */
58
- OBJECT = "object",
59
- /** An array. */
60
- ARRAY = "array",
61
- /** One of several of the above. */
62
- UNION = "union"
63
- }
64
35
  /** The ways a model can be read page by page, listed in `record.paging`. */
65
36
  export declare enum PagingMode {
66
37
  /** `list` and `stream`: the first `limit` rows. */
@@ -70,38 +41,6 @@ export declare enum PagingMode {
70
41
  /** `cursor`: forward-only pages after the last row seen. */
71
42
  CURSOR = "cursor"
72
43
  }
73
- /**
74
- * The system roles Wow names in a field's `role`: the system fields a root
75
- * operator targets, and the model's times. The set is open, like
76
- * {@link QueryModels}.
77
- */
78
- export declare const QueryFieldRoles: Readonly<{
79
- /** The record's own identity, `record.identity`. */
80
- readonly IDENTITY: "identity";
81
- /** The aggregate id. */
82
- readonly AGGREGATE_ID: "aggregate-id";
83
- /** The tenant id. */
84
- readonly TENANT_ID: "tenant-id";
85
- /** The owner id. */
86
- readonly OWNER_ID: "owner-id";
87
- /** The space id. */
88
- readonly SPACE_ID: "space-id";
89
- /** Whether the aggregate is deleted. */
90
- readonly DELETED: "deleted";
91
- /**
92
- * When the record's events happened: a snapshot's last event
93
- * (`eventTime`), an event stream's events (`createTime`). `FIRST` and
94
- * `LAST` order by it when they name no `orderBy`. Wow 9.2 and later.
95
- */
96
- readonly EVENT_TIME: "event-time";
97
- /**
98
- * When a snapshot's aggregate got its first event, i.e. was created
99
- * (`firstEventTime`). Wow 9.2 and later.
100
- */
101
- readonly FIRST_EVENT_TIME: "first-event-time";
102
- }>;
103
- /** A system field's role: one of {@link QueryFieldRoles}, or one a server added. */
104
- export type QueryFieldRole = (typeof QueryFieldRoles)[keyof typeof QueryFieldRoles] | (string & {});
105
44
  /**
106
45
  * The combination rules Wow names in a descriptor's `constraints`: rules
107
46
  * that no single capability shows. The set is open, like {@link QueryModels}.
@@ -138,278 +77,16 @@ export declare const QueryConstraintTypes: Readonly<{
138
77
  * `NE` with an array operand is refused with `ARRAY_EQUALITY`.
139
78
  */
140
79
  readonly ARRAY_EQUALITY: "array-equality";
80
+ /**
81
+ * The queries of an events model must name their aggregates: the
82
+ * constraint's `fields` are the one field to name them by, `aggregateId`.
83
+ * The service lists it where events are visible only per aggregate, and
84
+ * refuses a query that names none.
85
+ */
86
+ readonly AGGREGATE_REQUIRED: "aggregate-required";
141
87
  }>;
142
88
  /** A constraint's type: one of {@link QueryConstraintTypes}, or one a server added. */
143
89
  export type QueryConstraintType = (typeof QueryConstraintTypes)[keyof typeof QueryConstraintTypes] | (string & {});
144
- /**
145
- * The semantics Wow names in a field's `semantic.type`, one per member of
146
- * {@link QuerySemanticType}: read a descriptor's semantic by these rather
147
- * than by its spelling.
148
- */
149
- export declare const QuerySemanticTypes: Readonly<{
150
- /** A calendar date: {@link TemporalDate}. */
151
- readonly TEMPORAL_DATE: "temporal-date";
152
- /** A number of time units since the epoch: {@link TemporalEpoch}. */
153
- readonly TEMPORAL_EPOCH: "temporal-epoch";
154
- /** A time written as text in a pattern: {@link TemporalFormatted}. */
155
- readonly TEMPORAL_FORMATTED: "temporal-formatted";
156
- /** A fixed-point decimal: {@link NumericDecimal}. */
157
- readonly DECIMAL: "decimal";
158
- /** An amount of money: {@link NumericMoney}. */
159
- readonly MONEY: "money";
160
- /** A length of time: {@link DurationSemantic}. */
161
- readonly DURATION: "duration";
162
- /** The id of an aggregate: {@link ReferenceSemantic}. */
163
- readonly REFERENCE: "reference";
164
- }>;
165
- /** A field that holds a calendar date. */
166
- export interface TemporalDate {
167
- /** The discriminator. */
168
- type: typeof QuerySemanticTypes.TEMPORAL_DATE;
169
- }
170
- /** A field that holds a number of time units since the epoch. */
171
- export interface TemporalEpoch {
172
- /** The discriminator. */
173
- type: typeof QuerySemanticTypes.TEMPORAL_EPOCH;
174
- /** The unit the number counts; milliseconds when absent. */
175
- timeUnit?: TimeUnit;
176
- }
177
- /** A field that holds a time written as text in a `java.time` pattern. */
178
- export interface TemporalFormatted {
179
- /** The discriminator. */
180
- type: typeof QuerySemanticTypes.TEMPORAL_FORMATTED;
181
- /** The `java.time` pattern, such as `yyyy-MM-dd`. */
182
- pattern: string;
183
- }
184
- /**
185
- * A number field meant as a fixed-point decimal with `scale` fraction
186
- * digits: format and total it at that precision. Declared on the model
187
- * (`@QueryDecimal`), never inferred. Wow 9.2 and later.
188
- */
189
- export interface NumericDecimal {
190
- /** The discriminator. */
191
- type: typeof QuerySemanticTypes.DECIMAL;
192
- /** The number of digits after the decimal point, 0 or more. */
193
- scale: number;
194
- }
195
- /**
196
- * A number field meant as an amount of money, in exactly one of a fixed
197
- * ISO 4217 `currency` or the currency held by the sibling string field
198
- * `currencyField` (a property of the same object or element). `scale` is
199
- * always sent: with a fixed currency the server resolves an omitted one to
200
- * that currency's standard fraction digits (2 for CNY, 0 for JPY).
201
- * Amounts in different currencies must not be totalled together. Declared
202
- * on the model (`@QueryMoney`), never inferred. Wow 9.2 and later.
203
- */
204
- export type NumericMoney = {
205
- /** The discriminator. */
206
- type: typeof QuerySemanticTypes.MONEY;
207
- /** The number of digits after the decimal point, 0 or more. */
208
- scale: number;
209
- } & ({
210
- /** The fixed ISO 4217 currency code, such as `CNY`. */
211
- currency: string;
212
- currencyField?: undefined;
213
- } | {
214
- currency?: undefined;
215
- /** The sibling property that holds each value's currency code. */
216
- currencyField: string;
217
- });
218
- /**
219
- * A number field that is a length of time counted in `timeUnit`, such as a
220
- * timeout in seconds: format it as a duration. Declared on the model
221
- * (`@QueryDuration`), never inferred. Wow 9.2 and later.
222
- */
223
- export interface DurationSemantic {
224
- /** The discriminator. */
225
- type: typeof QuerySemanticTypes.DURATION;
226
- /** The unit the number counts; always sent. */
227
- timeUnit: TimeUnit;
228
- }
229
- /**
230
- * A field whose value is the id of an aggregate, to look it up and link to
231
- * it: either a fixed aggregate, `contextName` and `aggregateName`, or per
232
- * record the aggregate the sibling string fields `contextNameField` and
233
- * `aggregateNameField` name (as in an `AggregateId`). The id is always the
234
- * aggregate's own. Declared on the model (`@QueryReference`), or inferred
235
- * for an `AggregateId`. Wow 9.2 and later.
236
- */
237
- export type ReferenceSemantic = {
238
- /** The discriminator. */
239
- type: typeof QuerySemanticTypes.REFERENCE;
240
- } & ({
241
- /** The referenced aggregate's bounded context. */
242
- contextName: string;
243
- /** The referenced aggregate's name. */
244
- aggregateName: string;
245
- contextNameField?: undefined;
246
- aggregateNameField?: undefined;
247
- } | {
248
- contextName?: undefined;
249
- aggregateName?: undefined;
250
- /** The sibling property that holds each value's bounded context. */
251
- contextNameField: string;
252
- /** The sibling property that holds each value's aggregate name. */
253
- aggregateNameField: string;
254
- });
255
- /**
256
- * What a field's value means beyond its type, sent as its `semantic`: one
257
- * of the three temporal kinds, which the relative time filters (`TODAY`,
258
- * `RECENT_DAYS`, …) and date histograms need; one of the two numeric
259
- * formats, which say how a number is read and displayed; a duration; or a
260
- * reference to an aggregate. A field has one; an array field's is its
261
- * items'.
262
- *
263
- * The union grows in minor releases, as the server learns a semantic, and a
264
- * server newer than this client may send a `type` not listed here. The
265
- * descriptor is read as JSON, not parsed, so it arrives as it is: keep a
266
- * `default` branch in a `switch` over `type`, and treat a `type` you do not
267
- * know as no semantic at all. The union stays closed so that narrowing on
268
- * `type` still works.
269
- */
270
- export type QuerySemanticType = TemporalDate | TemporalEpoch | TemporalFormatted | NumericDecimal | NumericMoney | DurationSemantic | ReferenceSemantic;
271
- /** One declared value of an enum field, with its description when it has one. */
272
- export interface EnumValueDescriptor {
273
- /** The value as it is stored and filtered by. */
274
- value: unknown;
275
- /**
276
- * What the value means, when the model describes it: set by the `enum`
277
- * entry of the model's declaration file.
278
- */
279
- description?: string;
280
- }
281
- /**
282
- * How much Wow protects a sensitive field's raw value, sent as its
283
- * `sensitivity.level`. Both levels mask the value in every query result;
284
- * they differ in what a query may do with the raw value.
285
- */
286
- export declare enum SensitivityLevel {
287
- /**
288
- * Masked in results. Filters and paged sorts still compare the raw value,
289
- * unless the server turned that off; grouping, `ANY`, field metrics,
290
- * arithmetic references and cursor sorts are refused.
291
- */
292
- DISPLAY = "display",
293
- /**
294
- * Masked in results and never compared: no filter, sort, search, grouping
295
- * or metric may name it.
296
- */
297
- CONFIDENTIAL = "confidential"
298
- }
299
- /**
300
- * Why a field is deprecated. The field can still be queried, but new
301
- * queries and view definitions should avoid it.
302
- */
303
- export interface QueryDeprecation {
304
- /** Why, or what to use instead; absent when the declaration gave no reason. */
305
- message?: string;
306
- }
307
- /** How a sensitive field is protected. */
308
- export interface SensitivityDescriptor {
309
- /** How much its raw value is protected. */
310
- level: SensitivityLevel;
311
- /**
312
- * Whether filters and paged sorts may still compare its raw value: `false`
313
- * for {@link SensitivityLevel.CONFIDENTIAL}, and for
314
- * {@link SensitivityLevel.DISPLAY} when the server turned comparison off.
315
- * A field that is not comparable lists no filter operators, has
316
- * `sort.paged` `false` and is left out of `record.search`; naming it in a
317
- * filter, sort or search is refused with `PROTECTED_COMPARISON`.
318
- */
319
- comparable: boolean;
320
- }
321
- /** The filter operators a field admits. */
322
- export interface FieldFilterDescriptor {
323
- /**
324
- * Each operator admitted on this field when used alone; empty when none,
325
- * as for a sensitive field that is not comparable.
326
- */
327
- operators: FilterOperator[];
328
- }
329
- /** Where a field may appear in a sort. */
330
- export interface FieldSortDescriptor {
331
- /** In the sort of a list or paged query; never for a field that is not comparable. */
332
- paged: boolean;
333
- /** In the sort of a cursor query. */
334
- cursor: boolean;
335
- /**
336
- * Whether an index backs the sort, as the storage says: `false` marks a
337
- * sort it runs without one, which may be slow on a large model; absent
338
- * when the storage does not say.
339
- */
340
- indexed?: boolean;
341
- }
342
- /** How a field may be used in an aggregation. */
343
- export interface FieldAggregateDescriptor {
344
- /**
345
- * The group types it may be grouped by; a time field lists both
346
- * `DATE_HISTOGRAM` and `DATE_PART`.
347
- */
348
- groups: (AggregationGroupType | (string & {}))[];
349
- /** Whether a terms group on it may set `missingKey`. */
350
- missingKey: boolean;
351
- /** The numeric functions (`SUM`, `AVG`, …) it may feed. */
352
- functions: (AggregationFunction | (string & {}))[];
353
- /** Whether it may feed a `DISTINCT_COUNT` metric. */
354
- distinctCount: boolean;
355
- /** Whether it may feed a `PERCENTILE` metric. */
356
- percentile: boolean;
357
- /** Whether it may feed an `ANY` metric. */
358
- any: boolean;
359
- /** Whether a `FIRST` or `LAST` metric may read its value. */
360
- firstLast: boolean;
361
- /** Whether it may appear in an arithmetic expression. */
362
- expressionInput: boolean;
363
- /** Whether a metric's filter may name it. */
364
- inMetricFilter: boolean;
365
- }
366
- /** One queryable field, by the logical path a query names it with. */
367
- export interface FieldDescriptor {
368
- /** The logical path, such as `state.items.productId`. */
369
- path: string;
370
- /** The system role of a system field; absent on ordinary fields. */
371
- role?: QueryFieldRole;
372
- /** The value types it holds. */
373
- types: QueryValueType[];
374
- /** The structural shape of its value. */
375
- kind: QueryValueKind;
376
- /** Whether it may be `null`. */
377
- nullable: boolean;
378
- /** What its value means beyond its type; absent when nothing more. */
379
- semantic?: QuerySemanticType;
380
- /** Its declared values; never listed for a protected field. */
381
- enum?: EnumValueDescriptor[];
382
- /** Its description, when the model gives one. */
383
- description?: string;
384
- /** How it is protected; absent when it is not sensitive. */
385
- sensitivity?: SensitivityDescriptor;
386
- /** Whether a projection may select it. */
387
- project: boolean;
388
- /** The filter operators it admits. */
389
- filter: FieldFilterDescriptor;
390
- /** Where it may be sorted by. */
391
- sort: FieldSortDescriptor;
392
- /** How it may be aggregated; absent when it cannot be at all. */
393
- aggregate?: FieldAggregateDescriptor;
394
- /**
395
- * The element (array field) it lives in, by path; absent at the record
396
- * level. A filter on it goes inside `ELEMENT_MATCH` on that element.
397
- */
398
- scope?: string;
399
- /**
400
- * Set when the field is deprecated: still queryable, but new queries
401
- * should avoid it. An object, so it is truthy even without a message.
402
- */
403
- deprecated?: QueryDeprecation;
404
- /**
405
- * Other paths a query may name this field by, sorted; empty when none.
406
- * The server replaces an alias with `path` before it checks and runs a
407
- * query, so results, projections and errors use `path`, and an alias is
408
- * never listed as a field of its own. A variant's field lists them
409
- * relative to the element, like its `path`.
410
- */
411
- aliases: string[];
412
- }
413
90
  /** An array field whose elements can be filtered or aggregated one by one. */
414
91
  export interface ElementDescriptor {
415
92
  /** The array field's logical path. */
@@ -425,41 +102,6 @@ export interface ElementDescriptor {
425
102
  */
426
103
  search?: SearchDescriptor;
427
104
  }
428
- /**
429
- * The fields under a map's dynamic keys, written with `{key}` in place of
430
- * the key: any key matches, except those in `excludedKeys`. Each pattern
431
- * has one entry, resolved as the server resolves a concrete key: a pattern
432
- * whose values are arrays is one `ARRAY` entry, its items implicit.
433
- */
434
- export interface DynamicFieldDescriptor {
435
- /** The path pattern, such as `state.attributes.{key}`. */
436
- pattern: string;
437
- /** The value types they hold. */
438
- types: QueryValueType[];
439
- /** The structural shape of their values. */
440
- kind: QueryValueKind;
441
- /** Whether their values may be `null`, as a field's `nullable` says. */
442
- nullable: boolean;
443
- /**
444
- * What their values mean beyond their type, as a field's `semantic`
445
- * says; absent when nothing more.
446
- */
447
- semantic?: QuerySemanticType;
448
- /** The filter operators they admit. */
449
- filter: FieldFilterDescriptor;
450
- /** Where a concrete key may be sorted by. */
451
- sort: FieldSortDescriptor;
452
- /** How a concrete key may be aggregated; absent when it cannot be at all. */
453
- aggregate?: FieldAggregateDescriptor;
454
- /**
455
- * The map's keys that are declared as fields of their own and so are not
456
- * covered by this pattern; absent when there are none. For
457
- * `state.attributes.{key}` with `state.attributes.color` declared, it is
458
- * `['color']`: a filter on `state.attributes.color` takes that field's
459
- * entry in `fields`, with its own operators, not this pattern's.
460
- */
461
- excludedKeys?: string[];
462
- }
463
105
  /**
464
106
  * Full-text search in one scope: the record's (`record.search`) or an
465
107
  * element's (`elements[].search`).
@@ -471,7 +113,7 @@ export interface SearchDescriptor {
471
113
  * the model would match that field. For an element, the modes every
472
114
  * listed field accepts.
473
115
  */
474
- modes: SearchMode[];
116
+ modes: (SearchMode | (string & {}))[];
475
117
  /**
476
118
  * The fields a `SEARCH` may name, by full logical path; never one that is
477
119
  * not comparable. For the record, only record-level fields, never one
@@ -485,7 +127,7 @@ export interface RecordDescriptor {
485
127
  /** The logical path of the field that identifies a record. */
486
128
  identity: string;
487
129
  /** The ways the model can be read page by page. */
488
- paging: PagingMode[];
130
+ paging: (PagingMode | (string & {}))[];
489
131
  /** The deletion scope a query without one gets; absent when the model has none. */
490
132
  defaultScope?: DeletionState;
491
133
  /**
@@ -493,7 +135,7 @@ export interface RecordDescriptor {
493
135
  * as `ID` or `TENANT_ID`, and `EXPRESSION`, whose expression names its
494
136
  * fields, where the server allows expensive operators.
495
137
  */
496
- rootOperators: FilterOperator[];
138
+ rootOperators: (FilterOperator | (string & {}))[];
497
139
  /** Model-wide full-text search; absent when the model offers none. */
498
140
  search?: SearchDescriptor;
499
141
  }
@@ -527,7 +169,10 @@ export interface AggregationLimitsDescriptor {
527
169
  export interface LimitsDescriptor {
528
170
  /** Largest `limit` of a list query. */
529
171
  maxListSize: number | null;
530
- /** The `limit` a list query without one gets. */
172
+ /**
173
+ * The `limit` a list query without one gets. A cursor query without a
174
+ * `size` gets the same default, at most `maxPageSize`.
175
+ */
531
176
  defaultListSize: number | null;
532
177
  /** Largest page `size` of a paged or cursor query. */
533
178
  maxPageSize: number | null;
@@ -583,11 +228,11 @@ export interface AnalysisDescriptor {
583
228
  */
584
229
  dense: boolean;
585
230
  /** The calendar units a `DATE_HISTOGRAM` group may bucket by. */
586
- dateUnits: AggregationDateUnit[];
231
+ dateUnits: (AggregationDateUnit | (string & {}))[];
587
232
  /** The calendar parts a `DATE_PART` group may group by. */
588
- dateParts: AggregationDatePart[];
233
+ dateParts: (AggregationDatePart | (string & {}))[];
589
234
  /** The units a `DATE_DIFF` may measure in; empty when `expressions` is `false`. */
590
- dateDiffUnits: DateDiffUnit[];
235
+ dateDiffUnits: (DateDiffUnit | (string & {}))[];
591
236
  /**
592
237
  * The field `FIRST` and `LAST` order by when they name no `orderBy`, at
593
238
  * the record level: the model's event time. Absent when the model has no
@@ -601,7 +246,7 @@ export interface AnalysisDescriptor {
601
246
  * when expensive operators are off. Absent from servers before Wow 9.9,
602
247
  * which compute no windows.
603
248
  */
604
- windows?: WindowFunction[];
249
+ windows?: (WindowFunction | (string & {}))[];
605
250
  /**
606
251
  * Whether a group of a query that expands elements may name a field of the
607
252
  * root record (`scope: 'root'`); `false` when expensive operators are off.