@dynatrace-sdk/client-classic-environment-v2 3.7.2 → 3.7.3

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 (51) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +66 -107
  3. package/cjs/index.js +3520 -3784
  4. package/dynatrace-metadata.json +2 -2
  5. package/esm/index.js +1935 -2002
  6. package/package.json +3 -3
  7. package/types/packages/client/classic-environment-v2/src/lib/apis/access-tokens-active-gate-tokens-api.d.ts +2 -3
  8. package/types/packages/client/classic-environment-v2/src/lib/apis/access-tokens-agent-tokens-api.d.ts +1 -1
  9. package/types/packages/client/classic-environment-v2/src/lib/apis/access-tokens-api-tokens-api.d.ts +1 -1
  10. package/types/packages/client/classic-environment-v2/src/lib/apis/access-tokens-tenant-tokens-api.d.ts +1 -1
  11. package/types/packages/client/classic-environment-v2/src/lib/apis/active-gates-active-gate-groups-api.d.ts +1 -1
  12. package/types/packages/client/classic-environment-v2/src/lib/apis/active-gates-api.d.ts +1 -1
  13. package/types/packages/client/classic-environment-v2/src/lib/apis/active-gates-auto-update-configuration-api.d.ts +5 -27
  14. package/types/packages/client/classic-environment-v2/src/lib/apis/active-gates-auto-update-jobs-api.d.ts +1 -1
  15. package/types/packages/client/classic-environment-v2/src/lib/apis/attacks-api.d.ts +1 -1
  16. package/types/packages/client/classic-environment-v2/src/lib/apis/audit-logs-api.d.ts +1 -1
  17. package/types/packages/client/classic-environment-v2/src/lib/apis/business-events-api.d.ts +1 -1
  18. package/types/packages/client/classic-environment-v2/src/lib/apis/credential-vault-api.d.ts +3 -9
  19. package/types/packages/client/classic-environment-v2/src/lib/apis/davis-security-advisor-api.d.ts +1 -1
  20. package/types/packages/client/classic-environment-v2/src/lib/apis/events-api.d.ts +2 -5
  21. package/types/packages/client/classic-environment-v2/src/lib/apis/extensions-2-0-api.d.ts +1 -1
  22. package/types/packages/client/classic-environment-v2/src/lib/apis/logs-api.d.ts +1 -1
  23. package/types/packages/client/classic-environment-v2/src/lib/apis/metrics-api.d.ts +1 -1
  24. package/types/packages/client/classic-environment-v2/src/lib/apis/metrics-units-api.d.ts +1 -1
  25. package/types/packages/client/classic-environment-v2/src/lib/apis/monitored-entities-api.d.ts +1 -1
  26. package/types/packages/client/classic-environment-v2/src/lib/apis/monitored-entities-custom-tags-api.d.ts +1 -1
  27. package/types/packages/client/classic-environment-v2/src/lib/apis/monitored-entities-monitoring-state-api.d.ts +1 -1
  28. package/types/packages/client/classic-environment-v2/src/lib/apis/network-zones-api.d.ts +1 -1
  29. package/types/packages/client/classic-environment-v2/src/lib/apis/problems-api.d.ts +1 -1
  30. package/types/packages/client/classic-environment-v2/src/lib/apis/releases-api.d.ts +1 -1
  31. package/types/packages/client/classic-environment-v2/src/lib/apis/security-problems-api.d.ts +8 -13
  32. package/types/packages/client/classic-environment-v2/src/lib/apis/service-level-objectives-api.d.ts +4 -6
  33. package/types/packages/client/classic-environment-v2/src/lib/apis/settings-management-zones-api.d.ts +1 -1
  34. package/types/packages/client/classic-environment-v2/src/lib/apis/settings-objects-api.d.ts +6 -6
  35. package/types/packages/client/classic-environment-v2/src/lib/apis/settings-schemas-api.d.ts +1 -1
  36. package/types/packages/client/classic-environment-v2/src/lib/apis/synthetic-http-monitor-executions-api.d.ts +2 -5
  37. package/types/packages/client/classic-environment-v2/src/lib/apis/synthetic-locations-nodes-and-configuration-api.d.ts +3 -6
  38. package/types/packages/client/classic-environment-v2/src/lib/apis/synthetic-network-availability-monitors-api.d.ts +1 -1
  39. package/types/packages/client/classic-environment-v2/src/lib/apis/synthetic-on-demand-monitor-executions-api.d.ts +1 -1
  40. package/types/packages/{client/classic-environment-v2/src/lib/apis → shared-client-utils/src}/api-client-options.d.ts +1 -1
  41. package/types/packages/shared-client-utils/src/api-gateway-errors-handler.d.ts +9 -0
  42. package/types/packages/shared-client-utils/src/encoding.d.ts +17 -0
  43. package/types/packages/shared-client-utils/src/get-error-message.d.ts +8 -0
  44. package/types/packages/shared-client-utils/src/index.d.ts +6 -0
  45. package/types/packages/shared-client-utils/src/transformations.d.ts +64 -0
  46. package/types/packages/shared-client-utils/src/url-helpers.d.ts +12 -0
  47. package/types/packages/client/classic-environment-v2/src/lib/error-envelopes/api-gateway-errors-handler.d.ts +0 -2
  48. package/types/packages/client/classic-environment-v2/src/lib/error-envelopes/get-error-message.d.ts +0 -1
  49. package/types/packages/client/classic-environment-v2/src/lib/utils/encoding.d.ts +0 -10
  50. package/types/packages/client/classic-environment-v2/src/lib/utils/transformations.d.ts +0 -8
  51. package/types/packages/client/classic-environment-v2/src/lib/utils/url-helpers.d.ts +0 -6
