@depup/octokit__core 7.0.6-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/changes.json +18 -0
- package/dist-src/index.js +141 -0
- package/dist-src/version.js +4 -0
- package/dist-types/index.d.ts +31 -0
- package/dist-types/types.d.ts +49 -0
- package/dist-types/version.d.ts +1 -0
- package/package.json +90 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Octokit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @depup/octokit__core
|
|
2
|
+
|
|
3
|
+
> Dependency-bumped version of [@octokit/core](https://www.npmjs.com/package/@octokit/core)
|
|
4
|
+
|
|
5
|
+
Generated by [DepUp](https://github.com/depup/npm) -- all production
|
|
6
|
+
dependencies bumped to latest versions.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @depup/octokit__core
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
| Field | Value |
|
|
15
|
+
|-------|-------|
|
|
16
|
+
| Original | [@octokit/core](https://www.npmjs.com/package/@octokit/core) @ 7.0.6 |
|
|
17
|
+
| Processed | 2026-03-17 |
|
|
18
|
+
| Smoke test | passed |
|
|
19
|
+
| Deps updated | 3 |
|
|
20
|
+
|
|
21
|
+
## Dependency Changes
|
|
22
|
+
|
|
23
|
+
| Dependency | From | To |
|
|
24
|
+
|------------|------|-----|
|
|
25
|
+
| @octokit/request | ^10.0.6 | ^10.0.8 |
|
|
26
|
+
| @octokit/request-error | ^7.0.2 | ^7.1.0 |
|
|
27
|
+
| universal-user-agent | ^7.0.0 | ^7.0.3 |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/@octokit/core
|
|
32
|
+
|
|
33
|
+
License inherited from the original package.
|
package/changes.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bumped": {
|
|
3
|
+
"@octokit/request": {
|
|
4
|
+
"from": "^10.0.6",
|
|
5
|
+
"to": "^10.0.8"
|
|
6
|
+
},
|
|
7
|
+
"@octokit/request-error": {
|
|
8
|
+
"from": "^7.0.2",
|
|
9
|
+
"to": "^7.1.0"
|
|
10
|
+
},
|
|
11
|
+
"universal-user-agent": {
|
|
12
|
+
"from": "^7.0.0",
|
|
13
|
+
"to": "^7.0.3"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"timestamp": "2026-03-17T16:33:28.065Z",
|
|
17
|
+
"totalUpdated": 3
|
|
18
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { getUserAgent } from "universal-user-agent";
|
|
2
|
+
import Hook from "before-after-hook";
|
|
3
|
+
import { request } from "@octokit/request";
|
|
4
|
+
import { withCustomRequest } from "@octokit/graphql";
|
|
5
|
+
import { createTokenAuth } from "@octokit/auth-token";
|
|
6
|
+
import { VERSION } from "./version.js";
|
|
7
|
+
const noop = () => {
|
|
8
|
+
};
|
|
9
|
+
const consoleWarn = console.warn.bind(console);
|
|
10
|
+
const consoleError = console.error.bind(console);
|
|
11
|
+
function createLogger(logger = {}) {
|
|
12
|
+
if (typeof logger.debug !== "function") {
|
|
13
|
+
logger.debug = noop;
|
|
14
|
+
}
|
|
15
|
+
if (typeof logger.info !== "function") {
|
|
16
|
+
logger.info = noop;
|
|
17
|
+
}
|
|
18
|
+
if (typeof logger.warn !== "function") {
|
|
19
|
+
logger.warn = consoleWarn;
|
|
20
|
+
}
|
|
21
|
+
if (typeof logger.error !== "function") {
|
|
22
|
+
logger.error = consoleError;
|
|
23
|
+
}
|
|
24
|
+
return logger;
|
|
25
|
+
}
|
|
26
|
+
const userAgentTrail = `octokit-core.js/${VERSION} ${getUserAgent()}`;
|
|
27
|
+
class Octokit {
|
|
28
|
+
static VERSION = VERSION;
|
|
29
|
+
static defaults(defaults) {
|
|
30
|
+
const OctokitWithDefaults = class extends this {
|
|
31
|
+
constructor(...args) {
|
|
32
|
+
const options = args[0] || {};
|
|
33
|
+
if (typeof defaults === "function") {
|
|
34
|
+
super(defaults(options));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
super(
|
|
38
|
+
Object.assign(
|
|
39
|
+
{},
|
|
40
|
+
defaults,
|
|
41
|
+
options,
|
|
42
|
+
options.userAgent && defaults.userAgent ? {
|
|
43
|
+
userAgent: `${options.userAgent} ${defaults.userAgent}`
|
|
44
|
+
} : null
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return OctokitWithDefaults;
|
|
50
|
+
}
|
|
51
|
+
static plugins = [];
|
|
52
|
+
/**
|
|
53
|
+
* Attach a plugin (or many) to your Octokit instance.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
|
|
57
|
+
*/
|
|
58
|
+
static plugin(...newPlugins) {
|
|
59
|
+
const currentPlugins = this.plugins;
|
|
60
|
+
const NewOctokit = class extends this {
|
|
61
|
+
static plugins = currentPlugins.concat(
|
|
62
|
+
newPlugins.filter((plugin) => !currentPlugins.includes(plugin))
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
return NewOctokit;
|
|
66
|
+
}
|
|
67
|
+
constructor(options = {}) {
|
|
68
|
+
const hook = new Hook.Collection();
|
|
69
|
+
const requestDefaults = {
|
|
70
|
+
baseUrl: request.endpoint.DEFAULTS.baseUrl,
|
|
71
|
+
headers: {},
|
|
72
|
+
request: Object.assign({}, options.request, {
|
|
73
|
+
// @ts-ignore internal usage only, no need to type
|
|
74
|
+
hook: hook.bind(null, "request")
|
|
75
|
+
}),
|
|
76
|
+
mediaType: {
|
|
77
|
+
previews: [],
|
|
78
|
+
format: ""
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail;
|
|
82
|
+
if (options.baseUrl) {
|
|
83
|
+
requestDefaults.baseUrl = options.baseUrl;
|
|
84
|
+
}
|
|
85
|
+
if (options.previews) {
|
|
86
|
+
requestDefaults.mediaType.previews = options.previews;
|
|
87
|
+
}
|
|
88
|
+
if (options.timeZone) {
|
|
89
|
+
requestDefaults.headers["time-zone"] = options.timeZone;
|
|
90
|
+
}
|
|
91
|
+
this.request = request.defaults(requestDefaults);
|
|
92
|
+
this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
|
|
93
|
+
this.log = createLogger(options.log);
|
|
94
|
+
this.hook = hook;
|
|
95
|
+
if (!options.authStrategy) {
|
|
96
|
+
if (!options.auth) {
|
|
97
|
+
this.auth = async () => ({
|
|
98
|
+
type: "unauthenticated"
|
|
99
|
+
});
|
|
100
|
+
} else {
|
|
101
|
+
const auth = createTokenAuth(options.auth);
|
|
102
|
+
hook.wrap("request", auth.hook);
|
|
103
|
+
this.auth = auth;
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
const { authStrategy, ...otherOptions } = options;
|
|
107
|
+
const auth = authStrategy(
|
|
108
|
+
Object.assign(
|
|
109
|
+
{
|
|
110
|
+
request: this.request,
|
|
111
|
+
log: this.log,
|
|
112
|
+
// we pass the current octokit instance as well as its constructor options
|
|
113
|
+
// to allow for authentication strategies that return a new octokit instance
|
|
114
|
+
// that shares the same internal state as the current one. The original
|
|
115
|
+
// requirement for this was the "event-octokit" authentication strategy
|
|
116
|
+
// of https://github.com/probot/octokit-auth-probot.
|
|
117
|
+
octokit: this,
|
|
118
|
+
octokitOptions: otherOptions
|
|
119
|
+
},
|
|
120
|
+
options.auth
|
|
121
|
+
)
|
|
122
|
+
);
|
|
123
|
+
hook.wrap("request", auth.hook);
|
|
124
|
+
this.auth = auth;
|
|
125
|
+
}
|
|
126
|
+
const classConstructor = this.constructor;
|
|
127
|
+
for (let i = 0; i < classConstructor.plugins.length; ++i) {
|
|
128
|
+
Object.assign(this, classConstructor.plugins[i](this, options));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// assigned during constructor
|
|
132
|
+
request;
|
|
133
|
+
graphql;
|
|
134
|
+
log;
|
|
135
|
+
hook;
|
|
136
|
+
// TODO: type `octokit.auth` based on passed options.authStrategy
|
|
137
|
+
auth;
|
|
138
|
+
}
|
|
139
|
+
export {
|
|
140
|
+
Octokit
|
|
141
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HookCollection } from "before-after-hook";
|
|
2
|
+
import { request } from "@octokit/request";
|
|
3
|
+
import { type graphql } from "@octokit/graphql";
|
|
4
|
+
import type { Constructor, Hooks, OctokitOptions, OctokitPlugin, ReturnTypeOf, UnionToIntersection } from "./types.js";
|
|
5
|
+
export type { OctokitOptions } from "./types.js";
|
|
6
|
+
export declare class Octokit {
|
|
7
|
+
static VERSION: string;
|
|
8
|
+
static defaults<S extends Constructor<any>>(this: S, defaults: OctokitOptions | Function): typeof this;
|
|
9
|
+
static plugins: OctokitPlugin[];
|
|
10
|
+
/**
|
|
11
|
+
* Attach a plugin (or many) to your Octokit instance.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)
|
|
15
|
+
*/
|
|
16
|
+
static plugin<S extends Constructor<any> & {
|
|
17
|
+
plugins: any[];
|
|
18
|
+
}, T extends OctokitPlugin[]>(this: S, ...newPlugins: T): typeof this & Constructor<UnionToIntersection<ReturnTypeOf<T>>>;
|
|
19
|
+
constructor(options?: OctokitOptions);
|
|
20
|
+
request: typeof request;
|
|
21
|
+
graphql: typeof graphql;
|
|
22
|
+
log: {
|
|
23
|
+
debug: (message: string, additionalInfo?: object) => any;
|
|
24
|
+
info: (message: string, additionalInfo?: object) => any;
|
|
25
|
+
warn: (message: string, additionalInfo?: object) => any;
|
|
26
|
+
error: (message: string, additionalInfo?: object) => any;
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
};
|
|
29
|
+
hook: HookCollection<Hooks>;
|
|
30
|
+
auth: (...args: unknown[]) => Promise<unknown>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type * as OctokitTypes from "@octokit/types";
|
|
2
|
+
import type { RequestError } from "@octokit/request-error";
|
|
3
|
+
import type { Octokit } from "./index.js";
|
|
4
|
+
export type RequestParameters = OctokitTypes.RequestParameters;
|
|
5
|
+
export interface OctokitOptions {
|
|
6
|
+
authStrategy?: any;
|
|
7
|
+
auth?: any;
|
|
8
|
+
userAgent?: string;
|
|
9
|
+
previews?: string[];
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
log?: {
|
|
12
|
+
debug: (message: string) => unknown;
|
|
13
|
+
info: (message: string) => unknown;
|
|
14
|
+
warn: (message: string) => unknown;
|
|
15
|
+
error: (message: string) => unknown;
|
|
16
|
+
};
|
|
17
|
+
request?: OctokitTypes.RequestRequestOptions;
|
|
18
|
+
timeZone?: string;
|
|
19
|
+
[option: string]: any;
|
|
20
|
+
}
|
|
21
|
+
export type Constructor<T> = new (...args: any[]) => T;
|
|
22
|
+
export type ReturnTypeOf<T extends AnyFunction | AnyFunction[]> = T extends AnyFunction ? ReturnType<T> : T extends AnyFunction[] ? UnionToIntersection<Exclude<ReturnType<T[number]>, void>> : never;
|
|
23
|
+
/**
|
|
24
|
+
* @author https://stackoverflow.com/users/2887218/jcalz
|
|
25
|
+
* @see https://stackoverflow.com/a/50375286/10325032
|
|
26
|
+
*/
|
|
27
|
+
export type UnionToIntersection<Union> = (Union extends any ? (argument: Union) => void : never) extends (argument: infer Intersection) => void ? Intersection : never;
|
|
28
|
+
type AnyFunction = (...args: any) => any;
|
|
29
|
+
export type OctokitPlugin = (octokit: Octokit, options: OctokitOptions) => {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
} | void;
|
|
32
|
+
export type Hooks = {
|
|
33
|
+
request: {
|
|
34
|
+
Options: Required<OctokitTypes.EndpointDefaults>;
|
|
35
|
+
Result: OctokitTypes.OctokitResponse<any>;
|
|
36
|
+
Error: RequestError | Error;
|
|
37
|
+
};
|
|
38
|
+
[key: string]: {
|
|
39
|
+
Options: unknown;
|
|
40
|
+
Result: unknown;
|
|
41
|
+
Error: unknown;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export type StrictOmit<T, K extends keyof T> = {
|
|
45
|
+
[P in keyof T as P extends K ? never : P]: T[P];
|
|
46
|
+
} & {
|
|
47
|
+
[parameter: string]: unknown;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "7.0.6";
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@depup/octokit__core",
|
|
3
|
+
"version": "7.0.6-depup.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "[DepUp] Extendable client for GitHub's REST & GraphQL APIs",
|
|
6
|
+
"repository": "github:octokit/core.js",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"depup",
|
|
9
|
+
"dependency-bumped",
|
|
10
|
+
"updated-deps",
|
|
11
|
+
"@octokit/core",
|
|
12
|
+
"octokit",
|
|
13
|
+
"github",
|
|
14
|
+
"api",
|
|
15
|
+
"sdk",
|
|
16
|
+
"toolkit"
|
|
17
|
+
],
|
|
18
|
+
"author": "Gregor Martynus (https://github.com/gr2m)",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@octokit/auth-token": "^6.0.0",
|
|
22
|
+
"@octokit/graphql": "^9.0.3",
|
|
23
|
+
"@octokit/request": "^10.0.8",
|
|
24
|
+
"@octokit/request-error": "^7.1.0",
|
|
25
|
+
"@octokit/types": "^16.0.0",
|
|
26
|
+
"before-after-hook": "^4.0.0",
|
|
27
|
+
"universal-user-agent": "^7.0.3"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@octokit/auth-action": "^6.0.1",
|
|
31
|
+
"@octokit/auth-app": "^8.0.0",
|
|
32
|
+
"@octokit/auth-oauth-app": "^9.0.0",
|
|
33
|
+
"@octokit/tsconfig": "^4.0.0",
|
|
34
|
+
"@sinonjs/fake-timers": "^15.0.0",
|
|
35
|
+
"@types/lolex": "^5.1.0",
|
|
36
|
+
"@types/node": "^22.0.0",
|
|
37
|
+
"@types/sinonjs__fake-timers": "^15.0.0",
|
|
38
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
39
|
+
"esbuild": "^0.25.0",
|
|
40
|
+
"fetch-mock": "^12.0.0",
|
|
41
|
+
"prettier": "3.6.2",
|
|
42
|
+
"proxy": "^2.0.0",
|
|
43
|
+
"semantic-release-plugin-update-version-in-files": "^2.0.0",
|
|
44
|
+
"typescript": "^5.0.0",
|
|
45
|
+
"undici": "^7.0.0",
|
|
46
|
+
"vitest": "^3.0.5"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">= 20"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"dist-*/**",
|
|
53
|
+
"bin/**",
|
|
54
|
+
"changes.json",
|
|
55
|
+
"README.md"
|
|
56
|
+
],
|
|
57
|
+
"types": "./dist-types/index.d.ts",
|
|
58
|
+
"exports": {
|
|
59
|
+
".": {
|
|
60
|
+
"types": "./dist-types/index.d.ts",
|
|
61
|
+
"import": "./dist-src/index.js",
|
|
62
|
+
"default": "./dist-src/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./types": {
|
|
65
|
+
"types": "./dist-types/types.d.ts"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"sideEffects": false,
|
|
69
|
+
"depup": {
|
|
70
|
+
"changes": {
|
|
71
|
+
"@octokit/request": {
|
|
72
|
+
"from": "^10.0.6",
|
|
73
|
+
"to": "^10.0.8"
|
|
74
|
+
},
|
|
75
|
+
"@octokit/request-error": {
|
|
76
|
+
"from": "^7.0.2",
|
|
77
|
+
"to": "^7.1.0"
|
|
78
|
+
},
|
|
79
|
+
"universal-user-agent": {
|
|
80
|
+
"from": "^7.0.0",
|
|
81
|
+
"to": "^7.0.3"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"depsUpdated": 3,
|
|
85
|
+
"originalPackage": "@octokit/core",
|
|
86
|
+
"originalVersion": "7.0.6",
|
|
87
|
+
"processedAt": "2026-03-17T16:33:34.086Z",
|
|
88
|
+
"smokeTest": "passed"
|
|
89
|
+
}
|
|
90
|
+
}
|