@octokit/core
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -11,53 +11,4 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
const VERSION = "3.1.3"; | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
const VERSION = "3.1.2"; | ||
class Octokit { | ||
@@ -93,5 +44,3 @@ constructor(options = {}) { | ||
this.request = request.request.defaults(requestDefaults); | ||
this.graphql = graphql.withCustomRequest(this.request).defaults(_objectSpread2(_objectSpread2({}, requestDefaults), {}, { | ||
baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api") | ||
})); | ||
this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); | ||
this.log = Object.assign({ | ||
@@ -104,3 +53,3 @@ debug: () => {}, | ||
this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance | ||
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred. | ||
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. | ||
// (2) If only `options.auth` is set, use the default token authentication strategy. | ||
@@ -107,0 +56,0 @@ // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. |
@@ -38,6 +38,3 @@ import { getUserAgent } from "universal-user-agent"; | ||
this.request = request.defaults(requestDefaults); | ||
this.graphql = withCustomRequest(this.request).defaults({ | ||
...requestDefaults, | ||
baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api"), | ||
}); | ||
this.graphql = withCustomRequest(this.request).defaults(requestDefaults); | ||
this.log = Object.assign({ | ||
@@ -51,3 +48,3 @@ debug: () => { }, | ||
// (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance | ||
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred. | ||
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. | ||
// (2) If only `options.auth` is set, use the default token authentication strategy. | ||
@@ -54,0 +51,0 @@ // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "3.1.2"; | ||
export const VERSION = "3.1.3"; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "3.1.2"; | ||
export declare const VERSION = "3.1.3"; |
@@ -7,3 +7,3 @@ import { getUserAgent } from 'universal-user-agent'; | ||
const VERSION = "3.1.2"; | ||
const VERSION = "3.1.3"; | ||
@@ -41,6 +41,3 @@ class Octokit { | ||
this.request = request.defaults(requestDefaults); | ||
this.graphql = withCustomRequest(this.request).defaults({ | ||
...requestDefaults, | ||
baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api"), | ||
}); | ||
this.graphql = withCustomRequest(this.request).defaults(requestDefaults); | ||
this.log = Object.assign({ | ||
@@ -54,3 +51,3 @@ debug: () => { }, | ||
// (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance | ||
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred. | ||
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. | ||
// (2) If only `options.auth` is set, use the default token authentication strategy. | ||
@@ -57,0 +54,0 @@ // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. |
{ | ||
"name": "@octokit/core", | ||
"description": "Extendable client for GitHub's REST & GraphQL APIs", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"license": "MIT", | ||
@@ -48,3 +48,3 @@ "files": [ | ||
"ts-jest": "^26.1.3", | ||
"typescript": "^3.5.3" | ||
"typescript": "^4.0.2" | ||
}, | ||
@@ -51,0 +51,0 @@ "publishConfig": { |
@@ -35,7 +35,7 @@ # core.js | ||
</th><td width=100%> | ||
Load <code>@octokit/core</code> directly from <a href="https://cdn.pika.dev">cdn.pika.dev</a> | ||
Load <code>@octokit/core</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a> | ||
```html | ||
<script type="module"> | ||
import { Octokit } from "https://cdn.pika.dev/@octokit/core"; | ||
import { Octokit } from "https://cdn.skypack.dev/@octokit/core"; | ||
</script> | ||
@@ -118,3 +118,3 @@ ``` | ||
<td> | ||
Defaults to <a href="https://github.com/octokit/auth-token.js#readme"><code>@octokit/auth-token</code></a>. See <a href="authentication">Authentication</a> below for examples. | ||
Defaults to <a href="https://github.com/octokit/auth-token.js#readme"><code>@octokit/auth-token</code></a>. See <a href="#authentication">Authentication</a> below for examples. | ||
</td> | ||
@@ -130,3 +130,3 @@ </tr> | ||
<td> | ||
See <a href="authentication">Authentication</a> below for examples. | ||
See <a href="#authentication">Authentication</a> below for examples. | ||
</td> | ||
@@ -133,0 +133,0 @@ </tr> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47043
408