@dynatrace-sdk/client-query 1.0.0 → 1.1.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/cjs/index.js +2601 -1038
  3. package/docs/DOCS.md +31 -225
  4. package/dynatrace-metadata.json +5 -2
  5. package/esm/index.js +2606 -1038
  6. package/package.json +2 -2
  7. package/types/packages/client/query/src/lib/apis/query-execution-api.d.ts +27 -221
  8. package/types/packages/client/query/src/lib/models/autocomplete-request.d.ts +0 -11
  9. package/types/packages/client/query/src/lib/models/autocomplete-request.transformation.d.ts +11 -0
  10. package/types/packages/client/query/src/lib/models/autocomplete-response.d.ts +1 -11
  11. package/types/packages/client/query/src/lib/models/autocomplete-response.transformation.d.ts +11 -0
  12. package/types/packages/client/query/src/lib/models/autocomplete-suggestion-part.d.ts +1 -12
  13. package/types/packages/client/query/src/lib/models/autocomplete-suggestion-part.transformation.d.ts +12 -0
  14. package/types/packages/client/query/src/lib/models/autocomplete-suggestion.d.ts +1 -11
  15. package/types/packages/client/query/src/lib/models/autocomplete-suggestion.transformation.d.ts +11 -0
  16. package/types/packages/client/query/src/lib/models/dql-alternative-node.d.ts +1 -9
  17. package/types/packages/client/query/src/lib/models/dql-alternative-node.transformation.d.ts +9 -0
  18. package/types/packages/client/query/src/lib/models/dql-container-node.d.ts +1 -10
  19. package/types/packages/client/query/src/lib/models/dql-container-node.transformation.d.ts +10 -0
  20. package/types/packages/client/query/src/lib/models/dql-node-node-type.d.ts +0 -6
  21. package/types/packages/client/query/src/lib/models/dql-node-node-type.transformation.d.ts +6 -0
  22. package/types/packages/client/query/src/lib/models/dql-node.d.ts +2 -18
  23. package/types/packages/client/query/src/lib/models/dql-node.transformation.d.ts +17 -0
  24. package/types/packages/client/query/src/lib/models/dql-terminal-node.d.ts +2 -12
  25. package/types/packages/client/query/src/lib/models/dql-terminal-node.transformation.d.ts +12 -0
  26. package/types/packages/client/query/src/lib/models/error-envelope.d.ts +1 -12
  27. package/types/packages/client/query/src/lib/models/error-envelope.transformation.d.ts +12 -0
  28. package/types/packages/client/query/src/lib/models/error-response-details.d.ts +1 -16
  29. package/types/packages/client/query/src/lib/models/error-response-details.transformation.d.ts +16 -0
  30. package/types/packages/client/query/src/lib/models/error-response.d.ts +1 -11
  31. package/types/packages/client/query/src/lib/models/error-response.transformation.d.ts +11 -0
  32. package/types/packages/client/query/src/lib/models/execute-request.d.ts +1 -19
  33. package/types/packages/client/query/src/lib/models/execute-request.transformation.d.ts +18 -0
  34. package/types/packages/client/query/src/lib/models/field-type-type.d.ts +0 -6
  35. package/types/packages/client/query/src/lib/models/field-type-type.transformation.d.ts +6 -0
  36. package/types/packages/client/query/src/lib/models/field-type.d.ts +2 -11
  37. package/types/packages/client/query/src/lib/models/field-type.transformation.d.ts +11 -0
  38. package/types/packages/client/query/src/lib/models/geo-point.d.ts +0 -9
  39. package/types/packages/client/query/src/lib/models/geo-point.transformation.d.ts +9 -0
  40. package/types/packages/client/query/src/lib/models/grail-metadata.d.ts +2 -20
  41. package/types/packages/client/query/src/lib/models/grail-metadata.transformation.d.ts +20 -0
  42. package/types/packages/client/query/src/lib/models/index.d.ts +35 -0
  43. package/types/packages/client/query/src/lib/models/metadata-notification.d.ts +1 -15
  44. package/types/packages/client/query/src/lib/models/metadata-notification.transformation.d.ts +15 -0
  45. package/types/packages/client/query/src/lib/models/metadata.d.ts +2 -11
  46. package/types/packages/client/query/src/lib/models/metadata.transformation.d.ts +11 -0
  47. package/types/packages/client/query/src/lib/models/metric-metadata.d.ts +0 -11
  48. package/types/packages/client/query/src/lib/models/metric-metadata.transformation.d.ts +11 -0
  49. package/types/packages/client/query/src/lib/models/parse-request.d.ts +0 -10
  50. package/types/packages/client/query/src/lib/models/parse-request.transformation.d.ts +10 -0
  51. package/types/packages/client/query/src/lib/models/position-info.d.ts +0 -10
  52. package/types/packages/client/query/src/lib/models/position-info.transformation.d.ts +10 -0
  53. package/types/packages/client/query/src/lib/models/query-poll-response.d.ts +2 -13
  54. package/types/packages/client/query/src/lib/models/query-poll-response.transformation.d.ts +13 -0
  55. package/types/packages/client/query/src/lib/models/query-result.d.ts +3 -13
  56. package/types/packages/client/query/src/lib/models/query-result.transformation.d.ts +13 -0
  57. package/types/packages/client/query/src/lib/models/query-start-response.d.ts +2 -14
  58. package/types/packages/client/query/src/lib/models/query-start-response.transformation.d.ts +14 -0
  59. package/types/packages/client/query/src/lib/models/query-state.d.ts +0 -6
  60. package/types/packages/client/query/src/lib/models/query-state.transformation.d.ts +6 -0
  61. package/types/packages/client/query/src/lib/models/ranged-field-types-mappings.d.ts +1 -9
  62. package/types/packages/client/query/src/lib/models/ranged-field-types-mappings.transformation.d.ts +9 -0
  63. package/types/packages/client/query/src/lib/models/ranged-field-types.d.ts +1 -10
  64. package/types/packages/client/query/src/lib/models/ranged-field-types.transformation.d.ts +10 -0
  65. package/types/packages/client/query/src/lib/models/result-record-value.d.ts +3 -8
  66. package/types/packages/client/query/src/lib/models/result-record-value.transformation.d.ts +26 -0
  67. package/types/packages/client/query/src/lib/models/result-record.d.ts +1 -9
  68. package/types/packages/client/query/src/lib/models/result-record.transformation.d.ts +9 -0
  69. package/types/packages/client/query/src/lib/models/timeframe.d.ts +0 -9
  70. package/types/packages/client/query/src/lib/models/timeframe.transformation.d.ts +9 -0
  71. package/types/packages/client/query/src/lib/models/token-position.d.ts +1 -13
  72. package/types/packages/client/query/src/lib/models/token-position.transformation.d.ts +13 -0
  73. package/types/packages/client/query/src/lib/models/token-type.d.ts +0 -6
  74. package/types/packages/client/query/src/lib/models/token-type.transformation.d.ts +6 -0
  75. package/types/packages/client/query/src/lib/models/verify-request.d.ts +0 -10
  76. package/types/packages/client/query/src/lib/models/verify-request.transformation.d.ts +10 -0
  77. package/types/packages/client/query/src/lib/models/verify-response.d.ts +1 -10
  78. package/types/packages/client/query/src/lib/models/verify-response.transformation.d.ts +10 -0
  79. package/types/packages/http-client/src/lib/platform/http-client-response-error-serializer.d.ts +2 -0
  80. package/types/packages/platform/error-handlers/src/lib/types/common-serialized-error.d.ts +1 -0
  81. package/types/packages/platform/error-handlers/src/lib/types/http-serialized-error.d.ts +2 -0
