@dynatrace-sdk/client-classic-environment-v2 3.2.0 → 3.3.2

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/README.md +3038 -500
  3. package/cjs/index.js +6456 -4872
  4. package/dynatrace-metadata.json +2 -2
  5. package/esm/index.js +6456 -4872
  6. package/package.json +2 -2
  7. package/types/packages/client/classic-environment-v2/src/lib/apis/access-tokens-active-gate-tokens-api.d.ts +8 -4
  8. package/types/packages/client/classic-environment-v2/src/lib/apis/access-tokens-api-tokens-api.d.ts +4 -4
  9. package/types/packages/client/classic-environment-v2/src/lib/apis/access-tokens-tenant-tokens-api.d.ts +12 -6
  10. package/types/packages/client/classic-environment-v2/src/lib/apis/active-gates-active-gate-groups-api.d.ts +4 -2
  11. package/types/packages/client/classic-environment-v2/src/lib/apis/active-gates-api.d.ts +2 -2
  12. package/types/packages/client/classic-environment-v2/src/lib/apis/active-gates-auto-update-configuration-api.d.ts +31 -7
  13. package/types/packages/client/classic-environment-v2/src/lib/apis/active-gates-auto-update-jobs-api.d.ts +4 -4
  14. package/types/packages/client/classic-environment-v2/src/lib/apis/attacks-api.d.ts +2 -2
  15. package/types/packages/client/classic-environment-v2/src/lib/apis/audit-logs-api.d.ts +2 -2
  16. package/types/packages/client/classic-environment-v2/src/lib/apis/business-events-api.d.ts +1 -1
  17. package/types/packages/client/classic-environment-v2/src/lib/apis/credential-vault-api.d.ts +5 -5
  18. package/types/packages/client/classic-environment-v2/src/lib/apis/davis-security-advisor-api.d.ts +1 -1
  19. package/types/packages/client/classic-environment-v2/src/lib/apis/events-api.d.ts +11 -8
  20. package/types/packages/client/classic-environment-v2/src/lib/apis/extensions-2-0-api.d.ts +28 -26
  21. package/types/packages/client/classic-environment-v2/src/lib/apis/logs-api.d.ts +5 -5
  22. package/types/packages/client/classic-environment-v2/src/lib/apis/metrics-api.d.ts +4 -4
  23. package/types/packages/client/classic-environment-v2/src/lib/apis/metrics-units-api.d.ts +3 -3
  24. package/types/packages/client/classic-environment-v2/src/lib/apis/monitored-entities-api.d.ts +7 -7
  25. package/types/packages/client/classic-environment-v2/src/lib/apis/monitored-entities-custom-tags-api.d.ts +3 -3
  26. package/types/packages/client/classic-environment-v2/src/lib/apis/monitored-entities-monitoring-state-api.d.ts +1 -1
  27. package/types/packages/client/classic-environment-v2/src/lib/apis/network-zones-api.d.ts +11 -7
  28. package/types/packages/client/classic-environment-v2/src/lib/apis/problems-api.d.ts +5 -5
  29. package/types/packages/client/classic-environment-v2/src/lib/apis/releases-api.d.ts +1 -1
  30. package/types/packages/client/classic-environment-v2/src/lib/apis/security-problems-api.d.ts +39 -18
  31. package/types/packages/client/classic-environment-v2/src/lib/apis/service-level-objectives-api.d.ts +12 -4
  32. package/types/packages/client/classic-environment-v2/src/lib/apis/settings-management-zones-api.d.ts +1 -1
  33. package/types/packages/client/classic-environment-v2/src/lib/apis/settings-objects-api.d.ts +18 -9
  34. package/types/packages/client/classic-environment-v2/src/lib/apis/settings-schemas-api.d.ts +2 -2
  35. package/types/packages/client/classic-environment-v2/src/lib/apis/synthetic-http-monitor-executions-api.d.ts +1 -1
  36. package/types/packages/client/classic-environment-v2/src/lib/apis/synthetic-locations-nodes-and-configuration-api.d.ts +33 -16
  37. package/types/packages/client/classic-environment-v2/src/lib/apis/synthetic-network-availability-monitors-api.d.ts +3 -3
  38. package/types/packages/client/classic-environment-v2/src/lib/apis/synthetic-on-demand-monitor-executions-api.d.ts +6 -6
  39. package/types/packages/client/classic-environment-v2/src/lib/error-envelopes/index.d.ts +5 -5
  40. package/types/packages/client/classic-environment-v2/src/lib/models/any-value.d.ts +2 -3
  41. package/types/packages/client/classic-environment-v2/src/lib/models/any-value.transformation.d.ts +3 -3
  42. package/types/packages/client/classic-environment-v2/src/lib/models/api-token-create.d.ts +3 -3
  43. package/types/packages/client/classic-environment-v2/src/lib/models/api-token-update.d.ts +3 -3
  44. package/types/packages/client/classic-environment-v2/src/lib/models/aws-key-based-credentials-dto.d.ts +18 -0
  45. package/types/packages/client/classic-environment-v2/src/lib/models/aws-key-based-credentials-dto.transformation.d.ts +9 -0
  46. package/types/packages/client/classic-environment-v2/src/lib/models/aws-role-based-credentials.d.ts +14 -0
  47. package/types/packages/client/classic-environment-v2/src/lib/models/aws-role-based-credentials.transformation.d.ts +8 -0
  48. package/types/packages/client/classic-environment-v2/src/lib/models/credentials-response-element-type.d.ts +2 -0
  49. package/types/packages/client/classic-environment-v2/src/lib/models/credentials-type.d.ts +6 -0
  50. package/types/packages/client/classic-environment-v2/src/lib/models/credentials.d.ts +3 -0
  51. package/types/packages/client/classic-environment-v2/src/lib/models/credentials.transformation.d.ts +6 -0
  52. package/types/packages/client/classic-environment-v2/src/lib/models/index.d.ts +6 -0
  53. package/types/packages/client/classic-environment-v2/src/lib/models/list-credentials-query-type.d.ts +3 -1
  54. package/types/packages/client/classic-environment-v2/src/lib/models/metric-metadata-dto.d.ts +4 -0
  55. package/types/packages/client/classic-environment-v2/src/lib/models/metric-metadata-dto.transformation.d.ts +1 -0
  56. package/types/packages/client/classic-environment-v2/src/lib/models/snmpv3-credentials.d.ts +30 -0
  57. package/types/packages/client/classic-environment-v2/src/lib/models/snmpv3-credentials.transformation.d.ts +12 -0
  58. package/types/packages/client/classic-environment-v2/src/lib/models/synthetic-location.d.ts +1 -1
  59. package/types/packages/client/classic-environment-v2/src/lib/models/synthetic-location.transformation.d.ts +1 -1
  60. package/types/packages/client/classic-environment-v2/src/lib/utils/encoding.d.ts +1 -1
  61. package/types/packages/shared-errors/src/api-client-error.d.ts +13 -1
  62. package/types/packages/shared-errors/src/api-gateway-error.d.ts +19 -0
  63. package/types/packages/shared-errors/src/client-request-error.d.ts +29 -0
  64. package/types/packages/shared-errors/src/index.d.ts +0 -1
  65. package/types/packages/shared-errors/src/invalid-response-error.d.ts +18 -1
  66. package/types/packages/shared-errors/src/types.d.ts +62 -5
  67. package/types/packages/shared-errors/src/sdk-error.d.ts +0 -5
