@capraconsulting/cals-cli
Advanced tools
Comparing version 1.5.0 to 1.6.0
import Octokit, { OrgsGetResponse, ReposGetResponse, TeamsListResponseItem } from '@octokit/rest'; | ||
import { CacheProvider } from '../cache'; | ||
import { Config } from '../config'; | ||
import { Permission, Repo } from './types'; | ||
import { OrgMemberOrInvited, Permission, Repo, TeamMemberOrInvited } from './types'; | ||
export declare class GitHubService { | ||
@@ -19,2 +19,4 @@ constructor(config: Config, octokit: Octokit, cache: CacheProvider); | ||
getOrgMembersList(org: string): Promise<Octokit.OrgsListMembersResponseItem[]>; | ||
getOrgMembersInvitedList(org: string): Promise<Octokit.OrgsListPendingInvitationsResponseItem[]>; | ||
getOrgMembersListIncludingInvited(org: string): Promise<OrgMemberOrInvited[]>; | ||
getRepository(owner: string, repo: string): Promise<Octokit.ReposGetResponse | undefined>; | ||
@@ -25,2 +27,4 @@ getRepositoryTeamsList(repo: ReposGetResponse): Promise<Octokit.ReposListTeamsResponseItem[]>; | ||
getTeamMemberList(team: TeamsListResponseItem): Promise<Octokit.TeamsListMembersResponseItem[]>; | ||
getTeamMemberInvitedList(team: TeamsListResponseItem): Promise<Octokit.TeamsListPendingInvitationsResponseItem[]>; | ||
getTeamMemberListIncludingInvited(team: TeamsListResponseItem): Promise<TeamMemberOrInvited[]>; | ||
setTeamPermission(repo: ReposGetResponse, team: TeamsListResponseItem, permission: Permission): Promise<void>; | ||
@@ -27,0 +31,0 @@ getSearchedPullRequestList(): Promise<{ |
@@ -0,1 +1,2 @@ | ||
import { OrgsListMembersResponseItem, OrgsListPendingInvitationsResponseItem, TeamsListMembersResponseItem, TeamsListPendingInvitationsResponseItem } from '@octokit/rest'; | ||
export interface Repo { | ||
@@ -23,1 +24,19 @@ name: string; | ||
export declare type Permission = 'admin' | 'push' | 'pull'; | ||
export declare type TeamMemberOrInvited = { | ||
type: 'member'; | ||
login: string; | ||
data: TeamsListMembersResponseItem; | ||
} | { | ||
type: 'invited'; | ||
login: string; | ||
data: TeamsListPendingInvitationsResponseItem; | ||
}; | ||
export declare type OrgMemberOrInvited = { | ||
type: 'member'; | ||
login: string; | ||
data: OrgsListMembersResponseItem; | ||
} | { | ||
type: 'invited'; | ||
login: string; | ||
data: OrgsListPendingInvitationsResponseItem; | ||
}; |
@@ -1,2 +0,2 @@ | ||
var version = "1.5.0"; | ||
var version = "1.6.0"; | ||
@@ -3,0 +3,0 @@ const VERSION = version; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var version = "1.5.0"; | ||
var version = "1.6.0"; | ||
@@ -8,0 +8,0 @@ const VERSION = version; |
{ | ||
"name": "@capraconsulting/cals-cli", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "CLI for repeatable tasks in CALS", | ||
@@ -57,3 +57,2 @@ "scripts": { | ||
"ts-jest": "24.0.2", | ||
"ts-node": "8.3.0", | ||
"typescript": "3.5.3" | ||
@@ -60,0 +59,0 @@ }, |
# cals-cli | ||
[![Build Status](https://jenkins.capra.tv/buildStatus/icon?job=cals-cli/master)](https://jenkins.capra.tv/job/cals-cli/job/master/) | ||
[![Build Status](https://jenkins.capra.tv/buildStatus/icon?job=cals-internal/cals-cli/master)](https://jenkins.capra.tv/job/cals-internal/job/cals-cli/job/master/) | ||
## Getting started | ||
Make sure you have a recent version of node. E.g. by following | ||
Make sure you have a recent version of Node.js. E.g. by using | ||
https://github.com/creationix/nvm | ||
Clone this repo. | ||
Use NPM to link this repo as a global package: | ||
```bash | ||
npm install | ||
npm link | ||
npx @capraconsulting/cals-cli --help | ||
``` | ||
Run the cli from any folder (as it is linked by NPM it will also | ||
work in other terminals): | ||
It is recommended to use `npx` over global install to ensure you | ||
always run the latest version. If you install it globally remember | ||
to update it before running. | ||
```bash | ||
cals | ||
``` | ||
## Building locally | ||
### Updating | ||
Clone this repo. | ||
The `npm link` command will also build the application. When | ||
changing the code, a rebuild must be done. | ||
Use NPM to link this repo as a global package: | ||
```bash | ||
git pull | ||
npm install | ||
npm run build | ||
npm link | ||
``` | ||
### Development | ||
Run the cli from any terminal/folder: | ||
Source the version that uses the source files directly. | ||
```bash | ||
source alias-dev.sh | ||
cals | ||
``` | ||
Run the cli: | ||
Rebuild using `npm run build`. | ||
```bash | ||
cals | ||
``` | ||
## Contributing | ||
This is slower than using the build with `npm link` due to running | ||
through the TypeScript compiler. | ||
This project uses [semantic release](https://semantic-release.gitbook.io/semantic-release/) | ||
to automate releases and follows | ||
[Git commit guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit) | ||
from the Angular project. | ||
@@ -62,3 +54,2 @@ ## Goals of CLI | ||
* Release as package on NPM | ||
* Automate onboarding of people | ||
@@ -79,5 +70,5 @@ * Granting access to various resources: AWS, GitHub, Confluence, JIRA, Slack, ... | ||
- [ ] Automatically set up project in Snyk | ||
- [x] Report of which repos are in Snyk and which is not | ||
- [ ] Detect active vs disabled projects in Snyk (no way through API now?) | ||
- [x] Report issues in Snyk grouped by our projects | ||
* [ ] Automatically set up project in Snyk | ||
* [x] Report of which repos are in Snyk and which is not | ||
* [ ] Detect active vs disabled projects in Snyk (no way through API now?) | ||
* [x] Report issues in Snyk grouped by our projects |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
94030
25
50
2463
73