package/docs/DOCS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Storage – Query Service
2
2
 
3
- SDK package version **1.0.0**
3
+ SDK package version **1.1.0**
4
4
 
5
5
  ```bash
6
6
  npm install @dynatrace-sdk/client-query
@@ -516,7 +516,7 @@ The result has three main sections:
516
516
  * the 'metadata' section contains information about the query like 'analysisTimeframe', 'timezone' or 'locale'.
517
517
 
518
518
  Every record has an implicit 'index' according to the position in the 'records' JSON array.
519
- The types section has a list of 1..N possibhttps://dev.deus-dev.internal.dynatracelabs.com/query-frontend/docs/rest/swagger-ui/index.html?urls.primaryName=v0.5#/Query%20Execution/query%3Acancelle type 'buckets'. Each such bucket has an 'indexRange' which indicates which
519
+ The types section has a list of 1..N possible type 'buckets'. Each such bucket has an 'indexRange' which indicates which
520
520
  records will find their field types in which bucket. The index range has two values start & end and can be thought of as [startIndex, endIndex).
521
521
 
522
522
  A field part of a record with index 'i' will find its corresponding field type by first locating the bucket that satisfies:
@@ -536,108 +536,6 @@ It is guaranteed that every field of every record will have a corresponding type
536
536
  **Clients should always take the included types into account when consuming records!**
537
537
 
538
538
 
539
- As an example, the following response highlights a collision, where a field called "cancelled" was ingested both as a
540
- boolean but also wrongly as a string. The first record contains the field "cancelled" as a string, but the very next record has the
541
- field with the same name but of boolean type. The types section has two entries. One corresponds to first record that has
542
- the field cancelled of type string. The second entry in the types section corresponds to the subsequent records which have
543
- the boolean field type.
544
-
545
- ```json
546
- {
547
- "state":"SUCCEEDED",
548
- "ttlSeconds":197,
549
- "result": {
550
- "records": [
551
- {
552
- "type": "user_event",
553
- "order_id": "1ea34-2515-1515-fe1g",
554
- "cancelled": "true"
555
- },
556
- {
557
- "type": "user_event",
558
- "order_id": "2ea34-2515-1515-fe1g",
559
- "cancelled": false
560
- },
561
- {
562
- "type": "user_event",
563
- "order_id": "3ea34-2515-1515-fe1g",
564
- "cancelled": true
565
- },
566
- {
567
- "type": "user_event",
568
- "order_id": "4ea34-2515-1515-fe1g",
569
- "cancelled": false
570
- }
571
- ],
572
- "types": [
573
- {
574
- "indexRange": [
575
- 0,
576
- 1
577
- ],
578
- "mappings": {
579
- "type": {
580
- "type": "string"
581
- },
582
- "order_id": {
583
- "type": "string"
584
- },
585
- "cancelled": {
586
- "type": "string"
587
- }
588
- }
589
- },
590
- {
591
- "indexRange": [
592
- 1,
593
- 4
594
- ],
595
- "mappings": {
596
- "type": {
597
- "type": "string"
598
- },
599
- "order_id": {
600
- "type": "string"
601
- },
602
- "cancelled": {
603
- "type": "boolean"
604
- }
605
- }
606
- }
607
- ],
608
- "metadata": {
609
- "query": "fetch events | ...",
610
- "dqlVersion": "V0_3",
611
- "appliedTimeframe": {
612
- "start": 1657624357056,
613
- "end": 1657631557056
614
- },
615
- "timezone": "Z",
616
- "locale": ""
617
- }
618
- }
619
- }
620
- ```
621
-
622
- ### Field data types
623
-
624
- The possible Grail types encountered in the "types" section is limited to a list of well-defined types:
625
- ```
626
- BOOLEAN
627
- STRING
628
- DOUBLE
629
- LONG
630
- TIMESTAMP
631
- TIMEFRAME
632
- DURATION
633
- BINARY
634
- IP_ADDRESS
635
- GEO_POINT
636
- ARRAY
637
- RECORD
638
- ```
639
-
640
-
641
539
  **Parameters**
642
540
 
643
541
  <div class="padding-left--md padding-bottom--md">
@@ -713,16 +611,32 @@ For details about the query language see the [Dynatrace Query Language documenta
713
611
 
714
612
  ### The response format:
715
613
 
716
- The json response will contain the state of the started query and a request token to reference it in future polling requests:
614
+ 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.
615
+
616
+ The result has two main sections:
617
+ * The 'records' section contains the individual records, where each record consists of a set of fields and their corresponding values.
618
+ * The 'types' section describes the corresponding data types that a record field has.
619
+
620
+ Every record has an implicit 'index' according to the position in the 'records' JSON array.
621
+ The types section has a list of 1..N possible type 'buckets'. Each such bucket has an 'indexRange' which indicates which
622
+ records will find their field types in which bucket. The index range has two values start & end and can be thought of as [startIndex, endIndex).
623
+
624
+ A field part of a record with index 'i' will find its corresponding field type by first locating the bucket that satisfies:
717
625
 
718
- ```json
719
- {
720
- "state":"RUNNING",
721
- "requestToken":"5tCm27WbTHmyi+749/wGsw==",
722
- "ttlSeconds":197
723
- }
626
+ ```text
627
+ startIndex &lt;= i &lt;= endIndex
724
628
  ```
