@dynatrace-sdk/client-query 1.2.0 → 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 +27 -8
- package/README.md +12 -41
- package/cjs/index.js +10 -8
- package/docs/DOCS.md +243 -798
- package/dynatrace-metadata.json +3 -6
- package/esm/index.js +10 -8
- package/package.json +1 -1
- package/types/packages/client/query/src/lib/apis/query-assistance-api.d.ts +27 -0
- package/types/packages/client/query/src/lib/apis/query-execution-api.d.ts +28 -0
- package/types/packages/client/query/src/lib/models/metric-metadata.d.ts +4 -0
- package/types/packages/client/query/src/lib/models/metric-metadata.transformation.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,17 +2,36 @@
|
|
|
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
|
+
|
|
11
|
+
## 1.2.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Update docs.
|
|
16
|
+
|
|
17
|
+
## 1.2.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Add JSDoc @example for operations.
|
|
22
|
+
- Fix handling of the application/cloudevent+json content type.
|
|
23
|
+
|
|
5
24
|
## 1.2.0
|
|
6
25
|
|
|
7
26
|
### Minor Changes
|
|
8
27
|
|
|
9
|
-
-
|
|
28
|
+
- Add `sampled` property to GrailMetadata
|
|
10
29
|
|
|
11
30
|
## 1.1.0
|
|
12
31
|
|
|
13
32
|
### Minor Changes
|
|
14
33
|
|
|
15
|
-
-
|
|
34
|
+
- Export model transformations
|
|
16
35
|
|
|
17
36
|
## 1.0.6
|
|
18
37
|
|
|
@@ -25,14 +44,14 @@
|
|
|
25
44
|
|
|
26
45
|
### Patch Changes
|
|
27
46
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
47
|
+
- Update `@dynatrace-sdk/http-client` to `^1.0.1`
|
|
48
|
+
- Use parsed response body in error serializer
|
|
30
49
|
|
|
31
50
|
## 1.0.4
|
|
32
51
|
|
|
33
52
|
### Patch Changes
|
|
34
53
|
|
|
35
|
-
-
|
|
54
|
+
- Send response body in error serializer
|
|
36
55
|
- Updated dependencies
|
|
37
56
|
- @dynatrace-sdk/http-client@1.0.0
|
|
38
57
|
|
|
@@ -40,13 +59,13 @@
|
|
|
40
59
|
|
|
41
60
|
### Patch Changes
|
|
42
61
|
|
|
43
|
-
-
|
|
62
|
+
- Updated descriptions and examples.
|
|
44
63
|
|
|
45
64
|
## 1.0.2
|
|
46
65
|
|
|
47
66
|
### Patch Changes
|
|
48
67
|
|
|
49
|
-
-
|
|
68
|
+
- Generate client package with template-typescript-client v0.13.10. Query question mark is now removed from url when there are no search params.
|
|
50
69
|
|
|
51
70
|
## 1.0.1
|
|
52
71
|
|
|
@@ -62,4 +81,4 @@
|
|
|
62
81
|
|
|
63
82
|
### Major Changes
|
|
64
83
|
|
|
65
|
-
-
|
|
84
|
+
- Initial release of @dynatrace-sdk/client-query.
|
package/README.md
CHANGED
|
@@ -1,54 +1,25 @@
|
|
|
1
|
-
#
|
|
2
|
-
API version: `1.1.0`.
|
|
1
|
+
# @dynatrace-sdk/client-query
|
|
3
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.3.0)
|
|
4
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Exposes an API to fetch records stored in Grail
|
|
6
|
+
Exposes an API to fetch records stored in Grail
|
|
8
7
|
|
|
9
8
|
## Installation
|
|
10
9
|
|
|
11
|
-
```
|
|
10
|
+
```bash
|
|
12
11
|
npm install @dynatrace-sdk/client-query
|
|
13
12
|
```
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## [Experimental] Using client in nodejs/jest environment
|
|
18
|
-
|
|
19
|
-
> **Important!** Node.js officially is not supported. This guide shows some workarounds to enable usage of the client in nodejs runtime.
|
|
20
|
-
|
|
21
|
-
There is a possibility to use SDK clients in nodejs runtime. This may require additional setup:
|
|
22
|
-
First, developer may need to polyfill `fetch` function with some library like [undici](https://github.com/nodejs/undici) or [node-fetch](https://github.com/node-fetch/node-fetch).
|
|
23
|
-
Then, developer would need to provide the implementation of [HttpClient](https://bitbucket.lab.dynatrace.org/projects/APPFW/repos/dynatrace-sdk/browse/packages/http-client/src/lib/types/http-client.ts) interface. Sample code to achieve this:
|
|
24
|
-
```typescript
|
|
25
|
-
import { PlatformHttpClientResponse } from '@dynatrace-sdk/http-client';
|
|
26
|
-
import { fetch } from 'undici';
|
|
27
|
-
|
|
28
|
-
const myHttpClient = {
|
|
29
|
-
async send(options: any) {
|
|
30
|
-
return new PlatformHttpClientResponse(
|
|
31
|
-
await (fetch(`http://localhost:3000${options.url}`, { // here we would need to patch the request url to include hostname.
|
|
32
|
-
method: options.method,
|
|
33
|
-
headers: options.headers,
|
|
34
|
-
signal: options.abortSignal,
|
|
35
|
-
body: JSON.stringify(options.body), // but this will not work for form-data content-type
|
|
36
|
-
}) as any),
|
|
37
|
-
);
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
```
|
|
14
|
+
## API reference
|
|
41
15
|
|
|
42
|
-
|
|
16
|
+
Full API reference for this SDK is available at [Dynatrace Developer](https://developer.dynatrace.com/reference/sdks/client-query/).
|
|
43
17
|
|
|
44
|
-
|
|
45
|
-
import {
|
|
46
|
-
SettingsObjectsClient,
|
|
47
|
-
} from '@dynatrace-sdk/client-example';
|
|
18
|
+
## Getting help
|
|
48
19
|
|
|
49
|
-
|
|
20
|
+
- Visit [SDK for Typescript](https://developer.dynatrace.com/reference/sdks/) guide in the [Dynatrace Developer](https://developer.dynatrace.com/)
|
|
21
|
+
- Ask a question in the [Dynatrace Community](https://community.dynatrace.com/)
|
|
50
22
|
|
|
51
|
-
|
|
23
|
+
## License
|
|
52
24
|
|
|
53
|
-
|
|
54
|
-
```
|
|
25
|
+
This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE for more information.
|
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
|
|