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

Feature/dynamo db store implementation #234

Merged
merged 48 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
97e510e
Initial commit for dynamo db store implementation
Daniel-97 Oct 19, 2023
f5991d6
New method for dynamodb send comand
Daniel-97 Oct 19, 2023
f8e60fd
Added test file for dynamodb and dev dependency
Daniel-97 Oct 19, 2023
a4f65fe
Continue test dynamo
Daniel-97 Oct 19, 2023
79f37ec
Fixed create table
Daniel-97 Oct 20, 2023
68a27f9
Implemented _getRateLimiterRes and _get
Daniel-97 Oct 23, 2023
d106ee3
Added _upsert method implementation
Daniel-97 Oct 24, 2023
875f56f
Added docstring
Daniel-97 Oct 24, 2023
88a964b
If the table already exists do not throw exception
Daniel-97 Oct 24, 2023
615ac3e
Fix: error in _upsert and new test
Daniel-97 Oct 24, 2023
959ac78
Fixed some issue. Problem with _upsert
Daniel-97 Oct 24, 2023
e959820
Added new internal function _baseUpsert
Daniel-97 Oct 25, 2023
2b8ed35
Fixed _upsert in some cases
Daniel-97 Oct 25, 2023
004571b
Minor change
Daniel-97 Oct 25, 2023
3b4bad1
Made _upsert atomically safe
Daniel-97 Oct 25, 2023
190a52d
better _base_upsert
Daniel-97 Oct 29, 2023
c595b5d
Minor changes
Daniel-97 Oct 29, 2023
86d5984
Convert all promise in async function. Better code
Daniel-97 Oct 30, 2023
2ebdf31
Fixed issue with await resolve in _upsert()
Daniel-97 Oct 30, 2023
0f41ae6
Added tests
Daniel-97 Oct 30, 2023
4035302
Fixed delete item implementation if item not exists in the table
Daniel-97 Oct 31, 2023
529b59a
Added more tests
Daniel-97 Oct 31, 2023
85384c6
FIxed issue with never expire situation
Daniel-97 Nov 2, 2023
cc569a7
Fixed an issue in the _getRateLimiterRes implementation
Daniel-97 Nov 2, 2023
599908c
Added comments
Daniel-97 Nov 2, 2023
9968950
Fixed test delete rejects on error
Daniel-97 Nov 2, 2023
03d9563
Converted expire field from milliseconds to seconds because of dynamo…
Daniel-97 Nov 4, 2023
60c9a4b
Need to handle TTL if already set on dynamodb
Daniel-97 Nov 4, 2023
bdfdee1
Added function for check if the ttl is enabled
Daniel-97 Nov 6, 2023
565aea3
Added workflow dispatch
Daniel-97 Nov 13, 2023
41fcaba
Added dynamodb in test.yml
Daniel-97 Nov 13, 2023
fd54b7c
Dropped support for nodejs versione under 20
Daniel-97 Nov 13, 2023
3c3f2cc
Updated istanbul dependency
Daniel-97 Nov 13, 2023
365b7f6
Added local endpoint to dynamodb client in tests
Daniel-97 Nov 13, 2023
1ae4488
Added endpoint to local dynamodb
Daniel-97 Nov 13, 2023
52e7ba1
Added fake credential to local dynamo client
Daniel-97 Nov 13, 2023
88b3727
Fixed test return correct data with _getRateLimiterRes
Daniel-97 Nov 13, 2023
7065145
Merge branch 'master' of github.com:c4valli/node-rate-limiter-flexibl…
Daniel-97 Nov 14, 2023
4892f14
Fixed test delete not existing item from dynamodb
Daniel-97 Nov 15, 2023
d480ed6
Added custom option for dynamodb table, read capacity unit and write …
Daniel-97 Nov 16, 2023
2445d50
Removed usless class DynamoTableOpts
Daniel-97 Nov 23, 2023
b481fd5
Removed ?. operator in _createTable. May not be compatible with nodej…
Daniel-97 Nov 23, 2023
f4ffd73
Collapsed two dynamo db update in one single update with the OR condi…
Daniel-97 Nov 23, 2023
55c5239
Extracted static parameter from RateLimiterDynamo
Daniel-97 Nov 23, 2023
b707850
Added typescript definitions
Daniel-97 Nov 24, 2023
1454a44
Added rate limiter dynamo export in index.js
Daniel-97 Nov 24, 2023
5189be8
Added check in error type checking
Daniel-97 Nov 24, 2023
abe8fa9
Fixed issue with wrong compare between seconds and miliseconds
Daniel-97 Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

concurrency:
group: test-${{ github.ref }}
Expand All @@ -30,15 +31,21 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4.0.0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: ./package.json

- name: Start Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-version: ${{ matrix.redis-version }}

- name: Start DynamoDB local
uses: rrainn/dynamodb-action@v3.0.0

- run: npm install
- run: npm run test
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const RateLimiterUnion = require('./lib/RateLimiterUnion');
const RateLimiterQueue = require('./lib/RateLimiterQueue');
const BurstyRateLimiter = require('./lib/BurstyRateLimiter');
const RateLimiterRes = require('./lib/RateLimiterRes');
const RateLimiterDynamo = require('./lib/RateLimiterDynamo');

module.exports = {
RateLimiterRedis,
Expand All @@ -26,4 +27,5 @@ module.exports = {
RateLimiterQueue,
BurstyRateLimiter,
RateLimiterRes,
RateLimiterDynamo
};
Loading
Loading