725
629
 
630
+ Once the bucket is found the 'mappings' object has an entry for all the fields that are part of that record with index 'i'.
631
+
632
+
633
+ Since enforcement of a particular schema is absent at ingestion time, it is possible to have records that share the same
634
+ field name but their values are of a different type. This phenomenon will hence forth be named as a **"collision"**.
635
+ When a collision does occur, we will create a new type 'bucket' that will have a different index range where
636
+ the new record field types will be placed.
637
+ It is guaranteed that every field of every record will have a corresponding type.
638
+ **Clients should always take the included types into account when consuming records!**
639
+
726
640
 
727
641
  **Parameters**
728
642
 
@@ -791,7 +705,7 @@ If set additional data will be available in the metadata section.
791
705
  #### Returns
792
706
 
793
707
  <div class="padding-left--md">
794
- The final status and results of the supplied query if it finished within a supplied request-timeout-milliseconds. | The status of the query to start.
708
+ The final status and results of the supplied query if it finished within a supplied requestTimeoutMilliseconds. | The status of the query to start.
795
709
 
796
710
  </div>
797
711
 
@@ -820,17 +734,7 @@ Retrieves query status and final result from Grail.
820
734
  Polls the status of a Grail query. Returns the status of the query, including the result if the query finished.
821
735
 
