@dynatrace-sdk/client-query 1.15.0 → 1.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +111 -168
  3. package/cjs/index.js +581 -3316
  4. package/dynatrace-metadata.json +2 -2
  5. package/esm/index.js +557 -3292
  6. package/package.json +2 -2
  7. package/types/packages/client/query/src/lib/apis/query-assistance-api.d.ts +6 -9
  8. package/types/packages/client/query/src/lib/apis/query-execution-api.d.ts +6 -13
  9. package/types/packages/client/query/src/lib/error-envelopes/index.d.ts +3 -3
  10. package/types/packages/client/query/src/lib/models/autocomplete-request.d.ts +3 -0
  11. package/types/packages/client/query/src/lib/models/autocomplete-suggestion-part.d.ts +4 -2
  12. package/types/packages/client/query/src/lib/models/dql-container-node.d.ts +1 -1
  13. package/types/packages/client/query/src/lib/models/dql-node-node-type.d.ts +2 -0
  14. package/types/packages/client/query/src/lib/models/dql-node.d.ts +7 -2
  15. package/types/packages/client/query/src/lib/models/dql-terminal-node.d.ts +4 -2
  16. package/types/packages/client/query/src/lib/models/error-envelope.d.ts +3 -0
  17. package/types/packages/client/query/src/lib/models/error-response-details.d.ts +3 -0
  18. package/types/packages/client/query/src/lib/models/error-response.d.ts +3 -0
  19. package/types/packages/client/query/src/lib/models/execute-request.d.ts +6 -0
  20. package/types/packages/client/query/src/lib/models/field-type-type.d.ts +3 -0
  21. package/types/packages/client/query/src/lib/models/field-type.d.ts +1 -2
  22. package/types/packages/client/query/src/lib/models/grail-metadata.d.ts +3 -0
  23. package/types/packages/client/query/src/lib/models/index.d.ts +0 -40
  24. package/types/packages/client/query/src/lib/models/metadata-notification.d.ts +3 -0
  25. package/types/packages/client/query/src/lib/models/metadata.d.ts +3 -0
  26. package/types/packages/client/query/src/lib/models/parse-request.d.ts +3 -0
  27. package/types/packages/client/query/src/lib/models/query-poll-response.d.ts +7 -2
  28. package/types/packages/client/query/src/lib/models/query-result.d.ts +3 -0
  29. package/types/packages/client/query/src/lib/models/query-start-response.d.ts +7 -2
  30. package/types/packages/client/query/src/lib/models/query-state.d.ts +2 -0
  31. package/types/packages/client/query/src/lib/models/ranged-field-types.d.ts +3 -0
  32. package/types/packages/client/query/src/lib/models/token-position.d.ts +6 -0
  33. package/types/packages/client/query/src/lib/models/token-type.d.ts +2 -0
  34. package/types/packages/client/query/src/lib/models/verify-request.d.ts +3 -0
  35. package/types/packages/client/query/src/lib/utils/encoding.d.ts +10 -0
  36. package/types/packages/client/query/src/lib/utils/transformations.d.ts +6 -0
  37. package/types/packages/http-client/src/lib/types/binary.d.ts +2 -2
  38. package/types/packages/http-client/src/lib/types/http-client-response.d.ts +2 -2
  39. package/types/packages/shared-errors/src/api-client-error.d.ts +13 -1
  40. package/types/packages/shared-errors/src/api-gateway-error.d.ts +19 -0
  41. package/types/packages/shared-errors/src/client-request-error.d.ts +29 -0
  42. package/types/packages/shared-errors/src/index.d.ts +0 -1
  43. package/types/packages/shared-errors/src/invalid-response-error.d.ts +18 -1
  44. package/types/packages/shared-errors/src/types.d.ts +62 -5
  45. package/types/packages/client/query/src/lib/error-envelopes/error-serializer.d.ts +0 -3
  46. package/types/packages/client/query/src/lib/models/autocomplete-request.transformation.d.ts +0 -14
  47. package/types/packages/client/query/src/lib/models/autocomplete-response.transformation.d.ts +0 -11
  48. package/types/packages/client/query/src/lib/models/autocomplete-suggestion-part.transformation.d.ts +0 -12
  49. package/types/packages/client/query/src/lib/models/autocomplete-suggestion.transformation.d.ts +0 -11
  50. package/types/packages/client/query/src/lib/models/dql-alternative-node.transformation.d.ts +0 -9
  51. package/types/packages/client/query/src/lib/models/dql-container-node.transformation.d.ts +0 -10
  52. package/types/packages/client/query/src/lib/models/dql-node-node-type.transformation.d.ts +0 -6
  53. package/types/packages/client/query/src/lib/models/dql-node.transformation.d.ts +0 -17
  54. package/types/packages/client/query/src/lib/models/dql-terminal-node.transformation.d.ts +0 -12
  55. package/types/packages/client/query/src/lib/models/error-envelope.transformation.d.ts +0 -12
  56. package/types/packages/client/query/src/lib/models/error-response-details-constraint-violations-item.transformation.d.ts +0 -10
  57. package/types/packages/client/query/src/lib/models/error-response-details.transformation.d.ts +0 -21
  58. package/types/packages/client/query/src/lib/models/error-response.transformation.d.ts +0 -11
  59. package/types/packages/client/query/src/lib/models/execute-request.transformation.d.ts +0 -23
  60. package/types/packages/client/query/src/lib/models/field-type-type.transformation.d.ts +0 -6
  61. package/types/packages/client/query/src/lib/models/field-type.transformation.d.ts +0 -11
  62. package/types/packages/client/query/src/lib/models/filter-segment-variable-definition.transformation.d.ts +0 -9
  63. package/types/packages/client/query/src/lib/models/filter-segment.transformation.d.ts +0 -10
  64. package/types/packages/client/query/src/lib/models/filter-segments.transformation.d.ts +0 -6
  65. package/types/packages/client/query/src/lib/models/geo-point.transformation.d.ts +0 -9
  66. package/types/packages/client/query/src/lib/models/grail-metadata.transformation.d.ts +0 -22
  67. package/types/packages/client/query/src/lib/models/metadata-notification.transformation.d.ts +0 -15
  68. package/types/packages/client/query/src/lib/models/metadata.transformation.d.ts +0 -11
  69. package/types/packages/client/query/src/lib/models/metric-metadata.transformation.d.ts +0 -15
  70. package/types/packages/client/query/src/lib/models/parse-request.transformation.d.ts +0 -12
  71. package/types/packages/client/query/src/lib/models/position-info.transformation.d.ts +0 -10
  72. package/types/packages/client/query/src/lib/models/query-options.transformation.d.ts +0 -8
  73. package/types/packages/client/query/src/lib/models/query-poll-response.transformation.d.ts +0 -13
  74. package/types/packages/client/query/src/lib/models/query-result.transformation.d.ts +0 -13
  75. package/types/packages/client/query/src/lib/models/query-start-response.transformation.d.ts +0 -14
  76. package/types/packages/client/query/src/lib/models/query-state.transformation.d.ts +0 -6
  77. package/types/packages/client/query/src/lib/models/ranged-field-types-mappings.transformation.d.ts +0 -9
  78. package/types/packages/client/query/src/lib/models/ranged-field-types.transformation.d.ts +0 -10
  79. package/types/packages/client/query/src/lib/models/result-record-value.transformation.d.ts +0 -26
  80. package/types/packages/client/query/src/lib/models/result-record.transformation.d.ts +0 -9
  81. package/types/packages/client/query/src/lib/models/timeframe.transformation.d.ts +0 -9
  82. package/types/packages/client/query/src/lib/models/token-position.transformation.d.ts +0 -13
  83. package/types/packages/client/query/src/lib/models/token-type.transformation.d.ts +0 -6
  84. package/types/packages/client/query/src/lib/models/verify-request.transformation.d.ts +0 -13
  85. package/types/packages/client/query/src/lib/models/verify-response.transformation.d.ts +0 -11
  86. package/types/packages/shared-errors/src/sdk-error.d.ts +0 -5
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dynatrace-sdk/client-query",
3
- "version": "1.15.0",
3
+ "version": "1.17.1",
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
8
  "@dynatrace-sdk/http-client": "^1.3.0",
