Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shelf/gh-sdk

Package Overview
Dependencies
Maintainers
9
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shelf/gh-sdk - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

lib/prs/create-release-pr.d.ts

7

lib/index.d.ts

@@ -1,4 +0,9 @@

import Octokit from '@octokit/rest';
import { Octokit } from '@octokit/rest';
export { listOpenPRs } from './prs/list-open-prs';
export { listOrgRepos } from './repos/list-org-repos';
export { getRepoBranch, getRepoBranches, getRepoBranchesNames } from './repos/get-repo-branches';
export { deleteBranch } from './repos/delete-branch';
export { createReleasePR } from './prs/create-release-pr';
export { createReleaseBranch } from './repos/create-release-branch';
export { getLatestBranchCommit, getLatestDevelopCommit, getLatestDevelopCommitSHA } from './repos/get-latest-branch-commit';
interface ApprovePRParams {

@@ -5,0 +10,0 @@ owner: string;

@@ -21,2 +21,56 @@ "use strict";

});
Object.defineProperty(exports, "getRepoBranch", {
enumerable: true,
get: function () {
return _getRepoBranches.getRepoBranch;
}
});
Object.defineProperty(exports, "getRepoBranches", {
enumerable: true,
get: function () {
return _getRepoBranches.getRepoBranches;
}
});
Object.defineProperty(exports, "getRepoBranchesNames", {
enumerable: true,
get: function () {
return _getRepoBranches.getRepoBranchesNames;
}
});
Object.defineProperty(exports, "deleteBranch", {
enumerable: true,
get: function () {
return _deleteBranch.deleteBranch;
}
});
Object.defineProperty(exports, "createReleasePR", {
enumerable: true,
get: function () {
return _createReleasePr.createReleasePR;
}
});
Object.defineProperty(exports, "createReleaseBranch", {
enumerable: true,
get: function () {
return _createReleaseBranch.createReleaseBranch;
}
});
Object.defineProperty(exports, "getLatestBranchCommit", {
enumerable: true,
get: function () {
return _getLatestBranchCommit.getLatestBranchCommit;
}
});
Object.defineProperty(exports, "getLatestDevelopCommit", {
enumerable: true,
get: function () {
return _getLatestBranchCommit.getLatestDevelopCommit;
}
});
Object.defineProperty(exports, "getLatestDevelopCommitSHA", {
enumerable: true,
get: function () {
return _getLatestBranchCommit.getLatestDevelopCommitSHA;
}
});

@@ -29,2 +83,12 @@ var _restClient = require("./rest-client");

