@dynatrace-sdk/client-query 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  @dynatrace-sdk/client-query
4
4
 
5
+ ## 1.3.0
6
+
7
+ ### Minor Changes
8
+
9
+ - Expose the metric metadata `fieldName`.
10
+
5
11
  ## 1.2.2
6
12
 
7
13
  ### 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.2.2-blue)](https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.2.2)
3
+ [![npm](https://img.shields.io/badge/npm-v1.3.0-blue)](https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.3.0)
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
@@ -2185,10 +2185,10 @@ function isMetricMetadata(value) {
2185
2185
  if (Array.isArray(value)) {
2186
2186
  return false;
2187
2187
  }
2188
- const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit"]);
2188
+ const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit", "fieldName"]);
2189
2189
  const hasAdditionalProperties = false;
2190
2190
  const requiredKeys = [];
2191
- const optionalKeys = ["metric.key", "displayName", "description", "unit"];
2191
+ const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName"];
2192
2192
  const valKeys = new Set(Object.keys(value));
2193
2193
  const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
2194
2194
  const doesNotContainExtraKeys = [...valKeys].every((key) => modelKeys.has(key)) || hasAdditionalProperties;
@@ -2204,31 +2204,33 @@ function isJson23(value) {
2204
2204
  if (Array.isArray(value)) {
2205
2205
  return false;
2206
2206
  }
2207
- const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit"]);
2207
+ const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit", "fieldName"]);
2208
2208
  const hasAdditionalProperties = false;
2209
2209
  const requiredKeys = [];
2210
- const optionalKeys = ["metric.key", "displayName", "description", "unit"];
2210
+ const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName"];
2211
2211
  const valKeys = new Set(Object.keys(value));
2212
2212
  const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
2213
2213
  const doesNotContainExtraKeys = [...valKeys].every((key) => modelKeys.has(key)) || hasAdditionalProperties;
2214
2214
  return containsRequiredOrOptionalKeys && doesNotContainExtraKeys;
2215
2215
  }
2216
2216
  function fromJson23($model) {
2217
- const { "metric.key": metricKey, displayName, description, unit } = $model;
2217
+ const { "metric.key": metricKey, displayName, description, unit, fieldName } = $model;
2218
2218
  return {
2219
2219
  "metric.key": metricKey,
2220
2220
  displayName,
2221
2221
  description,
2222
- unit
2222
+ unit,
2223
+ fieldName
2223
2224
  };
2224
2225
  }
2225
2226
  function toJson23($model) {
2226
- const { "metric.key": metricKey, displayName, description, unit } = $model;
2227
+ const { "metric.key": metricKey, displayName, description, unit, fieldName } = $model;
2227
2228
  return {
2228
2229
  "metric.key": metricKey,
2229
2230
  displayName,
2230
2231
  description,
2231
- unit
2232
+ unit,
2233
+ fieldName
2232
2234
  };
2233
2235
  }
2234
2236
 
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.2.2">v1.2.2</a>
20
+ <a href="https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.3.0">v1.3.0</a>
21
21
  </div>
22
22
  </div>
23
23
 
@@ -198,11 +198,11 @@ each node is of one of following types and may contain more fields:
198
198
 
199
199
  can be identified by checking whether `canonicalString` is present
200
200
 
201
- | Field | Mandatory | Description |
202
- | ---------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
203
- | type | yes | the type of the terminal node - do not confuse with the type of container nodes |
204
- | canonicalString | yes | the canonical string representation. Concatenating the canonicalString of all nested terminal nodes provides the canonical form of the query. |
205
- | 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](#special-node-type-parameters) |
201
+ | Field | Mandatory | Description |
202
+ | ---------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
203
+ | type | yes | the type of the terminal node - do not confuse with the type of container nodes |
204
+ | canonicalString | yes | the canonical string representation. Concatenating the canonicalString of all nested terminal nodes provides the canonical form of the query. |
205
+ | 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 |
206
206
 
207
207
  ##### Current types of terminal nodes (list might grow):
208
208
 
@@ -1665,6 +1665,15 @@ The display name of the metadata.
1665
1665
 
1666
1666
  </div>
1667
1667
 
1668
+ </div>
1669
+ <div class="padding-left--md padding-bottom--md">
1670
+ <strong>fieldName</strong>: <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a>
1671
+ <div class="padding-left--md">
1672
+
1673
+ The name of the associated field used in the query.
1674
+
1675
+ </div>
1676
+
1668
1677
  </div>
1669
1678
  <div class="padding-left--md padding-bottom--md">
1670
1679
  <strong>metric.key</strong>: <a href="https://developer.mozilla.org/en-US/docs/Glossary/String">string</a>
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "spec": {
14
14
  "title": "Storage – Query Service",
15
- "version": "1.1.0",
15
+ "version": "1.2.0",
16
16
  "baseUrl": "/platform/storage/query/v1"
17
17
  }
18
18
  }
package/esm/index.js CHANGED
@@ -2120,10 +2120,10 @@ function isMetricMetadata(value) {
2120
2120
  if (Array.isArray(value)) {
2121
2121
  return false;
2122
2122
  }
2123
- const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit"]);
2123
+ const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit", "fieldName"]);
2124
2124
  const hasAdditionalProperties = false;
2125
2125
  const requiredKeys = [];
2126
- const optionalKeys = ["metric.key", "displayName", "description", "unit"];
2126
+ const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName"];
2127
2127
  const valKeys = new Set(Object.keys(value));
2128
2128
  const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
2129
2129
  const doesNotContainExtraKeys = [...valKeys].every((key) => modelKeys.has(key)) || hasAdditionalProperties;
@@ -2139,31 +2139,33 @@ function isJson23(value) {
2139
2139
  if (Array.isArray(value)) {
2140
2140
  return false;
2141
2141
  }
2142
- const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit"]);
2142
+ const modelKeys = /* @__PURE__ */ new Set(["metric.key", "displayName", "description", "unit", "fieldName"]);
2143
2143
  const hasAdditionalProperties = false;
2144
2144
  const requiredKeys = [];
2145
- const optionalKeys = ["metric.key", "displayName", "description", "unit"];
2145
+ const optionalKeys = ["metric.key", "displayName", "description", "unit", "fieldName"];
2146
2146
  const valKeys = new Set(Object.keys(value));
2147
2147
  const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
2148
2148
  const doesNotContainExtraKeys = [...valKeys].every((key) => modelKeys.has(key)) || hasAdditionalProperties;
2149
2149
  return containsRequiredOrOptionalKeys && doesNotContainExtraKeys;
2150
2150
  }
2151
2151
  function fromJson23($model) {
2152
- const { "metric.key": metricKey, displayName, description, unit } = $model;
2152
+ const { "metric.key": metricKey, displayName, description, unit, fieldName } = $model;
2153
2153
  return {
2154
2154
  "metric.key": metricKey,
2155
2155
  displayName,
2156
2156
  description,
2157
- unit
2157
+ unit,
2158
+ fieldName
2158
2159
  };
2159
2160
  }
2160
2161
  function toJson23($model) {
2161
- const { "metric.key": metricKey, displayName, description, unit } = $model;
2162
+ const { "metric.key": metricKey, displayName, description, unit, fieldName } = $model;
2162
2163
  return {
2163
2164
  "metric.key": metricKey,
2164
2165
  displayName,
2165
2166
  description,
2166
- unit
2167
+ unit,
2168
+ fieldName
2167
2169
  };
2168
2170
  }
2169
2171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynatrace-sdk/client-query",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "dependencies": {
5
5
  "@dynatrace-sdk/http-client": "^1.0.3"
6
6
  },
@@ -18,4 +18,8 @@ export interface MetricMetadata {
18
18
  * The unit used.
19
19
  */
20
20
  unit?: string;
21
+ /**
22
+ * The name of the associated field used in the query.
23
+ */
24
+ fieldName?: string;
21
25
  }
@@ -4,6 +4,7 @@ export interface AsJson {
4
4
  displayName?: string;
5
5
  description?: string;
6
6
  unit?: string;
7
+ fieldName?: string;
7
8
  }
8
9
  export declare function isMetricMetadata(value: any): value is MetricMetadata;
9
10
  export declare function isJson(value: any): value is AsJson;