Add octokit

This commit is contained in:
Rachael Sewell
2019-08-06 20:56:08 -07:00
parent ba3261b69d
commit 332696c680
122 changed files with 55351 additions and 0 deletions

21
node_modules/@octokit/request-error/LICENSE generated vendored Executable file
View File

@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2019 Octokit contributors
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:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.

68
node_modules/@octokit/request-error/README.md generated vendored Executable file
View File

@ -0,0 +1,68 @@
# http-error.js
> Error class for Octokit request errors
[![@latest](https://img.shields.io/npm/v/@octokit/request-error.svg)](https://www.npmjs.com/package/@octokit/request-error)
[![Build Status](https://travis-ci.com/octokit/request-error.js.svg?branch=master)](https://travis-ci.com/octokit/request-error.js)
[![Greenkeeper](https://badges.greenkeeper.io/octokit/request-error.js.svg)](https://greenkeeper.io/)
## Usage
<table>
<tbody valign=top align=left>
<tr><th>
Browsers
</th><td width=100%>
Load <code>@octokit/request-error</code> directly from <a href="https://cdn.pika.dev">cdn.pika.dev</a>
```html
<script type="module">
import { RequestError } from "https://cdn.pika.dev/@octokit/request-error";
</script>
```
</td></tr>
<tr><th>
Node
</th><td>
Install with <code>npm install @octokit/request-error</code>
```js
const { RequestError } = require("@octokit/request-error");
// or: import { RequestError } from "@octokit/request-error";
```
</td></tr>
</tbody>
</table>
```js
const error = new RequestError("Oops", 500, {
headers: {
"x-github-request-id": "1:2:3:4"
}, // response headers
request: {
method: "POST",
url: "https://api.github.com/foo",
body: {
bar: "baz"
},
headers: {
authorization: "token secret123"
}
}
});
error.message; // Oops
error.status; // 500
error.headers; // { 'x-github-request-id': '1:2:3:4' }
error.request.method; // POST
error.request.url; // https://api.github.com/foo
error.request.body; // { bar: 'baz' }
error.request.headers; // { authorization: 'token [REDACTED]' }
```
## LICENSE
[MIT](LICENSE)

54
node_modules/@octokit/request-error/dist-node/index.js generated vendored Executable file
View File

@ -0,0 +1,54 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var deprecation = require('deprecation');
var once = _interopDefault(require('once'));
const logOnce = once(deprecation => console.warn(deprecation));
/**
* Error with extra properties to help with debugging
*/
class RequestError extends Error {
constructor(message, statusCode, options) {
super(message); // Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "HttpError";
this.status = statusCode;
Object.defineProperty(this, "code", {
get() {
logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
return statusCode;
}
});
this.headers = options.headers; // redact request credentials without mutating original request options
const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
});
}
requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
this.request = requestCopy;
}
}
exports.RequestError = RequestError;

40
node_modules/@octokit/request-error/dist-src/index.js generated vendored Executable file
View File

@ -0,0 +1,40 @@
import { Deprecation } from "deprecation";
import once from "once";
const logOnce = once((deprecation) => console.warn(deprecation));
/**
* Error with extra properties to help with debugging
*/
export class RequestError extends Error {
constructor(message, statusCode, options) {
super(message);
// Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "HttpError";
this.status = statusCode;
Object.defineProperty(this, "code", {
get() {
logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
return statusCode;
}
});
this.headers = options.headers;
// redact request credentials without mutating original request options
const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
});
}
requestCopy.url = requestCopy.url
// client_id & client_secret can be passed as URL query parameters to increase rate limit
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]")
// OAuth tokens can be passed as URL query parameters, although it is not recommended
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
this.request = requestCopy;
}
}

0
node_modules/@octokit/request-error/dist-src/types.js generated vendored Executable file
View File

26
node_modules/@octokit/request-error/dist-types/index.d.ts generated vendored Executable file
View File

@ -0,0 +1,26 @@
import { RequestOptions, ResponseHeaders, RequestErrorOptions } from "./types";
/**
* Error with extra properties to help with debugging
*/
export declare class RequestError extends Error {
name: "HttpError";
/**
* http status code
*/
status: number;
/**
* http status code
*
* @deprecated `error.code` is deprecated in favor of `error.status`
*/
code: number;
/**
* error response headers
*/
headers: ResponseHeaders;
/**
* Request options that lead to the error.
*/
request: RequestOptions;
constructor(message: string, statusCode: number, options: RequestErrorOptions);
}

