@dynatrace-sdk/client-query 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +174 -0
- package/README.md +54 -0
- package/cjs/index.js +1788 -0
- package/docs/DOCS.md +2833 -0
- package/dynatrace-metadata.json +18 -0
- package/esm/index.js +1766 -0
- package/package.json +11 -0
- package/types/index.d.ts +1 -0
- package/types/packages/client/query/src/index.d.ts +1 -0
- package/types/packages/client/query/src/lib/apis/index.d.ts +2 -0
- package/types/packages/client/query/src/lib/apis/query-assistance-api.d.ts +276 -0
- package/types/packages/client/query/src/lib/apis/query-execution-api.d.ts +337 -0
- package/types/packages/client/query/src/lib/error-envelopes/api-client-error.d.ts +9 -0
- package/types/packages/client/query/src/lib/error-envelopes/client-request-error.d.ts +8 -0
- package/types/packages/client/query/src/lib/error-envelopes/error-envelope-error.d.ts +8 -0
- package/types/packages/client/query/src/lib/error-envelopes/error-serializer.d.ts +3 -0
- package/types/packages/client/query/src/lib/error-envelopes/index.d.ts +3 -0
- package/types/packages/client/query/src/lib/error-envelopes/invalid-response-error.d.ts +8 -0
- package/types/packages/client/query/src/lib/index.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/autocomplete-request.d.ts +26 -0
- package/types/packages/client/query/src/lib/models/autocomplete-response.d.ts +28 -0
- package/types/packages/client/query/src/lib/models/autocomplete-suggestion-part.d.ts +30 -0
- package/types/packages/client/query/src/lib/models/autocomplete-suggestion.d.ts +28 -0
- package/types/packages/client/query/src/lib/models/dql-alternative-node.d.ts +18 -0
- package/types/packages/client/query/src/lib/models/dql-container-node.d.ts +23 -0
- package/types/packages/client/query/src/lib/models/dql-node-node-type.d.ts +14 -0
- package/types/packages/client/query/src/lib/models/dql-node.d.ts +29 -0
- package/types/packages/client/query/src/lib/models/dql-terminal-node.d.ts +26 -0
- package/types/packages/client/query/src/lib/models/error-envelope.d.ts +18 -0
- package/types/packages/client/query/src/lib/models/error-response-details.d.ts +50 -0
- package/types/packages/client/query/src/lib/models/error-response.d.ts +25 -0
- package/types/packages/client/query/src/lib/models/execute-request.d.ts +64 -0
- package/types/packages/client/query/src/lib/models/field-type-type.d.ts +21 -0
- package/types/packages/client/query/src/lib/models/field-type.d.ts +18 -0
- package/types/packages/client/query/src/lib/models/geo-point.d.ts +22 -0
- package/types/packages/client/query/src/lib/models/grail-metadata.d.ts +66 -0
- package/types/packages/client/query/src/lib/models/index.d.ts +35 -0
- package/types/packages/client/query/src/lib/models/metadata-notification.d.ts +45 -0
- package/types/packages/client/query/src/lib/models/metadata.d.ts +18 -0
- package/types/packages/client/query/src/lib/models/metric-metadata.d.ts +32 -0
- package/types/packages/client/query/src/lib/models/parse-request.d.ts +24 -0
- package/types/packages/client/query/src/lib/models/position-info.d.ts +27 -0
- package/types/packages/client/query/src/lib/models/query-poll-response.d.ts +28 -0
- package/types/packages/client/query/src/lib/models/query-result.d.ts +27 -0
- package/types/packages/client/query/src/lib/models/query-start-response.d.ts +33 -0
- package/types/packages/client/query/src/lib/models/query-state.d.ts +17 -0
- package/types/packages/client/query/src/lib/models/ranged-field-types-mappings.d.ts +15 -0
- package/types/packages/client/query/src/lib/models/ranged-field-types.d.ts +20 -0
- package/types/packages/client/query/src/lib/models/result-record-value.d.ts +13 -0
- package/types/packages/client/query/src/lib/models/result-record.d.ts +15 -0
- package/types/packages/client/query/src/lib/models/timeframe.d.ts +22 -0
- package/types/packages/client/query/src/lib/models/token-position.d.ts +20 -0
- package/types/packages/client/query/src/lib/models/token-type.d.ts +48 -0
- package/types/packages/client/query/src/lib/models/verify-request.d.ts +24 -0
- package/types/packages/client/query/src/lib/models/verify-response.d.ts +23 -0
- package/types/packages/client/query/src/lib/utils/url-helpers.d.ts +3 -0
- package/types/packages/http-client/src/index.d.ts +2 -0
- package/types/packages/http-client/src/lib/platform/abort-controller.d.ts +6 -0
- package/types/packages/http-client/src/lib/platform/abort-signal.d.ts +6 -0
- package/types/packages/http-client/src/lib/platform/apply-content-type-header.d.ts +2 -0
- package/types/packages/http-client/src/lib/platform/base-error.d.ts +5 -0
- package/types/packages/http-client/src/lib/platform/binary.d.ts +13 -0
- package/types/packages/http-client/src/lib/platform/data-type-error.d.ts +6 -0
- package/types/packages/http-client/src/lib/platform/decode-response-body.d.ts +3 -0
- package/types/packages/http-client/src/lib/platform/default-status-validator.d.ts +2 -0
- package/types/packages/http-client/src/lib/platform/encode-request-body.d.ts +2 -0
- package/types/packages/http-client/src/lib/platform/http-client-abort-error.d.ts +7 -0
- package/types/packages/http-client/src/lib/platform/http-client-request-error.d.ts +7 -0
- package/types/packages/http-client/src/lib/platform/http-client-response-error-serializer.d.ts +1 -0
- package/types/packages/http-client/src/lib/platform/http-client-response-error.d.ts +8 -0
- package/types/packages/http-client/src/lib/platform/http-client-response.d.ts +10 -0
- package/types/packages/http-client/src/lib/platform/http-client.d.ts +5 -0
- package/types/packages/http-client/src/lib/platform/index.d.ts +11 -0
- package/types/packages/http-client/src/lib/platform/unsupported-operation-error.d.ts +6 -0
- package/types/packages/http-client/src/lib/types/abort-controller.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/abort-signal.d.ts +15 -0
- package/types/packages/http-client/src/lib/types/base-error.d.ts +4 -0
- package/types/packages/http-client/src/lib/types/binary.d.ts +15 -0
- package/types/packages/http-client/src/lib/types/data-type-error.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/data-types.d.ts +36 -0
- package/types/packages/http-client/src/lib/types/form-data-request-body.d.ts +83 -0
- package/types/packages/http-client/src/lib/types/form-data-response-body.d.ts +15 -0
- package/types/packages/http-client/src/lib/types/headers.d.ts +6 -0
- package/types/packages/http-client/src/lib/types/http-client-abort-error.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/http-client-network-error.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/http-client-request-error.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/http-client-request-options.d.ts +42 -0
- package/types/packages/http-client/src/lib/types/http-client-response-error.d.ts +19 -0
- package/types/packages/http-client/src/lib/types/http-client-response.d.ts +33 -0
- package/types/packages/http-client/src/lib/types/http-client.d.ts +24 -0
- package/types/packages/http-client/src/lib/types/index.d.ts +20 -0
- package/types/packages/http-client/src/lib/types/request-body-types.d.ts +26 -0
- package/types/packages/http-client/src/lib/types/response-body-types.d.ts +46 -0
- package/types/packages/http-client/src/lib/types/status-validator.d.ts +7 -0
- package/types/packages/http-client/src/lib/types/unsupported-operation-error.d.ts +14 -0
- package/types/packages/platform/error-handlers/src/index.d.ts +2 -0
- package/types/packages/platform/error-handlers/src/lib/add-global-error-serializer.d.ts +13 -0
- package/types/packages/platform/error-handlers/src/lib/types/common-serialized-error.d.ts +10 -0
- package/types/packages/platform/error-handlers/src/lib/types/dt-runtime-error-handlers.d.ts +5 -0
- package/types/packages/platform/error-handlers/src/lib/types/error-type.d.ts +9 -0
- package/types/packages/platform/error-handlers/src/lib/types/global-dt-runtime-with-error-handlers.d.ts +7 -0
- package/types/packages/platform/error-handlers/src/lib/types/global-error-serializer.d.ts +10 -0
- package/types/packages/platform/error-handlers/src/lib/types/http-serialized-error.d.ts +11 -0
- package/types/packages/platform/error-handlers/src/lib/types/index.d.ts +6 -0
- package/types/packages/platform/error-handlers/src/lib/types/serialized-error.d.ts +8 -0
- package/types/packages/platform/shared/index.d.ts +1 -0
- package/types/packages/platform/shared/utils/get-global-with-dt-runtime.d.ts +1 -0
package/esm/index.js
ADDED
|
@@ -0,0 +1,1766 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Dynatrace LLC
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// packages/client/query/src/lib/apis/query-assistance-api.ts
|
|
18
|
+
import { httpClient as defaultHttpClient } from "@dynatrace-sdk/http-client";
|
|
19
|
+
|
|
20
|
+
// packages/platform/shared/utils/get-global-with-dt-runtime.ts
|
|
21
|
+
var getGlobalWithDtRuntime = () => typeof globalThis !== "undefined" ? globalThis : window;
|
|
22
|
+
|
|
23
|
+
// packages/platform/error-handlers/src/lib/add-global-error-serializer.ts
|
|
24
|
+
function addGlobalErrorSerializer(serializer) {
|
|
25
|
+
const addGlobalErrorSerializerFunc = getAddGlobalErrorSerializer();
|
|
26
|
+
if (typeof addGlobalErrorSerializerFunc === "function") {
|
|
27
|
+
addGlobalErrorSerializerFunc(serializer);
|
|
28
|
+
} else {
|
|
29
|
+
console.warn("Missing addGlobalErrorSerializer function from sdk-web-runtime.");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function isGlobalErrorSerializerSupported() {
|
|
33
|
+
return typeof getAddGlobalErrorSerializer() === "function";
|
|
34
|
+
}
|
|
35
|
+
function getAddGlobalErrorSerializer() {
|
|
36
|
+
return getGlobalWithDtRuntime().dtRuntime?.errorHandlers?.addGlobalErrorSerializer;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// packages/client/query/src/lib/error-envelopes/api-client-error.ts
|
|
40
|
+
var ApiClientError = class extends Error {
|
|
41
|
+
errorType = "JS Error" /* COMMON */;
|
|
42
|
+
constructor(name, message) {
|
|
43
|
+
super(message);
|
|
44
|
+
this.name = name;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function isApiClientError(e) {
|
|
48
|
+
return e instanceof ApiClientError;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// packages/client/query/src/lib/error-envelopes/client-request-error.ts
|
|
52
|
+
var ClientRequestError = class extends ApiClientError {
|
|
53
|
+
body;
|
|
54
|
+
response;
|
|
55
|
+
constructor(name, response, body, message) {
|
|
56
|
+
super(name, message);
|
|
57
|
+
this.errorType = "Http Error" /* HTTP */;
|
|
58
|
+
this.body = body;
|
|
59
|
+
this.response = response;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function isClientRequestError(e) {
|
|
63
|
+
return e instanceof ClientRequestError;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// packages/client/query/src/lib/error-envelopes/error-envelope-error.ts
|
|
67
|
+
var ErrorEnvelopeError = class extends ClientRequestError {
|
|
68
|
+
};
|
|
69
|
+
function isErrorEnvelopeError(e) {
|
|
70
|
+
return e instanceof ErrorEnvelopeError;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// packages/client/query/src/lib/error-envelopes/error-serializer.ts
|
|
74
|
+
var apiClientErrorSerializer = async (error) => {
|
|
75
|
+
if (isClientRequestError(error)) {
|
|
76
|
+
const status = error.response.status;
|
|
77
|
+
const message = error.message;
|
|
78
|
+
return {
|
|
79
|
+
name: error.name,
|
|
80
|
+
status,
|
|
81
|
+
message,
|
|
82
|
+
stack: error.stack,
|
|
83
|
+
type: "Http Error" /* HTTP */
|
|
84
|
+
};
|
|
85
|
+
} else if (isApiClientError(error)) {
|
|
86
|
+
return {
|
|
87
|
+
name: error.name,
|
|
88
|
+
message: error.message,
|
|
89
|
+
stack: error.stack,
|
|
90
|
+
type: "JS Error" /* COMMON */
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var errorSerializerAdded = false;
|
|
95
|
+
function registerGlobalErrorSerializer(serializer) {
|
|
96
|
+
if (!errorSerializerAdded && isGlobalErrorSerializerSupported()) {
|
|
97
|
+
errorSerializerAdded = true;
|
|
98
|
+
addGlobalErrorSerializer(serializer);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// packages/client/query/src/lib/error-envelopes/invalid-response-error.ts
|
|
103
|
+
var InvalidResponseError = class extends ApiClientError {
|
|
104
|
+
responseBody;
|
|
105
|
+
expectedType;
|
|
106
|
+
nestedError;
|
|
107
|
+
constructor(name, nestedError, body, expectedType, message) {
|
|
108
|
+
super(
|
|
109
|
+
name,
|
|
110
|
+
message ?? `${name}: Response does not match expected datatype${expectedType ? " " + expectedType : ""}: ${nestedError?.toString() ?? "unable to deserialize"}`
|
|
111
|
+
);
|
|
112
|
+
this.nestedError = nestedError;
|
|
113
|
+
this.responseBody = body;
|
|
114
|
+
this.expectedType = expectedType;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// packages/client/query/src/lib/models/autocomplete-request.ts
|
|
119
|
+
var _AutocompleteRequestTransformation;
|
|
120
|
+
((_AutocompleteRequestTransformation2) => {
|
|
121
|
+
function fromJson(model) {
|
|
122
|
+
const { query, cursorPosition, timezone, locale } = model;
|
|
123
|
+
return {
|
|
124
|
+
query,
|
|
125
|
+
cursorPosition,
|
|
126
|
+
timezone,
|
|
127
|
+
locale
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
_AutocompleteRequestTransformation2.fromJson = fromJson;
|
|
131
|
+
function toJson(model) {
|
|
132
|
+
const { query, cursorPosition, timezone, locale } = model;
|
|
133
|
+
return {
|
|
134
|
+
query,
|
|
135
|
+
cursorPosition,
|
|
136
|
+
timezone,
|
|
137
|
+
locale
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
_AutocompleteRequestTransformation2.toJson = toJson;
|
|
141
|
+
})(_AutocompleteRequestTransformation || (_AutocompleteRequestTransformation = {}));
|
|
142
|
+
|
|
143
|
+
// packages/client/query/src/lib/models/token-type.ts
|
|
144
|
+
var TokenType = /* @__PURE__ */ ((TokenType4) => {
|
|
145
|
+
TokenType4["Space"] = "SPACE";
|
|
146
|
+
TokenType4["Linebreak"] = "LINEBREAK";
|
|
147
|
+
TokenType4["Indent"] = "INDENT";
|
|
148
|
+
TokenType4["Pipe"] = "PIPE";
|
|
149
|
+
TokenType4["Dot"] = "DOT";
|
|
150
|
+
TokenType4["Colon"] = "COLON";
|
|
151
|
+
TokenType4["Comma"] = "COMMA";
|
|
152
|
+
TokenType4["Assignment"] = "ASSIGNMENT";
|
|
153
|
+
TokenType4["BraceOpen"] = "BRACE_OPEN";
|
|
154
|
+
TokenType4["BraceClose"] = "BRACE_CLOSE";
|
|
155
|
+
TokenType4["BracketOpen"] = "BRACKET_OPEN";
|
|
156
|
+
TokenType4["BracketClose"] = "BRACKET_CLOSE";
|
|
157
|
+
TokenType4["ParenthesisOpen"] = "PARENTHESIS_OPEN";
|
|
158
|
+
TokenType4["ParenthesisClose"] = "PARENTHESIS_CLOSE";
|
|
159
|
+
TokenType4["Quote"] = "QUOTE";
|
|
160
|
+
TokenType4["SingleQuote"] = "SINGLE_QUOTE";
|
|
161
|
+
TokenType4["Slash"] = "SLASH";
|
|
162
|
+
TokenType4["BooleanTrue"] = "BOOLEAN_TRUE";
|
|
163
|
+
TokenType4["BooleanFalse"] = "BOOLEAN_FALSE";
|
|
164
|
+
TokenType4["Null"] = "NULL";
|
|
165
|
+
TokenType4["CommandName"] = "COMMAND_NAME";
|
|
166
|
+
TokenType4["ParameterKey"] = "PARAMETER_KEY";
|
|
167
|
+
TokenType4["ParameterValueScope"] = "PARAMETER_VALUE_SCOPE";
|
|
168
|
+
TokenType4["FunctionName"] = "FUNCTION_NAME";
|
|
169
|
+
TokenType4["TimeseriesAggregation"] = "TIMESERIES_AGGREGATION";
|
|
170
|
+
TokenType4["Operator"] = "OPERATOR";
|
|
171
|
+
TokenType4["TraversalOperator"] = "TRAVERSAL_OPERATOR";
|
|
172
|
+
TokenType4["TraversalRelationName"] = "TRAVERSAL_RELATION_NAME";
|
|
173
|
+
TokenType4["TraversalHopCount"] = "TRAVERSAL_HOP_COUNT";
|
|
174
|
+
TokenType4["SimpleIdentifier"] = "SIMPLE_IDENTIFIER";
|
|
175
|
+
TokenType4["Number"] = "NUMBER";
|
|
176
|
+
TokenType4["String"] = "STRING";
|
|
177
|
+
TokenType4["TimeUnit"] = "TIME_UNIT";
|
|
178
|
+
TokenType4["TimestampValue"] = "TIMESTAMP_VALUE";
|
|
179
|
+
TokenType4["MetricKey"] = "METRIC_KEY";
|
|
180
|
+
TokenType4["Variable"] = "VARIABLE";
|
|
181
|
+
TokenType4["EndComment"] = "END_COMMENT";
|
|
182
|
+
return TokenType4;
|
|
183
|
+
})(TokenType || {});
|
|
184
|
+
var _TokenTypeTransformation;
|
|
185
|
+
((_TokenTypeTransformation2) => {
|
|
186
|
+
_TokenTypeTransformation2.toJson = (value) => value;
|
|
187
|
+
_TokenTypeTransformation2.fromJson = (value) => value;
|
|
188
|
+
})(_TokenTypeTransformation || (_TokenTypeTransformation = {}));
|
|
189
|
+
|
|
190
|
+
// packages/client/query/src/lib/models/autocomplete-suggestion-part.ts
|
|
191
|
+
var _AutocompleteSuggestionPartTransformation;
|
|
192
|
+
((_AutocompleteSuggestionPartTransformation2) => {
|
|
193
|
+
function fromJson(model) {
|
|
194
|
+
const { type, info, synopsis, suggestion } = model;
|
|
195
|
+
return {
|
|
196
|
+
type: _TokenTypeTransformation.fromJson(type),
|
|
197
|
+
info,
|
|
198
|
+
synopsis,
|
|
199
|
+
suggestion
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
_AutocompleteSuggestionPartTransformation2.fromJson = fromJson;
|
|
203
|
+
function toJson(model) {
|
|
204
|
+
const { type, info, synopsis, suggestion } = model;
|
|
205
|
+
return {
|
|
206
|
+
type: _TokenTypeTransformation.toJson(type),
|
|
207
|
+
info,
|
|
208
|
+
synopsis,
|
|
209
|
+
suggestion
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
_AutocompleteSuggestionPartTransformation2.toJson = toJson;
|
|
213
|
+
})(_AutocompleteSuggestionPartTransformation || (_AutocompleteSuggestionPartTransformation = {}));
|
|
214
|
+
|
|
215
|
+
// packages/client/query/src/lib/models/autocomplete-suggestion.ts
|
|
216
|
+
var _AutocompleteSuggestionTransformation;
|
|
217
|
+
((_AutocompleteSuggestionTransformation2) => {
|
|
218
|
+
function fromJson(model) {
|
|
219
|
+
const { parts, alreadyTypedCharacters, suggestion } = model;
|
|
220
|
+
return {
|
|
221
|
+
parts: parts?.map((innerValue) => _AutocompleteSuggestionPartTransformation.fromJson(innerValue)),
|
|
222
|
+
alreadyTypedCharacters,
|
|
223
|
+
suggestion
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
_AutocompleteSuggestionTransformation2.fromJson = fromJson;
|
|
227
|
+
function toJson(model) {
|
|
228
|
+
const { parts, alreadyTypedCharacters, suggestion } = model;
|
|
229
|
+
return {
|
|
230
|
+
parts: parts?.map((innerValue) => _AutocompleteSuggestionPartTransformation.toJson(innerValue)),
|
|
231
|
+
alreadyTypedCharacters,
|
|
232
|
+
suggestion
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
_AutocompleteSuggestionTransformation2.toJson = toJson;
|
|
236
|
+
})(_AutocompleteSuggestionTransformation || (_AutocompleteSuggestionTransformation = {}));
|
|
237
|
+
|
|
238
|
+
// packages/client/query/src/lib/models/autocomplete-response.ts
|
|
239
|
+
var _AutocompleteResponseTransformation;
|
|
240
|
+
((_AutocompleteResponseTransformation2) => {
|
|
241
|
+
function fromJson(model) {
|
|
242
|
+
const { optional, suggestions, suggestedTtlSeconds } = model;
|
|
243
|
+
return {
|
|
244
|
+
optional,
|
|
245
|
+
suggestions: suggestions?.map((innerValue) => _AutocompleteSuggestionTransformation.fromJson(innerValue)),
|
|
246
|
+
suggestedTtlSeconds
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
_AutocompleteResponseTransformation2.fromJson = fromJson;
|
|
250
|
+
function toJson(model) {
|
|
251
|
+
const { optional, suggestions, suggestedTtlSeconds } = model;
|
|
252
|
+
return {
|
|
253
|
+
optional,
|
|
254
|
+
suggestions: suggestions?.map((innerValue) => _AutocompleteSuggestionTransformation.toJson(innerValue)),
|
|
255
|
+
suggestedTtlSeconds
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
_AutocompleteResponseTransformation2.toJson = toJson;
|
|
259
|
+
})(_AutocompleteResponseTransformation || (_AutocompleteResponseTransformation = {}));
|
|
260
|
+
|
|
261
|
+
// packages/client/query/src/lib/models/dql-alternative-node.ts
|
|
262
|
+
var _DQLAlternativeNodeTransformation;
|
|
263
|
+
((_DQLAlternativeNodeTransformation2) => {
|
|
264
|
+
function fromJson(model) {
|
|
265
|
+
const { alternatives } = model;
|
|
266
|
+
return {
|
|
267
|
+
..._DQLNodeTransformation.fromJson(model, false),
|
|
268
|
+
alternatives
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
_DQLAlternativeNodeTransformation2.fromJson = fromJson;
|
|
272
|
+
function toJson(model) {
|
|
273
|
+
const { alternatives } = model;
|
|
274
|
+
return {
|
|
275
|
+
..._DQLNodeTransformation.toJson(model, false),
|
|
276
|
+
alternatives
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
_DQLAlternativeNodeTransformation2.toJson = toJson;
|
|
280
|
+
})(_DQLAlternativeNodeTransformation || (_DQLAlternativeNodeTransformation = {}));
|
|
281
|
+
|
|
282
|
+
// packages/client/query/src/lib/models/dql-container-node.ts
|
|
283
|
+
var _DQLContainerNodeTransformation;
|
|
284
|
+
((_DQLContainerNodeTransformation2) => {
|
|
285
|
+
function fromJson(model) {
|
|
286
|
+
const { type, children } = model;
|
|
287
|
+
return {
|
|
288
|
+
..._DQLNodeTransformation.fromJson(model, false),
|
|
289
|
+
type,
|
|
290
|
+
children: children !== void 0 && children !== null ? children?.map((innerValue) => _DQLNodeTransformation.fromJson(innerValue)) : void 0
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
_DQLContainerNodeTransformation2.fromJson = fromJson;
|
|
294
|
+
function toJson(model) {
|
|
295
|
+
const { type, children } = model;
|
|
296
|
+
return {
|
|
297
|
+
..._DQLNodeTransformation.toJson(model, false),
|
|
298
|
+
type,
|
|
299
|
+
children: children !== void 0 && children !== null ? children?.map((innerValue) => _DQLNodeTransformation.toJson(innerValue)) : void 0
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
_DQLContainerNodeTransformation2.toJson = toJson;
|
|
303
|
+
})(_DQLContainerNodeTransformation || (_DQLContainerNodeTransformation = {}));
|
|
304
|
+
|
|
305
|
+
// packages/client/query/src/lib/models/dql-node-node-type.ts
|
|
306
|
+
var DQLNodeNodeType = /* @__PURE__ */ ((DQLNodeNodeType3) => {
|
|
307
|
+
DQLNodeNodeType3["Terminal"] = "TERMINAL";
|
|
308
|
+
DQLNodeNodeType3["Container"] = "CONTAINER";
|
|
309
|
+
DQLNodeNodeType3["Alternative"] = "ALTERNATIVE";
|
|
310
|
+
return DQLNodeNodeType3;
|
|
311
|
+
})(DQLNodeNodeType || {});
|
|
312
|
+
var _DQLNodeNodeTypeTransformation;
|
|
313
|
+
((_DQLNodeNodeTypeTransformation2) => {
|
|
314
|
+
_DQLNodeNodeTypeTransformation2.toJson = (value) => value;
|
|
315
|
+
_DQLNodeNodeTypeTransformation2.fromJson = (value) => value;
|
|
316
|
+
})(_DQLNodeNodeTypeTransformation || (_DQLNodeNodeTypeTransformation = {}));
|
|
317
|
+
|
|
318
|
+
// packages/client/query/src/lib/models/dql-terminal-node.ts
|
|
319
|
+
var _DQLTerminalNodeTransformation;
|
|
320
|
+
((_DQLTerminalNodeTransformation2) => {
|
|
321
|
+
function fromJson(model) {
|
|
322
|
+
const { type, isMandatoryOnUserOrder, canonicalString } = model;
|
|
323
|
+
return {
|
|
324
|
+
..._DQLNodeTransformation.fromJson(model, false),
|
|
325
|
+
type: type !== void 0 && type !== null ? _TokenTypeTransformation.fromJson(type) : void 0,
|
|
326
|
+
isMandatoryOnUserOrder,
|
|
327
|
+
canonicalString
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
_DQLTerminalNodeTransformation2.fromJson = fromJson;
|
|
331
|
+
function toJson(model) {
|
|
332
|
+
const { type, isMandatoryOnUserOrder, canonicalString } = model;
|
|
333
|
+
return {
|
|
334
|
+
..._DQLNodeTransformation.toJson(model, false),
|
|
335
|
+
type: type !== void 0 && type !== null ? _TokenTypeTransformation.toJson(type) : void 0,
|
|
336
|
+
isMandatoryOnUserOrder,
|
|
337
|
+
canonicalString
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
_DQLTerminalNodeTransformation2.toJson = toJson;
|
|
341
|
+
})(_DQLTerminalNodeTransformation || (_DQLTerminalNodeTransformation = {}));
|
|
342
|
+
|
|
343
|
+
// packages/client/query/src/lib/models/position-info.ts
|
|
344
|
+
var _PositionInfoTransformation;
|
|
345
|
+
((_PositionInfoTransformation2) => {
|
|
346
|
+
function fromJson(model) {
|
|
347
|
+
const { column, index, line } = model;
|
|
348
|
+
return {
|
|
349
|
+
column,
|
|
350
|
+
index,
|
|
351
|
+
line
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
_PositionInfoTransformation2.fromJson = fromJson;
|
|
355
|
+
function toJson(model) {
|
|
356
|
+
const { column, index, line } = model;
|
|
357
|
+
return {
|
|
358
|
+
column,
|
|
359
|
+
index,
|
|
360
|
+
line
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
_PositionInfoTransformation2.toJson = toJson;
|
|
364
|
+
})(_PositionInfoTransformation || (_PositionInfoTransformation = {}));
|
|
365
|
+
|
|
366
|
+
// packages/client/query/src/lib/models/token-position.ts
|
|
367
|
+
var _TokenPositionTransformation;
|
|
368
|
+
((_TokenPositionTransformation2) => {
|
|
369
|
+
function fromJson(model) {
|
|
370
|
+
const { start, end } = model;
|
|
371
|
+
return {
|
|
372
|
+
start: _PositionInfoTransformation.fromJson(start),
|
|
373
|
+
end: _PositionInfoTransformation.fromJson(end)
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
_TokenPositionTransformation2.fromJson = fromJson;
|
|
377
|
+
function toJson(model) {
|
|
378
|
+
const { start, end } = model;
|
|
379
|
+
return {
|
|
380
|
+
start: _PositionInfoTransformation.toJson(start),
|
|
381
|
+
end: _PositionInfoTransformation.toJson(end)
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
_TokenPositionTransformation2.toJson = toJson;
|
|
385
|
+
function fromFormData(formData) {
|
|
386
|
+
const formDataEntries = Object.fromEntries(formData.map((data) => [data.name, data.value]));
|
|
387
|
+
return {
|
|
388
|
+
start: _PositionInfoTransformation.fromJson(JSON.parse(formDataEntries["start"])),
|
|
389
|
+
end: _PositionInfoTransformation.fromJson(JSON.parse(formDataEntries["end"]))
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
_TokenPositionTransformation2.fromFormData = fromFormData;
|
|
393
|
+
function toFormData(model) {
|
|
394
|
+
const json = toJson(model);
|
|
395
|
+
const body = [
|
|
396
|
+
{ name: "start", type: "json", value: json["start"] },
|
|
397
|
+
{ name: "end", type: "json", value: json["end"] }
|
|
398
|
+
];
|
|
399
|
+
return body;
|
|
400
|
+
}
|
|
401
|
+
_TokenPositionTransformation2.toFormData = toFormData;
|
|
402
|
+
})(_TokenPositionTransformation || (_TokenPositionTransformation = {}));
|
|
403
|
+
|
|
404
|
+
// packages/client/query/src/lib/models/dql-node.ts
|
|
405
|
+
var _DQLNodeTransformation;
|
|
406
|
+
((_DQLNodeTransformation2) => {
|
|
407
|
+
function isDqlTerminalNode(model) {
|
|
408
|
+
return model["nodeType"] === "TERMINAL";
|
|
409
|
+
}
|
|
410
|
+
_DQLNodeTransformation2.isDqlTerminalNode = isDqlTerminalNode;
|
|
411
|
+
function isDqlContainerNode(model) {
|
|
412
|
+
return model["nodeType"] === "CONTAINER";
|
|
413
|
+
}
|
|
414
|
+
_DQLNodeTransformation2.isDqlContainerNode = isDqlContainerNode;
|
|
415
|
+
function isDqlAlternativeNode(model) {
|
|
416
|
+
return model["nodeType"] === "ALTERNATIVE";
|
|
417
|
+
}
|
|
418
|
+
_DQLNodeTransformation2.isDqlAlternativeNode = isDqlAlternativeNode;
|
|
419
|
+
function fromJson(model, includeChildProps = true) {
|
|
420
|
+
if (includeChildProps) {
|
|
421
|
+
switch (model.nodeType) {
|
|
422
|
+
case "TERMINAL":
|
|
423
|
+
return _DQLTerminalNodeTransformation.fromJson(model);
|
|
424
|
+
case "CONTAINER":
|
|
425
|
+
return _DQLContainerNodeTransformation.fromJson(model);
|
|
426
|
+
case "ALTERNATIVE":
|
|
427
|
+
return _DQLAlternativeNodeTransformation.fromJson(model);
|
|
428
|
+
default:
|
|
429
|
+
return fromJson(model, false);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
const { nodeType, tokenPosition, isOptional } = model;
|
|
433
|
+
return {
|
|
434
|
+
nodeType: _DQLNodeNodeTypeTransformation.fromJson(nodeType),
|
|
435
|
+
tokenPosition: tokenPosition !== void 0 && tokenPosition !== null ? _TokenPositionTransformation.fromJson(tokenPosition) : void 0,
|
|
436
|
+
isOptional
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
_DQLNodeTransformation2.fromJson = fromJson;
|
|
440
|
+
function toJson(model, includeChildProps = true) {
|
|
441
|
+
if (includeChildProps) {
|
|
442
|
+
switch (model.nodeType) {
|
|
443
|
+
case "TERMINAL":
|
|
444
|
+
return _DQLTerminalNodeTransformation.toJson(model);
|
|
445
|
+
case "CONTAINER":
|
|
446
|
+
return _DQLContainerNodeTransformation.toJson(model);
|
|
447
|
+
case "ALTERNATIVE":
|
|
448
|
+
return _DQLAlternativeNodeTransformation.toJson(model);
|
|
449
|
+
default:
|
|
450
|
+
return toJson(model, false);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const { nodeType, tokenPosition, isOptional } = model;
|
|
454
|
+
return {
|
|
455
|
+
nodeType: _DQLNodeNodeTypeTransformation.toJson(nodeType),
|
|
456
|
+
tokenPosition: tokenPosition !== void 0 && tokenPosition !== null ? _TokenPositionTransformation.toJson(tokenPosition) : void 0,
|
|
457
|
+
isOptional
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
_DQLNodeTransformation2.toJson = toJson;
|
|
461
|
+
})(_DQLNodeTransformation || (_DQLNodeTransformation = {}));
|
|
462
|
+
|
|
463
|
+
// packages/client/query/src/lib/models/error-response-details.ts
|
|
464
|
+
var _ErrorResponseDetailsTransformation;
|
|
465
|
+
((_ErrorResponseDetailsTransformation2) => {
|
|
466
|
+
function fromJson(model) {
|
|
467
|
+
const {
|
|
468
|
+
exceptionType,
|
|
469
|
+
syntaxErrorPosition,
|
|
470
|
+
errorType,
|
|
471
|
+
errorMessage,
|
|
472
|
+
arguments: _arguments,
|
|
473
|
+
queryString,
|
|
474
|
+
errorMessageFormatSpecifierTypes,
|
|
475
|
+
errorMessageFormat
|
|
476
|
+
} = model;
|
|
477
|
+
return {
|
|
478
|
+
exceptionType,
|
|
479
|
+
syntaxErrorPosition: syntaxErrorPosition !== void 0 && syntaxErrorPosition !== null ? _TokenPositionTransformation.fromJson(syntaxErrorPosition) : void 0,
|
|
480
|
+
errorType,
|
|
481
|
+
errorMessage,
|
|
482
|
+
arguments: _arguments?.slice(0),
|
|
483
|
+
queryString,
|
|
484
|
+
errorMessageFormatSpecifierTypes: errorMessageFormatSpecifierTypes?.slice(0),
|
|
485
|
+
errorMessageFormat
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
_ErrorResponseDetailsTransformation2.fromJson = fromJson;
|
|
489
|
+
function toJson(model) {
|
|
490
|
+
const {
|
|
491
|
+
exceptionType,
|
|
492
|
+
syntaxErrorPosition,
|
|
493
|
+
errorType,
|
|
494
|
+
errorMessage,
|
|
495
|
+
arguments: _arguments,
|
|
496
|
+
queryString,
|
|
497
|
+
errorMessageFormatSpecifierTypes,
|
|
498
|
+
errorMessageFormat
|
|
499
|
+
} = model;
|
|
500
|
+
return {
|
|
501
|
+
exceptionType,
|
|
502
|
+
syntaxErrorPosition: syntaxErrorPosition !== void 0 && syntaxErrorPosition !== null ? _TokenPositionTransformation.toJson(syntaxErrorPosition) : void 0,
|
|
503
|
+
errorType,
|
|
504
|
+
errorMessage,
|
|
505
|
+
arguments: _arguments?.slice(0),
|
|
506
|
+
queryString,
|
|
507
|
+
errorMessageFormatSpecifierTypes: errorMessageFormatSpecifierTypes?.slice(0),
|
|
508
|
+
errorMessageFormat
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
_ErrorResponseDetailsTransformation2.toJson = toJson;
|
|
512
|
+
})(_ErrorResponseDetailsTransformation || (_ErrorResponseDetailsTransformation = {}));
|
|
513
|
+
|
|
514
|
+
// packages/client/query/src/lib/models/error-response.ts
|
|
515
|
+
var _ErrorResponseTransformation;
|
|
516
|
+
((_ErrorResponseTransformation2) => {
|
|
517
|
+
function fromJson(model) {
|
|
518
|
+
const { message, details, code } = model;
|
|
519
|
+
return {
|
|
520
|
+
message,
|
|
521
|
+
details: _ErrorResponseDetailsTransformation.fromJson(details),
|
|
522
|
+
code
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
_ErrorResponseTransformation2.fromJson = fromJson;
|
|
526
|
+
function toJson(model) {
|
|
527
|
+
const { message, details, code } = model;
|
|
528
|
+
return {
|
|
529
|
+
message,
|
|
530
|
+
details: _ErrorResponseDetailsTransformation.toJson(details),
|
|
531
|
+
code
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
_ErrorResponseTransformation2.toJson = toJson;
|
|
535
|
+
})(_ErrorResponseTransformation || (_ErrorResponseTransformation = {}));
|
|
536
|
+
|
|
537
|
+
// packages/client/query/src/lib/models/error-envelope.ts
|
|
538
|
+
var _ErrorEnvelopeTransformation;
|
|
539
|
+
((_ErrorEnvelopeTransformation2) => {
|
|
540
|
+
function fromJson(model) {
|
|
541
|
+
const { error } = model;
|
|
542
|
+
return {
|
|
543
|
+
error: _ErrorResponseTransformation.fromJson(error)
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
_ErrorEnvelopeTransformation2.fromJson = fromJson;
|
|
547
|
+
function toJson(model) {
|
|
548
|
+
const { error } = model;
|
|
549
|
+
return {
|
|
550
|
+
error: _ErrorResponseTransformation.toJson(error)
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
_ErrorEnvelopeTransformation2.toJson = toJson;
|
|
554
|
+
function fromFormData(formData) {
|
|
555
|
+
const formDataEntries = Object.fromEntries(formData.map((data) => [data.name, data.value]));
|
|
556
|
+
return {
|
|
557
|
+
error: _ErrorResponseTransformation.fromJson(JSON.parse(formDataEntries["error"]))
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
_ErrorEnvelopeTransformation2.fromFormData = fromFormData;
|
|
561
|
+
function toFormData(model) {
|
|
562
|
+
const json = toJson(model);
|
|
563
|
+
const body = [{ name: "error", type: "json", value: json["error"] }];
|
|
564
|
+
return body;
|
|
565
|
+
}
|
|
566
|
+
_ErrorEnvelopeTransformation2.toFormData = toFormData;
|
|
567
|
+
})(_ErrorEnvelopeTransformation || (_ErrorEnvelopeTransformation = {}));
|
|
568
|
+
|
|
569
|
+
// packages/client/query/src/lib/models/parse-request.ts
|
|
570
|
+
var _ParseRequestTransformation;
|
|
571
|
+
((_ParseRequestTransformation2) => {
|
|
572
|
+
function fromJson(model) {
|
|
573
|
+
const { query, timezone, locale } = model;
|
|
574
|
+
return {
|
|
575
|
+
query,
|
|
576
|
+
timezone,
|
|
577
|
+
locale
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
_ParseRequestTransformation2.fromJson = fromJson;
|
|
581
|
+
function toJson(model) {
|
|
582
|
+
const { query, timezone, locale } = model;
|
|
583
|
+
return {
|
|
584
|
+
query,
|
|
585
|
+
timezone,
|
|
586
|
+
locale
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
_ParseRequestTransformation2.toJson = toJson;
|
|
590
|
+
})(_ParseRequestTransformation || (_ParseRequestTransformation = {}));
|
|
591
|
+
|
|
592
|
+
// packages/client/query/src/lib/models/verify-request.ts
|
|
593
|
+
var _VerifyRequestTransformation;
|
|
594
|
+
((_VerifyRequestTransformation2) => {
|
|
595
|
+
function fromJson(model) {
|
|
596
|
+
const { query, timezone, locale } = model;
|
|
597
|
+
return {
|
|
598
|
+
query,
|
|
599
|
+
timezone,
|
|
600
|
+
locale
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
_VerifyRequestTransformation2.fromJson = fromJson;
|
|
604
|
+
function toJson(model) {
|
|
605
|
+
const { query, timezone, locale } = model;
|
|
606
|
+
return {
|
|
607
|
+
query,
|
|
608
|
+
timezone,
|
|
609
|
+
locale
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
_VerifyRequestTransformation2.toJson = toJson;
|
|
613
|
+
})(_VerifyRequestTransformation || (_VerifyRequestTransformation = {}));
|
|
614
|
+
|
|
615
|
+
// packages/client/query/src/lib/models/metadata-notification.ts
|
|
616
|
+
var _MetadataNotificationTransformation;
|
|
617
|
+
((_MetadataNotificationTransformation2) => {
|
|
618
|
+
function fromJson(model) {
|
|
619
|
+
const {
|
|
620
|
+
severity,
|
|
621
|
+
messageFormat,
|
|
622
|
+
syntaxPosition,
|
|
623
|
+
messageFormatSpecifierTypes,
|
|
624
|
+
arguments: _arguments,
|
|
625
|
+
notificationType,
|
|
626
|
+
message
|
|
627
|
+
} = model;
|
|
628
|
+
return {
|
|
629
|
+
severity,
|
|
630
|
+
messageFormat,
|
|
631
|
+
syntaxPosition: syntaxPosition !== void 0 && syntaxPosition !== null ? _TokenPositionTransformation.fromJson(syntaxPosition) : void 0,
|
|
632
|
+
messageFormatSpecifierTypes: messageFormatSpecifierTypes !== void 0 && messageFormatSpecifierTypes !== null ? messageFormatSpecifierTypes?.slice(0) : void 0,
|
|
633
|
+
arguments: _arguments !== void 0 && _arguments !== null ? _arguments?.slice(0) : void 0,
|
|
634
|
+
notificationType,
|
|
635
|
+
message
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
_MetadataNotificationTransformation2.fromJson = fromJson;
|
|
639
|
+
function toJson(model) {
|
|
640
|
+
const {
|
|
641
|
+
severity,
|
|
642
|
+
messageFormat,
|
|
643
|
+
syntaxPosition,
|
|
644
|
+
messageFormatSpecifierTypes,
|
|
645
|
+
arguments: _arguments,
|
|
646
|
+
notificationType,
|
|
647
|
+
message
|
|
648
|
+
} = model;
|
|
649
|
+
return {
|
|
650
|
+
severity,
|
|
651
|
+
messageFormat,
|
|
652
|
+
syntaxPosition: syntaxPosition !== void 0 && syntaxPosition !== null ? _TokenPositionTransformation.toJson(syntaxPosition) : void 0,
|
|
653
|
+
messageFormatSpecifierTypes: messageFormatSpecifierTypes !== void 0 && messageFormatSpecifierTypes !== null ? messageFormatSpecifierTypes?.slice(0) : void 0,
|
|
654
|
+
arguments: _arguments !== void 0 && _arguments !== null ? _arguments?.slice(0) : void 0,
|
|
655
|
+
notificationType,
|
|
656
|
+
message
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
_MetadataNotificationTransformation2.toJson = toJson;
|
|
660
|
+
})(_MetadataNotificationTransformation || (_MetadataNotificationTransformation = {}));
|
|
661
|
+
|
|
662
|
+
// packages/client/query/src/lib/models/verify-response.ts
|
|
663
|
+
var _VerifyResponseTransformation;
|
|
664
|
+
((_VerifyResponseTransformation2) => {
|
|
665
|
+
function fromJson(model) {
|
|
666
|
+
const { valid, notifications } = model;
|
|
667
|
+
return {
|
|
668
|
+
valid,
|
|
669
|
+
notifications: notifications !== void 0 && notifications !== null ? notifications?.map((innerValue) => _MetadataNotificationTransformation.fromJson(innerValue)) : void 0
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
_VerifyResponseTransformation2.fromJson = fromJson;
|
|
673
|
+
function toJson(model) {
|
|
674
|
+
const { valid, notifications } = model;
|
|
675
|
+
return {
|
|
676
|
+
valid,
|
|
677
|
+
notifications: notifications !== void 0 && notifications !== null ? notifications?.map((innerValue) => _MetadataNotificationTransformation.toJson(innerValue)) : void 0
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
_VerifyResponseTransformation2.toJson = toJson;
|
|
681
|
+
})(_VerifyResponseTransformation || (_VerifyResponseTransformation = {}));
|
|
682
|
+
|
|
683
|
+
// packages/client/query/src/lib/apis/query-assistance-api.ts
|
|
684
|
+
var QueryAssistanceClient = class {
|
|
685
|
+
httpClient;
|
|
686
|
+
constructor(httpClientImplementation) {
|
|
687
|
+
this.httpClient = httpClientImplementation;
|
|
688
|
+
registerGlobalErrorSerializer(apiClientErrorSerializer);
|
|
689
|
+
}
|
|
690
|
+
async queryVerify(config) {
|
|
691
|
+
if (!config) {
|
|
692
|
+
throw new ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
693
|
+
}
|
|
694
|
+
const encodedBody = _VerifyRequestTransformation.toJson(config.body);
|
|
695
|
+
const headerParameters = {
|
|
696
|
+
...config.authorization !== void 0 && { Authorization: String(config.authorization) }
|
|
697
|
+
};
|
|
698
|
+
const response = await this.httpClient.send({
|
|
699
|
+
url: `/platform/storage/query/v1/query:verify`,
|
|
700
|
+
method: "POST",
|
|
701
|
+
requestBodyType: "json",
|
|
702
|
+
body: encodedBody,
|
|
703
|
+
headers: {
|
|
704
|
+
"Content-Type": "application/json",
|
|
705
|
+
Accept: "application/json",
|
|
706
|
+
...headerParameters
|
|
707
|
+
},
|
|
708
|
+
abortSignal: config.abortSignal,
|
|
709
|
+
statusValidator: (status) => {
|
|
710
|
+
if (200 <= status && status < 300) {
|
|
711
|
+
return true;
|
|
712
|
+
}
|
|
713
|
+
return [400, 500].includes(status);
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
switch (response.status) {
|
|
717
|
+
case 400: {
|
|
718
|
+
const responseValue = await response.body("json");
|
|
719
|
+
try {
|
|
720
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
721
|
+
throw new ErrorEnvelopeError("400", response, errorBody, "The supplied request is wrong.");
|
|
722
|
+
} catch (err) {
|
|
723
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
724
|
+
throw err;
|
|
725
|
+
}
|
|
726
|
+
throw new InvalidResponseError(
|
|
727
|
+
`QueryAssistanceClient.query:verify:400`,
|
|
728
|
+
err,
|
|
729
|
+
responseValue,
|
|
730
|
+
"ErrorEnvelope",
|
|
731
|
+
void 0
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
case 500: {
|
|
736
|
+
const responseValue = await response.body("json");
|
|
737
|
+
try {
|
|
738
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
739
|
+
throw new ErrorEnvelopeError("500", response, errorBody, "An internal server error has occurred.");
|
|
740
|
+
} catch (err) {
|
|
741
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
742
|
+
throw err;
|
|
743
|
+
}
|
|
744
|
+
throw new InvalidResponseError(
|
|
745
|
+
`QueryAssistanceClient.query:verify:500`,
|
|
746
|
+
err,
|
|
747
|
+
responseValue,
|
|
748
|
+
"ErrorEnvelope",
|
|
749
|
+
void 0
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
case 200: {
|
|
754
|
+
const responseValue = await response.body("json");
|
|
755
|
+
try {
|
|
756
|
+
return _VerifyResponseTransformation.fromJson(responseValue);
|
|
757
|
+
} catch (err) {
|
|
758
|
+
throw new InvalidResponseError(
|
|
759
|
+
`QueryAssistanceClient.query:verify:${response.status}`,
|
|
760
|
+
err,
|
|
761
|
+
responseValue,
|
|
762
|
+
void 0,
|
|
763
|
+
void 0
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
default: {
|
|
768
|
+
const responseValue = await response.body("text").catch();
|
|
769
|
+
throw new ClientRequestError(
|
|
770
|
+
`${response.status}`,
|
|
771
|
+
response,
|
|
772
|
+
responseValue,
|
|
773
|
+
`Unexpected api response: code=${response.status} body="${responseValue}"`
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
async queryParse(config) {
|
|
779
|
+
if (!config) {
|
|
780
|
+
throw new ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
781
|
+
}
|
|
782
|
+
const encodedBody = _ParseRequestTransformation.toJson(config.body);
|
|
783
|
+
const headerParameters = {
|
|
784
|
+
...config.authorization !== void 0 && { Authorization: String(config.authorization) }
|
|
785
|
+
};
|
|
786
|
+
const response = await this.httpClient.send({
|
|
787
|
+
url: `/platform/storage/query/v1/query:parse`,
|
|
788
|
+
method: "POST",
|
|
789
|
+
requestBodyType: "json",
|
|
790
|
+
body: encodedBody,
|
|
791
|
+
headers: {
|
|
792
|
+
"Content-Type": "application/json",
|
|
793
|
+
Accept: "application/json",
|
|
794
|
+
...headerParameters
|
|
795
|
+
},
|
|
796
|
+
abortSignal: config.abortSignal,
|
|
797
|
+
statusValidator: (status) => {
|
|
798
|
+
if (200 <= status && status < 300) {
|
|
799
|
+
return true;
|
|
800
|
+
}
|
|
801
|
+
return [400, 500].includes(status);
|
|
802
|
+
}
|
|
803
|
+
});
|
|
804
|
+
switch (response.status) {
|
|
805
|
+
case 400: {
|
|
806
|
+
const responseValue = await response.body("json");
|
|
807
|
+
try {
|
|
808
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
809
|
+
throw new ErrorEnvelopeError(
|
|
810
|
+
"400",
|
|
811
|
+
response,
|
|
812
|
+
errorBody,
|
|
813
|
+
"The supplied request is wrong. Either the query itself or other parameters are wrong."
|
|
814
|
+
);
|
|
815
|
+
} catch (err) {
|
|
816
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
817
|
+
throw err;
|
|
818
|
+
}
|
|
819
|
+
throw new InvalidResponseError(
|
|
820
|
+
`QueryAssistanceClient.query:parse:400`,
|
|
821
|
+
err,
|
|
822
|
+
responseValue,
|
|
823
|
+
"ErrorEnvelope",
|
|
824
|
+
void 0
|
|
825
|
+
);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
case 500: {
|
|
829
|
+
const responseValue = await response.body("json");
|
|
830
|
+
try {
|
|
831
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
832
|
+
throw new ErrorEnvelopeError("500", response, errorBody, "An internal server error has occurred.");
|
|
833
|
+
} catch (err) {
|
|
834
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
835
|
+
throw err;
|
|
836
|
+
}
|
|
837
|
+
throw new InvalidResponseError(
|
|
838
|
+
`QueryAssistanceClient.query:parse:500`,
|
|
839
|
+
err,
|
|
840
|
+
responseValue,
|
|
841
|
+
"ErrorEnvelope",
|
|
842
|
+
void 0
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
case 200: {
|
|
847
|
+
const responseValue = await response.body("json");
|
|
848
|
+
try {
|
|
849
|
+
return _DQLNodeTransformation.fromJson(responseValue);
|
|
850
|
+
} catch (err) {
|
|
851
|
+
throw new InvalidResponseError(
|
|
852
|
+
`QueryAssistanceClient.query:parse:${response.status}`,
|
|
853
|
+
err,
|
|
854
|
+
responseValue,
|
|
855
|
+
void 0,
|
|
856
|
+
void 0
|
|
857
|
+
);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
default: {
|
|
861
|
+
const responseValue = await response.body("text").catch();
|
|
862
|
+
throw new ClientRequestError(
|
|
863
|
+
`${response.status}`,
|
|
864
|
+
response,
|
|
865
|
+
responseValue,
|
|
866
|
+
`Unexpected api response: code=${response.status} body="${responseValue}"`
|
|
867
|
+
);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
async queryAutocomplete(config) {
|
|
872
|
+
if (!config) {
|
|
873
|
+
throw new ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
874
|
+
}
|
|
875
|
+
const encodedBody = _AutocompleteRequestTransformation.toJson(config.body);
|
|
876
|
+
const headerParameters = {
|
|
877
|
+
...config.authorization !== void 0 && { Authorization: String(config.authorization) }
|
|
878
|
+
};
|
|
879
|
+
const response = await this.httpClient.send({
|
|
880
|
+
url: `/platform/storage/query/v1/query:autocomplete`,
|
|
881
|
+
method: "POST",
|
|
882
|
+
requestBodyType: "json",
|
|
883
|
+
body: encodedBody,
|
|
884
|
+
headers: {
|
|
885
|
+
"Content-Type": "application/json",
|
|
886
|
+
Accept: "application/json",
|
|
887
|
+
...headerParameters
|
|
888
|
+
},
|
|
889
|
+
abortSignal: config.abortSignal,
|
|
890
|
+
statusValidator: (status) => {
|
|
891
|
+
if (200 <= status && status < 300) {
|
|
892
|
+
return true;
|
|
893
|
+
}
|
|
894
|
+
return [400, 500].includes(status);
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
switch (response.status) {
|
|
898
|
+
case 400: {
|
|
899
|
+
const responseValue = await response.body("json");
|
|
900
|
+
try {
|
|
901
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
902
|
+
throw new ErrorEnvelopeError(
|
|
903
|
+
"400",
|
|
904
|
+
response,
|
|
905
|
+
errorBody,
|
|
906
|
+
"The supplied request is wrong. Either the query itself or other parameters are wrong."
|
|
907
|
+
);
|
|
908
|
+
} catch (err) {
|
|
909
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
910
|
+
throw err;
|
|
911
|
+
}
|
|
912
|
+
throw new InvalidResponseError(
|
|
913
|
+
`QueryAssistanceClient.query:autocomplete:400`,
|
|
914
|
+
err,
|
|
915
|
+
responseValue,
|
|
916
|
+
"ErrorEnvelope",
|
|
917
|
+
void 0
|
|
918
|
+
);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
case 500: {
|
|
922
|
+
const responseValue = await response.body("json");
|
|
923
|
+
try {
|
|
924
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
925
|
+
throw new ErrorEnvelopeError("500", response, errorBody, "An internal server error has occurred.");
|
|
926
|
+
} catch (err) {
|
|
927
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
928
|
+
throw err;
|
|
929
|
+
}
|
|
930
|
+
throw new InvalidResponseError(
|
|
931
|
+
`QueryAssistanceClient.query:autocomplete:500`,
|
|
932
|
+
err,
|
|
933
|
+
responseValue,
|
|
934
|
+
"ErrorEnvelope",
|
|
935
|
+
void 0
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
case 200: {
|
|
940
|
+
const responseValue = await response.body("json");
|
|
941
|
+
try {
|
|
942
|
+
return _AutocompleteResponseTransformation.fromJson(responseValue);
|
|
943
|
+
} catch (err) {
|
|
944
|
+
throw new InvalidResponseError(
|
|
945
|
+
`QueryAssistanceClient.query:autocomplete:${response.status}`,
|
|
946
|
+
err,
|
|
947
|
+
responseValue,
|
|
948
|
+
void 0,
|
|
949
|
+
void 0
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
default: {
|
|
954
|
+
const responseValue = await response.body("text").catch();
|
|
955
|
+
throw new ClientRequestError(
|
|
956
|
+
`${response.status}`,
|
|
957
|
+
response,
|
|
958
|
+
responseValue,
|
|
959
|
+
`Unexpected api response: code=${response.status} body="${responseValue}"`
|
|
960
|
+
);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
};
|
|
965
|
+
var queryAssistanceClient = /* @__PURE__ */ new QueryAssistanceClient(defaultHttpClient);
|
|
966
|
+
|
|
967
|
+
// packages/client/query/src/lib/apis/query-execution-api.ts
|
|
968
|
+
import { httpClient as defaultHttpClient2 } from "@dynatrace-sdk/http-client";
|
|
969
|
+
|
|
970
|
+
// packages/client/query/src/lib/models/execute-request.ts
|
|
971
|
+
var _ExecuteRequestTransformation;
|
|
972
|
+
((_ExecuteRequestTransformation2) => {
|
|
973
|
+
function fromJson(model) {
|
|
974
|
+
const {
|
|
975
|
+
query,
|
|
976
|
+
defaultTimeframeStart,
|
|
977
|
+
defaultTimeframeEnd,
|
|
978
|
+
timezone,
|
|
979
|
+
locale,
|
|
980
|
+
maxResultRecords,
|
|
981
|
+
fetchTimeoutSeconds,
|
|
982
|
+
requestTimeoutMilliseconds,
|
|
983
|
+
enablePreview,
|
|
984
|
+
defaultSamplingRatio,
|
|
985
|
+
defaultScanLimitGbytes
|
|
986
|
+
} = model;
|
|
987
|
+
return {
|
|
988
|
+
query,
|
|
989
|
+
defaultTimeframeStart,
|
|
990
|
+
defaultTimeframeEnd,
|
|
991
|
+
timezone,
|
|
992
|
+
locale,
|
|
993
|
+
maxResultRecords,
|
|
994
|
+
fetchTimeoutSeconds,
|
|
995
|
+
requestTimeoutMilliseconds,
|
|
996
|
+
enablePreview,
|
|
997
|
+
defaultSamplingRatio,
|
|
998
|
+
defaultScanLimitGbytes
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
_ExecuteRequestTransformation2.fromJson = fromJson;
|
|
1002
|
+
function toJson(model) {
|
|
1003
|
+
const {
|
|
1004
|
+
query,
|
|
1005
|
+
defaultTimeframeStart,
|
|
1006
|
+
defaultTimeframeEnd,
|
|
1007
|
+
timezone,
|
|
1008
|
+
locale,
|
|
1009
|
+
maxResultRecords,
|
|
1010
|
+
fetchTimeoutSeconds,
|
|
1011
|
+
requestTimeoutMilliseconds,
|
|
1012
|
+
enablePreview,
|
|
1013
|
+
defaultSamplingRatio,
|
|
1014
|
+
defaultScanLimitGbytes
|
|
1015
|
+
} = model;
|
|
1016
|
+
return {
|
|
1017
|
+
query,
|
|
1018
|
+
defaultTimeframeStart,
|
|
1019
|
+
defaultTimeframeEnd,
|
|
1020
|
+
timezone,
|
|
1021
|
+
locale,
|
|
1022
|
+
maxResultRecords,
|
|
1023
|
+
fetchTimeoutSeconds,
|
|
1024
|
+
requestTimeoutMilliseconds,
|
|
1025
|
+
enablePreview,
|
|
1026
|
+
defaultSamplingRatio,
|
|
1027
|
+
defaultScanLimitGbytes
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
_ExecuteRequestTransformation2.toJson = toJson;
|
|
1031
|
+
})(_ExecuteRequestTransformation || (_ExecuteRequestTransformation = {}));
|
|
1032
|
+
|
|
1033
|
+
// packages/client/query/src/lib/models/timeframe.ts
|
|
1034
|
+
var _TimeframeTransformation;
|
|
1035
|
+
((_TimeframeTransformation2) => {
|
|
1036
|
+
function fromJson(model) {
|
|
1037
|
+
const { start, end } = model;
|
|
1038
|
+
return {
|
|
1039
|
+
start: start !== void 0 && start !== null ? new Date(start) : void 0,
|
|
1040
|
+
end: end !== void 0 && end !== null ? new Date(end) : void 0
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
_TimeframeTransformation2.fromJson = fromJson;
|
|
1044
|
+
function toJson(model) {
|
|
1045
|
+
const { start, end } = model;
|
|
1046
|
+
return {
|
|
1047
|
+
start: start !== void 0 && start !== null ? start.toISOString() : void 0,
|
|
1048
|
+
end: end !== void 0 && end !== null ? end.toISOString() : void 0
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
_TimeframeTransformation2.toJson = toJson;
|
|
1052
|
+
})(_TimeframeTransformation || (_TimeframeTransformation = {}));
|
|
1053
|
+
|
|
1054
|
+
// packages/client/query/src/lib/models/grail-metadata.ts
|
|
1055
|
+
var _GrailMetadataTransformation;
|
|
1056
|
+
((_GrailMetadataTransformation2) => {
|
|
1057
|
+
function fromJson(model) {
|
|
1058
|
+
const {
|
|
1059
|
+
canonicalQuery,
|
|
1060
|
+
timezone,
|
|
1061
|
+
query,
|
|
1062
|
+
scannedRecords,
|
|
1063
|
+
dqlVersion,
|
|
1064
|
+
scannedBytes,
|
|
1065
|
+
analysisTimeframe,
|
|
1066
|
+
locale,
|
|
1067
|
+
executionTimeMilliseconds,
|
|
1068
|
+
notifications,
|
|
1069
|
+
queryId
|
|
1070
|
+
} = model;
|
|
1071
|
+
return {
|
|
1072
|
+
canonicalQuery,
|
|
1073
|
+
timezone,
|
|
1074
|
+
query,
|
|
1075
|
+
scannedRecords,
|
|
1076
|
+
dqlVersion,
|
|
1077
|
+
scannedBytes,
|
|
1078
|
+
analysisTimeframe: analysisTimeframe !== void 0 && analysisTimeframe !== null ? _TimeframeTransformation.fromJson(analysisTimeframe) : void 0,
|
|
1079
|
+
locale,
|
|
1080
|
+
executionTimeMilliseconds,
|
|
1081
|
+
notifications: notifications !== void 0 && notifications !== null ? notifications?.map((innerValue) => _MetadataNotificationTransformation.fromJson(innerValue)) : void 0,
|
|
1082
|
+
queryId
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
_GrailMetadataTransformation2.fromJson = fromJson;
|
|
1086
|
+
function toJson(model) {
|
|
1087
|
+
const {
|
|
1088
|
+
canonicalQuery,
|
|
1089
|
+
timezone,
|
|
1090
|
+
query,
|
|
1091
|
+
scannedRecords,
|
|
1092
|
+
dqlVersion,
|
|
1093
|
+
scannedBytes,
|
|
1094
|
+
analysisTimeframe,
|
|
1095
|
+
locale,
|
|
1096
|
+
executionTimeMilliseconds,
|
|
1097
|
+
notifications,
|
|
1098
|
+
queryId
|
|
1099
|
+
} = model;
|
|
1100
|
+
return {
|
|
1101
|
+
canonicalQuery,
|
|
1102
|
+
timezone,
|
|
1103
|
+
query,
|
|
1104
|
+
scannedRecords,
|
|
1105
|
+
dqlVersion,
|
|
1106
|
+
scannedBytes,
|
|
1107
|
+
analysisTimeframe: analysisTimeframe !== void 0 && analysisTimeframe !== null ? _TimeframeTransformation.toJson(analysisTimeframe) : void 0,
|
|
1108
|
+
locale,
|
|
1109
|
+
executionTimeMilliseconds,
|
|
1110
|
+
notifications: notifications !== void 0 && notifications !== null ? notifications?.map((innerValue) => _MetadataNotificationTransformation.toJson(innerValue)) : void 0,
|
|
1111
|
+
queryId
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
_GrailMetadataTransformation2.toJson = toJson;
|
|
1115
|
+
})(_GrailMetadataTransformation || (_GrailMetadataTransformation = {}));
|
|
1116
|
+
|
|
1117
|
+
// packages/client/query/src/lib/models/metric-metadata.ts
|
|
1118
|
+
var _MetricMetadataTransformation;
|
|
1119
|
+
((_MetricMetadataTransformation2) => {
|
|
1120
|
+
function fromJson(model) {
|
|
1121
|
+
const { "metric.key": metricKey, displayName, description, unit } = model;
|
|
1122
|
+
return {
|
|
1123
|
+
"metric.key": metricKey,
|
|
1124
|
+
displayName,
|
|
1125
|
+
description,
|
|
1126
|
+
unit
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
_MetricMetadataTransformation2.fromJson = fromJson;
|
|
1130
|
+
function toJson(model) {
|
|
1131
|
+
const { "metric.key": metricKey, displayName, description, unit } = model;
|
|
1132
|
+
return {
|
|
1133
|
+
"metric.key": metricKey,
|
|
1134
|
+
displayName,
|
|
1135
|
+
description,
|
|
1136
|
+
unit
|
|
1137
|
+
};
|
|
1138
|
+
}
|
|
1139
|
+
_MetricMetadataTransformation2.toJson = toJson;
|
|
1140
|
+
})(_MetricMetadataTransformation || (_MetricMetadataTransformation = {}));
|
|
1141
|
+
|
|
1142
|
+
// packages/client/query/src/lib/models/metadata.ts
|
|
1143
|
+
var _MetadataTransformation;
|
|
1144
|
+
((_MetadataTransformation2) => {
|
|
1145
|
+
function fromJson(model) {
|
|
1146
|
+
const { grail, metrics } = model;
|
|
1147
|
+
return {
|
|
1148
|
+
grail: grail !== void 0 && grail !== null ? _GrailMetadataTransformation.fromJson(grail) : void 0,
|
|
1149
|
+
metrics: metrics !== void 0 && metrics !== null ? metrics?.map((innerValue) => _MetricMetadataTransformation.fromJson(innerValue)) : void 0
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
_MetadataTransformation2.fromJson = fromJson;
|
|
1153
|
+
function toJson(model) {
|
|
1154
|
+
const { grail, metrics } = model;
|
|
1155
|
+
return {
|
|
1156
|
+
grail: grail !== void 0 && grail !== null ? _GrailMetadataTransformation.toJson(grail) : void 0,
|
|
1157
|
+
metrics: metrics !== void 0 && metrics !== null ? metrics?.map((innerValue) => _MetricMetadataTransformation.toJson(innerValue)) : void 0
|
|
1158
|
+
};
|
|
1159
|
+
}
|
|
1160
|
+
_MetadataTransformation2.toJson = toJson;
|
|
1161
|
+
})(_MetadataTransformation || (_MetadataTransformation = {}));
|
|
1162
|
+
|
|
1163
|
+
// packages/client/query/src/lib/models/field-type-type.ts
|
|
1164
|
+
var FieldTypeType = /* @__PURE__ */ ((FieldTypeType3) => {
|
|
1165
|
+
FieldTypeType3["Boolean"] = "boolean";
|
|
1166
|
+
FieldTypeType3["String"] = "string";
|
|
1167
|
+
FieldTypeType3["Double"] = "double";
|
|
1168
|
+
FieldTypeType3["Long"] = "long";
|
|
1169
|
+
FieldTypeType3["Timestamp"] = "timestamp";
|
|
1170
|
+
FieldTypeType3["Timeframe"] = "timeframe";
|
|
1171
|
+
FieldTypeType3["Duration"] = "duration";
|
|
1172
|
+
FieldTypeType3["Binary"] = "binary";
|
|
1173
|
+
FieldTypeType3["IpAddress"] = "ip_address";
|
|
1174
|
+
FieldTypeType3["GeoPoint"] = "geo_point";
|
|
1175
|
+
FieldTypeType3["Array"] = "array";
|
|
1176
|
+
FieldTypeType3["Record"] = "record";
|
|
1177
|
+
FieldTypeType3["Undefined"] = "undefined";
|
|
1178
|
+
return FieldTypeType3;
|
|
1179
|
+
})(FieldTypeType || {});
|
|
1180
|
+
var _FieldTypeTypeTransformation;
|
|
1181
|
+
((_FieldTypeTypeTransformation2) => {
|
|
1182
|
+
_FieldTypeTypeTransformation2.toJson = (value) => value;
|
|
1183
|
+
_FieldTypeTypeTransformation2.fromJson = (value) => value;
|
|
1184
|
+
})(_FieldTypeTypeTransformation || (_FieldTypeTypeTransformation = {}));
|
|
1185
|
+
|
|
1186
|
+
// packages/client/query/src/lib/models/field-type.ts
|
|
1187
|
+
var _FieldTypeTransformation;
|
|
1188
|
+
((_FieldTypeTransformation2) => {
|
|
1189
|
+
function fromJson(model) {
|
|
1190
|
+
const { type, types } = model;
|
|
1191
|
+
return {
|
|
1192
|
+
type: _FieldTypeTypeTransformation.fromJson(type),
|
|
1193
|
+
types: types !== void 0 && types !== null ? types?.map((innerValue) => _RangedFieldTypesTransformation.fromJson(innerValue)) : void 0
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
_FieldTypeTransformation2.fromJson = fromJson;
|
|
1197
|
+
function toJson(model) {
|
|
1198
|
+
const { type, types } = model;
|
|
1199
|
+
return {
|
|
1200
|
+
type: _FieldTypeTypeTransformation.toJson(type),
|
|
1201
|
+
types: types !== void 0 && types !== null ? types?.map((innerValue) => _RangedFieldTypesTransformation.toJson(innerValue)) : void 0
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
_FieldTypeTransformation2.toJson = toJson;
|
|
1205
|
+
})(_FieldTypeTransformation || (_FieldTypeTransformation = {}));
|
|
1206
|
+
|
|
1207
|
+
// packages/client/query/src/lib/models/ranged-field-types-mappings.ts
|
|
1208
|
+
var _RangedFieldTypesMappingsTransformation;
|
|
1209
|
+
((_RangedFieldTypesMappingsTransformation2) => {
|
|
1210
|
+
function fromJson(model) {
|
|
1211
|
+
const additionalProps = model;
|
|
1212
|
+
return {
|
|
1213
|
+
...Object.fromEntries(
|
|
1214
|
+
Object.entries(additionalProps).map(([propName, value]) => [
|
|
1215
|
+
propName,
|
|
1216
|
+
value !== void 0 && value !== null ? _FieldTypeTransformation.fromJson(value) : void 0
|
|
1217
|
+
])
|
|
1218
|
+
)
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
_RangedFieldTypesMappingsTransformation2.fromJson = fromJson;
|
|
1222
|
+
function toJson(model) {
|
|
1223
|
+
const additionalProps = model;
|
|
1224
|
+
return {
|
|
1225
|
+
...Object.fromEntries(
|
|
1226
|
+
Object.entries(additionalProps).map(([propName, value]) => [
|
|
1227
|
+
propName,
|
|
1228
|
+
value !== void 0 && value !== null ? _FieldTypeTransformation.toJson(value) : void 0
|
|
1229
|
+
])
|
|
1230
|
+
)
|
|
1231
|
+
};
|
|
1232
|
+
}
|
|
1233
|
+
_RangedFieldTypesMappingsTransformation2.toJson = toJson;
|
|
1234
|
+
})(_RangedFieldTypesMappingsTransformation || (_RangedFieldTypesMappingsTransformation = {}));
|
|
1235
|
+
|
|
1236
|
+
// packages/client/query/src/lib/models/ranged-field-types.ts
|
|
1237
|
+
var _RangedFieldTypesTransformation;
|
|
1238
|
+
((_RangedFieldTypesTransformation2) => {
|
|
1239
|
+
function fromJson(model) {
|
|
1240
|
+
const { mappings, indexRange } = model;
|
|
1241
|
+
return {
|
|
1242
|
+
mappings: _RangedFieldTypesMappingsTransformation.fromJson(mappings),
|
|
1243
|
+
indexRange: indexRange !== void 0 && indexRange !== null ? indexRange?.slice(0) : void 0
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
_RangedFieldTypesTransformation2.fromJson = fromJson;
|
|
1247
|
+
function toJson(model) {
|
|
1248
|
+
const { mappings, indexRange } = model;
|
|
1249
|
+
return {
|
|
1250
|
+
mappings: _RangedFieldTypesMappingsTransformation.toJson(mappings),
|
|
1251
|
+
indexRange: indexRange !== void 0 && indexRange !== null ? indexRange?.slice(0) : void 0
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
_RangedFieldTypesTransformation2.toJson = toJson;
|
|
1255
|
+
})(_RangedFieldTypesTransformation || (_RangedFieldTypesTransformation = {}));
|
|
1256
|
+
|
|
1257
|
+
// packages/client/query/src/lib/models/result-record-value.ts
|
|
1258
|
+
var _ResultRecordValueTransformation;
|
|
1259
|
+
((_ResultRecordValueTransformation2) => {
|
|
1260
|
+
function fromJson(model) {
|
|
1261
|
+
return model;
|
|
1262
|
+
}
|
|
1263
|
+
_ResultRecordValueTransformation2.fromJson = fromJson;
|
|
1264
|
+
function toJson(model) {
|
|
1265
|
+
return model;
|
|
1266
|
+
}
|
|
1267
|
+
_ResultRecordValueTransformation2.toJson = toJson;
|
|
1268
|
+
})(_ResultRecordValueTransformation || (_ResultRecordValueTransformation = {}));
|
|
1269
|
+
|
|
1270
|
+
// packages/client/query/src/lib/models/result-record.ts
|
|
1271
|
+
var _ResultRecordTransformation;
|
|
1272
|
+
((_ResultRecordTransformation2) => {
|
|
1273
|
+
function fromJson(model) {
|
|
1274
|
+
if (model === null) {
|
|
1275
|
+
return null;
|
|
1276
|
+
}
|
|
1277
|
+
const additionalProps = model;
|
|
1278
|
+
return {
|
|
1279
|
+
...Object.fromEntries(
|
|
1280
|
+
Object.entries(additionalProps).map(([propName, value]) => [
|
|
1281
|
+
propName,
|
|
1282
|
+
value !== void 0 && value !== null ? _ResultRecordValueTransformation.fromJson(value) : void 0
|
|
1283
|
+
])
|
|
1284
|
+
)
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
_ResultRecordTransformation2.fromJson = fromJson;
|
|
1288
|
+
function toJson(model) {
|
|
1289
|
+
if (model === null) {
|
|
1290
|
+
return null;
|
|
1291
|
+
}
|
|
1292
|
+
const additionalProps = model;
|
|
1293
|
+
return {
|
|
1294
|
+
...Object.fromEntries(
|
|
1295
|
+
Object.entries(additionalProps).map(([propName, value]) => [
|
|
1296
|
+
propName,
|
|
1297
|
+
value !== void 0 && value !== null ? _ResultRecordValueTransformation.toJson(value) : void 0
|
|
1298
|
+
])
|
|
1299
|
+
)
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
_ResultRecordTransformation2.toJson = toJson;
|
|
1303
|
+
})(_ResultRecordTransformation || (_ResultRecordTransformation = {}));
|
|
1304
|
+
|
|
1305
|
+
// packages/client/query/src/lib/models/query-result.ts
|
|
1306
|
+
var _QueryResultTransformation;
|
|
1307
|
+
((_QueryResultTransformation2) => {
|
|
1308
|
+
function fromJson(model) {
|
|
1309
|
+
const { records, metadata, types } = model;
|
|
1310
|
+
return {
|
|
1311
|
+
records: records?.map((innerValue) => _ResultRecordTransformation.fromJson(innerValue)),
|
|
1312
|
+
metadata: _MetadataTransformation.fromJson(metadata),
|
|
1313
|
+
types: types?.map((innerValue) => _RangedFieldTypesTransformation.fromJson(innerValue))
|
|
1314
|
+
};
|
|
1315
|
+
}
|
|
1316
|
+
_QueryResultTransformation2.fromJson = fromJson;
|
|
1317
|
+
function toJson(model) {
|
|
1318
|
+
const { records, metadata, types } = model;
|
|
1319
|
+
return {
|
|
1320
|
+
records: records?.map((innerValue) => _ResultRecordTransformation.toJson(innerValue)),
|
|
1321
|
+
metadata: _MetadataTransformation.toJson(metadata),
|
|
1322
|
+
types: types?.map((innerValue) => _RangedFieldTypesTransformation.toJson(innerValue))
|
|
1323
|
+
};
|
|
1324
|
+
}
|
|
1325
|
+
_QueryResultTransformation2.toJson = toJson;
|
|
1326
|
+
})(_QueryResultTransformation || (_QueryResultTransformation = {}));
|
|
1327
|
+
|
|
1328
|
+
// packages/client/query/src/lib/models/query-state.ts
|
|
1329
|
+
var QueryState = /* @__PURE__ */ ((QueryState4) => {
|
|
1330
|
+
QueryState4["NotStarted"] = "NOT_STARTED";
|
|
1331
|
+
QueryState4["Running"] = "RUNNING";
|
|
1332
|
+
QueryState4["Succeeded"] = "SUCCEEDED";
|
|
1333
|
+
QueryState4["ResultGone"] = "RESULT_GONE";
|
|
1334
|
+
QueryState4["Cancelled"] = "CANCELLED";
|
|
1335
|
+
QueryState4["Failed"] = "FAILED";
|
|
1336
|
+
return QueryState4;
|
|
1337
|
+
})(QueryState || {});
|
|
1338
|
+
var _QueryStateTransformation;
|
|
1339
|
+
((_QueryStateTransformation2) => {
|
|
1340
|
+
_QueryStateTransformation2.toJson = (value) => value;
|
|
1341
|
+
_QueryStateTransformation2.fromJson = (value) => value;
|
|
1342
|
+
})(_QueryStateTransformation || (_QueryStateTransformation = {}));
|
|
1343
|
+
|
|
1344
|
+
// packages/client/query/src/lib/models/query-poll-response.ts
|
|
1345
|
+
var _QueryPollResponseTransformation;
|
|
1346
|
+
((_QueryPollResponseTransformation2) => {
|
|
1347
|
+
function fromJson(model) {
|
|
1348
|
+
const { result, ttlSeconds, progress, state } = model;
|
|
1349
|
+
return {
|
|
1350
|
+
result: result !== void 0 && result !== null ? _QueryResultTransformation.fromJson(result) : void 0,
|
|
1351
|
+
ttlSeconds,
|
|
1352
|
+
progress,
|
|
1353
|
+
state: _QueryStateTransformation.fromJson(state)
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
_QueryPollResponseTransformation2.fromJson = fromJson;
|
|
1357
|
+
function toJson(model) {
|
|
1358
|
+
const { result, ttlSeconds, progress, state } = model;
|
|
1359
|
+
return {
|
|
1360
|
+
result: result !== void 0 && result !== null ? _QueryResultTransformation.toJson(result) : void 0,
|
|
1361
|
+
ttlSeconds,
|
|
1362
|
+
progress,
|
|
1363
|
+
state: _QueryStateTransformation.toJson(state)
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
_QueryPollResponseTransformation2.toJson = toJson;
|
|
1367
|
+
})(_QueryPollResponseTransformation || (_QueryPollResponseTransformation = {}));
|
|
1368
|
+
|
|
1369
|
+
// packages/client/query/src/lib/models/query-start-response.ts
|
|
1370
|
+
var _QueryStartResponseTransformation;
|
|
1371
|
+
((_QueryStartResponseTransformation2) => {
|
|
1372
|
+
function fromJson(model) {
|
|
1373
|
+
const { result, ttlSeconds, progress, requestToken, state } = model;
|
|
1374
|
+
return {
|
|
1375
|
+
result: result !== void 0 && result !== null ? _QueryResultTransformation.fromJson(result) : void 0,
|
|
1376
|
+
ttlSeconds,
|
|
1377
|
+
progress,
|
|
1378
|
+
requestToken,
|
|
1379
|
+
state: _QueryStateTransformation.fromJson(state)
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
_QueryStartResponseTransformation2.fromJson = fromJson;
|
|
1383
|
+
function toJson(model) {
|
|
1384
|
+
const { result, ttlSeconds, progress, requestToken, state } = model;
|
|
1385
|
+
return {
|
|
1386
|
+
result: result !== void 0 && result !== null ? _QueryResultTransformation.toJson(result) : void 0,
|
|
1387
|
+
ttlSeconds,
|
|
1388
|
+
progress,
|
|
1389
|
+
requestToken,
|
|
1390
|
+
state: _QueryStateTransformation.toJson(state)
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
_QueryStartResponseTransformation2.toJson = toJson;
|
|
1394
|
+
})(_QueryStartResponseTransformation || (_QueryStartResponseTransformation = {}));
|
|
1395
|
+
|
|
1396
|
+
// packages/client/query/src/lib/utils/url-helpers.ts
|
|
1397
|
+
var encodeQueryParam = (key, value) => {
|
|
1398
|
+
const encodedKey = encodeURIComponent(key);
|
|
1399
|
+
return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : String(value))}`;
|
|
1400
|
+
};
|
|
1401
|
+
var addArrayQueryParam = (query, key) => {
|
|
1402
|
+
const arrayValue = query[key];
|
|
1403
|
+
return arrayValue.map((value) => encodeQueryParam(key, value)).join("&");
|
|
1404
|
+
};
|
|
1405
|
+
var addQueryParam = (query, key) => encodeQueryParam(key, query[key]);
|
|
1406
|
+
var toQueryString = (rawQuery) => {
|
|
1407
|
+
const query = rawQuery || {};
|
|
1408
|
+
const keys = Object.keys(query).filter((key) => typeof query[key] !== "undefined");
|
|
1409
|
+
return keys.map((key) => Array.isArray(query[key]) ? addArrayQueryParam(query, key) : addQueryParam(query, key)).join("&");
|
|
1410
|
+
};
|
|
1411
|
+
|
|
1412
|
+
// packages/client/query/src/lib/apis/query-execution-api.ts
|
|
1413
|
+
var QueryExecutionClient = class {
|
|
1414
|
+
httpClient;
|
|
1415
|
+
constructor(httpClientImplementation) {
|
|
1416
|
+
this.httpClient = httpClientImplementation;
|
|
1417
|
+
registerGlobalErrorSerializer(apiClientErrorSerializer);
|
|
1418
|
+
}
|
|
1419
|
+
async queryPoll(config) {
|
|
1420
|
+
if (!config) {
|
|
1421
|
+
throw new ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
1422
|
+
}
|
|
1423
|
+
const query = toQueryString({
|
|
1424
|
+
"request-token": config.requestToken,
|
|
1425
|
+
"request-timeout-milliseconds": config.requestTimeoutMilliseconds,
|
|
1426
|
+
enrich: config.enrich
|
|
1427
|
+
});
|
|
1428
|
+
const response = await this.httpClient.send({
|
|
1429
|
+
url: `/platform/storage/query/v1/query:poll?${query}`,
|
|
1430
|
+
method: "GET",
|
|
1431
|
+
headers: {
|
|
1432
|
+
Accept: "application/json"
|
|
1433
|
+
},
|
|
1434
|
+
abortSignal: config.abortSignal,
|
|
1435
|
+
statusValidator: (status) => {
|
|
1436
|
+
if (200 <= status && status < 300) {
|
|
1437
|
+
return true;
|
|
1438
|
+
}
|
|
1439
|
+
return [410, 500].includes(status);
|
|
1440
|
+
}
|
|
1441
|
+
});
|
|
1442
|
+
switch (response.status) {
|
|
1443
|
+
case 410: {
|
|
1444
|
+
const responseValue = await response.body("text");
|
|
1445
|
+
throw new ClientRequestError(
|
|
1446
|
+
`410`,
|
|
1447
|
+
response,
|
|
1448
|
+
responseValue,
|
|
1449
|
+
`The query for the given request-token is not available anymore.`
|
|
1450
|
+
);
|
|
1451
|
+
}
|
|
1452
|
+
case 500: {
|
|
1453
|
+
const responseValue = await response.body("json");
|
|
1454
|
+
try {
|
|
1455
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
1456
|
+
throw new ErrorEnvelopeError("500", response, errorBody, "An internal server error has occurred.");
|
|
1457
|
+
} catch (err) {
|
|
1458
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
1459
|
+
throw err;
|
|
1460
|
+
}
|
|
1461
|
+
throw new InvalidResponseError(
|
|
1462
|
+
`QueryExecutionClient.query:poll:500`,
|
|
1463
|
+
err,
|
|
1464
|
+
responseValue,
|
|
1465
|
+
"ErrorEnvelope",
|
|
1466
|
+
void 0
|
|
1467
|
+
);
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
case 200: {
|
|
1471
|
+
const responseValue = await response.body("json");
|
|
1472
|
+
try {
|
|
1473
|
+
return _QueryPollResponseTransformation.fromJson(responseValue);
|
|
1474
|
+
} catch (err) {
|
|
1475
|
+
throw new InvalidResponseError(
|
|
1476
|
+
`QueryExecutionClient.query:poll:${response.status}`,
|
|
1477
|
+
err,
|
|
1478
|
+
responseValue,
|
|
1479
|
+
void 0,
|
|
1480
|
+
void 0
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
default: {
|
|
1485
|
+
const responseValue = await response.body("text").catch();
|
|
1486
|
+
throw new ClientRequestError(
|
|
1487
|
+
`${response.status}`,
|
|
1488
|
+
response,
|
|
1489
|
+
responseValue,
|
|
1490
|
+
`Unexpected api response: code=${response.status} body="${responseValue}"`
|
|
1491
|
+
);
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
async queryExecute(config) {
|
|
1496
|
+
if (!config) {
|
|
1497
|
+
throw new ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
1498
|
+
}
|
|
1499
|
+
const encodedBody = _ExecuteRequestTransformation.toJson(config.body);
|
|
1500
|
+
const query = toQueryString({ enrich: config.enrich });
|
|
1501
|
+
const headerParameters = {
|
|
1502
|
+
...config.authorization !== void 0 && { Authorization: String(config.authorization) }
|
|
1503
|
+
};
|
|
1504
|
+
const response = await this.httpClient.send({
|
|
1505
|
+
url: `/platform/storage/query/v1/query:execute?${query}`,
|
|
1506
|
+
method: "POST",
|
|
1507
|
+
requestBodyType: "json",
|
|
1508
|
+
body: encodedBody,
|
|
1509
|
+
headers: {
|
|
1510
|
+
"Content-Type": "application/json",
|
|
1511
|
+
Accept: "application/json",
|
|
1512
|
+
...headerParameters
|
|
1513
|
+
},
|
|
1514
|
+
abortSignal: config.abortSignal,
|
|
1515
|
+
statusValidator: (status) => {
|
|
1516
|
+
if (200 <= status && status < 300) {
|
|
1517
|
+
return true;
|
|
1518
|
+
}
|
|
1519
|
+
return [400, 500, 503].includes(status);
|
|
1520
|
+
}
|
|
1521
|
+
});
|
|
1522
|
+
switch (response.status) {
|
|
1523
|
+
case 400: {
|
|
1524
|
+
const responseValue = await response.body("json");
|
|
1525
|
+
try {
|
|
1526
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
1527
|
+
throw new ErrorEnvelopeError(
|
|
1528
|
+
"400",
|
|
1529
|
+
response,
|
|
1530
|
+
errorBody,
|
|
1531
|
+
"The supplied request is wrong. Either the query itself or other parameters are wrong."
|
|
1532
|
+
);
|
|
1533
|
+
} catch (err) {
|
|
1534
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
1535
|
+
throw err;
|
|
1536
|
+
}
|
|
1537
|
+
throw new InvalidResponseError(
|
|
1538
|
+
`QueryExecutionClient.query:execute:400`,
|
|
1539
|
+
err,
|
|
1540
|
+
responseValue,
|
|
1541
|
+
"ErrorEnvelope",
|
|
1542
|
+
void 0
|
|
1543
|
+
);
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
case 500: {
|
|
1547
|
+
const responseValue = await response.body("json");
|
|
1548
|
+
try {
|
|
1549
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
1550
|
+
throw new ErrorEnvelopeError("500", response, errorBody, "An internal server error has occurred.");
|
|
1551
|
+
} catch (err) {
|
|
1552
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
1553
|
+
throw err;
|
|
1554
|
+
}
|
|
1555
|
+
throw new InvalidResponseError(
|
|
1556
|
+
`QueryExecutionClient.query:execute:500`,
|
|
1557
|
+
err,
|
|
1558
|
+
responseValue,
|
|
1559
|
+
"ErrorEnvelope",
|
|
1560
|
+
void 0
|
|
1561
|
+
);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
case 503: {
|
|
1565
|
+
const responseValue = await response.body("json");
|
|
1566
|
+
try {
|
|
1567
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
1568
|
+
throw new ErrorEnvelopeError("503", response, errorBody, "Service is unavailable.");
|
|
1569
|
+
} catch (err) {
|
|
1570
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
1571
|
+
throw err;
|
|
1572
|
+
}
|
|
1573
|
+
throw new InvalidResponseError(
|
|
1574
|
+
`QueryExecutionClient.query:execute:503`,
|
|
1575
|
+
err,
|
|
1576
|
+
responseValue,
|
|
1577
|
+
"ErrorEnvelope",
|
|
1578
|
+
void 0
|
|
1579
|
+
);
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
case 200: {
|
|
1583
|
+
const responseValue = await response.body("json");
|
|
1584
|
+
try {
|
|
1585
|
+
return _QueryStartResponseTransformation.fromJson(responseValue);
|
|
1586
|
+
} catch (err) {
|
|
1587
|
+
throw new InvalidResponseError(
|
|
1588
|
+
`QueryExecutionClient.query:execute:${response.status}`,
|
|
1589
|
+
err,
|
|
1590
|
+
responseValue,
|
|
1591
|
+
void 0,
|
|
1592
|
+
void 0
|
|
1593
|
+
);
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
case 202: {
|
|
1597
|
+
const responseValue = await response.body("json");
|
|
1598
|
+
try {
|
|
1599
|
+
return _QueryStartResponseTransformation.fromJson(responseValue);
|
|
1600
|
+
} catch (err) {
|
|
1601
|
+
throw new InvalidResponseError(
|
|
1602
|
+
`QueryExecutionClient.query:execute:${response.status}`,
|
|
1603
|
+
err,
|
|
1604
|
+
responseValue,
|
|
1605
|
+
void 0,
|
|
1606
|
+
void 0
|
|
1607
|
+
);
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
default: {
|
|
1611
|
+
const responseValue = await response.body("text").catch();
|
|
1612
|
+
throw new ClientRequestError(
|
|
1613
|
+
`${response.status}`,
|
|
1614
|
+
response,
|
|
1615
|
+
responseValue,
|
|
1616
|
+
`Unexpected api response: code=${response.status} body="${responseValue}"`
|
|
1617
|
+
);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
async queryCancel(config) {
|
|
1622
|
+
if (!config) {
|
|
1623
|
+
throw new ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
1624
|
+
}
|
|
1625
|
+
const query = toQueryString({ "request-token": config.requestToken });
|
|
1626
|
+
const response = await this.httpClient.send({
|
|
1627
|
+
url: `/platform/storage/query/v1/query:cancel?${query}`,
|
|
1628
|
+
method: "POST",
|
|
1629
|
+
headers: {
|
|
1630
|
+
Accept: "application/json"
|
|
1631
|
+
},
|
|
1632
|
+
abortSignal: config.abortSignal,
|
|
1633
|
+
statusValidator: (status) => {
|
|
1634
|
+
if (200 <= status && status < 300) {
|
|
1635
|
+
return true;
|
|
1636
|
+
}
|
|
1637
|
+
return [410, 500].includes(status);
|
|
1638
|
+
}
|
|
1639
|
+
});
|
|
1640
|
+
switch (response.status) {
|
|
1641
|
+
case 410: {
|
|
1642
|
+
const responseValue = await response.body("text");
|
|
1643
|
+
throw new ClientRequestError(
|
|
1644
|
+
`410`,
|
|
1645
|
+
response,
|
|
1646
|
+
responseValue,
|
|
1647
|
+
`The query for the given request-token is not available anymore.`
|
|
1648
|
+
);
|
|
1649
|
+
}
|
|
1650
|
+
case 500: {
|
|
1651
|
+
const responseValue = await response.body("json");
|
|
1652
|
+
try {
|
|
1653
|
+
const errorBody = _ErrorEnvelopeTransformation.fromJson(responseValue);
|
|
1654
|
+
throw new ErrorEnvelopeError("500", response, errorBody, "An internal server error has occurred.");
|
|
1655
|
+
} catch (err) {
|
|
1656
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
1657
|
+
throw err;
|
|
1658
|
+
}
|
|
1659
|
+
throw new InvalidResponseError(
|
|
1660
|
+
`QueryExecutionClient.query:cancel:500`,
|
|
1661
|
+
err,
|
|
1662
|
+
responseValue,
|
|
1663
|
+
"ErrorEnvelope",
|
|
1664
|
+
void 0
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
case 200: {
|
|
1669
|
+
const responseValue = await response.body("json");
|
|
1670
|
+
try {
|
|
1671
|
+
return _QueryPollResponseTransformation.fromJson(responseValue);
|
|
1672
|
+
} catch (err) {
|
|
1673
|
+
throw new InvalidResponseError(
|
|
1674
|
+
`QueryExecutionClient.query:cancel:${response.status}`,
|
|
1675
|
+
err,
|
|
1676
|
+
responseValue,
|
|
1677
|
+
void 0,
|
|
1678
|
+
void 0
|
|
1679
|
+
);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
case 202: {
|
|
1683
|
+
return;
|
|
1684
|
+
}
|
|
1685
|
+
default: {
|
|
1686
|
+
const responseValue = await response.body("text").catch();
|
|
1687
|
+
throw new ClientRequestError(
|
|
1688
|
+
`${response.status}`,
|
|
1689
|
+
response,
|
|
1690
|
+
responseValue,
|
|
1691
|
+
`Unexpected api response: code=${response.status} body="${responseValue}"`
|
|
1692
|
+
);
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
};
|
|
1697
|
+
var queryExecutionClient = /* @__PURE__ */ new QueryExecutionClient(defaultHttpClient2);
|
|
1698
|
+
|
|
1699
|
+
// packages/client/query/src/lib/models/geo-point.ts
|
|
1700
|
+
var _GeoPointTransformation;
|
|
1701
|
+
((_GeoPointTransformation2) => {
|
|
1702
|
+
function fromJson(model) {
|
|
1703
|
+
const { latitude, longitude } = model;
|
|
1704
|
+
return {
|
|
1705
|
+
latitude,
|
|
1706
|
+
longitude
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
_GeoPointTransformation2.fromJson = fromJson;
|
|
1710
|
+
function toJson(model) {
|
|
1711
|
+
const { latitude, longitude } = model;
|
|
1712
|
+
return {
|
|
1713
|
+
latitude,
|
|
1714
|
+
longitude
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
_GeoPointTransformation2.toJson = toJson;
|
|
1718
|
+
})(_GeoPointTransformation || (_GeoPointTransformation = {}));
|
|
1719
|
+
export {
|
|
1720
|
+
DQLNodeNodeType,
|
|
1721
|
+
FieldTypeType,
|
|
1722
|
+
QueryAssistanceClient,
|
|
1723
|
+
QueryExecutionClient,
|
|
1724
|
+
QueryState,
|
|
1725
|
+
TokenType,
|
|
1726
|
+
_AutocompleteRequestTransformation,
|
|
1727
|
+
_AutocompleteResponseTransformation,
|
|
1728
|
+
_AutocompleteSuggestionPartTransformation,
|
|
1729
|
+
_AutocompleteSuggestionTransformation,
|
|
1730
|
+
_DQLAlternativeNodeTransformation,
|
|
1731
|
+
_DQLContainerNodeTransformation,
|
|
1732
|
+
_DQLNodeNodeTypeTransformation,
|
|
1733
|
+
_DQLNodeTransformation,
|
|
1734
|
+
_DQLTerminalNodeTransformation,
|
|
1735
|
+
_ErrorEnvelopeTransformation,
|
|
1736
|
+
_ErrorResponseDetailsTransformation,
|
|
1737
|
+
_ErrorResponseTransformation,
|
|
1738
|
+
_ExecuteRequestTransformation,
|
|
1739
|
+
_FieldTypeTransformation,
|
|
1740
|
+
_FieldTypeTypeTransformation,
|
|
1741
|
+
_GeoPointTransformation,
|
|
1742
|
+
_GrailMetadataTransformation,
|
|
1743
|
+
_MetadataNotificationTransformation,
|
|
1744
|
+
_MetadataTransformation,
|
|
1745
|
+
_MetricMetadataTransformation,
|
|
1746
|
+
_ParseRequestTransformation,
|
|
1747
|
+
_PositionInfoTransformation,
|
|
1748
|
+
_QueryPollResponseTransformation,
|
|
1749
|
+
_QueryResultTransformation,
|
|
1750
|
+
_QueryStartResponseTransformation,
|
|
1751
|
+
_QueryStateTransformation,
|
|
1752
|
+
_RangedFieldTypesMappingsTransformation,
|
|
1753
|
+
_RangedFieldTypesTransformation,
|
|
1754
|
+
_ResultRecordTransformation,
|
|
1755
|
+
_ResultRecordValueTransformation,
|
|
1756
|
+
_TimeframeTransformation,
|
|
1757
|
+
_TokenPositionTransformation,
|
|
1758
|
+
_TokenTypeTransformation,
|
|
1759
|
+
_VerifyRequestTransformation,
|
|
1760
|
+
_VerifyResponseTransformation,
|
|
1761
|
+
isApiClientError,
|
|
1762
|
+
isClientRequestError,
|
|
1763
|
+
isErrorEnvelopeError,
|
|
1764
|
+
queryAssistanceClient,
|
|
1765
|
+
queryExecutionClient
|
|
1766
|
+
};
|