amazon-archives / aws-amplify-serverless-plugin

Plugin for the Serverless Framework to output AWS Amplify configuration files.
Apache License 2.0
124 stars 30 forks source link

Use an array in Typescript configuration to allow `.map()` #51

Closed fmauquie closed 5 years ago

fmauquie commented 5 years ago

I am modifying at runtime my generated client configuration to add headers for offline use. With the types as they are, I get Typescript errors:

I am trying to map my config as such:

offlineConfig = aws_exports.aws_cloud_logic_custom.map((cloud) => ({some: 'thing'});

These errors happen because IAWSAmplifyCloudLogicConfiguration is not an array in the type definitions, but an object with numeric indices. However, the generator actually adds an array.

Making this value an array of configurations in the typings works beautifully.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

adrianhall commented 5 years ago

Thank you for the contribution!