@awsless/cli 0.1.44 → 0.1.46

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.
@@ -234,8 +234,8 @@ var pubsubHandler = (event, routes) => {
234
234
  return;
235
235
  }
236
236
  const eventType = record.Sns.MessageAttributes?.event?.Value;
237
- const listeners = routes.filter((route) => {
238
- const [, type, id] = route.split(":");
237
+ const listeners = routes.filter((route2) => {
238
+ const [, type, id] = route2.split(":");
239
239
  return type === "pubsub" && id === `${pubsubId}-${eventType}`;
240
240
  });
241
241
  if (!listeners.length) {
@@ -386,8 +386,8 @@ var topicHandler = (event, routes) => {
386
386
  if (resourceType !== "topic") {
387
387
  return;
388
388
  }
389
- const subscribers = routes.filter((route) => {
390
- const [, type, id] = route.split(":");
389
+ const subscribers = routes.filter((route2) => {
390
+ const [, type, id] = route2.split(":");
391
391
  return type === "topic" && id === topicId;
392
392
  });
393
393
  if (!subscribers.length) {
@@ -434,30 +434,30 @@ var createBundle = (handlers) => {
434
434
  };
435
435
  return async (event, context) => {
436
436
  captureInvokedQualifier(context);
437
- const handleRoute = (match) => {
438
- const load = handlers[match.key];
437
+ const handleRoute = (match2) => {
438
+ const load = handlers[match2.key];
439
439
  if (!load) {
440
- if (routeType(match.key) === "function") {
440
+ if (routeType(match2.key) === "function") {
441
441
  return invoke({
442
- name: getStandaloneFunctionName(match.key),
442
+ name: getStandaloneFunctionName(match2.key),
443
443
  qualifier: getInvokedQualifier() ?? LIVE_BUNDLE_ALIAS,
444
- payload: match.payload
444
+ payload: match2.payload
445
445
  });
446
446
  }
447
- throw new Error("Unknown bundle route: " + match.key);
447
+ throw new Error("Unknown bundle route: " + match2.key);
448
448
  }
449
- return withBundleRouteContext(match.key, internalInvoke, async () => {
449
+ return withBundleRouteContext(match2.key, internalInvoke, async () => {
450
450
  const handle = await load();
451
- const routedContext = { ...context, route: match.key };
452
- return handle(match.payload ?? {}, routedContext);
453
- }, { throwExpectedErrors: match.throwExpectedErrors });
451
+ const routedContext = { ...context, route: match2.key };
452
+ return handle(match2.payload ?? {}, routedContext);
453
+ }, { throwExpectedErrors: match2.throwExpectedErrors });
454
454
  };
455
455
  const internalInvoke = async (key, payload) => {
456
- const match = matchRoute(formatRoutePayload(key, unpatch(payload ?? {})));
457
- if (Array.isArray(match)) {
456
+ const match2 = matchRoute(formatRoutePayload(key, unpatch(payload ?? {})));
457
+ if (Array.isArray(match2)) {
458
458
  throw new Error("Unknown bundle route: " + key);
459
459
  }
460
- const result = await handleRoute(match);
460
+ const result = await handleRoute(match2);
461
461
  const response = result === undefined ? undefined : patch(result);
462
462
  if (isErrorResponse(response)) {
463
463
  const { type, message, data } = response.__error__;