9
- "@dynatrace-sdk/shared-errors": "^0.0.3"
9
+ "@dynatrace-sdk/shared-errors": "^1.0.0"
10
10
  },
11
11
  "main": "./cjs/index.js",
12
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";
@@ -38,8 +38,7 @@ export declare class QueryAssistanceClient {
38
38
  * },
39
39
  * });
40
40
  *
41
- * @throws {ErrorEnvelopeError} The supplied request is wrong.
42
- * @throws {ErrorEnvelopeError} An internal server error has occurred.
41
+ * @throws {ErrorEnvelopeError} The supplied request is wrong. | An internal server error has occurred.
43
42
  * @throws {InvalidResponseError}
44
43
  * @throws {ApiClientError}
45
44
  * @throws {ClientRequestError}
@@ -243,7 +242,7 @@ export declare class QueryAssistanceClient {
243
242
  * for `FILTER condition:a == 1`. This `condition:` was neither written by the user nor is it canonical; but it might be
244
243
  * used to help the user understand what this parameter means.
245
244
  *
246
- * @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.
247
246
  *
248
247
  * @example <caption>Code example</caption>
249
248
  * import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
@@ -255,8 +254,7 @@ export declare class QueryAssistanceClient {
255
254
  * },
256
255
  * });
257
256
  *
