@dynatrace-sdk/client-query 1.4.0 → 1.4.2

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/docs/DOCS.md CHANGED
@@ -17,7 +17,7 @@ import NpmLogo from '@site/static/img/npm-logo.png';
17
17
  </a>
18
18
  </div>
19
19
  <div class="col" style={{textAlign: 'right'}}>
20
- <a href="https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.4.0">v1.4.0</a>
20
+ <a href="https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.4.2">v1.4.2</a>
21
21
  </div>
22
22
  </div>
23
23
 
@@ -34,7 +34,7 @@ import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
34
34
  ### queryAutocomplete
35
35
 
36
36
  <div class="padding-bottom--md">
37
- <strong>queryAssistanceClient.queryAutocomplete(config): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&lt;<a href="#autocompleteresponse">AutocompleteResponse</a>&gt;</strong>
37
+ <strong>queryAssistanceClient.queryAutocomplete(config): Promise&lt;<a href="#autocompleteresponse">AutocompleteResponse</a>&gt;</strong>
38
38
 
39
39
  <div class="padding-left--md">
40
40
 
@@ -42,7 +42,7 @@ Get a structured list of suggestions for the query at the given position.
42
42
 
43
43
  For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
44
44
 
45
- ## Overview
45
+ <h2> Overview</h2>
46
46
 
47
47
  We provide a list of suggestions that may be used after the cursor position. The following queries will all provide the
48
48
  same results:
@@ -99,8 +99,10 @@ Code example
99
99
  import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
100
100
 
101
101
  const data = await queryAssistanceClient.queryAutocomplete({
102
- authorization: "...",
103
- body: {} as AutocompleteRequest,
102
+ body: {
103
+ query:
104
+ 'fetch events | filter event.type == "davis" AND davis.status != "CLOSED" | fields timestamp, davis.title, davis.underMaintenance, davis.status | sort timestamp | limit 10',
105
+ },
104
106
  });
