cdk-real-drift 0.2.62 → 0.2.64

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
@@ -5080,8 +5080,12 @@ const CHILD_ENUMERATORS = {
5080
5080
  "AWS::EFS::FileSystem": enumerateEfsFileSystemChildren,
5081
5081
  "AWS::RDS::DBCluster": enumerateRdsClusterChildren
5082
5082
  };
5083
+ function isBodyDefinedRestApi(declared) {
5084
+ return declared.Body != null || declared.BodyS3Location != null;
5085
+ }
5083
5086
  function diffApiGatewayChildren(input) {
5084
- const { apiId, rootResourceId, declaredResourceIds, declaredMethodKeys, liveResources, liveMethodsByResource } = input;
5087
+ const { apiId, rootResourceId, declaredResourceIds, declaredMethodKeys, liveResources, liveMethodsByResource, bodyDefined } = input;
5088
+ if (bodyDefined) return [];
5085
5089
  const liveRootId = liveResources.find((r) => r.path === "/")?.id;
5086
5090
  const declaredResources = new Set(declaredResourceIds);
5087
5091
  if (rootResourceId) declaredResources.add(rootResourceId);
@@ -5138,6 +5142,7 @@ async function enumerateRestApiChildren(ctx) {
5138
5142
  if (!apiId) return [];
5139
5143
  const restApiLive = desired.ctx.liveAttrs[parent.logicalId] ?? {};
5140
5144
  const rootResourceId = typeof restApiLive.RootResourceId === "string" ? restApiLive.RootResourceId : void 0;
5145
+ const bodyDefined = isBodyDefinedRestApi(parent.declared);
5141
5146
  const declaredResourceIds = [];
5142
5147
  const declaredMethodKeys = [];
5143
5148
  for (const r of desired.resources) {
@@ -5163,7 +5168,7 @@ async function enumerateRestApiChildren(ctx) {
5163
5168
  region,
5164
5169
  ...READ_RETRY
5165
5170
  });
5166
- const items = await getAllResources(client, apiId);
5171
+ const items = bodyDefined ? [] : await getAllResources(client, apiId);
5167
5172
  const liveResources = items.filter((i) => typeof i.id === "string").map((i) => ({
5168
5173
  id: i.id,
5169
5174
  path: i.path,
@@ -5190,7 +5195,8 @@ async function enumerateRestApiChildren(ctx) {
5190
5195
  declaredResourceIds,
5191
5196
  declaredMethodKeys,
5192
5197
  liveResources,
5193
- liveMethodsByResource
5198
+ liveMethodsByResource,
5199
+ bodyDefined
5194
5200
  });
5195
5201
  const authorizerAdded = diffApiGatewayAuthorizers({
5196
5202
  apiId,
@@ -10816,13 +10822,22 @@ const writeLexBotLocales = async (ctx, ops) => {
10816
10822
  const loc = rawLocale;
10817
10823
  const localeId = lexStr(loc.LocaleId);
10818
10824
  if (!localeId) throw new Error("Lex BotLocales revert: a declared locale has no LocaleId");
10819
- const liveSlotTypes = await c.send(new ListSlotTypesCommand({
10820
- botId,
10821
- botVersion,
10822
- localeId
10823
- }));
10825
+ const slotTypeSummaries = [];
10826
+ {
10827
+ let nextToken;
10828
+ do {
10829
+ const r = await c.send(new ListSlotTypesCommand({
10830
+ botId,
10831
+ botVersion,
10832
+ localeId,
10833
+ ...nextToken && { nextToken }
10834
+ }));
10835
+ slotTypeSummaries.push(...r.slotTypeSummaries ?? []);
10836
+ nextToken = r.nextToken;
10837
+ } while (nextToken);
10838
+ }
10824
10839
  const slotTypeNameToId = /* @__PURE__ */ new Map();
10825
- for (const s of liveSlotTypes.slotTypeSummaries ?? []) {
10840
+ for (const s of slotTypeSummaries) {
10826
10841
  const id = lexStr(s.slotTypeId);
10827
10842
  const name = lexStr(s.slotTypeName);
10828
10843
  if (id && name && !id.startsWith("AMAZON.")) slotTypeNameToId.set(name, id);
@@ -10875,13 +10890,22 @@ const writeLexBotLocales = async (ctx, ops) => {
10875
10890
  else input.valueSelectionSetting = live.valueSelectionSetting;
10876
10891
  await c.send(new UpdateSlotTypeCommand(input));
10877
10892
  }
10878
- const liveIntents = await c.send(new ListIntentsCommand({
10879
- botId,
10880
- botVersion,
10881
- localeId
10882
- }));
10893
+ const intentSummaries = [];
10894
+ {
10895
+ let nextToken;
10896
+ do {
10897
+ const r = await c.send(new ListIntentsCommand({
10898
+ botId,
10899
+ botVersion,
10900
+ localeId,
10901
+ ...nextToken && { nextToken }
10902
+ }));
10903
+ intentSummaries.push(...r.intentSummaries ?? []);
10904
+ nextToken = r.nextToken;
10905
+ } while (nextToken);
10906
+ }
10883
10907
  const intentNameToId = /* @__PURE__ */ new Map();
10884
- for (const i of liveIntents.intentSummaries ?? []) {
10908
+ for (const i of intentSummaries) {
10885
10909
  const id = lexStr(i.intentId);
10886
10910
  const name = lexStr(i.intentName);
10887
10911
  if (id && name) intentNameToId.set(name, id);
@@ -10908,14 +10932,23 @@ const writeLexBotLocales = async (ctx, ops) => {
10908
10932
  const iName = lexStr(di.Name);
10909
10933
  const intentId = iName ? intentNameToId.get(iName) : void 0;
10910
10934
  if (!intentId || !iName || isBuiltinIntent(iName)) continue;
10911
- const liveSlots = await c.send(new ListSlotsCommand({
10912
- botId,
10913
- botVersion,
10914
- localeId,
10915
- intentId
10916
- }));
10935
+ const slotSummaries = [];
10936
+ {
10937
+ let nextToken;
10938
+ do {
10939
+ const r = await c.send(new ListSlotsCommand({
10940
+ botId,
10941
+ botVersion,
10942
+ localeId,
10943
+ intentId,
10944
+ ...nextToken && { nextToken }
10945
+ }));
10946
+ slotSummaries.push(...r.slotSummaries ?? []);
10947
+ nextToken = r.nextToken;
10948
+ } while (nextToken);
10949
+ }
10917
10950
  const slotNameToId = /* @__PURE__ */ new Map();
10918
- for (const s of liveSlots.slotSummaries ?? []) {
10951
+ for (const s of slotSummaries) {
10919
10952
  const id = lexStr(s.slotId);
10920
10953
  const name = lexStr(s.slotName);
10921
10954
  if (id && name) slotNameToId.set(name, id);