258
- * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong.
259
- * @throws {ErrorEnvelopeError} An internal server error has occurred.
257
+ * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | An internal server error has occurred.
260
258
  * @throws {InvalidResponseError}
261
259
  * @throws {ApiClientError}
262
260
  * @throws {ClientRequestError}
@@ -304,7 +302,7 @@ export declare class QueryAssistanceClient {
304
302
  * The `type` helps to treat specific parts of the suggestion different to others; either by a different visualization,
305
303
  * a link to docs, etc.
306
304
  *
307
- * @returns A list of structured autocomplete suggestions.
305
+ * @returns {Promise<AutocompleteResponse>} A list of structured autocomplete suggestions.
308
306
  *
309
307
  * @example <caption>Code example</caption>
310
308
  * import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
@@ -316,8 +314,7 @@ export declare class QueryAssistanceClient {
316
314
  * },
317
315
  * });
318
316
  *
319
- * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong.
320
- * @throws {ErrorEnvelopeError} An internal server error has occurred.
317
+ * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | An internal server error has occurred.
321
318
  * @throws {InvalidResponseError}
322
319
  * @throws {ApiClientError}
323
320
  * @throws {ClientRequestError}
@@ -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";
@@ -58,8 +58,7 @@ export declare class QueryExecutionClient {
58
58
  * requestToken: "...",
59
59
  * });
60
60
  *
61
- * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong.
62
- * @throws {ErrorEnvelopeError} An internal server error has occurred.
61
+ * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | An internal server error has occurred.
63
62
  * @throws {InvalidResponseError}
64
63
  * @throws {ApiClientError}
65
64
  * @throws {ClientRequestError}
@@ -109,7 +108,7 @@ export declare class QueryExecutionClient {
109
108
  * It is guaranteed that every field of every record will have a corresponding type.
110
109
  * **Clients should always take the included types into account when consuming records!**
111
110
  *
112
- * @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.
113
112
  *
114
113
  * @example <caption>Code example</caption>
115
114
  * import { queryExecutionClient } from "@dynatrace-sdk/client-query";
@@ -121,13 +120,8 @@ export declare class QueryExecutionClient {
121
120
  * },
122
121
  * });
123
122
  *
124
- * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong.
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.
125
124
  * @throws {InsufficientPermission} Insufficient permissions.
