@dynatrace-sdk/client-automation
Advanced tools
Comparing version 4.5.0 to 4.6.0
@@ -5,2 +5,12 @@ # Automation | ||
## 4.6.0 | ||
### Features | ||
- Export errors from the package. | ||
### Bugfixes | ||
- Internal type `PreviewTaskInputResponseError` is no longer exported. Use `PreviewTaskInputResponse` instead. | ||
## 4.5.0 | ||
@@ -7,0 +17,0 @@ |
{ | ||
"dynagen": { | ||
"version": "0.14.0", | ||
"version": "0.15.2", | ||
"generatedAt": "", | ||
"template": { | ||
"name": "@dynatrace-sdk/template-typescript-client", | ||
"version": "0.22.7" | ||
"version": "0.25.1" | ||
} | ||
@@ -9,0 +9,0 @@ }, |
{ | ||
"name": "@dynatrace-sdk/client-automation", | ||
"version": "4.5.0", | ||
"version": "4.6.0", | ||
"description": "Automation API allows working with workflows and various trigger options.", | ||
@@ -9,3 +9,3 @@ "license": "Apache-2.0", | ||
"@dynatrace-sdk/http-client": "^1.2.0", | ||
"@dynatrace-sdk/shared-errors": "^0.0.4" | ||
"@dynatrace-sdk/shared-errors": "^1.0.0" | ||
}, | ||
@@ -12,0 +12,0 @@ "main": "./cjs/index.js", |
@@ -27,3 +27,5 @@ import { AbortSignal, HttpClient } from '@dynatrace-sdk/http-client'; | ||
*/ | ||
getCountries(abortSignal?: AbortSignal): Promise<CountryList>; | ||
getCountries(config?: { | ||
abortSignal?: AbortSignal; | ||
} | AbortSignal): Promise<CountryList>; | ||
/** | ||
@@ -82,4 +84,6 @@ * **Required scope:** automation:workflows:read | ||
*/ | ||
getTimezones(abortSignal?: AbortSignal): Promise<string[]>; | ||
getTimezones(config?: { | ||
abortSignal?: AbortSignal; | ||
} | AbortSignal): Promise<string[]>; | ||
} | ||
export declare const schedulesClient: SchedulesClient; |
@@ -26,3 +26,5 @@ import { AbortSignal, HttpClient } from '@dynatrace-sdk/http-client'; | ||
*/ | ||
getSettings(abortSignal?: AbortSignal): Promise<GetSettingsResponse>; | ||
getSettings(config?: { | ||
abortSignal?: AbortSignal; | ||
} | AbortSignal): Promise<GetSettingsResponse>; | ||
/** | ||
@@ -41,3 +43,5 @@ * **Required scope:** automation:workflows:write | ||
*/ | ||
updateAuthorizations(abortSignal?: AbortSignal): Promise<void>; | ||
updateAuthorizations(config?: { | ||
abortSignal?: AbortSignal; | ||
} | AbortSignal): Promise<void>; | ||
/** | ||
@@ -56,3 +60,5 @@ * **Required scope:** automation:workflows:read<br/><br/>Get service users who could be used as workflow actor | ||
*/ | ||
getServiceUsers(abortSignal?: AbortSignal): Promise<GetServiceUsersResponse>; | ||
getServiceUsers(config?: { | ||
abortSignal?: AbortSignal; | ||
} | AbortSignal): Promise<GetServiceUsersResponse>; | ||
/** | ||
@@ -71,3 +77,5 @@ * **Required scope:** automation:workflows:read<br/><br/>Get user-specific settings | ||
*/ | ||
getUserSettings(abortSignal?: AbortSignal): Promise<UserSettings>; | ||
getUserSettings(config?: { | ||
abortSignal?: AbortSignal; | ||
} | AbortSignal): Promise<UserSettings>; | ||
/** | ||
@@ -86,4 +94,6 @@ * **Required scope:** automation:workflows:read<br/><br/>Get current user effective permissions. | ||
*/ | ||
getUserPermissions(abortSignal?: AbortSignal): Promise<string[]>; | ||
getUserPermissions(config?: { | ||
abortSignal?: AbortSignal; | ||
} | AbortSignal): Promise<string[]>; | ||
} | ||
export declare const settingsClient: SettingsClient; |
@@ -24,4 +24,6 @@ import { AbortSignal, HttpClient } from '@dynatrace-sdk/http-client'; | ||
*/ | ||
getVersion(abortSignal?: AbortSignal): Promise<VersionResponse>; | ||
getVersion(config?: { | ||
abortSignal?: AbortSignal; | ||
} | AbortSignal): Promise<VersionResponse>; | ||
} | ||
export declare const versionClient: VersionClient; |
export { ApiClientError, ApiGatewayError, ClientRequestError, InvalidResponseError, isApiClientError, isApiGatewayError, isClientRequestError, isInvalidResponseError, } from '@dynatrace-sdk/shared-errors'; | ||
export { isErrorEnvelopeError } from './error-envelope-error'; | ||
export { ErrorEnvelopeError, isErrorEnvelopeError } from './error-envelope-error'; |
@@ -153,4 +153,2 @@ export * from './action-execution'; | ||
export * as _PreviewTaskInputResponseTransformation from './preview-task-input-response.transformation'; | ||
export * from './preview-task-input-response-error'; | ||
export * as _PreviewTaskInputResponseErrorTransformation from './preview-task-input-response-error.transformation'; | ||
export * from './preview-task-input-response-value'; | ||
@@ -157,0 +155,0 @@ export * as _PreviewTaskInputResponseValueTransformation from './preview-task-input-response-value.transformation'; |
@@ -1,2 +0,1 @@ | ||
import { PreviewTaskInputResponseError } from './preview-task-input-response-error'; | ||
import { PreviewTaskInputResponseValue } from './preview-task-input-response-value'; | ||
@@ -6,3 +5,5 @@ export interface PreviewTaskInputResponse { | ||
value: PreviewTaskInputResponseValue; | ||
error: PreviewTaskInputResponseError; | ||
error: { | ||
[propName: string]: any; | ||
}; | ||
} |
import { ErrorType } from './types'; | ||
/** | ||
* Error base. All client errors should extend this class. | ||
* Base error for all client SDKs. All other errors extend this class. | ||
*/ | ||
@@ -11,2 +11,14 @@ export declare class ApiClientError extends Error { | ||
} | ||
/** | ||
* ApiClientError type guard function. | ||
* Does a structural check of the passed object. | ||
* @example | ||
* try { | ||
* doSomething(); | ||
* } catch (e: unknown) { | ||
* if(isApiClientError(e)) { | ||
* handleTheError(); | ||
* } | ||
* } | ||
*/ | ||
export declare function isApiClientError(e: any): e is ApiClientError; |
@@ -7,2 +7,5 @@ import { HttpClientResponse } from '@dynatrace-sdk/http-client'; | ||
}>; | ||
/** | ||
* Reference for *ApiGatewayError* details object. Contains information about received API Getaway error. | ||
* */ | ||
export interface ApiGatewayErrorDetails extends CommonErrorDetails { | ||
@@ -13,2 +16,6 @@ errorCodeProperties?: { | ||
} | ||
/** | ||
* Dedicated error response class for errors thrown by API Gateway. | ||
* Autogenerated SDK Clients have built-in handler for API Gateway errors that throws this error. | ||
*/ | ||
export declare class ApiGatewayError extends ClientRequestError<ApiGatewayErrorResponseBody> { | ||
@@ -20,2 +27,14 @@ readonly isApiGatewayError = true; | ||
} | ||
/** | ||
* APIGatewayError type guard function. | ||
* Does a structural check of the passed object. | ||
* @example | ||
* try { | ||
* doSomething(); | ||
* } catch (e: unknown) { | ||
* if(isApiClientError(e)) { | ||
* handleTheError(); | ||
* } | ||
* } | ||
*/ | ||
export declare function isApiGatewayError(e: any): e is ApiGatewayError; |
import { HttpClientResponse } from '@dynatrace-sdk/http-client'; | ||
import { ApiClientError } from './api-client-error'; | ||
import { ErrorResponseBody } from './types'; | ||
/** | ||
* Generic error class for service errors, used to handle both expected and unexpected service-level errors. | ||
* @example Handling unexpected error response, received by the SDK Client | ||
* const responseValue = await response.body('json'); | ||
* | ||
* throw new ClientRequestError( | ||
* `${response.status}`, | ||
* response, | ||
* responseValue, | ||
* getErrorMessage( | ||
* responseValue, | ||
* `Unexpected api response: code=${response.status} body="${responseValue}"`, | ||
* ), | ||
* e, | ||
* ); | ||
* | ||
*/ | ||
export declare class ClientRequestError<DTO = ErrorResponseBody> extends ApiClientError { | ||
@@ -10,2 +27,14 @@ readonly isClientRequestError = true; | ||
} | ||
/** | ||
* ClientRequestError type guard function. | ||
* Does a structural check of the passed object. | ||
* @example | ||
* try { | ||
* doSomething(); | ||
* } catch (e: unknown) { | ||
* if(isClientRequestError(e)) { | ||
* handleTheError(); | ||
* } | ||
* } | ||
*/ | ||
export declare function isClientRequestError(e: any): e is ClientRequestError; |
@@ -5,3 +5,2 @@ export * from './api-client-error'; | ||
export * from './invalid-response-error'; | ||
export * from './sdk-error'; | ||
export * from './types'; |
import { ApiClientError } from './api-client-error'; | ||
/** | ||
* Dedicated error class for errors related to response serialization. | ||
* Thrown when received service response can't be deserialized. | ||
**/ | ||
export declare class InvalidResponseError extends ApiClientError { | ||
@@ -10,2 +14,14 @@ readonly isInvalidResponseError = true; | ||
} | ||
/** | ||
* InvalidResponseError type guard function. | ||
* Does a structural check of the passed object. | ||
* @example | ||
* try { | ||
* doSomething(); | ||
* } catch (e: unknown) { | ||
* if (isInvalidResponseError(e)) { | ||
* throw e; | ||
* } | ||
* } | ||
*/ | ||
export declare function isInvalidResponseError(e: any): e is InvalidResponseError; |
@@ -1,6 +0,2 @@ | ||
/** | ||
* Possible serialized error types | ||
* `COMMON`: Common JS error | ||
* `HTTP`: Error thrown by a http-client | ||
*/ | ||
/** @ignore*/ | ||
export declare enum ErrorType { | ||
@@ -10,23 +6,84 @@ COMMON = "JS Error", | ||
} | ||
/** | ||
* Basic error envelope, that enforces all error to have mandatory "error" property. | ||
* */ | ||
export interface ErrorResponseBody<T = CommonApiError> { | ||
/** | ||
* *error* object must have two mandatory fields (*code, message*) and may have two additional fields (*help, details*): | ||
* refer to the *CommonApiError* for more details. | ||
* */ | ||
error: T; | ||
} | ||
/** | ||
* Common API error structure, established by Dynatrace API guidelines. | ||
* */ | ||
export interface CommonApiError<T extends Record<string, any> = Record<string, any>> { | ||
/** The error code should be set to the HTTP error code by default.<br> | ||
* The error code may be set to an API-specific error code which must be properly documented.*/ | ||
code: number; | ||
/** The error message should be short and precise, it should not contain details.*/ | ||
message: string; | ||
/** | ||
* An additional help field may be added which must be a URL to further information on how to deal with the error.<br> | ||
* This may be some detailed error documentation page or a link to the Dynatrace support system, etc. | ||
* */ | ||
help?: string; | ||
/** | ||
* Additional details about the error may be added in a details field. | ||
* Refer to *CommonErrorDetails* | ||
* */ | ||
details?: T; | ||
} | ||
/** | ||
* *CommonApiError* details object reference. Contains common API error information. | ||
* This object is used to convey additional information about the error like e.g., which query parameter exactly violated a precondition. <br> | ||
* Details may contain any fields to further describe the error | ||
* */ | ||
export interface CommonErrorDetails { | ||
/** | ||
* UUID string that represents a reference of the error into e.g., the log file of the service. | ||
* */ | ||
errorRef?: string; | ||
/** | ||
* String containing a 32-character hex integer value that is used for tracing. | ||
* */ | ||
traceId?: string; | ||
/** | ||
* String value representing a more detailed error information than the http response code alone. | ||
* Must be a single word in CamelCase, and all possible values must be documented. | ||
* */ | ||
errorCode?: string; | ||
/** | ||
* An array of *ConstraintViolation* object, refer to ConstraintViolation object reference for more details. | ||
* */ | ||
constraintViolations?: ConstraintViolation[]; | ||
/** | ||
* Must be an array of strings containing a complete list of missing IAM scopes necessary to successfully execute the request. | ||
* Should be set if the API returns a 403 - Forbidden response in case of missing OAuth scopes. | ||
* */ | ||
missingScopes?: string[]; | ||
/** | ||
* Must be an array of strings containing a complete list of missing IAM permissions necessary to successfully execute the request. | ||
* Should be set if the API returns a 403 - Forbidden response in case of missing OAuth user permissions. | ||
* */ | ||
missingPermissions?: string[]; | ||
} | ||
/** | ||
* Contains information about an input parameter (path, query or request body) | ||
* that violated some validation rule of the service API and caused the warning.<br> | ||
* May contain additional fields further describing the warning. | ||
* */ | ||
export interface ConstraintViolation extends Record<string, string | undefined> { | ||
/** | ||
* Mandatory field message describing the warning. | ||
* */ | ||
message: string; | ||
/** | ||
* Describes the general location of the violating parameter (query parameter, request body, etc.) | ||
*/ | ||
parameterLocation?: string; | ||
/** | ||
* Refers to the violating parameter within the parameterLocation. | ||
*/ | ||
path?: string; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1487345
32276
6950
375
+ Added@dynatrace-sdk/shared-errors@1.0.0(transitive)
- Removed@dynatrace-sdk/shared-errors@0.0.4(transitive)