vss-web-extension-sdk
Advanced tools
Comparing version 1.97.0 to 1.98.0
@@ -764,3 +764,3 @@ //---------------------------------------------------------- | ||
// Loader already configured, just issue require | ||
window.require(modulesArray, callback); | ||
issueVssRequire(modulesArray, callback); | ||
} | ||
@@ -781,3 +781,3 @@ else { | ||
ready(function () { | ||
window.require(modulesArray, callback); | ||
issueVssRequire(modulesArray, callback); | ||
}); | ||
@@ -787,2 +787,7 @@ } | ||
VSS.require = require; | ||
function issueVssRequire(modules, callback) { | ||
window.require(["VSS/Bundling"], function (VSS_Bundling) { | ||
VSS_Bundling.requireModules(modules, callback); | ||
}); | ||
} | ||
/** | ||
@@ -1022,2 +1027,5 @@ * Register a callback that gets called once the initial setup/handshake has completed. | ||
} | ||
if (hostPageContext.coreReferences.extensionCoreReferences) { | ||
scripts.push({ source: getAbsoluteUrl(hostPageContext.coreReferences.extensionCoreReferences.url, hostRootUri) }); | ||
} | ||
} | ||
@@ -1024,0 +1032,0 @@ // Define a new config for extension loader |
//---------------------------------------------------------- | ||
// Copyright (C) Microsoft Corporation. All rights reserved. | ||
//---------------------------------------------------------- | ||
var XDM,VSS;(function(n){function u(){return new o}function s(){return Math.floor(Math.random()*(f-t)+t).toString(36)+Math.floor(Math.random()*(f-t)+t).toString(36)}var i,r,e;n.createDeferred=u;var o=function(){function n(){var n=this;this._resolveCallbacks=[];this._rejectCallbacks=[];this._isResolved=!1;this._isRejected=!1;this.resolve=function(t){n._resolve(t)};this.reject=function(t){n._reject(t)};this.promise={};this.promise.then=function(t,i){return n._then(t,i)}}return n.prototype._then=function(t,i){var u=this,r;return!t&&!i||this._isResolved&&!t||this._isRejected&&!i?this.promise:(r=new n,this._resolveCallbacks.push(function(n){u._wrapCallback(t,n,r,!1)}),this._rejectCallbacks.push(function(n){u._wrapCallback(i,n,r,!0)}),this._isResolved?this._resolve(this._resolvedValue):this._isRejected&&this._reject(this._rejectValue),r.promise)},n.prototype._wrapCallback=function(n,t,i,r){if(!n){r?i.reject(t):i.resolve(t);return}var u;try{u=n(t)}catch(f){i.reject(f);return}u===undefined?i.resolve(t):u&&typeof u.then=="function"?u.then(function(n){i.resolve(n)},function(n){i.reject(n)}):i.resolve(u)},n.prototype._resolve=function(n){if(this._isRejected||this._isResolved||(this._isResolved=!0,this._resolvedValue=n),this._isResolved&&this._resolveCallbacks.length>0){var t=this._resolveCallbacks.splice(0);window.setTimeout(function(){for(var i=0,r=t.length;i<r;i++)t[i](n)})}},n.prototype._reject=function(n){if(this._isRejected||this._isResolved||(this._isRejected=!0,this._rejectValue=n,this._rejectCallbacks.length===0&&window.console&&window.console.warn&&(console.warn("Rejected XDM promise with no reject callbacks"),n&&console.warn(n))),this._isRejected&&this._rejectCallbacks.length>0){var t=this._rejectCallbacks.splice(0);window.setTimeout(function(){for(var i=0,r=t.length;i<r;i++)t[i](n)})}},n}(),t=parseInt("10000000000",36),f=Number.MAX_SAFE_INTEGER||9007199254740991;i=function(){function n(){this._registeredObjects={}}return n.prototype.register=function(n,t){this._registeredObjects[n]=t},n.prototype.getInstance=function(n,t){var i=this._registeredObjects[n];return i?typeof i=="function"?i(t):i:null},n}();n.XDMObjectRegistry=i;n.globalObjectRegistry=new i;r=function(){function t(n,r){r===void 0&&(r=null);this._nextMessageId=1;this._deferreds={};this._nextProxyFunctionId=1;this._proxyFunctions={};this._postToWindow=n;this._targetOrigin=r;this._channelObjectRegistry=new i;this._channelId=t._nextChannelId++;this._targetOrigin||(this._handshakeToken=s())}return t.prototype.getObjectRegistry=function(){return this._channelObjectRegistry},t.prototype.invokeRemoteMethod=function(n,t,i,r,f){var e={id:this._nextMessageId++,methodName:n,instanceId:t,instanceContext:r,params:this._customSerializeObject(i,f),jsonrpc:"2.0",serializationSettings:f},o;return this._targetOrigin||(e.handshakeToken=this._handshakeToken),o=u(),this._deferreds[e.id]=o,this._sendRpcMessage(e),o.promise},t.prototype.getRemoteObjectProxy=function(n,t){return this.invokeRemoteMethod(null,n,null,t)},t.prototype.invokeMethod=function(n,t){var f=this,r,u,i;if(!t.methodName){this._success(t,n,t.handshakeToken);return}if(r=n[t.methodName],typeof r!="function"){this._error(t,new Error("RPC method not found: "+t.methodName),t.handshakeToken);return}try{u=[];t.params&&(u=this._customDeserializeObject(t.params));i=r.apply(n,u);i&&i.then&&typeof i.then=="function"?i.then(function(n){f._success(t,n,t.handshakeToken)},function(n){f._error(t,n,t.handshakeToken)}):this._success(t,i,t.handshakeToken)}catch(e){this._error(t,e,t.handshakeToken)}},t.prototype.getRegisteredObject=function(t,i){if(t==="__proxyFunctions")return this._proxyFunctions;var r=this._channelObjectRegistry.getInstance(t,i);return r||(r=n.globalObjectRegistry.getInstance(t,i)),r},t.prototype.onMessage=function(n){var u=this,t=n,i,r;if(t.instanceId){if(i=this.getRegisteredObject(t.instanceId,t.instanceContext),!i)return!1;typeof i.then=="function"?i.then(function(n){u.invokeMethod(n,t)},function(n){u._error(t,n,t.handshakeToken)}):this.invokeMethod(i,t)}else{if(r=this._deferreds[t.id],!r)return!1;t.error?r.reject(this._customDeserializeObject([t.error])[0]):r.resolve(this._customDeserializeObject([t.result])[0]);delete this._deferreds[t.id]}return!0},t.prototype.owns=function(n,t,i){var r=i;if(this._postToWindow===n){if(this._targetOrigin)return t?t.toLowerCase()==="null"||this._targetOrigin.toLowerCase().indexOf(t.toLowerCase())===0:!1;if(r.handshakeToken&&r.handshakeToken===this._handshakeToken)return this._targetOrigin=t,!0}return!1},t.prototype.error=function(n,t){var i=n;this._error(i,t,i.handshakeToken)},t.prototype._error=function(n,t,i){var r={id:n.id,error:this._customSerializeObject([t],n.serializationSettings)[0],jsonrpc:"2.0",handshakeToken:i};this._sendRpcMessage(r)},t.prototype._success=function(n,t,i){var r={id:n.id,result:this._customSerializeObject([t],n.serializationSettings)[0],jsonrpc:"2.0",handshakeToken:i};this._sendRpcMessage(r)},t.prototype._sendRpcMessage=function(n){var t=JSON.stringify(n);this._postToWindow.postMessage(t,"*")},t.prototype._shouldSkipSerialization=function(n){for(var r,i=0,u=t.WINDOW_TYPES_TO_SKIP_SERIALIZATION.length;i<u;i++)if(r=t.WINDOW_TYPES_TO_SKIP_SERIALIZATION[i],window[r]&&n instanceof window[r])return!0;if(window.jQuery)for(i=0,u=t.JQUERY_TYPES_TO_SKIP_SERIALIZATION.length;i<u;i++)if(r=t.JQUERY_TYPES_TO_SKIP_SERIALIZATION[i],window.jQuery[r]&&n instanceof window.jQuery[r])return!0;return!1},t.prototype._customSerializeObject=function(n,i,r,u,f){var h=this,a,o,l,v,e,c,s;if((r===void 0&&(r=null),u===void 0&&(u=1),f===void 0&&(f=1),!n||f>t.MAX_XDM_DEPTH)||this._shouldSkipSerialization(n))return null;if(a=function(t,e,o){var s,c,l,a,v;try{s=t[o]}catch(y){}(c=typeof s,c!=="undefined")&&(l=-1,c==="object"&&(l=r.originalObjects.indexOf(s)),l>=0?(a=r.newObjects[l],a.__circularReferenceId||(a.__circularReferenceId=u++),e[o]={__circularReference:a.__circularReferenceId}):c==="function"?(v=h._nextProxyFunctionId++,e[o]={__proxyFunctionId:h._registerProxyFunction(s,n),__channelId:h._channelId}):c==="object"?e[o]=s&&s instanceof Date?{__proxyDate:s.getTime()}:h._customSerializeObject(s,i,r,u,f+1):o!=="__proxyFunctionId"&&(e[o]=s))},r||(r={newObjects:[],originalObjects:[]}),r.originalObjects.push(n),n instanceof Array)for(o=[],r.newObjects.push(o),e=0,c=n.length;e<c;e++)a(n,o,e);else{o={};r.newObjects.push(o);l={};try{for(s in n)l[s]=!0;for(v=Object.getOwnPropertyNames(n),e=0,c=v.length;e<c;e++)l[v[e]]=!0}catch(y){}for(s in l)(s&&s[0]!=="_"||i&&i.includeUnderscoreProperties)&&a(n,o,s)}return r.originalObjects.pop(),r.newObjects.pop(),o},t.prototype._registerProxyFunction=function(n,t){var i=this._nextProxyFunctionId++;return this._proxyFunctions["proxy"+i]=function(){return n.apply(t,Array.prototype.slice.call(arguments,0))},i},t.prototype._customDeserializeObject=function(n,t){var e=this,o=this,r,i,u,f;if(!n)return null;if(t||(t={}),r=function(n,i){var r=n[i],u=typeof r;i==="__circularReferenceId"&&u==="number"?(t[r]=n,delete n[i]):u==="object"&&r&&(r.__proxyFunctionId?n[i]=function(){return o.invokeRemoteMethod("proxy"+r.__proxyFunctionId,"__proxyFunctions",Array.prototype.slice.call(arguments,0),null,{includeUnderscoreProperties:!0})}:r.__proxyDate?n[i]=new Date(r.__proxyDate):r.__circularReference?n[i]=t[r.__circularReference]:e._customDeserializeObject(r,t))},n instanceof Array)for(i=0,u=n.length;i<u;i++)r(n,i);else if(typeof n=="object")for(f in n)r(n,f);return n},t._nextChannelId=1,t.MAX_XDM_DEPTH=100,t.WINDOW_TYPES_TO_SKIP_SERIALIZATION=["Node","Window","Event"],t.JQUERY_TYPES_TO_SKIP_SERIALIZATION=["jQuery"],t}();n.XDMChannel=r;e=function(){function n(){this._channels=[];this._subscribe(window)}return n.get=function(){return this._default||(this._default=new n),this._default},n.prototype.addChannel=function(n,t){var i=new r(n,t);return this._channels.push(i),i},n.prototype._handleMessageReceived=function(n){var i,e,r,t,u,f;if(typeof n.data=="string")try{t=JSON.parse(n.data)}catch(o){}if(t){for(u=!1,i=0,e=this._channels.length;i<e;i++)r=this._channels[i],r.owns(n.source,n.origin,t)&&(f=r,u=r.onMessage(t,n.origin)||u);!f||u||(window.console&&console.error("No handler found on any channel for message: "+JSON.stringify(t)),t.instanceId&&f.error(t,"The registered object "+t.instanceId+" could not be found."))}},n.prototype._subscribe=function(n){var t=this;n.addEventListener?n.addEventListener("message",function(n){t._handleMessageReceived(n)}):n.attachEvent("onmessage",function(n){t._handleMessageReceived(n)})},n}();n.XDMChannelManager=e})(XDM||(XDM={})),function(n){function d(n){i=n||{};f=i.usePlatformScripts;c=i.usePlatformStyles;window.setTimeout(function(){var n={notifyLoadSucceeded:!i.explicitNotifyLoaded,extensionReusedCallback:i.extensionReusedCallback};r.invokeRemoteMethod("initialHandshake","VSS.HostControl",[n]).then(function(n){t=n.pageContext;w=t.webContext;b=n.initialConfig||{};k=n.contribution;s=n.extensionContext;f||c?ft():p()})},0)}function st(n,t){var r;r=typeof n=="string"?[n]:n;t||(t=function(){});h?window.require(r,t):(i?f||(f=!0,o&&(o=!1,ft())):d({usePlatformScripts:!0}),g(function(){window.require(r,t)}))}function g(n){o?window.setTimeout(n,0):(u||(u=[]),u.push(n))}function ht(){r.invokeRemoteMethod("notifyLoadSucceeded","VSS.HostControl")}function nt(n){r.invokeRemoteMethod("notifyLoadFailed","VSS.HostControl",[n])}function tt(){return w}function ct(){return b}function it(){return s}function lt(){return k}function at(n,t){return t||(t={}),t.webContext||(t.webContext=tt()),t.extensionContext||(t.extensionContext=it()),rt(n).then(function(n){return n.getInstance(n.id,t)})}function rt(t){var i=XDM.createDeferred();return n.ready(function(){r.invokeRemoteMethod("getServiceContribution","vss.hostManagement",[t]).then(function(n){var t=n;t.getInstance=function(t,i){return ut(n,t,i)};i.resolve(t)},i.reject)}),i.promise}function vt(t){var i=XDM.createDeferred();return n.ready(function(){r.invokeRemoteMethod("getContributionsForTarget","vss.hostManagement",[t]).then(function(n){var t=[];n.forEach(function(n){var i=n;i.getInstance=function(t,i){return ut(n,t,i)};t.push(i)});i.resolve(t)},i.reject)}),i.promise}function ut(t,i,u){var f=XDM.createDeferred();return n.ready(function(){r.invokeRemoteMethod("getBackgroundContributionInstance","vss.hostManagement",[t,i,u]).then(f.resolve,f.reject)}),f.promise}function yt(n,t){r.getObjectRegistry().register(n,t)}function pt(n,t){return r.getObjectRegistry().getInstance(n,t)}function wt(){return r.invokeRemoteMethod("getAccessToken","VSS.HostControl")}function bt(){return r.invokeRemoteMethod("getAppToken","VSS.HostControl")}function kt(){e||(e=document.getElementsByTagName("body").item(0));r.invokeRemoteMethod("resize","VSS.HostControl",[e.scrollWidth,e.scrollHeight])}function ft(){var u=ni(t.webContext),o,g,n,w,e,b,k,nt,tt,d,r;if(window.__vssPageContext=t,window.__cultureInfo=t.microsoftAjaxConfig.cultureInfo,c!==!1&&t.coreReferences.stylesheets&&t.coreReferences.stylesheets.forEach(function(n){if(n.isCoreStylesheet){var t=document.createElement("link");t.href=y(n.url,u);t.rel="stylesheet";v(t,"head")}}),!f){h=!0;p();return}if(o=[],g=!1,t.coreReferences.scripts&&(t.coreReferences.scripts.forEach(function(n){if(n.isCoreModule){var i=!1,t=window;n.identifier==="JQuery"?i=!!t.jQuery:n.identifier==="JQueryUI"?i=!!(t.jQuery&&t.jQuery.ui&&t.jQuery.ui.version):n.identifier==="AMDLoader"&&(i=typeof t.define=="function"&&!!t.define.amd);i?g=!0:o.push({source:y(n.url,u)})}}),t.coreReferences.coreScriptsBundle&&!g&&(o=[{source:y(t.coreReferences.coreScriptsBundle.url,u)}])),n={baseUrl:s.baseUri,contributionPaths:null,paths:{},shim:{}},i.moduleLoaderConfig&&(i.moduleLoaderConfig.baseUrl&&(n.baseUrl=i.moduleLoaderConfig.baseUrl),gt(i.moduleLoaderConfig,n),et(i.moduleLoaderConfig,n)),t.moduleLoaderConfig&&(et(t.moduleLoaderConfig,n),w=t.moduleLoaderConfig.contributionPaths,w))for(e in w)if(w.hasOwnProperty(e)&&!n.paths[e]&&(b=w[e].value,n.paths[e]=b.match("^https?://")?b:u+b,k=t.moduleLoaderConfig.paths,k)){nt=e+"/";tt=l(u,t.moduleLoaderConfig.baseUrl);for(d in k)dt(d,nt)&&(r=k[d],r.match("^https?://")||(r=r[0]==="/"?l(u,r):l(tt,r)),n.paths[d]=r)}window.__vssModuleLoaderConfig=n;o.push({content:"require.config("+JSON.stringify(n)+");"});a(o,0,function(){h=!0;p()})}function dt(n,t){return n&&n.length>=t.length?n.substr(0,t.length).localeCompare(t)===0:!1}function l(n,t){var i=n||"";return i[i.length-1]!=="/"&&(i+="/"),t&&(i+=t[0]==="/"?t.substr(1):t),i}function gt(n,t,i){var r,u;if(n.paths){t.paths||(t.paths={});for(r in n.paths)n.paths.hasOwnProperty(r)&&(u=n.paths[r],i&&(u=i(r,n.paths[r])),u&&(t.paths[r]=u))}}function et(n,t){if(n.shim){t.shim||(t.shim={});for(var i in n.shim)n.shim.hasOwnProperty(i)&&(t.shim[i]=n.shim[i])}}function ni(n){var r=n.account||n.host,t=r.uri,i=r.relativeUri;return t&&i&&(t[t.length-1]!=="/"&&(t+="/"),i[i.length-1]!=="/"&&(i+="/"),t=t.substr(0,t.length-i.length)),t}function a(n,t,i){var f=this,r,u;if(t>=n.length){i.call(this);return}r=document.createElement("script");r.type="text/javascript";n[t].source?(u=n[t].source,r.src=u,r.addEventListener("load",function(){a.call(f,n,t+1,i)}),r.addEventListener("error",function(){nt("Failed to load script: "+u)}),v(r,"head")):n[t].content&&(r.textContent=n[t].content,v(r,"head"),a.call(this,n,t+1,i))}function v(n,t){var i=document.getElementsByTagName(t)[0];i||(i=document.createElement(t),document.appendChild(i));i.appendChild(n)}function y(n,t){var i=(n||"").toLowerCase();return i.substr(0,2)!=="//"&&i.substr(0,5)!=="http:"&&i.substr(0,6)!=="https:"&&(n=t+(i[0]==="/"?"":"/")+n),n}function p(){var t=this,n;o=!0;u&&(n=u,u=null,n.forEach(function(n){n.call(t)}))}n.VssSDKVersion=.1;n.VssSDKRestVersion="2.2";var e,w,t,s,b,k,i,h=!1,f,c,o=!1,u,r=XDM.XDMChannelManager.get().addChannel(window.parent),ot;(function(n){n.Dialog="ms.vss-web.dialog-service";n.Navigation="ms.vss-web.navigation-service";n.ExtensionData="ms.vss-web.data-service"})(ot=n.ServiceIds||(n.ServiceIds={}));n.init=d;n.require=st;n.ready=g;n.notifyLoadSucceeded=ht;n.notifyLoadFailed=nt;n.getWebContext=tt;n.getConfiguration=ct;n.getExtensionContext=it;n.getContribution=lt;n.getService=at;n.getServiceContribution=rt;n.getServiceContributions=vt;n.register=yt;n.getRegisteredObject=pt;n.getAccessToken=wt;n.getAppToken=bt;n.resize=kt}(VSS||(VSS={})); | ||
var XDM,VSS;(function(n){function u(){return new o}function s(){return Math.floor(Math.random()*(f-t)+t).toString(36)+Math.floor(Math.random()*(f-t)+t).toString(36)}var i,r,e;n.createDeferred=u;var o=function(){function n(){var n=this;this._resolveCallbacks=[];this._rejectCallbacks=[];this._isResolved=!1;this._isRejected=!1;this.resolve=function(t){n._resolve(t)};this.reject=function(t){n._reject(t)};this.promise={};this.promise.then=function(t,i){return n._then(t,i)}}return n.prototype._then=function(t,i){var u=this,r;return!t&&!i||this._isResolved&&!t||this._isRejected&&!i?this.promise:(r=new n,this._resolveCallbacks.push(function(n){u._wrapCallback(t,n,r,!1)}),this._rejectCallbacks.push(function(n){u._wrapCallback(i,n,r,!0)}),this._isResolved?this._resolve(this._resolvedValue):this._isRejected&&this._reject(this._rejectValue),r.promise)},n.prototype._wrapCallback=function(n,t,i,r){if(!n){r?i.reject(t):i.resolve(t);return}var u;try{u=n(t)}catch(f){i.reject(f);return}u===undefined?i.resolve(t):u&&typeof u.then=="function"?u.then(function(n){i.resolve(n)},function(n){i.reject(n)}):i.resolve(u)},n.prototype._resolve=function(n){if(this._isRejected||this._isResolved||(this._isResolved=!0,this._resolvedValue=n),this._isResolved&&this._resolveCallbacks.length>0){var t=this._resolveCallbacks.splice(0);window.setTimeout(function(){for(var i=0,r=t.length;i<r;i++)t[i](n)})}},n.prototype._reject=function(n){if(this._isRejected||this._isResolved||(this._isRejected=!0,this._rejectValue=n,this._rejectCallbacks.length===0&&window.console&&window.console.warn&&(console.warn("Rejected XDM promise with no reject callbacks"),n&&console.warn(n))),this._isRejected&&this._rejectCallbacks.length>0){var t=this._rejectCallbacks.splice(0);window.setTimeout(function(){for(var i=0,r=t.length;i<r;i++)t[i](n)})}},n}(),t=parseInt("10000000000",36),f=Number.MAX_SAFE_INTEGER||9007199254740991;i=function(){function n(){this._registeredObjects={}}return n.prototype.register=function(n,t){this._registeredObjects[n]=t},n.prototype.getInstance=function(n,t){var i=this._registeredObjects[n];return i?typeof i=="function"?i(t):i:null},n}();n.XDMObjectRegistry=i;n.globalObjectRegistry=new i;r=function(){function t(n,r){r===void 0&&(r=null);this._nextMessageId=1;this._deferreds={};this._nextProxyFunctionId=1;this._proxyFunctions={};this._postToWindow=n;this._targetOrigin=r;this._channelObjectRegistry=new i;this._channelId=t._nextChannelId++;this._targetOrigin||(this._handshakeToken=s())}return t.prototype.getObjectRegistry=function(){return this._channelObjectRegistry},t.prototype.invokeRemoteMethod=function(n,t,i,r,f){var e={id:this._nextMessageId++,methodName:n,instanceId:t,instanceContext:r,params:this._customSerializeObject(i,f),jsonrpc:"2.0",serializationSettings:f},o;return this._targetOrigin||(e.handshakeToken=this._handshakeToken),o=u(),this._deferreds[e.id]=o,this._sendRpcMessage(e),o.promise},t.prototype.getRemoteObjectProxy=function(n,t){return this.invokeRemoteMethod(null,n,null,t)},t.prototype.invokeMethod=function(n,t){var f=this,r,u,i;if(!t.methodName){this._success(t,n,t.handshakeToken);return}if(r=n[t.methodName],typeof r!="function"){this._error(t,new Error("RPC method not found: "+t.methodName),t.handshakeToken);return}try{u=[];t.params&&(u=this._customDeserializeObject(t.params));i=r.apply(n,u);i&&i.then&&typeof i.then=="function"?i.then(function(n){f._success(t,n,t.handshakeToken)},function(n){f._error(t,n,t.handshakeToken)}):this._success(t,i,t.handshakeToken)}catch(e){this._error(t,e,t.handshakeToken)}},t.prototype.getRegisteredObject=function(t,i){if(t==="__proxyFunctions")return this._proxyFunctions;var r=this._channelObjectRegistry.getInstance(t,i);return r||(r=n.globalObjectRegistry.getInstance(t,i)),r},t.prototype.onMessage=function(n){var u=this,t=n,i,r;if(t.instanceId){if(i=this.getRegisteredObject(t.instanceId,t.instanceContext),!i)return!1;typeof i.then=="function"?i.then(function(n){u.invokeMethod(n,t)},function(n){u._error(t,n,t.handshakeToken)}):this.invokeMethod(i,t)}else{if(r=this._deferreds[t.id],!r)return!1;t.error?r.reject(this._customDeserializeObject([t.error])[0]):r.resolve(this._customDeserializeObject([t.result])[0]);delete this._deferreds[t.id]}return!0},t.prototype.owns=function(n,t,i){var r=i;if(this._postToWindow===n){if(this._targetOrigin)return t?t.toLowerCase()==="null"||this._targetOrigin.toLowerCase().indexOf(t.toLowerCase())===0:!1;if(r.handshakeToken&&r.handshakeToken===this._handshakeToken)return this._targetOrigin=t,!0}return!1},t.prototype.error=function(n,t){var i=n;this._error(i,t,i.handshakeToken)},t.prototype._error=function(n,t,i){var r={id:n.id,error:this._customSerializeObject([t],n.serializationSettings)[0],jsonrpc:"2.0",handshakeToken:i};this._sendRpcMessage(r)},t.prototype._success=function(n,t,i){var r={id:n.id,result:this._customSerializeObject([t],n.serializationSettings)[0],jsonrpc:"2.0",handshakeToken:i};this._sendRpcMessage(r)},t.prototype._sendRpcMessage=function(n){var t=JSON.stringify(n);this._postToWindow.postMessage(t,"*")},t.prototype._shouldSkipSerialization=function(n){for(var r,i=0,u=t.WINDOW_TYPES_TO_SKIP_SERIALIZATION.length;i<u;i++)if(r=t.WINDOW_TYPES_TO_SKIP_SERIALIZATION[i],window[r]&&n instanceof window[r])return!0;if(window.jQuery)for(i=0,u=t.JQUERY_TYPES_TO_SKIP_SERIALIZATION.length;i<u;i++)if(r=t.JQUERY_TYPES_TO_SKIP_SERIALIZATION[i],window.jQuery[r]&&n instanceof window.jQuery[r])return!0;return!1},t.prototype._customSerializeObject=function(n,i,r,u,f){var h=this,a,o,l,v,e,c,s;if((r===void 0&&(r=null),u===void 0&&(u=1),f===void 0&&(f=1),!n||f>t.MAX_XDM_DEPTH)||this._shouldSkipSerialization(n))return null;if(a=function(t,e,o){var s,c,l,a,v;try{s=t[o]}catch(y){}(c=typeof s,c!=="undefined")&&(l=-1,c==="object"&&(l=r.originalObjects.indexOf(s)),l>=0?(a=r.newObjects[l],a.__circularReferenceId||(a.__circularReferenceId=u++),e[o]={__circularReference:a.__circularReferenceId}):c==="function"?(v=h._nextProxyFunctionId++,e[o]={__proxyFunctionId:h._registerProxyFunction(s,n),__channelId:h._channelId}):c==="object"?e[o]=s&&s instanceof Date?{__proxyDate:s.getTime()}:h._customSerializeObject(s,i,r,u,f+1):o!=="__proxyFunctionId"&&(e[o]=s))},r||(r={newObjects:[],originalObjects:[]}),r.originalObjects.push(n),n instanceof Array)for(o=[],r.newObjects.push(o),e=0,c=n.length;e<c;e++)a(n,o,e);else{o={};r.newObjects.push(o);l={};try{for(s in n)l[s]=!0;for(v=Object.getOwnPropertyNames(n),e=0,c=v.length;e<c;e++)l[v[e]]=!0}catch(y){}for(s in l)(s&&s[0]!=="_"||i&&i.includeUnderscoreProperties)&&a(n,o,s)}return r.originalObjects.pop(),r.newObjects.pop(),o},t.prototype._registerProxyFunction=function(n,t){var i=this._nextProxyFunctionId++;return this._proxyFunctions["proxy"+i]=function(){return n.apply(t,Array.prototype.slice.call(arguments,0))},i},t.prototype._customDeserializeObject=function(n,t){var e=this,o=this,r,i,u,f;if(!n)return null;if(t||(t={}),r=function(n,i){var r=n[i],u=typeof r;i==="__circularReferenceId"&&u==="number"?(t[r]=n,delete n[i]):u==="object"&&r&&(r.__proxyFunctionId?n[i]=function(){return o.invokeRemoteMethod("proxy"+r.__proxyFunctionId,"__proxyFunctions",Array.prototype.slice.call(arguments,0),null,{includeUnderscoreProperties:!0})}:r.__proxyDate?n[i]=new Date(r.__proxyDate):r.__circularReference?n[i]=t[r.__circularReference]:e._customDeserializeObject(r,t))},n instanceof Array)for(i=0,u=n.length;i<u;i++)r(n,i);else if(typeof n=="object")for(f in n)r(n,f);return n},t._nextChannelId=1,t.MAX_XDM_DEPTH=100,t.WINDOW_TYPES_TO_SKIP_SERIALIZATION=["Node","Window","Event"],t.JQUERY_TYPES_TO_SKIP_SERIALIZATION=["jQuery"],t}();n.XDMChannel=r;e=function(){function n(){this._channels=[];this._subscribe(window)}return n.get=function(){return this._default||(this._default=new n),this._default},n.prototype.addChannel=function(n,t){var i=new r(n,t);return this._channels.push(i),i},n.prototype._handleMessageReceived=function(n){var i,e,r,t,u,f;if(typeof n.data=="string")try{t=JSON.parse(n.data)}catch(o){}if(t){for(u=!1,i=0,e=this._channels.length;i<e;i++)r=this._channels[i],r.owns(n.source,n.origin,t)&&(f=r,u=r.onMessage(t,n.origin)||u);!f||u||(window.console&&console.error("No handler found on any channel for message: "+JSON.stringify(t)),t.instanceId&&f.error(t,"The registered object "+t.instanceId+" could not be found."))}},n.prototype._subscribe=function(n){var t=this;n.addEventListener?n.addEventListener("message",function(n){t._handleMessageReceived(n)}):n.attachEvent("onmessage",function(n){t._handleMessageReceived(n)})},n}();n.XDMChannelManager=e})(XDM||(XDM={})),function(n){function d(n){i=n||{};f=i.usePlatformScripts;l=i.usePlatformStyles;window.setTimeout(function(){var n={notifyLoadSucceeded:!i.explicitNotifyLoaded,extensionReusedCallback:i.extensionReusedCallback};r.invokeRemoteMethod("initialHandshake","VSS.HostControl",[n]).then(function(n){t=n.pageContext;w=t.webContext;b=n.initialConfig||{};k=n.contribution;h=n.extensionContext;f||l?et():p()})},0)}function ht(n,t){var r;r=typeof n=="string"?[n]:n;t||(t=function(){});c?g(r,t):(i?f||(f=!0,o&&(o=!1,et())):d({usePlatformScripts:!0}),nt(function(){g(r,t)}))}function g(n,t){window.require(["VSS/Bundling"],function(i){i.requireModules(n,t)})}function nt(n){o?window.setTimeout(n,0):(u||(u=[]),u.push(n))}function ct(){r.invokeRemoteMethod("notifyLoadSucceeded","VSS.HostControl")}function tt(n){r.invokeRemoteMethod("notifyLoadFailed","VSS.HostControl",[n])}function it(){return w}function lt(){return b}function rt(){return h}function at(){return k}function vt(n,t){return t||(t={}),t.webContext||(t.webContext=it()),t.extensionContext||(t.extensionContext=rt()),ut(n).then(function(n){return n.getInstance(n.id,t)})}function ut(t){var i=XDM.createDeferred();return n.ready(function(){r.invokeRemoteMethod("getServiceContribution","vss.hostManagement",[t]).then(function(n){var t=n;t.getInstance=function(t,i){return ft(n,t,i)};i.resolve(t)},i.reject)}),i.promise}function yt(t){var i=XDM.createDeferred();return n.ready(function(){r.invokeRemoteMethod("getContributionsForTarget","vss.hostManagement",[t]).then(function(n){var t=[];n.forEach(function(n){var i=n;i.getInstance=function(t,i){return ft(n,t,i)};t.push(i)});i.resolve(t)},i.reject)}),i.promise}function ft(t,i,u){var f=XDM.createDeferred();return n.ready(function(){r.invokeRemoteMethod("getBackgroundContributionInstance","vss.hostManagement",[t,i,u]).then(f.resolve,f.reject)}),f.promise}function pt(n,t){r.getObjectRegistry().register(n,t)}function wt(n,t){return r.getObjectRegistry().getInstance(n,t)}function bt(){return r.invokeRemoteMethod("getAccessToken","VSS.HostControl")}function kt(){return r.invokeRemoteMethod("getAppToken","VSS.HostControl")}function dt(){e||(e=document.getElementsByTagName("body").item(0));r.invokeRemoteMethod("resize","VSS.HostControl",[e.scrollWidth,e.scrollHeight])}function et(){var r=ti(t.webContext),e,g,n,w,o,b,k,nt,tt,d,u;if(window.__vssPageContext=t,window.__cultureInfo=t.microsoftAjaxConfig.cultureInfo,l!==!1&&t.coreReferences.stylesheets&&t.coreReferences.stylesheets.forEach(function(n){if(n.isCoreStylesheet){var t=document.createElement("link");t.href=s(n.url,r);t.rel="stylesheet";y(t,"head")}}),!f){c=!0;p();return}if(e=[],g=!1,t.coreReferences.scripts&&(t.coreReferences.scripts.forEach(function(n){if(n.isCoreModule){var i=!1,t=window;n.identifier==="JQuery"?i=!!t.jQuery:n.identifier==="JQueryUI"?i=!!(t.jQuery&&t.jQuery.ui&&t.jQuery.ui.version):n.identifier==="AMDLoader"&&(i=typeof t.define=="function"&&!!t.define.amd);i?g=!0:e.push({source:s(n.url,r)})}}),t.coreReferences.coreScriptsBundle&&!g&&(e=[{source:s(t.coreReferences.coreScriptsBundle.url,r)}]),t.coreReferences.extensionCoreReferences&&e.push({source:s(t.coreReferences.extensionCoreReferences.url,r)})),n={baseUrl:h.baseUri,contributionPaths:null,paths:{},shim:{}},i.moduleLoaderConfig&&(i.moduleLoaderConfig.baseUrl&&(n.baseUrl=i.moduleLoaderConfig.baseUrl),ni(i.moduleLoaderConfig,n),ot(i.moduleLoaderConfig,n)),t.moduleLoaderConfig&&(ot(t.moduleLoaderConfig,n),w=t.moduleLoaderConfig.contributionPaths,w))for(o in w)if(w.hasOwnProperty(o)&&!n.paths[o]&&(b=w[o].value,n.paths[o]=b.match("^https?://")?b:r+b,k=t.moduleLoaderConfig.paths,k)){nt=o+"/";tt=a(r,t.moduleLoaderConfig.baseUrl);for(d in k)gt(d,nt)&&(u=k[d],u.match("^https?://")||(u=u[0]==="/"?a(r,u):a(tt,u)),n.paths[d]=u)}window.__vssModuleLoaderConfig=n;e.push({content:"require.config("+JSON.stringify(n)+");"});v(e,0,function(){c=!0;p()})}function gt(n,t){return n&&n.length>=t.length?n.substr(0,t.length).localeCompare(t)===0:!1}function a(n,t){var i=n||"";return i[i.length-1]!=="/"&&(i+="/"),t&&(i+=t[0]==="/"?t.substr(1):t),i}function ni(n,t,i){var r,u;if(n.paths){t.paths||(t.paths={});for(r in n.paths)n.paths.hasOwnProperty(r)&&(u=n.paths[r],i&&(u=i(r,n.paths[r])),u&&(t.paths[r]=u))}}function ot(n,t){if(n.shim){t.shim||(t.shim={});for(var i in n.shim)n.shim.hasOwnProperty(i)&&(t.shim[i]=n.shim[i])}}function ti(n){var r=n.account||n.host,t=r.uri,i=r.relativeUri;return t&&i&&(t[t.length-1]!=="/"&&(t+="/"),i[i.length-1]!=="/"&&(i+="/"),t=t.substr(0,t.length-i.length)),t}function v(n,t,i){var f=this,r,u;if(t>=n.length){i.call(this);return}r=document.createElement("script");r.type="text/javascript";n[t].source?(u=n[t].source,r.src=u,r.addEventListener("load",function(){v.call(f,n,t+1,i)}),r.addEventListener("error",function(){tt("Failed to load script: "+u)}),y(r,"head")):n[t].content&&(r.textContent=n[t].content,y(r,"head"),v.call(this,n,t+1,i))}function y(n,t){var i=document.getElementsByTagName(t)[0];i||(i=document.createElement(t),document.appendChild(i));i.appendChild(n)}function s(n,t){var i=(n||"").toLowerCase();return i.substr(0,2)!=="//"&&i.substr(0,5)!=="http:"&&i.substr(0,6)!=="https:"&&(n=t+(i[0]==="/"?"":"/")+n),n}function p(){var t=this,n;o=!0;u&&(n=u,u=null,n.forEach(function(n){n.call(t)}))}n.VssSDKVersion=.1;n.VssSDKRestVersion="2.2";var e,w,t,h,b,k,i,c=!1,f,l,o=!1,u,r=XDM.XDMChannelManager.get().addChannel(window.parent),st;(function(n){n.Dialog="ms.vss-web.dialog-service";n.Navigation="ms.vss-web.navigation-service";n.ExtensionData="ms.vss-web.data-service"})(st=n.ServiceIds||(n.ServiceIds={}));n.init=d;n.require=ht;n.ready=nt;n.notifyLoadSucceeded=ct;n.notifyLoadFailed=tt;n.getWebContext=it;n.getConfiguration=lt;n.getExtensionContext=rt;n.getContribution=at;n.getService=vt;n.getServiceContribution=ut;n.getServiceContributions=yt;n.register=pt;n.getRegisteredObject=wt;n.getAccessToken=bt;n.getAppToken=kt;n.resize=dt}(VSS||(VSS={})); | ||
//dependencies= |
{ | ||
"name": "vss-web-extension-sdk", | ||
"version": "1.97.0", | ||
"version": "1.98.0", | ||
"description": "Visual Studio Services Client SDK. JavaScript library for Visual Studio Online extensions.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
// Type definitions for Microsoft Visual Studio Services v97.20160401.0802 | ||
// Type definitions for Microsoft Visual Studio Services v98.20160415.2004 | ||
// Project: http://www.visualstudio.com/integrate/extensions/overview | ||
@@ -42,2 +42,3 @@ // Definitions by: Microsoft <vsointegration@microsoft.com> | ||
var ReleaseUri: string; | ||
var ReleaseWebUrl: string; | ||
var ReleaseEnvironmentUri: string; | ||
@@ -75,5 +76,2 @@ var ReleaseEnvironmentName: string; | ||
} | ||
export interface ApprovalPendingEvent { | ||
environments: ReleaseEnvironment[]; | ||
} | ||
export enum ApprovalStatus { | ||
@@ -130,2 +128,8 @@ Undefined = 0, | ||
} | ||
export interface ArtifactSourceTrigger extends ReleaseTriggerBase { | ||
/** | ||
* Artifact source alias for Artifact Source trigger type | ||
*/ | ||
artifactAlias: string; | ||
} | ||
export interface ArtifactTypeDefinition { | ||
@@ -305,2 +309,5 @@ displayName: string; | ||
} | ||
export interface ReleaseAbandonedEvent { | ||
release: Release; | ||
} | ||
export interface ReleaseApproval { | ||
@@ -326,2 +333,9 @@ approvalType: ApprovalType; | ||
} | ||
export interface ReleaseApprovalCompletedEvent { | ||
approval: ReleaseApproval; | ||
definitionName: string; | ||
environmentId: number; | ||
environmentName: string; | ||
releaseName: string; | ||
} | ||
export interface ReleaseApprovalHistory { | ||
@@ -335,2 +349,13 @@ approver: VSS_Common_Contracts.IdentityRef; | ||
} | ||
export interface ReleaseApprovalPendingEvent { | ||
approval: ReleaseApproval; | ||
definitionName: string; | ||
environmentId: number; | ||
environmentName: string; | ||
environments: ReleaseEnvironment[]; | ||
releaseCreator: string; | ||
releaseName: string; | ||
title: string; | ||
webAccessUri: string; | ||
} | ||
export interface ReleaseArtifact { | ||
@@ -346,2 +371,5 @@ artifactProvider: ArtifactProvider; | ||
} | ||
export interface ReleaseCreatedEvent { | ||
release: Release; | ||
} | ||
export interface ReleaseDefinition { | ||
@@ -359,3 +387,3 @@ artifacts: Artifact[]; | ||
revision: number; | ||
triggers: ReleaseTrigger[]; | ||
triggers: ReleaseTriggerBase[]; | ||
variables: { | ||
@@ -467,4 +495,6 @@ [key: string]: ConfigurationVariableValue; | ||
createdByName: string; | ||
definitionId: number; | ||
definitionName: string; | ||
environment: ReleaseEnvironment; | ||
environmentId: number; | ||
projectName: string; | ||
@@ -478,2 +508,7 @@ releaseCreatedBy: VSS_Common_Contracts.IdentityRef; | ||
} | ||
export interface ReleaseEnvironmentStartedEvent { | ||
environment: ReleaseEnvironment; | ||
environmentId: number; | ||
release: Release; | ||
} | ||
export interface ReleaseEnvironmentUpdateMetadata { | ||
@@ -567,11 +602,3 @@ scheduledDeploymentTime: Date; | ||
} | ||
export interface ReleaseTrigger { | ||
/** | ||
* Artifact source alias for ArtifactSource trigger type - value is null for all other trigger types | ||
*/ | ||
artifactAlias: string; | ||
/** | ||
* Release schedule for Schedule trigger type - value is null for all other trigger types | ||
*/ | ||
schedule: ReleaseSchedule; | ||
export interface ReleaseTriggerBase { | ||
triggerType: ReleaseTriggerType; | ||
@@ -610,2 +637,8 @@ } | ||
} | ||
export interface ScheduledReleaseTrigger extends ReleaseTriggerBase { | ||
/** | ||
* Release schedule for Scheduled Release trigger type | ||
*/ | ||
schedule: ReleaseSchedule; | ||
} | ||
export enum SenderType { | ||
@@ -682,5 +715,2 @@ ServiceAccount = 1, | ||
}; | ||
ApprovalPendingEvent: { | ||
fields: any; | ||
}; | ||
ApprovalStatus: { | ||
@@ -726,2 +756,5 @@ enumValues: { | ||
}; | ||
ArtifactSourceTrigger: { | ||
fields: any; | ||
}; | ||
ArtifactTypeDefinition: { | ||
@@ -821,11 +854,23 @@ fields: any; | ||
}; | ||
ReleaseAbandonedEvent: { | ||
fields: any; | ||
}; | ||
ReleaseApproval: { | ||
fields: any; | ||
}; | ||
ReleaseApprovalCompletedEvent: { | ||
fields: any; | ||
}; | ||
ReleaseApprovalHistory: { | ||
fields: any; | ||
}; | ||
ReleaseApprovalPendingEvent: { | ||
fields: any; | ||
}; | ||
ReleaseArtifact: { | ||
fields: any; | ||
}; | ||
ReleaseCreatedEvent: { | ||
fields: any; | ||
}; | ||
ReleaseDefinition: { | ||
@@ -875,2 +920,5 @@ fields: any; | ||
}; | ||
ReleaseEnvironmentStartedEvent: { | ||
fields: any; | ||
}; | ||
ReleaseEnvironmentUpdateMetadata: { | ||
@@ -932,3 +980,3 @@ fields: any; | ||
}; | ||
ReleaseTrigger: { | ||
ReleaseTriggerBase: { | ||
fields: any; | ||
@@ -968,2 +1016,5 @@ }; | ||
}; | ||
ScheduledReleaseTrigger: { | ||
fields: any; | ||
}; | ||
SenderType: { | ||
@@ -1723,3 +1774,3 @@ enumValues: { | ||
*/ | ||
export function getClient(): ReleaseHttpClient2_2; | ||
export function getClient(options?: VSS_WebApi.IVssHttpClientOptions): ReleaseHttpClient2_2; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1586353
45841