822
736
  ### The response format:
823
- The response consists of:
824
- * The state of the query.
825
- * ttlSeconds until the query will be wiped
826
- * If the query succeeded, also a result
827
-
828
- ```json
829
- {
830
- "state":"RUNNING",
831
- "ttlSeconds":197
832
- }
833
- ```
737
+ The json response will contain the state of the query. If the query succeeded, the result will be included.
834
738
 
835
739
  The result has two main sections:
836
740
  * The 'records' section contains the individual records, where each record consists of a set of fields and their corresponding values.
@@ -856,104 +760,6 @@ the new record field types will be placed.
856
760
  It is guaranteed that every field of every record will have a corresponding type.
857
761
  **Clients should always take the included types into account when consuming records!**
858
762
 
859
- As an example, the following response highlights a collision, where a field called "cancelled" was ingested both as a
860
- boolean but also wrongly as a string. The first record contains the field "cancelled" as a string, but the very next record has the
861
- field with the same name but of boolean type. The types section has two entries. One corresponds to first record that has
862
- the field cancelled of type string. The second entry in the types section corresponds to the subsequent records which have
863
- the boolean field type.
864
-
865
- ```json
866
- {
867
- "state":"SUCCEEDED",
868
- "result": {
869
- "records": [
870
- {
871
- "type": "user_event",
872
- "order_id": "1ea34-2515-1515-fe1g",
873
- "cancelled": "true"
874
- },
875
- {
876
- "type": "user_event",
877
- "order_id": "2ea34-2515-1515-fe1g",
878
- "cancelled": false
879
- },
880
- {
881
- "type": "user_event",
882
- "order_id": "3ea34-2515-1515-fe1g",
883
- "cancelled": true
884
- },
885
- {
886
- "type": "user_event",
887
- "order_id": "4ea34-2515-1515-fe1g",
888
- "cancelled": false
889
- }
890
- ],
891
- "types": [
892
- {
893
- "indexRange": [
894
- 0,
895
- 1
896
- ],
897
- "mappings": {
898
- "type": {
899
- "type": "string"
900
- },
901
- "order_id": {
902
- "type": "string"
903
- },
904
- "cancelled": {
905
- "type": "string"
906
- }
907
- }
908
- },
909
- {
910
- "indexRange": [
911
- 1,
912
- 4
913
- ],
914
- "mappings": {
915
- "type": {
916
- "type": "string"
917
- },
918
- "order_id": {
919
- "type": "string"
920
- },
921
- "cancelled": {
922
- "type": "boolean"
923
- }
924
- }
925
- }
926
- ],
927
- "metadata": {
928
- "query": "fetch events | ...",
929
- "dqlVersion": "V0_3",
930
- "appliedTimeframe": {
931
- "start": 1657624357056,
932
- "end": 1657631557056
933
- },
934
- "timezone": "Z",
935
- "locale": ""
936
- }
937
- }
938
- }
939
- ```
940
-
941
- The possible Grail types ened in the "types" section is limited to a list of well-defined types:
942
- ```
943
- BOOLEAN
944
- STRING
945
- DOUBLE
946
- LONG
947
- TIMESTAMP
948
- TIMEFRAME
949
- DURATION
950
- BINARY
951
- IP_ADDRESS
952
- GEO_POINT
953
- ARRAY
954
- RECORD
955
- ```
956
-
957
763
 