var _getRepoBranches = require("./repos/get-repo-branches");
var _deleteBranch = require("./repos/delete-branch");
var _createReleasePr = require("./prs/create-release-pr");
var _createReleaseBranch = require("./repos/create-release-branch");
var _getLatestBranchCommit = require("./repos/get-latest-branch-commit");
async function approvePR(params) {

@@ -31,0 +95,0 @@ const gh = (0, _restClient.getClient)();

2

lib/prs/list-open-prs.d.ts

@@ -1,2 +0,2 @@

import Octokit from '@octokit/rest';
import { Octokit } from '@octokit/rest';
interface ListPRsParams {

@@ -3,0 +3,0 @@ owner: string;

@@ -1,2 +0,2 @@

import { ReposListForOrgResponseItem } from '@octokit/rest';
export declare function listOrgRepos(org: string): Promise<ReposListForOrgResponseItem[]>;
import { Octokit } from '@octokit/rest';
export declare function listOrgRepos(org: string): Promise<Octokit.ReposListForOrgResponseItem[]>;

@@ -1,2 +0,2 @@

import Oktokit from '@octokit/rest';
export declare function getClient(): Oktokit;
import { Octokit } from '@octokit/rest';
export declare function getClient(): Octokit;

@@ -8,6 +8,4 @@ "use strict";

var _rest = _interopRequireDefault(require("@octokit/rest"));
var _rest = require("@octokit/rest");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
let client;

@@ -20,3 +18,3 @@

client = new _rest.default({
client = new _rest.Octokit({
auth: process.env.GITHUB_TOKEN

@@ -23,0 +21,0 @@ });

{
"name": "@shelf/gh-sdk",
"version": "0.1.0",
"version": "0.2.0",
"description": "Convenient wrapper for GitHub API for automation tasks",

@@ -11,7 +11,7 @@ "license": "MIT",

},
"main": "lib",
"types": "lib/index.d.ts",
"files": [
"lib"
],
"main": "lib",
"types": "lib/index.d.ts",
"scripts": {

@@ -44,2 +44,3 @@ "build": "rm -rf lib/ && yarn build:types && yarn build:code",

},
"prettier": "@shelf/prettier-config",
"jest": {

@@ -49,19 +50,21 @@ "testEnvironment": "node"

"dependencies": {
"@octokit/rest": "16.40.1"
"@octokit/rest": "16.43.1",
"lodash": "4.17.15"
},
"devDependencies": {
"@babel/cli": "7.8.3",
"@babel/core": "7.8.3",
"@babel/preset-env": "7.8.3",
"@babel/preset-typescript": "7.8.3",
"@babel/cli": "7.8.4",
"@babel/core": "7.9.0",
"@babel/preset-env": "7.9.0",
"@babel/preset-typescript": "7.9.0",
"@shelf/eslint-config": "0.14.2",
"@types/jest": "25.1.0",
"@types/node": "12",
"babel-jest": "25.1.0",
"@shelf/prettier-config": "0.0.7",
"@types/jest": "25.1.4",
"@types/node": "12.12.31",
"babel-jest": "25.2.3",
"eslint": "6.8.0",
"husky": "4.2.1",
"jest": "25.1.0",
"lint-staged": "10.0.4",
"prettier": "1.19.1",
"typescript": "3.7.5"
"husky": "4.2.3",
"jest": "25.2.3",
"lint-staged": "10.0.9",
"prettier": "2.0.2",
"typescript": "3.8.3"
},

@@ -68,0 +71,0 @@ "engines": {

@@ -14,9 +14,18 @@ # gh-sdk [![CircleCI](https://circleci.com/gh/shelfio/gh-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/gh-sdk/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)

```js
const {approvePR, mergePR, listOpenPRs, getUserOrgs, listOrgRepos} = require('@shelf/gh-sdk');
const {approvePR, mergePR, listOpenPRs, getUserOrgs, ...} = require('@shelf/gh-sdk');
getUserOrgs();
listOrgRepos('shelf'); // => [, {repo}]
approvePR({owner: 'shelf', repo: 'api', pr: 3});
mergePR({owner: 'shelf', repo: 'api', pr: 3});
listOpenPRs({owner: 'shelf', searchText: 'renovate'});
getUserOrgs();
listOrgRepos('shelf');
getRepoBranch({owner: 'shelf', repo: 'api', branch: 'dev'});
getRepoBranches({owner: 'shelf', repo: 'api'}); // => [, {branch}]
getRepoBranchesNames({owner: 'shelf', repo: 'api'}); // => [, 'branch-ref']
deleteBranch({owner: 'shelf', repo: 'api', ref: 'dev'});
createReleaseBranch({owner:'shelf', repo: 'api', version: '1.2.3', sha: 'dev'}) // => ref 'release/v1.2.3`
createReleasePR({owner:'shelf', repo: 'api', version: '1.2.3', releaseTitle: 'Good stuff'}) //=> ref: 'release/v1.2.3`, title: Release v1.2.3: Good stuff
getLatestBranchCommit({owner: 'shelf', repo: 'api', branch: 'dev'});
getLatestDevelopCommit({owner: 'shelf', repo: 'api'}) //{branch: 'develop} as default
getLatestDevelopCommitSHA({owner: 'shelf', repo: 'api'}) // => 'develop-branch-hash-string'
```

@@ -23,0 +32,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc