Commit 0a6676a
feat(idempotency): Add persistence layer and DynamoDB implementation (#1110)
* feat: initial idempotency classes
* feat: refactor persistence layer classes into their own folder
* feat: rename idempotency config to differentiate from idempotency options
* feat: added type for a generic function
* feat: remove idempotency configuration for this FR
* feat: refactored type of function to accept any combo of parameters
* feat: adding PersistenceLayer
* feat: PersistenceLayer unit tests for saveInProgress
* feat: added saveSuccess
* feat: added getRecord
* feat: added delete record
* feat: branch coverage and cleaning up imports
* feat: added more tests
* feat: deleted unused methods
* feat: added comments
* feat: implement get command for dynamo persistence layer
* feat: implement get command for dynamo persistence layer
* feat: allow for data attr to be passed and return in persistence layer get
* feat: added implementation for delete, update, put
* feat: create condition on put for not in progress status
* feat: use inprogress enum for status
* feat: added error when unable to get record for idempotency key
* feat: added error for conditional write of an existing record
* feat: tests added for put record on dynamo persistence layer
* feat: implemented the idempotency record functions for status, expiry, and json response
* test: check if the status is expired
* test: idempotency record is not expired and status maintained
* feat: added tests for get record
* feat: add aws-sdk-client-mock jest assertion library
* feat: add unit tests for update record and delete record
* feat: remove optional chaining from item made unnecessary with error branch
* feat: remove unused block
* feat: refactored mock child class to be shared amongst dynamo persistence layer tests
* test: add path to get the response data from the data record
* feat: added branch to handle conditional check failure
* feat: add configuration option to dynamo client creation to remove undefined values
* feat: change how time is measured to seconds
* feat: change type of the response/result to a record
* feat:updated imports
* refactor: create constructor object for dynamo persistence layer
* fix: remove temp eslint disable
* fix: adjust verbiage on test blocks
Co-authored-by: ijemmy <ijemmy@users.noreply.github.com>
* style: put constructor parameters onto one line for readability
* fix: update dynamo persistence layer tests to use new construtor options
* fix: remove unneeded eslint ignore from persistence layer
* style: put parameters for dynamo client command object onto one line for readability
* fix: move lib-dynamo dep under the correct package
* refactor: change idempotency record to use options object in contructor
* feat: add consistent read to dynamo persistence layer
* fix: revert changes to layer-publisher package-lock
Co-authored-by: vgphoenixcampos <111440293+vgphoenixcampos@users.noreply.github.com>
Co-authored-by: KevenFuentes9 <keven_fuentes@vanguard.com>
Co-authored-by: Phoenix Campos <phoenix_campos@vanguard.com>
Co-authored-by: ijemmy <ijemmy@users.noreply.github.com>1 parent 8af1c17 commit 0a6676a
File tree
20 files changed
+4350
-64
lines changed- packages/idempotency
- src
- persistence
- types
- tests
- helpers
- unit
- persistence
20 files changed
+4350
-64
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | | - | |
46 | | - | |
| 44 | + | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
| |||
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
| 55 | + | |
57 | 56 | | |
58 | 57 | | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | 41 | | |
45 | 42 | | |
0 commit comments