@microsoft/teams-js 2.36.0 → 2.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.36.0/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.37.0/js/MicrosoftTeams.min.js) or point your package manager at them.
28
28
 
29
29
  ## Usage
30
30
 
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
45
45
  ```html
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
- src="https://res.cdn.office.net/teams-js/2.36.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-Vg2zZJuta2CG1wHGm8f5belcapTREs0cxiGzaMgVWI/apjFxwHqOgYOon/OqPXP7"
48
+ src="https://res.cdn.office.net/teams-js/2.37.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-+OMQ/6mqZshXOsxUMXFX4gtF5cMsJTNH6ldUO3QThAsuQyv7R0ZpnpJmvrsPwzf4"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
53
53
  <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.36.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.37.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -18,12 +18,14 @@ import { AppEligibilityInformation } from '../../public/interfaces';
18
18
  */
19
19
  export declare function isSupported(): boolean;
20
20
  /**
21
+ *
22
+ * @param forceRefresh - boolean to represent whether to force refresh the eligibility information
23
+ * @returns the copilot eligibility information about the user
24
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
25
+ *
21
26
  * @hidden
22
27
  * @internal
23
28
  * Limited to Microsoft-internal use
24
29
  * @beta
25
- * @returns the copilot eligibility information about the user
26
- *
27
- * @throws Error if {@linkcode app.initialize} has not successfully completed
28
30
  */
29
- export declare function getEligibilityInfo(): Promise<AppEligibilityInformation>;
31
+ export declare function getEligibilityInfo(forceRefresh?: boolean): Promise<AppEligibilityInformation>;
@@ -1 +1 @@
1
- import{__awaiter as i}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndUnwrap as o}from"../../internal/communication.js";import{ensureInitialized as t}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as e}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as n}from"../../public/constants.js";import{isSdkError as l}from"../../public/interfaces.js";import{runtime as s}from"../../public/runtime.js";const a=r("copilot");function p(){var i,o;return t(s)&&(!!(null===(i=s.hostVersionsInfo)||void 0===i?void 0:i.appEligibilityInformation)||!!(null===(o=s.supports.copilot)||void 0===o?void 0:o.eligibility))}function u(){var r,u;return i(this,void 0,void 0,(function*(){if(t(s),!p())throw new Error(`Error code: ${n.errorCode}, message: Not supported on platform`);if(null===(r=s.hostVersionsInfo)||void 0===r?void 0:r.appEligibilityInformation)return a("Eligibility information is already available on runtime."),s.hostVersionsInfo.appEligibilityInformation;a("Eligibility information is not available on runtime. Requesting from host.");const i=yield o(e("v2","copilot.eligibility.getEligibilityInfo"),"copilot.eligibility.getEligibilityInfo");if(l(i))throw new Error(`Error code: ${i.errorCode}, message: ${null!==(u=i.message)&&void 0!==u?u:"Failed to get eligibility information from the host."}`);if(!function(i){if(void 0===i.ageGroup||void 0===i.cohort||void 0===i.userClassification||void 0===i.isCopilotEligible||void 0===i.isCopilotEnabledRegion||void 0===i.isOptedOutByAdmin||i.featureSet&&(void 0===i.featureSet.serverFeatures||void 0===i.featureSet.uxFeatures))return!1;return!0}(i))throw new Error("Error deserializing eligibility information");return i}))}export{u as getEligibilityInfo,p as isSupported};
1
+ import{__awaiter as i}from"../../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndUnwrap as o}from"../../internal/communication.js";import{ensureInitialized as t}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as e}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as n}from"../../public/constants.js";import{isSdkError as l}from"../../public/interfaces.js";import{runtime as s}from"../../public/runtime.js";const a=r("copilot");function p(){var i,o;return t(s)&&(!!(null===(i=s.hostVersionsInfo)||void 0===i?void 0:i.appEligibilityInformation)||!!(null===(o=s.supports.copilot)||void 0===o?void 0:o.eligibility))}function u(r){var u,m;return i(this,void 0,void 0,(function*(){if(t(s),!p())throw new Error(`Error code: ${n.errorCode}, message: Not supported on platform`);if((null===(u=s.hostVersionsInfo)||void 0===u?void 0:u.appEligibilityInformation)&&!r)return a("Eligibility information is already available on runtime."),s.hostVersionsInfo.appEligibilityInformation;a("Eligibility information is not available on runtime. Requesting from host.");const i=yield o(e("v2","copilot.eligibility.getEligibilityInfo"),"copilot.eligibility.getEligibilityInfo",r);if(l(i))throw new Error(`Error code: ${i.errorCode}, message: ${null!==(m=i.message)&&void 0!==m?m:"Failed to get eligibility information from the host."}`);if(!function(i){if(void 0===i.ageGroup||void 0===i.cohort||void 0===i.userClassification||void 0===i.isCopilotEligible||void 0===i.isCopilotEnabledRegion||void 0===i.isOptedOutByAdmin||i.featureSet&&(void 0===i.featureSet.serverFeatures||void 0===i.featureSet.uxFeatures))return!1;return!0}(i))throw new Error("Error deserializing eligibility information");return i}))}export{u as getEligibilityInfo,p as isSupported};
@@ -1 +1 @@
1
- const o="2.36.0";export{o as version};
1
+ const o="2.37.0";export{o as version};
@@ -4535,7 +4535,7 @@ function isSerializable(arg) {
4535
4535
  * @hidden
4536
4536
  * Package version.
4537
4537
  */
4538
- const version = "2.36.0";
4538
+ const version = "2.37.0";
4539
4539
 
4540
4540
  ;// ./src/public/featureFlags.ts
4541
4541
  // All build feature flags are defined inside this object. Any build feature flag must have its own unique getter and setter function. This pattern allows for client apps to treeshake unused code and avoid including code guarded by this feature flags in the final bundle. If this property isn't desired, use the below runtime feature flags object.
@@ -9307,15 +9307,17 @@ function eligibility_isSupported() {
9307
9307
  (!!((_a = runtime.hostVersionsInfo) === null || _a === void 0 ? void 0 : _a.appEligibilityInformation) || !!((_b = runtime.supports.copilot) === null || _b === void 0 ? void 0 : _b.eligibility)));
9308
9308
  }
9309
9309
  /**
9310
+ *
9311
+ * @param forceRefresh - boolean to represent whether to force refresh the eligibility information
9312
+ * @returns the copilot eligibility information about the user
9313
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
9314
+ *
9310
9315
  * @hidden
9311
9316
  * @internal
9312
9317
  * Limited to Microsoft-internal use
9313
9318
  * @beta
9314
- * @returns the copilot eligibility information about the user
9315
- *
9316
- * @throws Error if {@linkcode app.initialize} has not successfully completed
9317
9319
  */
9318
- function getEligibilityInfo() {
9320
+ function getEligibilityInfo(forceRefresh) {
9319
9321
  var _a, _b;
9320
9322
  return eligibility_awaiter(this, void 0, void 0, function* () {
9321
9323
  ensureInitialized(runtime);
@@ -9323,13 +9325,13 @@ function getEligibilityInfo() {
9323
9325
  throw new Error(`Error code: ${errorNotSupportedOnPlatform.errorCode}, message: Not supported on platform`);
9324
9326
  }
9325
9327
  // Return the eligibility information if it is already available
9326
- if ((_a = runtime.hostVersionsInfo) === null || _a === void 0 ? void 0 : _a.appEligibilityInformation) {
9328
+ if (((_a = runtime.hostVersionsInfo) === null || _a === void 0 ? void 0 : _a.appEligibilityInformation) && !forceRefresh) {
9327
9329
  eligibility_copilotLogger('Eligibility information is already available on runtime.');
9328
9330
  return runtime.hostVersionsInfo.appEligibilityInformation;
9329
9331
  }
9330
9332
  eligibility_copilotLogger('Eligibility information is not available on runtime. Requesting from host.');
9331
9333
  // Send message to host SDK to get eligibility information
9332
- const response = yield sendAndUnwrap(getApiVersionTag(eligibility_copilotTelemetryVersionNumber, "copilot.eligibility.getEligibilityInfo" /* ApiName.Copilot_Eligibility_GetEligibilityInfo */), "copilot.eligibility.getEligibilityInfo" /* ApiName.Copilot_Eligibility_GetEligibilityInfo */);
9334
+ const response = yield sendAndUnwrap(getApiVersionTag(eligibility_copilotTelemetryVersionNumber, "copilot.eligibility.getEligibilityInfo" /* ApiName.Copilot_Eligibility_GetEligibilityInfo */), "copilot.eligibility.getEligibilityInfo" /* ApiName.Copilot_Eligibility_GetEligibilityInfo */, forceRefresh);
9333
9335
  if (isSdkError(response)) {
9334
9336
  throw new Error(`Error code: ${response.errorCode}, message: ${(_b = response.message) !== null && _b !== void 0 ? _b : 'Failed to get eligibility information from the host.'}`);
9335
9337
  }