105
107
  ```
106
108
 
@@ -111,7 +113,7 @@ const data = await queryAssistanceClient.queryAutocomplete({
111
113
  ### queryParse
112
114
 
113
115
  <div class="padding-bottom--md">
114
- <strong>queryAssistanceClient.queryParse(config): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&lt;<a href="#dqlnode">DQLNode</a>&gt;</strong>
116
+ <strong>queryAssistanceClient.queryParse(config): Promise&lt;<a href="#dqlnode">DQLNode</a>&gt;</strong>
115
117
 
116
118
  <div class="padding-left--md">
117
119
 
@@ -119,24 +121,24 @@ Get a structured tree of the canonical form of the query.
119
121
 
120
122
  For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
121
123
 
122
- ## Overview
124
+ <h2> Overview</h2>
123
125
 
124
126
  Returns the parsed query as a tree, containing the structure of the canonical query. Tree-nodes can contain references to
125
127
  the token position where they originate from. This may help to provide hover effects, show canonical forms, mark
126
128
  optional items, and more.
127
129
 
128
- ## Details
130
+ <h2> Details</h2>
129
131
 
130
132
  The query tree consists of nodes that contain different additional information (everything optional):
131
133
 
132
- ### General Fields
134
+ <h3> General Fields</h3>
133
135
 
134
136
  | Field | Mandatory | Description |
135
137
  | ------------- | --------- | -------------------------------------------------------------------------------------------------- |
136
138
  | tokenPosition | no | optional. If present, it represents the position within the query string where the node refers to. |
137
139
  | isOptional | no | whether this node could be left out and the result would still be the same query (semantically). |
138
140
 
139
- #### tokenPosition
141
+ <h4> tokenPosition</h4>
140
142
 
141
143
  contains `start` (inclusive) and `end` (inclusive), both contain `index` (0 based; fur substrings), `line`
142
144
  and `column` (both 1-based; for readability).
@@ -149,7 +151,7 @@ and `column` (both 1-based; for readability).
149
151
  We can always check whether the canonical representation of a node matches the text in the tokenPosition to see whether
150
152
  something was inserted, removed, or changed.
151
153
 
152
- #### isOptional
154
+ <h4> isOptional</h4>
153
155
 
154
156
  only present if it is true.
155
157
 
@@ -157,7 +159,7 @@ Optional nodes can e.g. be optional braces that make a query more readable, but
157
159
  enter _ghost braces_ and _implicit functions_ in the user's input field; maybe with different formatting
158
160
  (using the tokenPosition of sibling nodes we can also check whether the user wrote these or not).
159
161
 
160
- ### Advanced Token Types
162
+ <h3> Advanced Token Types</h3>
161
163
 
162
164
  each node is of one of following types and may contain more fields:
163
165
 
@@ -165,7 +167,7 @@ each node is of one of following types and may contain more fields:
165
167
  - ContainerNode
166
168
  - Alternative Node
167
169
 
168
- #### Terminal Node
170
+ <h4> Terminal Node</h4>
169
171
 
170
172
  can be identified by checking whether `canonicalString` is present
171
173
 
@@ -175,7 +177,7 @@ can be identified by checking whether `canonicalString` is present
175
177
  | canonicalString | yes | the canonical string representation. Concatenating the canonicalString of all nested terminal nodes provides the canonical form of the query. |
176
178
  | isMandatoryOnUserOrder | no | may only be present if (`type="BRACE_OPEN"` or `type="BRACE_CLOSE"`) and `isOptional=true`. For usage see section Special node type: PARAMETERS |
177
179
 
178
- ##### Current types of terminal nodes (list might grow):
180
+ <h5> Current types of terminal nodes (list might grow):</h5>
179
181
 
180
182
  - SPACE
181
183
  - LINEBREAK
@@ -211,7 +213,7 @@ can be identified by checking whether `canonicalString` is present
211
213
  - METRIC_KEY
212
214
  - VARIABLE
213
215
 
214
- #### ContainerNode
216
+ <h4> ContainerNode</h4>
215
217
 
216
218
  can be identified by checking whether `children` is present
217
219
 
@@ -220,7 +222,7 @@ can be identified by checking whether `children` is present
220
222
  | type | yes | the type of the container node - do not confuse with the type of terminal nodes |
221
223
  | children | yes | the children for the node. might be of any type |
222
224
 
223
- ##### Current types of container nodes (list might grow):
225
+ <h5> Current types of container nodes (list might grow):</h5>
224
226
 
225
227
  - QUERY
226
228
  - EXECUTION_BLOCK
@@ -242,14 +244,14 @@ can be identified by checking whether `children` is present
242
244
  - TRAVERSAL_PATH
243
245
  - TRAVERSAL_STEP
244
246
 
245
- ##### Special node type: PARAMETERS
247
+ <h5> Special node type: PARAMETERS</h5>
246
248
 
247
249
  can contain children representing the parameters. Every second child is of type PARAMETER_SEPARATOR.
248
250
 
249
251
  You may reorder the children based on their tokenPosition to get the user order. However, in this case,
250
252
  you need to consider `isMandatoryOnUserOrder` to determine whether the grouping braces are mandatory or not.
251
253
 
252
- ###### Example
254
+ <h6> Example</h6>
253
255
 
254
256
  For the query `SORT a, {direction:"descending", b}`, the canonical form is:
255
257
 
@@ -267,7 +269,7 @@ However, if you reorder the children by tokenPosition, the braces are not option
267
269
  So, if the children in PARAMETERS are re-ordered by tokenPosition, braces (or in general: TerminalNodes)
268
270
  are only optional if `isOptional && !isMandatoryOnUserOrder`.
269
271
 
270
- ##### Special node type: FUNCTION_PART
272
+ <h5> Special node type: FUNCTION_PART</h5>
271
273
 
272
274
  A container node of type `FUNCTION` may contain nodes of type `FUNCTION_PART`.
273
275
 
@@ -282,7 +284,7 @@ The optional function parts are `anyMatch(` and `, input:a)`. If you leave out b
282
284
  `filter a.b == 1` and return the same result. Using one of these optional function parts and removing the other will lead
283
285
  to an invalid query.
284
286
 
285
- #### Alternative Node
287
+ <h4> Alternative Node</h4>
286
288
 
287
289
  can be identified by checking whether `alternatives` is present
288
290
 
@@ -292,7 +294,7 @@ can be identified by checking whether `alternatives` is present
292
294
 
293
295
  When displaying the query, pick one option. You may use the other options for hovering, replacing, and more.
294
296
 
295
- ##### Current values of AlternativeType (list might grow):
297
+ <h5> Current values of AlternativeType (list might grow):</h5>
296
298
 
297
299
  - CANONICAL: This node is the one we will use for our canonical form
298
300
  - USER: An alternative that is also valid, but not canonical; and this version was picked by the user.
@@ -332,8 +334,10 @@ Code example
332
334
  import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
333
335
 
334
336
  const data = await queryAssistanceClient.queryParse({
335
- authorization: "...",
336
- body: {} as ParseRequest,
337
+ body: {
338
+ query:
339
+ 'fetch events | filter event.type == "davis" AND davis.status != "CLOSED" | fields timestamp, davis.title, davis.underMaintenance, davis.status | sort timestamp | limit 10',
340
+ },
337
341
  });
338
342
  ```
