@microsoft/teams-js 2.57.0-beta.0 → 2.58.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.56.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.58.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.56.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-ftygCQXhLMbuUBdLMhfAnIFTGb2SAYYAPD9iyq2LRkbWpKkEifAGD+qPVcPgthO2"
48
+ src="https://res.cdn.office.net/teams-js/2.58.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-sMo/EOqQPa1OCup2/VBRum7oFeOS22kvs8WGDc45xK53tUVZzFR5WwFYDUYN1LO4"
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.56.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.58.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -98,7 +98,9 @@ interface IRuntimeV4 extends IBaseRuntime {
98
98
  };
99
99
  readonly shortcutRelay?: {};
100
100
  readonly stageView?: {
101
- readonly self?: {};
101
+ readonly self?: {
102
+ readonly closeResult?: {};
103
+ };
102
104
  };
103
105
  readonly store?: {};
104
106
  readonly teams?: {
@@ -6,12 +6,17 @@
6
6
  */
7
7
  /**
8
8
  * Closes the current stage view. This function will be a no-op if called from outside of a stage view.
9
+ * @param result - Optional opaque serialized result passed to the host when closing.
10
+ * An empty string is a result. Requires the host to advertise `stageView.self.closeResult` support;
11
+ * otherwise the request is rejected without closing. The SDK does not interpret the result.
9
12
  * @returns Promise that resolves or rejects with an error once the stage view is closed.
13
+ * The promise acknowledges closing; it does not return the result to the closing application.
14
+ * This does not add a result callback to `stageView.open()`.
10
15
  *
11
16
  * @beta
12
17
  * @throws Error if stageView.self.close is not supported in the current context or if `app.initialize()` has not resolved successfully.
13
18
  */
14
- export declare function close(): Promise<void>;
19
+ export declare function close(result?: string): Promise<void>;
15
20
  /**
16
21
  * Checks if stageView.self capability is supported by the host
17
22
  * @beta
@@ -21,3 +26,11 @@ export declare function close(): Promise<void>;
21
26
  *
22
27
  */
23
28
  export declare function isSupported(): boolean;
29
+ /**
30
+ * Checks whether the host supports passing a result when closing a stage view.
31
+ *
32
+ * @beta
33
+ * @returns true if the host supports Stage close results; otherwise false.
34
+ * @throws Error if {@linkcode app.initialize} has not successfully completed.
35
+ */
36
+ export declare function isCloseResultSupported(): boolean;
@@ -1 +1 @@
1
- var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","admin.microsoft.com","m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"],c={validOrigins:o};export{c as default,o as validOrigins};
1
+ var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate.office.com","copilot-connectors.core.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","cr.m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.usgovcloud.microsoft","cr.m365copilotapp.svc.usgovcloud.microsoft","dod.m365copilotapp.svc.usgovcloud.microsoft","cr.dod.m365copilotapp.svc.usgovcloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","admin.microsoft.com","m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"],c={validOrigins:o};export{c as default,o as validOrigins};
@@ -1 +1 @@
1
- import{sendAndHandleSdkError as t}from"../../internal/communication.js";import{ensureInitialized as e}from"../../internal/internalAPIs.js";import{getApiVersionTag as o}from"../../internal/telemetry.js";import{FrameContexts as r,errorNotSupportedOnPlatform as n}from"../constants.js";import{runtime as i}from"../runtime.js";function s(){return new Promise(s=>{if(e(i,r.content),!m())throw n;s(t(o("v2","stageView.self.close"),"stageView.self.close"))})}function m(){var t;return e(i)&&void 0!==(null===(t=i.supports.stageView)||void 0===t?void 0:t.self)}export{s as close,m as isSupported};
1
+ import{sendAndHandleSdkError as e}from"../../internal/communication.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{getApiVersionTag as t}from"../../internal/telemetry.js";import{FrameContexts as i,errorNotSupportedOnPlatform as r}from"../constants.js";import{runtime as s}from"../runtime.js";function n(n){return new Promise(m=>{if(o(s,i.content),!l()||void 0!==n&&!f())throw r;if(void 0!==n&&"string"!=typeof n)throw new Error("[stageView.self.close] Result must be a string");m(e(t("v2","stageView.self.close"),"stageView.self.close",...void 0===n?[]:[n]))})}function l(){var e;return o(s)&&void 0!==(null===(e=s.supports.stageView)||void 0===e?void 0:e.self)}function f(){var e,t;return o(s)&&!!(null===(t=null===(e=s.supports.stageView)||void 0===e?void 0:e.self)||void 0===t?void 0:t.closeResult)}export{n as close,f as isCloseResultSupported,l as isSupported};
@@ -1 +1 @@
1
- const t="2.57.0-beta.0";export{t as version};
1
+ const o="2.58.0";export{o as version};
@@ -1979,6 +1979,7 @@ var self_namespaceObject = {};
1979
1979
  __webpack_require__.r(self_namespaceObject);
1980
1980
  __webpack_require__.d(self_namespaceObject, {
1981
1981
  close: () => (self_close),
1982
+ isCloseResultSupported: () => (isCloseResultSupported),
1982
1983
  isSupported: () => (self_isSupported)
1983
1984
  });
1984
1985
 
@@ -2338,7 +2339,7 @@ var ClipboardSupportedMimeType;
2338
2339
  })(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
2339
2340
 
2340
2341
  ;// ./src/artifactsForCDN/validDomains.json
2341
- const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","admin.microsoft.com","m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"]}');
2342
+ const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate.office.com","copilot-connectors.core.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","cr.m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.usgovcloud.microsoft","cr.m365copilotapp.svc.usgovcloud.microsoft","dod.m365copilotapp.svc.usgovcloud.microsoft","cr.dod.m365copilotapp.svc.usgovcloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","admin.microsoft.com","m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"]}');
2342
2343
  var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
2343
2344
  ;// ./src/internal/constants.ts
2344
2345
 
@@ -4707,7 +4708,7 @@ function isSerializable(arg) {
4707
4708
  * @hidden
4708
4709
  * Package version.
4709
4710
  */
4710
- const version = "2.57.0-beta.0";
4711
+ const version = "2.58.0";
4711
4712
 
4712
4713
  ;// ./src/public/featureFlags.ts
4713
4714
  // 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.
@@ -18732,18 +18733,26 @@ function sharing_isSupported() {
18732
18733
  const stageViewTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
18733
18734
  /**
18734
18735
  * Closes the current stage view. This function will be a no-op if called from outside of a stage view.
18736
+ * @param result - Optional opaque serialized result passed to the host when closing.
18737
+ * An empty string is a result. Requires the host to advertise `stageView.self.closeResult` support;
18738
+ * otherwise the request is rejected without closing. The SDK does not interpret the result.
18735
18739
  * @returns Promise that resolves or rejects with an error once the stage view is closed.
18740
+ * The promise acknowledges closing; it does not return the result to the closing application.
18741
+ * This does not add a result callback to `stageView.open()`.
18736
18742
  *
18737
18743
  * @beta
18738
18744
  * @throws Error if stageView.self.close is not supported in the current context or if `app.initialize()` has not resolved successfully.
18739
18745
  */
18740
- function self_close() {
18746
+ function self_close(result) {
18741
18747
  return new Promise((resolve) => {
18742
18748
  ensureInitialized(runtime, FrameContexts.content);
18743
- if (!self_isSupported()) {
18749
+ if (!self_isSupported() || (result !== undefined && !isCloseResultSupported())) {
18744
18750
  throw errorNotSupportedOnPlatform;
18745
18751
  }
18746
- resolve(sendAndHandleSdkError(getApiVersionTag(stageViewTelemetryVersionNumber, "stageView.self.close" /* ApiName.StageView_Self_Close */), 'stageView.self.close'));
18752
+ if (result !== undefined && typeof result !== 'string') {
18753
+ throw new Error('[stageView.self.close] Result must be a string');
18754
+ }
18755
+ resolve(sendAndHandleSdkError(getApiVersionTag(stageViewTelemetryVersionNumber, "stageView.self.close" /* ApiName.StageView_Self_Close */), 'stageView.self.close', ...(result === undefined ? [] : [result])));
18747
18756
  });
18748
18757
  }
18749
18758
  /**
@@ -18758,6 +18767,17 @@ function self_isSupported() {
18758
18767
  var _a;
18759
18768
  return ensureInitialized(runtime) && ((_a = runtime.supports.stageView) === null || _a === void 0 ? void 0 : _a.self) !== undefined;
18760
18769
  }
18770
+ /**
18771
+ * Checks whether the host supports passing a result when closing a stage view.
18772
+ *
18773
+ * @beta
18774
+ * @returns true if the host supports Stage close results; otherwise false.
18775
+ * @throws Error if {@linkcode app.initialize} has not successfully completed.
18776
+ */
18777
+ function isCloseResultSupported() {
18778
+ var _a, _b;
18779
+ return ensureInitialized(runtime) && !!((_b = (_a = runtime.supports.stageView) === null || _a === void 0 ? void 0 : _a.self) === null || _b === void 0 ? void 0 : _b.closeResult);
18780
+ }
18761
18781
 
18762
18782
  ;// ./src/public/stageView/stageView.ts
18763
18783
  /**