37
node_modules/@octokit/request-error/dist-types/types.d.ts generated vendored Executable file
View File

@ -0,0 +1,37 @@
/**
* Relative or absolute URL. Examples: `'/orgs/:org'`, `https://example.com/foo/bar`
*/
export declare type Url = string;
/**
* Request method
*/
export declare type Method = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
export declare type RequestHeaders = {
/**
* Used for API previews and custom formats
*/
accept?: string;
/**
* Redacted authorization header
*/
authorization?: string;
"user-agent"?: string;
[header: string]: string | number | undefined;
};
export declare type ResponseHeaders = {
[header: string]: string;
};
export declare type EndpointRequestOptions = {
[option: string]: any;
};
export declare type RequestOptions = {
method: Method;
url: Url;
headers: RequestHeaders;
body?: any;
request?: EndpointRequestOptions;
};
export declare type RequestErrorOptions = {
headers: ResponseHeaders;
request: RequestOptions;
};

48
node_modules/@octokit/request-error/dist-web/index.js generated vendored Executable file
View File

@ -0,0 +1,48 @@
import { Deprecation } from 'deprecation';
import once from 'once';
const logOnce = once(deprecation => console.warn(deprecation));
/**
* Error with extra properties to help with debugging
*/
class RequestError extends Error {
constructor(message, statusCode, options) {
super(message); // Maintains proper stack trace (only available on V8)
/* istanbul ignore next */
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = "HttpError";
this.status = statusCode;
Object.defineProperty(this, "code", {
get() {
logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
return statusCode;
}
});
this.headers = options.headers; // redact request credentials without mutating original request options
const requestCopy = Object.assign({}, options.request);
if (options.request.headers.authorization) {
requestCopy.headers = Object.assign({}, options.request.headers, {
authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
});
}
requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
// see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
// see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
.replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
this.request = requestCopy;
}
}
export { RequestError };

81
node_modules/@octokit/request-error/package.json generated vendored Executable file
View File

@ -0,0 +1,81 @@
{
"_from": "@octokit/request-error@^1.0.1",
"_id": "@octokit/request-error@1.0.4",
"_inBundle": false,
"_integrity": "sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig==",
"_location": "/@octokit/request-error",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@octokit/request-error@^1.0.1",
"name": "@octokit/request-error",
"escapedName": "@octokit%2frequest-error",
"scope": "@octokit",
"rawSpec": "^1.0.1",
"saveSpec": null,
"fetchSpec": "^1.0.1"
},
"_requiredBy": [
"/@octokit/request",
"/@octokit/rest"
],
"_resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.0.4.tgz",
"_shasum": "15e1dc22123ba4a9a4391914d80ec1e5303a23be",
"_spec": "@octokit/request-error@^1.0.1",
"_where": "C:\\Users\\damccorm\\Documents\\node12-template\\node_modules\\@octokit\\request",
"bugs": {
"url": "https://github.com/octokit/request-error.js/issues"
},
"bundleDependencies": false,
"dependencies": {
"deprecation": "^2.0.0",
"once": "^1.4.0"
},
"deprecated": false,
"description": "Error class for Octokit request errors",
"devDependencies": {
"@pika/pack": "^0.3.7",
"@pika/plugin-build-node": "^0.4.0",
"@pika/plugin-build-web": "^0.4.0",
"@pika/plugin-bundle-web": "^0.4.0",
"@pika/plugin-ts-standard-pkg": "^0.4.0",
"@semantic-release/git": "^7.0.12",
"@types/jest": "^24.0.12",
"@types/node": "^12.0.2",
"@types/once": "^1.4.0",
"jest": "^24.7.1",
"pika-plugin-unpkg-field": "^1.1.0",
"prettier": "^1.17.0",
"semantic-release": "^15.10.5",
"ts-jest": "^24.0.2",
"typescript": "^3.4.5"
},
"files": [
"dist-*/",
"bin/"
],
"homepage": "https://github.com/octokit/request-error.js#readme",
"keywords": [
"octokit",
"github",
"api",
"error"
],
"license": "MIT",
"main": "dist-node/index.js",
"module": "dist-web/index.js",
"name": "@octokit/request-error",
"pika": true,
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/octokit/request-error.js.git"
},
"sideEffects": false,
"source": "dist-src/index.js",
"types": "dist-types/index.d.ts",
"version": "1.0.4"
}