@@ -1,4 +1,5 @@
1
1
  import { AbortSignal, HttpClient } from '@dynatrace-sdk/http-client';
2
+ import { ApiClientOptions } from '@dynatrace-sdk/shared-client-utils';
2
3
  import { Node } from '../models/node';
3
4
  import { Nodes } from '../models/nodes';
4
5
  import { PrivateSyntheticLocation } from '../models/private-synthetic-location';
@@ -8,7 +9,6 @@ import { SyntheticLocationIdsDto } from '../models/synthetic-location-ids-dto';
8
9
  import { SyntheticLocationUpdate } from '../models/synthetic-location-update';
9
10
  import { SyntheticLocations } from '../models/synthetic-locations';
10
11
  import { SyntheticPublicLocationsStatus } from '../models/synthetic-public-locations-status';
11
- import { ApiClientOptions } from './api-client-options';
12
12
  export declare class SyntheticLocationsNodesAndConfigurationClient {
13
13
  private httpClient;
14
14
  private shouldTransformDates;
@@ -106,7 +106,7 @@ export declare class SyntheticLocationsNodesAndConfigurationClient {
106
106
  * longitude: 10,
107
107
  * name: "...",
108
108
  * nodes: ["..."],
109
- * type: PrivateSyntheticLocationType.Cluster,
109
+ * type: "CLUSTER",
110
110
  * },
111
111
  * },
112
112
  * );
