File tree Expand file tree Collapse file tree 8 files changed +11
-16
lines changed Expand file tree Collapse file tree 8 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ const bitbucket = new Bitbucket(clientOptions)
149149const clientOptions = {
150150 authStrategy: ' OAuth' ,
151151 auth: {
152- grant_type: ' urn:bitbucket:oauth2:jwt ' ,
152+ grant_type: ' bitbucketCloudJWTGrant ' ,
153153 jwt_token: ' jwt_token' ,
154154 },
155155}
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ import { request } from '../request'
33import { getEndpointOptions } from './get-endpoint-options'
44
55type APIClient = import ( './types' ) . APIClient
6- type BitbucketOptions = import ( './types' ) . BitbucketOptions
6+ type Options = import ( './types' ) . Options
77type Plugin = import ( './types' ) . Plugin
88type RequestHook = import ( './types' ) . RequestHook
99
1010export 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 )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { lowerCaseHeaderFields } from '../utils/lower-case-header-fields'
44import { pick } from './utils/pick'
55
66type EndpointParams = import ( './types' ) . EndpointParams
7- type Options = import ( './types' ) . BitbucketOptions
7+ type Options = import ( './types' ) . Options
88type RequestHook = import ( './types' ) . RequestHook
99
1010export function getEndpointOptions (
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ type HTTPError = import('../error/types').HTTPError
55type Request = import ( '../request/types' ) . Request
66type 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
2828export 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}
Original file line number Diff line number Diff line change 11export type APIClient = import ( '../../../client/types' ) . APIClient
2- export type Options = import ( '../../../client/types' ) . BitbucketOptions
2+ export type Options = import ( '../../../client/types' ) . Options
33export type RequestOptions = import ( '../../../endpoint/types' ) . RequestOptions
44export type AuthOptions = import ( '../types' ) . OAuthOptions
55
Original file line number Diff line number Diff line change 11export type APIClient = import ( '../../../client/types' ) . APIClient
2- export type Options = import ( '../../../client/types' ) . BitbucketOptions
2+ export type Options = import ( '../../../client/types' ) . Options
33export type RequestOptions = import ( '../../../endpoint/types' ) . RequestOptions
44
55type AuthHeaders = {
Original file line number Diff line number Diff line change @@ -10,11 +10,6 @@ const routes = getOAuthRoutes(oAuth2Spec)
1010function 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' :
Original file line number Diff line number Diff line change 11export type APIClient = import ( '../../client/types' ) . APIClient
2- export type Options = import ( '../../client/types' ) . BitbucketOptions
2+ export type Options = import ( '../../client/types' ) . Options
33export type RequestOptions = import ( '../../endpoint/types' ) . RequestOptions
44
55export type AuthBasic = {
You can’t perform that action at this time.
0 commit comments