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

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
@@ -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}.
@@ -148,275 +87,6 @@ export declare const QueryConstraintTypes: Readonly<{
148
87
  }>;
149
88
  /** A constraint's type: one of {@link QueryConstraintTypes}, or one a server added. */
150
89
  export type QueryConstraintType = (typeof QueryConstraintTypes)[keyof typeof QueryConstraintTypes] | (string & {});
151
- /**
152
- * The semantics Wow names in a field's `semantic.type`, one per member of
153
- * {@link QuerySemanticType}: read a descriptor's semantic by these rather
154
- * than by its spelling.
155
- */
156
- export declare const QuerySemanticTypes: Readonly<{
157
- /** A calendar date: {@link TemporalDate}. */
158
- readonly TEMPORAL_DATE: "temporal-date";
159
- /** A number of time units since the epoch: {@link TemporalEpoch}. */
160
- readonly TEMPORAL_EPOCH: "temporal-epoch";
161
- /** A time written as text in a pattern: {@link TemporalFormatted}. */
162
- readonly TEMPORAL_FORMATTED: "temporal-formatted";
163
- /** A fixed-point decimal: {@link NumericDecimal}. */
164
- readonly DECIMAL: "decimal";
165
- /** An amount of money: {@link NumericMoney}. */
166
- readonly MONEY: "money";
167
- /** A length of time: {@link DurationSemantic}. */
168
- readonly DURATION: "duration";
169
- /** The id of an aggregate: {@link ReferenceSemantic}. */
170
- readonly REFERENCE: "reference";
171
- }>;
172
- /** A field that holds a calendar date. */
173
- export interface TemporalDate {
174
- /** The discriminator. */
175
- type: typeof QuerySemanticTypes.TEMPORAL_DATE;
176
- }
177
- /** A field that holds a number of time units since the epoch. */
178
- export interface TemporalEpoch {
179
- /** The discriminator. */
180
- type: typeof QuerySemanticTypes.TEMPORAL_EPOCH;
181
- /** The unit the number counts; milliseconds when absent. */
182
- timeUnit?: TimeUnit;
183
- }
184
- /** A field that holds a time written as text in a `java.time` pattern. */
185
- export interface TemporalFormatted {
186
- /** The discriminator. */
187
- type: typeof QuerySemanticTypes.TEMPORAL_FORMATTED;
188
- /** The `java.time` pattern, such as `yyyy-MM-dd`. */
189
- pattern: string;
190
- }
191
- /**
192
- * A number field meant as a fixed-point decimal with `scale` fraction
193
- * digits: format and total it at that precision. Declared on the model
194
- * (`@QueryDecimal`), never inferred. Wow 9.2 and later.
195
- */
196
- export interface NumericDecimal {
197
- /** The discriminator. */
198
- type: typeof QuerySemanticTypes.DECIMAL;
199
- /** The number of digits after the decimal point, 0 or more. */
200
- scale: number;
201
- }
202
- /**
203
- * A number field meant as an amount of money, in exactly one of a fixed
204
- * ISO 4217 `currency` or the currency held by the sibling string field
205
- * `currencyField` (a property of the same object or element). `scale` is
206
- * always sent: with a fixed currency the server resolves an omitted one to
207
- * that currency's standard fraction digits (2 for CNY, 0 for JPY).
208
- * Amounts in different currencies must not be totalled together. Declared
209
- * on the model (`@QueryMoney`), never inferred. Wow 9.2 and later.
210
- */
211
- export type NumericMoney = {
212
- /** The discriminator. */
213
- type: typeof QuerySemanticTypes.MONEY;
214
- /** The number of digits after the decimal point, 0 or more. */
215
- scale: number;
216
- } & ({
217
- /** The fixed ISO 4217 currency code, such as `CNY`. */
218
- currency: string;
219
- currencyField?: undefined;
220
- } | {
221
- currency?: undefined;
222
- /** The sibling property that holds each value's currency code. */
223
- currencyField: string;
224
- });
225
- /**
226
- * A number field that is a length of time counted in `timeUnit`, such as a
227
- * timeout in seconds: format it as a duration. Declared on the model
228
- * (`@QueryDuration`), never inferred. Wow 9.2 and later.
229
- */
230
- export interface DurationSemantic {
231
- /** The discriminator. */
232
- type: typeof QuerySemanticTypes.DURATION;
233
- /** The unit the number counts; always sent. */
234
- timeUnit: TimeUnit;
235
- }
236
- /**
237
- * A field whose value is the id of an aggregate, to look it up and link to
238
- * it: either a fixed aggregate, `contextName` and `aggregateName`, or per
239
- * record the aggregate the sibling string fields `contextNameField` and
240
- * `aggregateNameField` name (as in an `AggregateId`). The id is always the
241
- * aggregate's own. Declared on the model (`@QueryReference`), or inferred
242
- * for an `AggregateId`. Wow 9.2 and later.
243
- */
244
- export type ReferenceSemantic = {
245
- /** The discriminator. */
246
- type: typeof QuerySemanticTypes.REFERENCE;
247
- } & ({
248
- /** The referenced aggregate's bounded context. */
249
- contextName: string;
250
- /** The referenced aggregate's name. */
251
- aggregateName: string;
252
- contextNameField?: undefined;
253
- aggregateNameField?: undefined;
254
- } | {
255
- contextName?: undefined;
256
- aggregateName?: undefined;
257
- /** The sibling property that holds each value's bounded context. */
258
- contextNameField: string;
259
- /** The sibling property that holds each value's aggregate name. */
260
- aggregateNameField: string;
261
- });
262
- /**
263
- * What a field's value means beyond its type, sent as its `semantic`: one
264
- * of the three temporal kinds, which the relative time filters (`TODAY`,
265
- * `RECENT_DAYS`, …) and date histograms need; one of the two numeric
266
- * formats, which say how a number is read and displayed; a duration; or a
267
- * reference to an aggregate. A field has one; an array field's is its
268
- * items'.
269
- *
270
- * The union grows in minor releases, as the server learns a semantic, and a
271
- * server newer than this client may send a `type` not listed here. The
272
- * descriptor is read as JSON, not parsed, so it arrives as it is: keep a
273
- * `default` branch in a `switch` over `type`, and treat a `type` you do not
274
- * know as no semantic at all. The union stays closed so that narrowing on
275
- * `type` still works.
276
- */
277
- export type QuerySemanticType = TemporalDate | TemporalEpoch | TemporalFormatted | NumericDecimal | NumericMoney | DurationSemantic | ReferenceSemantic;
278
- /** One declared value of an enum field, with its description when it has one. */
279
- export interface EnumValueDescriptor {
280
- /** The value as it is stored and filtered by. */
281
- value: unknown;
282
- /**
283
- * What the value means, when the model describes it: set by the `enum`
284
- * entry of the model's declaration file.
285
- */
286
- description?: string;
287
- }
288
- /**
289
- * How much Wow protects a sensitive field's raw value, sent as its
290
- * `sensitivity.level`. Both levels mask the value in every query result;
291
- * they differ in what a query may do with the raw value.
292
- */
293
- export declare enum SensitivityLevel {
294
- /**
295
- * Masked in results. Filters and paged sorts still compare the raw value,
296
- * unless the server turned that off; grouping, `ANY`, field metrics,
297
- * arithmetic references and cursor sorts are refused.
298
- */
299
- DISPLAY = "display",
300
- /**
301
- * Masked in results and never compared: no filter, sort, search, grouping
302
- * or metric may name it.
303
- */
304
- CONFIDENTIAL = "confidential"
305
- }
306
- /**
307
- * Why a field is deprecated. The field can still be queried, but new
308
- * queries and view definitions should avoid it.
309
- */
310
- export interface QueryDeprecation {
311
- /** Why, or what to use instead; absent when the declaration gave no reason. */
312
- message?: string;
313
- }
314
- /** How a sensitive field is protected. */
315
- export interface SensitivityDescriptor {
316
- /** How much its raw value is protected. */
317
- level: SensitivityLevel;
318
- /**
319
- * Whether filters and paged sorts may still compare its raw value: `false`
320
- * for {@link SensitivityLevel.CONFIDENTIAL}, and for
321
- * {@link SensitivityLevel.DISPLAY} when the server turned comparison off.
322
- * A field that is not comparable lists no filter operators, has
323
- * `sort.paged` `false` and is left out of `record.search`; naming it in a
324
- * filter, sort or search is refused with `PROTECTED_COMPARISON`.
325
- */
326
- comparable: boolean;
327
- }
328
- /** The filter operators a field admits. */
329
- export interface FieldFilterDescriptor {
330
- /**
331
- * Each operator admitted on this field when used alone; empty when none,
332
- * as for a sensitive field that is not comparable.
333
- */
334
- operators: FilterOperator[];
335
- }
336
- /** Where a field may appear in a sort. */
337
- export interface FieldSortDescriptor {
338
- /** In the sort of a list or paged query; never for a field that is not comparable. */
339
- paged: boolean;
340
- /** In the sort of a cursor query. */
341
- cursor: boolean;
342
- /**
343
- * Whether an index backs the sort, as the storage says: `false` marks a
344
- * sort it runs without one, which may be slow on a large model; absent
345
- * when the storage does not say.
346
- */
347
- indexed?: boolean;
348
- }
349
- /** How a field may be used in an aggregation. */
350
- export interface FieldAggregateDescriptor {
351
- /**
352
- * The group types it may be grouped by; a time field lists both
353
- * `DATE_HISTOGRAM` and `DATE_PART`.
354
- */
355
- groups: (AggregationGroupType | (string & {}))[];
356
- /** Whether a terms group on it may set `missingKey`. */
357
- missingKey: boolean;
358
- /** The numeric functions (`SUM`, `AVG`, …) it may feed. */
359
- functions: (AggregationFunction | (string & {}))[];
360
- /** Whether it may feed a `DISTINCT_COUNT` metric. */
361
- distinctCount: boolean;
362
- /** Whether it may feed a `PERCENTILE` metric. */
363
- percentile: boolean;
364
- /** Whether it may feed an `ANY` metric. */
365
- any: boolean;
366
- /** Whether a `FIRST` or `LAST` metric may read its value. */
367
- firstLast: boolean;
368
- /** Whether it may appear in an arithmetic expression. */
369
- expressionInput: boolean;
370
- /** Whether a metric's filter may name it. */
371
- inMetricFilter: boolean;
372
- }
373
- /** One queryable field, by the logical path a query names it with. */
374
- export interface FieldDescriptor {
375
- /** The logical path, such as `state.items.productId`. */
376
- path: string;
377
- /** The system role of a system field; absent on ordinary fields. */
378
- role?: QueryFieldRole;
379
- /** The value types it holds. */
380
- types: QueryValueType[];
381
- /** The structural shape of its value. */
382
- kind: QueryValueKind;
383
- /** Whether it may be `null`. */
384
- nullable: boolean;
385
- /** What its value means beyond its type; absent when nothing more. */
386
- semantic?: QuerySemanticType;
387
- /** Its declared values; never listed for a protected field. */
388
- enum?: EnumValueDescriptor[];
389
- /** Its description, when the model gives one. */
390
- description?: string;
391
- /** How it is protected; absent when it is not sensitive. */
392
- sensitivity?: SensitivityDescriptor;
393
- /** Whether a projection may select it. */
394
- project: boolean;
395
- /** The filter operators it admits. */
396
- filter: FieldFilterDescriptor;
397
- /** Where it may be sorted by. */
398
- sort: FieldSortDescriptor;
399
- /** How it may be aggregated; absent when it cannot be at all. */
400
- aggregate?: FieldAggregateDescriptor;
401
- /**
402
- * The element (array field) it lives in, by path; absent at the record
403
- * level. A filter on it goes inside `ELEMENT_MATCH` on that element.
404
- */
405
- scope?: string;
406
- /**
407
- * Set when the field is deprecated: still queryable, but new queries
408
- * should avoid it. An object, so it is truthy even without a message.
409
- */
410
- deprecated?: QueryDeprecation;
411
- /**
412
- * Other paths a query may name this field by, sorted; empty when none.
413
- * The server replaces an alias with `path` before it checks and runs a
414
- * query, so results, projections and errors use `path`, and an alias is
415
- * never listed as a field of its own. A variant's field lists them
416
- * relative to the element, like its `path`.
417
- */
418
- aliases: string[];
419
- }
420
90
  /** An array field whose elements can be filtered or aggregated one by one. */
