@dynatrace-sdk/client-query 1.4.3 → 1.5.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 +14 -1
- package/README.md +1 -1
- package/cjs/index.js +54 -2
- package/docs/DOCS.md +5 -5
- package/dynatrace-metadata.json +4 -4
- package/esm/index.js +54 -2
- package/package.json +1 -1
- package/types/packages/client/query/src/lib/apis/query-assistance-api.d.ts +1 -1
- package/types/packages/client/query/src/lib/apis/query-execution-api.d.ts +1 -1
- package/types/packages/client/query/src/lib/models/geo-point.d.ts +2 -2
- package/types/packages/http-client/src/lib/platform/http-client-response-error.d.ts +4 -1
- package/types/packages/platform/error-handlers/src/lib/types/common-serialized-error.d.ts +2 -0
- package/types/packages/platform/error-handlers/src/lib/types/http-serialized-error.d.ts +3 -0
- package/types/packages/platform/error-handlers/src/lib/types/serialized-error.d.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DQL Query
|
|
2
2
|
|
|
3
3
|
@dynatrace-sdk/client-query
|
|
4
4
|
|
|
5
|
+
## 1.5.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- Update JSDoc examples.
|
|
10
|
+
|
|
11
|
+
## 1.5.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- Change title from **Storage – Query Service** to **DQL Query**
|
|
16
|
+
- Support 400 error code for poll and cancel operations.
|
|
17
|
+
|
|
5
18
|
## 1.4.3
|
|
6
19
|
|
|
7
20
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @dynatrace-sdk/client-query
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.5.1)
|
|
4
4
|
[](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
|
@@ -3139,10 +3139,36 @@ var QueryExecutionClient = class {
|
|
|
3139
3139
|
if (200 <= status && status < 300) {
|
|
3140
3140
|
return true;
|
|
3141
3141
|
}
|
|
3142
|
-
return [410, 500].includes(status);
|
|
3142
|
+
return [400, 410, 500].includes(status);
|
|
3143
3143
|
}
|
|
3144
3144
|
});
|
|
3145
3145
|
switch (response.status) {
|
|
3146
|
+
case 400: {
|
|
3147
|
+
const responseValue = await response.body("json");
|
|
3148
|
+
try {
|
|
3149
|
+
const errorBody = fromJson15(responseValue);
|
|
3150
|
+
throw new ErrorEnvelopeError(
|
|
3151
|
+
"400",
|
|
3152
|
+
response,
|
|
3153
|
+
errorBody,
|
|
3154
|
+
getErrorMessage(
|
|
3155
|
+
errorBody,
|
|
3156
|
+
"The supplied request is wrong. Either the query itself or other parameters are wrong."
|
|
3157
|
+
)
|
|
3158
|
+
);
|
|
3159
|
+
} catch (err) {
|
|
3160
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
3161
|
+
throw err;
|
|
3162
|
+
}
|
|
3163
|
+
throw new InvalidResponseError(
|
|
3164
|
+
`QueryExecutionClient.query:poll:400`,
|
|
3165
|
+
err,
|
|
3166
|
+
responseValue,
|
|
3167
|
+
"ErrorEnvelope",
|
|
3168
|
+
void 0
|
|
3169
|
+
);
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3146
3172
|
case 410: {
|
|
3147
3173
|
const responseValue = await response.body("text");
|
|
3148
3174
|
throw new ClientRequestError(
|
|
@@ -3355,10 +3381,36 @@ var QueryExecutionClient = class {
|
|
|
3355
3381
|
if (200 <= status && status < 300) {
|
|
3356
3382
|
return true;
|
|
3357
3383
|
}
|
|
3358
|
-
return [410, 500].includes(status);
|
|
3384
|
+
return [400, 410, 500].includes(status);
|
|
3359
3385
|
}
|
|
3360
3386
|
});
|
|
3361
3387
|
switch (response.status) {
|
|
3388
|
+
case 400: {
|
|
3389
|
+
const responseValue = await response.body("json");
|
|
3390
|
+
try {
|
|
3391
|
+
const errorBody = fromJson15(responseValue);
|
|
3392
|
+
throw new ErrorEnvelopeError(
|
|
3393
|
+
"400",
|
|
3394
|
+
response,
|
|
3395
|
+
errorBody,
|
|
3396
|
+
getErrorMessage(
|
|
3397
|
+
errorBody,
|
|
3398
|
+
"The supplied request is wrong. Either the query itself or other parameters are wrong."
|
|
3399
|
+
)
|
|
3400
|
+
);
|
|
3401
|
+
} catch (err) {
|
|
3402
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
3403
|
+
throw err;
|
|
3404
|
+
}
|
|
3405
|
+
throw new InvalidResponseError(
|
|
3406
|
+
`QueryExecutionClient.query:cancel:400`,
|
|
3407
|
+
err,
|
|
3408
|
+
responseValue,
|
|
3409
|
+
"ErrorEnvelope",
|
|
3410
|
+
void 0
|
|
3411
|
+
);
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3362
3414
|
case 410: {
|
|
3363
3415
|
const responseValue = await response.body("text");
|
|
3364
3416
|
throw new ClientRequestError(
|
package/docs/DOCS.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: "DQL Query"
|
|
3
3
|
description: Exposes an API to fetch records stored in Grail.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# DQL Query
|
|
7
7
|
|
|
8
8
|
Exposes an API to fetch records stored in Grail
|
|
9
9
|
|
|
@@ -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.
|
|
20
|
+
<a href="https://www.npmjs.com/package/@dynatrace-sdk/client-query/v/1.5.1">v1.5.1</a>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
@@ -783,8 +783,8 @@ DQL data type representing a geolocation point.
|
|
|
783
783
|
|
|
784
784
|
| Name | Type | Description |
|
|
785
785
|
| ------------------------------ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
786
|
-
| latitude<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The coordinate that specifies the north
|
|
787
|
-
| longitude<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The coordinate that specifies the east
|
|
786
|
+
| latitude<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The coordinate that specifies the north-south position of a point on the surface of the earth. |
|
|
787
|
+
| longitude<sup>\*required</sup> | <a href="https://developer.mozilla.org/en-US/docs/Glossary/Number">number</a> | The coordinate that specifies the east-west position of a point on the surface of the earth. |
|
|
788
788
|
|
|
789
789
|
### GrailMetadata
|
|
790
790
|
|
package/dynatrace-metadata.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dynagen": {
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5",
|
|
4
4
|
"generatedAt": "",
|
|
5
5
|
"template": {
|
|
6
6
|
"name": "@dynatrace-sdk/template-typescript-client",
|
|
7
|
-
"version": "0.17.
|
|
7
|
+
"version": "0.17.13"
|
|
8
8
|
},
|
|
9
9
|
"featureFlags": {
|
|
10
10
|
"typeguards": true
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"spec": {
|
|
14
|
-
"title": "
|
|
15
|
-
"version": "1.
|
|
14
|
+
"title": "DQL Query",
|
|
15
|
+
"version": "1.4.0",
|
|
16
16
|
"baseUrl": "/platform/storage/query/v1"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/esm/index.js
CHANGED
|
@@ -3073,10 +3073,36 @@ var QueryExecutionClient = class {
|
|
|
3073
3073
|
if (200 <= status && status < 300) {
|
|
3074
3074
|
return true;
|
|
3075
3075
|
}
|
|
3076
|
-
return [410, 500].includes(status);
|
|
3076
|
+
return [400, 410, 500].includes(status);
|
|
3077
3077
|
}
|
|
3078
3078
|
});
|
|
3079
3079
|
switch (response.status) {
|
|
3080
|
+
case 400: {
|
|
3081
|
+
const responseValue = await response.body("json");
|
|
3082
|
+
try {
|
|
3083
|
+
const errorBody = fromJson15(responseValue);
|
|
3084
|
+
throw new ErrorEnvelopeError(
|
|
3085
|
+
"400",
|
|
3086
|
+
response,
|
|
3087
|
+
errorBody,
|
|
3088
|
+
getErrorMessage(
|
|
3089
|
+
errorBody,
|
|
3090
|
+
"The supplied request is wrong. Either the query itself or other parameters are wrong."
|
|
3091
|
+
)
|
|
3092
|
+
);
|
|
3093
|
+
} catch (err) {
|
|
3094
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
3095
|
+
throw err;
|
|
3096
|
+
}
|
|
3097
|
+
throw new InvalidResponseError(
|
|
3098
|
+
`QueryExecutionClient.query:poll:400`,
|
|
3099
|
+
err,
|
|
3100
|
+
responseValue,
|
|
3101
|
+
"ErrorEnvelope",
|
|
3102
|
+
void 0
|
|
3103
|
+
);
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3080
3106
|
case 410: {
|
|
3081
3107
|
const responseValue = await response.body("text");
|
|
3082
3108
|
throw new ClientRequestError(
|
|
@@ -3289,10 +3315,36 @@ var QueryExecutionClient = class {
|
|
|
3289
3315
|
if (200 <= status && status < 300) {
|
|
3290
3316
|
return true;
|
|
3291
3317
|
}
|
|
3292
|
-
return [410, 500].includes(status);
|
|
3318
|
+
return [400, 410, 500].includes(status);
|
|
3293
3319
|
}
|
|
3294
3320
|
});
|
|
3295
3321
|
switch (response.status) {
|
|
3322
|
+
case 400: {
|
|
3323
|
+
const responseValue = await response.body("json");
|
|
3324
|
+
try {
|
|
3325
|
+
const errorBody = fromJson15(responseValue);
|
|
3326
|
+
throw new ErrorEnvelopeError(
|
|
3327
|
+
"400",
|
|
3328
|
+
response,
|
|
3329
|
+
errorBody,
|
|
3330
|
+
getErrorMessage(
|
|
3331
|
+
errorBody,
|
|
3332
|
+
"The supplied request is wrong. Either the query itself or other parameters are wrong."
|
|
3333
|
+
)
|
|
3334
|
+
);
|
|
3335
|
+
} catch (err) {
|
|
3336
|
+
if (err instanceof ErrorEnvelopeError) {
|
|
3337
|
+
throw err;
|
|
3338
|
+
}
|
|
3339
|
+
throw new InvalidResponseError(
|
|
3340
|
+
`QueryExecutionClient.query:cancel:400`,
|
|
3341
|
+
err,
|
|
3342
|
+
responseValue,
|
|
3343
|
+
"ErrorEnvelope",
|
|
3344
|
+
void 0
|
|
3345
|
+
);
|
|
3346
|
+
}
|
|
3347
|
+
}
|
|
3296
3348
|
case 410: {
|
|
3297
3349
|
const responseValue = await response.body("text");
|
|
3298
3350
|
throw new ClientRequestError(
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ export declare class QueryAssistanceClient {
|
|
|
13
13
|
/**
|
|
14
14
|
* @param {HttpClient} httpClientImplementation - You can provide custom http client as a parameter to constructor of a QueryAssistanceClient. Custom http client should implement {HttpClient} interface.
|
|
15
15
|
* @example
|
|
16
|
-
* const
|
|
16
|
+
* const queryAssistanceClientNodeJs = new QueryAssistanceClient(yourCustomImplementation);
|
|
17
17
|
*/
|
|
18
18
|
constructor(httpClientImplementation: HttpClient);
|
|
19
19
|
/**
|
|
@@ -10,7 +10,7 @@ export declare class QueryExecutionClient {
|
|
|
10
10
|
/**
|
|
11
11
|
* @param {HttpClient} httpClientImplementation - You can provide custom http client as a parameter to constructor of a QueryExecutionClient. Custom http client should implement {HttpClient} interface.
|
|
12
12
|
* @example
|
|
13
|
-
* const
|
|
13
|
+
* const queryExecutionClientNodeJs = new QueryExecutionClient(yourCustomImplementation);
|
|
14
14
|
*/
|
|
15
15
|
constructor(httpClientImplementation: HttpClient);
|
|
16
16
|
/**
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface GeoPoint {
|
|
5
5
|
/**
|
|
6
|
-
* The coordinate that specifies the north
|
|
6
|
+
* The coordinate that specifies the north-south position of a point on the surface of the earth.
|
|
7
7
|
*/
|
|
8
8
|
latitude: number;
|
|
9
9
|
/**
|
|
10
|
-
* The coordinate that specifies the east
|
|
10
|
+
* The coordinate that specifies the east-west position of a point on the surface of the earth.
|
|
11
11
|
*/
|
|
12
12
|
longitude: number;
|
|
13
13
|
}
|
|
@@ -4,5 +4,8 @@ import { BaseError } from './base-error';
|
|
|
4
4
|
export declare class HttpClientResponseError extends BaseError implements types.HttpClientResponseError {
|
|
5
5
|
readonly name = "ResponseError";
|
|
6
6
|
readonly response: HttpClientResponse;
|
|
7
|
-
|
|
7
|
+
readonly requestMethod?: string;
|
|
8
|
+
constructor(response: Response, data?: {
|
|
9
|
+
requestMethod?: string;
|
|
10
|
+
});
|
|
8
11
|
}
|
|
@@ -5,4 +5,6 @@ import { HttpSerializedError } from './http-serialized-error';
|
|
|
5
5
|
*
|
|
6
6
|
* @property {ErrorType} type error type
|
|
7
7
|
*/
|
|
8
|
-
export declare type SerializedError = HttpSerializedError | CommonSerializedError
|
|
8
|
+
export declare type SerializedError = (HttpSerializedError | CommonSerializedError) & {
|
|
9
|
+
traceId?: string;
|
|
10
|
+
};
|