@dynatrace-sdk/client-query 1.13.0 → 1.17.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 +29 -0
- package/README.md +113 -170
- package/cjs/index.js +428 -217
- package/dynatrace-metadata.json +3 -3
- package/esm/index.js +425 -194
- package/package.json +3 -2
- package/types/packages/client/query/src/lib/apis/query-assistance-api.d.ts +18 -3
- package/types/packages/client/query/src/lib/apis/query-execution-api.d.ts +19 -3
- package/types/packages/client/query/src/lib/error-envelopes/api-gateway-errors-handler.d.ts +2 -0
- package/types/packages/client/query/src/lib/error-envelopes/error-envelope-error.d.ts +1 -1
- package/types/packages/client/query/src/lib/error-envelopes/index.d.ts +3 -4
- package/types/packages/client/query/src/lib/error-envelopes/responses/insufficient-permission.d.ts +9 -0
- package/types/packages/client/query/src/lib/models/autocomplete-request.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/autocomplete-suggestion-part.d.ts +4 -2
- package/types/packages/client/query/src/lib/models/dql-container-node.d.ts +1 -1
- package/types/packages/client/query/src/lib/models/dql-container-node.transformation.d.ts +1 -1
- package/types/packages/client/query/src/lib/models/dql-node-node-type.d.ts +2 -0
- package/types/packages/client/query/src/lib/models/dql-node-node-type.transformation.d.ts +3 -4
- package/types/packages/client/query/src/lib/models/dql-node.d.ts +7 -2
- package/types/packages/client/query/src/lib/models/dql-terminal-node.d.ts +4 -2
- package/types/packages/client/query/src/lib/models/error-envelope.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/error-response-details.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/error-response.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/execute-request.d.ts +6 -0
- package/types/packages/client/query/src/lib/models/field-type-type.d.ts +4 -0
- package/types/packages/client/query/src/lib/models/field-type-type.transformation.d.ts +3 -4
- package/types/packages/client/query/src/lib/models/field-type.d.ts +1 -2
- package/types/packages/client/query/src/lib/models/grail-metadata.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/metadata-notification.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/metadata.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/parse-request.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/query-poll-response.d.ts +7 -2
- package/types/packages/client/query/src/lib/models/query-result.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/query-start-response.d.ts +7 -2
- package/types/packages/client/query/src/lib/models/query-state.d.ts +2 -0
- package/types/packages/client/query/src/lib/models/query-state.transformation.d.ts +3 -4
- package/types/packages/client/query/src/lib/models/ranged-field-types.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/token-position.d.ts +6 -0
- package/types/packages/client/query/src/lib/models/token-type.d.ts +4 -1
- package/types/packages/client/query/src/lib/models/token-type.transformation.d.ts +3 -4
- package/types/packages/client/query/src/lib/models/verify-request.d.ts +3 -0
- package/types/packages/client/query/src/lib/utils/encoding.d.ts +10 -0
- package/types/packages/http-client/src/lib/types/binary.d.ts +2 -2
- package/types/packages/http-client/src/lib/types/http-client-response.d.ts +2 -2
- package/types/packages/shared-errors/src/api-client-error.d.ts +23 -0
- package/types/packages/shared-errors/src/api-gateway-error.d.ts +37 -0
- package/types/packages/shared-errors/src/client-request-error.d.ts +39 -0
- package/types/packages/shared-errors/src/index.d.ts +5 -0
- package/types/packages/shared-errors/src/invalid-response-error.d.ts +26 -0
- package/types/packages/shared-errors/src/types.d.ts +88 -0
- package/types/packages/client/query/src/lib/error-envelopes/api-client-error.d.ts +0 -11
- package/types/packages/client/query/src/lib/error-envelopes/client-request-error.d.ts +0 -9
- package/types/packages/client/query/src/lib/error-envelopes/invalid-response-error.d.ts +0 -9
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace-sdk/client-query",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Exposes an API to fetch records stored in Grail.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@dynatrace-sdk/error-handlers": "^1.2.0",
|
|
8
|
-
"@dynatrace-sdk/http-client": "^1.3.0"
|
|
8
|
+
"@dynatrace-sdk/http-client": "^1.3.0",
|
|
9
|
+
"@dynatrace-sdk/shared-errors": "^1.0.0"
|
|
9
10
|
},
|
|
10
11
|
"main": "./cjs/index.js",
|
|
11
12
|
"module": "./esm/index.js",
|
|
@@ -26,7 +26,7 @@ export declare class QueryAssistanceClient {
|
|
|
26
26
|
* Verifies the supplied query string and other query parameters for lack of any errors, but without actually
|
|
27
27
|
* submitting the query for execution.
|
|
28
28
|
*
|
|
29
|
-
* @returns Supplied query and parameters were verified.
|
|
29
|
+
* @returns {Promise<VerifyResponse>} Supplied query and parameters were verified.
|
|
30
30
|
*
|
|
31
31
|
* @example <caption>Code example</caption>
|
|
32
32
|
* import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
|
|
@@ -37,6 +37,11 @@ export declare class QueryAssistanceClient {
|
|
|
37
37
|
* 'fetch events | filter event.type == "davis" AND davis.status != "CLOSED" | fields timestamp, davis.title, davis.underMaintenance, davis.status | sort timestamp | limit 10',
|
|
38
38
|
* },
|
|
39
39
|
* });
|
|
40
|
+
*
|
|
41
|
+
* @throws {ErrorEnvelopeError} The supplied request is wrong. | An internal server error has occurred.
|
|
42
|
+
* @throws {InvalidResponseError}
|
|
43
|
+
* @throws {ApiClientError}
|
|
44
|
+
* @throws {ClientRequestError}
|
|
40
45
|
*/
|
|
41
46
|
queryVerify(config: {
|
|
42
47
|
body: VerifyRequest;
|
|
@@ -237,7 +242,7 @@ export declare class QueryAssistanceClient {
|
|
|
237
242
|
* for `FILTER condition:a == 1`. This `condition:` was neither written by the user nor is it canonical; but it might be
|
|
238
243
|
* used to help the user understand what this parameter means.
|
|
239
244
|
*
|
|
240
|
-
* @returns A node containing more nodes, a node offering different (semantically equivalent) versions of the query parts, or a terminal node that shows the canonical form.
|
|
245
|
+
* @returns {Promise<DQLNode>} A node containing more nodes, a node offering different (semantically equivalent) versions of the query parts, or a terminal node that shows the canonical form.
|
|
241
246
|
*
|
|
242
247
|
* @example <caption>Code example</caption>
|
|
243
248
|
* import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
|
|
@@ -248,6 +253,11 @@ export declare class QueryAssistanceClient {
|
|
|
248
253
|
* 'fetch events | filter event.type == "davis" AND davis.status != "CLOSED" | fields timestamp, davis.title, davis.underMaintenance, davis.status | sort timestamp | limit 10',
|
|
249
254
|
* },
|
|
250
255
|
* });
|
|
256
|
+
*
|
|
257
|
+
* @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | An internal server error has occurred.
|
|
258
|
+
* @throws {InvalidResponseError}
|
|
259
|
+
* @throws {ApiClientError}
|
|
260
|
+
* @throws {ClientRequestError}
|
|
251
261
|
*/
|
|
252
262
|
queryParse(config: {
|
|
253
263
|
body: ParseRequest;
|
|
@@ -292,7 +302,7 @@ export declare class QueryAssistanceClient {
|
|
|
292
302
|
* The `type` helps to treat specific parts of the suggestion different to others; either by a different visualization,
|
|
293
303
|
* a link to docs, etc.
|
|
294
304
|
*
|
|
295
|
-
* @returns A list of structured autocomplete suggestions.
|
|
305
|
+
* @returns {Promise<AutocompleteResponse>} A list of structured autocomplete suggestions.
|
|
296
306
|
*
|
|
297
307
|
* @example <caption>Code example</caption>
|
|
298
308
|
* import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
|
|
@@ -303,6 +313,11 @@ export declare class QueryAssistanceClient {
|
|
|
303
313
|
* 'fetch events | filter event.type == "davis" AND davis.status != "CLOSED" | fields timestamp, davis.title, davis.underMaintenance, davis.status | sort timestamp | limit 10',
|
|
304
314
|
* },
|
|
305
315
|
* });
|
|
316
|
+
*
|
|
317
|
+
* @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | An internal server error has occurred.
|
|
318
|
+
* @throws {InvalidResponseError}
|
|
319
|
+
* @throws {ApiClientError}
|
|
320
|
+
* @throws {ClientRequestError}
|
|
306
321
|
*/
|
|
307
322
|
queryAutocomplete(config: {
|
|
308
323
|
body: AutocompleteRequest;
|
|
@@ -49,7 +49,7 @@ export declare class QueryExecutionClient {
|
|
|
49
49
|
* It is guaranteed that every field of every record will have a corresponding type.
|
|
50
50
|
* **Clients should always take the included types into account when consuming records!**
|
|
51
51
|
*
|
|
52
|
-
* @returns The current status and results of the supplied query.
|
|
52
|
+
* @returns {Promise<QueryPollResponse>} The current status and results of the supplied query.
|
|
53
53
|
*
|
|
54
54
|
* @example <caption>Code example</caption>
|
|
55
55
|
* import { queryExecutionClient } from "@dynatrace-sdk/client-query";
|
|
@@ -57,6 +57,11 @@ export declare class QueryExecutionClient {
|
|
|
57
57
|
* const data = await queryExecutionClient.queryPoll({
|
|
58
58
|
* requestToken: "...",
|
|
59
59
|
* });
|
|
60
|
+
*
|
|
61
|
+
* @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | An internal server error has occurred.
|
|
62
|
+
* @throws {InvalidResponseError}
|
|
63
|
+
* @throws {ApiClientError}
|
|
64
|
+
* @throws {ClientRequestError}
|
|
60
65
|
*/
|
|
61
66
|
queryPoll(config: {
|
|
62
67
|
/** The request-token of the query. */ requestToken: string;
|
|
@@ -103,7 +108,7 @@ export declare class QueryExecutionClient {
|
|
|
103
108
|
* It is guaranteed that every field of every record will have a corresponding type.
|
|
104
109
|
* **Clients should always take the included types into account when consuming records!**
|
|
105
110
|
*
|
|
106
|
-
* @returns The final status and results of the supplied query if it finished within a supplied requestTimeoutMilliseconds. | The status of the query to start.
|
|
111
|
+
* @returns {Promise<QueryStartResponse>} The final status and results of the supplied query if it finished within a supplied requestTimeoutMilliseconds. | The status of the query to start.
|
|
107
112
|
*
|
|
108
113
|
* @example <caption>Code example</caption>
|
|
109
114
|
* import { queryExecutionClient } from "@dynatrace-sdk/client-query";
|
|
@@ -114,6 +119,12 @@ export declare class QueryExecutionClient {
|
|
|
114
119
|
* 'fetch events | filter event.type == "davis" AND davis.status != "CLOSED" | fields timestamp, davis.title, davis.underMaintenance, davis.status | sort timestamp | limit 10',
|
|
115
120
|
* },
|
|
116
121
|
* });
|
|
122
|
+
*
|
|
123
|
+
* @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | Too many requests. | An internal server error has occurred. | Service is unavailable. | Client error. | Server error.
|
|
124
|
+
* @throws {InsufficientPermission} Insufficient permissions.
|
|
125
|
+
* @throws {InvalidResponseError}
|
|
126
|
+
* @throws {ApiClientError}
|
|
127
|
+
* @throws {ClientRequestError}
|
|
117
128
|
*/
|
|
118
129
|
queryExecute(config: {
|
|
119
130
|
body: ExecuteRequest;
|
|
@@ -158,7 +169,7 @@ export declare class QueryExecutionClient {
|
|
|
158
169
|
* It is guaranteed that every field of every record will have a corresponding type.
|
|
159
170
|
* **Clients should always take the included types into account when consuming records!**
|
|
160
171
|
*
|
|
161
|
-
* @returns The query already finished.
|
|
172
|
+
* @returns {Promise<QueryPollResponse | void>} The query already finished.
|
|
162
173
|
*
|
|
163
174
|
* @example <caption>Code example</caption>
|
|
164
175
|
* import { queryExecutionClient } from "@dynatrace-sdk/client-query";
|
|
@@ -166,6 +177,11 @@ export declare class QueryExecutionClient {
|
|
|
166
177
|
* const data = await queryExecutionClient.queryCancel({
|
|
167
178
|
* requestToken: "...",
|
|
168
179
|
* });
|
|
180
|
+
*
|
|
181
|
+
* @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | An internal server error has occurred.
|
|
182
|
+
* @throws {InvalidResponseError}
|
|
183
|
+
* @throws {ApiClientError}
|
|
184
|
+
* @throws {ClientRequestError}
|
|
169
185
|
*/
|
|
170
186
|
queryCancel(config: {
|
|
171
187
|
/** The request-token of the query. */ requestToken: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ErrorEnvelope
|
|
3
3
|
*/
|
|
4
|
-
import { ClientRequestError } from '
|
|
4
|
+
import { ClientRequestError } from '@dynatrace-sdk/shared-errors';
|
|
5
5
|
import { ErrorEnvelope } from '../models';
|
|
6
6
|
export declare class ErrorEnvelopeError extends ClientRequestError<ErrorEnvelope> {
|
|
7
7
|
readonly isErrorEnvelopeError = true;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { isClientRequestError } from '
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { isErrorEnvelopeError } from './error-envelope-error';
|
|
1
|
+
export { ApiClientError, ApiGatewayError, ClientRequestError, InvalidResponseError, isApiClientError, isApiGatewayError, isClientRequestError, isInvalidResponseError, } from '@dynatrace-sdk/shared-errors';
|
|
2
|
+
export { ErrorEnvelopeError, isErrorEnvelopeError } from './error-envelope-error';
|
|
3
|
+
export { InsufficientPermission, isInsufficientPermission } from './responses/insufficient-permission';
|
package/types/packages/client/query/src/lib/error-envelopes/responses/insufficient-permission.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ErrorEnvelope
|
|
3
|
+
*/
|
|
4
|
+
import { ErrorEnvelopeError } from '../error-envelope-error';
|
|
5
|
+
export declare class InsufficientPermission extends ErrorEnvelopeError {
|
|
6
|
+
readonly isInsufficientPermission = true;
|
|
7
|
+
readonly name = "InsufficientPermission";
|
|
8
|
+
}
|
|
9
|
+
export declare function isInsufficientPermission(e: any): e is InsufficientPermission;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { TokenType } from './token-type';
|
|
2
1
|
/**
|
|
3
2
|
* Part of the suggestion.
|
|
4
3
|
*/
|
|
5
4
|
export interface AutocompleteSuggestionPart {
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The type of the autocomplete token.
|
|
7
|
+
*/
|
|
8
|
+
type: 'SPACE' | 'LINEBREAK' | 'INDENT' | 'PIPE' | 'DOT' | 'COLON' | 'COMMA' | 'ASSIGNMENT' | 'BRACE_OPEN' | 'BRACE_CLOSE' | 'BRACKET_OPEN' | 'BRACKET_CLOSE' | 'PARENTHESIS_OPEN' | 'PARENTHESIS_CLOSE' | 'QUOTE' | 'SINGLE_QUOTE' | 'SLASH' | 'BOOLEAN_TRUE' | 'BOOLEAN_FALSE' | 'NULL' | 'COMMAND_NAME' | 'PARAMETER_KEY' | 'PARAMETER_VALUE_SCOPE' | 'FUNCTION_NAME' | 'TIMESERIES_AGGREGATION' | 'TIMESERIES_AGGREGATION_EXPRESSION' | 'OPERATOR' | 'TRAVERSAL_OPERATOR' | 'TRAVERSAL_RELATION_NAME' | 'TRAVERSAL_HOP_COUNT' | 'SIMPLE_IDENTIFIER' | 'DATA_OBJECT' | 'NUMBER' | 'STRING' | 'TIME_UNIT' | 'TIMESTAMP_VALUE' | 'METRIC_KEY' | 'VARIABLE' | 'END_COMMENT' | 'UID_VALUE' | 'PARSE_PATTERN' | 'FIELD_PATTERN' | 'ENTITY_SELECTOR_PART' | 'FIELD_MODIFIER' | 'ENTITY_TYPE' | 'ENTITY_ATTRIBUTE' | 'SMARTSCAPE_ID_VALUE';
|
|
7
9
|
/**
|
|
8
10
|
* The type of the suggestion.
|
|
9
11
|
*/
|
|
@@ -6,7 +6,7 @@ export interface DQLContainerNode extends DQLNode {
|
|
|
6
6
|
/**
|
|
7
7
|
* The type of the node.
|
|
8
8
|
*/
|
|
9
|
-
type?:
|
|
9
|
+
type?: 'QUERY' | 'EXECUTION_BLOCK' | 'COMMAND' | 'COMMAND_SEPARATOR' | 'PARAMETER_WITH_KEY' | 'GROUP' | 'PARAMETERS' | 'PARAMETER_NAMING' | 'PARAMETER_ASSIGNMENT' | 'PARAMETER_SEPARATOR' | 'FUNCTION' | 'FUNCTION_PART' | 'EXPRESSION' | 'IDENTIFIER' | 'SOURCE_ID' | 'DURATION' | 'TIMESTAMP' | 'TIMEFRAME' | 'TRAVERSAL_PATH' | 'TRAVERSAL_STEP';
|
|
10
10
|
/**
|
|
11
11
|
* The list of children nodes.
|
|
12
12
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DQLContainerNode } from './dql-container-node';
|
|
2
2
|
import * as _DQLNodeTransformation from './dql-node.transformation';
|
|
3
3
|
export interface AsJson extends _DQLNodeTransformation.AsJson {
|
|
4
|
-
type?:
|
|
4
|
+
type?: 'QUERY' | 'EXECUTION_BLOCK' | 'COMMAND' | 'COMMAND_SEPARATOR' | 'PARAMETER_WITH_KEY' | 'GROUP' | 'PARAMETERS' | 'PARAMETER_NAMING' | 'PARAMETER_ASSIGNMENT' | 'PARAMETER_SEPARATOR' | 'FUNCTION' | 'FUNCTION_PART' | 'EXPRESSION' | 'IDENTIFIER' | 'SOURCE_ID' | 'DURATION' | 'TIMESTAMP' | 'TIMEFRAME' | 'TRAVERSAL_PATH' | 'TRAVERSAL_STEP';
|
|
5
5
|
children?: _DQLNodeTransformation.AsJson[];
|
|
6
6
|
}
|
|
7
7
|
export declare function isDqlContainerNode(value: any): value is DQLContainerNode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { DQLNodeNodeType } from './dql-node-node-type';
|
|
2
1
|
export type AsJson = string;
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function isTerminalContainerAlternative(value: any): value is 'TERMINAL' | 'CONTAINER' | 'ALTERNATIVE';
|
|
4
3
|
export declare function isJson(value: any): value is AsJson;
|
|
5
|
-
export declare function fromJson($model: AsJson):
|
|
6
|
-
export declare function toJson($model:
|
|
4
|
+
export declare function fromJson($model: AsJson): 'TERMINAL' | 'CONTAINER' | 'ALTERNATIVE';
|
|
5
|
+
export declare function toJson($model: 'TERMINAL' | 'CONTAINER' | 'ALTERNATIVE'): AsJson;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { DQLNodeNodeType } from './dql-node-node-type';
|
|
2
1
|
import { TokenPosition } from './token-position';
|
|
3
2
|
/**
|
|
4
3
|
* General Node in the DQL query.
|
|
5
4
|
*/
|
|
6
5
|
export interface DQLNode {
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The type of the node.
|
|
8
|
+
*/
|
|
9
|
+
nodeType: 'TERMINAL' | 'CONTAINER' | 'ALTERNATIVE';
|
|
10
|
+
/**
|
|
11
|
+
* The position of a token in a query string used for errors and notification to map the message to a specific part of the query.
|
|
12
|
+
*/
|
|
8
13
|
tokenPosition?: TokenPosition;
|
|
9
14
|
/**
|
|
10
15
|
* True if the node is optional.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { DQLNode } from './dql-node';
|
|
2
|
-
import { TokenType } from './token-type';
|
|
3
2
|
/**
|
|
4
3
|
* Node that represents single token.
|
|
5
4
|
*/
|
|
6
5
|
export interface DQLTerminalNode extends DQLNode {
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The type of the autocomplete token.
|
|
8
|
+
*/
|
|
9
|
+
type?: 'SPACE' | 'LINEBREAK' | 'INDENT' | 'PIPE' | 'DOT' | 'COLON' | 'COMMA' | 'ASSIGNMENT' | 'BRACE_OPEN' | 'BRACE_CLOSE' | 'BRACKET_OPEN' | 'BRACKET_CLOSE' | 'PARENTHESIS_OPEN' | 'PARENTHESIS_CLOSE' | 'QUOTE' | 'SINGLE_QUOTE' | 'SLASH' | 'BOOLEAN_TRUE' | 'BOOLEAN_FALSE' | 'NULL' | 'COMMAND_NAME' | 'PARAMETER_KEY' | 'PARAMETER_VALUE_SCOPE' | 'FUNCTION_NAME' | 'TIMESERIES_AGGREGATION' | 'TIMESERIES_AGGREGATION_EXPRESSION' | 'OPERATOR' | 'TRAVERSAL_OPERATOR' | 'TRAVERSAL_RELATION_NAME' | 'TRAVERSAL_HOP_COUNT' | 'SIMPLE_IDENTIFIER' | 'DATA_OBJECT' | 'NUMBER' | 'STRING' | 'TIME_UNIT' | 'TIMESTAMP_VALUE' | 'METRIC_KEY' | 'VARIABLE' | 'END_COMMENT' | 'UID_VALUE' | 'PARSE_PATTERN' | 'FIELD_PATTERN' | 'ENTITY_SELECTOR_PART' | 'FIELD_MODIFIER' | 'ENTITY_TYPE' | 'ENTITY_ATTRIBUTE' | 'SMARTSCAPE_ID_VALUE';
|
|
8
10
|
/**
|
|
9
11
|
* For optional items only: whether this node becomes mandatory when user order is used. True only for some optional 'ghost braces'
|
|
10
12
|
*/
|
|
@@ -8,6 +8,9 @@ export interface ErrorResponseDetails {
|
|
|
8
8
|
* The exception type.
|
|
9
9
|
*/
|
|
10
10
|
exceptionType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The position of a token in a query string used for errors and notification to map the message to a specific part of the query.
|
|
13
|
+
*/
|
|
11
14
|
syntaxErrorPosition?: TokenPosition;
|
|
12
15
|
/**
|
|
13
16
|
* The error type, e.g. COMMAND_NAME_MISSING
|
|
@@ -7,6 +7,9 @@ export interface ErrorResponse {
|
|
|
7
7
|
* A short, clear error message without details
|
|
8
8
|
*/
|
|
9
9
|
message: string;
|
|
10
|
+
/**
|
|
11
|
+
* Detailed information about the error.
|
|
12
|
+
*/
|
|
10
13
|
details?: ErrorResponseDetails;
|
|
11
14
|
/**
|
|
12
15
|
* Error code, which normally matches the HTTP error code.
|
|
@@ -49,6 +49,12 @@ export interface ExecuteRequest {
|
|
|
49
49
|
* Limit in gigabytes for the amount data that will be scanned during read.
|
|
50
50
|
*/
|
|
51
51
|
defaultScanLimitGbytes?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Query options enhance query functionality for Dynatrace internal services.
|
|
54
|
+
*/
|
|
52
55
|
queryOptions?: QueryOptions;
|
|
56
|
+
/**
|
|
57
|
+
* Represents a collection of filter segments.
|
|
58
|
+
*/
|
|
53
59
|
filterSegments?: FilterSegments;
|
|
54
60
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use literal values.
|
|
3
|
+
*/
|
|
1
4
|
export declare enum FieldTypeType {
|
|
2
5
|
Boolean = "boolean",
|
|
3
6
|
String = "string",
|
|
@@ -12,5 +15,6 @@ export declare enum FieldTypeType {
|
|
|
12
15
|
Array = "array",
|
|
13
16
|
Record = "record",
|
|
14
17
|
Uid = "uid",
|
|
18
|
+
SmartscapeId = "smartscape_id",
|
|
15
19
|
Undefined = "undefined"
|
|
16
20
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { FieldTypeType } from './field-type-type';
|
|
2
1
|
export type AsJson = string;
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function isBooleanStringDoubleLongTimestampTimeframeDurationBinaryIpAddressGeoPointArrayRecordUidSmartscapeIdUndefined(value: any): value is 'boolean' | 'string' | 'double' | 'long' | 'timestamp' | 'timeframe' | 'duration' | 'binary' | 'ip_address' | 'geo_point' | 'array' | 'record' | 'uid' | 'smartscape_id' | 'undefined';
|
|
4
3
|
export declare function isJson(value: any): value is AsJson;
|
|
5
|
-
export declare function fromJson($model: AsJson):
|
|
6
|
-
export declare function toJson($model:
|
|
4
|
+
export declare function fromJson($model: AsJson): 'boolean' | 'string' | 'double' | 'long' | 'timestamp' | 'timeframe' | 'duration' | 'binary' | 'ip_address' | 'geo_point' | 'array' | 'record' | 'uid' | 'smartscape_id' | 'undefined';
|
|
5
|
+
export declare function toJson($model: 'boolean' | 'string' | 'double' | 'long' | 'timestamp' | 'timeframe' | 'duration' | 'binary' | 'ip_address' | 'geo_point' | 'array' | 'record' | 'uid' | 'smartscape_id' | 'undefined'): AsJson;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { FieldTypeType } from './field-type-type';
|
|
2
1
|
import { RangedFieldTypes } from './ranged-field-types';
|
|
3
2
|
/**
|
|
4
3
|
* The possible type of a field in DQL.
|
|
5
4
|
*/
|
|
6
5
|
export interface FieldType {
|
|
7
|
-
type:
|
|
6
|
+
type: 'boolean' | 'string' | 'double' | 'long' | 'timestamp' | 'timeframe' | 'duration' | 'binary' | 'ip_address' | 'geo_point' | 'array' | 'record' | 'uid' | 'smartscape_id' | 'undefined';
|
|
8
7
|
types?: RangedFieldTypes[];
|
|
9
8
|
}
|
|
@@ -11,6 +11,9 @@ export interface MetadataNotification {
|
|
|
11
11
|
* The message format of the notification, string.format based
|
|
12
12
|
*/
|
|
13
13
|
messageFormat?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The position of a token in a query string used for errors and notification to map the message to a specific part of the query.
|
|
16
|
+
*/
|
|
14
17
|
syntaxPosition?: TokenPosition;
|
|
15
18
|
/**
|
|
16
19
|
* The corresponding DQL format specifier types for each format specifier used in the error message format.
|
|
@@ -12,5 +12,8 @@ export interface ParseRequest {
|
|
|
12
12
|
* The query locale. If none specified, then a language/country neutral locale is chosen. The input values take the ISO-639 Language code with an optional ISO-3166 country code appended to it with an underscore. For instance, both values are valid 'en' or 'en_US'.
|
|
13
13
|
*/
|
|
14
14
|
locale?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Query options enhance query functionality for Dynatrace internal services.
|
|
17
|
+
*/
|
|
15
18
|
queryOptions?: QueryOptions;
|
|
16
19
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { QueryResult } from './query-result';
|
|
2
|
-
import { QueryState } from './query-state';
|
|
3
2
|
/**
|
|
4
3
|
* The response of GET query:execute call.
|
|
5
4
|
*/
|
|
6
5
|
export interface QueryPollResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The result of the DQL query.
|
|
8
|
+
*/
|
|
7
9
|
result?: QueryResult;
|
|
8
10
|
/**
|
|
9
11
|
* Time to live in seconds.
|
|
@@ -13,5 +15,8 @@ export interface QueryPollResponse {
|
|
|
13
15
|
* The progress of the query from 0 to 100.
|
|
14
16
|
*/
|
|
15
17
|
progress?: number;
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Possible state of the query.
|
|
20
|
+
*/
|
|
21
|
+
state: 'NOT_STARTED' | 'RUNNING' | 'SUCCEEDED' | 'RESULT_GONE' | 'CANCELLED' | 'FAILED';
|
|
17
22
|
}
|
|
@@ -9,6 +9,9 @@ export interface QueryResult {
|
|
|
9
9
|
* List of records containing the result fields data.
|
|
10
10
|
*/
|
|
11
11
|
records: (ResultRecord | null)[];
|
|
12
|
+
/**
|
|
13
|
+
* Collects various bits of metadata information.
|
|
14
|
+
*/
|
|
12
15
|
metadata: Metadata;
|
|
13
16
|
/**
|
|
14
17
|
* The data types for the result records.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { QueryResult } from './query-result';
|
|
2
|
-
import { QueryState } from './query-state';
|
|
3
2
|
/**
|
|
4
3
|
* The response when starting a query.
|
|
5
4
|
*/
|
|
6
5
|
export interface QueryStartResponse {
|
|
6
|
+
/**
|
|
7
|
+
* The result of the DQL query.
|
|
8
|
+
*/
|
|
7
9
|
result?: QueryResult;
|
|
8
10
|
/**
|
|
9
11
|
* Time to live in seconds.
|
|
@@ -17,5 +19,8 @@ export interface QueryStartResponse {
|
|
|
17
19
|
* The token returned by the POST query:execute call.
|
|
18
20
|
*/
|
|
19
21
|
requestToken?: string;
|
|
20
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Possible state of the query.
|
|
24
|
+
*/
|
|
25
|
+
state: 'NOT_STARTED' | 'RUNNING' | 'SUCCEEDED' | 'RESULT_GONE' | 'CANCELLED' | 'FAILED';
|
|
21
26
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { QueryState } from './query-state';
|
|
2
1
|
export type AsJson = string;
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function isNotStartedRunningSucceededResultGoneCancelledFailed(value: any): value is 'NOT_STARTED' | 'RUNNING' | 'SUCCEEDED' | 'RESULT_GONE' | 'CANCELLED' | 'FAILED';
|
|
4
3
|
export declare function isJson(value: any): value is AsJson;
|
|
5
|
-
export declare function fromJson($model: AsJson):
|
|
6
|
-
export declare function toJson($model:
|
|
4
|
+
export declare function fromJson($model: AsJson): 'NOT_STARTED' | 'RUNNING' | 'SUCCEEDED' | 'RESULT_GONE' | 'CANCELLED' | 'FAILED';
|
|
5
|
+
export declare function toJson($model: 'NOT_STARTED' | 'RUNNING' | 'SUCCEEDED' | 'RESULT_GONE' | 'CANCELLED' | 'FAILED'): AsJson;
|
|
@@ -3,6 +3,9 @@ import { RangedFieldTypesMappings } from './ranged-field-types-mappings';
|
|
|
3
3
|
* The field type in range.
|
|
4
4
|
*/
|
|
5
5
|
export interface RangedFieldTypes {
|
|
6
|
+
/**
|
|
7
|
+
* The mapping between the field name and data type.
|
|
8
|
+
*/
|
|
6
9
|
mappings: RangedFieldTypesMappings;
|
|
7
10
|
/**
|
|
8
11
|
* The range of elements at use this type in arrays (null for records).
|
|
@@ -3,6 +3,12 @@ import { PositionInfo } from './position-info';
|
|
|
3
3
|
* The position of a token in a query string used for errors and notification to map the message to a specific part of the query.
|
|
4
4
|
*/
|
|
5
5
|
export interface TokenPosition {
|
|
6
|
+
/**
|
|
7
|
+
* The exact position in the query string.
|
|
8
|
+
*/
|
|
6
9
|
start: PositionInfo;
|
|
10
|
+
/**
|
|
11
|
+
* The exact position in the query string.
|
|
12
|
+
*/
|
|
7
13
|
end: PositionInfo;
|
|
8
14
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The type of the autocomplete token.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Use literal values.
|
|
3
5
|
*/
|
|
4
6
|
export declare enum TokenType {
|
|
5
7
|
Space = "SPACE",
|
|
@@ -47,5 +49,6 @@ export declare enum TokenType {
|
|
|
47
49
|
EntitySelectorPart = "ENTITY_SELECTOR_PART",
|
|
48
50
|
FieldModifier = "FIELD_MODIFIER",
|
|
49
51
|
EntityType = "ENTITY_TYPE",
|
|
50
|
-
EntityAttribute = "ENTITY_ATTRIBUTE"
|
|
52
|
+
EntityAttribute = "ENTITY_ATTRIBUTE",
|
|
53
|
+
SmartscapeIdValue = "SMARTSCAPE_ID_VALUE"
|
|
51
54
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { TokenType } from './token-type';
|
|
2
1
|
export type AsJson = string;
|
|
3
|
-
export declare function
|
|
2
|
+
export declare function isSpaceLinebreakIndentPipeDotColonCommaAssignmentBraceOpenBraceCloseBracketOpenBracketCloseParenthesisOpenParenthesisCloseQuoteSingleQuoteSlashBooleanTrueBooleanFalseNullCommandNameParameterKeyParameterValueScopeFunctionNameTimeseriesAggregationTimeseriesAggregationExpressionOperatorTraversalOperatorTraversalRelationNameTraversalHopCountSimpleIdentifierDataObjectNumberStringTimeUnitTimestampValueMetricKeyVariableEndCommentUidValueParsePatternFieldPatternEntitySelectorPartFieldModifierEntityTypeEntityAttributeSmartscapeIdValue(value: any): value is 'SPACE' | 'LINEBREAK' | 'INDENT' | 'PIPE' | 'DOT' | 'COLON' | 'COMMA' | 'ASSIGNMENT' | 'BRACE_OPEN' | 'BRACE_CLOSE' | 'BRACKET_OPEN' | 'BRACKET_CLOSE' | 'PARENTHESIS_OPEN' | 'PARENTHESIS_CLOSE' | 'QUOTE' | 'SINGLE_QUOTE' | 'SLASH' | 'BOOLEAN_TRUE' | 'BOOLEAN_FALSE' | 'NULL' | 'COMMAND_NAME' | 'PARAMETER_KEY' | 'PARAMETER_VALUE_SCOPE' | 'FUNCTION_NAME' | 'TIMESERIES_AGGREGATION' | 'TIMESERIES_AGGREGATION_EXPRESSION' | 'OPERATOR' | 'TRAVERSAL_OPERATOR' | 'TRAVERSAL_RELATION_NAME' | 'TRAVERSAL_HOP_COUNT' | 'SIMPLE_IDENTIFIER' | 'DATA_OBJECT' | 'NUMBER' | 'STRING' | 'TIME_UNIT' | 'TIMESTAMP_VALUE' | 'METRIC_KEY' | 'VARIABLE' | 'END_COMMENT' | 'UID_VALUE' | 'PARSE_PATTERN' | 'FIELD_PATTERN' | 'ENTITY_SELECTOR_PART' | 'FIELD_MODIFIER' | 'ENTITY_TYPE' | 'ENTITY_ATTRIBUTE' | 'SMARTSCAPE_ID_VALUE';
|
|
4
3
|
export declare function isJson(value: any): value is AsJson;
|
|
5
|
-
export declare function fromJson($model: AsJson):
|
|
6
|
-
export declare function toJson($model:
|
|
4
|
+
export declare function fromJson($model: AsJson): 'SPACE' | 'LINEBREAK' | 'INDENT' | 'PIPE' | 'DOT' | 'COLON' | 'COMMA' | 'ASSIGNMENT' | 'BRACE_OPEN' | 'BRACE_CLOSE' | 'BRACKET_OPEN' | 'BRACKET_CLOSE' | 'PARENTHESIS_OPEN' | 'PARENTHESIS_CLOSE' | 'QUOTE' | 'SINGLE_QUOTE' | 'SLASH' | 'BOOLEAN_TRUE' | 'BOOLEAN_FALSE' | 'NULL' | 'COMMAND_NAME' | 'PARAMETER_KEY' | 'PARAMETER_VALUE_SCOPE' | 'FUNCTION_NAME' | 'TIMESERIES_AGGREGATION' | 'TIMESERIES_AGGREGATION_EXPRESSION' | 'OPERATOR' | 'TRAVERSAL_OPERATOR' | 'TRAVERSAL_RELATION_NAME' | 'TRAVERSAL_HOP_COUNT' | 'SIMPLE_IDENTIFIER' | 'DATA_OBJECT' | 'NUMBER' | 'STRING' | 'TIME_UNIT' | 'TIMESTAMP_VALUE' | 'METRIC_KEY' | 'VARIABLE' | 'END_COMMENT' | 'UID_VALUE' | 'PARSE_PATTERN' | 'FIELD_PATTERN' | 'ENTITY_SELECTOR_PART' | 'FIELD_MODIFIER' | 'ENTITY_TYPE' | 'ENTITY_ATTRIBUTE' | 'SMARTSCAPE_ID_VALUE';
|
|
5
|
+
export declare function toJson($model: 'SPACE' | 'LINEBREAK' | 'INDENT' | 'PIPE' | 'DOT' | 'COLON' | 'COMMA' | 'ASSIGNMENT' | 'BRACE_OPEN' | 'BRACE_CLOSE' | 'BRACKET_OPEN' | 'BRACKET_CLOSE' | 'PARENTHESIS_OPEN' | 'PARENTHESIS_CLOSE' | 'QUOTE' | 'SINGLE_QUOTE' | 'SLASH' | 'BOOLEAN_TRUE' | 'BOOLEAN_FALSE' | 'NULL' | 'COMMAND_NAME' | 'PARAMETER_KEY' | 'PARAMETER_VALUE_SCOPE' | 'FUNCTION_NAME' | 'TIMESERIES_AGGREGATION' | 'TIMESERIES_AGGREGATION_EXPRESSION' | 'OPERATOR' | 'TRAVERSAL_OPERATOR' | 'TRAVERSAL_RELATION_NAME' | 'TRAVERSAL_HOP_COUNT' | 'SIMPLE_IDENTIFIER' | 'DATA_OBJECT' | 'NUMBER' | 'STRING' | 'TIME_UNIT' | 'TIMESTAMP_VALUE' | 'METRIC_KEY' | 'VARIABLE' | 'END_COMMENT' | 'UID_VALUE' | 'PARSE_PATTERN' | 'FIELD_PATTERN' | 'ENTITY_SELECTOR_PART' | 'FIELD_MODIFIER' | 'ENTITY_TYPE' | 'ENTITY_ATTRIBUTE' | 'SMARTSCAPE_ID_VALUE'): AsJson;
|
|
@@ -12,6 +12,9 @@ export interface VerifyRequest {
|
|
|
12
12
|
* The query locale. If none specified, then a language/country neutral locale is chosen. The input values take the ISO-639 Language code with an optional ISO-3166 country code appended to it with an underscore. For instance, both values are valid 'en' or 'en_US'.
|
|
13
13
|
*/
|
|
14
14
|
locale?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Query options enhance query functionality for Dynatrace internal services.
|
|
17
|
+
*/
|
|
15
18
|
queryOptions?: QueryOptions;
|
|
16
19
|
generateCanonicalQuery?: boolean;
|
|
17
20
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available formats to transform models to and from
|
|
3
|
+
*/
|
|
4
|
+
export declare enum Encoding {
|
|
5
|
+
Json = "json",
|
|
6
|
+
Text = "text",
|
|
7
|
+
Binary = "binary",
|
|
8
|
+
FormData = "form-data"
|
|
9
|
+
}
|
|
10
|
+
export declare function mimeTypeToEncoding(mimeType: string, defaultEncoding?: Encoding): Encoding;
|
|
@@ -8,8 +8,8 @@ export interface Binary {
|
|
|
8
8
|
*
|
|
9
9
|
* @param type The type of the data.
|
|
10
10
|
* Can be `text`, `json`, `array-buffer`, `blob`, `readable-stream`, `buffer` or `stream`.
|
|
11
|
-
* @throws DataTypeError
|
|
12
|
-
* @throws UnsupportedOperationError
|
|
11
|
+
* @throws {DataTypeError} Data does not conform to the specified type.
|
|
12
|
+
* @throws {UnsupportedOperationError} Type is not supported by the platform.
|
|
13
13
|
*/
|
|
14
14
|
get<T extends keyof DataTypes>(type: T): DataTypes[T];
|
|
15
15
|
}
|
|
@@ -26,8 +26,8 @@ export interface HttpClientResponse {
|
|
|
26
26
|
* @param responseBodyType The type of the response body.
|
|
27
27
|
* Can be `text`, `json`, `binary`, `form-data`, `array-buffer`, `blob`, `readable-stream`, `buffer` or `stream`.
|
|
28
28
|
* The default response body type is `json`.
|
|
29
|
-
* @throws DataTypeError
|
|
30
|
-
* @throws UnsupportedOperationError
|
|
29
|
+
* @throws {DataTypeError} Response body does not conform to the specified response body type.
|
|
30
|
+
* @throws {UnsupportedOperationError} Response body type is not supported by the platform.
|
|
31
31
|
*/
|
|
32
32
|
body<T extends keyof ResponseBodyTypes = 'json'>(responseBodyType?: T): ResponseBodyTypes[T];
|
|
33
33
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ErrorType } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Base error for all client SDKs. All other errors extend this class.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ApiClientError extends Error {
|
|
6
|
+
readonly cause?: any;
|
|
7
|
+
readonly isApiClientError = true;
|
|
8
|
+
errorType: ErrorType;
|
|
9
|
+
constructor(name: string, message?: string, cause?: any);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* ApiClientError type guard function.
|
|
13
|
+
* Does a structural check of the passed object.
|
|
14
|
+
* @example
|
|
15
|
+
* try {
|
|
16
|
+
* doSomething();
|
|
17
|
+
* } catch (e: unknown) {
|
|
18
|
+
* if(isApiClientError(e)) {
|
|
19
|
+
* handleTheError();
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
export declare function isApiClientError(e: any): e is ApiClientError;
|