421
91
  export interface ElementDescriptor {
422
92
  /** The array field's logical path. */
@@ -432,41 +102,6 @@ export interface ElementDescriptor {
432
102
  */
433
103
  search?: SearchDescriptor;
434
104
  }
435
- /**
436
- * The fields under a map's dynamic keys, written with `{key}` in place of
437
- * the key: any key matches, except those in `excludedKeys`. Each pattern
438
- * has one entry, resolved as the server resolves a concrete key: a pattern
439
- * whose values are arrays is one `ARRAY` entry, its items implicit.
440
- */
441
- export interface DynamicFieldDescriptor {
442
- /** The path pattern, such as `state.attributes.{key}`. */
443
- pattern: string;
444
- /** The value types they hold. */
445
- types: QueryValueType[];
446
- /** The structural shape of their values. */
447
- kind: QueryValueKind;
448
- /** Whether their values may be `null`, as a field's `nullable` says. */
449
- nullable: boolean;
450
- /**
451
- * What their values mean beyond their type, as a field's `semantic`
452
- * says; absent when nothing more.
453
- */
454
- semantic?: QuerySemanticType;
455
- /** The filter operators they admit. */
456
- filter: FieldFilterDescriptor;
457
- /** Where a concrete key may be sorted by. */
458
- sort: FieldSortDescriptor;
459
- /** How a concrete key may be aggregated; absent when it cannot be at all. */
460
- aggregate?: FieldAggregateDescriptor;
461
- /**
462
- * The map's keys that are declared as fields of their own and so are not
463
- * covered by this pattern; absent when there are none. For
464
- * `state.attributes.{key}` with `state.attributes.color` declared, it is
465
- * `['color']`: a filter on `state.attributes.color` takes that field's
466
- * entry in `fields`, with its own operators, not this pattern's.
467
- */
468
- excludedKeys?: string[];
469
- }
470
105
  /**
471
106
  * Full-text search in one scope: the record's (`record.search`) or an
472
107
  * element's (`elements[].search`).
@@ -478,7 +113,7 @@ export interface SearchDescriptor {
478
113
  * the model would match that field. For an element, the modes every
479
114
  * listed field accepts.
480
115
  */
481
- modes: SearchMode[];
116
+ modes: (SearchMode | (string & {}))[];
482
117
  /**
483
118
  * The fields a `SEARCH` may name, by full logical path; never one that is
484
119
  * not comparable. For the record, only record-level fields, never one
@@ -492,7 +127,7 @@ export interface RecordDescriptor {
492
127
  /** The logical path of the field that identifies a record. */
493
128
  identity: string;
494
129
  /** The ways the model can be read page by page. */
495
- paging: PagingMode[];
130
+ paging: (PagingMode | (string & {}))[];
496
131
  /** The deletion scope a query without one gets; absent when the model has none. */
497
132
  defaultScope?: DeletionState;
498
133
  /**
@@ -500,7 +135,7 @@ export interface RecordDescriptor {
500
135
  * as `ID` or `TENANT_ID`, and `EXPRESSION`, whose expression names its
501
136
  * fields, where the server allows expensive operators.
502
137
  */
503
- rootOperators: FilterOperator[];
138
+ rootOperators: (FilterOperator | (string & {}))[];
504
139
  /** Model-wide full-text search; absent when the model offers none. */
505
140
  search?: SearchDescriptor;
506
141
  }
