@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
74 lines (73 loc) • 3.43 kB
JavaScript
const PUBLIC = Object.freeze({
loginEndpoint: "https://login.microsoftonline.com",
loginTenant: "botframework.com",
botScope: "https://api.botframework.com/.default",
tokenServiceUrl: "https://token.botframework.com",
openIdMetadataUrl: "https://login.botframework.com/v1/.well-known/openidconfiguration",
tokenIssuer: "https://api.botframework.com",
graphScope: "https://graph.microsoft.com/.default",
agenticIdentityBotScope: "https://botapi.skype.com/.default"
});
const US_GOV = Object.freeze({
loginEndpoint: "https://login.microsoftonline.us",
loginTenant: "MicrosoftServices.onmicrosoft.us",
botScope: "https://api.botframework.us/.default",
tokenServiceUrl: "https://tokengcch.botframework.azure.us",
openIdMetadataUrl: "https://login.botframework.azure.us/v1/.well-known/openidconfiguration",
tokenIssuer: "https://api.botframework.us",
graphScope: "https://graph.microsoft.us/.default",
// TODO: Use the sovereign AgenticIdentity Bot API scope when one is available.
agenticIdentityBotScope: "https://botapi.skype.com/.default"
});
const US_GOV_DOD = Object.freeze({
loginEndpoint: "https://login.microsoftonline.us",
loginTenant: "MicrosoftServices.onmicrosoft.us",
botScope: "https://api.botframework.us/.default",
tokenServiceUrl: "https://apiDoD.botframework.azure.us",
openIdMetadataUrl: "https://login.botframework.azure.us/v1/.well-known/openidconfiguration",
tokenIssuer: "https://api.botframework.us",
graphScope: "https://dod-graph.microsoft.us/.default",
// TODO: Use the sovereign AgenticIdentity Bot API scope when one is available.
agenticIdentityBotScope: "https://botapi.skype.com/.default"
});
const CHINA = Object.freeze({
loginEndpoint: "https://login.partner.microsoftonline.cn",
loginTenant: "microsoftservices.partner.onmschina.cn",
botScope: "https://api.botframework.azure.cn/.default",
tokenServiceUrl: "https://token.botframework.azure.cn",
openIdMetadataUrl: "https://login.botframework.azure.cn/v1/.well-known/openidconfiguration",
tokenIssuer: "https://api.botframework.azure.cn",
graphScope: "https://microsoftgraph.chinacloudapi.cn/.default",
// TODO: Use the China cloud AgenticIdentity Bot API scope when one is available.
agenticIdentityBotScope: "https://botapi.skype.com/.default"
});
function withOverrides(base, overrides) {
return Object.freeze({
loginEndpoint: overrides.loginEndpoint ?? base.loginEndpoint,
loginTenant: overrides.loginTenant ?? base.loginTenant,
botScope: overrides.botScope ?? base.botScope,
tokenServiceUrl: overrides.tokenServiceUrl ?? base.tokenServiceUrl,
openIdMetadataUrl: overrides.openIdMetadataUrl ?? base.openIdMetadataUrl,
tokenIssuer: overrides.tokenIssuer ?? base.tokenIssuer,
graphScope: overrides.graphScope ?? base.graphScope,
agenticIdentityBotScope: overrides.agenticIdentityBotScope ?? base.agenticIdentityBotScope
});
}
const CLOUD_ENVIRONMENTS = {
public: PUBLIC,
usgov: US_GOV,
usgovdod: US_GOV_DOD,
china: CHINA
};
function cloudFromName(name) {
const env = CLOUD_ENVIRONMENTS[name.toLowerCase()];
if (!env) {
throw new Error(
`Unknown cloud environment: '${name}'. Valid values are: Public, USGov, USGovDoD, China.`
);
}
return env;
}
export { CHINA, PUBLIC, US_GOV, US_GOV_DOD, cloudFromName, withOverrides };
//# sourceMappingURL=cloud-environment.mjs.map
//# sourceMappingURL=cloud-environment.mjs.map