@microsoft/teams.api
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.api" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.api/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.api?activeTab=code" t
60 lines (57 loc) • 2.19 kB
text/typescript
import { Client, ClientOptions } from '@microsoft/teams.common';
import { CloudEnvironment } from '../../auth/cloud-environment.mjs';
import { TokenResponse } from '../../models/token/token-response.mjs';
import { TokenStatus } from '../../models/token/token-status.mjs';
import { TokenExchangeRequest } from '../../models/token-exchange/token-exchange-request.mjs';
import { ChannelID } from '../../models/channel-id.mjs';
import { ApiClientSettings } from '../api-client-settings.mjs';
import '../../auth/credentials.mjs';
import '../../models/agentic-identity.mjs';
type GetUserTokenParams = {
userId: string;
connectionName: string;
channelId?: ChannelID;
code?: string;
};
type GetUserAADTokenParams = {
userId: string;
connectionName: string;
resourceUrls: string[];
channelId: ChannelID;
};
type GetUserTokenStatusParams = {
userId: string;
channelId: ChannelID;
includeFilter: string;
};
type SignOutUserParams = {
userId: string;
connectionName: string;
channelId: ChannelID;
};
type ExchangeUserTokenParams = {
userId: string;
connectionName: string;
channelId: ChannelID;
exchangeRequest: TokenExchangeRequest;
};
declare const USER_TOKEN_ENDPOINTS: {
GET_TOKEN: string;
GET_AAD_TOKENS: string;
GET_STATUS: string;
SIGN_OUT: string;
EXCHANGE: string;
};
declare class UserTokenClient {
get http(): Client;
set http(v: Client);
protected _http: Client;
protected _apiClientSettings: Partial<ApiClientSettings>;
constructor(options?: Client | ClientOptions, apiClientSettings?: Partial<ApiClientSettings>, cloud?: CloudEnvironment);
get(params: GetUserTokenParams): Promise<TokenResponse>;
getAad(params: GetUserAADTokenParams): Promise<Record<string, TokenResponse>>;
getStatus(params: GetUserTokenStatusParams): Promise<TokenStatus[]>;
signOut(params: SignOutUserParams): Promise<void>;
exchange(params: ExchangeUserTokenParams): Promise<TokenResponse>;
}
export { type ExchangeUserTokenParams, type GetUserAADTokenParams, type GetUserTokenParams, type GetUserTokenStatusParams, type SignOutUserParams, USER_TOKEN_ENDPOINTS, UserTokenClient };