@dynatrace-sdk/client-query 1.0.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 +9 -0
- package/LICENSE +174 -0
- package/README.md +54 -0
- package/cjs/index.js +1788 -0
- package/docs/DOCS.md +2833 -0
- package/dynatrace-metadata.json +18 -0
- package/esm/index.js +1766 -0
- package/package.json +11 -0
- package/types/index.d.ts +1 -0
- package/types/packages/client/query/src/index.d.ts +1 -0
- package/types/packages/client/query/src/lib/apis/index.d.ts +2 -0
- package/types/packages/client/query/src/lib/apis/query-assistance-api.d.ts +276 -0
- package/types/packages/client/query/src/lib/apis/query-execution-api.d.ts +337 -0
- package/types/packages/client/query/src/lib/error-envelopes/api-client-error.d.ts +9 -0
- package/types/packages/client/query/src/lib/error-envelopes/client-request-error.d.ts +8 -0
- package/types/packages/client/query/src/lib/error-envelopes/error-envelope-error.d.ts +8 -0
- package/types/packages/client/query/src/lib/error-envelopes/error-serializer.d.ts +3 -0
- package/types/packages/client/query/src/lib/error-envelopes/index.d.ts +3 -0
- package/types/packages/client/query/src/lib/error-envelopes/invalid-response-error.d.ts +8 -0
- package/types/packages/client/query/src/lib/index.d.ts +3 -0
- package/types/packages/client/query/src/lib/models/autocomplete-request.d.ts +26 -0
- package/types/packages/client/query/src/lib/models/autocomplete-response.d.ts +28 -0
- package/types/packages/client/query/src/lib/models/autocomplete-suggestion-part.d.ts +30 -0
- package/types/packages/client/query/src/lib/models/autocomplete-suggestion.d.ts +28 -0
- package/types/packages/client/query/src/lib/models/dql-alternative-node.d.ts +18 -0
- package/types/packages/client/query/src/lib/models/dql-container-node.d.ts +23 -0
- package/types/packages/client/query/src/lib/models/dql-node-node-type.d.ts +14 -0
- package/types/packages/client/query/src/lib/models/dql-node.d.ts +29 -0
- package/types/packages/client/query/src/lib/models/dql-terminal-node.d.ts +26 -0
- package/types/packages/client/query/src/lib/models/error-envelope.d.ts +18 -0
- package/types/packages/client/query/src/lib/models/error-response-details.d.ts +50 -0
- package/types/packages/client/query/src/lib/models/error-response.d.ts +25 -0
- package/types/packages/client/query/src/lib/models/execute-request.d.ts +64 -0
- package/types/packages/client/query/src/lib/models/field-type-type.d.ts +21 -0
- package/types/packages/client/query/src/lib/models/field-type.d.ts +18 -0
- package/types/packages/client/query/src/lib/models/geo-point.d.ts +22 -0
- package/types/packages/client/query/src/lib/models/grail-metadata.d.ts +66 -0
- package/types/packages/client/query/src/lib/models/index.d.ts +35 -0
- package/types/packages/client/query/src/lib/models/metadata-notification.d.ts +45 -0
- package/types/packages/client/query/src/lib/models/metadata.d.ts +18 -0
- package/types/packages/client/query/src/lib/models/metric-metadata.d.ts +32 -0
- package/types/packages/client/query/src/lib/models/parse-request.d.ts +24 -0
- package/types/packages/client/query/src/lib/models/position-info.d.ts +27 -0
- package/types/packages/client/query/src/lib/models/query-poll-response.d.ts +28 -0
- package/types/packages/client/query/src/lib/models/query-result.d.ts +27 -0
- package/types/packages/client/query/src/lib/models/query-start-response.d.ts +33 -0
- package/types/packages/client/query/src/lib/models/query-state.d.ts +17 -0
- package/types/packages/client/query/src/lib/models/ranged-field-types-mappings.d.ts +15 -0
- package/types/packages/client/query/src/lib/models/ranged-field-types.d.ts +20 -0
- package/types/packages/client/query/src/lib/models/result-record-value.d.ts +13 -0
- package/types/packages/client/query/src/lib/models/result-record.d.ts +15 -0
- package/types/packages/client/query/src/lib/models/timeframe.d.ts +22 -0
- package/types/packages/client/query/src/lib/models/token-position.d.ts +20 -0
- package/types/packages/client/query/src/lib/models/token-type.d.ts +48 -0
- package/types/packages/client/query/src/lib/models/verify-request.d.ts +24 -0
- package/types/packages/client/query/src/lib/models/verify-response.d.ts +23 -0
- package/types/packages/client/query/src/lib/utils/url-helpers.d.ts +3 -0
- package/types/packages/http-client/src/index.d.ts +2 -0
- package/types/packages/http-client/src/lib/platform/abort-controller.d.ts +6 -0
- package/types/packages/http-client/src/lib/platform/abort-signal.d.ts +6 -0
- package/types/packages/http-client/src/lib/platform/apply-content-type-header.d.ts +2 -0
- package/types/packages/http-client/src/lib/platform/base-error.d.ts +5 -0
- package/types/packages/http-client/src/lib/platform/binary.d.ts +13 -0
- package/types/packages/http-client/src/lib/platform/data-type-error.d.ts +6 -0
- package/types/packages/http-client/src/lib/platform/decode-response-body.d.ts +3 -0
- package/types/packages/http-client/src/lib/platform/default-status-validator.d.ts +2 -0
- package/types/packages/http-client/src/lib/platform/encode-request-body.d.ts +2 -0
- package/types/packages/http-client/src/lib/platform/http-client-abort-error.d.ts +7 -0
- package/types/packages/http-client/src/lib/platform/http-client-request-error.d.ts +7 -0
- package/types/packages/http-client/src/lib/platform/http-client-response-error-serializer.d.ts +1 -0
- package/types/packages/http-client/src/lib/platform/http-client-response-error.d.ts +8 -0
- package/types/packages/http-client/src/lib/platform/http-client-response.d.ts +10 -0
- package/types/packages/http-client/src/lib/platform/http-client.d.ts +5 -0
- package/types/packages/http-client/src/lib/platform/index.d.ts +11 -0
- package/types/packages/http-client/src/lib/platform/unsupported-operation-error.d.ts +6 -0
- package/types/packages/http-client/src/lib/types/abort-controller.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/abort-signal.d.ts +15 -0
- package/types/packages/http-client/src/lib/types/base-error.d.ts +4 -0
- package/types/packages/http-client/src/lib/types/binary.d.ts +15 -0
- package/types/packages/http-client/src/lib/types/data-type-error.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/data-types.d.ts +36 -0
- package/types/packages/http-client/src/lib/types/form-data-request-body.d.ts +83 -0
- package/types/packages/http-client/src/lib/types/form-data-response-body.d.ts +15 -0
- package/types/packages/http-client/src/lib/types/headers.d.ts +6 -0
- package/types/packages/http-client/src/lib/types/http-client-abort-error.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/http-client-network-error.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/http-client-request-error.d.ts +14 -0
- package/types/packages/http-client/src/lib/types/http-client-request-options.d.ts +42 -0
- package/types/packages/http-client/src/lib/types/http-client-response-error.d.ts +19 -0
- package/types/packages/http-client/src/lib/types/http-client-response.d.ts +33 -0
- package/types/packages/http-client/src/lib/types/http-client.d.ts +24 -0
- package/types/packages/http-client/src/lib/types/index.d.ts +20 -0
- package/types/packages/http-client/src/lib/types/request-body-types.d.ts +26 -0
- package/types/packages/http-client/src/lib/types/response-body-types.d.ts +46 -0
- package/types/packages/http-client/src/lib/types/status-validator.d.ts +7 -0
- package/types/packages/http-client/src/lib/types/unsupported-operation-error.d.ts +14 -0
- package/types/packages/platform/error-handlers/src/index.d.ts +2 -0
- package/types/packages/platform/error-handlers/src/lib/add-global-error-serializer.d.ts +13 -0
- package/types/packages/platform/error-handlers/src/lib/types/common-serialized-error.d.ts +10 -0
- package/types/packages/platform/error-handlers/src/lib/types/dt-runtime-error-handlers.d.ts +5 -0
- package/types/packages/platform/error-handlers/src/lib/types/error-type.d.ts +9 -0
- package/types/packages/platform/error-handlers/src/lib/types/global-dt-runtime-with-error-handlers.d.ts +7 -0
- package/types/packages/platform/error-handlers/src/lib/types/global-error-serializer.d.ts +10 -0
- package/types/packages/platform/error-handlers/src/lib/types/http-serialized-error.d.ts +11 -0
- package/types/packages/platform/error-handlers/src/lib/types/index.d.ts +6 -0
- package/types/packages/platform/error-handlers/src/lib/types/serialized-error.d.ts +8 -0
- package/types/packages/platform/shared/index.d.ts +1 -0
- package/types/packages/platform/shared/utils/get-global-with-dt-runtime.d.ts +1 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ParseRequest {
|
|
2
|
+
/**
|
|
3
|
+
* The full query string.
|
|
4
|
+
*/
|
|
5
|
+
query: string;
|
|
6
|
+
/**
|
|
7
|
+
* The query timezone. If none is specified, UTC is used as fallback. The list of valid input values matches that of the IANA Time Zone Database (TZDB). It accepts values in their canonical names like 'Europe/Paris', the abbreviated version like CET or the UTC offset format like '+01:00'
|
|
8
|
+
*/
|
|
9
|
+
timezone?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 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'.
|
|
12
|
+
*/
|
|
13
|
+
locale?: string;
|
|
14
|
+
}
|
|
15
|
+
/** @ignore */
|
|
16
|
+
export declare namespace _ParseRequestTransformation {
|
|
17
|
+
interface AsJson {
|
|
18
|
+
query: string;
|
|
19
|
+
timezone?: string;
|
|
20
|
+
locale?: string;
|
|
21
|
+
}
|
|
22
|
+
function fromJson(model: AsJson): ParseRequest;
|
|
23
|
+
function toJson(model: ParseRequest): AsJson;
|
|
24
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exact position in the query string.
|
|
3
|
+
*/
|
|
4
|
+
export interface PositionInfo {
|
|
5
|
+
/**
|
|
6
|
+
* Query position column zero based index.
|
|
7
|
+
*/
|
|
8
|
+
column: number;
|
|
9
|
+
/**
|
|
10
|
+
* Query position index.
|
|
11
|
+
*/
|
|
12
|
+
index: number;
|
|
13
|
+
/**
|
|
14
|
+
* Query position line zero based index.
|
|
15
|
+
*/
|
|
16
|
+
line: number;
|
|
17
|
+
}
|
|
18
|
+
/** @ignore */
|
|
19
|
+
export declare namespace _PositionInfoTransformation {
|
|
20
|
+
interface AsJson {
|
|
21
|
+
column: number;
|
|
22
|
+
index: number;
|
|
23
|
+
line: number;
|
|
24
|
+
}
|
|
25
|
+
function fromJson(model: AsJson): PositionInfo;
|
|
26
|
+
function toJson(model: PositionInfo): AsJson;
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { QueryResult, _QueryResultTransformation } from './query-result';
|
|
2
|
+
import { QueryState, _QueryStateTransformation } from './query-state';
|
|
3
|
+
/**
|
|
4
|
+
* The response of GET query:execute call.
|
|
5
|
+
*/
|
|
6
|
+
export interface QueryPollResponse {
|
|
7
|
+
result?: QueryResult;
|
|
8
|
+
/**
|
|
9
|
+
* Time to live in seconds.
|
|
10
|
+
*/
|
|
11
|
+
ttlSeconds?: number;
|
|
12
|
+
/**
|
|
13
|
+
* The progress of the query from 0 to 100.
|
|
14
|
+
*/
|
|
15
|
+
progress?: number;
|
|
16
|
+
state: QueryState;
|
|
17
|
+
}
|
|
18
|
+
/** @ignore */
|
|
19
|
+
export declare namespace _QueryPollResponseTransformation {
|
|
20
|
+
interface AsJson {
|
|
21
|
+
result?: _QueryResultTransformation.AsJson;
|
|
22
|
+
ttlSeconds?: number;
|
|
23
|
+
progress?: number;
|
|
24
|
+
state: _QueryStateTransformation.AsJson;
|
|
25
|
+
}
|
|
26
|
+
function fromJson(model: AsJson): QueryPollResponse;
|
|
27
|
+
function toJson(model: QueryPollResponse): AsJson;
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Metadata, _MetadataTransformation } from './metadata';
|
|
2
|
+
import { RangedFieldTypes, _RangedFieldTypesTransformation } from './ranged-field-types';
|
|
3
|
+
import { ResultRecord, _ResultRecordTransformation } from './result-record';
|
|
4
|
+
/**
|
|
5
|
+
* The result of the DQL query.
|
|
6
|
+
*/
|
|
7
|
+
export interface QueryResult {
|
|
8
|
+
/**
|
|
9
|
+
* List of records containing the result fields data.
|
|
10
|
+
*/
|
|
11
|
+
records: (ResultRecord | null)[];
|
|
12
|
+
metadata: Metadata;
|
|
13
|
+
/**
|
|
14
|
+
* The data types for the result records.
|
|
15
|
+
*/
|
|
16
|
+
types: RangedFieldTypes[];
|
|
17
|
+
}
|
|
18
|
+
/** @ignore */
|
|
19
|
+
export declare namespace _QueryResultTransformation {
|
|
20
|
+
interface AsJson {
|
|
21
|
+
records: (_ResultRecordTransformation.AsJson | null)[];
|
|
22
|
+
metadata: _MetadataTransformation.AsJson;
|
|
23
|
+
types: _RangedFieldTypesTransformation.AsJson[];
|
|
24
|
+
}
|
|
25
|
+
function fromJson(model: AsJson): QueryResult;
|
|
26
|
+
function toJson(model: QueryResult): AsJson;
|
|
27
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { QueryResult, _QueryResultTransformation } from './query-result';
|
|
2
|
+
import { QueryState, _QueryStateTransformation } from './query-state';
|
|
3
|
+
/**
|
|
4
|
+
* The response when starting a query.
|
|
5
|
+
*/
|
|
6
|
+
export interface QueryStartResponse {
|
|
7
|
+
result?: QueryResult;
|
|
8
|
+
/**
|
|
9
|
+
* Time to live in seconds.
|
|
10
|
+
*/
|
|
11
|
+
ttlSeconds?: number;
|
|
12
|
+
/**
|
|
13
|
+
* The progress of the query from 0 to 100.
|
|
14
|
+
*/
|
|
15
|
+
progress?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The token returned by the POST query:execute call.
|
|
18
|
+
*/
|
|
19
|
+
requestToken?: string;
|
|
20
|
+
state: QueryState;
|
|
21
|
+
}
|
|
22
|
+
/** @ignore */
|
|
23
|
+
export declare namespace _QueryStartResponseTransformation {
|
|
24
|
+
interface AsJson {
|
|
25
|
+
result?: _QueryResultTransformation.AsJson;
|
|
26
|
+
ttlSeconds?: number;
|
|
27
|
+
progress?: number;
|
|
28
|
+
requestToken?: string;
|
|
29
|
+
state: _QueryStateTransformation.AsJson;
|
|
30
|
+
}
|
|
31
|
+
function fromJson(model: AsJson): QueryStartResponse;
|
|
32
|
+
function toJson(model: QueryStartResponse): AsJson;
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Possible state of the query.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum QueryState {
|
|
5
|
+
NotStarted = "NOT_STARTED",
|
|
6
|
+
Running = "RUNNING",
|
|
7
|
+
Succeeded = "SUCCEEDED",
|
|
8
|
+
ResultGone = "RESULT_GONE",
|
|
9
|
+
Cancelled = "CANCELLED",
|
|
10
|
+
Failed = "FAILED"
|
|
11
|
+
}
|
|
12
|
+
/** @ignore */
|
|
13
|
+
export declare namespace _QueryStateTransformation {
|
|
14
|
+
type AsJson = QueryState;
|
|
15
|
+
const toJson: (value: QueryState) => AsJson;
|
|
16
|
+
const fromJson: (value: AsJson) => QueryState;
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FieldType, _FieldTypeTransformation } from './field-type';
|
|
2
|
+
/**
|
|
3
|
+
* The mapping between the field name and data type.
|
|
4
|
+
*/
|
|
5
|
+
export interface RangedFieldTypesMappings {
|
|
6
|
+
[propName: string]: FieldType | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** @ignore */
|
|
9
|
+
export declare namespace _RangedFieldTypesMappingsTransformation {
|
|
10
|
+
interface AsJson {
|
|
11
|
+
[propName: string]: _FieldTypeTransformation.AsJson | undefined;
|
|
12
|
+
}
|
|
13
|
+
function fromJson(model: AsJson): RangedFieldTypesMappings;
|
|
14
|
+
function toJson(model: RangedFieldTypesMappings): AsJson;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RangedFieldTypesMappings, _RangedFieldTypesMappingsTransformation } from './ranged-field-types-mappings';
|
|
2
|
+
/**
|
|
3
|
+
* The field type in range.
|
|
4
|
+
*/
|
|
5
|
+
export interface RangedFieldTypes {
|
|
6
|
+
mappings: RangedFieldTypesMappings;
|
|
7
|
+
/**
|
|
8
|
+
* The range of elements at use this type in arrays (null for records).
|
|
9
|
+
*/
|
|
10
|
+
indexRange?: number[];
|
|
11
|
+
}
|
|
12
|
+
/** @ignore */
|
|
13
|
+
export declare namespace _RangedFieldTypesTransformation {
|
|
14
|
+
interface AsJson {
|
|
15
|
+
mappings: _RangedFieldTypesMappingsTransformation.AsJson;
|
|
16
|
+
indexRange?: number[];
|
|
17
|
+
}
|
|
18
|
+
function fromJson(model: AsJson): RangedFieldTypes;
|
|
19
|
+
function toJson(model: RangedFieldTypes): AsJson;
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GeoPoint, _GeoPointTransformation } from '../models/geo-point';
|
|
2
|
+
import { ResultRecord, _ResultRecordTransformation } from '../models/result-record';
|
|
3
|
+
import { Timeframe, _TimeframeTransformation } from '../models/timeframe';
|
|
4
|
+
/**
|
|
5
|
+
* Single result field of a record.
|
|
6
|
+
* @typedef {boolean | number | string | Timeframe | GeoPoint | ResultRecord | null | (ResultRecordValue | null)[] | null} ResultRecordValue
|
|
7
|
+
*/
|
|
8
|
+
export declare type ResultRecordValue = boolean | number | string | Timeframe | GeoPoint | ResultRecord | null | (ResultRecordValue | null)[] | null;
|
|
9
|
+
export declare namespace _ResultRecordValueTransformation {
|
|
10
|
+
type AsJson = boolean | number | string | _TimeframeTransformation.AsJson | _GeoPointTransformation.AsJson | _ResultRecordTransformation.AsJson | null | (_ResultRecordValueTransformation.AsJson | null)[] | null;
|
|
11
|
+
function fromJson(model: AsJson): any;
|
|
12
|
+
function toJson(model: ResultRecordValue): any;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ResultRecordValue, _ResultRecordValueTransformation } from './result-record-value';
|
|
2
|
+
/**
|
|
3
|
+
* Single record that contains the result fields.
|
|
4
|
+
*/
|
|
5
|
+
export interface ResultRecord {
|
|
6
|
+
[propName: string]: ResultRecordValue | null | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** @ignore */
|
|
9
|
+
export declare namespace _ResultRecordTransformation {
|
|
10
|
+
interface AsJson {
|
|
11
|
+
[propName: string]: _ResultRecordValueTransformation.AsJson | null | undefined;
|
|
12
|
+
}
|
|
13
|
+
function fromJson(model: AsJson | null): ResultRecord | null;
|
|
14
|
+
function toJson(model: ResultRecord | null): AsJson | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DQL data type timeframe.
|
|
3
|
+
*/
|
|
4
|
+
export interface Timeframe {
|
|
5
|
+
/**
|
|
6
|
+
* The start time of the timeframe.
|
|
7
|
+
*/
|
|
8
|
+
start?: Date;
|
|
9
|
+
/**
|
|
10
|
+
* The end time of the timeframe.
|
|
11
|
+
*/
|
|
12
|
+
end?: Date;
|
|
13
|
+
}
|
|
14
|
+
/** @ignore */
|
|
15
|
+
export declare namespace _TimeframeTransformation {
|
|
16
|
+
interface AsJson {
|
|
17
|
+
start?: string;
|
|
18
|
+
end?: string;
|
|
19
|
+
}
|
|
20
|
+
function fromJson(model: AsJson): Timeframe;
|
|
21
|
+
function toJson(model: Timeframe): AsJson;
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FormDataRequestBody, FormDataResponseBody } from '@dynatrace-sdk/http-client';
|
|
2
|
+
import { PositionInfo, _PositionInfoTransformation } from './position-info';
|
|
3
|
+
/**
|
|
4
|
+
* The position of a token in a query string used for errors and notification to map the message to a specific part of the query.
|
|
5
|
+
*/
|
|
6
|
+
export interface TokenPosition {
|
|
7
|
+
start: PositionInfo;
|
|
8
|
+
end: PositionInfo;
|
|
9
|
+
}
|
|
10
|
+
/** @ignore */
|
|
11
|
+
export declare namespace _TokenPositionTransformation {
|
|
12
|
+
interface AsJson {
|
|
13
|
+
start: _PositionInfoTransformation.AsJson;
|
|
14
|
+
end: _PositionInfoTransformation.AsJson;
|
|
15
|
+
}
|
|
16
|
+
function fromJson(model: AsJson): TokenPosition;
|
|
17
|
+
function toJson(model: TokenPosition): AsJson;
|
|
18
|
+
function fromFormData(formData: FormDataResponseBody): TokenPosition;
|
|
19
|
+
function toFormData(model: TokenPosition): FormDataRequestBody;
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of the autocomplete token.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum TokenType {
|
|
5
|
+
Space = "SPACE",
|
|
6
|
+
Linebreak = "LINEBREAK",
|
|
7
|
+
Indent = "INDENT",
|
|
8
|
+
Pipe = "PIPE",
|
|
9
|
+
Dot = "DOT",
|
|
10
|
+
Colon = "COLON",
|
|
11
|
+
Comma = "COMMA",
|
|
12
|
+
Assignment = "ASSIGNMENT",
|
|
13
|
+
BraceOpen = "BRACE_OPEN",
|
|
14
|
+
BraceClose = "BRACE_CLOSE",
|
|
15
|
+
BracketOpen = "BRACKET_OPEN",
|
|
16
|
+
BracketClose = "BRACKET_CLOSE",
|
|
17
|
+
ParenthesisOpen = "PARENTHESIS_OPEN",
|
|
18
|
+
ParenthesisClose = "PARENTHESIS_CLOSE",
|
|
19
|
+
Quote = "QUOTE",
|
|
20
|
+
SingleQuote = "SINGLE_QUOTE",
|
|
21
|
+
Slash = "SLASH",
|
|
22
|
+
BooleanTrue = "BOOLEAN_TRUE",
|
|
23
|
+
BooleanFalse = "BOOLEAN_FALSE",
|
|
24
|
+
Null = "NULL",
|
|
25
|
+
CommandName = "COMMAND_NAME",
|
|
26
|
+
ParameterKey = "PARAMETER_KEY",
|
|
27
|
+
ParameterValueScope = "PARAMETER_VALUE_SCOPE",
|
|
28
|
+
FunctionName = "FUNCTION_NAME",
|
|
29
|
+
TimeseriesAggregation = "TIMESERIES_AGGREGATION",
|
|
30
|
+
Operator = "OPERATOR",
|
|
31
|
+
TraversalOperator = "TRAVERSAL_OPERATOR",
|
|
32
|
+
TraversalRelationName = "TRAVERSAL_RELATION_NAME",
|
|
33
|
+
TraversalHopCount = "TRAVERSAL_HOP_COUNT",
|
|
34
|
+
SimpleIdentifier = "SIMPLE_IDENTIFIER",
|
|
35
|
+
Number = "NUMBER",
|
|
36
|
+
String = "STRING",
|
|
37
|
+
TimeUnit = "TIME_UNIT",
|
|
38
|
+
TimestampValue = "TIMESTAMP_VALUE",
|
|
39
|
+
MetricKey = "METRIC_KEY",
|
|
40
|
+
Variable = "VARIABLE",
|
|
41
|
+
EndComment = "END_COMMENT"
|
|
42
|
+
}
|
|
43
|
+
/** @ignore */
|
|
44
|
+
export declare namespace _TokenTypeTransformation {
|
|
45
|
+
type AsJson = TokenType;
|
|
46
|
+
const toJson: (value: TokenType) => AsJson;
|
|
47
|
+
const fromJson: (value: AsJson) => TokenType;
|
|
48
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface VerifyRequest {
|
|
2
|
+
/**
|
|
3
|
+
* The full query string.
|
|
4
|
+
*/
|
|
5
|
+
query: string;
|
|
6
|
+
/**
|
|
7
|
+
* The query timezone. If none is specified, UTC is used as fallback. The list of valid input values matches that of the IANA Time Zone Database (TZDB). It accepts values in their canonical names like 'Europe/Paris', the abbreviated version like CET or the UTC offset format like '+01:00'
|
|
8
|
+
*/
|
|
9
|
+
timezone?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 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'.
|
|
12
|
+
*/
|
|
13
|
+
locale?: string;
|
|
14
|
+
}
|
|
15
|
+
/** @ignore */
|
|
16
|
+
export declare namespace _VerifyRequestTransformation {
|
|
17
|
+
interface AsJson {
|
|
18
|
+
query: string;
|
|
19
|
+
timezone?: string;
|
|
20
|
+
locale?: string;
|
|
21
|
+
}
|
|
22
|
+
function fromJson(model: AsJson): VerifyRequest;
|
|
23
|
+
function toJson(model: VerifyRequest): AsJson;
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MetadataNotification, _MetadataNotificationTransformation } from './metadata-notification';
|
|
2
|
+
/**
|
|
3
|
+
* Verify response.
|
|
4
|
+
*/
|
|
5
|
+
export interface VerifyResponse {
|
|
6
|
+
/**
|
|
7
|
+
* True if the supplied DQL query string is valid.
|
|
8
|
+
*/
|
|
9
|
+
valid: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The notifications related to the supplied DQL query string.
|
|
12
|
+
*/
|
|
13
|
+
notifications?: MetadataNotification[];
|
|
14
|
+
}
|
|
15
|
+
/** @ignore */
|
|
16
|
+
export declare namespace _VerifyResponseTransformation {
|
|
17
|
+
interface AsJson {
|
|
18
|
+
valid: boolean;
|
|
19
|
+
notifications?: _MetadataNotificationTransformation.AsJson[];
|
|
20
|
+
}
|
|
21
|
+
function fromJson(model: AsJson): VerifyResponse;
|
|
22
|
+
function toJson(model: VerifyResponse): AsJson;
|
|
23
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AbortController, AbortSignal, BaseError, Binary, BinaryFormDataRequestField, BinaryFormDataResponseField, DataTypeError, DataTypes, FormDataRequestBody, FormDataRequestField, FormDataResponseBody, FormDataResponseField, Headers, HttpClient, HttpClientAbortError, HttpClientNetworkError, HttpClientRequestError, HttpClientRequestOptions, HttpClientResponse, HttpClientResponseError, JsonFormDataRequestField, RequestBodyTypes, ResponseBodyTypes, StatusValidator, TextFormDataRequestField, TextFormDataResponseField, UnsupportedOperationError, } from './lib/types';
|
|
2
|
+
export { AbortController as PlatformAbortController, AbortSignal as PlatformAbortSignal, BaseError as PlatformBaseError, Binary as PlatformBinary, DataTypeError as PlatformDataTypeError, HttpClient as PlatformHttpClient, HttpClientAbortError as PlatformHttpClientAbortError, HttpClientRequestError as PlatformHttpClientRequestError, HttpClientResponse as PlatformHttpClientResponse, HttpClientResponseError as PlatformHttpClientResponseError, UnsupportedOperationError as PlatformUnsupportedOperationError, httpClient, } from './lib/platform';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type * as stream from 'stream';
|
|
4
|
+
import * as types from '../types';
|
|
5
|
+
export declare class Binary implements types.Binary {
|
|
6
|
+
readonly data: Blob | ArrayBuffer | ReadableStream<Uint8Array>;
|
|
7
|
+
static fromText(text: string): Binary;
|
|
8
|
+
static fromJson(json: any): Binary;
|
|
9
|
+
static from(data: Blob | ArrayBuffer | ReadableStream<Uint8Array> | Buffer | stream.Readable): Binary;
|
|
10
|
+
private constructor();
|
|
11
|
+
get<T extends keyof types.DataTypes>(type: T): types.DataTypes[T];
|
|
12
|
+
}
|
|
13
|
+
export declare function isBinary(body: any): body is Binary;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as types from '../types';
|
|
2
|
+
export declare class HttpClientAbortError extends Error implements types.HttpClientAbortError {
|
|
3
|
+
readonly cause: any;
|
|
4
|
+
readonly name = "AbortError";
|
|
5
|
+
constructor(cause: any);
|
|
6
|
+
}
|
|
7
|
+
export declare const throwIfAbortError: (e: unknown) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as types from '../types';
|
|
2
|
+
import { BaseError } from './base-error';
|
|
3
|
+
export declare class HttpClientRequestError extends BaseError implements types.HttpClientRequestError {
|
|
4
|
+
readonly cause: any;
|
|
5
|
+
readonly name = "RequestError";
|
|
6
|
+
constructor(cause: any);
|
|
7
|
+
}
|
package/types/packages/http-client/src/lib/platform/http-client-response-error-serializer.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addHttpClientResponseErrorSerializer(): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as types from '../types';
|
|
2
|
+
import { HttpClientResponse } from './http-client-response';
|
|
3
|
+
import { BaseError } from './base-error';
|
|
4
|
+
export declare class HttpClientResponseError extends BaseError implements types.HttpClientResponseError {
|
|
5
|
+
readonly name = "ResponseError";
|
|
6
|
+
readonly response: HttpClientResponse;
|
|
7
|
+
constructor(response: Response);
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as types from '../types';
|
|
2
|
+
export declare class HttpClientResponse implements types.HttpClientResponse {
|
|
3
|
+
private response;
|
|
4
|
+
constructor(response: Response);
|
|
5
|
+
get url(): string;
|
|
6
|
+
get status(): number;
|
|
7
|
+
get statusText(): string;
|
|
8
|
+
get headers(): types.Headers;
|
|
9
|
+
body<T extends keyof types.ResponseBodyTypes = 'json'>(responseBodyType?: T): types.ResponseBodyTypes[T];
|
|
10
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as types from '../types';
|
|
2
|
+
export declare class HttpClient implements types.HttpClient {
|
|
3
|
+
send<T extends keyof types.RequestBodyTypes = 'json'>(options: types.HttpClientRequestOptions<T>): Promise<types.HttpClientResponse>;
|
|
4
|
+
}
|
|
5
|
+
export declare const httpClient: HttpClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './abort-controller';
|
|
2
|
+
export * from './abort-signal';
|
|
3
|
+
export * from './base-error';
|
|
4
|
+
export * from './binary';
|
|
5
|
+
export * from './data-type-error';
|
|
6
|
+
export * from './http-client';
|
|
7
|
+
export * from './http-client-abort-error';
|
|
8
|
+
export * from './http-client-request-error';
|
|
9
|
+
export * from './http-client-response';
|
|
10
|
+
export * from './http-client-response-error';
|
|
11
|
+
export * from './unsupported-operation-error';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as types from '../types';
|
|
2
|
+
import { BaseError } from './base-error';
|
|
3
|
+
export declare class UnsupportedOperationError extends BaseError implements types.UnsupportedOperationError {
|
|
4
|
+
readonly name = "UnsupportedOperationError";
|
|
5
|
+
constructor(message: string, cause?: any);
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbortSignal } from './abort-signal';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a controller object that allows to abort one or more requests as and when desired.
|
|
4
|
+
*/
|
|
5
|
+
export interface AbortController {
|
|
6
|
+
/**
|
|
7
|
+
* Aborts a request before it has completed.
|
|
8
|
+
*/
|
|
9
|
+
abort(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Returns an AbortSignal object instance, which can be used to communicate with a request.
|
|
12
|
+
*/
|
|
13
|
+
signal: AbortSignal;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a signal object that allows to communicate with the request and abort it using the `AbortController`.
|
|
3
|
+
*/
|
|
4
|
+
export interface AbortSignal extends EventTarget {
|
|
5
|
+
readonly reason: any;
|
|
6
|
+
throwIfAborted(): void;
|
|
7
|
+
/**
|
|
8
|
+
* A flag indicating whether the requests the signal is communicating with are aborted.
|
|
9
|
+
*/
|
|
10
|
+
readonly aborted: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Invoked when the requests the signal is communicating with are aborted.
|
|
13
|
+
*/
|
|
14
|
+
onabort: ((this: AbortSignal, event: Event) => void) | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DataTypes } from './data-types';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an environment agnostic (browser vs node) abstraction layer for binary data.
|
|
4
|
+
*/
|
|
5
|
+
export interface Binary {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the binary data in a form that conforms to the specified type.
|
|
8
|
+
*
|
|
9
|
+
* @param type The type of the data.
|
|
10
|
+
* Can be `text`, `json`, `array-buffer`, `blob`, `readable-stream`, `buffer` or `stream`.
|
|
11
|
+
* @throws DataTypeError when the data does not conform to the specified type.
|
|
12
|
+
* @throws UnsupportedOperationError when the type is not supported by the platform.
|
|
13
|
+
*/
|
|
14
|
+
get<T extends keyof DataTypes>(type: T): DataTypes[T];
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a situation when the response body does not conform to the specified response body type.
|
|
3
|
+
*/
|
|
4
|
+
import { BaseError } from './base-error';
|
|
5
|
+
export interface DataTypeError extends BaseError {
|
|
6
|
+
/**
|
|
7
|
+
* The error name.
|
|
8
|
+
*/
|
|
9
|
+
readonly name: 'DataTypeError';
|
|
10
|
+
/**
|
|
11
|
+
* The error root cause.
|
|
12
|
+
*/
|
|
13
|
+
readonly cause?: any;
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type * as stream from 'stream';
|
|
4
|
+
/**
|
|
5
|
+
* Mapping between the data type names and types.
|
|
6
|
+
*/
|
|
7
|
+
export declare type DataTypes = {
|
|
8
|
+
/**
|
|
9
|
+
* A text type.
|
|
10
|
+
*/
|
|
11
|
+
text: Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* A JSON type.
|
|
14
|
+
*/
|
|
15
|
+
json: Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* An ArrayBuffer type.
|
|
18
|
+
*/
|
|
19
|
+
'array-buffer': Promise<ArrayBuffer>;
|
|
20
|
+
/**
|
|
21
|
+
* A Blob type. Browser only.
|
|
22
|
+
*/
|
|
23
|
+
blob: Promise<Blob>;
|
|
24
|
+
/**
|
|
25
|
+
* A ReadableStream type. Browser only.
|
|
26
|
+
*/
|
|
27
|
+
'readable-stream': ReadableStream<Uint8Array>;
|
|
28
|
+
/**
|
|
29
|
+
* A Buffer type. Node only.
|
|
30
|
+
*/
|
|
31
|
+
buffer: Promise<Buffer>;
|
|
32
|
+
/**
|
|
33
|
+
* A Stream type. Node only.
|
|
34
|
+
*/
|
|
35
|
+
stream: stream.Readable;
|
|
36
|
+
};
|