126
- * @throws {ErrorEnvelopeError} Too many requests.
127
- * @throws {ErrorEnvelopeError} An internal server error has occurred.
128
- * @throws {ErrorEnvelopeError} Service is unavailable.
129
- * @throws {ErrorEnvelopeError} Client error.
130
- * @throws {ErrorEnvelopeError} Server error.
131
125
  * @throws {InvalidResponseError}
132
126
  * @throws {ApiClientError}
133
127
  * @throws {ClientRequestError}
@@ -175,7 +169,7 @@ export declare class QueryExecutionClient {
175
169
  * It is guaranteed that every field of every record will have a corresponding type.
176
170
  * **Clients should always take the included types into account when consuming records!**
177
171
  *
178
- * @returns The query already finished.
172
+ * @returns {Promise<QueryPollResponse | void>} The query already finished.
179
173
  *
180
174
  * @example <caption>Code example</caption>
181
175
  * import { queryExecutionClient } from "@dynatrace-sdk/client-query";
@@ -184,8 +178,7 @@ export declare class QueryExecutionClient {
184
178
  * requestToken: "...",
185
179
  * });
186
180
  *
187
- * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong.
188
- * @throws {ErrorEnvelopeError} An internal server error has occurred.
181
+ * @throws {ErrorEnvelopeError} The supplied request is wrong. Either the query itself or other parameters are wrong. | An internal server error has occurred.
189
182
  * @throws {InvalidResponseError}
190
183
  * @throws {ApiClientError}
191
184
  * @throws {ClientRequestError}
@@ -1,3 +1,3 @@
1
- export { isApiClientError, isClientRequestError, isInvalidResponseError } from '@dynatrace-sdk/shared-errors';
2
- export { isErrorEnvelopeError } from './error-envelope-error';
3
- export { isInsufficientPermission } from './responses/insufficient-permission';
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';
@@ -14,5 +14,8 @@ export interface AutocompleteRequest {
14
14
  */
15
15
  locale?: string;
16
16
  maxDataSuggestions?: number;
17
+ /**
18
+ * Query options enhance query functionality for Dynatrace internal services.
19
+ */
17
20
  queryOptions?: QueryOptions;
18
21
  }
@@ -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
- type: TokenType;
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?: string;
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,5 +1,7 @@
1
1
  /**
2
2
  * The type of the node.
3
+ *
4
+ * @deprecated Use literal values.
3
5
  */
4
6
  export declare enum DQLNodeNodeType {
5
7
  Terminal = "TERMINAL",
@@ -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
- nodeType: DQLNodeNodeType;
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
- type?: TokenType;
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
  */
@@ -3,5 +3,8 @@ import { ErrorResponse } from './error-response';
3
3
  * An 'envelope' error object that has the mandatory error object.
4
4
  */
5
5
  export interface ErrorEnvelope {
6
+ /**
7
+ * The response for error state
8
+ */
6
9
  error: ErrorResponse;
7
10
  }
@@ -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",
@@ -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: FieldTypeType;
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
  }
