/** Optional TLS options forwarded to the HTTPS token request. Defaults to strict cert validation; supply { rejectUnauthorized: false } only for self-hosted OAuth providers on private CAs. */
tls?:{
[key: string]:any;
}|undefined;
/** Service account client id (the JWT issuer), switches to the JWT bearer flow */
serviceClient?: string|undefined;
/** Lifetime of the service account JWT in seconds, defaults to 5 minutes, capped at an hour */
serviceRequestTimeout?: number|undefined;
/** OAuth2 scope for the service account flow, defaults to 'https://mail.google.com/' */
scope?: string|undefined;
/** Logger component name, defaults to 'OAuth2' */
component?: string|undefined;
/** Extra headers for the token request */
customHeaders?: OutgoingHttpHeaders|undefined;
/** Extra form fields for the token request */
customParams?:{
[key: string]:any;
}|undefined;
}
/**
* The object emitted with the 'token' event once a new access token has been generated
*/
exportinterfaceXOAuth2Token{
/** User e-mail address */
user?: string|undefined;
/** The new access token */
accessToken: string;
/** Expire time as a timestamp in milliseconds, 0 when unknown */
expires: number;
}
/**
* A getToken request waiting for an in-flight renewal to complete
* Usage for generating access tokens with a custom method using provisionCallback:
* provisionCallback(user, renew, callback)
* * user is the username to get the token for
* * renew is a boolean that if true indicates that existing token failed and needs to be renewed
* * callback is the callback to run with (error, accessToken [, expires])
* * accessToken is a string
* * expires is an optional expire time in milliseconds
* If provisionCallback is used, then Nodemailer does not try to attempt generating the token by itself
*
* @constructor
* @param options Client information for token generation
* @param options.user User e-mail address
* @param options.clientId Client ID value
* @param options.clientSecret Client secret value
* @param options.refreshToken Refresh token for an user
* @param options.accessUrl Endpoint for token generation, defaults to 'https://accounts.google.com/o/oauth2/token'
* @param options.accessToken An existing valid accessToken
* @param options.privateKey Private key for JSW
* @param options.expires Optional Access Token expire time in ms
* @param options.timeout Optional TTL for Access Token in seconds
* @param options.provisionCallback Function to run when a new access token is required
* @param options.tls Optional TLS options forwarded to the HTTPS token request. Defaults to strict cert validation; supply { rejectUnauthorized: false } only for self-hosted OAuth providers on private CAs.