serverless-plugin-module-registry 1.0.18 → 1.0.20

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/index.js CHANGED
@@ -19672,18 +19672,23 @@ var ServerlessModuleRegistryPlugin = class {
19672
19672
  this.apiGatewayClient = new import_client_api_gateway2.APIGatewayClient({ region });
19673
19673
  }
19674
19674
  try {
19675
- const apisCommand = new import_client_api_gateway2.GetRestApisCommand({});
19676
- const apisResponse = await this.apiGatewayClient.send(apisCommand);
19677
- const matchingApi = (_b3 = apisResponse.items) == null ? void 0 : _b3.find(
19678
- (api) => {
19679
- var _a5;
19680
- return api.name === serviceName || ((_a5 = api.name) == null ? void 0 : _a5.includes(serviceName));
19675
+ let position;
19676
+ do {
19677
+ const apisResponse = await this.apiGatewayClient.send(
19678
+ new import_client_api_gateway2.GetRestApisCommand(position ? { position } : {})
19679
+ );
19680
+ const matchingApi = (_b3 = apisResponse.items) == null ? void 0 : _b3.find(
19681
+ (api) => {
19682
+ var _a5;
19683
+ return api.name === serviceName || ((_a5 = api.name) == null ? void 0 : _a5.includes(serviceName));
19684
+ }
19685
+ );
19686
+ if (matchingApi == null ? void 0 : matchingApi.id) {
19687
+ this.logger.info(`\u2705 Discovered API Gateway ID from API Gateway service: ${matchingApi.id}`);
19688
+ return matchingApi.id;
19681
19689
  }
19682
- );
19683
- if (matchingApi == null ? void 0 : matchingApi.id) {
19684
- this.logger.info(`\u2705 Discovered API Gateway ID from API Gateway service: ${matchingApi.id}`);
19685
- return matchingApi.id;
19686
- }
19690
+ position = apisResponse.position;
19691
+ } while (position);
19687
19692
  } catch (apiError) {
19688
19693
  this.logger.warning(`API Gateway service lookup failed: ${apiError.message}`);
19689
19694
  }