Skip to content

Commit c738fba

Browse files
Merge pull request #102 from shiftcode/beta
Beta
2 parents 08f2d5c + 6264857 commit c738fba

File tree

341 files changed

+13025
-8716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

341 files changed

+13025
-8716
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.huskyrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
hooks:
22
commit-msg: "commitlint -E HUSKY_GIT_PARAMS"
33
pre-commit: "lint-staged"
4-
pre-push: "npm run test && npm run build"
4+
pre-push: "npm run check-snippets && npm run test && npm run build"

.lintstagedrc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ linters:
33
- prettier --write --config ./.prettierrc.yml
44
- tslint --project ./tsconfig.json -t codeFrame --fix
55
- git add
6+
"(src/**/*.spec.ts|test/**/*.ts)":
7+
- prettier --write --config ./.prettierrc.yml
8+
# TODO LOW tslint will not work because of the following error
9+
# ✖ tslint --project ./tsconfig.jest.json -t codeFrame --fix found some errors. Please fix them and try committing again.
10+
#'/Users/michaelwittwer/dev/shiftcode/dynamo-easy/test/models/complex.model.ts' is not included in project.
11+
# - tslint --project ./tsconfig.jest.json -t codeFrame --fix
12+
- git add
613
"**/package.json":
714
- sort-package-json
815
- git add