339
343
 
@@ -344,7 +348,7 @@ const data = await queryAssistanceClient.queryParse({
344
348
  ### queryVerify
345
349
 
346
350
  <div class="padding-bottom--md">
347
- <strong>queryAssistanceClient.queryVerify(config): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&lt;<a href="#verifyresponse">VerifyResponse</a>&gt;</strong>
351
+ <strong>queryAssistanceClient.queryVerify(config): Promise&lt;<a href="#verifyresponse">VerifyResponse</a>&gt;</strong>
348
352
 
349
353
  <div class="padding-left--md">
350
354
 
@@ -352,7 +356,7 @@ Verifies a query without executing it.
352
356
 
353
357
  For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
354
358
 
355
- ## Overview
359
+ <h2> Overview</h2>
356
360
 
357
361
  Verifies the supplied query string and other query parameters for lack of any errors, but without actually
358
362
  submitting the query for execution.
@@ -380,8 +384,10 @@ Code example
380
384
  import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
381
385
 
382
386
  const data = await queryAssistanceClient.queryVerify({
383
- authorization: "...",
384
- body: {} as VerifyRequest,
387
+ body: {
388
+ query:
389
+ 'fetch events | filter event.type == "davis" AND davis.status != "CLOSED" | fields timestamp, davis.title, davis.underMaintenance, davis.status | sort timestamp | limit 10',
390
+ },
385
391
  });
386
392
  ```
387
393
 
@@ -398,7 +404,7 @@ import { queryExecutionClient } from "@dynatrace-sdk/client-query";
398
404
  ### queryCancel
399
405
 
400
406
  <div class="padding-bottom--md">
401
- <strong>queryExecutionClient.queryCancel(config): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&lt;void &#124; <a href="#querypollresponse">QueryPollResponse</a>&gt;</strong>
407
+ <strong>queryExecutionClient.queryCancel(config): Promise&lt;void &#124; <a href="#querypollresponse">QueryPollResponse</a>&gt;</strong>
402
408
 
403
409
  <div class="padding-left--md">
404
410
 
@@ -406,11 +412,11 @@ Cancels the query and returns the result if the query was already finished, othe
406
412
 
407
413
  For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
408
414
 
409
- ### Overview:
415
+ <h3> Overview:</h3>
410
416
 
411
417
  Cancels a running Grail query and returns a list of records if the query already finished.
412
418
 
413
- ### The response format:
419
+ <h3> The response format:</h3>
414
420
 
415
421
  If the query was already finished, a response body including the result will be returned. Otherwise the response will contain no body.
416
422
 
@@ -472,7 +478,7 @@ const data = await queryExecutionClient.queryCancel({
472
478
  ### queryExecute
473
479
 
474
480
  <div class="padding-bottom--md">
475
- <strong>queryExecutionClient.queryExecute(config): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&lt;<a href="#querystartresponse">QueryStartResponse</a>&gt;</strong>
481
+ <strong>queryExecutionClient.queryExecute(config): Promise&lt;<a href="#querystartresponse">QueryStartResponse</a>&gt;</strong>
476
482
 
477
483
  <div class="padding-left--md">
478
484
 
@@ -480,13 +486,13 @@ Starts a Grail query.
480
486
 
481
487
  For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
482
488
 
483
- ### Overview:
489
+ <h3> Overview:</h3>
484
490
 
485
491
  Executes a query and returns a list of records.
486
492
 
487
493
  For details about the query language see the [Dynatrace Query Language documentation](https://dt-url.net/bv03yk8).
488
494
 
489
- ### The response format:
495
+ <h3> The response format:</h3>
490
496
 
491
497
  The json response will contain the state of the started query. If the query succeeded, the result will be included. Otherwise the response will contain a request token to reference the query in future polling requests.
492
498
 
@@ -538,9 +544,10 @@ Code example
538
544
  import { queryExecutionClient } from "@dynatrace-sdk/client-query";
539
545
 
540
546
  const data = await queryExecutionClient.queryExecute({
541
- enrich: "metric-metadata",
542
- authorization: "...",
543
- body: {} as ExecuteRequest,
547
+ body: {
548
+ query:
549
+ 'fetch events | filter event.type == "davis" AND davis.status != "CLOSED" | fields timestamp, davis.title, davis.underMaintenance, davis.status | sort timestamp | limit 10',
550
+ },
544
551
  });
545
552
  ```
546
553
 
@@ -551,7 +558,7 @@ const data = await queryExecutionClient.queryExecute({
551
558
  ### queryPoll
552
559
 
553
560
  <div class="padding-bottom--md">
554
- <strong>queryExecutionClient.queryPoll(config): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>&lt;<a href="#querypollresponse">QueryPollResponse</a>&gt;</strong>
561
+ <strong>queryExecutionClient.queryPoll(config): Promise&lt;<a href="#querypollresponse">QueryPollResponse</a>&gt;</strong>
555
562
 
556
563
  <div class="padding-left--md">
557
564
 
@@ -559,11 +566,11 @@ Retrieves query status and final result from Grail.
559
566
 
560
567
  For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
561
568
 
562
- ### Overview:
569
+ <h3> Overview:</h3>
563
570
 
564
571
  Polls the status of a Grail query. Returns the status of the query, including the result if the query finished.
565
572
 
566
- ### The response format:
573
+ <h3> The response format:</h3>
567
574
 
568
575
  The json response will contain the state of the query. If the query succeeded, the result will be included.
569
576
 
@@ -616,8 +623,6 @@ import { queryExecutionClient } from "@dynatrace-sdk/client-query";
616
623
 
617
624
  const data = await queryExecutionClient.queryPoll({
618
625
  requestToken: "...",
619
- requestTimeoutMilliseconds: 60,
620
- enrich: "metric-metadata",
621
626
  });
622
627
  ```
623
628
 
@@ -665,7 +670,7 @@ Part of the suggestion.
665
670
  | info | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The type of the suggestion. |
666
671
  | suggestion<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The suggested continuation of the query. |
667
672
  | synopsis | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The synopsis of the suggestion. |
668
- | type<sup>\*required</sup> | <a href="#tokentype">TokenType</a> | |
673
+ | type<sup>\*required</sup> | TokenType | |
669
674
 
670
675
  ### DQLAlternativeNode
671
676
 
@@ -675,7 +680,7 @@ The DQL node that has alternatives.
675
680
  | ------------------------------- | ------------------------------------------------------------------------------- | ----------------------------- |
676
681
  | alternatives | object | The different alternatives. |
677
682
  | isOptional<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Boolean">boolean</a> | True if the node is optional. |
678
- | nodeType<sup>\*required</sup> | <a href="#dqlnodenodetype">DQLNodeNodeType</a> | |
683
+ | nodeType<sup>\*required</sup> | DQLNodeNodeType | |
679
684
  | tokenPosition | <a href="#tokenposition">TokenPosition</a> | |
680
685
 
681
686
  ### DQLContainerNode
@@ -686,7 +691,7 @@ The DQL node that contains other nodes.
686
691
  | ------------------------------- | ------------------------------------------------------------------------------- | ----------------------------- |
687
692
  | children | Array&lt;<a href="#dqlnode">DQLNode</a>&gt; | The list of children nodes. |
688
693
  | isOptional<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Boolean">boolean</a> | True if the node is optional. |
689
- | nodeType<sup>\*required</sup> | <a href="#dqlnodenodetype">DQLNodeNodeType</a> | |
694
+ | nodeType<sup>\*required</sup> | DQLNodeNodeType | |
690
695
  | tokenPosition | <a href="#tokenposition">TokenPosition</a> | |
691
696
  | type | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The type of the node. |
692
697
 
@@ -697,7 +702,7 @@ General Node in the DQL query.
697
702
  | Name | Type | Description |
698
703
  | ------------------------------- | ------------------------------------------------------------------------------- | ----------------------------- |
699
704
  | isOptional<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Boolean">boolean</a> | True if the node is optional. |
700
- | nodeType<sup>\*required</sup> | <a href="#dqlnodenodetype">DQLNodeNodeType</a> | |
705
+ | nodeType<sup>\*required</sup> | DQLNodeNodeType | |
701
706
  | tokenPosition | <a href="#tokenposition">TokenPosition</a> | |
702
707
 
703
708
  ### DQLTerminalNode
@@ -709,9 +714,9 @@ Node that represents single token.
709
714
  | canonicalString | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | Canonical form. |
710
715
  | isMandatoryOnUserOrder | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Boolean">boolean</a> | For optional items only: whether this node becomes mandatory when user order is used. True only for some optional 'ghost braces' |
711
716
  | isOptional<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Boolean">boolean</a> | True if the node is optional. |
712
- | nodeType<sup>\*required</sup> | <a href="#dqlnodenodetype">DQLNodeNodeType</a> | |
717
+ | nodeType<sup>\*required</sup> | DQLNodeNodeType | |
713
718
  | tokenPosition | <a href="#tokenposition">TokenPosition</a> | |
714
- | type | <a href="#tokentype">TokenType</a> | |
719
+ | type | TokenType | |
715
720
 
716
721
  ### ErrorEnvelope
717
722
 
@@ -769,7 +774,7 @@ The possible type of a field in DQL.
769
774
 
770
775
  | Name | Type |
771
776
  | ------------------------- | ------------------------------------------------------------- |
772
- | type<sup>\*required</sup> | <a href="#fieldtypetype">FieldTypeType</a> |
777
+ | type<sup>\*required</sup> | FieldTypeType |
773
778
  | types | Array&lt;<a href="#rangedfieldtypes">RangedFieldTypes</a>&gt; |
774
779
 
775
780
  ### GeoPoint
@@ -861,7 +866,7 @@ The response of GET query:execute call.
861
866
  | -------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------- |
862
867
  | progress | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The progress of the query from 0 to 100. |
863
868
  | result | <a href="#queryresult">QueryResult</a> | |
864
- | state<sup>\*required</sup> | <a href="#querystate">QueryState</a> | |
869
+ | state<sup>\*required</sup> | QueryState | |
865
870
  | ttlSeconds | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | Time to live in seconds. |
866
871
 
867
872
  ### QueryResult
@@ -883,7 +888,7 @@ The response when starting a query.
883
888
  | progress | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The progress of the query from 0 to 100. |
884
889
  | requestToken | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The token returned by the POST query:execute call. |
885
890
  | result | <a href="#queryresult">QueryResult</a> | |
886
- | state<sup>\*required</sup> | <a href="#querystate">QueryState</a> | |
891
+ | state<sup>\*required</sup> | QueryState | |
887
892
  | ttlSeconds | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | Time to live in seconds. |
888
893
 
889
894
  ### RangedFieldTypes
@@ -907,10 +912,10 @@ Single record that contains the result fields.
907
912
 
908
913
  DQL data type timeframe.
909
914
 
910
- | Name | Type | Description |
911
- | ----- | -------------------------------------------------------------------------------------------------------- | -------------------------------- |
912
- | end | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</a> | The end time of the timeframe. |
913
- | start | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date">Date</a> | The start time of the timeframe. |
915
+ | Name | Type | Description |
916
+ | ----- | ---- | -------------------------------- |
917
+ | end | Date | The end time of the timeframe. |
918
+ | start | Date | The start time of the timeframe. |
914
919
 
915
920
  ### TokenPosition
916
921
 
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "dynagen": {
3
- "version": "0.10.9",
3
+ "version": "0.12.1",
4
4
  "generatedAt": "",
5
5
  "template": {
6
6
  "name": "@dynatrace-sdk/template-typescript-client",
7
- "version": "0.17.4"
7
+ "version": "0.17.8"
8
8
  },
9
9
  "featureFlags": {
10
10
  "typeguards": true