@dynatrace-sdk/client-query 1.7.2 → 1.8.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  @dynatrace-sdk/client-query
4
4
 
5
+ ## 1.8.1
6
+
7
+ ### Patch Changes
8
+
9
+ - Update documentation.
10
+
11
+ ## 1.8.0
12
+
13
+ ### Minor Changes
14
+
15
+ - `rollup` and `rate` properties were added to the `MetricMetadata` object
16
+
5
17
  ## 1.7.2
6
18
 
7
19
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @dynatrace-sdk/client-query
2
2
 
3
- [![npm](https://img.shields.io/badge/npm-v1.7.2-blue)](https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.7.2)
3
+ [![npm](https://img.shields.io/badge/npm-v1.8.1-blue)](https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.8.1)
4
4
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
5
5
 
6
6
  Exposes an API to fetch records stored in Grail
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright 2023 Dynatrace LLC
3
+ * Copyright 2023-2024 Dynatrace LLC
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
6
6
  * You may obtain a copy of the License at
@@ -2302,10 +2302,18 @@ function isMetricMetadata(value) {
2302
2302
  if (Array.isArray(value)) {
2303
2303
  return false;
2304
2304
  }
2305
- const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit", "fieldName"]);
2305
+ const modelKeys = /* @__PURE__ */ new Set([
2306
+ "metric.key",
2307
+ "displayName",
2308
+ "description",
2309
+ "unit",
2310
+ "fieldName",
2311
+ "rollup",
2312
+ "rate"
2313
+ ]);
2306
2314
  const hasAdditionalProperties = false;
2307
2315
  const requiredKeys = [];
2308
- const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName"];
2316
+ const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName", "rollup", "rate"];
2309
2317
  const valKeys = new Set(Object.keys(value));
2310
2318
  const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
2311
2319
  const doesNotContainExtraKeys = [...valKeys].every((key) => modelKeys.has(key)) || hasAdditionalProperties;
@@ -2322,10 +2330,18 @@ function isJson23(value) {
2322
2330
  if (Array.isArray(value)) {
2323
2331
  return false;
2324
2332
  }
2325
- const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit", "fieldName"]);
2333
+ const modelKeys = /* @__PURE__ */ new Set([
2334
+ "metric.key",
2335
+ "displayName",
2336
+ "description",
2337
+ "unit",
2338
+ "fieldName",
2339
+ "rollup",
2340
+ "rate"
2341
+ ]);
2326
2342
  const hasAdditionalProperties = false;
2327
2343
  const requiredKeys = [];
2328
- const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName"];
2344
+ const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName", "rollup", "rate"];
2329
2345
  const valKeys = new Set(Object.keys(value));
2330
2346
  const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
2331
2347
  const doesNotContainExtraKeys = [...valKeys].every((key) => modelKeys.has(key)) || hasAdditionalProperties;
@@ -2333,23 +2349,27 @@ function isJson23(value) {
2333
2349
  return containsRequiredOrOptionalKeys && doesNotContainExtraKeys && allPropertiesMatchFormat;
2334
2350
  }
2335
2351
  function fromJson23($model) {
2336
- const { "metric.key": metricKey, displayName, description, unit, fieldName } = $model;
2352
+ const { "metric.key": metricKey, displayName, description, unit, fieldName, rollup, rate } = $model;
2337
2353
  return {
2338
2354
  "metric.key": metricKey,
2339
2355
  displayName,
2340
2356
  description,
2341
2357
  unit,
2342
- fieldName
2358
+ fieldName,
2359
+ rollup,
2360
+ rate
2343
2361
  };
2344
2362
  }
2345
2363
  function toJson23($model) {
2346
- const { "metric.key": metricKey, displayName, description, unit, fieldName } = $model;
2364
+ const { "metric.key": metricKey, displayName, description, unit, fieldName, rollup, rate } = $model;
2347
2365
  return {
2348
2366
  "metric.key": metricKey,
2349
2367
  displayName,
2350
2368
  description,
2351
2369
  unit,
2352
- fieldName
2370
+ fieldName,
2371
+ rollup,
2372
+ rate
2353
2373
  };
2354
2374
  }
2355
2375
 
package/docs/DOCS.md CHANGED
@@ -7,7 +7,7 @@ description: Exposes an API to fetch records stored in Grail.
7
7
 
8
8
  Exposes an API to fetch records stored in Grail
9
9
 
10
- import NpmLogo from '@site/static/img/npm-logo.png';
10
+ import NpmLogo from "@site/static/img/npm-logo.png";
11
11
 
12
12
  <div class="row margin-bottom--md">
13
13
  <div class="col">
@@ -16,8 +16,10 @@ import NpmLogo from '@site/static/img/npm-logo.png';
16
16
  <img className="no-zoom" width="20px" src={NpmLogo} />
17
17
  </a>
18
18
  </div>
19
- <div class="col" style={{textAlign: 'right'}}>
20
- <a href="https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.7.2">v1.7.2</a>
19
+ <div class="col" style={{ textAlign: "right" }}>
20
+ <a href="https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.8.1">
21
+ v1.8.1
22
+ </a>
21
23
  </div>
22
24
  </div>
23
25
 
@@ -40,7 +42,7 @@ import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
40
42
 
41
43
  Get a structured list of suggestions for the query at the given position.
42
44
 
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).
45
+ For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
44
46
 
45
47
  <h2> Overview</h2>
46
48
 
@@ -119,7 +121,7 @@ const data = await queryAssistanceClient.queryAutocomplete({
119
121
 
120
122
  Get a structured tree of the canonical form of the query.
121
123
 
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).
124
+ For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
123
125
 
124
126
  <h2> Overview</h2>
125
127
 
@@ -354,7 +356,7 @@ const data = await queryAssistanceClient.queryParse({
354
356
 
355
357
  Verifies a query without executing it.
356
358
 
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).
359
+ For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
358
360
 
359
361
  <h2> Overview</h2>
360
362
 
@@ -410,7 +412,7 @@ import { queryExecutionClient } from "@dynatrace-sdk/client-query";
410
412
 
411
413
  Cancels the query and returns the result if the query was already finished, otherwise discards it.
412
414
 
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).
415
+ For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
414
416
 
415
417
  <h3> Overview:</h3>
416
418
 
@@ -485,7 +487,7 @@ const data = await queryExecutionClient.queryCancel({
485
487
 
486
488
  Starts a Grail query.
487
489
 
488
- 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).
490
+ For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
489
491
 
490
492
  <h3> Overview:</h3>
491
493
 
@@ -565,7 +567,7 @@ const data = await queryExecutionClient.queryExecute({
565
567
 
566
568
  Retrieves query status and final result from Grail.
567
569
 
568
- 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).
570
+ For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
569
571
 
570
572
  <h3> Overview:</h3>
571
573
 
@@ -761,7 +763,7 @@ Detailed information about the error.
761
763
  | defaultTimeframeEnd | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The query timeframe 'end' timestamp in ISO-8601 or RFC399 format. If the timeframe 'start' parameter is missing, the whole timeframe is ignored. <em>Note that if a timeframe is specified within the query string (query) then it has precedence over this query request parameter.</em> |
762
764
  | defaultTimeframeStart | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The query timeframe 'start' timestamp in ISO-8601 or RFC399 format. If the timeframe 'end' parameter is missing, the whole timeframe is ignored. <em>Note that if a timeframe is specified within the query string (query) then it has precedence over this query request parameter.</em> |
763
765
  | enablePreview | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Boolean">boolean</a> | Request preview results. If a preview is available within the requestTimeoutMilliseconds, then it will be returned as part of the response. |
764
- | fetchTimeoutSeconds | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The query will stop after reaching the fetch-timeout. |
766
+ | fetchTimeoutSeconds | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The query will stop reading data after reaching the fetch-timeout. The query execution will continue, providing a partial result based on the read data. |
765
767
  | locale | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | 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'. |
766
768
  | maxResultBytes | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The maximum number of result bytes that this query will return. |
767
769
  | maxResultRecords | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The maximum number of result records that this query will return. |
@@ -839,6 +841,8 @@ An object that defines additional metric metadata.
839
841
  | displayName | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The display name of the metadata. |
840
842
  | fieldName | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The name of the associated field used in the query. |
841
843
  | metric.key | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The metric key. |
844
+ | rate | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The specified rate normalization parameter. |
845
+ | rollup | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | Metadata about the rollup type. |
842
846
  | unit | <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a> | The unit used. |
843
847
 
844
848
  ### ParseRequest
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "dynagen": {
3
- "version": "0.12.9",
3
+ "version": "0.13.1",
4
4
  "generatedAt": "",
5
5
  "template": {
6
6
  "name": "@dynatrace-sdk/template-typescript-client",
7
- "version": "0.18.6"
7
+ "version": "0.18.10"
8
8
  },
9
9
  "featureFlags": {
10
10
  "typeguards": true
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "spec": {
14
14
  "title": "DQL Query",
15
- "version": "1.6.0",
15
+ "version": "1.7.0",
16
16
  "baseUrl": "/platform/storage/query/v1"
17
17
  }
18
18
  }
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright 2023 Dynatrace LLC
3
+ * Copyright 2023-2024 Dynatrace LLC
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
6
6
  * You may obtain a copy of the License at
@@ -2248,10 +2248,18 @@ function isMetricMetadata(value) {
2248
2248
  if (Array.isArray(value)) {
2249
2249
  return false;
2250
2250
  }
2251
- const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit", "fieldName"]);
2251
+ const modelKeys = /* @__PURE__ */ new Set([
2252
+ "metric.key",
2253
+ "displayName",
2254
+ "description",
2255
+ "unit",
2256
+ "fieldName",
2257
+ "rollup",
2258
+ "rate"
2259
+ ]);
2252
2260
  const hasAdditionalProperties = false;
2253
2261
  const requiredKeys = [];
2254
- const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName"];
2262
+ const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName", "rollup", "rate"];
2255
2263
  const valKeys = new Set(Object.keys(value));
2256
2264
  const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
2257
2265
  const doesNotContainExtraKeys = [...valKeys].every((key) => modelKeys.has(key)) || hasAdditionalProperties;
@@ -2268,10 +2276,18 @@ function isJson23(value) {
2268
2276
  if (Array.isArray(value)) {
2269
2277
  return false;
2270
2278
  }
2271
- const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit", "fieldName"]);
2279
+ const modelKeys = /* @__PURE__ */ new Set([
2280
+ "metric.key",
2281
+ "displayName",
2282
+ "description",
2283
+ "unit",
2284
+ "fieldName",
2285
+ "rollup",
2286
+ "rate"
2287
+ ]);
2272
2288
  const hasAdditionalProperties = false;
2273
2289
  const requiredKeys = [];
2274
- const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName"];
2290
+ const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName", "rollup", "rate"];
2275
2291
  const valKeys = new Set(Object.keys(value));
2276
2292
  const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
2277
2293
  const doesNotContainExtraKeys = [...valKeys].every((key) => modelKeys.has(key)) || hasAdditionalProperties;
@@ -2279,23 +2295,27 @@ function isJson23(value) {
2279
2295
  return containsRequiredOrOptionalKeys && doesNotContainExtraKeys && allPropertiesMatchFormat;
2280
2296
  }
2281
2297
  function fromJson23($model) {
2282
- const { "metric.key": metricKey, displayName, description, unit, fieldName } = $model;
2298
+ const { "metric.key": metricKey, displayName, description, unit, fieldName, rollup, rate } = $model;
2283
2299
  return {
2284
2300
  "metric.key": metricKey,
2285
2301
  displayName,
2286
2302
  description,
2287
2303
  unit,
2288
- fieldName
2304
+ fieldName,
2305
+ rollup,
2306
+ rate
2289
2307
  };
2290
2308
  }
2291
2309
  function toJson23($model) {
2292
- const { "metric.key": metricKey, displayName, description, unit, fieldName } = $model;
2310
+ const { "metric.key": metricKey, displayName, description, unit, fieldName, rollup, rate } = $model;
2293
2311
  return {
2294
2312
  "metric.key": metricKey,
2295
2313
  displayName,
2296
2314
  description,
2297
2315
  unit,
2298
- fieldName
2316
+ fieldName,
2317
+ rollup,
2318
+ rate
2299
2319
  };
2300
2320
  }
2301
2321
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace-sdk/client-query",
3
- "version": "1.7.2",
3
+ "version": "1.8.1",
4
4
  "description": "Exposes an API to fetch records stored in Grail.",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {
@@ -19,7 +19,7 @@ export declare class QueryAssistanceClient {
19
19
  /**
20
20
  * Verifies a query without executing it.
21
21
  *
22
- * 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).
22
+ * For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
23
23
  *
24
24
  * ## Overview
25
25
  *
@@ -46,7 +46,7 @@ export declare class QueryAssistanceClient {
46
46
  /**
47
47
  * Get a structured tree of the canonical form of the query.
48
48
  *
49
- * 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).
49
+ * For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
50
50
  *
51
51
  * ## Overview
52
52
  *
@@ -258,7 +258,7 @@ export declare class QueryAssistanceClient {
258
258
  /**
259
259
  * Get a structured list of suggestions for the query at the given position.
260
260
  *
261
- * 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).
261
+ * For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
262
262
  *
263
263
  * ## Overview
264
264
  *
@@ -16,7 +16,7 @@ export declare class QueryExecutionClient {
16
16
  /**
17
17
  * Retrieves query status and final result from Grail.
18
18
  *
19
- * 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).
19
+ * For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
20
20
  *
21
21
  * ### Overview:
22
22
  *
@@ -67,7 +67,7 @@ export declare class QueryExecutionClient {
67
67
  /**
68
68
  * Starts a Grail query.
69
69
  *
70
- * 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).
70
+ * For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
71
71
  *
72
72
  * ### Overview:
73
73
  *
@@ -124,7 +124,7 @@ export declare class QueryExecutionClient {
124
124
  /**
125
125
  * Cancels the query and returns the result if the query was already finished, otherwise discards it.
126
126
  *
127
- * 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).
127
+ * For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://docs.dynatrace.com/docs/shortlink/assign-bucket-table-permissions).
128
128
  *
129
129
  * ### Overview:
130
130
  *
@@ -28,7 +28,7 @@ export interface ExecuteRequest {
28
28
  */
29
29
  maxResultBytes?: number;
30
30
  /**
31
- * The query will stop after reaching the fetch-timeout.
31
+ * The query will stop reading data after reaching the fetch-timeout. The query execution will continue, providing a partial result based on the read data.
32
32
  */
33
33
  fetchTimeoutSeconds?: number;
34
34
  /**
@@ -22,4 +22,12 @@ export interface MetricMetadata {
22
22
  * The name of the associated field used in the query.
23
23
  */
24
24
  fieldName?: string;
25
+ /**
26
+ * Metadata about the rollup type.
27
+ */
28
+ rollup?: string;
29
+ /**
30
+ * The specified rate normalization parameter.
31
+ */
32
+ rate?: string;
25
33
  }
@@ -5,6 +5,8 @@ export interface AsJson {
5
5
  description?: string;
6
6
  unit?: string;
7
7
  fieldName?: string;
8
+ rollup?: string;
9
+ rate?: string;
8
10
  }
9
11
  export declare function isMetricMetadata(value: any): value is MetricMetadata;
10
12
  export declare function isJson(value: any): value is AsJson;