.travis.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,22 @@
11
language: node_js
22
node_js:
3-
- lts/*
3+
- lts/*
44

55
cache: npm
6-
# directories:
7-
# - $HOME/.npm
8-
# - node_modules
96

10-
#before_install:
11-
#- npm install npm@^6.0.0 -g
12-
13-
# npm ci will not work with branches created from greenkeeper, because those need to update the package-lock.json
14-
# From https://github.com/greenkeeperio/greenkeeper-lockfile#npm:
15-
# If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead
16-
# of updating the package lock.
177
install:
18-
# decide if running on greenkeeper branch or not
19-
- case $TRAVIS_BRANCH in greenkeeper*) npm i;; *) npm ci;; esac;
20-
# somehow the above command fails when we have a cache available on travis - needs some more investigation, stick with
21-
# npm i for now
22-
#- npm ci
8+
- npm ci
239

2410
notifications:
2511
email: false
2612

27-
before_script: npx greenkeeper-lockfile-update
28-
2913
script:
30-
- npm run lint:ci
31-
- npm run test:ci
32-
- npm run build
33-
- npm run build:docs
34-
35-
after_script: npx greenkeeper-lockfile-upload
14+
- npm run lint:ci
15+
- npm run test:ci
16+
- npm run build
17+
- npm run docs:build
3618

3719
after_success:
38-
- npm run report-coverage
39-
- npm run deploy-docs
40-
- npx semantic-release
20+
- npm run report-coverage
21+
- npm run docs:deploy
22+
- npx semantic-release

LICENSE

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1-
Copyright 2017 Michael Wittwer <michael.wittwer@shiftcode.ch>
1+
MIT License
22

3-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3+
Copyright (c) 2017 shiftcode GmbH (info@shiftcode.ch)
44

5-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
611

7-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Dynamo-Easy
2+
[![Travis](https://img.shields.io/travis/com/shiftcode/dynamo-easy.svg)](https://travis-ci.com/shiftcode/dynamo-easy)
3+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
4+
[![latest-release](https://img.shields.io/npm/v/@shiftcoders/dynamo-easy/latest.svg)]()
5+
[![Coverage Status](https://coveralls.io/repos/github/shiftcode/dynamo-easy/badge.svg?branch=master)](https://coveralls.io/github/shiftcode/dynamo-easy?branch=master)
6+
[![Dev Dependencies](https://img.shields.io/david/expressjs/express.svg)](https://david-dm.org/michaelwittwer/dynamo-easy?type=dev)
7+
[![Greenkeeper badge](https://badges.greenkeeper.io/alexjoverm/typescript-library-starter.svg)](https://greenkeeper.io/)
8+
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
9+
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg)](#contributors)
10+
11+
12+
A dynamoDB client which provides an easy to use fluent api to execute requests. It supports typescript decorators, to define the necessary metadata for your models. You don't need to care about the mapping of javascript types to their dynamo types any more. We got you covered.
13+
14+
Built with :heart: by [shiftcode](https://www.shiftcode.ch).
15+
16+
## Show me some code
17+
```typescript
18+
import { Model, PartitionKey, DynamoStore } from '@shiftcoders/dynamo-easy'
19+
20+
@Model()
21+
export class Person {
22+
@PartitionKey()
23+
id: string
24+
name: string
25+
yearOfBirth: number
26+
}
27+
28+
const personStore = new DynamoStore(Person)
29+
30+
personStore
31+
.scan()
32+
.whereAttribute('yearOfBirth').equals(1958)
33+
.exec()
34+
.then(res => console.log('ALL items with yearOfBirth == 1958', res))
35+
36+
```
37+
38+
## Ressources
39+
- 🤓 Learn more visiting the [docs](https://shiftcode.gitbook.io/dynamo-easy)
40+
- 📖 Checkout the technical API documentation [api docs](https://shiftcode.github.io/dynamo-easy/)
41+
- 🚀 Check the running sample on [Stackblitz](https://stackblitz.com/edit/dynamo-easy-node-sample)
42+
- [demo git repository](https://github.com/shiftcode/dynamo-easy-demo)
43+
44+
## Credits
45+
- [https://github.com/alexjoverm/typescript-library-starter](typescript-library-starter) - Starter project which helps creating a TypeScript library project
46+
- [https://github.com/ryanfitz/vogels](vogels) - To get an idea on how to build the fluent api
47+
- [http://densebrain.github.io/typestore/](typestore) - Inspiration on how to implement the model decorators
48+
49+
## Contributors
50+
Made with :heart: by [@michaelwittwer](https://github.com/michaelwittwer) and all these wonderful contributors ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
51+
52+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
53+
| [<img src="https://avatars1.githubusercontent.com/u/8394182?v=4" width="100px;"/><br /><sub>Michael Wittwer</sub>](https://www.shiftcode.ch)<br />[💻](https://github.com/shiftcode/dynamo-easy/commits?author=michaelwittwer "Code") [📖](https://github.com/shiftcode/dynamo-easy/commits?author=michaelwittwer "Documentation") [⚠️](https://github.com/shiftcode/dynamo-easy/commits?author=michaelwittwer "Tests") | [<img src="https://avatars2.githubusercontent.com/u/8321523?s=460&v=4" width="100px;"/><br /><sub>Michael Lieberherr</sub>](https://www.shiftcode.ch)<br />[💻](https://github.com/shiftcode/dynamo-easy/commits?author=michaellieberherrr "Code") [📖](https://github.com/shiftcode/dynamo-easy/commits?author=michaellieberherrr "Documentation") [⚠️](https://github.com/shiftcode/dynamo-easy/commits?author=michaellieberherrr "Tests") | [<img src="https://avatars3.githubusercontent.com/u/37636934?s=460&v=4" width="100px;"/><br /><sub>Simon Mumenthaler</sub>](https://www.shiftcode.ch)<br />[💻](https://github.com/shiftcode/dynamo-easy/commits?author=simonmumenthaler "Code") [📖](https://github.com/shiftcode/dynamo-easy/commits?author=simonmumenthaler "Documentation") [⚠️](https://github.com/shiftcode/dynamo-easy/commits?author=simonmumenthaler "Tests") |
54+
| :---: | :---:| :---: |
55+
<!-- ALL-CONTRIBUTORS-LIST:END -->
56+
57+
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

doc-intro.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
### Config
3+
* [updateDynamoEasyConfig](/modules/dynamo_easy.html#updatedynamoeasyconfig)
4+
* [tableNameResolver](/modules/dynamo_easy.html#tablenameresolver)
5+
* [sessionValidityEnsurer](/modules/dynamo_easy.html#sessionvalidityensurer)
6+
7+
### Model
8+
* [Decorators](/modules/decorators.html)
9+
* [MapperForType](/interfaces/mapper.mapperfortype.html)
10+
11+
### DynamoStore
12+
* [DynamoStore](/classes/dynamo_easy.dynamostore.html)
13+
14+
#### Store Requests (Single Model)
15+
* [GetRequest](/classes/store_requests.getrequest.html)
16+
* [PutRequest](/classes/store_requests.putrequest.html)
17+
* [DeleteRequest](/classes/store_requests.deleterequest.html)
18+
* [UpdateRequest](/classes/store_requests.updaterequest.html)
19+
* [QueryRequest](classes/store_requests.queryrequest.html)
20+
* [ScanRequest](/classes/store_requests.scanrequest.html)
21+
* [TransactGetSingleTableRequest](/classes/store_requests.transactgetsingletablerequest.html)
22+
* [BatchGetSingleTableRequest](/classes/store_requests.batchgetsingletablerequest.html)
23+
* [BatchWriteSingleTableRequest](/classes/store_requests.batchwritesingletablerequest.html)
24+
25+
### Multi Model Requests
26+
* [BatchGetRequest](/classes/multi_model_requests_batch_get.batchgetrequest.html)
27+
* [BatchWriteRequest](/classes/multi_model_requests_batch_write.batchwriterequest.html)
28+
* [TransactGetRequest](/classes/multi_model_requests_transact_get.transactgetrequest.html)
29+
* [TransactWriteRequest](/classes/multi_model_requests_transact_write.transactwriterequest.html)
30+

dynamoDbAbstraction.monopic

-12.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)