Skip to content

Commit 5d63fd0

Browse files
author
Artem Shteltser
committed
Remove renamings
1 parent 39ad05b commit 5d63fd0

File tree

9 files changed

+15
-21
lines changed

9 files changed

+15
-21
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const bitbucket = new Bitbucket(clientOptions)
149149
const clientOptions = {
150150
authStrategy: 'OAuth',
151151
auth: {
152-
grant_type: 'urn:bitbucket:oauth2:jwt',
152+
grant_type: 'bitbucketCloudJWTGrant',
153153
jwt_token: 'jwt_token',
154154
},
155155
}

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"build:core": "bili",
3030
"prebuild:plugins": "rimraf lib/plugins/*.js lib/plugins/*.js.map",
3131
"build:plugins": "npm-run-all -s build:plugin:*",
32-
"build:plugin:authenticate": "cross-env PLUGIN=auth bili",
32+
"build:plugin:auth": "cross-env PLUGIN=auth bili",
3333
"predocs:build": "mkdirp docs && rimraf docs/*",
3434
"docs:build": "npm run generate:api-docs",
3535
"postdocs:build": "apidoc -i docs -o docs",
@@ -48,7 +48,7 @@
4848
"validate:types:bitbucket": "tsc --noEmit lib/bitbucket.d.ts",
4949
"validate:types:index": "tsc --noEmit lib/index.d.ts",
5050
"validate:types:minimal": "tsc --noEmit lib/minimal.d.ts",
51-
"validate:types:plugin:authenticate": "tsc --noEmit lib/plugins/authenticate.d.ts",
51+
"validate:types:plugin:auth": "tsc --noEmit lib/plugins/auth.d.ts",
5252
"test": "jest"
5353
},
5454
"dependencies": {

Diff for: src/client/constructor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { request } from '../request'
33
import { getEndpointOptions } from './get-endpoint-options'
44

55
type APIClient = import('./types').APIClient
6-
type BitbucketOptions = import('./types').BitbucketOptions
6+
type Options = import('./types').Options
77
type Plugin = import('./types').Plugin
88
type RequestHook = import('./types').RequestHook
99

1010
export function constructor(
1111
plugins: Plugin[],
12-
clientOptions: BitbucketOptions = {}
12+
clientOptions: Options = {}
1313
): APIClient {
1414
const requestHook: RequestHook = new Singular()
1515
const requestDefaults = getEndpointOptions(clientOptions, requestHook)

Diff for: src/client/get-endpoint-options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { lowerCaseHeaderFields } from '../utils/lower-case-header-fields'
44
import { pick } from './utils/pick'
55

66
type EndpointParams = import('./types').EndpointParams
7-
type Options = import('./types').BitbucketOptions
7+
type Options = import('./types').Options
88
type RequestHook = import('./types').RequestHook
99

1010
export function getEndpointOptions(

Diff for: src/client/types.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ type HTTPError = import('../error/types').HTTPError
55
type Request = import('../request/types').Request
66
type Response<T> = import('../request/types').Response<T>
77

8-
export interface BitbucketOptions {
9-
type?: any
8+
export interface Options {
109
auth?: any
1110
authStrategy?: string
1211
baseUrl?: string
@@ -23,11 +22,11 @@ export interface APIClient {
2322
[key: string]: any
2423
}
2524

26-
export type Plugin = (client: APIClient, options: BitbucketOptions) => void
25+
export type Plugin = (client: APIClient, options: Options) => void
2726

2827
export interface APIClientFactory {
29-
new (options?: BitbucketOptions): APIClient
30-
(options?: BitbucketOptions): APIClient
28+
new (options?: Options): APIClient
29+
(options?: Options): APIClient
3130

3231
plugins(plugins: Plugin[]): APIClientFactory
3332
}

Diff for: src/plugins/auth/OAuth/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type APIClient = import('../../../client/types').APIClient
2-
export type Options = import('../../../client/types').BitbucketOptions
2+
export type Options = import('../../../client/types').Options
33
export type RequestOptions = import('../../../endpoint/types').RequestOptions
44
export type AuthOptions = import('../types').OAuthOptions
55

Diff for: src/plugins/auth/basicAuth/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type APIClient = import('../../../client/types').APIClient
2-
export type Options = import('../../../client/types').BitbucketOptions
2+
export type Options = import('../../../client/types').Options
33
export type RequestOptions = import('../../../endpoint/types').RequestOptions
44

55
type AuthHeaders = {

Diff for: src/plugins/auth/index.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@ type APIClient = import('./types').APIClient
77
type Options = import('./types').Options
88

99
const routes = getOAuthRoutes(oAuth2Spec)
10-
function authenticatePlugin(client: APIClient, clientOptions: Options): void {
10+
function authPlugin(client: APIClient, clientOptions: Options): void {
1111
client.registerEndpoints({ oauth: routes.getToken })
1212

13-
// (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
14-
// is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.
15-
// (2) If only `options.auth` is set, use the default token authentication strategy.
16-
// (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.
17-
1813
if (!clientOptions.auth) return
1914
switch (clientOptions.authStrategy) {
2015
case 'OAuth':
@@ -27,4 +22,4 @@ function authenticatePlugin(client: APIClient, clientOptions: Options): void {
2722
}
2823
}
2924

30-
export default authenticatePlugin
25+
export default authPlugin

Diff for: src/plugins/auth/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type APIClient = import('../../client/types').APIClient
2-
export type Options = import('../../client/types').BitbucketOptions
2+
export type Options = import('../../client/types').Options
33
export type RequestOptions = import('../../endpoint/types').RequestOptions
44

55
export type AuthBasic = {

0 commit comments

Comments
 (0)