https://github.com/tmr08c/weekly-summary-typescript
A module used to interact with the GitHub API to fetch recently closed Pull Requests.
https://github.com/tmr08c/weekly-summary-typescript
circle-ci circleci github-api graphql npm-package typescript
Last synced: 2 months ago
JSON representation
A module used to interact with the GitHub API to fetch recently closed Pull Requests.
- Host: GitHub
- URL: https://github.com/tmr08c/weekly-summary-typescript
- Owner: tmr08c
- Created: 2019-05-12T16:35:05.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-04-23T13:50:13.000Z (about 2 years ago)
- Last Synced: 2025-02-24T04:45:34.486Z (3 months ago)
- Topics: circle-ci, circleci, github-api, graphql, npm-package, typescript
- Language: TypeScript
- Size: 1.05 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Weekly Summary TypeScript
[](https://badge.fury.io/js/weekly-summary-typescript)
[](https://circleci.com/gh/tmr08c/weekly-summary-typescript/tree/master)
[](https://coveralls.io/github/tmr08c/weekly-summary-typescript?branch=master)
[](http://commitizen.github.io/cz-cli/)
[](https://github.com/semantic-release/semantic-release)This package gets the last week of merged pull requests for a specific organization from GitHub.
# Installing
```bash
npm install weekly-summary-typescript
```# Usage
## Requsting pull requests
```typescript
import { fetchRecentlyClosedPullRequests } from "weekly-summary-typescript";const recentlyClosedPullRequests = await fetchRecentlyClosedPullRequests(
{
organization: `my-organization`
},
`my-github-auth-token`
);
```## Response
Pull requests are returned as an object where the key is the repository's name and the value is an array of objects that include information about the pull request. For example:
```json
{
"weekly-summary-typescript": [
{
"repository": {
"name": "weekly-summary-typescript"
},
"title": "refactor(github): changes setup for GitHub auth token",
"createdAt": "2019-11-02T19:14:53Z",
"closedAt": "2019-11-03T10:58:15Z",
"url": "https://github.com/tmr08c/weekly-summary-typescript/pull/14",
"merged": true
},
{
"repository": {
"name": "weekly-summary-typescript"
},
"title": "chore: sets up commitizen",
"createdAt": "2019-11-02T19:00:06Z",
"closedAt": "2019-11-02T19:00:51Z",
"url": "https://github.com/tmr08c/weekly-summary-typescript/pull/13",
"merged": true
}
]
}
```Type definitions can be found [here](https://github.com/tmr08c/weekly-summary-typescript/blob/f3aa636e1a2aa4d97d404b97e90f3390bc397ce4/src/github.ts#L29).
You can also check out [this project](https://github.com/tmr08c/weekly-summary-cron-with-now) for an example of how this package is used in production.