@@ -49,12 +49,12 @@ export interface ApiTokenUpdate {
49
49
  * * `problems.write`: Write problems.
50
50
  * * `events.read`: Read events.
51
51
  * * `events.ingest`: Ingest events.
52
- * * `openpipeline.events`: OpenPipeline - Ingest Events.
52
+ * * `openpipeline.events`: OpenPipeline - Ingest Events (Built-in).
53
53
  * * `openpipeline.events.custom`: OpenPipeline - Ingest Events (Custom).
54
54
  * * `openpipeline.events_security`: OpenPipeline - Ingest Security Events (Built-in).
55
55
  * * `openpipeline.events_security.custom`: OpenPipeline - Ingest Security Events (Custom).
56
- * * `openpipeline.events_sdlc`: OpenPipeline - Ingest Events, Software Development Lifecycle.
57
- * * `openpipeline.events_sdlc.custom`: OpenPipeline - Ingest Events, Software Development Lifecycle (Custom).
56
+ * * `openpipeline.events_sdlc`: OpenPipeline - Ingest Software Development Lifecycle Events (Built-in).
57
+ * * `openpipeline.events_sdlc.custom`: OpenPipeline - Ingest Software Development Lifecycle Events (Custom).
58
58
  * * `bizevents.ingest`: Ingest bizevents.
59
59
  * * `analyzers.read`: Read analyzers.
60
60
  * * `analyzers.write`: Write & execute analyzers.
@@ -0,0 +1,18 @@
1
+ import { Credentials } from './credentials';
2
+ /**
3
+ * A credentials set of the `AWS_KEY_BASED` type.
4
+ */
5
+ export interface AWSKeyBasedCredentialsDto extends Credentials {
6
+ /**
7
+ * Access Key ID of the credentials set.
8
+ */
9
+ accessKeyID?: string;
10
+ /**
11
+ * AWS partition of the credential.
12
+ */
13
+ awsPartition?: string;
14
+ /**
15
+ * Secret access key of the credential.
16
+ */
17
+ secretKey?: string;
18
+ }
@@ -0,0 +1,9 @@
1
+ import { AWSKeyBasedCredentialsDto } from './aws-key-based-credentials-dto';
2
+ import * as _CredentialsTransformation from './credentials.transformation';
3
+ export interface AsJson extends _CredentialsTransformation.AsJson {
4
+ accessKeyID?: string;
5
+ awsPartition?: string;
6
+ secretKey?: string;
7
+ }
8
+ export declare function fromJson($model: AsJson): AWSKeyBasedCredentialsDto;
9
+ export declare function toJson($model: AWSKeyBasedCredentialsDto): AsJson;
@@ -0,0 +1,14 @@
1
+ import { Credentials } from './credentials';
2
+ /**
3
+ * A credentials set of the `AWS_ROLE_BASED` type.
4
+ */
5
+ export interface AWSRoleBasedCredentials extends Credentials {
6
+ /**
7
+ * Amazon account ID of the credential.
8
+ */
9
+ accountID?: string;
10
+ /**
11
+ * The IAM role name of the credentials set.
12
+ */
13
+ iamRole?: string;
14
+ }
@@ -0,0 +1,8 @@
1
+ import { AWSRoleBasedCredentials } from './aws-role-based-credentials';
2
+ import * as _CredentialsTransformation from './credentials.transformation';
3
+ export interface AsJson extends _CredentialsTransformation.AsJson {
4
+ accountID?: string;
5
+ iamRole?: string;
6
+ }
7
+ export declare function fromJson($model: AsJson): AWSRoleBasedCredentials;
8
+ export declare function toJson($model: AWSRoleBasedCredentials): AsJson;
@@ -2,6 +2,8 @@
2
2
  * The type of the credentials set.
3
3
  */
4
4
  export declare enum CredentialsResponseElementType {
5
+ AwsMonitoringKeyBased = "AWS_MONITORING_KEY_BASED",
6
+ AwsMonitoringRoleBased = "AWS_MONITORING_ROLE_BASED",
5
7
  Certificate = "CERTIFICATE",
6
8
  PublicCertificate = "PUBLIC_CERTIFICATE",
7
9
  Snmpv3 = "SNMPV3",
@@ -5,10 +5,16 @@
5
5
  * * `PUBLIC_CERTIFICATE` -> PublicCertificateCredentials
6
6
  * * `USERNAME_PASSWORD` -> UserPasswordCredentials
7
7
  * * `TOKEN` -> TokenCredentials
8
+ * * `SNMPV3` -> SNMPV3Credentials
9
+ * * `AWS_KEY_BASED` -> AWSKeyBasedCredentialsDto
10
+ * * `AWS_ROLE_BASED` -> AWSRoleBasedCredentials
8
11
  */
9
12
  export declare enum CredentialsType {
13
+ AwsKeyBased = "AWS_KEY_BASED",
14
+ AwsRoleBased = "AWS_ROLE_BASED",
10
15
  Certificate = "CERTIFICATE",
11
16
  PublicCertificate = "PUBLIC_CERTIFICATE",
17
+ Snmpv3 = "SNMPV3",
12
18
  Token = "TOKEN",
13
19
  UsernamePassword = "USERNAME_PASSWORD"
14
20
  }
@@ -51,6 +51,9 @@ export interface Credentials {
51
51
  * * `PUBLIC_CERTIFICATE` -> PublicCertificateCredentials
52
52
  * * `USERNAME_PASSWORD` -> UserPasswordCredentials
53
53
  * * `TOKEN` -> TokenCredentials
54
+ * * `SNMPV3` -> SNMPV3Credentials
55
+ * * `AWS_KEY_BASED` -> AWSKeyBasedCredentialsDto
56
+ * * `AWS_ROLE_BASED` -> AWSRoleBasedCredentials
54
57
  */
55
58
  type?: CredentialsType;
56
59
  }
@@ -1,3 +1,5 @@
1
+ import { AWSKeyBasedCredentialsDto } from './aws-key-based-credentials-dto';
2
+ import { AWSRoleBasedCredentials } from './aws-role-based-credentials';
1
3
  import { CertificateCredentials } from './certificate-credentials';
2
4
  import * as _CredentialAccessDataTransformation from './credential-access-data.transformation';
3
5
  import { Credentials } from './credentials';
@@ -5,10 +7,14 @@ import * as _CredentialsScopeTransformation from './credentials-scope.transforma
5
7
  import * as _CredentialsScopesItemTransformation from './credentials-scopes-item.transformation';
6
8
  import * as _CredentialsTypeTransformation from './credentials-type.transformation';
7
9
  import { PublicCertificateCredentials } from './public-certificate-credentials';
10
+ import { SNMPV3Credentials } from './snmpv3-credentials';
8
11
  import { TokenCredentials } from './token-credentials';
9
12
  import { UserPasswordCredentials } from './user-password-credentials';
13
+ export declare function isAwsKeyBasedCredentialsDto($model: Credentials): $model is AWSKeyBasedCredentialsDto;
14
+ export declare function isAwsRoleBasedCredentials($model: Credentials): $model is AWSRoleBasedCredentials;
10
15
  export declare function isCertificateCredentials($model: Credentials): $model is CertificateCredentials;
11
16
  export declare function isPublicCertificateCredentials($model: Credentials): $model is PublicCertificateCredentials;
17
+ export declare function isSnmpv3Credentials($model: Credentials): $model is SNMPV3Credentials;
12
18
  export declare function isTokenCredentials($model: Credentials): $model is TokenCredentials;
13
19
  export declare function isUserPasswordCredentials($model: Credentials): $model is UserPasswordCredentials;
14
20
  export interface AsJson {
@@ -1,3 +1,7 @@
1
+ export * from './aws-key-based-credentials-dto';
2
+ export * as _AWSKeyBasedCredentialsDtoTransformation from './aws-key-based-credentials-dto.transformation';
3
+ export * from './aws-role-based-credentials';
4
+ export * as _AWSRoleBasedCredentialsTransformation from './aws-role-based-credentials.transformation';
1
5
  export * from './abstract-credentials-response-element';
2
6
  export * as _AbstractCredentialsResponseElementTransformation from './abstract-credentials-response-element.transformation';
3
7
  export * from './abstract-credentials-response-element-scope';
@@ -876,6 +880,8 @@ export * from './slo-status';
876
880
  export * as _SLOStatusTransformation from './slo-status.transformation';
877
881
  export * from './sl-os';
878
882
  export * as _SLOsTransformation from './sl-os.transformation';
883
+ export * from './snmpv3-credentials';
884
+ export * as _SNMPV3CredentialsTransformation from './snmpv3-credentials.transformation';
879
885
  export * from './schema-constraint-rest-dto';
880
886
  export * as _SchemaConstraintRestDtoTransformation from './schema-constraint-rest-dto.transformation';
881
887
  export * from './schema-constraint-rest-dto-type';
@@ -2,5 +2,7 @@ export declare enum ListCredentialsQueryType {
2
2
  Certificate = "CERTIFICATE",
3
3
  UsernamePassword = "USERNAME_PASSWORD",
4
4
  Token = "TOKEN",
5
- Snmpv3 = "SNMPV3"
5
+ Snmpv3 = "SNMPV3",
6
+ AwsKeyBased = "AWS_KEY_BASED",
7
+ AwsRoleBased = "AWS_ROLE_BASED"
6
8
  }
@@ -10,6 +10,10 @@ export interface MetricMetadataDto {
10
10
  * The name of the metric in the user interface
11
11
  */
12
12
  displayName?: string;
13
+ /**
14
+ * Interval value (numeric or variable reference) defined for this metric on subgroup level
15
+ */
16
+ metricInterval?: string;
13
17
  /**
14
18
  * The unit of the metric
15
19
  */
@@ -2,6 +2,7 @@ import { MetricMetadataDto } from './metric-metadata-dto';
2
2
  export interface AsJson {
3
3
  description?: string;
4
4
  displayName?: string;
5
+ metricInterval?: string;
5
6
  unit?: string;
6
7
  }
7
8
  export declare function fromJson($model: AsJson): MetricMetadataDto;
@@ -0,0 +1,30 @@
1
+ import { Credentials } from './credentials';
2
+ /**
3
+ * A credentials set of the `SNMPV3` type.
4
+ */
5
+ export interface SNMPV3Credentials extends Credentials {
6
+ /**
7
+ * The authentication password in the string format (should not be empty for AUTH_PRIV and AUTH_NO_PRIV security levels)
8
+ */
9
+ authenticationPassword?: string;
10
+ /**
11
+ * The authentication protocol, supported protocols: MD5, SHA, SHA224, SHA256, SHA384, SHA512
12
+ */
13
+ authenticationProtocol?: string;
14
+ /**
15
+ * The privacy password in the string format (should not be empty for AUTH_PRIV security level)
16
+ */
17
+ privacyPassword?: string;
18
+ /**
19
+ * The privacy protocol
20
+ */
21
+ privacyProtocol?: string;
22
+ /**
23
+ * The security level, supported levels: AUTH_PRIV, NO_AUTH_NO_PRIV, AUTH_NO_PRIV
24
+ */
25
+ securityLevel?: string;
26
+ /**
27
+ * User name value
28
+ */
29
+ username?: string;
30
+ }
@@ -0,0 +1,12 @@
1
+ import * as _CredentialsTransformation from './credentials.transformation';
2
+ import { SNMPV3Credentials } from './snmpv3-credentials';
3
+ export interface AsJson extends _CredentialsTransformation.AsJson {
4
+ authenticationPassword?: string;
5
+ authenticationProtocol?: string;
6
+ privacyPassword?: string;
7
+ privacyProtocol?: string;
8
+ securityLevel?: string;
9
+ username?: string;
10
+ }
11
+ export declare function fromJson($model: AsJson): SNMPV3Credentials;
12
+ export declare function toJson($model: SNMPV3Credentials): AsJson;
@@ -21,7 +21,7 @@ export interface SyntheticLocation {
21
21
  /**
22
22
  * The Dynatrace entity ID of the location.
23
23
  */
24
- entityId: string;
24
+ entityId?: string;
25
25
  /**
26
26
  * The Dynatrace GeoLocation ID of the location.
27
27
  */
@@ -8,7 +8,7 @@ export declare function isPublicSyntheticLocation($model: SyntheticLocation): $m
8
8
  export interface AsJson {
9
9
  city?: string;
10
10
  countryCode?: string;
11
- entityId: string;
11
+ entityId?: string;
12
12
  geoLocationId?: string;
13
13
  latitude: number;
14
14
  longitude: number;
@@ -7,4 +7,4 @@ export declare enum Encoding {
7
7
  Binary = "binary",
8
8
  FormData = "form-data"
9
9
  }
10
- export declare function mimeTypeToEncoding(mimeType: string): Encoding;
10
+ export declare function mimeTypeToEncoding(mimeType: string, defaultEncoding?: Encoding): Encoding;
@@ -1,6 +1,6 @@
1
1
  import { ErrorType } from './types';
2
2
  /**
3
- * Error base. All client errors should extend this class.
3
+ * Base error for all client SDKs. All other errors extend this class.
4
4
  */
5
5
  export declare class ApiClientError extends Error {
6
6
  readonly cause?: any;
@@ -8,4 +8,16 @@ export declare class ApiClientError extends Error {
8
8
  errorType: ErrorType;
9
9
  constructor(name: string, message?: string, cause?: any);
10
10
  }
11
+ /**
12
+ * ApiClientError type guard function.
13
+ * Does a structural check of the passed object.
14
+ * @example
15
+ * try {
16
+ * doSomething();
17
+ * } catch (e: unknown) {
18
+ * if(isApiClientError(e)) {
19
+ * handleTheError();
20
+ * }
21
+ * }
22
+ */
11
23
  export declare function isApiClientError(e: any): e is ApiClientError;
@@ -4,15 +4,34 @@ import { CommonApiError, CommonErrorDetails, ErrorResponseBody } from './types';
4
4
  export type ApiGatewayErrorResponseBody = ErrorResponseBody<CommonApiError<ApiGatewayErrorDetails> & {
5
5
  retryAfterSeconds?: number;
6
6
  }>;
7
+ /**
8
+ * Reference for *ApiGatewayError* details object. Contains information about received API Getaway error.
9
+ * */
7
10
  export interface ApiGatewayErrorDetails extends CommonErrorDetails {
8
11
  errorCodeProperties?: {
9
12
  [key: string]: string;
10
13
  };
11
14
  }
15
+ /**
16
+ * Dedicated error response class for errors thrown by API Gateway.
17
+ * Autogenerated SDK Clients have built-in handler for API Gateway errors that throws this error.
18
+ */
12
19
  export declare class ApiGatewayError extends ClientRequestError<ApiGatewayErrorResponseBody> {
13
20
  readonly isApiGatewayError = true;
14
21
  readonly code: number;
15
22
  readonly retryAfterSeconds: number | undefined;
16
23
  constructor(response: HttpClientResponse, body: ApiGatewayErrorResponseBody);
17
24
  }
25
+ /**
26
+ * APIGatewayError type guard function.
27
+ * Does a structural check of the passed object.
28
+ * @example
29
+ * try {
30
+ * doSomething();
31
+ * } catch (e: unknown) {
32
+ * if(isApiClientError(e)) {
33
+ * handleTheError();
34
+ * }
35
+ * }
36
+ */
18
37
  export declare function isApiGatewayError(e: any): e is ApiGatewayError;
@@ -1,10 +1,39 @@
1
1
  import { HttpClientResponse } from '@dynatrace-sdk/http-client';
2
2
  import { ApiClientError } from './api-client-error';
3
3
  import { ErrorResponseBody } from './types';
4
+ /**
5
+ * Generic error class for service errors, used to handle both expected and unexpected service-level errors.
6
+ * @example Handling unexpected error response, received by the SDK Client
7
+ * const responseValue = await response.body('json');
8
+ *
9
+ * throw new ClientRequestError(
10
+ * `${response.status}`,
11
+ * response,
12
+ * responseValue,
13
+ * getErrorMessage(
14
+ * responseValue,
15
+ * `Unexpected api response: code=${response.status} body="${responseValue}"`,
16
+ * ),
17
+ * e,
18
+ * );
19
+ *
20
+ */
4
21
  export declare class ClientRequestError<DTO = ErrorResponseBody> extends ApiClientError {
5
22
  readonly isClientRequestError = true;
6
23
  body: DTO;
7
24
  response: HttpClientResponse;
8
25
  constructor(name: string, response: HttpClientResponse, body: DTO, message?: string, cause?: any);
9
26
  }
27
+ /**
28
+ * ClientRequestError type guard function.
29
+ * Does a structural check of the passed object.
30
+ * @example
31
+ * try {
32
+ * doSomething();
33
+ * } catch (e: unknown) {
34
+ * if(isClientRequestError(e)) {
35
+ * handleTheError();
36
+ * }
37
+ * }
38
+ */
10
39
  export declare function isClientRequestError(e: any): e is ClientRequestError;
@@ -2,5 +2,4 @@ export * from './api-client-error';
2
2
  export * from './api-gateway-error';
3
3
  export * from './client-request-error';
4
4
  export * from './invalid-response-error';
5
- export * from './sdk-error';
6
5
  export * from './types';
@@ -1,9 +1,26 @@
1
1
  import { ApiClientError } from './api-client-error';
2
+ /**
3
+ * Dedicated error class for errors related to response serialization.
4
+ * Thrown when received service response can't be deserialized.
5
+ **/
2
6
  export declare class InvalidResponseError extends ApiClientError {
3
7
  readonly isInvalidResponseError = true;
4
8
  responseBody: any;
5
9
  expectedType?: string;
6
10
  nestedError?: Error;
7
- constructor(name: string, nestedError: Error | any | undefined, body: any, expectedType?: string, message?: string);
11
+ response: any;
12
+ constructor(name: string, nestedError: Error | any | undefined, body: any, expectedType?: string, message?: string, response?: any);
8
13
  }
14
+ /**
15
+ * InvalidResponseError type guard function.
16
+ * Does a structural check of the passed object.
17
+ * @example
18
+ * try {
19
+ * doSomething();
20
+ * } catch (e: unknown) {
21
+ * if (isInvalidResponseError(e)) {
22
+ * throw e;
23
+ * }
24
+ * }
25
+ */
9
26
  export declare function isInvalidResponseError(e: any): e is InvalidResponseError;
@@ -1,31 +1,88 @@
1
- /**
2
- * Possible serialized error types
3
- * `COMMON`: Common JS error
4
- * `HTTP`: Error thrown by a http-client
5
- */
1
+ /** @ignore*/
6
2
  export declare enum ErrorType {
7
3
  COMMON = "JS Error",
8
4
  HTTP = "Http Error"
9
5
  }
6
+ /**
7
+ * Basic error envelope, that enforces all error to have mandatory "error" property.
8
+ * */
10
9
  export interface ErrorResponseBody<T = CommonApiError> {
10
+ /**
11
+ * *error* object must have two mandatory fields (*code, message*) and may have two additional fields (*help, details*):
12
+ * refer to the *CommonApiError* for more details.
13
+ * */
11
14
  error: T;
12
15
  }
16
+ /**
17
+ * Common API error structure, established by Dynatrace API guidelines.
18
+ * */
13
19
  export interface CommonApiError<T extends Record<string, any> = Record<string, any>> {
20
+ /** The error code should be set to the HTTP error code by default.<br>
21
+ * The error code may be set to an API-specific error code which must be properly documented.*/
14
22
  code: number;
23
+ /** The error message should be short and precise, it should not contain details.*/
15
24
  message: string;
25
+ /**
26
+ * An additional help field may be added which must be a URL to further information on how to deal with the error.<br>
27
+ * This may be some detailed error documentation page or a link to the Dynatrace support system, etc.
28
+ * */
16
29
  help?: string;
30
+ /**
31
+ * Additional details about the error may be added in a details field.
32
+ * Refer to *CommonErrorDetails*
33
+ * */
17
34
  details?: T;
18
35
  }
36
+ /**
37
+ * *CommonApiError* details object reference. Contains common API error information.
38
+ * This object is used to convey additional information about the error like e.g., which query parameter exactly violated a precondition. <br>
39
+ * Details may contain any fields to further describe the error
40
+ * */
19
41
  export interface CommonErrorDetails {
42
+ /**
43
+ * UUID string that represents a reference of the error into e.g., the log file of the service.
44
+ * */
20
45
  errorRef?: string;
46
+ /**
47
+ * String containing a 32-character hex integer value that is used for tracing.
48
+ * */
21
49
  traceId?: string;
50
+ /**
51
+ * String value representing a more detailed error information than the http response code alone.
52
+ * Must be a single word in CamelCase, and all possible values must be documented.
53
+ * */
22
54
  errorCode?: string;
55
+ /**
56
+ * An array of *ConstraintViolation* object, refer to ConstraintViolation object reference for more details.
57
+ * */
23
58
  constraintViolations?: ConstraintViolation[];
59
+ /**
60
+ * Must be an array of strings containing a complete list of missing IAM scopes necessary to successfully execute the request.
61
+ * Should be set if the API returns a 403 - Forbidden response in case of missing OAuth scopes.
62
+ * */
24
63
  missingScopes?: string[];
64
+ /**
65
+ * Must be an array of strings containing a complete list of missing IAM permissions necessary to successfully execute the request.
66
+ * Should be set if the API returns a 403 - Forbidden response in case of missing OAuth user permissions.
67
+ * */
25
68
  missingPermissions?: string[];
26
69
  }
70
+ /**
71
+ * Contains information about an input parameter (path, query or request body)
72
+ * that violated some validation rule of the service API and caused the warning.<br>
73
+ * May contain additional fields further describing the warning.
74
+ * */
27
75
  export interface ConstraintViolation extends Record<string, string | undefined> {
76
+ /**
77
+ * Mandatory field message describing the warning.
78
+ * */
28
79
  message: string;
80
+ /**
81
+ * Describes the general location of the violating parameter (query parameter, request body, etc.)
82
+ */
29
83
  parameterLocation?: string;
84
+ /**
85
+ * Refers to the violating parameter within the parameterLocation.
86
+ */
30
87
  path?: string;
31
88
  }
@@ -1,5 +0,0 @@
1
- export declare class SDKError extends Error {
2
- cause?: Error | undefined;
3
- name: string;
4
- constructor(message: string, cause?: Error | undefined);
5
- }