1 | import * as stream from 'stream';
|
2 | import { JWTInput } from './credentials';
|
3 | import { GetTokenResponse, OAuth2Client, OAuth2ClientOptions } from './oauth2client';
|
4 | export declare const USER_REFRESH_ACCOUNT_TYPE = "authorized_user";
|
5 | export interface UserRefreshClientOptions extends OAuth2ClientOptions {
|
6 | clientId?: string;
|
7 | clientSecret?: string;
|
8 | refreshToken?: string;
|
9 | }
|
10 | export declare class UserRefreshClient extends OAuth2Client {
|
11 | _refreshToken?: string | null;
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | constructor(clientId?: string, clientSecret?: string, refreshToken?: string);
|
20 | constructor(options: UserRefreshClientOptions);
|
21 | constructor(clientId?: string, clientSecret?: string, refreshToken?: string);
|
22 | /**
|
23 | * Refreshes the access token.
|
24 | * @param refreshToken An ignored refreshToken..
|
25 | * @param callback Optional callback.
|
26 | */
|
27 | protected refreshTokenNoCache(refreshToken?: string | null): Promise<GetTokenResponse>;
|
28 | fetchIdToken(targetAudience: string): Promise<string>;
|
29 | /**
|
30 | * Create a UserRefreshClient credentials instance using the given input
|
31 | * options.
|
32 | * @param json The input object.
|
33 | */
|
34 | fromJSON(json: JWTInput): void;
|
35 | /**
|
36 | * Create a UserRefreshClient credentials instance using the given input
|
37 | * stream.
|
38 | * @param inputStream The input stream.
|
39 | * @param callback Optional callback.
|
40 | */
|
41 | fromStream(inputStream: stream.Readable): Promise<void>;
|
42 | fromStream(inputStream: stream.Readable, callback: (err?: Error) => void): void;
|
43 | private fromStreamAsync;
|
44 | /**
|
45 | * Create a UserRefreshClient credentials instance using the given input
|
46 | * options.
|
47 | * @param json The input object.
|
48 | */
|
49 | static fromJSON(json: JWTInput): UserRefreshClient;
|
50 | }
|