@dynatrace-sdk/client-classic-environment-v2 9.0.0 → 9.0.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 +8 -0
- package/README.md +1 -1
- package/cjs/index.js +52 -33
- package/dynatrace-metadata.json +2 -2
- package/esm/index.js +52 -33
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
@dynatrace-sdk/client-classic-environment-v2
|
|
4
4
|
|
|
5
|
+
## 9.0.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- Fix encoding of the fields query parameter - reserved characters are now preserved verbatim instead of being percent-encoded. (APPDEV-19736)
|
|
10
|
+
|
|
5
11
|
## 9.0.0
|
|
6
12
|
|
|
7
13
|
### Major Changes
|
|
14
|
+
|
|
8
15
|
- BREAKING: `SyntheticLocationsNodesAndConfigurationClient.updateConfiguration` now returns `Promise<void>` because the endpoint returns HTTP 204 without a response body. Do not consume the resolved `SyntheticConfigDto`.
|
|
9
16
|
- BREAKING: `SyntheticConfigDto.maintenanceWindowsExcludedFromAvailability` is now required. Include this field in every `updateConfiguration` request.
|
|
10
17
|
|
|
11
18
|
### Minor Changes
|
|
19
|
+
|
|
12
20
|
- Add optional `monitorCrossOriginFrames` to `SyntheticBrowserMonitorConfigurationDto`.
|
|
13
21
|
- Add `asHistogram` to metric descriptor transformations.
|
|
14
22
|
- Deprecate the API-token operations on `accessTokensApiTokensClient`.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @dynatrace-sdk/client-classic-environment-v2
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@dynatrace-sdk/client-classic-environment-v2/v/9.0.1)
|
|
4
4
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
5
|
|
|
6
6
|
|
package/cjs/index.js
CHANGED
|
@@ -613,29 +613,36 @@ function transformToFormDataField(value, field) {
|
|
|
613
613
|
}
|
|
614
614
|
|
|
615
615
|
// packages/client/classic-environment-v2/src/lib/utils/url-helpers.ts
|
|
616
|
-
var
|
|
616
|
+
var flagFor = (flags, key, fallback) => flags && Object.prototype.hasOwnProperty.call(flags, key) ? flags[key] : fallback;
|
|
617
|
+
var encodeAllowingReserved = (value) => value.replace(/[^:/?#[\]@!$&'()*+,;=]+/g, (unreserved) => encodeURIComponent(unreserved));
|
|
618
|
+
var encodeQueryParamValue = (value, allowReserved) => {
|
|
619
|
+
const rawValue = String(value);
|
|
620
|
+
return allowReserved ? encodeAllowingReserved(rawValue) : encodeURIComponent(rawValue);
|
|
621
|
+
};
|
|
622
|
+
var encodeQueryParam = (key, value, allowReserved) => {
|
|
617
623
|
const encodedKey = encodeURIComponent(key);
|
|
618
|
-
return `${encodedKey}=${
|
|
624
|
+
return `${encodedKey}=${encodeQueryParamValue(value, allowReserved)}`;
|
|
619
625
|
};
|
|
620
|
-
var addExplodedArrayQueryParam = (query, key) => {
|
|
626
|
+
var addExplodedArrayQueryParam = (query, key, allowReserved) => {
|
|
621
627
|
const arrayValue = query[key];
|
|
622
|
-
return arrayValue.map((value) => encodeQueryParam(key, value)).join("&");
|
|
628
|
+
return arrayValue.map((value) => encodeQueryParam(key, value, allowReserved)).join("&");
|
|
623
629
|
};
|
|
624
|
-
var addNonExplodedArrayQueryParams = (query, key) => {
|
|
630
|
+
var addNonExplodedArrayQueryParams = (query, key, allowReserved) => {
|
|
625
631
|
const encodedKey = encodeURIComponent(key);
|
|
626
|
-
const encodedParamsList = query[key].map((value) =>
|
|
632
|
+
const encodedParamsList = query[key].map((value) => encodeQueryParamValue(value, allowReserved)).join(",");
|
|
627
633
|
return `${encodedKey}=${encodedParamsList}`;
|
|
628
634
|
};
|
|
629
|
-
var addQueryParam = (query, key) => encodeQueryParam(key, query[key]);
|
|
630
|
-
var arrayQueryParams = (query, key, explode) => {
|
|
631
|
-
return explode ? addExplodedArrayQueryParam(query, key) : addNonExplodedArrayQueryParams(query, key);
|
|
635
|
+
var addQueryParam = (query, key, allowReserved) => encodeQueryParam(key, query[key], allowReserved);
|
|
636
|
+
var arrayQueryParams = (query, key, explode, allowReserved) => {
|
|
637
|
+
return explode ? addExplodedArrayQueryParam(query, key, allowReserved) : addNonExplodedArrayQueryParams(query, key, allowReserved);
|
|
632
638
|
};
|
|
633
639
|
var toQueryString = (rawQuery, flags = {}) => {
|
|
634
640
|
const query = rawQuery || {};
|
|
635
641
|
const keys = Object.keys(query).filter((key) => typeof query[key] !== "undefined");
|
|
636
|
-
const queryString = keys.map(
|
|
637
|
-
|
|
638
|
-
|
|
642
|
+
const queryString = keys.map((key) => {
|
|
643
|
+
const allowReserved = flagFor(flags.allowReserved, key, false);
|
|
644
|
+
return Array.isArray(query[key]) ? arrayQueryParams(query, key, flagFor(flags.explode, key, true), allowReserved) : addQueryParam(query, key, allowReserved);
|
|
645
|
+
}).join("&");
|
|
639
646
|
return queryString ? `?${queryString}` : "";
|
|
640
647
|
};
|
|
641
648
|
|
|
@@ -18423,16 +18430,19 @@ var MetricsClient = class {
|
|
|
18423
18430
|
if (!config) {
|
|
18424
18431
|
throw new import_shared_errors28.ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
18425
18432
|
}
|
|
18426
|
-
const query = toQueryString(
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
|
|
18433
|
+
const query = toQueryString(
|
|
18434
|
+
{
|
|
18435
|
+
nextPageKey: config.nextPageKey,
|
|
18436
|
+
pageSize: config.pageSize,
|
|
18437
|
+
metricSelector: config.metricSelector,
|
|
18438
|
+
text: config.text,
|
|
18439
|
+
fields: config.fields,
|
|
18440
|
+
writtenSince: config.writtenSince,
|
|
18441
|
+
writtenSinceMode: config.writtenSinceMode,
|
|
18442
|
+
metadataSelector: config.metadataSelector
|
|
18443
|
+
},
|
|
18444
|
+
{ allowReserved: { fields: true } }
|
|
18445
|
+
);
|
|
18436
18446
|
try {
|
|
18437
18447
|
const response = await this.httpClient.send({
|
|
18438
18448
|
url: `/platform/classic/environment-api/v2/metrics${query}`,
|
|
@@ -19419,7 +19429,10 @@ var MetricsUnitsClient = class {
|
|
|
19419
19429
|
if (!config) {
|
|
19420
19430
|
throw new import_shared_errors29.ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
19421
19431
|
}
|
|
19422
|
-
const query = toQueryString(
|
|
19432
|
+
const query = toQueryString(
|
|
19433
|
+
{ unitSelector: config.unitSelector, fields: config.fields },
|
|
19434
|
+
{ allowReserved: { fields: true } }
|
|
19435
|
+
);
|
|
19423
19436
|
try {
|
|
19424
19437
|
const response = await this.httpClient.send({
|
|
19425
19438
|
url: `/platform/classic/environment-api/v2/units${query}`,
|
|
@@ -20815,15 +20828,18 @@ var MonitoredEntitiesClient = class {
|
|
|
20815
20828
|
if (!config) {
|
|
20816
20829
|
throw new import_shared_errors31.ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
20817
20830
|
}
|
|
20818
|
-
const query = toQueryString(
|
|
20819
|
-
|
|
20820
|
-
|
|
20821
|
-
|
|
20822
|
-
|
|
20823
|
-
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
20831
|
+
const query = toQueryString(
|
|
20832
|
+
{
|
|
20833
|
+
nextPageKey: config.nextPageKey,
|
|
20834
|
+
pageSize: config.pageSize,
|
|
20835
|
+
entitySelector: config.entitySelector,
|
|
20836
|
+
from: config.from,
|
|
20837
|
+
to: config.to,
|
|
20838
|
+
fields: config.fields,
|
|
20839
|
+
sort: config.sort
|
|
20840
|
+
},
|
|
20841
|
+
{ allowReserved: { fields: true } }
|
|
20842
|
+
);
|
|
20827
20843
|
try {
|
|
20828
20844
|
const response = await this.httpClient.send({
|
|
20829
20845
|
url: `/platform/classic/environment-api/v2/entities${query}`,
|
|
@@ -21428,7 +21444,10 @@ var MonitoredEntitiesClient = class {
|
|
|
21428
21444
|
if (!config) {
|
|
21429
21445
|
throw new import_shared_errors31.ApiClientError("API client error", "API client call is missing mandatory config parameter");
|
|
21430
21446
|
}
|
|
21431
|
-
const query = toQueryString(
|
|
21447
|
+
const query = toQueryString(
|
|
21448
|
+
{ from: config.from, to: config.to, fields: config.fields },
|
|
21449
|
+
{ allowReserved: { fields: true } }
|
|
21450
|
+
);
|
|
21432
21451
|
try {
|
|
21433
21452
|
const response = await this.httpClient.send({
|
|
21434
21453
|
url: `/platform/classic/environment-api/v2/entities/${config.entityId}${query}`,
|
package/dynatrace-metadata.json
CHANGED
package/esm/index.js
CHANGED
|
@@ -238,29 +238,36 @@ function transformToFormDataField(value, field) {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
// packages/client/classic-environment-v2/src/lib/utils/url-helpers.ts
|
|
241
|
-
var
|
|
241
|
+
var flagFor = (flags, key, fallback) => flags && Object.prototype.hasOwnProperty.call(flags, key) ? flags[key] : fallback;
|
|
242
|
+
var encodeAllowingReserved = (value) => value.replace(/[^:/?#[\]@!$&'()*+,;=]+/g, (unreserved) => encodeURIComponent(unreserved));
|
|
243
|
+
var encodeQueryParamValue = (value, allowReserved) => {
|
|
244
|
+
const rawValue = String(value);
|
|
245
|
+
return allowReserved ? encodeAllowingReserved(rawValue) : encodeURIComponent(rawValue);
|
|
246
|
+
};
|
|
247
|
+
var encodeQueryParam = (key, value, allowReserved) => {
|
|
242
248
|
const encodedKey = encodeURIComponent(key);
|
|
243
|
-
return `${encodedKey}=${
|
|
249
|
+
return `${encodedKey}=${encodeQueryParamValue(value, allowReserved)}`;
|
|
244
250
|
};
|
|
245
|
-
var addExplodedArrayQueryParam = (query, key) => {
|
|
251
|
+
var addExplodedArrayQueryParam = (query, key, allowReserved) => {
|
|
246
252
|
const arrayValue = query[key];
|
|
247
|
-
return arrayValue.map((value) => encodeQueryParam(key, value)).join("&");
|
|
253
|
+
return arrayValue.map((value) => encodeQueryParam(key, value, allowReserved)).join("&");
|
|
248
254
|
};
|
|
249
|
-
var addNonExplodedArrayQueryParams = (query, key) => {
|
|
255
|
+
var addNonExplodedArrayQueryParams = (query, key, allowReserved) => {
|
|
250
256
|
const encodedKey = encodeURIComponent(key);
|
|
251
|
-
const encodedParamsList = query[key].map((value) =>
|
|
257
|
+
const encodedParamsList = query[key].map((value) => encodeQueryParamValue(value, allowReserved)).join(",");
|
|
252
258
|
return `${encodedKey}=${encodedParamsList}`;
|
|
253
259
|
};
|
|
254
|
-
var addQueryParam = (query, key) => encodeQueryParam(key, query[key]);
|
|
255
|
-
var arrayQueryParams = (query, key, explode) => {
|
|
256
|
-
return explode ? addExplodedArrayQueryParam(query, key) : addNonExplodedArrayQueryParams(query, key);
|
|
260
|
+
var addQueryParam = (query, key, allowReserved) => encodeQueryParam(key, query[key], allowReserved);
|
|
261
|
+
var arrayQueryParams = (query, key, explode, allowReserved) => {
|
|
262
|
+
return explode ? addExplodedArrayQueryParam(query, key, allowReserved) : addNonExplodedArrayQueryParams(query, key, allowReserved);
|
|
257
263
|
};
|
|
258
264
|
var toQueryString = (rawQuery, flags = {}) => {
|
|
259
265
|
const query = rawQuery || {};
|
|
260
266
|
const keys = Object.keys(query).filter((key) => typeof query[key] !== "undefined");
|
|
261
|
-
const queryString = keys.map(
|
|
262
|
-
|
|
263
|
-
|
|
267
|
+
const queryString = keys.map((key) => {
|
|
268
|
+
const allowReserved = flagFor(flags.allowReserved, key, false);
|
|
269
|
+
return Array.isArray(query[key]) ? arrayQueryParams(query, key, flagFor(flags.explode, key, true), allowReserved) : addQueryParam(query, key, allowReserved);
|
|
270
|
+
}).join("&");
|
|
264
271
|
return queryString ? `?${queryString}` : "";
|
|
265
272
|
};
|
|
266
273
|
|
|
@@ -18237,16 +18244,19 @@ var MetricsClient = class {
|
|
|
18237
18244
|
if (!config) {
|
|
18238
18245
|
throw new ApiClientError22("API client error", "API client call is missing mandatory config parameter");
|
|
18239
18246
|
}
|
|
18240
|
-
const query = toQueryString(
|
|
18241
|
-
|
|
18242
|
-
|
|
18243
|
-
|
|
18244
|
-
|
|
18245
|
-
|
|
18246
|
-
|
|
18247
|
-
|
|
18248
|
-
|
|
18249
|
-
|
|
18247
|
+
const query = toQueryString(
|
|
18248
|
+
{
|
|
18249
|
+
nextPageKey: config.nextPageKey,
|
|
18250
|
+
pageSize: config.pageSize,
|
|
18251
|
+
metricSelector: config.metricSelector,
|
|
18252
|
+
text: config.text,
|
|
18253
|
+
fields: config.fields,
|
|
18254
|
+
writtenSince: config.writtenSince,
|
|
18255
|
+
writtenSinceMode: config.writtenSinceMode,
|
|
18256
|
+
metadataSelector: config.metadataSelector
|
|
18257
|
+
},
|
|
18258
|
+
{ allowReserved: { fields: true } }
|
|
18259
|
+
);
|
|
18250
18260
|
try {
|
|
18251
18261
|
const response = await this.httpClient.send({
|
|
18252
18262
|
url: `/platform/classic/environment-api/v2/metrics${query}`,
|
|
@@ -19242,7 +19252,10 @@ var MetricsUnitsClient = class {
|
|
|
19242
19252
|
if (!config) {
|
|
19243
19253
|
throw new ApiClientError23("API client error", "API client call is missing mandatory config parameter");
|
|
19244
19254
|
}
|
|
19245
|
-
const query = toQueryString(
|
|
19255
|
+
const query = toQueryString(
|
|
19256
|
+
{ unitSelector: config.unitSelector, fields: config.fields },
|
|
19257
|
+
{ allowReserved: { fields: true } }
|
|
19258
|
+
);
|
|
19246
19259
|
try {
|
|
19247
19260
|
const response = await this.httpClient.send({
|
|
19248
19261
|
url: `/platform/classic/environment-api/v2/units${query}`,
|
|
@@ -20658,15 +20671,18 @@ var MonitoredEntitiesClient = class {
|
|
|
20658
20671
|
if (!config) {
|
|
20659
20672
|
throw new ApiClientError25("API client error", "API client call is missing mandatory config parameter");
|
|
20660
20673
|
}
|
|
20661
|
-
const query = toQueryString(
|
|
20662
|
-
|
|
20663
|
-
|
|
20664
|
-
|
|
20665
|
-
|
|
20666
|
-
|
|
20667
|
-
|
|
20668
|
-
|
|
20669
|
-
|
|
20674
|
+
const query = toQueryString(
|
|
20675
|
+
{
|
|
20676
|
+
nextPageKey: config.nextPageKey,
|
|
20677
|
+
pageSize: config.pageSize,
|
|
20678
|
+
entitySelector: config.entitySelector,
|
|
20679
|
+
from: config.from,
|
|
20680
|
+
to: config.to,
|
|
20681
|
+
fields: config.fields,
|
|
20682
|
+
sort: config.sort
|
|
20683
|
+
},
|
|
20684
|
+
{ allowReserved: { fields: true } }
|
|
20685
|
+
);
|
|
20670
20686
|
try {
|
|
20671
20687
|
const response = await this.httpClient.send({
|
|
20672
20688
|
url: `/platform/classic/environment-api/v2/entities${query}`,
|
|
@@ -21271,7 +21287,10 @@ var MonitoredEntitiesClient = class {
|
|
|
21271
21287
|
if (!config) {
|
|
21272
21288
|
throw new ApiClientError25("API client error", "API client call is missing mandatory config parameter");
|
|
21273
21289
|
}
|
|
21274
|
-
const query = toQueryString(
|
|
21290
|
+
const query = toQueryString(
|
|
21291
|
+
{ from: config.from, to: config.to, fields: config.fields },
|
|
21292
|
+
{ allowReserved: { fields: true } }
|
|
21293
|
+
);
|
|
21275
21294
|
try {
|
|
21276
21295
|
const response = await this.httpClient.send({
|
|
21277
21296
|
url: `/platform/classic/environment-api/v2/entities/${config.entityId}${query}`,
|