@@ -29,6 +29,9 @@ export interface GrailMetadata {
29
29
  */
30
30
  scannedBytes?: number;
31
31
  scannedDataPoints?: number;
32
+ /**
33
+ * DQL data type timeframe.
34
+ */
32
35
  analysisTimeframe?: Timeframe;
33
36
  /**
34
37
  * Effective locale for the query.
@@ -1,80 +1,40 @@
1
1
  export * from './autocomplete-request';
2
- export * as _AutocompleteRequestTransformation from './autocomplete-request.transformation';
3
2
  export * from './autocomplete-response';
4
- export * as _AutocompleteResponseTransformation from './autocomplete-response.transformation';
5
3
  export * from './autocomplete-suggestion';
6
- export * as _AutocompleteSuggestionTransformation from './autocomplete-suggestion.transformation';
7
4
  export * from './autocomplete-suggestion-part';
8
- export * as _AutocompleteSuggestionPartTransformation from './autocomplete-suggestion-part.transformation';
9
5
  export * from './dql-alternative-node';
10
- export * as _DQLAlternativeNodeTransformation from './dql-alternative-node.transformation';
11
6
  export * from './dql-container-node';
12
- export * as _DQLContainerNodeTransformation from './dql-container-node.transformation';
13
7
  export * from './dql-node';
14
- export * as _DQLNodeTransformation from './dql-node.transformation';
15
8
  export * from './dql-node-node-type';
16
- export * as _DQLNodeNodeTypeTransformation from './dql-node-node-type.transformation';
17
9
  export * from './dql-terminal-node';
18
- export * as _DQLTerminalNodeTransformation from './dql-terminal-node.transformation';
19
10
  export * from './error-envelope';
20
- export * as _ErrorEnvelopeTransformation from './error-envelope.transformation';
21
11
  export * from './error-response';
22
- export * as _ErrorResponseTransformation from './error-response.transformation';
23
12
  export * from './error-response-details';
24
- export * as _ErrorResponseDetailsTransformation from './error-response-details.transformation';
25
13
  export * from './error-response-details-constraint-violations-item';
26
- export * as _ErrorResponseDetailsConstraintViolationsItemTransformation from './error-response-details-constraint-violations-item.transformation';
27
14
  export * from './execute-request';
28
- export * as _ExecuteRequestTransformation from './execute-request.transformation';
29
15
  export * from './field-type';
30
- export * as _FieldTypeTransformation from './field-type.transformation';
31
16
  export * from './field-type-type';
32
- export * as _FieldTypeTypeTransformation from './field-type-type.transformation';
33
17
  export * from './filter-segment';
34
- export * as _FilterSegmentTransformation from './filter-segment.transformation';
35
18
  export * from './filter-segment-variable-definition';
36
- export * as _FilterSegmentVariableDefinitionTransformation from './filter-segment-variable-definition.transformation';
37
19
  export * from './filter-segments';
38
- export * as _FilterSegmentsTransformation from './filter-segments.transformation';
39
20
  export * from './geo-point';
40
- export * as _GeoPointTransformation from './geo-point.transformation';
41
21
  export * from './grail-metadata';
42
- export * as _GrailMetadataTransformation from './grail-metadata.transformation';
43
22
  export * from './metadata';
44
- export * as _MetadataTransformation from './metadata.transformation';
45
23
  export * from './metadata-notification';
46
- export * as _MetadataNotificationTransformation from './metadata-notification.transformation';
47
24
  export * from './metric-metadata';
48
- export * as _MetricMetadataTransformation from './metric-metadata.transformation';
49
25
  export * from './parse-request';
50
- export * as _ParseRequestTransformation from './parse-request.transformation';
51
26
  export * from './position-info';
52
- export * as _PositionInfoTransformation from './position-info.transformation';
53
27
  export * from './query-options';
54
- export * as _QueryOptionsTransformation from './query-options.transformation';
55
28
  export * from './query-poll-response';
56
- export * as _QueryPollResponseTransformation from './query-poll-response.transformation';
57
29
  export * from './query-result';
58
- export * as _QueryResultTransformation from './query-result.transformation';
59
30
  export * from './query-start-response';
60
- export * as _QueryStartResponseTransformation from './query-start-response.transformation';
61
31
  export * from './query-state';
62
- export * as _QueryStateTransformation from './query-state.transformation';
63
32
  export * from './ranged-field-types';
64
- export * as _RangedFieldTypesTransformation from './ranged-field-types.transformation';
65
33
  export * from './ranged-field-types-mappings';
66
- export * as _RangedFieldTypesMappingsTransformation from './ranged-field-types-mappings.transformation';
67
34
  export * from './result-record';
68
- export * as _ResultRecordTransformation from './result-record.transformation';
69
35
  export * from './result-record-value';
70
- export * as _ResultRecordValueTransformation from './result-record-value.transformation';
71
36
  export * from './timeframe';
72
- export * as _TimeframeTransformation from './timeframe.transformation';
73
37
  export * from './token-position';
74
- export * as _TokenPositionTransformation from './token-position.transformation';
75
38
  export * from './token-type';
76
- export * as _TokenTypeTransformation from './token-type.transformation';
77
39
  export * from './verify-request';
78
- export * as _VerifyRequestTransformation from './verify-request.transformation';
79
40
  export * from './verify-response';
80
- export * as _VerifyResponseTransformation from './verify-response.transformation';
@@ -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.
@@ -4,6 +4,9 @@ import { MetricMetadata } from './metric-metadata';
4
4
  * Collects various bits of metadata information.
5
5
  */
6
6
  export interface Metadata {
7
+ /**
8
+ * Collects various bits of metadata information.
9
+ */
7
10
  grail?: GrailMetadata;
8
11
  metrics?: MetricMetadata[];
9
12
  }
@@ -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
- state: QueryState;
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
- state: QueryState;
22
+ /**
23
+ * Possible state of the query.
24
+ */
25
+ state: 'NOT_STARTED' | 'RUNNING' | 'SUCCEEDED' | 'RESULT_GONE' | 'CANCELLED' | 'FAILED';
21
26
  }
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * Possible state of the query.
3
+ *
4
+ * @deprecated Use literal values.
3
5
  */
