cdk-real-drift 0.12.33 → 0.12.34

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/dist/cli.js CHANGED
@@ -1823,8 +1823,8 @@ const TAG_PROPERTY_NAMES = new Set([
1823
1823
  "TestBotAliasTags",
1824
1824
  "TestAliasTags"
1825
1825
  ]);
1826
- function stripCcApiAwsManagedFields(awsProps) {
1827
- return stripWalk(awsProps, false);
1826
+ function stripCcApiAwsManagedFields(awsProps, freeFormSeed = false) {
1827
+ return stripWalk(awsProps, freeFormSeed);
1828
1828
  }
1829
1829
  const MANAGED_TIMESTAMP_NAME = /^(creation|created|create|lastmodified|lastupdated|lastupdate|modification|modified|updated|update)(date|time|timestamp|at)$/;
1830
1830
  function isManagedTimestampName(key) {
@@ -5091,8 +5091,12 @@ function sortObjectArraysDeep(v) {
5091
5091
  }
5092
5092
  return v;
5093
5093
  }
5094
- function canonicalizeBaselineForCompare(v, resourceType) {
5095
- return sortObjectArraysDeep(canonicalizeForCompare(stripAwsTagsDeep(stripCcApiAwsManagedFields(v)), resourceType));
5094
+ function seedFreeFormFromPath(path) {
5095
+ if (!path) return false;
5096
+ return path.replace(/\[([^\]]*)\]/g, ".$1").split(".").filter((s) => s.length > 0).some((s) => FREE_FORM_MAP_PARENTS.has(s));
5097
+ }
5098
+ function canonicalizeBaselineForCompare(v, resourceType, path) {
5099
+ return sortObjectArraysDeep(canonicalizeForCompare(stripAwsTagsDeep(stripCcApiAwsManagedFields(v, seedFreeFormFromPath(path))), resourceType));
5096
5100
  }
5097
5101
 
5098
5102
  //#endregion
@@ -12731,12 +12735,12 @@ function carryForwardIgnored(recorded, existing, findings) {
12731
12735
  * type-agnostic over UNDECLARED snapshot fragments, which never carry an
12732
12736
  * order-significant declared array, so an order-insensitive sort is safe here.
12733
12737
  */
12734
- function baselineValueMatches(baselineValue, currentCanonicalValue, resourceType) {
12738
+ function baselineValueMatches(baselineValue, currentCanonicalValue, resourceType, path) {
12735
12739
  if (isRedactedHashSentinel(baselineValue) || isRedactedHashSentinel(currentCanonicalValue)) {
12736
- const asHash = (v) => redactedHashOf(isRedactedHashSentinel(v) ? v : canonicalizeBaselineForCompare(v, resourceType));
12740
+ const asHash = (v) => redactedHashOf(isRedactedHashSentinel(v) ? v : canonicalizeBaselineForCompare(v, resourceType, path));
12737
12741
  return asHash(baselineValue) === asHash(currentCanonicalValue);
12738
12742
  }
12739
- return deepEqual(canonicalizeBaselineForCompare(baselineValue, resourceType), canonicalizeBaselineForCompare(currentCanonicalValue, resourceType));
12743
+ return deepEqual(canonicalizeBaselineForCompare(baselineValue, resourceType, path), canonicalizeBaselineForCompare(currentCanonicalValue, resourceType, path));
12740
12744
  }
12741
12745
  const DELTA_IDENTITY_FIELDS = [
12742
12746
  "Key",
@@ -12818,7 +12822,7 @@ function splitRecordedByBaseline(recorded, baseline) {
12818
12822
  const changed = [];
12819
12823
  for (const entry of recorded) {
12820
12824
  const baselineEntry = baseline.recorded.find((a) => a.logicalId === entry.logicalId && a.path === entry.path && a.resourceType === entry.resourceType);
12821
- if (baselineEntry && baselineValueMatches(baselineEntry.value, entry.value, entry.resourceType)) unchanged.push(entry);
12825
+ if (baselineEntry && baselineValueMatches(baselineEntry.value, entry.value, entry.resourceType, entry.path)) unchanged.push(entry);
12822
12826
  else changed.push(entry);
12823
12827
  }
12824
12828
  return {
@@ -12979,7 +12983,7 @@ function applyBaseline(findings, baseline, opts = {}) {
12979
12983
  });
12980
12984
  continue;
12981
12985
  }
12982
- if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType)) continue;
12986
+ if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType, f.path)) continue;
12983
12987
  if (entry) {
12984
12988
  kept.push({
12985
12989
  ...f,
@@ -12999,7 +13003,7 @@ function applyBaseline(findings, baseline, opts = {}) {
12999
13003
  continue;
13000
13004
  }
13001
13005
  const entry = replacedLogical.has(f.logicalId) ? void 0 : recorded.find((a) => entryMatches(a, f));
13002
- if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType)) continue;
13006
+ if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType, f.path)) continue;
13003
13007
  if (entry) {
13004
13008
  const delta = identityArrayDelta(canonicalizeForCompare(entry.value, f.resourceType), f.actual);
13005
13009
  kept.push({