Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(idempotency): idempotency middleware & types exports #1487

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

dreamorosi
Copy link
Contributor

Description of your changes

This PR introduces exports for the Idempotency Middy middleware introduced in #1293 as well as for the package types. It also should fix a casing error in the DynamoDB exports.

All the exports below are verified to work:

import { idempotentLambdaHandler } from "@aws-lambda-powertools/idempotency";
import { DynamoDBPersistenceLayer } from "@aws-lambda-powertools/idempotency/dynamodb";
import { makeHandlerIdempotent } from "@aws-lambda-powertools/idempotency/middleware";
import { IdempotencyRecord as I } from "@aws-lambda-powertools/idempotency/persistence";
import { IdempotencyConfig } from "@aws-lambda-powertools/idempotency";
import type { DynamoDBPersistenceLayerOptions } from "@aws-lambda-powertools/idempotency/dynamodb";
import type { AnyFunctionWithRecord } from "@aws-lambda-powertools/idempotency/types";

The tests has been done with Node.js 18 & TS ~4.9.

Below a short video that shows the build of this branch and the installation of the resulting package in a separate project, with visual confirmation that the exports are recognized in the IDE:

input.mp4

Related issues, RFCs

Issue number: #1486

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my change is effective and works
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@dreamorosi dreamorosi self-assigned this Jun 7, 2023
@dreamorosi dreamorosi linked an issue Jun 7, 2023 that may be closed by this pull request
@boring-cyborg boring-cyborg bot added idempotency This item relates to the Idempotency Utility dependencies Changes that touch dependencies, e.g. Dependabot, etc. labels Jun 7, 2023
@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label Jun 7, 2023
@github-actions github-actions bot added the feature PRs that introduce new features or minor changes label Jun 7, 2023
@pull-request-size pull-request-size bot added size/S PR between 10-29 LOC and removed size/M PR between 30-99 LOC labels Jun 7, 2023
@brianhyder
Copy link

I can confirm that this fixes the issue I was having and I'm good to close #1486 once merged.

@dreamorosi dreamorosi merged commit d947db9 into main Jun 7, 2023
@dreamorosi dreamorosi deleted the 1486-idempotency-exports branch June 7, 2023 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Changes that touch dependencies, e.g. Dependabot, etc. feature PRs that introduce new features or minor changes idempotency This item relates to the Idempotency Utility size/S PR between 10-29 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Declared Idempotency Packages Do Not Match Repo Structure
2 participants