@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
35 lines • 1.62 kB
TypeScript
import { JwtPayload } from 'jsonwebtoken';
import { Service } from './environment-accessor-types';
import { ResilienceOptions } from './resilience-options';
import { ClientCredentialsResponse } from './xsuaa-service-types';
interface SubdomainAndZoneId {
subdomain: string | null;
zoneId: string | null;
}
/**
* Get subdomain and zoneId value from a given JWT.
* @param jwt - A JWT from the current user.
* @returns subdomain and zoneId from the JWT
* @hidden
*/
export declare function getSubdomainAndZoneId(jwt?: string | JwtPayload): SubdomainAndZoneId;
/**
* Make a user token request against the XSUAA service.
* @param service - Service as it is defined in the environment variable.
* @param userJwt - User JWT.
* @param options - Options to influence resilience behavior (see [[ResilienceOptions]]). By default, usage of a circuit breaker is enabled.
* @returns Client credentials token.
* @hidden
*/
export declare function getClientCredentialsToken(service: string | Service, userJwt?: string | JwtPayload, options?: ResilienceOptions): Promise<ClientCredentialsResponse>;
/**
* Make a user token request against the XSUAA service.
* @param service - Service as it is defined in the environment variable.
* @param userJwt - User JWT.
* @param options - Options to influence resilience behavior (see [[ResilienceOptions]]). By default, usage of a circuit breaker is enabled.
* @returns User token.
* @hidden
*/
export declare function getUserToken(service: Service, userJwt: string, options?: ResilienceOptions): Promise<string>;
export {};
//# sourceMappingURL=xsuaa-service.d.ts.map