You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-29Lines changed: 53 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@ When one of the following decorators is present, the value is always mapped to a
187
187
We only support the native Date type and you need to explicitly mark a property to be a Date by using the @Date() decorator\
188
188
(which is basically just syntactic sugar for @CustomMapper(TheDateMapper)).\
189
189
If you want to use a different type for the @Date decorator (eg. Moment) you need to define a custom mapper and provide it to the dynamo easy config like this:\
Enum values are persisted as Numbers (index of enum) or string if string value was given.
222
+
Enum values are persisted as Numbers (index of enum or assigned value) or string if string value was assigned.
223
223
224
224
# Request API
225
225
To start making requests create an instance of [DynamoStore](https://shiftcode.github.io/dynamo-easy/classes/_dynamo_dynamo_store_.dynamostore.html) and execute the desired operation using the provided api.
@@ -237,6 +237,54 @@ We support the following dynamodb operations with a fluent api:
237
237
238
238
There is always the possibility to access the Params object directly to add values which are not covered with our api.
239
239
240
+
## non table tied requests
241
+
Currently two type of requests exists which are not tied to one table/model and therefore are not created from a DynamoStore instance.
242
+
243
+
### BatchGet
244
+
245
+
There are two scenarios for a batch get item request. One is requesting multiple items from one table by id and the other is requesting multiple items by id from multiple
246
+
tables. The first scenario is support using DynamoStore.batchGet() the second one can be achieved by using the [BatchGetRequest](https://shiftcode.github.io/dynamo-easy/classes/_dynamo_batchget_batch_get_request_.batchgetrequest.html) class.
// an object where the items are mapped to the table name
257
+
})
258
+
```
259
+
### TransactWriteRequest
260
+
Create transactions for all-or-nothing operations with [TransactWriteRequest](https://shiftcode.github.io/dynamo-easy/classes/_dynamo_transactwrite_transact_write_request_.transactwriterequest.html) across one or more tables.
In a real world scenario you'll have some kind of authentication to protect your dynamodb ressources. You can customize on how to authenticate when providing a custom
242
290
SessionValidityEnsurer function to the DynamoStore when creating a new instance.
@@ -245,7 +293,7 @@ The default implementation is a no-op function.
245
293
## Session Validity Ensurer
246
294
Here is an example of an implementation using amazon cognito
247
295
248
-
```javascript
296
+
```typescript
249
297
function sessionValidityEnsurer():Observable<boolean> {
250
298
returnObservable.of(this.isLoggedIn())
251
299
.switchMap(isLoggedIn=> {
@@ -295,30 +343,6 @@ these are the accessor rules for nested attribute types
295
343
-[n] — for list elements
296
344
- . (dot) — for map elements
297
345
298
-
## Pagination
299
-
TODO
300
-
301
-
## BatchGet
302
-
303
-
There are two scenarios for a batch get item request. One is requesting multiple items from one table by id and the other is requesting multiple items by id from multiple
304
-
tables.
305
-
The first scenario is support using DynamoStore.batchGet() the second one must be implemented using the BatchGetItem class.
-`npm run commit`: Commit using conventional commit style ([husky](https://github.com/typicode/husky) will tell you to use it if you haven't :wink:)
332
356
333
357
## Automatic releases
334
-
Use the npm comand `npm run commit`, which is a convenient way to create conventional commits. Those messages are used to run [semantic releases](https://github.com/semantic-release/semantic-release),
358
+
Use the npm comand `npm run commity`, which is a convenient way to create conventional commits. Those messages are used to run [semantic releases](https://github.com/semantic-release/semantic-release),
335
359
which publishes our code automatically on github and npm, plus generates automatically a changelog. This setup is highly influenced by [Kent C. Dodds course on egghead.io](https://egghead.io/courses/how-to-write-an-open-source-javascript-library)
336
360
337
361
## Git Hooks
@@ -354,7 +378,7 @@ We use 2 git hooks:
354
378
Made with :heart: by [@michaelwittwer](https://github.com/michaelwittwer) and all these wonderful contributors ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
355
379
356
380
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
0 commit comments