├── .circleci └── config.yml ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .jshintrc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── package.json ├── src ├── host.json ├── local.settings.json └── some-function │ ├── function.json │ ├── some-function.spec.ts │ └── some-function.ts ├── tools ├── build │ ├── helpers.js │ └── webpack.prod.js └── deploy │ └── publish.sh ├── tsconfig.json ├── tslint.json └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: circleci/node:8 6 | branches: 7 | ignore: 8 | - prod 9 | steps: 10 | - checkout 11 | - run: sudo npm install -g yarn@0 12 | - run: sudo yarn global add greenkeeper-lockfile@1 13 | - restore_cache: 14 | keys: 15 | - deps-{{ .Branch }}-{{ checksum "yarn.lock" }} 16 | - deps- 17 | - run: yarn 18 | - save_cache: 19 | key: deps-{{ .Branch }}-{{ checksum "yarn.lock" }} 20 | paths: 'node_modules' 21 | - run: yarn ci:before 22 | - run: yarn test:ci 23 | - run: yarn build 24 | - run: yarn ci:after 25 | - run: bash <(curl -s https://codecov.io/bash) 26 | - store_artifacts: 27 | path: coverage 28 | prefix: coverage 29 | - store_artifacts: 30 | path: dist 31 | prefix: dist 32 | - store_test_results: 33 | path: test-report.xml 34 | - run: sudo chmod +x ./tools/deploy/publish.sh 35 | - deploy: 36 | command: | 37 | if [ "${CIRCLE_BRANCH}" == "master" ]; 38 | then ./tools/deploy/publish.sh prod; 39 | fi 40 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | **I'm submitting a ...** (check one with "x") 4 | ``` 5 | [ ] Regression (a behavior that used to work and stopped working in a new release) 6 | [ ] Bug report 7 | [ ] Support request => 8 | [ ] Feature request 9 | [ ] Documentation issue or request 10 | ``` 11 | 12 | **Current behavior** 13 | 14 | 15 | **Expected/desired behavior** 16 | 17 | 18 | **Minimal reproduction of the problem with instructions** 19 | 20 | 21 | **What is the motivation / use case for changing the behavior?** 22 | 23 | 24 | **Environment** 25 | * **For Tooling issues:** 26 | - Node version: XX 27 | - Platform: 28 | 29 | * Others: 30 | 31 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ** PR Checklist 2 | Please check if your PR fulfills the following requirements: 3 | 4 | - [ ] The commit message follows our guidelines: https://github.com/azure-seed/azure-functions-typescript/blob/master/CONTRIBUTING.md#commit 5 | - [ ] Tests for the changes have been added (for bug fixes / features) 6 | - [ ] Docs have been added / updated (for bug fixes / features) 7 | 8 | ** PR Type 9 | What kind of change does this PR introduce? 10 | 11 | 12 | ``` 13 | [ ] Bugfix 14 | [ ] Feature 15 | [ ] Code style update (formatting, local variables) 16 | [ ] Refactoring (no functional changes, no api changes) 17 | [ ] Build related changes 18 | [ ] CI related changes 19 | [ ] Documentation content changes 20 | [ ] Other... Please describe: 21 | ``` 22 | 23 | ** What is the current behavior? 24 | 25 | 26 | Issue Number: N/A 27 | 28 | ** What is the new behavior? 29 | 30 | ** Does this PR introduce a breaking change? 31 | ``` 32 | [ ] Yes 33 | [ ] No 34 | ``` 35 | 36 | 37 | 38 | ** Other information 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | dist/ 5 | 6 | # dependencies 7 | node_modules/ 8 | 9 | # IDEs and editors 10 | .idea/ 11 | 12 | # build tools 13 | coverage/ 14 | test-report.xml 15 | 16 | # misc 17 | npm-debug.log 18 | yarn-error.log 19 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "eqeqeq": true, 4 | "forin": true, 5 | "noarg": true, 6 | "noempty": true, 7 | "nonbsp": true, 8 | "nonew": true, 9 | "undef": true, 10 | "varstmt": true, 11 | "esversion": 6, 12 | "latedef": true, 13 | "unused": true, 14 | "indent": 2, 15 | "quotmark": "single", 16 | "maxcomplexity": 20, 17 | "maxlen": 140, 18 | "maxerr": 50, 19 | "globals": {}, 20 | "strict": true, 21 | "laxbreak": true, 22 | "browser": true, 23 | "module": true, 24 | "node": true, 25 | "trailing": true, 26 | "onevar": true, 27 | "white": true 28 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. 4 | 5 | 6 | ## [1.2.1](https://github.com/azure-seed/azure-functions-typescript/compare/v1.2.0...v1.2.1) (2017-11-28) 7 | 8 | * upgrade to TypeScript v2.6.2 9 | 10 | ### Bug Fixes 11 | 12 | * remove url from response body ([#18](https://github.com/azure-seed/azure-functions-typescript/issues/18)) ([ee6ffed](https://github.com/azure-seed/azure-functions-typescript/commit/ee6ffed)) 13 | 14 | 15 | 16 | 17 | # [1.2.0](https://github.com/azure-seed/azure-functions-typescript/compare/v1.1.1...v1.2.0) (2017-10-09) 18 | 19 | 20 | ### Features 21 | 22 | * accept request body as application/json ([#15](https://github.com/azure-seed/azure-functions-typescript/issues/15)) ([c1dc7e6](https://github.com/azure-seed/azure-functions-typescript/commit/c1dc7e6)) 23 | * add uglify-js ([#16](https://github.com/azure-seed/azure-functions-typescript/issues/16)) ([f06c3fa](https://github.com/azure-seed/azure-functions-typescript/commit/f06c3fa)) 24 | 25 | 26 | 27 | 28 | ## [1.1.1](https://github.com/azure-seed/azure-functions-typescript/compare/v1.1.0...v1.1.1) (2017-09-30) 29 | 30 | 31 | ### Bug Fixes 32 | 33 | * parse request body using JSON.parse ([#9](https://github.com/azure-seed/azure-functions-typescript/issues/9)) ([9a3f407](https://github.com/azure-seed/azure-functions-typescript/commit/9a3f407)) 34 | 35 | 36 | 37 | 38 | # [1.1.0](https://github.com/azure-seed/azure-functions-typescript/compare/v1.0.0...v1.1.0) (2017-09-30) 39 | 40 | 41 | ### Features 42 | 43 | * route http methods to relevant functions ([#8](https://github.com/azure-seed/azure-functions-typescript/issues/8)) ([1629980](https://github.com/azure-seed/azure-functions-typescript/commit/1629980)) 44 | 45 | 46 | 47 | 48 | # 1.0.0 (2017-09-27) 49 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at **mail@buraktasci.com**. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to **`azure-seed/azure-functions-typescript`** 2 | 3 | As a contributor, here are the guidelines we would like you to follow: 4 | 5 | - [Code of Conduct](#coc) 6 | - [Issues and Bugs](#issue) 7 | - [Feature requests](#feature) 8 | - [Submission guidelines](#submit) 9 | - [Coding rules](#rules) 10 | - [Commit message guidelines](#commit) 11 | 12 | ## Code of Conduct 13 | Help us keep **`azure-seed/azure-functions-typescript`** open and inclusive. Please read and follow our [Code of Conduct][coc]. 14 | 15 | ## Found a Bug? 16 | If you find a bug in the source code, you can help us by [submitting an issue](#submit-issue) to our [GitHub Repository][github]. 17 | 18 | Even better, you can [submit a Pull Request](#submit-pr) with a fix. 19 | 20 | ## Missing a Feature? 21 | You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub Repository. 22 | 23 | If you would like to *implement* a new feature, please submit an issue with a proposal for your work first, to be sure that 24 | we can use it. 25 | 26 | Please consider what kind of change it is: 27 | * For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. 28 | This will also allow us to better coordinate our efforts, prevent duplication of work, and help you to craft the change 29 | so that it is successfully accepted into the project. 30 | * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). 31 | 32 | ## Submission guidelines 33 | ### Submitting an Issue 34 | Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion 35 | might inform you of workarounds readily available. 36 | 37 | We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. However, 38 | in order to reproduce bugs we need to ask you to provide a minimal reproduction scenario. 39 | 40 | Having a live, reproducible scenario gives us wealth of important information without going back & forth to you with additional 41 | questions like: 42 | - version used 43 | - 3rd-party libraries and their versions 44 | - and most importantly: a use-case that fails 45 | 46 | Unfortunately we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you, 47 | we are going to close an issue that don't have enough info to be reproduced. 48 | 49 | You can file new issues by filling out our [new issue form](https://github.com/azure-seed/azure-functions-typescript/issues/new). 50 | 51 | ### Submitting a Pull Request (PR) 52 | Before you submit your Pull Request (PR) consider the following guidelines: 53 | 54 | * Search [GitHub](https://github.com/azure-seed/azure-functions-typescript/pulls) for an open or closed PR that relates to your submission. 55 | You don't want to duplicate effort. 56 | * Make your changes in a new git branch: 57 | ```shell 58 | git checkout -b my-fix-branch master 59 | ``` 60 | * Create your patch, **including appropriate test cases**. 61 | * Follow our [Coding rules](#rules). 62 | * Run the full test suite and ensure that all tests pass. 63 | * Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit). 64 | Adherence to these conventions is necessary because release notes are automatically generated from these messages. 65 | ```shell 66 | git commit -a 67 | ``` 68 | Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files. 69 | * Push your branch to GitHub: 70 | ```shell 71 | git push origin my-fix-branch 72 | ``` 73 | * In GitHub, send a pull request to `azure-functions-typescript:master`. 74 | * If we suggest changes then: 75 | * Make the required updates. 76 | * Re-run the test suites to ensure tests are still passing. 77 | * Rebase your branch and force push to your GitHub repository (this will update your Pull Request): 78 | ```shell 79 | git rebase master -i 80 | git push -f 81 | ``` 82 | That's it, thanks for your contribution! 83 | 84 | #### After your pull request is merged 85 | After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository: 86 | * Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: 87 | ```shell 88 | git push origin --delete my-fix-branch 89 | ``` 90 | * Check out the master branch: 91 | ```shell 92 | git checkout master -f 93 | ``` 94 | * Delete the local branch: 95 | ```shell 96 | git branch -D my-fix-branch 97 | ``` 98 | * Update your master with the latest upstream version: 99 | ```shell 100 | git pull --ff upstream master 101 | ``` 102 | 103 | ## Coding rules 104 | To ensure consistency throughout the source code, keep these rules in mind as you are working: 105 | * All features or bug fixes **must be tested** by one or more specs (unit-tests). 106 | * All public API methods **must be documented**. (Details TBC). 107 | * We follow [fulls1z3's Backend TSLint rules][backend-tslint-rules]. 108 | 109 | ## Commit message guidelines 110 | We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that 111 | are easy to follow when looking through the **project history**. But also, we use the git commit messages to **generate 112 | the **`azure-seed/azure-functions-typescript`** change log**. 113 | 114 | ### Commit Message Format 115 | Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes 116 | a **type**, a **scope** (*when applicable*) and a **subject**: 117 | ``` 118 | (): 119 | 120 | 121 | 122 |