@@ -534,7 +169,10 @@ export interface AggregationLimitsDescriptor {
534
169
  export interface LimitsDescriptor {
535
170
  /** Largest `limit` of a list query. */
536
171
  maxListSize: number | null;
537
- /** 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
+ */
538
176
  defaultListSize: number | null;
539
177
  /** Largest page `size` of a paged or cursor query. */
540
178
  maxPageSize: number | null;
@@ -590,11 +228,11 @@ export interface AnalysisDescriptor {
590
228
  */
591
229
  dense: boolean;
592
230
  /** The calendar units a `DATE_HISTOGRAM` group may bucket by. */
593
- dateUnits: AggregationDateUnit[];
231
+ dateUnits: (AggregationDateUnit | (string & {}))[];
594
232
  /** The calendar parts a `DATE_PART` group may group by. */
595
- dateParts: AggregationDatePart[];
233
+ dateParts: (AggregationDatePart | (string & {}))[];
596
234
  /** The units a `DATE_DIFF` may measure in; empty when `expressions` is `false`. */
597
- dateDiffUnits: DateDiffUnit[];
235
+ dateDiffUnits: (DateDiffUnit | (string & {}))[];
598
236
  /**
599
237
  * The field `FIRST` and `LAST` order by when they name no `orderBy`, at
600
238
  * the record level: the model's event time. Absent when the model has no
@@ -608,7 +246,7 @@ export interface AnalysisDescriptor {
608
246
  * when expensive operators are off. Absent from servers before Wow 9.9,
609
247
  * which compute no windows.
610
248
  */
611
- windows?: WindowFunction[];
249
+ windows?: (WindowFunction | (string & {}))[];
612
250
  /**
613
251
  * Whether a group of a query that expands elements may name a field of the
614
252
  * root record (`scope: 'root'`); `false` when expensive operators are off.