Skip to content

Commit d38e53a

Browse files
author
Artem Shteltser
committed
Remove renamings
1 parent a8418aa commit d38e53a

File tree

8 files changed

+11
-16
lines changed

8 files changed

+11
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
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
}

src/client/constructor.ts

Lines changed: 2 additions & 2 deletions
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)

src/client/get-endpoint-options.ts

Lines changed: 1 addition & 1 deletion
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(

src/client/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +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 {
8+
export interface Options {
99
type?: any
1010
auth?: any
1111
authStrategy?: string
@@ -23,11 +23,11 @@ export interface APIClient {
2323
[key: string]: any
2424
}
2525

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

2828
export interface APIClientFactory {
29-
new (options?: BitbucketOptions): APIClient
30-
(options?: BitbucketOptions): APIClient
29+
new (options?: Options): APIClient
30+
(options?: Options): APIClient
3131

3232
plugins(plugins: Plugin[]): APIClientFactory
3333
}

src/plugins/auth/OAuth/types.ts

Lines changed: 1 addition & 1 deletion
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

src/plugins/auth/basicAuth/types.ts

Lines changed: 1 addition & 1 deletion
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 = {

src/plugins/auth/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ const routes = getOAuthRoutes(oAuth2Spec)
1010
function authenticatePlugin(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':

src/plugins/auth/types.ts

Lines changed: 1 addition & 1 deletion
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)