@dynatrace-sdk/client-classic-environment-v2 3.7.0 → 3.7.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 -1
- package/README.md +1 -1
- package/cjs/index.js +49 -20
- package/dynatrace-metadata.json +2 -3
- package/esm/index.js +49 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
@dynatrace-sdk/client-classic-environment-v2
|
|
4
4
|
|
|
5
|
+
## 3.7.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- Improve performance of payload transformations. (APPDEV-12840)
|
|
10
|
+
- Remove generatedAt property from metadata file. (APPDEV-12696)
|
|
11
|
+
|
|
5
12
|
## 3.7.0
|
|
6
13
|
|
|
7
14
|
### Minor Changes
|
|
8
15
|
|
|
9
16
|
- Fix `getPermissions` operation success response to return proper `AccessorPermissionsList` type instead of `AccessorPermissionsList[]` in **SettingsObjectsAPI**
|
|
10
|
-
- Add new `DEBUGGING` value
|
|
17
|
+
- Add new `DEBUGGING` value to `ActiveGateModule.type` enum
|
|
11
18
|
- Add new optional fields (`description`, `displayName`, `isRecommended`) to the `FeatureSetDetails` model
|
|
12
19
|
- Add new optional `browserExecutionSupported` field to the `PrivateSyntheticLocation` and `SyntheticPrivateLocationUpdate` models
|
|
13
20
|
- Made `targetList` field optional in `SyntheticMultiProtocolMonitorStepDto`
|
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/3.7.1)
|
|
4
4
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
5
|
|
|
6
6
|
|
package/cjs/index.js
CHANGED
|
@@ -432,6 +432,23 @@ function matchKey(key, keys) {
|
|
|
432
432
|
}
|
|
433
433
|
return null;
|
|
434
434
|
}
|
|
435
|
+
var potentialMatchForRoot = (pattern, key) => pattern.startsWith(key) || pattern.startsWith("*") || pattern.startsWith("**");
|
|
436
|
+
var potentialMatch = (pattern, key) => pattern.startsWith(key) || pattern.includes("*") || pattern.includes("**");
|
|
437
|
+
function partialMatch(key, keyPatterns) {
|
|
438
|
+
if (key.includes(".")) {
|
|
439
|
+
const keyParts = key.split(".");
|
|
440
|
+
let currentKey = "";
|
|
441
|
+
return !!keyParts.find((keyPart) => {
|
|
442
|
+
currentKey = mergeKeys(currentKey, keyPart);
|
|
443
|
+
const isRoot = !currentKey.includes(".");
|
|
444
|
+
if (isRoot) {
|
|
445
|
+
return !!keyPatterns.find((k) => potentialMatchForRoot(k, currentKey));
|
|
446
|
+
}
|
|
447
|
+
return !!keyPatterns.find((k) => potentialMatch(k, currentKey));
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
return !!keyPatterns.find((k) => potentialMatchForRoot(k, key));
|
|
451
|
+
}
|
|
435
452
|
var dateTimePattern = /^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[+-]\d{2}:\d{2})?)$/i;
|
|
436
453
|
function isDateLike(value) {
|
|
437
454
|
if (typeof value === "string") {
|
|
@@ -450,31 +467,43 @@ function transformValue(value, rules, direction) {
|
|
|
450
467
|
}
|
|
451
468
|
return value;
|
|
452
469
|
}
|
|
453
|
-
function
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
for (const key of Object.keys(obj)) {
|
|
467
|
-
const mergedKey = mergeKeys(currentKey, key);
|
|
468
|
-
const match = matchKey(mergedKey, keys);
|
|
470
|
+
function walk(obj, direction, keyPatterns, flatKeyPatterns, currentKey = "") {
|
|
471
|
+
if (keyPatterns.length <= 0) {
|
|
472
|
+
return obj;
|
|
473
|
+
}
|
|
474
|
+
if (!partialMatch(currentKey, flatKeyPatterns)) {
|
|
475
|
+
return obj;
|
|
476
|
+
}
|
|
477
|
+
if (Array.isArray(obj)) {
|
|
478
|
+
obj.forEach((item, idx) => {
|
|
479
|
+
if (typeof item === "object" && item !== null) {
|
|
480
|
+
walk(item, direction, keyPatterns, flatKeyPatterns, currentKey);
|
|
481
|
+
} else {
|
|
482
|
+
const match = matchKey(currentKey, keyPatterns);
|
|
469
483
|
if (match) {
|
|
470
|
-
obj[
|
|
484
|
+
obj[idx] = transformValue(obj[idx], match[1], direction);
|
|
471
485
|
}
|
|
472
|
-
walk(obj[key], mergedKey);
|
|
473
486
|
}
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
if (typeof obj === "object" && obj !== null && !Array.isArray(obj)) {
|
|
490
|
+
for (const key of Object.keys(obj)) {
|
|
491
|
+
const mergedKey = mergeKeys(currentKey, key);
|
|
492
|
+
const match = matchKey(mergedKey, keyPatterns);
|
|
493
|
+
if (match) {
|
|
494
|
+
obj[key] = transformValue(obj[key], match[1], direction);
|
|
495
|
+
}
|
|
496
|
+
walk(obj[key], direction, keyPatterns, flatKeyPatterns, mergedKey);
|
|
474
497
|
}
|
|
475
|
-
return obj;
|
|
476
498
|
}
|
|
477
|
-
return
|
|
499
|
+
return obj;
|
|
500
|
+
}
|
|
501
|
+
function flattenKeys(keys) {
|
|
502
|
+
return keys.map((k) => Array.isArray(k) ? k[0] : k);
|
|
503
|
+
}
|
|
504
|
+
function transform(direction, object, keys) {
|
|
505
|
+
const flatKeys = flattenKeys(keys);
|
|
506
|
+
return walk(object, direction, keys, flatKeys);
|
|
478
507
|
}
|
|
479
508
|
function transformRequest(object, keys) {
|
|
480
509
|
return transform("from", object, keys);
|
package/dynatrace-metadata.json
CHANGED
package/esm/index.js
CHANGED
|
@@ -131,6 +131,23 @@ function matchKey(key, keys) {
|
|
|
131
131
|
}
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
+
var potentialMatchForRoot = (pattern, key) => pattern.startsWith(key) || pattern.startsWith("*") || pattern.startsWith("**");
|
|
135
|
+
var potentialMatch = (pattern, key) => pattern.startsWith(key) || pattern.includes("*") || pattern.includes("**");
|
|
136
|
+
function partialMatch(key, keyPatterns) {
|
|
137
|
+
if (key.includes(".")) {
|
|
138
|
+
const keyParts = key.split(".");
|
|
139
|
+
let currentKey = "";
|
|
140
|
+
return !!keyParts.find((keyPart) => {
|
|
141
|
+
currentKey = mergeKeys(currentKey, keyPart);
|
|
142
|
+
const isRoot = !currentKey.includes(".");
|
|
143
|
+
if (isRoot) {
|
|
144
|
+
return !!keyPatterns.find((k) => potentialMatchForRoot(k, currentKey));
|
|
145
|
+
}
|
|
146
|
+
return !!keyPatterns.find((k) => potentialMatch(k, currentKey));
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
return !!keyPatterns.find((k) => potentialMatchForRoot(k, key));
|
|
150
|
+
}
|
|
134
151
|
var dateTimePattern = /^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[+-]\d{2}:\d{2})?)$/i;
|
|
135
152
|
function isDateLike(value) {
|
|
136
153
|
if (typeof value === "string") {
|
|
@@ -149,31 +166,43 @@ function transformValue(value, rules, direction) {
|
|
|
149
166
|
}
|
|
150
167
|
return value;
|
|
151
168
|
}
|
|
152
|
-
function
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
for (const key of Object.keys(obj)) {
|
|
166
|
-
const mergedKey = mergeKeys(currentKey, key);
|
|
167
|
-
const match = matchKey(mergedKey, keys);
|
|
169
|
+
function walk(obj, direction, keyPatterns, flatKeyPatterns, currentKey = "") {
|
|
170
|
+
if (keyPatterns.length <= 0) {
|
|
171
|
+
return obj;
|
|
172
|
+
}
|
|
173
|
+
if (!partialMatch(currentKey, flatKeyPatterns)) {
|
|
174
|
+
return obj;
|
|
175
|
+
}
|
|
176
|
+
if (Array.isArray(obj)) {
|
|
177
|
+
obj.forEach((item, idx) => {
|
|
178
|
+
if (typeof item === "object" && item !== null) {
|
|
179
|
+
walk(item, direction, keyPatterns, flatKeyPatterns, currentKey);
|
|
180
|
+
} else {
|
|
181
|
+
const match = matchKey(currentKey, keyPatterns);
|
|
168
182
|
if (match) {
|
|
169
|
-
obj[
|
|
183
|
+
obj[idx] = transformValue(obj[idx], match[1], direction);
|
|
170
184
|
}
|
|
171
|
-
walk(obj[key], mergedKey);
|
|
172
185
|
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
if (typeof obj === "object" && obj !== null && !Array.isArray(obj)) {
|
|
189
|
+
for (const key of Object.keys(obj)) {
|
|
190
|
+
const mergedKey = mergeKeys(currentKey, key);
|
|
191
|
+
const match = matchKey(mergedKey, keyPatterns);
|
|
192
|
+
if (match) {
|
|
193
|
+
obj[key] = transformValue(obj[key], match[1], direction);
|
|
194
|
+
}
|
|
195
|
+
walk(obj[key], direction, keyPatterns, flatKeyPatterns, mergedKey);
|
|
173
196
|
}
|
|
174
|
-
return obj;
|
|
175
197
|
}
|
|
176
|
-
return
|
|
198
|
+
return obj;
|
|
199
|
+
}
|
|
200
|
+
function flattenKeys(keys) {
|
|
201
|
+
return keys.map((k) => Array.isArray(k) ? k[0] : k);
|
|
202
|
+
}
|
|
203
|
+
function transform(direction, object, keys) {
|
|
204
|
+
const flatKeys = flattenKeys(keys);
|
|
205
|
+
return walk(object, direction, keys, flatKeys);
|
|
177
206
|
}
|
|
178
207
|
function transformRequest(object, keys) {
|
|
179
208
|
return transform("from", object, keys);
|