4
6
  export declare enum QueryState {
5
7
  NotStarted = "NOT_STARTED",
@@ -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",
@@ -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;
@@ -0,0 +1,6 @@
1
+ type TransformRuleConfig = {
2
+ force?: boolean;
3
+ };
4
+ export declare function transformRequest<T = any>(object: T, keys: Array<string | [string, TransformRuleConfig]>): T;
5
+ export declare function transformResponse<T = any>(object: T, keys: Array<string | [string, TransformRuleConfig]>): T;
6
+ export {};
@@ -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 when the data does not conform to the specified type.
12
- * @throws UnsupportedOperationError when the type is not supported by the platform.
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 when the response body does not conform to the specified response body type.
30
- * @throws UnsupportedOperationError when the response body type is not supported by the platform.
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
  }
@@ -1,6 +1,6 @@
1
1
  import { ErrorType } from './types';
2
2
  /**
3
- * Error base. All client errors should extend this class.
3
+ * Base error for all client SDKs. All other errors extend this class.
4
4
  */
5
5
  export declare class ApiClientError extends Error {
6
6
  readonly cause?: any;
@@ -8,4 +8,16 @@ export declare class ApiClientError extends Error {
8
8
  errorType: ErrorType;
9
9
  constructor(name: string, message?: string, cause?: any);
10
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
+ */
11
23
  export declare function isApiClientError(e: any): e is ApiClientError;
@@ -4,15 +4,34 @@ import { CommonApiError, CommonErrorDetails, ErrorResponseBody } from './types';
4
4
  export type ApiGatewayErrorResponseBody = ErrorResponseBody<CommonApiError<ApiGatewayErrorDetails> & {
5
5
  retryAfterSeconds?: number;
6
6
  }>;
7
+ /**
8
+ * Reference for *ApiGatewayError* details object. Contains information about received API Getaway error.
9
+ * */
7
10
  export interface ApiGatewayErrorDetails extends CommonErrorDetails {
8
11
  errorCodeProperties?: {
9
12
  [key: string]: string;
10
13
  };
11
14
  }
15
+ /**
16
+ * Dedicated error response class for errors thrown by API Gateway.
17
+ * Autogenerated SDK Clients have built-in handler for API Gateway errors that throws this error.
18
+ */
12
19
  export declare class ApiGatewayError extends ClientRequestError<ApiGatewayErrorResponseBody> {
13
20
  readonly isApiGatewayError = true;
14
21
  readonly code: number;
15
22
  readonly retryAfterSeconds: number | undefined;
16
23
  constructor(response: HttpClientResponse, body: ApiGatewayErrorResponseBody);
17
24
  }
25
+ /**
26
+ * APIGatewayError type guard function.
27
+ * Does a structural check of the passed object.
28
+ * @example
29
+ * try {
30
+ * doSomething();
31
+ * } catch (e: unknown) {
32
+ * if(isApiClientError(e)) {
33
+ * handleTheError();
34
+ * }
35
+ * }
36
+ */
18
37
  export declare function isApiGatewayError(e: any): e is ApiGatewayError;