@microsoft/teams-js 2.34.0-beta.0 → 2.34.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/esm/_virtual/_polyfill-node.buffer.js +1 -0
- package/dist/esm/_virtual/_polyfill-node.global.js +1 -0
- package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +8 -0
- package/dist/esm/packages/teams-js/dts/internal/internalAPIs.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +1 -0
- package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/private/copilot/customTelemetry.d.ts +10 -0
- package/dist/esm/packages/teams-js/dts/public/app/app.d.ts +9 -0
- package/dist/esm/packages/teams-js/dts/public/authentication.d.ts +12 -4
- package/dist/esm/packages/teams-js/dts/public/constants.d.ts +2 -0
- package/dist/esm/packages/teams-js/dts/public/index.d.ts +1 -1
- package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +14 -0
- package/dist/esm/packages/teams-js/dts/public/mail/handoff.d.ts +48 -0
- package/dist/esm/packages/teams-js/dts/public/{mail.d.ts → mail/mail.d.ts} +4 -1
- package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +3 -1
- package/dist/esm/packages/teams-js/src/index.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/constants.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/internalAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/utils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/customTelemetry.js +1 -1
- package/dist/esm/packages/teams-js/src/public/app/app.js +1 -1
- package/dist/esm/packages/teams-js/src/public/constants.js +1 -1
- package/dist/esm/packages/teams-js/src/public/mail/handoff.js +1 -0
- package/dist/esm/packages/teams-js/src/public/mail/mail.js +1 -0
- package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
- package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
- package/dist/umd/MicrosoftTeams.js +318 -159
- 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 +53 -1
- package/dist/esm/node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js +0 -1
- package/dist/esm/packages/teams-js/src/public/mail.js +0 -1
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.
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.34.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.
|
49
|
-
integrity="sha384-
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.34.0/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-brW9AazbKR2dYw2DucGgWCCcmrm2oBFV4HQidyuyZRI/TnAkmOOnTARSTdps3Hwt"
|
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.
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.34.0/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
@@ -0,0 +1 @@
|
|
1
|
+
import t from"./_polyfill-node.global.js";var r=[],e=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)r[n]=t[n],e[t.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63}function u(t,e,n){for(var i,o,u=[],f=e;f<n;f+=3)i=(t[f]<<16)+(t[f+1]<<8)+t[f+2],u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}function f(t){var e;i||o();for(var n=t.length,f=n%3,s="",h=[],a=16383,c=0,l=n-f;c<l;c+=a)h.push(u(t,c,c+a>l?l:c+a));return 1===f?(e=t[n-1],s+=r[e>>2],s+=r[e<<4&63],s+="=="):2===f&&(e=(t[n-2]<<8)+t[n-1],s+=r[e>>10],s+=r[e>>4&63],s+=r[e<<2&63],s+="="),h.push(s),h.join("")}function s(t,r,e,n,i){var o,u,f=8*i-n-1,s=(1<<f)-1,h=s>>1,a=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-a)-1,p>>=-a,a+=f;a>0;o=256*o+t[r+c],c+=l,a-=8);for(u=o&(1<<-a)-1,o>>=-a,a+=n;a>0;u=256*u+t[r+c],c+=l,a-=8);if(0===o)o=1-h;else{if(o===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=h}return(p?-1:1)*u*Math.pow(2,o-n)}function h(t,r,e,n,i,o){var u,f,s,h=8*o-i-1,a=(1<<h)-1,c=a>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=a):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+c>=1?l/s:l*Math.pow(2,1-c))*s>=2&&(u++,s/=2),u+c>=a?(f=0,u=a):u+c>=1?(f=(r*s-1)*Math.pow(2,i),u+=c):(f=r*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[e+p]=255&f,p+=g,f/=256,i-=8);for(u=u<<i|f,h+=i;h>0;t[e+p]=255&u,p+=g,u/=256,h-=8);t[e+p-g]|=128*y}var a={}.toString,c=Array.isArray||function(t){return"[object Array]"==a.call(t)},l=50;function p(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(p()<r)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=y.prototype:(null===t&&(t=new y(r)),t.length=r),t}function y(t,r,e){if(!(y.TYPED_ARRAY_SUPPORT||this instanceof y))return new y(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return v(this,t)}return w(this,t,r,e)}function w(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);y.TYPED_ARRAY_SUPPORT?(t=r).__proto__=y.prototype:t=E(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!y.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|b(r,e);t=g(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(R(r)){var e=0|A(r.length);return 0===(t=g(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?g(t,0):E(t,r);if("Buffer"===r.type&&c(r.data))return E(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function v(t,r){if(d(r),t=g(t,r<0?0:0|A(r)),!y.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function E(t,r){var e=r.length<0?0:0|A(r.length);t=g(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function A(t){if(t>=p())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p().toString(16)+" bytes");return 0|t}function R(t){return!(null==t||!t._isBuffer)}function b(t,r){if(R(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return Q(t).length;default:if(n)return K(t).length;r=(""+r).toLowerCase(),n=!0}}function m(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,r,e);case"utf8":case"utf-8":return L(this,r,e);case"ascii":return D(this,r,e);case"latin1":case"binary":return x(this,r,e);case"base64":return O(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function P(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=y.from(r,n)),R(r))return 0===r.length?-1:T(t,r,e,n,i);if("number"==typeof r)return r&=255,y.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):T(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function T(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function U(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function B(t,r,e,n){return W(K(r,t.length-e),t,e,n)}function S(t,r,e,n){return W(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function Y(t,r,e,n){return S(t,r,e,n)}function I(t,r,e,n){return W(Q(r),t,e,n)}function C(t,r,e,n){return W(function(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function O(t,r,e){return 0===r&&e===t.length?f(t):f(t.slice(r,e))}function L(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return function(t){var r=t.length;if(r<=M)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=M));return e}(n)}y.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,p(),y.poolSize=8192,y._augment=function(t){return t.__proto__=y.prototype,t},y.from=function(t,r,e){return w(null,t,r,e)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&y[Symbol.species]),y.alloc=function(t,r,e){return function(t,r,e,n){return d(r),r<=0?g(t,r):void 0!==e?"string"==typeof n?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}(null,t,r,e)},y.allocUnsafe=function(t){return v(null,t)},y.allocUnsafeSlow=function(t){return v(null,t)},y.isBuffer=X,y.compare=function(t,r){if(!R(t)||!R(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},y.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(t,r){if(!c(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return y.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=y.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!R(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},y.byteLength=b,y.prototype._isBuffer=!0,y.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)_(this,r,r+1);return this},y.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)_(this,r,r+3),_(this,r+1,r+2);return this},y.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)_(this,r,r+7),_(this,r+1,r+6),_(this,r+2,r+5),_(this,r+3,r+4);return this},y.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?L(this,0,t):m.apply(this,arguments)},y.prototype.equals=function(t){if(!R(t))throw new TypeError("Argument must be a Buffer");return this===t||0===y.compare(this,t)},y.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},y.prototype.compare=function(t,r,e,n,i){if(!R(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),f=Math.min(o,u),s=this.slice(n,i),h=t.slice(r,e),a=0;a<f;++a)if(s[a]!==h[a]){o=s[a],u=h[a];break}return o<u?-1:u<o?1:0},y.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},y.prototype.indexOf=function(t,r,e){return P(this,t,r,e,!0)},y.prototype.lastIndexOf=function(t,r,e){return P(this,t,r,e,!1)},y.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return U(this,t,r,e);case"utf8":case"utf-8":return B(this,t,r,e);case"ascii":return S(this,t,r,e);case"latin1":case"binary":return Y(this,t,r,e);case"base64":return I(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function x(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function k(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=H(t[o]);return i}function N(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function z(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function F(t,r,e,n,i,o){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function j(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function q(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function J(t,r,e,n,i){return i||q(t,0,e,4),h(t,r,e,n,23,4),e+4}function Z(t,r,e,n,i){return i||q(t,0,e,8),h(t,r,e,n,52,8),e+8}y.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),y.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=y.prototype;else{var i=r-t;e=new y(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},y.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},y.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},y.prototype.readUInt8=function(t,r){return r||z(t,1,this.length),this[t]},y.prototype.readUInt16LE=function(t,r){return r||z(t,2,this.length),this[t]|this[t+1]<<8},y.prototype.readUInt16BE=function(t,r){return r||z(t,2,this.length),this[t]<<8|this[t+1]},y.prototype.readUInt32LE=function(t,r){return r||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},y.prototype.readUInt32BE=function(t,r){return r||z(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},y.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},y.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},y.prototype.readInt8=function(t,r){return r||z(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},y.prototype.readInt16LE=function(t,r){r||z(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},y.prototype.readInt16BE=function(t,r){r||z(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},y.prototype.readInt32LE=function(t,r){return r||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},y.prototype.readInt32BE=function(t,r){return r||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},y.prototype.readFloatLE=function(t,r){return r||z(t,4,this.length),s(this,t,!0,23,4)},y.prototype.readFloatBE=function(t,r){return r||z(t,4,this.length),s(this,t,!1,23,4)},y.prototype.readDoubleLE=function(t,r){return r||z(t,8,this.length),s(this,t,!0,52,8)},y.prototype.readDoubleBE=function(t,r){return r||z(t,8,this.length),s(this,t,!1,52,8)},y.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||F(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},y.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||F(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},y.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,1,255,0),y.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},y.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},y.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},y.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):V(this,t,r,!0),r+4},y.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},y.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);F(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},y.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);F(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},y.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,1,127,-128),y.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},y.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},y.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},y.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):V(this,t,r,!0),r+4},y.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},y.prototype.writeFloatLE=function(t,r,e){return J(this,t,r,!0,e)},y.prototype.writeFloatBE=function(t,r,e){return J(this,t,r,!1,e)},y.prototype.writeDoubleLE=function(t,r,e){return Z(this,t,r,!0,e)},y.prototype.writeDoubleBE=function(t,r,e){return Z(this,t,r,!1,e)},y.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!y.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},y.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=R(t)?t:K(new y(t,n).toString()),f=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%f]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function Q(t){return function(t){var r,u,f,s,h,a;i||o();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");h="="===t[c-2]?2:"="===t[c-1]?1:0,a=new n(3*c/4-h),f=h>0?c-4:c;var l=0;for(r=0,u=0;r<f;r+=4,u+=3)s=e[t.charCodeAt(r)]<<18|e[t.charCodeAt(r+1)]<<12|e[t.charCodeAt(r+2)]<<6|e[t.charCodeAt(r+3)],a[l++]=s>>16&255,a[l++]=s>>8&255,a[l++]=255&s;return 2===h?(s=e[t.charCodeAt(r)]<<2|e[t.charCodeAt(r+1)]>>4,a[l++]=255&s):1===h&&(s=e[t.charCodeAt(r)]<<10|e[t.charCodeAt(r+1)]<<4|e[t.charCodeAt(r+2)]>>2,a[l++]=s>>8&255,a[l++]=255&s),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function X(t){return null!=t&&(!!t._isBuffer||$(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&$(t.slice(0,0))}(t))}function $(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}export{y as Buffer,l as INSPECT_MAX_BYTES,X as isBuffer};
|
@@ -0,0 +1 @@
|
|
1
|
+
var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};export{e as default};
|
@@ -104,6 +104,14 @@ export declare const scanBarCodeAPIMobileSupportVersion = "1.9.0";
|
|
104
104
|
* Limited to Microsoft-internal use
|
105
105
|
*/
|
106
106
|
export declare const validOriginsFallback: string[];
|
107
|
+
/**
|
108
|
+
* @hidden
|
109
|
+
* Timeout length for Fetch Call for Valid Origins
|
110
|
+
*
|
111
|
+
* @internal
|
112
|
+
* Limited to Microsoft-internal use
|
113
|
+
*/
|
114
|
+
export declare const ORIGIN_LIST_FETCH_TIMEOUT_IN_MS: number;
|
107
115
|
/**
|
108
116
|
* @hidden
|
109
117
|
* CDN endpoint of the list of valid origins
|
@@ -34,7 +34,7 @@ export declare function ensureInitialized(runtime: IBaseRuntime, ...expectedFram
|
|
34
34
|
export declare function isCurrentSDKVersionAtLeast(requiredVersion?: string): boolean;
|
35
35
|
/**
|
36
36
|
* @hidden
|
37
|
-
* Helper function to identify if host client is either android, ios, or
|
37
|
+
* Helper function to identify if host client is either android, ios, ipados, or visionOS
|
38
38
|
*
|
39
39
|
* @internal
|
40
40
|
* Limited to Microsoft-internal use
|
@@ -152,6 +152,7 @@ export declare const enum ApiName {
|
|
152
152
|
Logs_Receive = "log.receive",
|
153
153
|
Logs_RegisterLogRequestHandler = "log.request",
|
154
154
|
Mail_ComposeMail = "mail.composeMail",
|
155
|
+
Mail_Handoff_ComposeMail = "mail.handoff.composeMail",
|
155
156
|
Mail_OpenMailItem = "mail.openMailItem",
|
156
157
|
Marketplace_AddOrUpdateCartItems = "marketplace.addOrUpdateCartItems",
|
157
158
|
Marketplace_GetCart = "marketplace.getCart",
|
@@ -3,4 +3,4 @@ export declare function prefetchOriginsFromCDN(): Promise<void>;
|
|
3
3
|
* @internal
|
4
4
|
* Limited to Microsoft-internal use
|
5
5
|
*/
|
6
|
-
export declare function validateOrigin(messageOrigin: URL): Promise<boolean>;
|
6
|
+
export declare function validateOrigin(messageOrigin: URL, disableCache?: boolean): Promise<boolean>;
|
@@ -7,6 +7,16 @@
|
|
7
7
|
* @module
|
8
8
|
*/
|
9
9
|
import { UUID } from '../../public/uuidObject';
|
10
|
+
/**
|
11
|
+
* @hidden
|
12
|
+
* @internal
|
13
|
+
* Limited to Microsoft-internal use
|
14
|
+
* @beta
|
15
|
+
* @returns boolean to represent whether copilot.customTelemetry capability is supported
|
16
|
+
*
|
17
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
18
|
+
*/
|
19
|
+
export declare function isSupported(): boolean;
|
10
20
|
/**
|
11
21
|
* Sends custom telemetry data to the host.
|
12
22
|
*
|
@@ -3,6 +3,7 @@
|
|
3
3
|
* @module
|
4
4
|
*/
|
5
5
|
import * as appHelpers from '../../internal/appHelpers';
|
6
|
+
import { AppId } from '../appId';
|
6
7
|
import { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from '../constants';
|
7
8
|
import { ActionInfo, FileOpenPreference, HostToAppPerformanceMetrics, LocaleInfo } from '../interfaces';
|
8
9
|
import * as lifecycle from './lifecycle';
|
@@ -142,6 +143,14 @@ export interface AppInfo {
|
|
142
143
|
* ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.
|
143
144
|
*/
|
144
145
|
appLaunchId?: string;
|
146
|
+
/**
|
147
|
+
* This ID is the unique identifier assigned to the app after deployment and is critical for ensuring the correct app instance is recognized across hosts.
|
148
|
+
*/
|
149
|
+
appId?: AppId;
|
150
|
+
/**
|
151
|
+
* The version of the manifest that the app is running.
|
152
|
+
*/
|
153
|
+
manifestVersion?: string;
|
145
154
|
}
|
146
155
|
/**
|
147
156
|
* Represents information about the application's host.
|
@@ -32,7 +32,7 @@ export declare function registerAuthenticationHandlers(authenticateParameters: A
|
|
32
32
|
*
|
33
33
|
* @remarks
|
34
34
|
* The authentication flow must start and end from the same domain, otherwise success and failure messages won't be returned to the window that initiated the call.
|
35
|
-
* The [
|
35
|
+
* The [authentication flow](https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/authentication/auth-flow-tab) starts and ends at an endpoint on
|
36
36
|
* your own service (with a redirect round-trip to the 3rd party identity provider in the middle).
|
37
37
|
*
|
38
38
|
* @param authenticateParameters - Parameters describing the authentication window used for executing the authentication flow
|
@@ -116,16 +116,24 @@ export declare function getUser(): Promise<UserProfile>;
|
|
116
116
|
export declare function getUser(userRequest: UserRequest): void;
|
117
117
|
/**
|
118
118
|
* When using {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>}, the
|
119
|
-
* window that was opened to execute the authentication flow should call this method after
|
119
|
+
* window that was opened to execute the authentication flow should call this method after authentication to notify the caller of
|
120
120
|
* {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>} that the
|
121
121
|
* authentication request was successful.
|
122
122
|
*
|
123
123
|
* @remarks
|
124
|
-
*
|
124
|
+
* The `result` parameter should **never** contain the token that was received from the identity provider, because a malicious app (rather than your own app) might have opened
|
125
|
+
* the authentication window. If that was the case, passing the token in this parameter would leak it to them. More secure methods for completing the authentication flow include:
|
126
|
+
* - For a purely browser-based experience (e.g., a personal app/tab app), you could store the token in browser local storage and then have your personal app retrieve it once
|
127
|
+
* this `notifySuccess` call is received.
|
128
|
+
* - For a server-based experience (e.g., a message extension), your authentication window could store the token on your service and then generate a unique code passed via this
|
129
|
+
* `result` parameter. The caller can then use the unique code to retrieve the token from your service.
|
130
|
+
*
|
131
|
+
* This function is usable only from an authentication window opened with {@link authentication.authenticate authentication.authenticate(authenticateParameters: AuthenticatePopUpParameters): Promise\<string\>}.
|
125
132
|
* This call causes the authentication window to be closed.
|
126
133
|
*
|
127
134
|
* @param result - Specifies a result for the authentication. If specified, the frame that initiated the authentication pop-up receives
|
128
|
-
* this value in its callback or via the `Promise` return value
|
135
|
+
* this value in its callback or via the `Promise` return value.
|
136
|
+
*
|
129
137
|
*/
|
130
138
|
export declare function notifySuccess(result?: string): void;
|
131
139
|
/**
|
@@ -12,6 +12,8 @@ export declare enum HostClientType {
|
|
12
12
|
ipados = "ipados",
|
13
13
|
/** The host is running on a macOS client, which runs on devices such as MacBooks. */
|
14
14
|
macos = "macos",
|
15
|
+
/** The host is running on a visionOS client, which runs on devices such as Apple Vision. */
|
16
|
+
visionOS = "visionOS",
|
15
17
|
/**
|
16
18
|
* @deprecated
|
17
19
|
* As of TeamsJS v2.0.0, please use {@link teamsRoomsWindows} instead.
|
@@ -22,7 +22,7 @@ export * as location from './location';
|
|
22
22
|
export * as meeting from './meeting/meeting';
|
23
23
|
export * as monetization from './monetization';
|
24
24
|
export * as calendar from './calendar';
|
25
|
-
export * as mail from './mail';
|
25
|
+
export * as mail from './mail/mail';
|
26
26
|
export * as teamsCore from './teamsAPIs';
|
27
27
|
export * as people from './people';
|
28
28
|
export * as profile from './profile';
|
@@ -687,6 +687,20 @@ export interface Context {
|
|
687
687
|
* They help pre-fill the dialog with necessary information (`dialogParameters`) along with other details.
|
688
688
|
*/
|
689
689
|
dialogParameters?: Record<string, string>;
|
690
|
+
/**
|
691
|
+
* @deprecated
|
692
|
+
* As of TeamsJS v2.0.0, please use {@link app.AppInfo.appId | app.Context.app.appId} instead
|
693
|
+
*
|
694
|
+
* This ID is the unique identifier assigned to the app after deployment and is critical for ensuring the correct app instance is recognized across hosts.
|
695
|
+
*/
|
696
|
+
appId?: string;
|
697
|
+
/**
|
698
|
+
* @deprecated
|
699
|
+
* As of TeamsJS v2.0.0, please use {@link app.AppInfo.manifestVersion | app.Context.app.manifestVersion} instead
|
700
|
+
*
|
701
|
+
* The version of the manifest that the app is running.
|
702
|
+
*/
|
703
|
+
manifestVersion?: string;
|
690
704
|
}
|
691
705
|
/** Represents the parameters used to share a deep link. */
|
692
706
|
export interface ShareDeepLinkParameters {
|
@@ -0,0 +1,48 @@
|
|
1
|
+
/**
|
2
|
+
* Used to interact with mail capability, including opening and composing mail.
|
3
|
+
* @module
|
4
|
+
*
|
5
|
+
* @beta
|
6
|
+
*/
|
7
|
+
import { ComposeMailParams } from './mail';
|
8
|
+
/**
|
9
|
+
* Extended parameters for {@link composeMail}, including support for external handoff.
|
10
|
+
*
|
11
|
+
* This interface wraps {@link ComposeMailParamsWithHandoff} to provide additional functionality for scenarios
|
12
|
+
* where an external handoff is needed, such as transferring a draft email created in BizChat.
|
13
|
+
*
|
14
|
+
* @see {@link ComposeNewParams} for parameters when composing a new mail item.
|
15
|
+
* @see {@link ComposeReplyOrForwardParams} for reply or forward-specific parameters.
|
16
|
+
* @see {@link ComposeMailType} for supported mail operation types.
|
17
|
+
*
|
18
|
+
* @beta
|
19
|
+
*/
|
20
|
+
export interface ComposeMailParamsWithHandoff {
|
21
|
+
/**
|
22
|
+
* Base parameters for composing a mail item.
|
23
|
+
*/
|
24
|
+
composeMailParams: ComposeMailParams;
|
25
|
+
/**
|
26
|
+
* Use this endpoint to retrieve the handoff payload when BizChat creates an email draft for external handoff.
|
27
|
+
*/
|
28
|
+
handoffId: string;
|
29
|
+
}
|
30
|
+
/**
|
31
|
+
* Compose a new email in the user's mailbox, opening it in the drafts UX instead of the standard email.
|
32
|
+
*
|
33
|
+
* @param composeMailParamsWithHandoff - Object that specifies the type of mail item to compose and the details of the mail item.
|
34
|
+
* @returns { Promise<void> } - promise resolves after the compose window has opened successfully in host SDK.
|
35
|
+
* @throws Error with a message describing whether the capability is not initialized or the input is invalid.
|
36
|
+
*
|
37
|
+
* @beta
|
38
|
+
*/
|
39
|
+
export declare function composeMailWithHandoff(composeMailParamsWithHandoff: ComposeMailParamsWithHandoff): Promise<void>;
|
40
|
+
/**
|
41
|
+
* Checks if the mail capability and handoff sub-capability is supported by the host
|
42
|
+
* @returns boolean to represent whether the handoff sub-capability is supported
|
43
|
+
*
|
44
|
+
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
45
|
+
*
|
46
|
+
* @beta
|
47
|
+
*/
|
48
|
+
export declare function isSupported(): boolean;
|
@@ -2,6 +2,7 @@
|
|
2
2
|
* Used to interact with mail capability, including opening and composing mail.
|
3
3
|
* @module
|
4
4
|
*/
|
5
|
+
import * as handoff from './handoff';
|
5
6
|
/**
|
6
7
|
* Opens a mail message in the host.
|
7
8
|
*
|
@@ -86,9 +87,11 @@ export interface ComposeReplyOrForwardParams<T extends ComposeMailType> extends
|
|
86
87
|
/**
|
87
88
|
* Parameters supplied to {@link composeMail} when composing a new mail item
|
88
89
|
*
|
90
|
+
* For ComposeMailType.New, it is valid to pass empty arrays for toRecipients, ccRecipients, and bccRecipients.
|
91
|
+
* This will result in a new email with (pre-populated) body content but no pre-populated recipients.
|
89
92
|
* @see {@link ComposeNewParams}
|
90
93
|
* @see {@link ComposeReplyOrForwardParams}
|
91
94
|
* @see {@link ComposeMailType}
|
92
95
|
*/
|
93
96
|
export type ComposeMailParams = ComposeNewParams | ComposeReplyOrForwardParams<ComposeMailType.Reply> | ComposeReplyOrForwardParams<ComposeMailType.ReplyAll> | ComposeReplyOrForwardParams<ComposeMailType.Forward>;
|
94
|
-
export {};
|
97
|
+
export { handoff };
|
@@ -57,7 +57,9 @@ interface IRuntimeV4 extends IBaseRuntime {
|
|
57
57
|
readonly secondaryBrowser?: {};
|
58
58
|
readonly location?: {};
|
59
59
|
readonly logs?: {};
|
60
|
-
readonly mail?: {
|
60
|
+
readonly mail?: {
|
61
|
+
readonly handoff?: {};
|
62
|
+
};
|
61
63
|
readonly marketplace?: {};
|
62
64
|
readonly meetingRoom?: {};
|
63
65
|
readonly menus?: {};
|
@@ -1 +1 @@
|
|
1
|
-
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as r from"./private/logs.js";export{r as logs};import*as e from"./private/conversations.js";export{e as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as t from"./private/externalAppAuthentication.js";export{t as externalAppAuthentication};import*as p from"./private/externalAppAuthenticationForCEA.js";export{p as externalAppAuthenticationForCEA};import*as i from"./private/externalAppCardActions.js";export{i as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as a from"./private/externalAppCommands.js";export{a as externalAppCommands};import*as m from"./private/files.js";export{m as files};import*as n from"./private/meetingRoom.js";export{n as meetingRoom};import*as l from"./private/messageChannels/messageChannels.js";export{l as messageChannels};import*as c from"./private/notifications.js";export{c as notifications};import*as f from"./private/otherAppStateChange.js";export{f as otherAppStateChange};import*as x from"./private/remoteCamera.js";export{x as remoteCamera};import*as u from"./private/appEntity.js";export{u as appEntity};import*as j from"./private/teams/teams.js";export{j as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as d from"./private/hostEntity/hostEntity.js";export{d as hostEntity};import*as g from"./private/store.js";export{g as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as v from"./public/liveShareHost.js";export{v as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as C from"./public/authentication.js";export{C as authentication};import*as A from"./public/app/app.js";export{A as app};import*as h from"./public/appInstallDialog.js";export{h as appInstallDialog};import*as H from"./public/barCode.js";export{H as barCode};import*as T from"./public/chat.js";export{T as chat};import*as y from"./public/clipboard.js";export{y as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as S from"./public/nestedAppAuth.js";export{S as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as D from"./public/pages/pages.js";export{D as pages};import*as F from"./public/menus.js";export{F as menus};import*as w from"./public/media.js";export{w as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as B from"./public/location.js";export{B as location};import*as P from"./public/meeting/meeting.js";export{P as meeting};import*as L from"./public/monetization.js";export{L as monetization};import*as M from"./public/calendar.js";export{M as calendar};import*as U from"./public/mail.js";export{U as mail};import*as O from"./public/teamsAPIs.js";export{O as teamsCore};import*as z from"./public/people.js";export{z as people};import*as V from"./public/profile.js";export{V as profile};import*as W from"./public/videoEffects.js";export{W as videoEffects};import*as N from"./public/search.js";export{N as search};import*as R from"./public/sharing/sharing.js";export{R as sharing};import*as q from"./public/stageView/stageView.js";export{q as stageView};import*as G from"./public/visualMedia/visualMedia.js";export{G as visualMedia};import*as J from"./public/webStorage.js";export{J as webStorage};import*as K from"./public/call.js";export{K as call};import*as Q from"./public/appInitialization.js";export{Q as appInitialization};import*as X from"./public/thirdPartyCloudStorage.js";export{X as thirdPartyCloudStorage};import*as Y from"./public/settings.js";export{Y as settings};import*as Z from"./public/tasks.js";export{Z as tasks};import*as $ from"./public/marketplace.js";export{$ as marketplace};
|
1
|
+
export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as r from"./private/logs.js";export{r as logs};import*as e from"./private/conversations.js";export{e as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as t from"./private/externalAppAuthentication.js";export{t as externalAppAuthentication};import*as p from"./private/externalAppAuthenticationForCEA.js";export{p as externalAppAuthenticationForCEA};import*as i from"./private/externalAppCardActions.js";export{i as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as a from"./private/externalAppCommands.js";export{a as externalAppCommands};import*as m from"./private/files.js";export{m as files};import*as n from"./private/meetingRoom.js";export{n as meetingRoom};import*as l from"./private/messageChannels/messageChannels.js";export{l as messageChannels};import*as c from"./private/notifications.js";export{c as notifications};import*as f from"./private/otherAppStateChange.js";export{f as otherAppStateChange};import*as x from"./private/remoteCamera.js";export{x as remoteCamera};import*as u from"./private/appEntity.js";export{u as appEntity};import*as j from"./private/teams/teams.js";export{j as teams};import*as b from"./private/videoEffectsEx.js";export{b as videoEffectsEx};import*as d from"./private/hostEntity/hostEntity.js";export{d as hostEntity};import*as g from"./private/store.js";export{g as store};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as v from"./public/liveShareHost.js";export{v as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as C from"./public/authentication.js";export{C as authentication};import*as A from"./public/app/app.js";export{A as app};import*as h from"./public/appInstallDialog.js";export{h as appInstallDialog};import*as H from"./public/barCode.js";export{H as barCode};import*as T from"./public/chat.js";export{T as chat};import*as y from"./public/clipboard.js";export{y as clipboard};import*as E from"./public/dialog/dialog.js";export{E as dialog};import*as S from"./public/nestedAppAuth.js";export{S as nestedAppAuth};import*as I from"./public/geoLocation/geoLocation.js";export{I as geoLocation};import*as D from"./public/pages/pages.js";export{D as pages};import*as F from"./public/menus.js";export{F as menus};import*as w from"./public/media.js";export{w as media};import*as k from"./public/secondaryBrowser.js";export{k as secondaryBrowser};import*as B from"./public/location.js";export{B as location};import*as P from"./public/meeting/meeting.js";export{P as meeting};import*as L from"./public/monetization.js";export{L as monetization};import*as M from"./public/calendar.js";export{M as calendar};import*as U from"./public/mail/mail.js";export{U as mail};import*as O from"./public/teamsAPIs.js";export{O as teamsCore};import*as z from"./public/people.js";export{z as people};import*as V from"./public/profile.js";export{V as profile};import*as W from"./public/videoEffects.js";export{W as videoEffects};import*as N from"./public/search.js";export{N as search};import*as R from"./public/sharing/sharing.js";export{R as sharing};import*as q from"./public/stageView/stageView.js";export{q as stageView};import*as G from"./public/visualMedia/visualMedia.js";export{G as visualMedia};import*as J from"./public/webStorage.js";export{J as webStorage};import*as K from"./public/call.js";export{K as call};import*as Q from"./public/appInitialization.js";export{Q as appInitialization};import*as X from"./public/thirdPartyCloudStorage.js";export{X as thirdPartyCloudStorage};import*as Y from"./public/settings.js";export{Y as settings};import*as Z from"./public/tasks.js";export{Z as tasks};import*as $ from"./public/marketplace.js";export{$ as marketplace};
|
@@ -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 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
|
+
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),function(e){const n=L(o("v2","tasks.startTask"),e.func,e.args,!0);k.callbacks.set(n.uuid,((...n)=>{if(y.childWindow){const i=n.pop();X("Message from parent being relayed to child, id: %s",ae(e)),se(e.id,e.uuid,n,i)}}))}(n))}}(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 P(e){return e.map((e=>a(e)?e.serialize():e))}function A(n,i,o,r,a){var d;return e(this,void 0,void 0,(function*(){const e=P(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=P(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}),Q(i,o)}const F=b.extend("sendRequestToTargetWindowHelper");function Q(e,n){const i=F,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 z=b.extend("sendMessageToParentHelper");function L(e,n,i,o){const t=z,s=y.parentWindow,r=function(e,n,i,o){const t=k.nextMessageId++,s=new d;return k.legacyMessageIdsToUuidMap[t]=s,{id:t,uuid:s,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:i||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o}}(e,n,i,o);return g.storeCallbackInformation(r.uuid,{name:n,calledAt:r.timestamp}),t("Message %s information: %o",ae(r),{actionName:n,args:i}),Q(s,r)}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,A 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*as t from"../artifactsForCDN/validDomains.json.js";const i="2.0.1",s="2.0.2",e="2.0.3",n="2.0.4",o="2.0.1",a="1.9.0",r="2.0.0",m="1.7.0",l="1.8.0",d="2.0.0",h="1.9.0",p=t.validOrigins,c=new URL("https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json"),
|
1
|
+
import*as t from"../artifactsForCDN/validDomains.json.js";const i="2.0.1",s="2.0.2",e="2.0.3",n="2.0.4",o="2.0.1",a="1.9.0",r="2.0.0",m="1.7.0",l="1.8.0",d="2.0.0",h="1.9.0",p=t.validOrigins,c=1500,f=new URL("https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json"),j=/^https:\/\//,v="https",y="teams.microsoft.com",D="The library has not yet been initialized",T="The runtime has not yet been initialized",b="The runtime version is not supported",u="The call was not properly started";export{c as ORIGIN_LIST_FETCH_TIMEOUT_IN_MS,m as captureImageMobileSupportVersion,i as defaultSDKVersionForCompatCheck,u as errorCallNotStarted,D as errorLibraryNotInitialized,T as errorRuntimeNotInitialized,b as errorRuntimeNotSupported,d as getMediaCallbackSupportVersion,o as getUserJoinedTeamsSupportedAndroidClientVersion,n as imageOutputFormatsAPISupportVersion,a as locationAPIsRequiredVersion,l as mediaAPISupportVersion,e as nonFullScreenVideoModeAPISupportVersion,r as peoplePickerRequiredVersion,h as scanBarCodeAPIMobileSupportVersion,y as teamsDeepLinkHost,v as teamsDeepLinkProtocol,j as userOriginUrlValidationRegExp,f as validOriginsCdnEndpoint,p as validOriginsFallback,s as videoAndImageMediaAPISupportVersion};
|
@@ -1 +1 @@
|
|
1
|
-
import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as e}from"../public/runtime.js";import{errorLibraryNotInitialized as
|
1
|
+
import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as e}from"../public/runtime.js";import{errorLibraryNotInitialized as n,defaultSDKVersionForCompatCheck as o,userOriginUrlValidationRegExp as r}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{getLogger as s}from"./telemetry.js";import{compareSDKVersions as a}from"./utils.js";const f=s("internal"),c=f.extend("ensureInitializeCalled"),d=f.extend("ensureInitialized");function p(){if(!l.initializeCalled)throw c(n),new Error(n)}function m(i,...t){if(!l.initializeCompleted)throw d("%s. initializeCalled: %s",n,l.initializeCalled.toString()),new Error(n);if(t&&t.length>0){let i=!1;for(let e=0;e<t.length;e++)if(t[e]===l.frameContext){i=!0;break}if(!i)throw new Error(`This call is only allowed in following contexts: ${JSON.stringify(t)}. Current context: "${l.frameContext}".`)}return e(i)}function u(i=o){const t=a(l.clientSupportedSDKVersion,i);return!isNaN(t)&&t>=0}function C(){return l.hostClientType==i.android||l.hostClientType==i.ios||l.hostClientType==i.ipados||l.hostClientType==i.visionOS}function h(i=o){if(!C()){throw{errorCode:t.NOT_SUPPORTED_ON_PLATFORM}}if(!u(i)){throw{errorCode:t.OLD_PLATFORM}}}function w(i){let t=l.additionalValidOrigins.concat(i.filter((i=>"string"==typeof i&&r.test(i))));const e={};t=t.filter((i=>!e[i]&&(e[i]=!0,!0))),l.additionalValidOrigins=t}export{p as ensureInitializeCalled,m as ensureInitialized,u as isCurrentSDKVersionAtLeast,C as isHostClientMobile,w as processAdditionalValidOrigins,h as throwExceptionIfMobileApiIsNotSupported};
|
@@ -1 +1 @@
|
|
1
|
-
import{Buffer as
|
1
|
+
import{Buffer as t}from"../../../../_virtual/_polyfill-node.buffer.js";import{minAdaptiveCardVersion as e}from"../public/constants.js";import r from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";import n from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(t){return(t,e)=>{if(!t)throw new Error(e)}}function i(t,e){if("string"!=typeof t||"string"!=typeof e)return NaN;const r=t.split("."),n=e.split(".");function o(t){return/^\d+$/.test(t)}if(!r.every(o)||!n.every(o))return NaN;for(;r.length<n.length;)r.push("0");for(;n.length<r.length;)n.push("0");for(let t=0;t<r.length;++t)if(Number(r[t])!=Number(n[t]))return Number(r[t])>Number(n[t])?1:-1;return 0}function c(){return r()}function u(t){return Object.keys(t).forEach((e=>{null!==t[e]&&void 0!==t[e]&&"object"==typeof t[e]&&u(t[e])})),Object.freeze(t)}function s(t,e,...r){const n=t(...r);return n.then((t=>{e&&e(void 0,t)})).catch((t=>{e&&e(t)})),n}function f(t,e,...r){const n=t(...r);return n.then((()=>{e&&e(null)})).catch((t=>{e&&e(t)})),n}function l(t,e,...r){const n=t(...r);return n.then((t=>{e&&e(null,t)})).catch((t=>{e&&e(t,null)})),n}function a(t,e,r){return new Promise(((n,o)=>{const i=setTimeout(o,e,r);t().then((t=>{clearTimeout(i),n(t)})).catch((t=>{clearTimeout(i),o(t)}))}))}function p(t){const e=new URL("https://teams.microsoft.com/l/entity/"+encodeURIComponent(t.appId.toString())+"/"+encodeURIComponent(t.pageId));return t.webUrl&&e.searchParams.append("webUrl",t.webUrl.toString()),(t.chatId||t.channelId||t.subPageId)&&e.searchParams.append("context",JSON.stringify({chatId:t.chatId,channelId:t.channelId,subEntityId:t.subPageId})),e.toString()}function d(t){return!(i(`${t.majorVersion}.${t.minorVersion}`,`${e.majorVersion}.${e.minorVersion}`)>=0)}function m(t){return"https:"===t.protocol}function h(e,r){return new Promise(((n,o)=>{if(e||o("MimeType cannot be null or empty."),r||o("Base64 string cannot be null or empty."),e.startsWith("image/")){const t=atob(r),o=new Uint8Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);n(new Blob([o],{type:e}))}const i=t.from(r,"base64").toString();n(new Blob([i],{type:e}))}))}function b(t){return new Promise(((e,r)=>{0===t.size&&r(new Error("Blob cannot be empty."));const n=new FileReader;n.onloadend=()=>{n.result?e(n.result.toString().split(",")[1]):r(new Error("Failed to read the blob"))},n.onerror=()=>{r(n.error)},n.readAsDataURL(t)}))}function w(){if(g())throw new Error("window object undefined at SSR check");return window}function g(){return"undefined"==typeof window}function y(t,e){if(v(t)||!function(t){return t.length<256&&t.length>4}(t)||!function(t){for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<32||r>126)return!1}return!0}(t))throw e||new Error("id is not valid.")}function j(t,e){const r=t.toString().toLocaleLowerCase();if(v(r))throw new Error("Invalid Url");if(r.length>2048)throw new Error("Url exceeds the maximum size of 2048 characters");if(!m(t))throw new Error("Url should be a valid https url")}function E(t){const e=document.createElement("a");return e.href=t,new URL(e.href)}function v(t){return new RegExp(`${/<script[^>]*>|<script[^&]*>|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|<\/script[^&]*>|%3C\/script[^%]*%3E/gi.source}`,"gi").test(t)}function I(t){if(!t)throw new Error("id must not be empty");if(!1===n(t))throw new Error("id must be a valid UUID")}const U=!!performance&&"now"in performance;function O(){return U?performance.now()+performance.timeOrigin:void 0}function S(t,e=0){if(e>1e3)return!1;if(void 0===t||"boolean"==typeof t||"number"==typeof t||"bigint"==typeof t||"string"==typeof t||null===t)return!0;if(Array.isArray(t))return t.every((t=>S(t,e+1)));return!("object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t)||Object.getPrototypeOf(t)!==Object.prototype&&null!==Object.getPrototypeOf(t))&&Object.keys(t).every((r=>S(t[r],e+1)))}export{h as base64ToBlob,s as callCallbackWithErrorOrResultFromPromiseAndReturnPromise,l as callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise,f as callCallbackWithSdkErrorFromPromiseAndReturnPromise,i as compareSDKVersions,p as createTeamsAppLink,u as deepFreeze,E as fullyQualifyUrlString,c as generateGUID,b as getBase64StringFromBlob,O as getCurrentTimestamp,o as getGenericOnCompleteHandler,v as hasScriptTags,g as inServerSideRenderingEnvironment,d as isHostAdaptiveCardSchemaVersionUnsupported,S as isPrimitiveOrPlainObject,m as isValidHttpsURL,a as runWithTimeout,w as ssrSafeWindow,y as validateId,j as validateUrl,I as validateUuid};
|
@@ -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{
|
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{ORIGIN_LIST_FETCH_TIMEOUT_IN_MS as t,validOriginsCdnEndpoint as r,validOriginsFallback as n}from"./constants.js";import{GlobalVars as e}from"./globalVars.js";import{getLogger as o}from"./telemetry.js";import{inServerSideRenderingEnvironment as l,isValidHttpsURL as s}from"./utils.js";let a=[];const u=o("validateOrigin");function c(){return i(this,void 0,void 0,(function*(){yield d()}))}function d(e=!1){return i(this,void 0,void 0,(function*(){if(0!==a.length&&!e)return a;if(l())return a=n,n;{u("Initiating fetch call to acquire valid origins list from CDN");const i=new AbortController,e=setTimeout((()=>i.abort()),t);return fetch(r,{signal:i.signal}).then((i=>{if(clearTimeout(e),!i.ok)throw new Error("Invalid Response from Fetch Call");return u("Fetch call completed and retrieved valid origins list from CDN"),i.json().then((i=>{if(function(i){let t=JSON.parse(i);try{t=JSON.parse(i)}catch(i){return!1}if(!t.validOrigins)return!1;for(const i of t.validOrigins)try{new URL("https://"+i)}catch(t){return u("isValidOriginsFromCDN call failed to validate origin: %s",i),!1}return!0}(JSON.stringify(i)))return a=i.validOrigins,a;throw new Error("Valid origins list retrieved from CDN is invalid")}))})).catch((i=>("AbortError"===i.name?u(`validOrigins fetch call to CDN failed due to Timeout of ${t} ms. Defaulting to fallback list`):u("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",i),a=n,a)))}}))}function f(i,t){if("*."===i.substring(0,2)){const r=i.substring(1);if(t.length>r.length&&t.split(".").length===r.split(".").length&&t.substring(t.length-r.length)===r)return!0}else if(i===t)return!0;return!1}function g(i,t){return d(t).then((t=>{if(!s(i))return u("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",i,i.protocol),!1;const r=i.host;if(t.some((i=>f(i,r))))return!0;for(const i of e.additionalValidOrigins){if(f("https://"===i.substring(0,8)?i.substring(8):i,r))return!0}return u("Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o",i,t,e.additionalValidOrigins),!1}))}c();export{c as prefetchOriginsFromCDN,g as validateOrigin};
|
@@ -1 +1 @@
|
|
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{getLogger as r,getApiVersionTag as i}from"../../internal/telemetry.js";import{getCurrentTimestamp 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{getLogger as r,getApiVersionTag as i}from"../../internal/telemetry.js";import{getCurrentTimestamp as n}from"../../internal/utils.js";import{runtime as m}from"../../public/runtime.js";const s=r("copilot");function l(){var t;return e(m)&&!!(null===(t=m.supports.copilot)||void 0===t?void 0:t.customTelemetry)}function p(r,l){var p;return void 0===l&&(l=null!==(p=n())&&void 0!==p?p:Date.now()),t(this,void 0,void 0,(function*(){return e(m),s("Sending custom telemetry data to host for stage: %s to record timestamp: %s",r,l),o("copilot.customTelemetry.sendCustomTelemetryData",[r.toString(),l],i("v2","copilot.customTelemetry.sendCustomTelemetryData"))}))}export{l as isSupported,p as sendCustomTelemetryData};
|
@@ -1 +1 @@
|
|
1
|
-
import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as s}from"../../internal/appHelpers.js";import{uninitializeCommunication as r,sendAndUnwrap as l,Communication as m}from"../../internal/communication.js";import{GlobalVars as d}from"../../internal/globalVars.js";import{uninitializeHandlers as p,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as u}from"../../internal/internalAPIs.js";import{getLogger as f,getApiVersionTag as h}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as
|
1
|
+
import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as s}from"../../internal/appHelpers.js";import{uninitializeCommunication as r,sendAndUnwrap as l,Communication as m}from"../../internal/communication.js";import{GlobalVars as d}from"../../internal/globalVars.js";import{uninitializeHandlers as p,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as u}from"../../internal/internalAPIs.js";import{getLogger as f,getApiVersionTag as h}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as I}from"../../internal/utils.js";import{AppId as g}from"../appId.js";import{HostName as y,HostClientType as S}from"../constants.js";import{version as T}from"../version.js";import*as C from"./lifecycle.js";export{C as lifecycle};import{_clearTelemetryPort as v}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as P}from"../../private/messageChannels/dataLayer.js";const j="v2",w=f("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var O,b;function F(){return d.initializeCompleted}function x(){return d.frameContext}function L(i){return e(h(j,"app.initialize"),i)}function A(e){m.currentWindow=e}function z(){d.initializeCalled&&(p(),d.initializeCalled=!1,d.initializeCompleted=!1,d.initializePromise=void 0,d.additionalValidOrigins=[],d.frameContext=void 0,d.hostClientType=void 0,d.isFramelessWindow=!1,v(),P(),r())}function D(){return new Promise((e=>{u(),e(l(h(j,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:y.teams,clientType:e.hostClientType?e.hostClientType:S.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId,appId:e.appId?new g(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))}function k(){u(),i(h(j,"app.notifyAppLoaded"))}function U(){return t(h(j,"app.notifySuccess"))}function V(e){u(),n(h(j,"app.notifyFailure"),e)}function E(e){u(),a(h(j,"app.notifyExpectedFailure"),e)}function H(e){o(h(j,"app.registerOnThemeChangeHandler"),e)}function M(e){c(e)}function W(e){return s(h(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(O||(O={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),w("teamsjs instance is version %s, starting at %s UTC (%s local)",T,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(I())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?w("teamsjs is being used from %s. %s",i,t):w("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,O as FailedReason,N as Messages,A as _initialize,z as _uninitialize,D as getContext,x as getFrameContext,L as initialize,F as isInitialized,k as notifyAppLoaded,E as notifyExpectedFailure,V as notifyFailure,U as notifySuccess,W as openLink,M as registerHostToAppPerformanceMetricsHandler,H as registerOnThemeChangeHandler};
|
@@ -1 +1 @@
|
|
1
|
-
import{ErrorCode as e}from"./interfaces.js";var o,a,
|
1
|
+
import{ErrorCode as e}from"./interfaces.js";var o,s,a,i,n,t,r;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.visionOS="visionOS",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(s||(s={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(a||(a={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(i||(i={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(n||(n={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(t||(t={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(r||(r={}));const m={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},d={majorVersion:1,minorVersion:5},u={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},l=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),c=new Error("Invalid response: Received more images than the specified max limit in the response.");export{r as ChannelType,t as DialogDimension,a as FrameContexts,o as HostClientType,s as HostName,t as TaskModuleDimension,i as TeamType,n as UserTeamRole,l as errorInvalidCount,c as errorInvalidResponse,m as errorNotSupportedOnPlatform,d as minAdaptiveCardVersion,u as teamsMinAdaptiveCardVersion};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{callFunctionInHost as o}from"../../internal/communication.js";import{validateEmailAddress as t}from"../../internal/emailAddressValidation.js";import{ensureInitialized as n}from"../../internal/internalAPIs.js";import{getApiVersionTag as r}from"../../internal/telemetry.js";import{FrameContexts as i}from"../constants.js";import{runtime as e}from"../runtime.js";import{ComposeMailType as a}from"./mail.js";function s(o){o&&0!==o.length&&o.forEach((o=>{t(o)}))}function m(t){if(n(e,i.content),!f())throw new Error("Not supported");return function(o){if(!o.handoffId||0==o.handoffId.trim().length||""===o.handoffId.trim())throw new Error("handoffId should not be null or empty string.");const t=o.composeMailParams;t.type===a.New&&(s(t.toRecipients),s(t.ccRecipients),s(t.bccRecipients))}(t),o("mail.handoff.composeMail",[new c(t)],r("v2","mail.handoff.composeMail"))}function f(){return!!(n(e)&&e.supports.mail&&e.supports.mail.handoff)}class c{constructor(o){this.composeMailParamsWithHandoff=o}serialize(){return this.composeMailParamsWithHandoff}}export{m as composeMailWithHandoff,f as isSupported};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{sendAndHandleStatusAndReason as r}from"../../internal/communication.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{getApiVersionTag as t}from"../../internal/telemetry.js";import{FrameContexts as e}from"../constants.js";import{runtime as n}from"../runtime.js";import*as i from"./handoff.js";export{i as handoff};function m(i){return new Promise((m=>{if(o(n,e.content),!l())throw new Error("Not supported");if(!i.itemId||!i.itemId.trim())throw new Error("Must supply an itemId to openMailItem");m(r(t("v2","mail.openMailItem"),"mail.openMailItem",i))}))}function p(i){return new Promise((m=>{if(o(n,e.content),!l())throw new Error("Not supported");m(r(t("v2","mail.composeMail"),"mail.composeMail",i))}))}function l(){return!(!o(n)||!n.supports.mail)}var a;!function(r){r.New="new",r.Reply="reply",r.ReplyAll="replyAll",r.Forward="forward"}(a||(a={}));export{a as ComposeMailType,p as composeMail,l as isSupported,m as openMailItem};
|
@@ -1 +1 @@
|
|
1
|
-
import{GlobalVars as t}from"../internal/globalVars.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{HostClientType as o}from"./constants.js";import{runtime as e}from"./runtime.js";function
|
1
|
+
import{GlobalVars as t}from"../internal/globalVars.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{HostClientType as o}from"./constants.js";import{runtime as e}from"./runtime.js";function i(){var i;return null!==(i=n(e)&&(e.isNAAChannelRecommended||!(!n(e)||t.hostClientType!==o.android&&t.hostClientType!==o.ios&&t.hostClientType!==o.ipados&&t.hostClientType!==o.visionOS||!e.isLegacyTeams||!e.supports.nestedAppAuth)))&&void 0!==i&&i}export{i as isNAAChannelRecommended};
|