958
764
  **Parameters**
959
765
 
@@ -997,7 +803,7 @@ If set additional data will be available in the metadata section.
997
803
  <strong>config.requestTimeoutMilliseconds</strong>: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a>
998
804
  <div class="padding-left--md">
999
805
 
1000
- The request timeout in milliseconds. The response will be delayed for up to the specified time in milliseconds to wait for the result of the query.
806
+ The time a client is willing to wait for the query result. In case the query finishes within the specified timeout, the query result is returned. Otherwise, the query status is returned.
1001
807
 
1002
808
  </div>
1003
809
 
@@ -1736,7 +1542,7 @@ Limit in gigabytes for the amount data that will be scanned during read.
1736
1542
  <strong>defaultTimeframeEnd</strong>: <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a>
1737
1543
  <div class="padding-left--md">
1738
1544
 
1739
- The query timeframe 'end' timestamp in ISO-8601 or RFC399 format. If the timeframe 'start' parameter is missing, the whole timeframe is ignored. &lt;em&gt;Note that if a timeframe is specified within the query string (query) then it has precedence over this query request parameter.&lt;/em&gt;
1545
+ The query timeframe 'end' timestamp in ISO-8601 or RFC399 format. If the timeframe 'start' parameter is missing, the whole timeframe is ignored. *Note that if a timeframe is specified within the query string (query) then it has precedence over this query request parameter.*
1740
1546
 
1741
1547
  </div>
1742
1548
 
@@ -1748,7 +1554,7 @@ The query timeframe 'end' timestamp in ISO-8601 or RFC399 format. If the timefra
1748
1554
  <strong>defaultTimeframeStart</strong>: <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a>
1749
1555
  <div class="padding-left--md">
1750
1556
 
1751
- The query timeframe 'start' timestamp in ISO-8601 or RFC399 format. If the timeframe 'end' parameter is missing, the whole timeframe is ignored. &lt;em&gt;Note that if a timeframe is specified within the query string (query) then it has precedence over this query request parameter.&lt;/em&gt;
1557
+ The query timeframe 'start' timestamp in ISO-8601 or RFC399 format. If the timeframe 'end' parameter is missing, the whole timeframe is ignored. *Note that if a timeframe is specified within the query string (query) then it has precedence over this query request parameter.*
1752
1558
 
1753
1559
  </div>
1754
1560
 
@@ -1760,7 +1566,7 @@ The query timeframe 'start' timestamp in ISO-8601 or RFC399 format. If the timef
1760
1566
  <strong>enablePreview</strong>: boolean
1761
1567
  <div class="padding-left--md">
1762
1568
 
1763
- Request preview results. If a preview is available within the request-timeout-milliseconds, then it will be returned as part of the response.
1569
+ Request preview results. If a preview is available within the requestTimeoutMilliseconds, then it will be returned as part of the response.
1764
1570
 
1765
1571
  </div>
1766
1572
 
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "dynagen": {
3
- "version": "0.10.4",
3
+ "version": "0.10.7",
4
4
  "generatedAt": "",
5
5
  "template": {
6
6
  "name": "@dynatrace-sdk/template-typescript-client",
7
- "version": "0.13.7"
7
+ "version": "0.17.0"
8
+ },
9
+ "featureFlags": {
10
+ "typeguards": true
8
11
  }
9
12
  },
10
13
  "spec": {