@@ -221,10 +221,7 @@ export declare class SyntheticLocationsNodesAndConfigurationClient {
221
221
  *
222
222
  * const data =
223
223
  * await syntheticLocationsNodesAndConfigurationClient.updateLocation(
224
- * {
225
- * locationId: "...",
226
- * body: { type: SyntheticLocationUpdateType.Private },
227
- * },
224
+ * { locationId: "...", body: { type: "PRIVATE" } },
228
225
  * );
229
226
  *
230
227
  * @throws {ErrorEnvelopeError} Client side error. | Server side error.
@@ -1,9 +1,9 @@
1
1
  import { AbortSignal, HttpClient } from '@dynatrace-sdk/http-client';
2
+ import { ApiClientOptions } from '@dynatrace-sdk/shared-client-utils';
2
3
  import { MonitorEntityIdDto } from '../models/monitor-entity-id-dto';
3
4
  import { SyntheticMonitorListDto } from '../models/synthetic-monitor-list-dto';
4
5
  import { SyntheticMultiProtocolMonitorDto } from '../models/synthetic-multi-protocol-monitor-dto';
5
6
  import { SyntheticMultiProtocolMonitorUpdateDto } from '../models/synthetic-multi-protocol-monitor-update-dto';
6
- import { ApiClientOptions } from './api-client-options';
7
7
  /**
8
8
  * Create, read, update and delete synthetic monitors. Currently network availability monitors only.
9
9
  */
@@ -1,10 +1,10 @@
1
1
  import { AbortSignal, HttpClient } from '@dynatrace-sdk/http-client';
2
+ import { ApiClientOptions } from '@dynatrace-sdk/shared-client-utils';
2
3
  import { SyntheticOnDemandBatchStatus } from '../models/synthetic-on-demand-batch-status';
3
4
  import { SyntheticOnDemandExecution } from '../models/synthetic-on-demand-execution';
4
5
  import { SyntheticOnDemandExecutionRequest } from '../models/synthetic-on-demand-execution-request';
5
6
  import { SyntheticOnDemandExecutionResult } from '../models/synthetic-on-demand-execution-result';
6
7
  import { SyntheticOnDemandExecutions } from '../models/synthetic-on-demand-executions';
7
- import { ApiClientOptions } from './api-client-options';
8
8
  /**
9
9
  * Trigger and view information about on-demand synthetic monitor executions
10
10
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Configuration for generated TypeScript SDK clients
2
+ * Configuration for the API client.
3
3
  * @param {boolean} transformDates - Flag to control date transformations, enabled by default.
4
4
  */
5
5
  export interface ApiClientOptions {
@@ -0,0 +1,9 @@
1
+ import type { HttpClientResponse } from '@dynatrace-sdk/http-client';
2
+ /**
3
+ * Handles errors from API Gateway responses.
4
+ * Throws an ApiGatewayError if the response source is 'API Gateway'.
5
+ *
6
+ * @param {HttpClientResponse} response - The HTTP response to check for API Gateway errors.
7
+ * @throws {ApiGatewayError} If the response is from API Gateway and contains an error.
8
+ */
9
+ export declare function apiGatewayErrorsHandler(response: HttpClientResponse): Promise<void>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Available formats to transform models to and from
3
+ */
4
+ export declare enum Encoding {
5
+ Json = "json",
6
+ Text = "text",
7
+ Binary = "binary",
8
+ FormData = "form-data"
9
+ }
10
+ /**
11
+ * Maps a MIME type string to an Encoding.
12
+ *
13
+ * @param {string} mimeType - The MIME type to convert (e.g., 'application/json').
14
+ * @param {Encoding} [defaultEncoding] - The encoding to return if the MIME type isn't recognized.
15
+ * @returns {Encoding} The corresponding Encoding enum value, or the defaultEncoding if not recognized.
16
+ */
17
+ export declare function mimeTypeToEncoding(mimeType: string, defaultEncoding?: Encoding): Encoding;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns a user-friendly error message from an error body object.
3
+ *
4
+ * @param {unknown} errorBody - The error object or response body to extract the message from.
5
+ * @param {string} defaultMessage - The default message to use if no error message is found.
6
+ * @returns {string} The extracted or default error message, possibly including details.
7
+ */
8
+ export declare function getErrorMessage(errorBody: unknown, defaultMessage: string): string;
@@ -0,0 +1,6 @@
1
+ export * from './api-client-options';
2
+ export * from './api-gateway-errors-handler';
3
+ export * from './encoding';
4
+ export * from './get-error-message';
5
+ export * from './transformations';
6
+ export * from './url-helpers';
@@ -0,0 +1,64 @@
1
+ import { FormDataRequestBody, FormDataRequestField, FormDataResponseBody } from '@dynatrace-sdk/http-client';
2
+ export type TransformRuleConfig = {
3
+ force?: boolean;
4
+ datetime?: boolean;
5
+ };
6
+ export type TransformRulesParam = Array<string | [string, TransformRuleConfig]>;
7
+ /**
8
+ * Transforms an object by applying transformation rules before sending it in a request.
9
+ *
10
+ * @template T
11
+ * @param {T} object - The object to transform.
12
+ * @param {TransformRulesParam} rules - The transformation rules to apply.
13
+ * @returns {T} The transformed object.
14
+ */
15
+ export declare function transformRequest<T = any>(object: T, rules: TransformRulesParam): T;
16
+ /**
17
+ * Transforms an object by applying transformation rules after receiving it in a response.
18
+ *
19
+ * @template T
20
+ * @param {T} object - The object to transform.
21
+ * @param {TransformRulesParam} rules - The transformation rules to apply.
22
+ * @returns {T} The transformed object.
23
+ */
24
+ export declare function transformResponse<T = any>(object: T, rules: TransformRulesParam): T;
25
+ export interface FormDataRequestFieldDefinition {
26
+ key: string;
27
+ type: 'text' | 'json' | 'binary';
28
+ required: boolean;
29
+ }
30
+ export interface FormDataResponseGenericFieldDefinition {
31
+ type: 'text' | 'binary';
32
+ }
33
+ export interface FormDataResponseJsonFieldDefinition {
34
+ type: 'json';
35
+ transformations: Array<string | [string, TransformRuleConfig]>;
36
+ }
37
+ export type FormDataResponseFieldDefinition = FormDataResponseGenericFieldDefinition | FormDataResponseJsonFieldDefinition;
38
+ /**
39
+ * Converts an object to a FormDataRequestBody using field definitions.
40
+ *
41
+ * @template T
42
+ * @param {T} value - The object to convert.
43
+ * @param {Array<FormDataRequestFieldDefinition>} fields - The field definitions for the form data.
44
+ * @returns {FormDataRequestBody} The resulting form data body.
45
+ */
46
+ export declare function transformToFormData<T extends Record<any, any>>(value: T, fields: Array<FormDataRequestFieldDefinition>): FormDataRequestBody;
47
+ /**
48
+ * Converts a value to a FormDataRequestField based on the field definition.
49
+ *
50
+ * @template T
51
+ * @param {T} value - The value to convert.
52
+ * @param {FormDataRequestFieldDefinition} field - The field definition.
53
+ * @returns {FormDataRequestField | null} The resulting form data field or null if not required and undefined.
54
+ */
55
+ export declare function transformToFormDataField<T = any>(value: T, field: FormDataRequestFieldDefinition): FormDataRequestField | null;
56
+ /**
57
+ * Converts form data and field definitions into a typed object, applying transformations for JSON fields.
58
+ *
59
+ * @template T
60
+ * @param {FormDataResponseBody} formData - The form data to convert.
61
+ * @param {Record<string, FormDataResponseFieldDefinition>} fields - The field definitions for the form data.
62
+ * @returns {T} The resulting typed object.
63
+ */
64
+ export declare function transformFromFormData<T extends Record<any, any>>(formData: FormDataResponseBody, fields: Record<string, FormDataResponseFieldDefinition>): T;
@@ -0,0 +1,12 @@
1
+ export type QueryParamsType = Record<string | number, any>;
2
+ export interface ParametersFlags {
3
+ explode?: Record<string, boolean>;
4
+ }
5
+ /**
6
+ * Converts an object of query parameters into a URL query string.
7
+ *
8
+ * @param {QueryParamsType} [rawQuery] - The object containing query parameters.
9
+ * @param {ParametersFlags} [flags] - Flags to control parameter formatting (e.g., explode arrays).
10
+ * @returns {string} The resulting query string.
11
+ */
12
+ export declare const toQueryString: (rawQuery?: QueryParamsType, flags?: ParametersFlags) => string;
@@ -1,2 +0,0 @@
1
- import { HttpClientResponse } from '@dynatrace-sdk/http-client';
2
- export declare function apiGatewayErrorsHandler(response: HttpClientResponse): Promise<void>;
@@ -1 +0,0 @@
1
- export declare function getErrorMessage(errorBody: unknown, defaultMessage: string): string;
@@ -1,10 +0,0 @@
1
- /**
2
- * Available formats to transform models to and from
3
- */
4
- export declare enum Encoding {
5
- Json = "json",
6
- Text = "text",
7
- Binary = "binary",
8
- FormData = "form-data"
9
- }
10
- export declare function mimeTypeToEncoding(mimeType: string, defaultEncoding?: Encoding): Encoding;
@@ -1,8 +0,0 @@
1
- type TransformRuleConfig = {
2
- force?: boolean;
3
- datetime?: boolean;
4
- };
5
- type TransformRulesParam = Array<string | [string, TransformRuleConfig]>;
6
- export declare function transformRequest<T = any>(object: T, rules: TransformRulesParam): T;
7
- export declare function transformResponse<T = any>(object: T, rules: TransformRulesParam): T;
8
- export {};
@@ -1,6 +0,0 @@
1
- type QueryParamsType = Record<string | number, any>;
2
- interface ParametersFlags {
3
- explode?: Record<string, boolean>;
4
- }
5
- export declare const toQueryString: (rawQuery?: QueryParamsType, flags?: ParametersFlags) => string;
6
- export {};