cdk-real-drift 0.12.36 → 0.12.37

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
@@ -5553,12 +5553,12 @@ function isSelfEchoTrivialEmpty(v, physicalId) {
5553
5553
  function isIdentityOnlyHusk(el, idField) {
5554
5554
  return Object.entries(el).every(([k, v]) => k === idField || isTrivialEmpty(v));
5555
5555
  }
5556
- function rdsMaterializedDefault(catalog, physicalId, declared, path, settingName) {
5556
+ function rdsMaterializedDefault(catalog, physicalId, aligned, path, settingName) {
5557
5557
  if (!catalog || physicalId === void 0) return void 0;
5558
5558
  const m = /OptionConfigurations\.(\d+)\.OptionSettings$/.exec(path);
5559
5559
  if (!m) return void 0;
5560
- const configs = declared?.OptionConfigurations;
5561
- const optName = Array.isArray(configs) ? configs[Number(m[1])]?.OptionName : void 0;
5560
+ const configs = Array.isArray(aligned) ? aligned : void 0;
5561
+ const optName = configs ? configs[Number(m[1])]?.OptionName : void 0;
5562
5562
  if (typeof optName !== "string") return void 0;
5563
5563
  const perOption = catalog[physicalId]?.[optName];
5564
5564
  return perOption && settingName in perOption ? perOption[settingName] : void 0;
@@ -6396,7 +6396,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6396
6396
  let isRdsOptionDefault = false;
6397
6397
  if (resourceType === "AWS::RDS::OptionGroup") if (isIdentityOnlyHusk(loRec, nvSubsetSpec.nameField)) isRdsOptionDefault = true;
6398
6398
  else {
6399
- const matDefault = rdsMaterializedDefault(opts.rdsOptionSettingDefaults, physicalId, declaredIn, d.path, loName);
6399
+ const matDefault = rdsMaterializedDefault(opts.rdsOptionSettingDefaults, physicalId, liveVal, d.path, loName);
6400
6400
  isRdsOptionDefault = matDefault != null && matDefault === loValue;
6401
6401
  }
6402
6402
  findings.push({
@@ -6955,35 +6955,39 @@ async function enumerateRestApiChildren(ctx) {
6955
6955
  const authorizerAdded = diffApiGatewayAuthorizers({
6956
6956
  apiId,
6957
6957
  declaredAuthorizerIds,
6958
- liveAuthorizers: (await getAllAuthorizers(client, apiId)).filter((a) => typeof a.id === "string").map((a) => ({
6958
+ liveAuthorizers: (bodyDefined ? [] : await getAllAuthorizers(client, apiId)).filter((a) => typeof a.id === "string").map((a) => ({
6959
6959
  id: a.id,
6960
6960
  label: a.name ?? a.id
6961
- }))
6961
+ })),
6962
+ bodyDefined
6962
6963
  });
6963
6964
  const modelAdded = diffApiGatewayModels({
6964
6965
  apiId,
6965
6966
  declaredModelNames,
6966
- liveModels: (await getAllModels(client, apiId)).filter((m) => typeof m.name === "string").map((m) => ({
6967
+ liveModels: (bodyDefined ? [] : await getAllModels(client, apiId)).filter((m) => typeof m.name === "string").map((m) => ({
6967
6968
  name: m.name,
6968
6969
  label: m.name
6969
- }))
6970
+ })),
6971
+ bodyDefined
6970
6972
  });
6971
6973
  const validatorAdded = diffApiGatewayRequestValidators({
6972
6974
  apiId,
6973
6975
  declaredValidatorIds,
6974
- liveValidators: (await getAllRequestValidators(client, apiId)).filter((v) => typeof v.id === "string").map((v) => ({
6976
+ liveValidators: (bodyDefined ? [] : await getAllRequestValidators(client, apiId)).filter((v) => typeof v.id === "string").map((v) => ({
6975
6977
  id: v.id,
6976
6978
  label: v.name ?? v.id
6977
- }))
6979
+ })),
6980
+ bodyDefined
6978
6981
  });
6979
6982
  const gatewayResponseAdded = diffApiGatewayGatewayResponses({
6980
6983
  apiId,
6981
6984
  declaredResponseTypes,
6982
- liveResponseTypes: (await getAllGatewayResponses(client, apiId)).filter((g) => typeof g.responseType === "string").map((g) => ({
6985
+ liveResponseTypes: (bodyDefined ? [] : await getAllGatewayResponses(client, apiId)).filter((g) => typeof g.responseType === "string").map((g) => ({
6983
6986
  type: g.responseType,
6984
6987
  label: g.responseType
6985
6988
  })),
6986
- hasUnresolvedDeclaredResponseType: gatewayResponseTypeUnresolved
6989
+ hasUnresolvedDeclaredResponseType: gatewayResponseTypeUnresolved,
6990
+ bodyDefined
6987
6991
  });
6988
6992
  const stageAdded = diffApiGatewayStages({
6989
6993
  apiId,
@@ -7024,7 +7028,8 @@ async function getAllStages(client, apiId) {
7024
7028
  return (await client.send(new GetStagesCommand({ restApiId: apiId }))).item ?? [];
7025
7029
  }
7026
7030
  function diffApiGatewayAuthorizers(input) {
7027
- const { apiId, declaredAuthorizerIds, liveAuthorizers } = input;
7031
+ const { apiId, declaredAuthorizerIds, liveAuthorizers, bodyDefined } = input;
7032
+ if (bodyDefined) return [];
7028
7033
  const declared = new Set(declaredAuthorizerIds);
7029
7034
  const added = [];
7030
7035
  for (const a of liveAuthorizers) {
@@ -7057,7 +7062,8 @@ async function getAllAuthorizers(client, apiId) {
7057
7062
  }
7058
7063
  const BUILTIN_MODEL_NAMES = new Set(["Empty", "Error"]);
7059
7064
  function diffApiGatewayModels(input) {
7060
- const { apiId, declaredModelNames, liveModels } = input;
7065
+ const { apiId, declaredModelNames, liveModels, bodyDefined } = input;
7066
+ if (bodyDefined) return [];
7061
7067
  const declared = new Set(declaredModelNames);
7062
7068
  const added = [];
7063
7069
  for (const m of liveModels) {
@@ -7090,7 +7096,8 @@ async function getAllModels(client, apiId) {
7090
7096
  return out;
7091
7097
  }
7092
7098
  function diffApiGatewayRequestValidators(input) {
7093
- const { apiId, declaredValidatorIds, liveValidators } = input;
7099
+ const { apiId, declaredValidatorIds, liveValidators, bodyDefined } = input;
7100
+ if (bodyDefined) return [];
7094
7101
  const declared = new Set(declaredValidatorIds);
7095
7102
  const added = [];
7096
7103
  for (const v of liveValidators) {
@@ -7122,6 +7129,7 @@ async function getAllRequestValidators(client, apiId) {
7122
7129
  return out;
7123
7130
  }
7124
7131
  function diffApiGatewayGatewayResponses(input) {
7132
+ if (input.bodyDefined) return [];
7125
7133
  if (input.hasUnresolvedDeclaredResponseType) return [];
7126
7134
  const { apiId, declaredResponseTypes, liveResponseTypes } = input;
7127
7135
  const declared = new Set(declaredResponseTypes);
@@ -10768,10 +10776,14 @@ const supplementTrustStore = async ({ physicalId, region }) => {
10768
10776
  ...READ_RETRY
10769
10777
  }).send(new GetTrustStoreCaCertificatesBundleCommand({ TrustStoreArn: arn }))).Location);
10770
10778
  if (!url) return void 0;
10771
- const resp = await fetch(url);
10772
- if (!resp.ok) return void 0;
10773
- const hash = hashCaBundle(await resp.text());
10774
- return hash !== void 0 ? { CaCertificatesBundleSha256: hash } : void 0;
10779
+ try {
10780
+ const resp = await fetch(url, { signal: AbortSignal.timeout(CLIENT_REQUEST_HANDLER.requestTimeout) });
10781
+ if (!resp.ok) return void 0;
10782
+ const hash = hashCaBundle(await resp.text());
10783
+ return hash !== void 0 ? { CaCertificatesBundleSha256: hash } : void 0;
10784
+ } catch {
10785
+ return;
10786
+ }
10775
10787
  };
10776
10788
  const supplementLambdaFunction = async ({ physicalId, region }) => {
10777
10789
  const name = str$1(physicalId);