@microsoft/teams-js 2.33.0 → 2.34.0-beta.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/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +4 -1
- package/dist/esm/packages/teams-js/dts/private/store.d.ts +52 -47
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/private/store.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/umd/MicrosoftTeams.js +69 -69
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -50
@@ -300,7 +300,10 @@ export declare const enum ApiName {
|
|
300
300
|
Sharing_ShareWebContent = "sharing.shareWebContent",
|
301
301
|
StageView_Open = "stageView.open",
|
302
302
|
StageView_Self_Close = "stageView.self.close",
|
303
|
-
|
303
|
+
Store_OpenFullStore = "store.openFullStore",
|
304
|
+
Store_OpenAppDetail = "store.openAppDetail",
|
305
|
+
Store_OpenInContextStore = "store.openInContextStore",
|
306
|
+
Store_OpenSpecificStore = "store.openSpecificStore",
|
304
307
|
Tasks_StartTask = "tasks.startTask",
|
305
308
|
Tasks_SubmitTask = "tasks.submitTask",
|
306
309
|
Tasks_UpdateTask = "tasks.updateTask",
|
@@ -1,41 +1,57 @@
|
|
1
|
+
import { DialogSize } from '../public';
|
1
2
|
import { AppId } from '../public/appId';
|
2
3
|
/**
|
3
4
|
* @beta
|
4
5
|
* @hidden
|
5
|
-
*
|
6
|
+
* @module
|
7
|
+
* Namespace to open app store
|
6
8
|
* @internal
|
7
9
|
* Limited to Microsoft-internal use
|
8
10
|
*/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
SpecificStore = "specificstore",
|
18
|
-
/**
|
19
|
-
* open in-context-store
|
20
|
-
*/
|
21
|
-
InContextStore = "ics",
|
11
|
+
/**
|
12
|
+
* @beta
|
13
|
+
* @hidden
|
14
|
+
* Interface for opening the full store function parameters
|
15
|
+
* @internal
|
16
|
+
* Limited to Microsoft-internal use
|
17
|
+
*/
|
18
|
+
export interface OpenFullStoreParams {
|
22
19
|
/**
|
23
|
-
*
|
20
|
+
* the store dialog size, defined by {@link DialogSize}, if not present, the host will choose an appropriate size
|
24
21
|
*/
|
25
|
-
|
22
|
+
size?: DialogSize;
|
26
23
|
}
|
27
24
|
/**
|
28
25
|
* @beta
|
29
26
|
* @hidden
|
30
|
-
* Interface
|
27
|
+
* Interface for opening the in-context store function parameters
|
31
28
|
* @internal
|
32
29
|
* Limited to Microsoft-internal use
|
33
30
|
*/
|
34
|
-
export interface
|
31
|
+
export interface OpenInContextStoreParams {
|
32
|
+
/**
|
33
|
+
* the store dialog size, defined by {@link DialogSize}, if not present, the host will choose an appropriate size
|
34
|
+
*/
|
35
|
+
size?: DialogSize;
|
36
|
+
/**
|
37
|
+
* The application capability (e.g., "Tab", "Bot", "Messaging", "Connector", "CUSTOMBOT").
|
38
|
+
* Defaults to "Tab".
|
39
|
+
*/
|
40
|
+
appCapability?: string;
|
41
|
+
/**
|
42
|
+
* The application meta capabilities (e.g., ["copilotPlugins", "copilotExtensions"]).
|
43
|
+
* Defaults to "[]".
|
44
|
+
*/
|
45
|
+
appMetaCapabilities?: string[];
|
35
46
|
/**
|
36
|
-
*
|
47
|
+
* The installation scope (e.g., "Personal" | "Team").
|
48
|
+
* Defaults to "Personal".
|
37
49
|
*/
|
38
|
-
|
50
|
+
installationScope?: string;
|
51
|
+
/**
|
52
|
+
* A list of app IDs to be filtered out.
|
53
|
+
*/
|
54
|
+
filteredOutAppIds?: AppId[];
|
39
55
|
}
|
40
56
|
/**
|
41
57
|
* @beta
|
@@ -45,14 +61,14 @@ export interface OpenFullStoreAndICSParams {
|
|
45
61
|
* Limited to Microsoft-internal use
|
46
62
|
*/
|
47
63
|
export interface OpenAppDetailParams {
|
48
|
-
/**
|
49
|
-
* need to be app detail type, defined by {@link StoreDialogType}
|
50
|
-
*/
|
51
|
-
dialogType: StoreDialogType.AppDetail;
|
52
64
|
/**
|
53
65
|
* app id of the dialog to open
|
54
66
|
*/
|
55
67
|
appId: AppId;
|
68
|
+
/**
|
69
|
+
* the store dialog size, defined by {@link DialogSize}, if not present, the host will choose an appropriate size
|
70
|
+
*/
|
71
|
+
size?: DialogSize;
|
56
72
|
}
|
57
73
|
/**
|
58
74
|
* @beta
|
@@ -62,58 +78,47 @@ export interface OpenAppDetailParams {
|
|
62
78
|
* Limited to Microsoft-internal use
|
63
79
|
*/
|
64
80
|
export interface OpenSpecificStoreParams {
|
65
|
-
/**
|
66
|
-
* need to be specific store type, defined by {@link StoreDialogType}
|
67
|
-
*/
|
68
|
-
dialogType: StoreDialogType.SpecificStore;
|
69
81
|
/**
|
70
82
|
* collection id of the plugin store to open
|
71
83
|
*/
|
72
84
|
collectionId: string;
|
85
|
+
/**
|
86
|
+
* the store dialog size, defined by {@link DialogSize}, if not present, the host will choose an appropriate size
|
87
|
+
*/
|
88
|
+
size?: DialogSize;
|
73
89
|
}
|
74
90
|
/**
|
75
91
|
* @beta
|
76
92
|
* @hidden
|
77
|
-
*
|
93
|
+
* Api to open a full store without navigation
|
78
94
|
* @internal
|
79
95
|
* Limited to Microsoft-internal use
|
80
96
|
*/
|
81
|
-
export
|
97
|
+
export declare function openFullStore(params: OpenFullStoreParams | undefined): Promise<void>;
|
82
98
|
/**
|
83
99
|
* @beta
|
84
100
|
* @hidden
|
85
|
-
*
|
101
|
+
* Api to open an app detail dialog
|
86
102
|
* @internal
|
87
103
|
* Limited to Microsoft-internal use
|
88
104
|
*/
|
89
|
-
export declare
|
105
|
+
export declare function openAppDetail(params: OpenAppDetailParams): Promise<void>;
|
90
106
|
/**
|
91
107
|
* @beta
|
92
108
|
* @hidden
|
93
|
-
*
|
109
|
+
* Api to open an in-context-store dialog
|
94
110
|
* @internal
|
95
111
|
* Limited to Microsoft-internal use
|
96
112
|
*/
|
97
|
-
export declare
|
113
|
+
export declare function openInContextStore(params: OpenInContextStoreParams | undefined): Promise<void>;
|
98
114
|
/**
|
99
115
|
* @beta
|
100
116
|
* @hidden
|
101
|
-
*
|
102
|
-
* @internal
|
103
|
-
* Limited to Microsoft-internal use
|
104
|
-
*/
|
105
|
-
export declare const errorMissingCollectionId = "No Collection Id present, but CollectionId needed to open a store specific to a collection";
|
106
|
-
/**
|
107
|
-
* @beta
|
108
|
-
* @hidden
|
109
|
-
* Api to open a store
|
110
|
-
*
|
111
|
-
* @param openStoreParams - params to call openStoreExperience
|
112
|
-
*
|
117
|
+
* Api to open an store with navigation to a specific collection
|
113
118
|
* @internal
|
114
119
|
* Limited to Microsoft-internal use
|
115
120
|
*/
|
116
|
-
export declare function
|
121
|
+
export declare function openSpecificStore(params: OpenSpecificStoreParams): Promise<void>;
|
117
122
|
/**
|
118
123
|
* Checks if the store capability is supported by the host
|
119
124
|
* @returns boolean to represent whether the store capability is supported
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as e}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{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as t}from"./telemetry.js";import{isSdkError as o,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{UUID as d}from"../public/uuidObject.js";import{version as c}from"../public/version.js";import{GlobalVars as u}from"./globalVars.js";import{callHandler as l}from"./handlers.js";import g from"./hostToAppTelemetry.js";import{serializeMessageRequest as p,deserializeMessageResponse as f,deserializeMessageRequest as m,serializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getCurrentTimestamp as W,ssrSafeWindow as v}from"./utils.js";import{validateOrigin as M}from"./validOrigins.js";const b=n("communication");class y{}class k{}function I(n,i){if(k.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void _("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return H(e,i).then((o=>{o?(function(e,n){u.isFramelessWindow||y.parentWindow&&!y.parentWindow.closed&&e!==y.parentWindow?y.childWindow&&!y.childWindow.closed&&e!==y.childWindow||(y.childWindow=e,y.childOrigin=n):(y.parentWindow=e,y.parentOrigin=n);y.parentWindow&&y.parentWindow.closed&&(y.parentWindow=null,y.parentOrigin=null);y.childWindow&&y.childWindow.closed&&(y.childWindow=null,y.childOrigin=null);te(y.parentWindow),te(y.childWindow)}(e,i),e===y.parentWindow?G(n):e===y.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=m(e.data),[i,o]=l(n.func,n.args);i&&void 0!==o?(X("Returning message %s from child back to child, action: %s.",ae(n),n.func),se(n.id,n.uuid,Array.isArray(o)?o:[o])):(X("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",ae(n),n.func),N(t("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(y.childWindow){const i=e.pop();X("Message from parent being relayed to child, id: %s",ae(n)),se(n.id,n.uuid,e,i)}})))}}(n)):_("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),y.currentWindow=y.currentWindow||v(),y.parentWindow=y.currentWindow.parent!==y.currentWindow.self?y.currentWindow.parent:y.currentWindow.opener,y.topWindow=y.currentWindow.top,(y.parentWindow||n)&&y.currentWindow.addEventListener("message",k.messageListener,!1),!y.parentWindow){const e=y.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));u.isFramelessWindow=!0,e.onNativeMessage=G}try{return y.parentOrigin="*",S(i,"initialize",[c,r,n]).then((([e,n,i,t])=>(h(t,y.currentWindow,{onMessage:q,sendPostMessage:U}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:t})))}finally{y.parentOrigin=null}}function T(){y.currentWindow&&y.currentWindow.removeEventListener("message",k.messageListener,!1),y.currentWindow=null,y.parentWindow=null,y.parentOrigin=null,y.childWindow=null,y.childOrigin=null,k.parentMessageQueue=[],k.childMessageQueue=[],k.nextMessageId=0,k.callbacks.clear(),k.promiseCallbacks.clear(),k.portCallbacks.clear(),k.legacyMessageIdsToUuidMap={},g.clearMessages()}function R(e,n,...i){return S(e,n,i).then((([e])=>e))}function E(e,n,...i){return S(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function O(e,n,i,...t){return S(e,n,t).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function j(e,n,...i){return S(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function S(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const o=L(e,n,t);var s;i((s=o.uuid,new Promise((e=>{k.promiseCallbacks.set(s,e)}))))}))}function A(e){return e.map((e=>a(e)?e.serialize():e))}function P(n,i,t,r,a){var d;return e(this,void 0,void 0,(function*(){const e=A(i),[c]=yield S(r,n,e);if(a&&a(c)||!a&&o(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(t.validate(c))return t.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function C(n,i,t,r){var a;return e(this,void 0,void 0,(function*(){const e=A(i),[d]=yield S(t,n,e);if(r&&r(d)||!r&&o(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function x(e,n,t=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const o=L(e,n,t);return s=o.uuid,new Promise(((e,n)=>{k.portCallbacks.set(s,((i,t)=>{i instanceof MessagePort?e(i):n(t&&t.length>0?t[0]:new Error("Host responded without port or error details."))}))}));var s}function N(e,n,t,o){let s;if(t instanceof Function?o=t:t instanceof Array&&(s=t),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=L(e,n,s);o&&k.callbacks.set(r.uuid,o)}k.parentMessageQueue=[],k.childMessageQueue=[],k.topMessageQueue=[],k.nextMessageId=0,k.callbacks=new Map,k.promiseCallbacks=new Map,k.portCallbacks=new Map,k.legacyMessageIdsToUuidMap={};const $=b.extend("sendNestedAuthRequestToTopWindow");function U(e){const n=$,i=y.topWindow,t=function(e){const n=k.nextMessageId++,i=new d;return k.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),args:[],data:e}}(e);return n("Message %s information: %o",ae(t),{actionName:t.func}),z(i,t)}const Q=b.extend("sendRequestToTargetWindowHelper");function z(e,n){const i=Q,t=ne(e),o=p(n);if(u.isFramelessWindow)y.currentWindow&&y.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",ae(o),t),y.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(o)));else{const s=ee(e);e&&s?(i("Sending message %s to %s via postMessage",ae(o),t),e.postMessage(o,s)):(i("Adding message %s to %s message queue",ae(o),t),Z(e).push(n))}return n}const F=b.extend("sendMessageToParentHelper");function L(e,n,i){const t=F,o=y.parentWindow,s=function(e,n,i){const t=k.nextMessageId++,o=new d;return k.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:i||[],apiVersionTag:e}}(e,n,i);return g.storeCallbackInformation(s.uuid,{name:n,calledAt:s.timestamp}),t("Message %s information: %o",ae(s),{actionName:n,args:i}),z(o,s)}const _=b.extend("processIncomingMessage");const V=b.extend("processAuthBridgeMessage");function q(e,n){var i,t;const o=V;if(!e||!e.data||"object"!=typeof e.data)return void o("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void o("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.origin);d?H(d,c)?(y.topWindow&&!y.topWindow.closed&&d!==y.topWindow||(y.topWindow=d,y.topOrigin=c),y.topWindow&&y.topWindow.closed&&(y.topWindow=null,y.topOrigin=null),te(y.topWindow),n(r)):o("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):o("Message being ignored by app because it is coming for a target that is null")}const D=b.extend("shouldProcessIncomingMessage");function H(n,i){return e(this,void 0,void 0,(function*(){if(y.currentWindow&&n===y.currentWindow)return D("Should not process message because it is coming from the current window"),!1;if(y.currentWindow&&y.currentWindow.location&&i&&i===y.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return D("Message has an invalid origin of %s",i),!1}const n=yield M(e);return n||D("Message has an invalid origin of %s",i),n}}))}const J=b.extend("handleIncomingMessageFromParent");function B(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function K(e,n){const i=B(n,e.uuid);i&&n.delete(i),e.uuid?k.legacyMessageIdsToUuidMap={}:delete k.legacyMessageIdsToUuidMap[e.id]}function G(e){const n=J,i=W();if("id"in e.data&&"number"==typeof e.data.id){const t=e.data,o=f(t),s=function(e){const n=J;if(!e.uuid)return k.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=B(k.callbacks,n);if(i)return i;const t=B(k.promiseCallbacks,n);if(t)return t;const o=B(k.portCallbacks,n);if(o)return o}n("Received message %s that failed to produce a callbackId",ae(e))}(o);if(s){const t=k.callbacks.get(s);n("Received a response from parent for message %s",s.toString()),g.handlePerformanceMetrics(s,o,n,i),t&&(n("Invoking the registered callback for message %s with arguments %o",s.toString(),o.args),t.apply(null,[...o.args,o.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",s.toString()),K(o,k.callbacks)));const r=k.promiseCallbacks.get(s);r&&(n("Invoking the registered promise callback for message %s with arguments %o",s.toString(),o.args),r(o.args),n("Removing registered promise callback for message %s",s.toString()),K(o,k.promiseCallbacks));const a=k.portCallbacks.get(s);if(a){let i;n("Invoking the registered port callback for message %s with arguments %o",s.toString(),o.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),a(i,o.args),n("Removing registered port callback for message %s",s.toString()),K(o,k.portCallbacks)}o.uuid&&(k.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const t=e.data;g.handleOneWayPerformanceMetrics(t,n,i),n('Received a message from parent %s, action: "%s"',ae(t),t.func),l(t.func,t.args)}else n("Received an unknown message: %O",e)}const X=b.extend("handleIncomingMessageFromChild");function Y(){return y.topWindow!==y.parentWindow}function Z(e){return e===y.topWindow&&Y()?k.topMessageQueue:e===y.parentWindow?k.parentMessageQueue:e===y.childWindow?k.childMessageQueue:[]}function ee(e){return e===y.topWindow&&Y()?y.topOrigin:e===y.parentWindow?y.parentOrigin:e===y.childWindow?y.childOrigin:null}function ne(e){return e===y.topWindow&&Y()?"top":e===y.parentWindow?"parent":e===y.childWindow?"child":null}const ie=b.extend("flushMessageQueue");function te(e){const n=ee(e),i=Z(e),t=ne(e);for(;e&&n&&i.length>0;){const o=i.shift();if(o){const i=p(o);ie("Flushing message %s from %s message queue via postMessage.",ae(i),t),e.postMessage(i,n)}}}function oe(e,n){let i;i=y.currentWindow.setInterval((()=>{0===Z(e).length&&(clearInterval(i),n())}),100)}function se(e,n,i,t){const o=y.childWindow,s=function(e,n,i,t){return{id:e,uuid:n,args:i||[],isPartialResponse:t}}(e,n,i,t),r=w(s),a=ee(o);o&&a&&o.postMessage(r,a)}function re(e,n){const i=y.childWindow,t=function(e,n){return{func:e,args:n||[]}}(e,n),o=ee(i);i&&o?i.postMessage(t,o):Z(i).push(t)}function ae(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{y as Communication,C as callFunctionInHost,P as callFunctionInHostAndHandleResponse,I as initializeCommunication,x as requestPortFromParentWithVersion,j as sendAndHandleSdkError,E as sendAndHandleStatusAndReason,O as sendAndHandleStatusAndReasonWithDefaultError,R as sendAndUnwrap,re as sendMessageEventToChild,N as sendMessageToParent,S as sendMessageToParentAsync,U as sendNestedAuthRequestToTopWindow,T as uninitializeCommunication,oe as waitForMessageQueue};
|
1
|
+
import{__awaiter as e}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{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as o}from"./telemetry.js";import{isSdkError as t,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{UUID as d}from"../public/uuidObject.js";import{version as c}from"../public/version.js";import{GlobalVars as u}from"./globalVars.js";import{callHandler as l}from"./handlers.js";import g from"./hostToAppTelemetry.js";import{serializeMessageRequest as p,deserializeMessageResponse as f,deserializeMessageRequest as m,serializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getCurrentTimestamp as W,ssrSafeWindow as v}from"./utils.js";import{validateOrigin as M}from"./validOrigins.js";const b=n("communication");class y{}class k{}function I(n,i){if(k.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void _("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return D(e,i).then((t=>{t?(function(e,n){u.isFramelessWindow||y.parentWindow&&!y.parentWindow.closed&&e!==y.parentWindow?y.childWindow&&!y.childWindow.closed&&e!==y.childWindow||(y.childWindow=e,y.childOrigin=n):(y.parentWindow=e,y.parentOrigin=n);y.parentWindow&&y.parentWindow.closed&&(y.parentWindow=null,y.parentOrigin=null);y.childWindow&&y.childWindow.closed&&(y.childWindow=null,y.childOrigin=null);oe(y.parentWindow),oe(y.childWindow)}(e,i),e===y.parentWindow?G(n):e===y.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=m(e.data),[i,t]=l(n.func,n.args);i&&void 0!==t?(X("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",ae(n),n.func),se(n.id,n.uuid,Array.isArray(t)?t:[t])):(X("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",ae(n),n.func),N(o("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(y.childWindow){const i=e.pop();X("Message from parent being relayed to child, id: %s",ae(n)),se(n.id,n.uuid,e,i)}})))}}(n)):_("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),y.currentWindow=y.currentWindow||v(),y.parentWindow=y.currentWindow.parent!==y.currentWindow.self?y.currentWindow.parent:y.currentWindow.opener,y.topWindow=y.currentWindow.top,(y.parentWindow||n)&&y.currentWindow.addEventListener("message",k.messageListener,!1),!y.parentWindow){const e=y.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));u.isFramelessWindow=!0,e.onNativeMessage=G}try{return y.parentOrigin="*",j(i,"initialize",[c,r,n]).then((([e,n,i,o])=>(h(o,y.currentWindow,{onMessage:q,sendPostMessage:U}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:o})))}finally{y.parentOrigin=null}}function T(){y.currentWindow&&y.currentWindow.removeEventListener("message",k.messageListener,!1),y.currentWindow=null,y.parentWindow=null,y.parentOrigin=null,y.childWindow=null,y.childOrigin=null,k.parentMessageQueue=[],k.childMessageQueue=[],k.nextMessageId=0,k.callbacks.clear(),k.promiseCallbacks.clear(),k.portCallbacks.clear(),k.legacyMessageIdsToUuidMap={},g.clearMessages()}function R(e,n,...i){return j(e,n,i).then((([e])=>e))}function E(e,n,...i){return j(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function O(e,n,i,...o){return j(e,n,o).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function S(e,n,...i){return j(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function j(e,n,o=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const t=L(e,n,o);var s;i((s=t.uuid,new Promise((e=>{k.promiseCallbacks.set(s,e)}))))}))}function A(e){return e.map((e=>a(e)?e.serialize():e))}function P(n,i,o,r,a){var d;return e(this,void 0,void 0,(function*(){const e=A(i),[c]=yield j(r,n,e);if(a&&a(c)||!a&&t(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(o.validate(c))return o.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function C(n,i,o,r){var a;return e(this,void 0,void 0,(function*(){const e=A(i),[d]=yield j(o,n,e);if(r&&r(d)||!r&&t(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function x(e,n,o=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const t=L(e,n,o);return s=t.uuid,new Promise(((e,n)=>{k.portCallbacks.set(s,((i,o)=>{i instanceof MessagePort?e(i):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))}))}));var s}function N(e,n,o,t){let s;if(o instanceof Function?t=o:o instanceof Array&&(s=o),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=L(e,n,s);t&&k.callbacks.set(r.uuid,t)}k.parentMessageQueue=[],k.childMessageQueue=[],k.topMessageQueue=[],k.nextMessageId=0,k.callbacks=new Map,k.promiseCallbacks=new Map,k.portCallbacks=new Map,k.legacyMessageIdsToUuidMap={};const $=b.extend("sendNestedAuthRequestToTopWindow");function U(e){const n=$,i=y.topWindow,o=function(e){const n=k.nextMessageId++,i=new d;return k.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),args:[],data:e}}(e);return n("Message %s information: %o",ae(o),{actionName:o.func}),z(i,o)}const Q=b.extend("sendRequestToTargetWindowHelper");function z(e,n){const i=Q,o=ne(e),t=p(n);if(u.isFramelessWindow)y.currentWindow&&y.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",ae(t),o),y.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(t)));else{const s=ee(e);e&&s?(i("Sending message %s to %s via postMessage",ae(t),o),e.postMessage(t,s)):(i("Adding message %s to %s message queue",ae(t),o),Z(e).push(n))}return n}const F=b.extend("sendMessageToParentHelper");function L(e,n,i){const o=F,t=y.parentWindow,s=function(e,n,i){const o=k.nextMessageId++,t=new d;return k.legacyMessageIdsToUuidMap[o]=t,{id:o,uuid:t,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:i||[],apiVersionTag:e}}(e,n,i);return g.storeCallbackInformation(s.uuid,{name:n,calledAt:s.timestamp}),o("Message %s information: %o",ae(s),{actionName:n,args:i}),z(t,s)}const _=b.extend("processIncomingMessage");const V=b.extend("processAuthBridgeMessage");function q(e,n){var i,o;const t=V;if(!e||!e.data||"object"!=typeof e.data)return void t("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void t("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);d?D(d,c)?(y.topWindow&&!y.topWindow.closed&&d!==y.topWindow||(y.topWindow=d,y.topOrigin=c),y.topWindow&&y.topWindow.closed&&(y.topWindow=null,y.topOrigin=null),oe(y.topWindow),n(r)):t("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):t("Message being ignored by app because it is coming for a target that is null")}const H=b.extend("shouldProcessIncomingMessage");function D(n,i){return e(this,void 0,void 0,(function*(){if(y.currentWindow&&n===y.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(y.currentWindow&&y.currentWindow.location&&i&&i===y.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return H("Message has an invalid origin of %s",i),!1}const n=yield M(e);return n||H("Message has an invalid origin of %s",i),n}}))}const J=b.extend("handleIncomingMessageFromParent");function B(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function K(e,n){const i=B(n,e.uuid);i&&n.delete(i),e.uuid?k.legacyMessageIdsToUuidMap={}:delete k.legacyMessageIdsToUuidMap[e.id]}function G(e){const n=J,i=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,t=f(o),s=function(e){const n=J;if(!e.uuid)return k.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=B(k.callbacks,n);if(i)return i;const o=B(k.promiseCallbacks,n);if(o)return o;const t=B(k.portCallbacks,n);if(t)return t}n("Received message %s that failed to produce a callbackId",ae(e))}(t);if(s){const o=k.callbacks.get(s);n("Received a response from parent for message %s",s.toString()),g.handlePerformanceMetrics(s,t,n,i),o&&(n("Invoking the registered callback for message %s with arguments %o",s.toString(),t.args),o.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",s.toString()),K(t,k.callbacks)));const r=k.promiseCallbacks.get(s);r&&(n("Invoking the registered promise callback for message %s with arguments %o",s.toString(),t.args),r(t.args),n("Removing registered promise callback for message %s",s.toString()),K(t,k.promiseCallbacks));const a=k.portCallbacks.get(s);if(a){let i;n("Invoking the registered port callback for message %s with arguments %o",s.toString(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),a(i,t.args),n("Removing registered port callback for message %s",s.toString()),K(t,k.portCallbacks)}t.uuid&&(k.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;g.handleOneWayPerformanceMetrics(o,n,i),n('Received a message from parent %s, action: "%s"',ae(o),o.func),l(o.func,o.args)}else n("Received an unknown message: %O",e)}const X=b.extend("handleIncomingMessageFromChild");function Y(){return y.topWindow!==y.parentWindow}function Z(e){return e===y.topWindow&&Y()?k.topMessageQueue:e===y.parentWindow?k.parentMessageQueue:e===y.childWindow?k.childMessageQueue:[]}function ee(e){return e===y.topWindow&&Y()?y.topOrigin:e===y.parentWindow?y.parentOrigin:e===y.childWindow?y.childOrigin:null}function ne(e){return e===y.topWindow&&Y()?"top":e===y.parentWindow?"parent":e===y.childWindow?"child":null}const ie=b.extend("flushMessageQueue");function oe(e){const n=ee(e),i=Z(e),o=ne(e);for(;e&&n&&i.length>0;){const t=i.shift();if(t){const i=p(t);ie("Flushing message %s from %s message queue via postMessage.",ae(i),o),e.postMessage(i,n)}}}function te(e,n){let i;i=y.currentWindow.setInterval((()=>{0===Z(e).length&&(clearInterval(i),n())}),100)}function se(e,n,i,o){const t=y.childWindow,s=function(e,n,i,o){return{id:e,uuid:n,args:i||[],isPartialResponse:o}}(e,n,i,o),r=w(s),a=ee(t);t&&a&&(X("Sending message %s to %s via postMessage, args = %o",ae(r),ne(t),r.args),t.postMessage(r,a))}function re(e,n){const i=y.childWindow,o=function(e,n){return{func:e,args:n||[]}}(e,n),t=ee(i);i&&t?i.postMessage(o,t):Z(i).push(o)}function ae(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{y as Communication,C as callFunctionInHost,P as callFunctionInHostAndHandleResponse,I as initializeCommunication,x as requestPortFromParentWithVersion,S as sendAndHandleSdkError,E as sendAndHandleStatusAndReason,O as sendAndHandleStatusAndReasonWithDefaultError,R as sendAndUnwrap,re as sendMessageEventToChild,N as sendMessageToParent,j as sendMessageToParentAsync,U as sendNestedAuthRequestToTopWindow,T as uninitializeCommunication,te as waitForMessageQueue};
|
@@ -1 +1 @@
|
|
1
|
-
import{__awaiter as
|
1
|
+
import{__awaiter as t}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{callFunctionInHost as o}from"../internal/communication.js";import{ensureInitialized as e}from"../internal/internalAPIs.js";import{getApiVersionTag as n}from"../internal/telemetry.js";import{AppId as i}from"../public/appId.js";import{FrameContexts as r,errorNotSupportedOnPlatform as p}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";const l="v2",u="Invalid store dialog size";function c(e){return t(this,void 0,void 0,(function*(){v();const{size:t}=null!=e?e:{};return o("store.openFullStore",[b(t)],n(l,"store.openFullStore"))}))}function d(e){return t(this,void 0,void 0,(function*(){v();const{size:t,appId:r}=e;if(!(r instanceof i))throw new Error("No App Id present, but AppId needed to open AppDetail store");return o("store.openAppDetail",[b(t),r],n(l,"store.openAppDetail"))}))}function f(e){return t(this,void 0,void 0,(function*(){v();const{size:t,appCapability:i,appMetaCapabilities:r,installationScope:p,filteredOutAppIds:s}=null!=e?e:{};return o("store.openInContextStore",[b(t),i,r,p,null==s?void 0:s.map((t=>t.toString()))],n(l,"store.openInContextStore"))}))}function a(e){return t(this,void 0,void 0,(function*(){v();const{size:t,collectionId:i}=e;if(void 0===i)throw new Error("No Collection Id present, but CollectionId needed to open a store specific to a collection");return o("store.openSpecificStore",[b(t),i],n(l,"store.openSpecificStore"))}))}function m(){return e(s)&&!!s.supports.store}function v(){if(e(s,r.content,r.sidePanel,r.meetingStage),!m())throw p}function b(t){if(void 0===t)return;const{width:o,height:e}=t;if(void 0!==o&&"number"==typeof o&&o<0)throw new Error(u);if(void 0!==e&&"number"==typeof e&&e<0)throw new Error(u);return JSON.stringify(t)}export{m as isSupported,d as openAppDetail,c as openFullStore,f as openInContextStore,a as openSpecificStore};
|
@@ -1 +1 @@
|
|
1
|
-
const
|
1
|
+
const t="2.34.0-beta.0";export{t as version};
|
@@ -1607,12 +1607,11 @@ __webpack_require__.d(hostEntity_namespaceObject, {
|
|
1607
1607
|
var store_namespaceObject = {};
|
1608
1608
|
__webpack_require__.r(store_namespaceObject);
|
1609
1609
|
__webpack_require__.d(store_namespaceObject, {
|
1610
|
-
StoreDialogType: () => (StoreDialogType),
|
1611
|
-
errorInvalidDialogType: () => (errorInvalidDialogType),
|
1612
|
-
errorMissingAppId: () => (errorMissingAppId),
|
1613
|
-
errorMissingCollectionId: () => (errorMissingCollectionId),
|
1614
1610
|
isSupported: () => (store_isSupported),
|
1615
|
-
|
1611
|
+
openAppDetail: () => (openAppDetail),
|
1612
|
+
openFullStore: () => (openFullStore),
|
1613
|
+
openInContextStore: () => (openInContextStore),
|
1614
|
+
openSpecificStore: () => (openSpecificStore)
|
1616
1615
|
});
|
1617
1616
|
|
1618
1617
|
// NAMESPACE OBJECT: ./src/public/appInstallDialog.ts
|
@@ -4461,7 +4460,7 @@ function isSerializable(arg) {
|
|
4461
4460
|
* @hidden
|
4462
4461
|
* Package version.
|
4463
4462
|
*/
|
4464
|
-
const version = "2.
|
4463
|
+
const version = "2.34.0-beta.0";
|
4465
4464
|
|
4466
4465
|
;// ./src/internal/internalAPIs.ts
|
4467
4466
|
|
@@ -8667,14 +8666,14 @@ function handleIncomingMessageFromChild(evt) {
|
|
8667
8666
|
const message = deserializeMessageRequest(evt.data);
|
8668
8667
|
const [called, result] = callHandler(message.func, message.args);
|
8669
8668
|
if (called && typeof result !== 'undefined') {
|
8670
|
-
handleIncomingMessageFromChildLogger('
|
8669
|
+
handleIncomingMessageFromChildLogger('Handler called in response to message %s from child. Returning response from handler to child, action: %s.', getMessageIdsAsLogString(message), message.func);
|
8671
8670
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
8672
8671
|
// @ts-ignore
|
8673
8672
|
sendMessageResponseToChild(message.id, message.uuid, Array.isArray(result) ? result : [result]);
|
8674
8673
|
}
|
8675
8674
|
else {
|
8676
8675
|
// No handler, proxy to parent
|
8677
|
-
handleIncomingMessageFromChildLogger('
|
8676
|
+
handleIncomingMessageFromChildLogger('No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.', getMessageIdsAsLogString(message), message.func);
|
8678
8677
|
sendMessageToParent(getApiVersionTag("v2" /* ApiVersionNumber.V_2 */, "tasks.startTask" /* ApiName.Tasks_StartTask */), message.func, message.args, (...args) => {
|
8679
8678
|
if (Communication.childWindow) {
|
8680
8679
|
const isPartialResponse = args.pop();
|
@@ -8800,6 +8799,7 @@ function sendMessageResponseToChild(id, uuid, args, isPartialResponse) {
|
|
8800
8799
|
const serializedResponse = serializeMessageResponse(response);
|
8801
8800
|
const targetOrigin = getTargetOrigin(targetWindow);
|
8802
8801
|
if (targetWindow && targetOrigin) {
|
8802
|
+
handleIncomingMessageFromChildLogger('Sending message %s to %s via postMessage, args = %o', getMessageIdsAsLogString(serializedResponse), getTargetName(targetWindow), serializedResponse.args);
|
8803
8803
|
targetWindow.postMessage(serializedResponse, targetOrigin);
|
8804
8804
|
}
|
8805
8805
|
}
|
@@ -13023,95 +13023,76 @@ var store_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _ar
|
|
13023
13023
|
|
13024
13024
|
|
13025
13025
|
|
13026
|
-
/**
|
13027
|
-
* @beta
|
13028
|
-
* @hidden
|
13029
|
-
* @module
|
13030
|
-
* Namespace to open app store
|
13031
|
-
* @internal
|
13032
|
-
* Limited to Microsoft-internal use
|
13033
|
-
*/
|
13034
13026
|
const StoreVersionTagNum = "v2" /* ApiVersionNumber.V_2 */;
|
13027
|
+
const errorInvalidDialogSize = 'Invalid store dialog size';
|
13028
|
+
const errorMissingAppId = 'No App Id present, but AppId needed to open AppDetail store';
|
13029
|
+
const errorMissingCollectionId = 'No Collection Id present, but CollectionId needed to open a store specific to a collection';
|
13035
13030
|
/**
|
13036
13031
|
* @beta
|
13037
13032
|
* @hidden
|
13038
|
-
*
|
13039
|
-
* @internal
|
13040
|
-
* Limited to Microsoft-internal use
|
13041
|
-
*/
|
13042
|
-
var StoreDialogType;
|
13043
|
-
(function (StoreDialogType) {
|
13044
|
-
/**
|
13045
|
-
* open a store without navigation
|
13046
|
-
*/
|
13047
|
-
StoreDialogType["FullStore"] = "fullstore";
|
13048
|
-
/**
|
13049
|
-
* open a store with navigation to a specific collection
|
13050
|
-
*/
|
13051
|
-
StoreDialogType["SpecificStore"] = "specificstore";
|
13052
|
-
/**
|
13053
|
-
* open in-context-store
|
13054
|
-
*/
|
13055
|
-
StoreDialogType["InContextStore"] = "ics";
|
13056
|
-
/**
|
13057
|
-
* open detail dialog (DD)
|
13058
|
-
*/
|
13059
|
-
StoreDialogType["AppDetail"] = "appdetail";
|
13060
|
-
})(StoreDialogType || (StoreDialogType = {}));
|
13061
|
-
/**
|
13062
|
-
* @beta
|
13063
|
-
* @hidden
|
13064
|
-
* error message when getting invalid store dialog type
|
13033
|
+
* Api to open a full store without navigation
|
13065
13034
|
* @internal
|
13066
13035
|
* Limited to Microsoft-internal use
|
13067
13036
|
*/
|
13068
|
-
|
13037
|
+
function openFullStore(params) {
|
13038
|
+
return store_awaiter(this, void 0, void 0, function* () {
|
13039
|
+
ensureStoreReady();
|
13040
|
+
const { size } = params !== null && params !== void 0 ? params : {};
|
13041
|
+
return callFunctionInHost("store.openFullStore" /* ApiName.Store_OpenFullStore */, [serializeValidSize(size)], getApiVersionTag(StoreVersionTagNum, "store.openFullStore" /* ApiName.Store_OpenFullStore */));
|
13042
|
+
});
|
13043
|
+
}
|
13069
13044
|
/**
|
13070
13045
|
* @beta
|
13071
13046
|
* @hidden
|
13072
|
-
*
|
13047
|
+
* Api to open an app detail dialog
|
13073
13048
|
* @internal
|
13074
13049
|
* Limited to Microsoft-internal use
|
13075
13050
|
*/
|
13076
|
-
|
13051
|
+
function openAppDetail(params) {
|
13052
|
+
return store_awaiter(this, void 0, void 0, function* () {
|
13053
|
+
ensureStoreReady();
|
13054
|
+
const { size, appId } = params;
|
13055
|
+
if (!(appId instanceof AppId)) {
|
13056
|
+
throw new Error(errorMissingAppId);
|
13057
|
+
}
|
13058
|
+
return callFunctionInHost("store.openAppDetail" /* ApiName.Store_OpenAppDetail */, [serializeValidSize(size), appId], getApiVersionTag(StoreVersionTagNum, "store.openAppDetail" /* ApiName.Store_OpenAppDetail */));
|
13059
|
+
});
|
13060
|
+
}
|
13077
13061
|
/**
|
13078
13062
|
* @beta
|
13079
13063
|
* @hidden
|
13080
|
-
*
|
13064
|
+
* Api to open an in-context-store dialog
|
13081
13065
|
* @internal
|
13082
13066
|
* Limited to Microsoft-internal use
|
13083
13067
|
*/
|
13084
|
-
|
13068
|
+
function openInContextStore(params) {
|
13069
|
+
return store_awaiter(this, void 0, void 0, function* () {
|
13070
|
+
ensureStoreReady();
|
13071
|
+
const { size, appCapability, appMetaCapabilities, installationScope, filteredOutAppIds } = params !== null && params !== void 0 ? params : {};
|
13072
|
+
return callFunctionInHost("store.openInContextStore" /* ApiName.Store_OpenInContextStore */, [
|
13073
|
+
serializeValidSize(size),
|
13074
|
+
appCapability,
|
13075
|
+
appMetaCapabilities,
|
13076
|
+
installationScope,
|
13077
|
+
filteredOutAppIds === null || filteredOutAppIds === void 0 ? void 0 : filteredOutAppIds.map((id) => id.toString()),
|
13078
|
+
], getApiVersionTag(StoreVersionTagNum, "store.openInContextStore" /* ApiName.Store_OpenInContextStore */));
|
13079
|
+
});
|
13080
|
+
}
|
13085
13081
|
/**
|
13086
13082
|
* @beta
|
13087
13083
|
* @hidden
|
13088
|
-
* Api to open a
|
13089
|
-
*
|
13090
|
-
* @param openStoreParams - params to call openStoreExperience
|
13091
|
-
*
|
13084
|
+
* Api to open an store with navigation to a specific collection
|
13092
13085
|
* @internal
|
13093
13086
|
* Limited to Microsoft-internal use
|
13094
13087
|
*/
|
13095
|
-
function
|
13088
|
+
function openSpecificStore(params) {
|
13096
13089
|
return store_awaiter(this, void 0, void 0, function* () {
|
13097
|
-
|
13098
|
-
|
13099
|
-
|
13100
|
-
}
|
13101
|
-
if (openStoreParams === undefined || !Object.values(StoreDialogType).includes(openStoreParams.dialogType)) {
|
13102
|
-
throw new Error(errorInvalidDialogType);
|
13103
|
-
}
|
13104
|
-
if (openStoreParams.dialogType === StoreDialogType.AppDetail && !(openStoreParams.appId instanceof AppId)) {
|
13105
|
-
throw new Error(errorMissingAppId);
|
13106
|
-
}
|
13107
|
-
if (openStoreParams.dialogType === StoreDialogType.SpecificStore && !openStoreParams.collectionId) {
|
13090
|
+
ensureStoreReady();
|
13091
|
+
const { size, collectionId } = params;
|
13092
|
+
if (collectionId === undefined) {
|
13108
13093
|
throw new Error(errorMissingCollectionId);
|
13109
13094
|
}
|
13110
|
-
return callFunctionInHost("store.
|
13111
|
-
openStoreParams.dialogType,
|
13112
|
-
openStoreParams.appId,
|
13113
|
-
openStoreParams.collectionId,
|
13114
|
-
], getApiVersionTag(StoreVersionTagNum, "store.open" /* ApiName.Store_Open */));
|
13095
|
+
return callFunctionInHost("store.openSpecificStore" /* ApiName.Store_OpenSpecificStore */, [serializeValidSize(size), collectionId], getApiVersionTag(StoreVersionTagNum, "store.openSpecificStore" /* ApiName.Store_OpenSpecificStore */));
|
13115
13096
|
});
|
13116
13097
|
}
|
13117
13098
|
/**
|
@@ -13123,6 +13104,25 @@ function openStoreExperience(openStoreParams) {
|
|
13123
13104
|
function store_isSupported() {
|
13124
13105
|
return ensureInitialized(runtime) && !!runtime.supports.store;
|
13125
13106
|
}
|
13107
|
+
function ensureStoreReady() {
|
13108
|
+
ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
13109
|
+
if (!store_isSupported()) {
|
13110
|
+
throw errorNotSupportedOnPlatform;
|
13111
|
+
}
|
13112
|
+
}
|
13113
|
+
function serializeValidSize(size) {
|
13114
|
+
if (size === undefined) {
|
13115
|
+
return undefined;
|
13116
|
+
}
|
13117
|
+
const { width, height } = size;
|
13118
|
+
if (width !== undefined && typeof width === 'number' && width < 0) {
|
13119
|
+
throw new Error(errorInvalidDialogSize);
|
13120
|
+
}
|
13121
|
+
if (height !== undefined && typeof height === 'number' && height < 0) {
|
13122
|
+
throw new Error(errorInvalidDialogSize);
|
13123
|
+
}
|
13124
|
+
return JSON.stringify(size);
|
13125
|
+
}
|
13126
13126
|
|
13127
13127
|
;// ./src/private/index.ts
|
13128
13128
|
|