@ahoo-wang/wow-client 10.0.0-alpha.6 → 10.0.0-alpha.7
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.
- package/README.md +76 -23
- package/README.zh-CN.md +66 -19
- package/dist/commands.cjs +1 -1
- package/dist/commands.cjs.map +1 -1
- package/dist/commands.d.cts +131 -61
- package/dist/commands.d.ts +131 -61
- package/dist/commands.es.js +117 -59
- package/dist/commands.es.js.map +1 -1
- package/dist/developmentCaller.cjs +2 -0
- package/dist/developmentCaller.cjs.map +1 -0
- package/dist/developmentCaller.d.cts +61 -0
- package/dist/developmentCaller.d.ts +61 -0
- package/dist/developmentCaller.es.js +26 -0
- package/dist/developmentCaller.es.js.map +1 -0
- package/dist/dsl/aggregation/admit.cjs +1 -1
- package/dist/dsl/aggregation/admit.cjs.map +1 -1
- package/dist/dsl/aggregation/admit.es.js +93 -93
- package/dist/dsl/aggregation/admit.es.js.map +1 -1
- package/dist/dsl/aggregation/builders.cjs +1 -1
- package/dist/dsl/aggregation/builders.cjs.map +1 -1
- package/dist/dsl/aggregation/builders.d.cts +20 -20
- package/dist/dsl/aggregation/builders.d.ts +20 -20
- package/dist/dsl/aggregation/builders.es.js +88 -88
- package/dist/dsl/aggregation/builders.es.js.map +1 -1
- package/dist/dsl/aggregation/derived.cjs.map +1 -1
- package/dist/dsl/aggregation/derived.d.cts +8 -8
- package/dist/dsl/aggregation/derived.d.ts +8 -8
- package/dist/dsl/aggregation/derived.es.js +1 -2
- package/dist/dsl/aggregation/derived.es.js.map +1 -1
- package/dist/dsl/aggregation/expressionTrees.cjs.map +1 -1
- package/dist/dsl/aggregation/expressionTrees.es.js +1 -2
- package/dist/dsl/aggregation/having.cjs +1 -1
- package/dist/dsl/aggregation/having.cjs.map +1 -1
- package/dist/dsl/aggregation/having.d.cts +12 -12
- package/dist/dsl/aggregation/having.d.ts +12 -12
- package/dist/dsl/aggregation/having.es.js +33 -33
- package/dist/dsl/aggregation/having.es.js.map +1 -1
- package/dist/dsl/aggregation/sort.cjs.map +1 -1
- package/dist/dsl/aggregation/sort.es.js +1 -2
- package/dist/dsl/aggregation/types.cjs +1 -1
- package/dist/dsl/aggregation/types.cjs.map +1 -1
- package/dist/dsl/aggregation/types.d.cts +69 -69
- package/dist/dsl/aggregation/types.d.ts +69 -69
- package/dist/dsl/aggregation/types.es.js +15 -16
- package/dist/dsl/aggregation/types.es.js.map +1 -1
- package/dist/dsl/constantName.cjs +2 -0
- package/dist/dsl/constantName.cjs.map +1 -0
- package/dist/dsl/constantName.d.cts +9 -0
- package/dist/dsl/constantName.d.ts +9 -0
- package/dist/dsl/constantName.es.js +7 -0
- package/dist/dsl/constantName.es.js.map +1 -0
- package/dist/dsl/cursorQuery.cjs.map +1 -1
- package/dist/dsl/cursorQuery.es.js +1 -2
- package/dist/dsl/deletionState.cjs +1 -1
- package/dist/dsl/deletionState.cjs.map +1 -1
- package/dist/dsl/deletionState.d.cts +3 -3
- package/dist/dsl/deletionState.d.ts +3 -3
- package/dist/dsl/deletionState.es.js +2 -3
- package/dist/dsl/deletionState.es.js.map +1 -1
- package/dist/dsl/descriptor.cjs +1 -1
- package/dist/dsl/descriptor.cjs.map +1 -1
- package/dist/dsl/descriptor.d.cts +92 -42
- package/dist/dsl/descriptor.d.ts +92 -42
- package/dist/dsl/descriptor.es.js +36 -29
- package/dist/dsl/descriptor.es.js.map +1 -1
- package/dist/dsl/field.cjs.map +1 -1
- package/dist/dsl/field.es.js +1 -2
- package/dist/dsl/filter/builders.cjs +1 -1
- package/dist/dsl/filter/builders.cjs.map +1 -1
- package/dist/dsl/filter/builders.d.cts +53 -53
- package/dist/dsl/filter/builders.d.ts +53 -53
- package/dist/dsl/filter/builders.es.js +111 -111
- package/dist/dsl/filter/builders.es.js.map +1 -1
- package/dist/dsl/filter/datePattern.cjs.map +1 -1
- package/dist/dsl/filter/datePattern.es.js +1 -2
- package/dist/dsl/filter/operator.cjs +1 -1
- package/dist/dsl/filter/operator.cjs.map +1 -1
- package/dist/dsl/filter/operator.d.cts +57 -57
- package/dist/dsl/filter/operator.d.ts +57 -57
- package/dist/dsl/filter/operator.es.js +4 -5
- package/dist/dsl/filter/operator.es.js.map +1 -1
- package/dist/dsl/filter/scope.cjs +1 -1
- package/dist/dsl/filter/scope.cjs.map +1 -1
- package/dist/dsl/filter/scope.es.js +12 -12
- package/dist/dsl/filter/scope.es.js.map +1 -1
- package/dist/dsl/filter/validate.cjs +1 -1
- package/dist/dsl/filter/validate.cjs.map +1 -1
- package/dist/dsl/filter/validate.es.js +23 -23
- package/dist/dsl/filter/validate.es.js.map +1 -1
- package/dist/dsl/pagination.cjs.map +1 -1
- package/dist/dsl/pagination.es.js +1 -2
- package/dist/dsl/projection.cjs.map +1 -1
- package/dist/dsl/projection.d.cts +1 -1
- package/dist/dsl/projection.d.ts +1 -1
- package/dist/dsl/projection.es.js +1 -2
- package/dist/dsl/projection.es.js.map +1 -1
- package/dist/dsl/queryErrorCodes.cjs +1 -1
- package/dist/dsl/queryErrorCodes.cjs.map +1 -1
- package/dist/dsl/queryErrorCodes.d.cts +59 -48
- package/dist/dsl/queryErrorCodes.d.ts +59 -48
- package/dist/dsl/queryErrorCodes.es.js +51 -50
- package/dist/dsl/queryErrorCodes.es.js.map +1 -1
- package/dist/dsl/queryable.cjs +1 -1
- package/dist/dsl/queryable.cjs.map +1 -1
- package/dist/dsl/queryable.d.cts +25 -21
- package/dist/dsl/queryable.d.ts +25 -21
- package/dist/dsl/queryable.es.js +5 -5
- package/dist/dsl/queryable.es.js.map +1 -1
- package/dist/dsl/sort.cjs +1 -1
- package/dist/dsl/sort.cjs.map +1 -1
- package/dist/dsl/sort.d.cts +2 -2
- package/dist/dsl/sort.d.ts +2 -2
- package/dist/dsl/sort.es.js +4 -5
- package/dist/dsl/sort.es.js.map +1 -1
- package/dist/dsl.cjs +1 -1
- package/dist/dsl.es.js +3 -3
- package/dist/exactJson.cjs.map +1 -1
- package/dist/exactJson.d.cts +4 -4
- package/dist/exactJson.d.ts +4 -4
- package/dist/exactJson.es.js +1 -2
- package/dist/exactJson.es.js.map +1 -1
- package/dist/frameworkErrors.cjs +2 -0
- package/dist/frameworkErrors.cjs.map +1 -0
- package/dist/frameworkErrors.d.cts +121 -0
- package/dist/frameworkErrors.d.ts +121 -0
- package/dist/frameworkErrors.es.js +95 -0
- package/dist/frameworkErrors.es.js.map +1 -0
- package/dist/http.cjs +1 -1
- package/dist/http.cjs.map +1 -1
- package/dist/http.d.cts +4 -7
- package/dist/http.d.ts +4 -7
- package/dist/http.es.js +12 -20
- package/dist/http.es.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.es.js +11 -9
- package/dist/manifest.cjs +1 -1
- package/dist/manifest.cjs.map +1 -1
- package/dist/manifest.d.cts +33 -95
- package/dist/manifest.d.ts +33 -95
- package/dist/manifest.es.js +12 -7
- package/dist/manifest.es.js.map +1 -1
- package/dist/manifestTypes.d.cts +193 -0
- package/dist/manifestTypes.d.ts +193 -0
- package/dist/problem.cjs +1 -1
- package/dist/problem.cjs.map +1 -1
- package/dist/problem.d.cts +76 -115
- package/dist/problem.d.ts +76 -115
- package/dist/problem.es.js +45 -80
- package/dist/problem.es.js.map +1 -1
- package/dist/queries.cjs +1 -1
- package/dist/queries.cjs.map +1 -1
- package/dist/queries.d.cts +28 -51
- package/dist/queries.d.ts +28 -51
- package/dist/queries.es.js +49 -40
- package/dist/queries.es.js.map +1 -1
- package/dist/routes.cjs +2 -0
- package/dist/routes.cjs.map +1 -0
- package/dist/routes.d.cts +49 -0
- package/dist/routes.d.ts +49 -0
- package/dist/routes.es.js +33 -0
- package/dist/routes.es.js.map +1 -0
- package/dist/state.cjs +1 -1
- package/dist/state.cjs.map +1 -1
- package/dist/state.d.cts +56 -11
- package/dist/state.d.ts +56 -11
- package/dist/state.es.js +56 -21
- package/dist/state.es.js.map +1 -1
- package/dist/streams.cjs +1 -1
- package/dist/streams.cjs.map +1 -1
- package/dist/streams.d.cts +17 -13
- package/dist/streams.d.ts +17 -13
- package/dist/streams.es.js +50 -50
- package/dist/streams.es.js.map +1 -1
- package/dist/testing/wire.cjs +2 -0
- package/dist/testing/wire.cjs.map +1 -0
- package/dist/testing/wire.d.cts +29 -0
- package/dist/testing/wire.d.ts +29 -0
- package/dist/testing/wire.es.js +88 -0
- package/dist/testing/wire.es.js.map +1 -0
- package/dist/testing.cjs +1 -0
- package/dist/testing.d.cts +12 -0
- package/dist/testing.d.ts +12 -0
- package/dist/testing.es.js +3 -0
- package/dist/wait.cjs +1 -1
- package/dist/wait.cjs.map +1 -1
- package/dist/wait.d.cts +67 -18
- package/dist/wait.d.ts +67 -18
- package/dist/wait.es.js +59 -12
- package/dist/wait.es.js.map +1 -1
- package/dist/wire.cjs +1 -1
- package/dist/wire.cjs.map +1 -1
- package/dist/wire.d.cts +100 -50
- package/dist/wire.d.ts +100 -50
- package/dist/wire.es.js +17 -6
- package/dist/wire.es.js.map +1 -1
- package/package.json +23 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.es.js","names":["projection","include","queryField","exclude"],"sources":["../../src/dsl/projection.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { queryField } from './field.js';\n\n/**\n * Interface for field projection.\n */\nexport interface Projection<FIELDS extends string = string> {\n include?: FIELDS[];\n exclude?: FIELDS[];\n}\n\n/** The first segment of a dotted path. */\ntype Head<P extends string> = P extends `${infer H}.${string}` ? H : P;\n\n/** What follows `K.` in the dotted paths of `P`. */\ntype Tail<P extends string, K extends string> = P extends `${K}.${infer R}`\n ? R\n : never;\n\n/**\n * `T` with only the dotted paths `P` (and the objects that lead to them): an\n * included path keeps its descendants, an array its items' paths, and a\n * nullable or optional value stays so.\n */\nexport type PickPaths<T, P extends string> = T extends readonly (infer E)[]\n ? PickPaths<E, P>[]\n : T extends object\n ? {\n [K in keyof T as K extends Head<P> ? K : never]: K extends P\n ? T[K]\n : PickPaths<T[K], Tail<P, K & string>>;\n }\n : T;\n\n/**\n * The records of type `R` a query whose projection includes the paths\n * `INCLUDE` returns
|
|
1
|
+
{"version":3,"file":"projection.es.js","names":["projection","include","queryField","exclude"],"sources":["../../src/dsl/projection.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { queryField } from './field.js';\n\n/**\n * Interface for field projection.\n */\nexport interface Projection<FIELDS extends string = string> {\n include?: FIELDS[];\n exclude?: FIELDS[];\n}\n\n/** The first segment of a dotted path. */\ntype Head<P extends string> = P extends `${infer H}.${string}` ? H : P;\n\n/** What follows `K.` in the dotted paths of `P`. */\ntype Tail<P extends string, K extends string> = P extends `${K}.${infer R}`\n ? R\n : never;\n\n/**\n * `T` with only the dotted paths `P` (and the objects that lead to them): an\n * included path keeps its descendants, an array its items' paths, and a\n * nullable or optional value stays so.\n */\nexport type PickPaths<T, P extends string> = T extends readonly (infer E)[]\n ? PickPaths<E, P>[]\n : T extends object\n ? {\n [K in keyof T as K extends Head<P> ? K : never]: K extends P\n ? T[K]\n : PickPaths<T[K], Tail<P, K & string>>;\n }\n : T;\n\n/**\n * The records of type `R` a query whose projection includes the paths\n * `INCLUDE` returns: `R` narrowed to those paths\n * ({@link PickPaths}), or `R` itself when they are not literal. A query\n * client answers so for a query whose `include` it sees as literal paths;\n * any other query (an exclusion alone, or one whose projection is optional,\n * as the DSL builds it) answers whole records.\n */\nexport type Projected<R, INCLUDE extends string> = string extends INCLUDE\n ? R\n : PickPaths<R, INCLUDE>;\n\n/**\n * Creates a Projection object with the provided parameters.\n *\n * This function is a factory for creating Projection objects, which represent\n * field projection specifications for queries. It allows specifying which fields\n * to include or exclude in query results.\n *\n * @param options - The projection options. Defaults to none, which includes\n * every field.\n * @param options.include - Array of field names to include in the projection. Optional.\n * @param options.exclude - Array of field names to exclude from the projection. Optional.\n * @returns A Projection object with the specified parameters\n */\nexport function projection<FIELDS extends string = string>({\n include,\n exclude,\n}: Projection<FIELDS> = {}): Projection<FIELDS> {\n // Kotlin holds these as `QueryField`, which refuses a path its pattern does\n // not match. A projection entry is a path like any other. Both keys stay\n // present whether or not they were given: the shape this factory returns is\n // its own contract, and validating a path is no reason to change it.\n return {\n include: include?.map(queryField),\n exclude: exclude?.map(queryField),\n };\n}\n\n/**\n * Interface for objects that support field projection.\n */\nexport interface ProjectionCapable<FIELDS extends string = string> {\n projection?: Projection<FIELDS>;\n}\n"],"mappings":";;AAuEA,SAAgBA,EAA2C,EACzD,YACA,eACsB,CAAC,GAAuB;CAK9C,OAAO;EACL,SAASC,GAAS,IAAIC,CAAU;EAChC,SAASC,GAAS,IAAID,CAAU;CAClC;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Object.freeze({INVALID_JSON:`
|
|
1
|
+
var e=Object.freeze({INVALID_JSON:`invalid-json`,BODY_NOT_OBJECT:`body-not-object`,EMPTY_BODY:`empty-body`,UNKNOWN_PROPERTY:`unknown-property`,UNKNOWN_TYPE:`unknown-type`,UNKNOWN_VALUE:`unknown-value`,INVALID_VALUE:`invalid-value`,INVALID_REQUEST:`invalid-request`,CURSOR_SORT_DUPLICATE:`cursor-sort-duplicate`,CURSOR_SORT_TOO_MANY:`cursor-sort-too-many`,INVALID_CURSOR:`invalid-cursor`,STREAM_NOT_RESUMABLE:`stream-not-resumable`,SIZE_OUT_OF_RANGE:`size-out-of-range`,FILTER_TOO_LARGE:`filter-too-large`,EXPENSIVE_OPERATOR_DISABLED:`expensive-operator-disabled`,COUNT_REQUIRES_FILTER:`count-requires-filter`,RESIDUAL_GROUPS_EXCEEDED:`residual-groups-exceeded`,TOO_MANY_GROUPS:`too-many-groups`,EXPLICIT_ENTRY_REQUIRED:`explicit-entry-required`,REPLAY_TOO_LONG:`replay-too-long`,UNKNOWN_FIELD:`unknown-field`,UNSUPPORTED_CAPABILITY:`unsupported-capability`,ELEMENT_SCOPE_REQUIRED:`element-scope-required`,VALUE_MISMATCH:`value-mismatch`,NOT_COLLECTION:`not-collection`,NOT_SINGLE_STRING:`not-single-string`,MODEL_SEARCH_UNSUPPORTED:`model-search-unsupported`,CURSOR_NOT_ALLOWED:`cursor-not-allowed`,PROTECTED_AGGREGATION:`protected-aggregation`,PROTECTED_COMPARISON:`protected-comparison`,MISSING_KEY_REQUIRES_STRING:`missing-key-requires-string`,ANY_REQUIRES_SINGLE_VALUE:`any-requires-single-value`,INCOMPLETE_PROJECTION:`incomplete-projection`,METRIC_FILTER_SEARCH:`metric-filter-search`,METRIC_FILTER_ELEMENT_MATCH:`metric-filter-element-match`,METRIC_FILTER_ARRAY_FIELD:`metric-filter-array-field`,NOT_PROJECTABLE:`not-projectable`,EVENT_PROJECTION_TYPE_REQUIRED:`event-projection-type-required`,TEMPORAL_REPRESENTATION_REQUIRED:`temporal-representation-required`,TEMPORAL_CONFIGURATION_CONFLICT:`temporal-configuration-conflict`,PARALLEL_ARRAY_SORT:`parallel-array-sort`,ARRAY_EQUALITY:`array-equality`,FIRST_LAST_REQUIRES_SINGLE_VALUE:`first-last-requires-single-value`,FIRST_LAST_REQUIRES_ORDER_BY:`first-last-requires-order-by`,TEMPORAL_AGGREGATION_UNSUPPORTED:`temporal-aggregation-unsupported`,SORT_TOO_MANY:`sort-too-many`,SORT_FIELD_DUPLICATE:`sort-field-duplicate`,IDENTITY_UNDEFINED:`identity-undefined`,STORAGE_UNSUPPORTED:`storage-unsupported`,PREVIOUS_UNSHIFTABLE:`previous-unshiftable`});exports.QueryErrorCodes=e;
|
|
2
2
|
//# sourceMappingURL=queryErrorCodes.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryErrorCodes.cjs","names":["QueryErrorCodes"],"sources":["../../src/dsl/queryErrorCodes.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The codes the violations of a rejected query carry: which rule the request\n * broke, stable where the human text is not. A query route answers a query it\n * refuses with the problem `wow.query.invalid` (`WowProblemError`), each of\n * whose `violations` names one of these codes and where it applies.\n *\n * Mirrors `QueryErrorCodes` in\n * `api/query-api/src/main/kotlin/me/ahoo/wow/api/query/QueryErrorCodes.kt`.\n * The list is open: Wow adds codes and never renames or reuses one, so a\n * client treats a code it does not know as a generic rejection and shows the\n * violation's message. {@link QueryErrorCode} admits those codes too.\n *\n * A violation's `path` locates it three ways:\n * - decoding the request body: the JSON path of the offending value, such as\n * `filter.state` or `metrics[0]`, or `body` for the body as a whole;\n * - the entry's budget and gates: the part of the request the rule bounds,\n * such as `limit` or `filter`;\n * - admission against the query model: the absolute logical field path, such\n * as `state.items.sku`, or `''` when the rule is about the model rather\n * than one field.\n */\nexport const QueryErrorCodes = Object.freeze({\n /** The body is not valid JSON. */\n INVALID_JSON: 'INVALID_JSON',\n /** The body is JSON but not an object. */\n BODY_NOT_OBJECT: 'BODY_NOT_OBJECT',\n /** The body is empty. */\n EMPTY_BODY: 'EMPTY_BODY',\n /** The body has a property the query type does not declare. */\n UNKNOWN_PROPERTY: 'UNKNOWN_PROPERTY',\n /** An `op`, metric or other type discriminator names no known type. */\n UNKNOWN_TYPE: 'UNKNOWN_TYPE',\n /** An enum value is not one the server knows. */\n UNKNOWN_VALUE: 'UNKNOWN_VALUE',\n /** A value is missing or has the wrong JSON type. */\n INVALID_VALUE: 'INVALID_VALUE',\n /** Any other request rule; the message names it. */\n INVALID_REQUEST: 'INVALID_REQUEST',\n /** A cursor sort names a field twice; `path` is the repeated field. */\n CURSOR_SORT_DUPLICATE: 'CURSOR_SORT_DUPLICATE',\n /** A cursor sort has too many fields once the identity tie-breaker is appended. */\n CURSOR_SORT_TOO_MANY: 'CURSOR_SORT_TOO_MANY',\n /**\n * The cursor token was not issued for this model and effective sort, or\n * does not decode; `path` is `cursor`. Start again from the first page.\n */\n INVALID_CURSOR: 'INVALID_CURSOR',\n /**\n * The entry's budget: a list or aggregation `limit`, a page's index, size,\n * window or offset, or a cursor page's `size` is out of range; `path` names\n * which (`limit`, `pagination.size`, `size`, …).\n */\n SIZE_OUT_OF_RANGE: 'SIZE_OUT_OF_RANGE',\n /**\n * The entry's budget: the filter or `having` has too many nodes or values;\n * `path` is `filter` or `having`.\n */\n FILTER_TOO_LARGE: 'FILTER_TOO_LARGE',\n /**\n * The entry does not allow expensive operators, and the query uses one: an\n * operator, an element expansion, a metric sort, an arithmetic or\n * expression group, a date part, a dense fill or FIRST / LAST; `path` names\n * the part (`filter`, `elements`, `sort`, `metrics`, `groupBy`).\n */\n EXPENSIVE_OPERATOR_DISABLED: 'EXPENSIVE_OPERATOR_DISABLED',\n /**\n * A counting query (count, or a paged query's total) would match every\n * record, which the entry refuses; `path` is `filter`.\n */\n COUNT_REQUIRES_FILTER: 'COUNT_REQUIRES_FILTER',\n /**\n * A `having` or metric sort the storage evaluates after grouping read more\n * groups than the server allows; `path` is `body`. It may end a stream\n * partway through.\n */\n RESIDUAL_GROUPS_EXCEEDED: 'RESIDUAL_GROUPS_EXCEEDED',\n /**\n * An in-process query named no entry where one is required. Never\n * answered over HTTP; listed so the mirror stays complete.\n */\n EXPLICIT_ENTRY_REQUIRED: 'EXPLICIT_ENTRY_REQUIRED',\n /**\n * A state point read (`GET …/{id}/state?version=|at=`, `…/state/trace`): the\n * state asked for is more commits away from the snapshot, or from version 1,\n * than a state read replays. The path is the query parameter.\n */\n REPLAY_TOO_LONG: 'REPLAY_TOO_LONG',\n /** The model has no such logical field. */\n UNKNOWN_FIELD: 'UNKNOWN_FIELD',\n /** The field does not offer the capability the query uses (sort, range, …). */\n UNSUPPORTED_CAPABILITY: 'UNSUPPORTED_CAPABILITY',\n /** The field is an element field and must be queried inside its element scope. */\n ELEMENT_SCOPE_REQUIRED: 'ELEMENT_SCOPE_REQUIRED',\n /** A filter value falls outside the field's declared domain. */\n VALUE_MISMATCH: 'VALUE_MISMATCH',\n /** The field is not a known collection (for example under `isEmpty`). */\n NOT_COLLECTION: 'NOT_COLLECTION',\n /** The field is not a single string. */\n NOT_SINGLE_STRING: 'NOT_SINGLE_STRING',\n /** The model does not support search. */\n MODEL_SEARCH_UNSUPPORTED: 'MODEL_SEARCH_UNSUPPORTED',\n /** The field cannot be used for a cursor. */\n CURSOR_NOT_ALLOWED: 'CURSOR_NOT_ALLOWED',\n /** The field is protected and cannot be aggregated. */\n PROTECTED_AGGREGATION: 'PROTECTED_AGGREGATION',\n /**\n * The field is protected and cannot be filtered or sorted: its descriptor\n * says `sensitivity.comparable: false`. A search that names it is refused\n * the same way.\n */\n PROTECTED_COMPARISON: 'PROTECTED_COMPARISON',\n /** A terms group's `missingKey` needs a single-valued string field. */\n MISSING_KEY_REQUIRES_STRING: 'MISSING_KEY_REQUIRES_STRING',\n /** `ANY` needs a single value. */\n ANY_REQUIRES_SINGLE_VALUE: 'ANY_REQUIRES_SINGLE_VALUE',\n /** The storage cannot deliver a complete projection; select fields explicitly. */\n INCOMPLETE_PROJECTION: 'INCOMPLETE_PROJECTION',\n /** A metric filter uses a search filter. */\n METRIC_FILTER_SEARCH: 'METRIC_FILTER_SEARCH',\n /** A metric filter uses `ELEMENT_MATCH`. */\n METRIC_FILTER_ELEMENT_MATCH: 'METRIC_FILTER_ELEMENT_MATCH',\n /** A metric filter names an array field; it must be scalar. */\n METRIC_FILTER_ARRAY_FIELD: 'METRIC_FILTER_ARRAY_FIELD',\n /** The field cannot be projected. */\n NOT_PROJECTABLE: 'NOT_PROJECTABLE',\n /** An event projection that keeps payloads must keep their `bodyType`. */\n EVENT_PROJECTION_TYPE_REQUIRED: 'EVENT_PROJECTION_TYPE_REQUIRED',\n /** A relative-time filter needs a field with a known temporal representation. */\n TEMPORAL_REPRESENTATION_REQUIRED: 'TEMPORAL_REPRESENTATION_REQUIRED',\n /** A relative-time filter's zone, pattern or unit conflicts with the field's definition. */\n TEMPORAL_CONFIGURATION_CONFLICT: 'TEMPORAL_CONFIGURATION_CONFLICT',\n /**\n * A sort names two array fields on independent arrays, which the storage\n * cannot order by together; `path` is the second of them. The descriptor\n * lists such fields under a `PARALLEL_ARRAY_SORT` constraint.\n */\n PARALLEL_ARRAY_SORT: 'PARALLEL_ARRAY_SORT',\n /**\n * An `EQ` or `NE` compares the field to an array, which the storage cannot\n * do: it takes only a scalar operand. The descriptor says so with an\n * `ARRAY_EQUALITY` constraint.\n */\n ARRAY_EQUALITY: 'ARRAY_EQUALITY',\n /**\n * A `FIRST` or `LAST` metric names a field that may hold several values;\n * it needs a single-valued one (`aggregate.firstLast` in the descriptor).\n */\n FIRST_LAST_REQUIRES_SINGLE_VALUE: 'FIRST_LAST_REQUIRES_SINGLE_VALUE',\n /**\n * A `FIRST` or `LAST` metric names no `orderBy` where there is no event\n * time to order by, such as inside an element or on a model whose\n * descriptor has no `analysis.firstLastOrderBy`; `path` is its field.\n */\n FIRST_LAST_REQUIRES_ORDER_BY: 'FIRST_LAST_REQUIRES_ORDER_BY',\n /**\n * A date group or date difference names a field that stores neither a\n * date nor an epoch (a formatted string, say), so it cannot be aggregated\n * by time.\n */\n TEMPORAL_AGGREGATION_UNSUPPORTED: 'TEMPORAL_AGGREGATION_UNSUPPORTED',\n /** The sort has more fields than the protocol allows; `path` is `''`. */\n SORT_TOO_MANY: 'SORT_TOO_MANY',\n /** Two sort fields name the same stored field; `path` is the second. */\n SORT_FIELD_DUPLICATE: 'SORT_FIELD_DUPLICATE',\n /**\n * An identity filter or a cursor on a model that defines no record\n * identity; `path` is `''`.\n */\n IDENTITY_UNDEFINED: 'IDENTITY_UNDEFINED',\n /**\n * The storage does not support the feature the query uses, or its native\n * query language cannot express it (a MongoDB PHRASE search with a quote,\n * say); `path` is the field, or `''`.\n */\n STORAGE_UNSUPPORTED: 'STORAGE_UNSUPPORTED',\n /**\n * A `PREVIOUS` window steps along a date group whose field the filter\n * conditions where its range cannot be shifted to the earlier period:\n * outside the top-level `AND`, or with a value that is not an instant;\n * `path` is the field.\n */\n PREVIOUS_UNSHIFTABLE: 'PREVIOUS_UNSHIFTABLE',\n} as const);\n\n/** One of the codes this package knows; see {@link QueryErrorCodes}. */\nexport type KnownQueryErrorCode =\n (typeof QueryErrorCodes)[keyof typeof QueryErrorCodes];\n\n/**\n * The code of a rejected query: one this package knows, which editors\n * complete, or one a newer server added.\n */\nexport type QueryErrorCode = KnownQueryErrorCode | (string & {});\n\n/**\n * Why the server rejected a query: one violation of its `wow.query.invalid`\n * problem, which rule failed, where, and the server's words.\n */\nexport interface QueryViolation {\n /** Which rule failed; switch on it against {@link QueryErrorCodes}. */\n code: QueryErrorCode;\n /**\n * Where: the JSON path of the offending value for a decoding error\n * (`filter.state`, `metrics[0]`, `body`), the absolute logical field path\n * for an admission error (`state.items.sku`), or `''` when the rule is about\n * the model rather than a field.\n */\n path: string;\n /** The server's words. */\n message: string;\n}\n"],"mappings":"AAkCA,IAAaA,EAAkB,OAAO,OAAO,CAE3C,aAAc,eAEd,gBAAiB,kBAEjB,WAAY,aAEZ,iBAAkB,mBAElB,aAAc,eAEd,cAAe,gBAEf,cAAe,gBAEf,gBAAiB,kBAEjB,sBAAuB,wBAEvB,qBAAsB,uBAKtB,eAAgB,iBAMhB,kBAAmB,oBAKnB,iBAAkB,mBAOlB,4BAA6B,8BAK7B,sBAAuB,wBAMvB,yBAA0B,2BAK1B,wBAAyB,0BAMzB,gBAAiB,kBAEjB,cAAe,gBAEf,uBAAwB,yBAExB,uBAAwB,yBAExB,eAAgB,iBAEhB,eAAgB,iBAEhB,kBAAmB,oBAEnB,yBAA0B,2BAE1B,mBAAoB,qBAEpB,sBAAuB,wBAMvB,qBAAsB,uBAEtB,4BAA6B,8BAE7B,0BAA2B,4BAE3B,sBAAuB,wBAEvB,qBAAsB,uBAEtB,4BAA6B,8BAE7B,0BAA2B,4BAE3B,gBAAiB,kBAEjB,+BAAgC,iCAEhC,iCAAkC,mCAElC,gCAAiC,kCAMjC,oBAAqB,sBAMrB,eAAgB,iBAKhB,iCAAkC,mCAMlC,6BAA8B,+BAM9B,iCAAkC,mCAElC,cAAe,gBAEf,qBAAsB,uBAKtB,mBAAoB,qBAMpB,oBAAqB,sBAOrB,qBAAsB,sBACxB,CAAU"}
|
|
1
|
+
{"version":3,"file":"queryErrorCodes.cjs","names":["QueryErrorCodes"],"sources":["../../src/dsl/queryErrorCodes.ts"],"sourcesContent":["/*\n * Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The codes the violations of a rejected query carry: which rule the request\n * broke, stable where the human text is not. A query route answers a query it\n * refuses with the problem `wow.query.invalid` (`WowProblemError`), each of\n * whose `violations` names one of these codes and where it applies.\n *\n * Mirrors `QueryErrorCodes` in\n * `api/query-api/src/main/kotlin/me/ahoo/wow/api/query/QueryErrorCodes.kt`.\n * The list is open: Wow adds codes and never renames or reuses one, so a\n * client treats a code it does not know as a generic rejection and shows the\n * violation's message. {@link QueryErrorCode} admits those codes too.\n *\n * A violation's `path` locates it three ways:\n * - decoding the request body: the JSON path of the offending value, such as\n * `filter.state` or `metrics[0]`, or `body` for the body as a whole;\n * - the entry's budget and gates: the part of the request the rule bounds,\n * such as `limit` or `filter`;\n * - admission against the query model: the absolute logical field path, such\n * as `state.items.sku`, or `''` when the rule is about the model rather\n * than one field.\n */\nexport const QueryErrorCodes = Object.freeze({\n /** The body is not valid JSON. */\n INVALID_JSON: 'invalid-json',\n /** The body is JSON but not an object. */\n BODY_NOT_OBJECT: 'body-not-object',\n /** The body is empty. */\n EMPTY_BODY: 'empty-body',\n /** The body has a property the query type does not declare. */\n UNKNOWN_PROPERTY: 'unknown-property',\n /** An `op`, metric or other type discriminator names no known type. */\n UNKNOWN_TYPE: 'unknown-type',\n /** An enum value is not one the server knows. */\n UNKNOWN_VALUE: 'unknown-value',\n /** A value is missing or has the wrong JSON type. */\n INVALID_VALUE: 'invalid-value',\n /** Any other request rule; the message names it. */\n INVALID_REQUEST: 'invalid-request',\n /** A cursor sort names a field twice; `path` is the repeated field. */\n CURSOR_SORT_DUPLICATE: 'cursor-sort-duplicate',\n /** A cursor sort has too many fields once the identity tie-breaker is appended. */\n CURSOR_SORT_TOO_MANY: 'cursor-sort-too-many',\n /**\n * The cursor token was not issued for this model and effective sort, or\n * does not decode; `path` is `cursor`. Start again from the first page.\n */\n INVALID_CURSOR: 'invalid-cursor',\n /**\n * A stream that cannot be resumed, its sort having no keyset in its store,\n * names no `limit`: it would stop at a default and say nothing. Name a\n * `limit`, or sort by fields its store keeps a keyset of; `path` is `limit`.\n */\n STREAM_NOT_RESUMABLE: 'stream-not-resumable',\n /**\n * The entry's budget: a list or aggregation `limit`, a page's index, size,\n * window or offset, or a cursor page's `size` is out of range; `path` names\n * which (`limit`, `pagination.size`, `size`, …).\n */\n SIZE_OUT_OF_RANGE: 'size-out-of-range',\n /**\n * The entry's budget: the filter or `having` has too many nodes or values;\n * `path` is `filter` or `having`.\n */\n FILTER_TOO_LARGE: 'filter-too-large',\n /**\n * The entry does not allow expensive operators, and the query uses one: an\n * operator, an element expansion, a metric sort, an arithmetic or\n * expression group, a date part, a dense fill or FIRST / LAST; `path` names\n * the part (`filter`, `elements`, `sort`, `metrics`, `groupBy`).\n */\n EXPENSIVE_OPERATOR_DISABLED: 'expensive-operator-disabled',\n /**\n * A counting query (count, or a paged query's total) would match every\n * record, which the entry refuses; `path` is `filter`.\n */\n COUNT_REQUIRES_FILTER: 'count-requires-filter',\n /**\n * A `having` or metric sort the storage evaluates after grouping read more\n * groups than the server allows; `path` is `body`. It may end a stream\n * partway through.\n */\n RESIDUAL_GROUPS_EXCEEDED: 'residual-groups-exceeded',\n /**\n * An aggregation that names no sort found more groups than its `limit`;\n * `path` is `limit`. Add a sort for a top-N, or raise the limit.\n */\n TOO_MANY_GROUPS: 'too-many-groups',\n /**\n * An in-process query named no entry where one is required. Never\n * answered over HTTP; listed so the mirror stays complete.\n */\n EXPLICIT_ENTRY_REQUIRED: 'explicit-entry-required',\n /**\n * A state point read (`GET …/{id}/state?version=|at=`, `…/state/trace`): the\n * state asked for is more commits away from the snapshot, or from version 1,\n * than a state read replays. The path is the query parameter.\n */\n REPLAY_TOO_LONG: 'replay-too-long',\n /** The model has no such logical field. */\n UNKNOWN_FIELD: 'unknown-field',\n /** The field does not offer the capability the query uses (sort, range, …). */\n UNSUPPORTED_CAPABILITY: 'unsupported-capability',\n /** The field is an element field and must be queried inside its element scope. */\n ELEMENT_SCOPE_REQUIRED: 'element-scope-required',\n /** A filter value falls outside the field's declared domain. */\n VALUE_MISMATCH: 'value-mismatch',\n /** The field is not a known collection (for example under `isEmpty`). */\n NOT_COLLECTION: 'not-collection',\n /** The field is not a single string. */\n NOT_SINGLE_STRING: 'not-single-string',\n /** The model does not support search. */\n MODEL_SEARCH_UNSUPPORTED: 'model-search-unsupported',\n /** The field cannot be used for a cursor. */\n CURSOR_NOT_ALLOWED: 'cursor-not-allowed',\n /** The field is protected and cannot be aggregated. */\n PROTECTED_AGGREGATION: 'protected-aggregation',\n /**\n * The field is protected and cannot be filtered or sorted: its descriptor\n * says `sensitivity.comparable: false`. A search that names it is refused\n * the same way.\n */\n PROTECTED_COMPARISON: 'protected-comparison',\n /** A terms group's `missingKey` needs a single-valued string field. */\n MISSING_KEY_REQUIRES_STRING: 'missing-key-requires-string',\n /** `ANY` needs a single value. */\n ANY_REQUIRES_SINGLE_VALUE: 'any-requires-single-value',\n /** The storage cannot deliver a complete projection; select fields explicitly. */\n INCOMPLETE_PROJECTION: 'incomplete-projection',\n /** A metric filter uses a search filter. */\n METRIC_FILTER_SEARCH: 'metric-filter-search',\n /** A metric filter uses `ELEMENT_MATCH`. */\n METRIC_FILTER_ELEMENT_MATCH: 'metric-filter-element-match',\n /** A metric filter names an array field; it must be scalar. */\n METRIC_FILTER_ARRAY_FIELD: 'metric-filter-array-field',\n /** The field cannot be projected. */\n NOT_PROJECTABLE: 'not-projectable',\n /** An event projection that keeps payloads must keep their `bodyType`. */\n EVENT_PROJECTION_TYPE_REQUIRED: 'event-projection-type-required',\n /** A relative-time filter needs a field with a known temporal representation. */\n TEMPORAL_REPRESENTATION_REQUIRED: 'temporal-representation-required',\n /** A relative-time filter's zone, pattern or unit conflicts with the field's definition. */\n TEMPORAL_CONFIGURATION_CONFLICT: 'temporal-configuration-conflict',\n /**\n * A sort names two array fields on independent arrays, which the storage\n * cannot order by together; `path` is the second of them. The descriptor\n * lists such fields under a `PARALLEL_ARRAY_SORT` constraint.\n */\n PARALLEL_ARRAY_SORT: 'parallel-array-sort',\n /**\n * An `EQ` or `NE` compares the field to an array, which the storage cannot\n * do: it takes only a scalar operand. The descriptor says so with an\n * `ARRAY_EQUALITY` constraint.\n */\n ARRAY_EQUALITY: 'array-equality',\n /**\n * A `FIRST` or `LAST` metric names a field that may hold several values;\n * it needs a single-valued one (`aggregate.firstLast` in the descriptor).\n */\n FIRST_LAST_REQUIRES_SINGLE_VALUE: 'first-last-requires-single-value',\n /**\n * A `FIRST` or `LAST` metric names no `orderBy` where there is no event\n * time to order by, such as inside an element or on a model whose\n * descriptor has no `analysis.firstLastOrderBy`; `path` is its field.\n */\n FIRST_LAST_REQUIRES_ORDER_BY: 'first-last-requires-order-by',\n /**\n * A date group or date difference names a field that stores neither a\n * date nor an epoch (a formatted string, say), so it cannot be aggregated\n * by time.\n */\n TEMPORAL_AGGREGATION_UNSUPPORTED: 'temporal-aggregation-unsupported',\n /** The sort has more fields than the protocol allows; `path` is `''`. */\n SORT_TOO_MANY: 'sort-too-many',\n /** Two sort fields name the same stored field; `path` is the second. */\n SORT_FIELD_DUPLICATE: 'sort-field-duplicate',\n /**\n * An identity filter or a cursor on a model that defines no record\n * identity; `path` is `''`.\n */\n IDENTITY_UNDEFINED: 'identity-undefined',\n /**\n * The storage does not support the feature the query uses, or its native\n * query language cannot express it (a MongoDB PHRASE search with a quote,\n * say); `path` is the field, or `''`.\n */\n STORAGE_UNSUPPORTED: 'storage-unsupported',\n /**\n * A `PREVIOUS` window steps along a date group whose field the filter\n * conditions where its range cannot be shifted to the earlier period:\n * outside the top-level `AND`, or with a value that is not an instant;\n * `path` is the field.\n */\n PREVIOUS_UNSHIFTABLE: 'previous-unshiftable',\n} as const);\n\n/** One of the codes this package knows; see {@link QueryErrorCodes}. */\nexport type KnownQueryErrorCode =\n (typeof QueryErrorCodes)[keyof typeof QueryErrorCodes];\n\n/**\n * The code of a rejected query: one this package knows, which editors\n * complete, or one a newer server added.\n */\nexport type QueryErrorCode = KnownQueryErrorCode | (string & {});\n\n/**\n * Why the server rejected a query: one violation of its `wow.query.invalid`\n * problem, which rule failed, where, and the server's words.\n */\nexport interface QueryViolation {\n /** Which rule failed; switch on it against {@link QueryErrorCodes}. */\n code: QueryErrorCode;\n /**\n * Where: the JSON path of the offending value for a decoding error\n * (`filter.state`, `metrics[0]`, `body`), the absolute logical field path\n * for an admission error (`state.items.sku`), or `''` when the rule is about\n * the model rather than a field.\n */\n path: string;\n /** The server's words. */\n message: string;\n}\n"],"mappings":"AAkCA,IAAaA,EAAkB,OAAO,OAAO,CAE3C,aAAc,eAEd,gBAAiB,kBAEjB,WAAY,aAEZ,iBAAkB,mBAElB,aAAc,eAEd,cAAe,gBAEf,cAAe,gBAEf,gBAAiB,kBAEjB,sBAAuB,wBAEvB,qBAAsB,uBAKtB,eAAgB,iBAMhB,qBAAsB,uBAMtB,kBAAmB,oBAKnB,iBAAkB,mBAOlB,4BAA6B,8BAK7B,sBAAuB,wBAMvB,yBAA0B,2BAK1B,gBAAiB,kBAKjB,wBAAyB,0BAMzB,gBAAiB,kBAEjB,cAAe,gBAEf,uBAAwB,yBAExB,uBAAwB,yBAExB,eAAgB,iBAEhB,eAAgB,iBAEhB,kBAAmB,oBAEnB,yBAA0B,2BAE1B,mBAAoB,qBAEpB,sBAAuB,wBAMvB,qBAAsB,uBAEtB,4BAA6B,8BAE7B,0BAA2B,4BAE3B,sBAAuB,wBAEvB,qBAAsB,uBAEtB,4BAA6B,8BAE7B,0BAA2B,4BAE3B,gBAAiB,kBAEjB,+BAAgC,iCAEhC,iCAAkC,mCAElC,gCAAiC,kCAMjC,oBAAqB,sBAMrB,eAAgB,iBAKhB,iCAAkC,mCAMlC,6BAA8B,+BAM9B,iCAAkC,mCAElC,cAAe,gBAEf,qBAAsB,uBAKtB,mBAAoB,qBAMpB,oBAAqB,sBAOrB,qBAAsB,sBACxB,CAAU,E"}
|
|
@@ -21,165 +21,176 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const QueryErrorCodes: Readonly<{
|
|
23
23
|
/** The body is not valid JSON. */
|
|
24
|
-
readonly INVALID_JSON: "
|
|
24
|
+
readonly INVALID_JSON: "invalid-json";
|
|
25
25
|
/** The body is JSON but not an object. */
|
|
26
|
-
readonly BODY_NOT_OBJECT: "
|
|
26
|
+
readonly BODY_NOT_OBJECT: "body-not-object";
|
|
27
27
|
/** The body is empty. */
|
|
28
|
-
readonly EMPTY_BODY: "
|
|
28
|
+
readonly EMPTY_BODY: "empty-body";
|
|
29
29
|
/** The body has a property the query type does not declare. */
|
|
30
|
-
readonly UNKNOWN_PROPERTY: "
|
|
30
|
+
readonly UNKNOWN_PROPERTY: "unknown-property";
|
|
31
31
|
/** An `op`, metric or other type discriminator names no known type. */
|
|
32
|
-
readonly UNKNOWN_TYPE: "
|
|
32
|
+
readonly UNKNOWN_TYPE: "unknown-type";
|
|
33
33
|
/** An enum value is not one the server knows. */
|
|
34
|
-
readonly UNKNOWN_VALUE: "
|
|
34
|
+
readonly UNKNOWN_VALUE: "unknown-value";
|
|
35
35
|
/** A value is missing or has the wrong JSON type. */
|
|
36
|
-
readonly INVALID_VALUE: "
|
|
36
|
+
readonly INVALID_VALUE: "invalid-value";
|
|
37
37
|
/** Any other request rule; the message names it. */
|
|
38
|
-
readonly INVALID_REQUEST: "
|
|
38
|
+
readonly INVALID_REQUEST: "invalid-request";
|
|
39
39
|
/** A cursor sort names a field twice; `path` is the repeated field. */
|
|
40
|
-
readonly CURSOR_SORT_DUPLICATE: "
|
|
40
|
+
readonly CURSOR_SORT_DUPLICATE: "cursor-sort-duplicate";
|
|
41
41
|
/** A cursor sort has too many fields once the identity tie-breaker is appended. */
|
|
42
|
-
readonly CURSOR_SORT_TOO_MANY: "
|
|
42
|
+
readonly CURSOR_SORT_TOO_MANY: "cursor-sort-too-many";
|
|
43
43
|
/**
|
|
44
44
|
* The cursor token was not issued for this model and effective sort, or
|
|
45
45
|
* does not decode; `path` is `cursor`. Start again from the first page.
|
|
46
46
|
*/
|
|
47
|
-
readonly INVALID_CURSOR: "
|
|
47
|
+
readonly INVALID_CURSOR: "invalid-cursor";
|
|
48
|
+
/**
|
|
49
|
+
* A stream that cannot be resumed, its sort having no keyset in its store,
|
|
50
|
+
* names no `limit`: it would stop at a default and say nothing. Name a
|
|
51
|
+
* `limit`, or sort by fields its store keeps a keyset of; `path` is `limit`.
|
|
52
|
+
*/
|
|
53
|
+
readonly STREAM_NOT_RESUMABLE: "stream-not-resumable";
|
|
48
54
|
/**
|
|
49
55
|
* The entry's budget: a list or aggregation `limit`, a page's index, size,
|
|
50
56
|
* window or offset, or a cursor page's `size` is out of range; `path` names
|
|
51
57
|
* which (`limit`, `pagination.size`, `size`, …).
|
|
52
58
|
*/
|
|
53
|
-
readonly SIZE_OUT_OF_RANGE: "
|
|
59
|
+
readonly SIZE_OUT_OF_RANGE: "size-out-of-range";
|
|
54
60
|
/**
|
|
55
61
|
* The entry's budget: the filter or `having` has too many nodes or values;
|
|
56
62
|
* `path` is `filter` or `having`.
|
|
57
63
|
*/
|
|
58
|
-
readonly FILTER_TOO_LARGE: "
|
|
64
|
+
readonly FILTER_TOO_LARGE: "filter-too-large";
|
|
59
65
|
/**
|
|
60
66
|
* The entry does not allow expensive operators, and the query uses one: an
|
|
61
67
|
* operator, an element expansion, a metric sort, an arithmetic or
|
|
62
68
|
* expression group, a date part, a dense fill or FIRST / LAST; `path` names
|
|
63
69
|
* the part (`filter`, `elements`, `sort`, `metrics`, `groupBy`).
|
|
64
70
|
*/
|
|
65
|
-
readonly EXPENSIVE_OPERATOR_DISABLED: "
|
|
71
|
+
readonly EXPENSIVE_OPERATOR_DISABLED: "expensive-operator-disabled";
|
|
66
72
|
/**
|
|
67
73
|
* A counting query (count, or a paged query's total) would match every
|
|
68
74
|
* record, which the entry refuses; `path` is `filter`.
|
|
69
75
|
*/
|
|
70
|
-
readonly COUNT_REQUIRES_FILTER: "
|
|
76
|
+
readonly COUNT_REQUIRES_FILTER: "count-requires-filter";
|
|
71
77
|
/**
|
|
72
78
|
* A `having` or metric sort the storage evaluates after grouping read more
|
|
73
79
|
* groups than the server allows; `path` is `body`. It may end a stream
|
|
74
80
|
* partway through.
|
|
75
81
|
*/
|
|
76
|
-
readonly RESIDUAL_GROUPS_EXCEEDED: "
|
|
82
|
+
readonly RESIDUAL_GROUPS_EXCEEDED: "residual-groups-exceeded";
|
|
83
|
+
/**
|
|
84
|
+
* An aggregation that names no sort found more groups than its `limit`;
|
|
85
|
+
* `path` is `limit`. Add a sort for a top-N, or raise the limit.
|
|
86
|
+
*/
|
|
87
|
+
readonly TOO_MANY_GROUPS: "too-many-groups";
|
|
77
88
|
/**
|
|
78
89
|
* An in-process query named no entry where one is required. Never
|
|
79
90
|
* answered over HTTP; listed so the mirror stays complete.
|
|
80
91
|
*/
|
|
81
|
-
readonly EXPLICIT_ENTRY_REQUIRED: "
|
|
92
|
+
readonly EXPLICIT_ENTRY_REQUIRED: "explicit-entry-required";
|
|
82
93
|
/**
|
|
83
94
|
* A state point read (`GET …/{id}/state?version=|at=`, `…/state/trace`): the
|
|
84
95
|
* state asked for is more commits away from the snapshot, or from version 1,
|
|
85
96
|
* than a state read replays. The path is the query parameter.
|
|
86
97
|
*/
|
|
87
|
-
readonly REPLAY_TOO_LONG: "
|
|
98
|
+
readonly REPLAY_TOO_LONG: "replay-too-long";
|
|
88
99
|
/** The model has no such logical field. */
|
|
89
|
-
readonly UNKNOWN_FIELD: "
|
|
100
|
+
readonly UNKNOWN_FIELD: "unknown-field";
|
|
90
101
|
/** The field does not offer the capability the query uses (sort, range, …). */
|
|
91
|
-
readonly UNSUPPORTED_CAPABILITY: "
|
|
102
|
+
readonly UNSUPPORTED_CAPABILITY: "unsupported-capability";
|
|
92
103
|
/** The field is an element field and must be queried inside its element scope. */
|
|
93
|
-
readonly ELEMENT_SCOPE_REQUIRED: "
|
|
104
|
+
readonly ELEMENT_SCOPE_REQUIRED: "element-scope-required";
|
|
94
105
|
/** A filter value falls outside the field's declared domain. */
|
|
95
|
-
readonly VALUE_MISMATCH: "
|
|
106
|
+
readonly VALUE_MISMATCH: "value-mismatch";
|
|
96
107
|
/** The field is not a known collection (for example under `isEmpty`). */
|
|
97
|
-
readonly NOT_COLLECTION: "
|
|
108
|
+
readonly NOT_COLLECTION: "not-collection";
|
|
98
109
|
/** The field is not a single string. */
|
|
99
|
-
readonly NOT_SINGLE_STRING: "
|
|
110
|
+
readonly NOT_SINGLE_STRING: "not-single-string";
|
|
100
111
|
/** The model does not support search. */
|
|
101
|
-
readonly MODEL_SEARCH_UNSUPPORTED: "
|
|
112
|
+
readonly MODEL_SEARCH_UNSUPPORTED: "model-search-unsupported";
|
|
102
113
|
/** The field cannot be used for a cursor. */
|
|
103
|
-
readonly CURSOR_NOT_ALLOWED: "
|
|
114
|
+
readonly CURSOR_NOT_ALLOWED: "cursor-not-allowed";
|
|
104
115
|
/** The field is protected and cannot be aggregated. */
|
|
105
|
-
readonly PROTECTED_AGGREGATION: "
|
|
116
|
+
readonly PROTECTED_AGGREGATION: "protected-aggregation";
|
|
106
117
|
/**
|
|
107
118
|
* The field is protected and cannot be filtered or sorted: its descriptor
|
|
108
119
|
* says `sensitivity.comparable: false`. A search that names it is refused
|
|
109
120
|
* the same way.
|
|
110
121
|
*/
|
|
111
|
-
readonly PROTECTED_COMPARISON: "
|
|
122
|
+
readonly PROTECTED_COMPARISON: "protected-comparison";
|
|
112
123
|
/** A terms group's `missingKey` needs a single-valued string field. */
|
|
113
|
-
readonly MISSING_KEY_REQUIRES_STRING: "
|
|
124
|
+
readonly MISSING_KEY_REQUIRES_STRING: "missing-key-requires-string";
|
|
114
125
|
/** `ANY` needs a single value. */
|
|
115
|
-
readonly ANY_REQUIRES_SINGLE_VALUE: "
|
|
126
|
+
readonly ANY_REQUIRES_SINGLE_VALUE: "any-requires-single-value";
|
|
116
127
|
/** The storage cannot deliver a complete projection; select fields explicitly. */
|
|
117
|
-
readonly INCOMPLETE_PROJECTION: "
|
|
128
|
+
readonly INCOMPLETE_PROJECTION: "incomplete-projection";
|
|
118
129
|
/** A metric filter uses a search filter. */
|
|
119
|
-
readonly METRIC_FILTER_SEARCH: "
|
|
130
|
+
readonly METRIC_FILTER_SEARCH: "metric-filter-search";
|
|
120
131
|
/** A metric filter uses `ELEMENT_MATCH`. */
|
|
121
|
-
readonly METRIC_FILTER_ELEMENT_MATCH: "
|
|
132
|
+
readonly METRIC_FILTER_ELEMENT_MATCH: "metric-filter-element-match";
|
|
122
133
|
/** A metric filter names an array field; it must be scalar. */
|
|
123
|
-
readonly METRIC_FILTER_ARRAY_FIELD: "
|
|
134
|
+
readonly METRIC_FILTER_ARRAY_FIELD: "metric-filter-array-field";
|
|
124
135
|
/** The field cannot be projected. */
|
|
125
|
-
readonly NOT_PROJECTABLE: "
|
|
136
|
+
readonly NOT_PROJECTABLE: "not-projectable";
|
|
126
137
|
/** An event projection that keeps payloads must keep their `bodyType`. */
|
|
127
|
-
readonly EVENT_PROJECTION_TYPE_REQUIRED: "
|
|
138
|
+
readonly EVENT_PROJECTION_TYPE_REQUIRED: "event-projection-type-required";
|
|
128
139
|
/** A relative-time filter needs a field with a known temporal representation. */
|
|
129
|
-
readonly TEMPORAL_REPRESENTATION_REQUIRED: "
|
|
140
|
+
readonly TEMPORAL_REPRESENTATION_REQUIRED: "temporal-representation-required";
|
|
130
141
|
/** A relative-time filter's zone, pattern or unit conflicts with the field's definition. */
|
|
131
|
-
readonly TEMPORAL_CONFIGURATION_CONFLICT: "
|
|
142
|
+
readonly TEMPORAL_CONFIGURATION_CONFLICT: "temporal-configuration-conflict";
|
|
132
143
|
/**
|
|
133
144
|
* A sort names two array fields on independent arrays, which the storage
|
|
134
145
|
* cannot order by together; `path` is the second of them. The descriptor
|
|
135
146
|
* lists such fields under a `PARALLEL_ARRAY_SORT` constraint.
|
|
136
147
|
*/
|
|
137
|
-
readonly PARALLEL_ARRAY_SORT: "
|
|
148
|
+
readonly PARALLEL_ARRAY_SORT: "parallel-array-sort";
|
|
138
149
|
/**
|
|
139
150
|
* An `EQ` or `NE` compares the field to an array, which the storage cannot
|
|
140
151
|
* do: it takes only a scalar operand. The descriptor says so with an
|
|
141
152
|
* `ARRAY_EQUALITY` constraint.
|
|
142
153
|
*/
|
|
143
|
-
readonly ARRAY_EQUALITY: "
|
|
154
|
+
readonly ARRAY_EQUALITY: "array-equality";
|
|
144
155
|
/**
|
|
145
156
|
* A `FIRST` or `LAST` metric names a field that may hold several values;
|
|
146
157
|
* it needs a single-valued one (`aggregate.firstLast` in the descriptor).
|
|
147
158
|
*/
|
|
148
|
-
readonly FIRST_LAST_REQUIRES_SINGLE_VALUE: "
|
|
159
|
+
readonly FIRST_LAST_REQUIRES_SINGLE_VALUE: "first-last-requires-single-value";
|
|
149
160
|
/**
|
|
150
161
|
* A `FIRST` or `LAST` metric names no `orderBy` where there is no event
|
|
151
162
|
* time to order by, such as inside an element or on a model whose
|
|
152
163
|
* descriptor has no `analysis.firstLastOrderBy`; `path` is its field.
|
|
153
164
|
*/
|
|
154
|
-
readonly FIRST_LAST_REQUIRES_ORDER_BY: "
|
|
165
|
+
readonly FIRST_LAST_REQUIRES_ORDER_BY: "first-last-requires-order-by";
|
|
155
166
|
/**
|
|
156
167
|
* A date group or date difference names a field that stores neither a
|
|
157
168
|
* date nor an epoch (a formatted string, say), so it cannot be aggregated
|
|
158
169
|
* by time.
|
|
159
170
|
*/
|
|
160
|
-
readonly TEMPORAL_AGGREGATION_UNSUPPORTED: "
|
|
171
|
+
readonly TEMPORAL_AGGREGATION_UNSUPPORTED: "temporal-aggregation-unsupported";
|
|
161
172
|
/** The sort has more fields than the protocol allows; `path` is `''`. */
|
|
162
|
-
readonly SORT_TOO_MANY: "
|
|
173
|
+
readonly SORT_TOO_MANY: "sort-too-many";
|
|
163
174
|
/** Two sort fields name the same stored field; `path` is the second. */
|
|
164
|
-
readonly SORT_FIELD_DUPLICATE: "
|
|
175
|
+
readonly SORT_FIELD_DUPLICATE: "sort-field-duplicate";
|
|
165
176
|
/**
|
|
166
177
|
* An identity filter or a cursor on a model that defines no record
|
|
167
178
|
* identity; `path` is `''`.
|
|
168
179
|
*/
|
|
169
|
-
readonly IDENTITY_UNDEFINED: "
|
|
180
|
+
readonly IDENTITY_UNDEFINED: "identity-undefined";
|
|
170
181
|
/**
|
|
171
182
|
* The storage does not support the feature the query uses, or its native
|
|
172
183
|
* query language cannot express it (a MongoDB PHRASE search with a quote,
|
|
173
184
|
* say); `path` is the field, or `''`.
|
|
174
185
|
*/
|
|
175
|
-
readonly STORAGE_UNSUPPORTED: "
|
|
186
|
+
readonly STORAGE_UNSUPPORTED: "storage-unsupported";
|
|
176
187
|
/**
|
|
177
188
|
* A `PREVIOUS` window steps along a date group whose field the filter
|
|
178
189
|
* conditions where its range cannot be shifted to the earlier period:
|
|
179
190
|
* outside the top-level `AND`, or with a value that is not an instant;
|
|
180
191
|
* `path` is the field.
|
|
181
192
|
*/
|
|
182
|
-
readonly PREVIOUS_UNSHIFTABLE: "
|
|
193
|
+
readonly PREVIOUS_UNSHIFTABLE: "previous-unshiftable";
|
|
183
194
|
}>;
|
|
184
195
|
/** One of the codes this package knows; see {@link QueryErrorCodes}. */
|
|
185
196
|
export type KnownQueryErrorCode = (typeof QueryErrorCodes)[keyof typeof QueryErrorCodes];
|
|
@@ -21,165 +21,176 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const QueryErrorCodes: Readonly<{
|
|
23
23
|
/** The body is not valid JSON. */
|
|
24
|
-
readonly INVALID_JSON: "
|
|
24
|
+
readonly INVALID_JSON: "invalid-json";
|
|
25
25
|
/** The body is JSON but not an object. */
|
|
26
|
-
readonly BODY_NOT_OBJECT: "
|
|
26
|
+
readonly BODY_NOT_OBJECT: "body-not-object";
|
|
27
27
|
/** The body is empty. */
|
|
28
|
-
readonly EMPTY_BODY: "
|
|
28
|
+
readonly EMPTY_BODY: "empty-body";
|
|
29
29
|
/** The body has a property the query type does not declare. */
|
|
30
|
-
readonly UNKNOWN_PROPERTY: "
|
|
30
|
+
readonly UNKNOWN_PROPERTY: "unknown-property";
|
|
31
31
|
/** An `op`, metric or other type discriminator names no known type. */
|
|
32
|
-
readonly UNKNOWN_TYPE: "
|
|
32
|
+
readonly UNKNOWN_TYPE: "unknown-type";
|
|
33
33
|
/** An enum value is not one the server knows. */
|
|
34
|
-
readonly UNKNOWN_VALUE: "
|
|
34
|
+
readonly UNKNOWN_VALUE: "unknown-value";
|
|
35
35
|
/** A value is missing or has the wrong JSON type. */
|
|
36
|
-
readonly INVALID_VALUE: "
|
|
36
|
+
readonly INVALID_VALUE: "invalid-value";
|
|
37
37
|
/** Any other request rule; the message names it. */
|
|
38
|
-
readonly INVALID_REQUEST: "
|
|
38
|
+
readonly INVALID_REQUEST: "invalid-request";
|
|
39
39
|
/** A cursor sort names a field twice; `path` is the repeated field. */
|
|
40
|
-
readonly CURSOR_SORT_DUPLICATE: "
|
|
40
|
+
readonly CURSOR_SORT_DUPLICATE: "cursor-sort-duplicate";
|
|
41
41
|
/** A cursor sort has too many fields once the identity tie-breaker is appended. */
|
|
42
|
-
readonly CURSOR_SORT_TOO_MANY: "
|
|
42
|
+
readonly CURSOR_SORT_TOO_MANY: "cursor-sort-too-many";
|
|
43
43
|
/**
|
|
44
44
|
* The cursor token was not issued for this model and effective sort, or
|
|
45
45
|
* does not decode; `path` is `cursor`. Start again from the first page.
|
|
46
46
|
*/
|
|
47
|
-
readonly INVALID_CURSOR: "
|
|
47
|
+
readonly INVALID_CURSOR: "invalid-cursor";
|
|
48
|
+
/**
|
|
49
|
+
* A stream that cannot be resumed, its sort having no keyset in its store,
|
|
50
|
+
* names no `limit`: it would stop at a default and say nothing. Name a
|
|
51
|
+
* `limit`, or sort by fields its store keeps a keyset of; `path` is `limit`.
|
|
52
|
+
*/
|
|
53
|
+
readonly STREAM_NOT_RESUMABLE: "stream-not-resumable";
|
|
48
54
|
/**
|
|
49
55
|
* The entry's budget: a list or aggregation `limit`, a page's index, size,
|
|
50
56
|
* window or offset, or a cursor page's `size` is out of range; `path` names
|
|
51
57
|
* which (`limit`, `pagination.size`, `size`, …).
|
|
52
58
|
*/
|
|
53
|
-
readonly SIZE_OUT_OF_RANGE: "
|
|
59
|
+
readonly SIZE_OUT_OF_RANGE: "size-out-of-range";
|
|
54
60
|
/**
|
|
55
61
|
* The entry's budget: the filter or `having` has too many nodes or values;
|
|
56
62
|
* `path` is `filter` or `having`.
|
|
57
63
|
*/
|
|
58
|
-
readonly FILTER_TOO_LARGE: "
|
|
64
|
+
readonly FILTER_TOO_LARGE: "filter-too-large";
|
|
59
65
|
/**
|
|
60
66
|
* The entry does not allow expensive operators, and the query uses one: an
|
|
61
67
|
* operator, an element expansion, a metric sort, an arithmetic or
|
|
62
68
|
* expression group, a date part, a dense fill or FIRST / LAST; `path` names
|
|
63
69
|
* the part (`filter`, `elements`, `sort`, `metrics`, `groupBy`).
|
|
64
70
|
*/
|
|
65
|
-
readonly EXPENSIVE_OPERATOR_DISABLED: "
|
|
71
|
+
readonly EXPENSIVE_OPERATOR_DISABLED: "expensive-operator-disabled";
|
|
66
72
|
/**
|
|
67
73
|
* A counting query (count, or a paged query's total) would match every
|
|
68
74
|
* record, which the entry refuses; `path` is `filter`.
|
|
69
75
|
*/
|
|
70
|
-
readonly COUNT_REQUIRES_FILTER: "
|
|
76
|
+
readonly COUNT_REQUIRES_FILTER: "count-requires-filter";
|
|
71
77
|
/**
|
|
72
78
|
* A `having` or metric sort the storage evaluates after grouping read more
|
|
73
79
|
* groups than the server allows; `path` is `body`. It may end a stream
|
|
74
80
|
* partway through.
|
|
75
81
|
*/
|
|
76
|
-
readonly RESIDUAL_GROUPS_EXCEEDED: "
|
|
82
|
+
readonly RESIDUAL_GROUPS_EXCEEDED: "residual-groups-exceeded";
|
|
83
|
+
/**
|
|
84
|
+
* An aggregation that names no sort found more groups than its `limit`;
|
|
85
|
+
* `path` is `limit`. Add a sort for a top-N, or raise the limit.
|
|
86
|
+
*/
|
|
87
|
+
readonly TOO_MANY_GROUPS: "too-many-groups";
|
|
77
88
|
/**
|
|
78
89
|
* An in-process query named no entry where one is required. Never
|
|
79
90
|
* answered over HTTP; listed so the mirror stays complete.
|
|
80
91
|
*/
|
|
81
|
-
readonly EXPLICIT_ENTRY_REQUIRED: "
|
|
92
|
+
readonly EXPLICIT_ENTRY_REQUIRED: "explicit-entry-required";
|
|
82
93
|
/**
|
|
83
94
|
* A state point read (`GET …/{id}/state?version=|at=`, `…/state/trace`): the
|
|
84
95
|
* state asked for is more commits away from the snapshot, or from version 1,
|
|
85
96
|
* than a state read replays. The path is the query parameter.
|
|
86
97
|
*/
|
|
87
|
-
readonly REPLAY_TOO_LONG: "
|
|
98
|
+
readonly REPLAY_TOO_LONG: "replay-too-long";
|
|
88
99
|
/** The model has no such logical field. */
|
|
89
|
-
readonly UNKNOWN_FIELD: "
|
|
100
|
+
readonly UNKNOWN_FIELD: "unknown-field";
|
|
90
101
|
/** The field does not offer the capability the query uses (sort, range, …). */
|
|
91
|
-
readonly UNSUPPORTED_CAPABILITY: "
|
|
102
|
+
readonly UNSUPPORTED_CAPABILITY: "unsupported-capability";
|
|
92
103
|
/** The field is an element field and must be queried inside its element scope. */
|
|
93
|
-
readonly ELEMENT_SCOPE_REQUIRED: "
|
|
104
|
+
readonly ELEMENT_SCOPE_REQUIRED: "element-scope-required";
|
|
94
105
|
/** A filter value falls outside the field's declared domain. */
|
|
95
|
-
readonly VALUE_MISMATCH: "
|
|
106
|
+
readonly VALUE_MISMATCH: "value-mismatch";
|
|
96
107
|
/** The field is not a known collection (for example under `isEmpty`). */
|
|
97
|
-
readonly NOT_COLLECTION: "
|
|
108
|
+
readonly NOT_COLLECTION: "not-collection";
|
|
98
109
|
/** The field is not a single string. */
|
|
99
|
-
readonly NOT_SINGLE_STRING: "
|
|
110
|
+
readonly NOT_SINGLE_STRING: "not-single-string";
|
|
100
111
|
/** The model does not support search. */
|
|
101
|
-
readonly MODEL_SEARCH_UNSUPPORTED: "
|
|
112
|
+
readonly MODEL_SEARCH_UNSUPPORTED: "model-search-unsupported";
|
|
102
113
|
/** The field cannot be used for a cursor. */
|
|
103
|
-
readonly CURSOR_NOT_ALLOWED: "
|
|
114
|
+
readonly CURSOR_NOT_ALLOWED: "cursor-not-allowed";
|
|
104
115
|
/** The field is protected and cannot be aggregated. */
|
|
105
|
-
readonly PROTECTED_AGGREGATION: "
|
|
116
|
+
readonly PROTECTED_AGGREGATION: "protected-aggregation";
|
|
106
117
|
/**
|
|
107
118
|
* The field is protected and cannot be filtered or sorted: its descriptor
|
|
108
119
|
* says `sensitivity.comparable: false`. A search that names it is refused
|
|
109
120
|
* the same way.
|
|
110
121
|
*/
|
|
111
|
-
readonly PROTECTED_COMPARISON: "
|
|
122
|
+
readonly PROTECTED_COMPARISON: "protected-comparison";
|
|
112
123
|
/** A terms group's `missingKey` needs a single-valued string field. */
|
|
113
|
-
readonly MISSING_KEY_REQUIRES_STRING: "
|
|
124
|
+
readonly MISSING_KEY_REQUIRES_STRING: "missing-key-requires-string";
|
|
114
125
|
/** `ANY` needs a single value. */
|
|
115
|
-
readonly ANY_REQUIRES_SINGLE_VALUE: "
|
|
126
|
+
readonly ANY_REQUIRES_SINGLE_VALUE: "any-requires-single-value";
|
|
116
127
|
/** The storage cannot deliver a complete projection; select fields explicitly. */
|
|
117
|
-
readonly INCOMPLETE_PROJECTION: "
|
|
128
|
+
readonly INCOMPLETE_PROJECTION: "incomplete-projection";
|
|
118
129
|
/** A metric filter uses a search filter. */
|
|
119
|
-
readonly METRIC_FILTER_SEARCH: "
|
|
130
|
+
readonly METRIC_FILTER_SEARCH: "metric-filter-search";
|
|
120
131
|
/** A metric filter uses `ELEMENT_MATCH`. */
|
|
121
|
-
readonly METRIC_FILTER_ELEMENT_MATCH: "
|
|
132
|
+
readonly METRIC_FILTER_ELEMENT_MATCH: "metric-filter-element-match";
|
|
122
133
|
/** A metric filter names an array field; it must be scalar. */
|
|
123
|
-
readonly METRIC_FILTER_ARRAY_FIELD: "
|
|
134
|
+
readonly METRIC_FILTER_ARRAY_FIELD: "metric-filter-array-field";
|
|
124
135
|
/** The field cannot be projected. */
|
|
125
|
-
readonly NOT_PROJECTABLE: "
|
|
136
|
+
readonly NOT_PROJECTABLE: "not-projectable";
|
|
126
137
|
/** An event projection that keeps payloads must keep their `bodyType`. */
|
|
127
|
-
readonly EVENT_PROJECTION_TYPE_REQUIRED: "
|
|
138
|
+
readonly EVENT_PROJECTION_TYPE_REQUIRED: "event-projection-type-required";
|
|
128
139
|
/** A relative-time filter needs a field with a known temporal representation. */
|
|
129
|
-
readonly TEMPORAL_REPRESENTATION_REQUIRED: "
|
|
140
|
+
readonly TEMPORAL_REPRESENTATION_REQUIRED: "temporal-representation-required";
|
|
130
141
|
/** A relative-time filter's zone, pattern or unit conflicts with the field's definition. */
|
|
131
|
-
readonly TEMPORAL_CONFIGURATION_CONFLICT: "
|
|
142
|
+
readonly TEMPORAL_CONFIGURATION_CONFLICT: "temporal-configuration-conflict";
|
|
132
143
|
/**
|
|
133
144
|
* A sort names two array fields on independent arrays, which the storage
|
|
134
145
|
* cannot order by together; `path` is the second of them. The descriptor
|
|
135
146
|
* lists such fields under a `PARALLEL_ARRAY_SORT` constraint.
|
|
136
147
|
*/
|
|
137
|
-
readonly PARALLEL_ARRAY_SORT: "
|
|
148
|
+
readonly PARALLEL_ARRAY_SORT: "parallel-array-sort";
|
|
138
149
|
/**
|
|
139
150
|
* An `EQ` or `NE` compares the field to an array, which the storage cannot
|
|
140
151
|
* do: it takes only a scalar operand. The descriptor says so with an
|
|
141
152
|
* `ARRAY_EQUALITY` constraint.
|
|
142
153
|
*/
|
|
143
|
-
readonly ARRAY_EQUALITY: "
|
|
154
|
+
readonly ARRAY_EQUALITY: "array-equality";
|
|
144
155
|
/**
|
|
145
156
|
* A `FIRST` or `LAST` metric names a field that may hold several values;
|
|
146
157
|
* it needs a single-valued one (`aggregate.firstLast` in the descriptor).
|
|
147
158
|
*/
|
|
148
|
-
readonly FIRST_LAST_REQUIRES_SINGLE_VALUE: "
|
|
159
|
+
readonly FIRST_LAST_REQUIRES_SINGLE_VALUE: "first-last-requires-single-value";
|
|
149
160
|
/**
|
|
150
161
|
* A `FIRST` or `LAST` metric names no `orderBy` where there is no event
|
|
151
162
|
* time to order by, such as inside an element or on a model whose
|
|
152
163
|
* descriptor has no `analysis.firstLastOrderBy`; `path` is its field.
|
|
153
164
|
*/
|
|
154
|
-
readonly FIRST_LAST_REQUIRES_ORDER_BY: "
|
|
165
|
+
readonly FIRST_LAST_REQUIRES_ORDER_BY: "first-last-requires-order-by";
|
|
155
166
|
/**
|
|
156
167
|
* A date group or date difference names a field that stores neither a
|
|
157
168
|
* date nor an epoch (a formatted string, say), so it cannot be aggregated
|
|
158
169
|
* by time.
|
|
159
170
|
*/
|
|
160
|
-
readonly TEMPORAL_AGGREGATION_UNSUPPORTED: "
|
|
171
|
+
readonly TEMPORAL_AGGREGATION_UNSUPPORTED: "temporal-aggregation-unsupported";
|
|
161
172
|
/** The sort has more fields than the protocol allows; `path` is `''`. */
|
|
162
|
-
readonly SORT_TOO_MANY: "
|
|
173
|
+
readonly SORT_TOO_MANY: "sort-too-many";
|
|
163
174
|
/** Two sort fields name the same stored field; `path` is the second. */
|
|
164
|
-
readonly SORT_FIELD_DUPLICATE: "
|
|
175
|
+
readonly SORT_FIELD_DUPLICATE: "sort-field-duplicate";
|
|
165
176
|
/**
|
|
166
177
|
* An identity filter or a cursor on a model that defines no record
|
|
167
178
|
* identity; `path` is `''`.
|
|
168
179
|
*/
|
|
169
|
-
readonly IDENTITY_UNDEFINED: "
|
|
180
|
+
readonly IDENTITY_UNDEFINED: "identity-undefined";
|
|
170
181
|
/**
|
|
171
182
|
* The storage does not support the feature the query uses, or its native
|
|
172
183
|
* query language cannot express it (a MongoDB PHRASE search with a quote,
|
|
173
184
|
* say); `path` is the field, or `''`.
|
|
174
185
|
*/
|
|
175
|
-
readonly STORAGE_UNSUPPORTED: "
|
|
186
|
+
readonly STORAGE_UNSUPPORTED: "storage-unsupported";
|
|
176
187
|
/**
|
|
177
188
|
* A `PREVIOUS` window steps along a date group whose field the filter
|
|
178
189
|
* conditions where its range cannot be shifted to the earlier period:
|
|
179
190
|
* outside the top-level `AND`, or with a value that is not an instant;
|
|
180
191
|
* `path` is the field.
|
|
181
192
|
*/
|
|
182
|
-
readonly PREVIOUS_UNSHIFTABLE: "
|
|
193
|
+
readonly PREVIOUS_UNSHIFTABLE: "previous-unshiftable";
|
|
183
194
|
}>;
|
|
184
195
|
/** One of the codes this package knows; see {@link QueryErrorCodes}. */
|
|
185
196
|
export type KnownQueryErrorCode = (typeof QueryErrorCodes)[keyof typeof QueryErrorCodes];
|