Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

azure-devops-extension-sdk

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-devops-extension-sdk - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

5

package.json
{
"name": "azure-devops-extension-sdk",
"version": "2.0.0",
"version": "2.0.1",
"description": "Azure DevOps web extension JavaScript library.",

@@ -23,3 +23,4 @@ "repository": {

"dependencies": {
"es6-promise": "^4.2.5"
"es6-promise": "^4.2.5",
"es6-object-assign": "^1.1.0"
},

@@ -26,0 +27,0 @@ "devDependencies": {

1

XDM.d.ts
import "es6-promise/auto";
import "es6-object-assign/auto";
/**

@@ -3,0 +4,0 @@ * Interface for a single XDM channel

@@ -36,3 +36,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
define(["require", "exports", "es6-promise/auto"], function (require, exports) {
define(["require", "exports", "es6-promise/auto", "es6-object-assign/auto"], function (require, exports) {
"use strict";

@@ -39,0 +39,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,1 +0,1 @@

var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(i=2&n[0]?o.return:n[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,n[1])).done)return i;switch(o=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!(i=i.length>0&&i[i.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){a.label=n[1];break}if(6===n[0]&&a.label<i[1]){a.label=i[1],i=n;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(n);break}i[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,o,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s};define(["require","exports","es6-promise/auto"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=parseInt("10000000000",36),r=Number.MAX_SAFE_INTEGER||9007199254740991,o=function(){function e(){this.objects={}}return e.prototype.register=function(e,t){this.objects[e]=t},e.prototype.unregister=function(e){delete this.objects[e]},e.prototype.getInstance=function(e,t){var n=this.objects[e];if(n)return"function"==typeof n?n(t):n},e}();t.XDMObjectRegistry=o;var i=1,s=function(){function e(e,t){this.promises={},this.nextMessageId=1,this.nextProxyId=1,this.proxyFunctions={},this.postToWindow=e,this.targetOrigin=t,this.registry=new o,this.channelId=i++,this.targetOrigin||(this.handshakeToken=Math.floor(Math.random()*(r-n)+n).toString(36)+Math.floor(Math.random()*(r-n)+n).toString(36))}return e.prototype.getObjectRegistry=function(){return this.registry},e.prototype.invokeRemoteMethod=function(e,t,n,r,o){return __awaiter(this,void 0,void 0,function(){var i,s,a=this;return __generator(this,function(c){return i={id:this.nextMessageId++,methodName:e,instanceId:t,instanceContext:r,params:this._customSerializeObject(n,o),serializationSettings:o},this.targetOrigin||(i.handshakeToken=this.handshakeToken),s=new Promise(function(e,t){a.promises[i.id]={resolve:e,reject:t}}),this._sendRpcMessage(i),[2,s]})})},e.prototype.getRemoteObjectProxy=function(e,t){return this.invokeRemoteMethod("",e,void 0,t)},e.prototype.invokeMethod=function(e,t){var n=this;if(t.methodName){var r=e[t.methodName];if("function"==typeof r)try{var o=[];t.params&&(o=this._customDeserializeObject(t.params,{}));var i=r.apply(e,o);i&&i.then&&"function"==typeof i.then?i.then(function(e){n._success(t,e,t.handshakeToken)},function(e){n.error(t,e)}):this._success(t,i,t.handshakeToken)}catch(e){this.error(t,e)}else this.error(t,new Error("RPC method not found: "+t.methodName))}else this._success(t,e,t.handshakeToken)},e.prototype.getRegisteredObject=function(e,n){if("__proxyFunctions"===e)return this.proxyFunctions;var r=this.registry.getInstance(e,n);return r||(r=t.globalObjectRegistry.getInstance(e,n)),r},e.prototype.onMessage=function(e){var t=this;if(e.instanceId){var n=this.getRegisteredObject(e.instanceId,e.instanceContext);if(!n)return!1;"function"==typeof n.then?n.then(function(n){t.invokeMethod(n,e)},function(n){t.error(e,n)}):this.invokeMethod(n,e)}else{var r=this.promises[e.id];if(!r)return!1;e.error?r.reject(this._customDeserializeObject([e.error],{})[0]):r.resolve(this._customDeserializeObject([e.result],{})[0]),delete this.promises[e.id]}return!0},e.prototype.owns=function(e,t,n){if(this.postToWindow===e){if(this.targetOrigin)return!!t&&("null"===t.toLowerCase()||0===this.targetOrigin.toLowerCase().indexOf(t.toLowerCase()));if(n.handshakeToken&&n.handshakeToken===this.handshakeToken)return this.targetOrigin=t,!0}return!1},e.prototype.error=function(e,t){this._sendRpcMessage({id:e.id,error:this._customSerializeObject([t],e.serializationSettings)[0],handshakeToken:e.handshakeToken})},e.prototype._success=function(e,t,n){this._sendRpcMessage({id:e.id,result:this._customSerializeObject([t],e.serializationSettings)[0],handshakeToken:n})},e.prototype._sendRpcMessage=function(e){this.postToWindow.postMessage(JSON.stringify(e),"*")},e.prototype._customSerializeObject=function(e,t,n,r,o){var i=this;if(void 0===r&&(r=1),void 0===o&&(o=1),e&&!(o>100)&&!(e instanceof Node||e instanceof Window||e instanceof Event)){var s,a;(a=n||{newObjects:[],originalObjects:[]}).originalObjects.push(e);var c=function(n,s,c){var u;try{u=n[c]}catch(e){}var h=typeof u;if("undefined"!==h){var f=-1;if("object"===h&&(f=a.originalObjects.indexOf(u)),f>=0){var l=a.newObjects[f];l.__circularReferenceId||(l.__circularReferenceId=r++),s[c]={__circularReference:l.__circularReferenceId}}else if("function"===h){i.nextProxyId++;s[c]={__proxyFunctionId:i._registerProxyFunction(u,e),_channelId:i.channelId}}else"object"===h?u&&u instanceof Date?s[c]={__proxyDate:u.getTime()}:s[c]=i._customSerializeObject(u,t,a,r,o+1):"__proxyFunctionId"!==c&&(s[c]=u)}};if(e instanceof Array){s=[],a.newObjects.push(s);for(var u=0,h=e.length;u<h;u++)c(e,s,u)}else{s={},a.newObjects.push(s);var f={};try{for(var l in e)f[l]=!0;for(var p=Object.getOwnPropertyNames(e),u=0,h=p.length;u<h;u++)f[p[u]]=!0}catch(e){}for(var l in f)(l&&"_"!==l[0]||t&&t.includeUnderscoreProperties)&&c(e,s,l)}return a.originalObjects.pop(),a.newObjects.pop(),s}},e.prototype._registerProxyFunction=function(e,t){var n=this.nextProxyId++;return this.proxyFunctions["proxy"+n]=function(){return e.apply(t,Array.prototype.slice.call(arguments,0))},n},e.prototype._customDeserializeObject=function(e,t){var n=this,r=this;if(!e)return null;var o=function(e,o){var i=e[o],s=typeof i;"__circularReferenceId"===o&&"number"===s?(t[i]=e,delete e[o]):"object"===s&&i&&(i.__proxyFunctionId?e[o]=function(){return r.invokeRemoteMethod("proxy"+i.__proxyFunctionId,"__proxyFunctions",Array.prototype.slice.call(arguments,0),{},{includeUnderscoreProperties:!0})}:i.__proxyDate?e[o]=new Date(i.__proxyDate):i.__circularReference?e[o]=t[i.__circularReference]:n._customDeserializeObject(i,t))};if(e instanceof Array)for(var i=0,s=e.length;i<s;i++)o(e,i);else if("object"==typeof e)for(var a in e)o(e,a);return e},e}();t.XDMChannel=s;var a=function(){function e(){var e=this;this._channels=[],this._handleMessageReceived=function(t){var n;if("string"==typeof t.data)try{n=JSON.parse(t.data)}catch(e){}if(n){for(var r=!1,o=void 0,i=0,s=e._channels;i<s.length;i++){var a=s[i];a.owns(t.source,t.origin,n)&&(o=a,r=a.onMessage(n)||r)}o&&!r&&(window.console&&console.error("No handler found on any channel for message: "+JSON.stringify(n)),n.instanceId&&o.error(n,new Error("The registered object "+n.instanceId+" could not be found.")))}},window.addEventListener("message",this._handleMessageReceived)}return e.prototype.addChannel=function(e,t){var n=new s(e,t);return this._channels.push(n),n},e.prototype.removeChannel=function(e){this._channels=this._channels.filter(function(t){return t!==e})},e}();t.globalObjectRegistry=new o,t.channelManager=new a});
var __awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function n(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(i=2&n[0]?o.return:n[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,n[1])).done)return i;switch(o=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!(i=i.length>0&&i[i.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){a.label=n[1];break}if(6===n[0]&&a.label<i[1]){a.label=i[1],i=n;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(n);break}i[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}var r,o,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s};define(["require","exports","es6-promise/auto","es6-object-assign/auto"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=parseInt("10000000000",36),r=Number.MAX_SAFE_INTEGER||9007199254740991,o=function(){function e(){this.objects={}}return e.prototype.register=function(e,t){this.objects[e]=t},e.prototype.unregister=function(e){delete this.objects[e]},e.prototype.getInstance=function(e,t){var n=this.objects[e];if(n)return"function"==typeof n?n(t):n},e}();t.XDMObjectRegistry=o;var i=1,s=function(){function e(e,t){this.promises={},this.nextMessageId=1,this.nextProxyId=1,this.proxyFunctions={},this.postToWindow=e,this.targetOrigin=t,this.registry=new o,this.channelId=i++,this.targetOrigin||(this.handshakeToken=Math.floor(Math.random()*(r-n)+n).toString(36)+Math.floor(Math.random()*(r-n)+n).toString(36))}return e.prototype.getObjectRegistry=function(){return this.registry},e.prototype.invokeRemoteMethod=function(e,t,n,r,o){return __awaiter(this,void 0,void 0,function(){var i,s,a=this;return __generator(this,function(c){return i={id:this.nextMessageId++,methodName:e,instanceId:t,instanceContext:r,params:this._customSerializeObject(n,o),serializationSettings:o},this.targetOrigin||(i.handshakeToken=this.handshakeToken),s=new Promise(function(e,t){a.promises[i.id]={resolve:e,reject:t}}),this._sendRpcMessage(i),[2,s]})})},e.prototype.getRemoteObjectProxy=function(e,t){return this.invokeRemoteMethod("",e,void 0,t)},e.prototype.invokeMethod=function(e,t){var n=this;if(t.methodName){var r=e[t.methodName];if("function"==typeof r)try{var o=[];t.params&&(o=this._customDeserializeObject(t.params,{}));var i=r.apply(e,o);i&&i.then&&"function"==typeof i.then?i.then(function(e){n._success(t,e,t.handshakeToken)},function(e){n.error(t,e)}):this._success(t,i,t.handshakeToken)}catch(e){this.error(t,e)}else this.error(t,new Error("RPC method not found: "+t.methodName))}else this._success(t,e,t.handshakeToken)},e.prototype.getRegisteredObject=function(e,n){if("__proxyFunctions"===e)return this.proxyFunctions;var r=this.registry.getInstance(e,n);return r||(r=t.globalObjectRegistry.getInstance(e,n)),r},e.prototype.onMessage=function(e){var t=this;if(e.instanceId){var n=this.getRegisteredObject(e.instanceId,e.instanceContext);if(!n)return!1;"function"==typeof n.then?n.then(function(n){t.invokeMethod(n,e)},function(n){t.error(e,n)}):this.invokeMethod(n,e)}else{var r=this.promises[e.id];if(!r)return!1;e.error?r.reject(this._customDeserializeObject([e.error],{})[0]):r.resolve(this._customDeserializeObject([e.result],{})[0]),delete this.promises[e.id]}return!0},e.prototype.owns=function(e,t,n){if(this.postToWindow===e){if(this.targetOrigin)return!!t&&("null"===t.toLowerCase()||0===this.targetOrigin.toLowerCase().indexOf(t.toLowerCase()));if(n.handshakeToken&&n.handshakeToken===this.handshakeToken)return this.targetOrigin=t,!0}return!1},e.prototype.error=function(e,t){this._sendRpcMessage({id:e.id,error:this._customSerializeObject([t],e.serializationSettings)[0],handshakeToken:e.handshakeToken})},e.prototype._success=function(e,t,n){this._sendRpcMessage({id:e.id,result:this._customSerializeObject([t],e.serializationSettings)[0],handshakeToken:n})},e.prototype._sendRpcMessage=function(e){this.postToWindow.postMessage(JSON.stringify(e),"*")},e.prototype._customSerializeObject=function(e,t,n,r,o){var i=this;if(void 0===r&&(r=1),void 0===o&&(o=1),e&&!(o>100)&&!(e instanceof Node||e instanceof Window||e instanceof Event)){var s,a;(a=n||{newObjects:[],originalObjects:[]}).originalObjects.push(e);var c=function(n,s,c){var u;try{u=n[c]}catch(e){}var h=typeof u;if("undefined"!==h){var f=-1;if("object"===h&&(f=a.originalObjects.indexOf(u)),f>=0){var l=a.newObjects[f];l.__circularReferenceId||(l.__circularReferenceId=r++),s[c]={__circularReference:l.__circularReferenceId}}else if("function"===h){i.nextProxyId++;s[c]={__proxyFunctionId:i._registerProxyFunction(u,e),_channelId:i.channelId}}else"object"===h?u&&u instanceof Date?s[c]={__proxyDate:u.getTime()}:s[c]=i._customSerializeObject(u,t,a,r,o+1):"__proxyFunctionId"!==c&&(s[c]=u)}};if(e instanceof Array){s=[],a.newObjects.push(s);for(var u=0,h=e.length;u<h;u++)c(e,s,u)}else{s={},a.newObjects.push(s);var f={};try{for(var l in e)f[l]=!0;for(var p=Object.getOwnPropertyNames(e),u=0,h=p.length;u<h;u++)f[p[u]]=!0}catch(e){}for(var l in f)(l&&"_"!==l[0]||t&&t.includeUnderscoreProperties)&&c(e,s,l)}return a.originalObjects.pop(),a.newObjects.pop(),s}},e.prototype._registerProxyFunction=function(e,t){var n=this.nextProxyId++;return this.proxyFunctions["proxy"+n]=function(){return e.apply(t,Array.prototype.slice.call(arguments,0))},n},e.prototype._customDeserializeObject=function(e,t){var n=this,r=this;if(!e)return null;var o=function(e,o){var i=e[o],s=typeof i;"__circularReferenceId"===o&&"number"===s?(t[i]=e,delete e[o]):"object"===s&&i&&(i.__proxyFunctionId?e[o]=function(){return r.invokeRemoteMethod("proxy"+i.__proxyFunctionId,"__proxyFunctions",Array.prototype.slice.call(arguments,0),{},{includeUnderscoreProperties:!0})}:i.__proxyDate?e[o]=new Date(i.__proxyDate):i.__circularReference?e[o]=t[i.__circularReference]:n._customDeserializeObject(i,t))};if(e instanceof Array)for(var i=0,s=e.length;i<s;i++)o(e,i);else if("object"==typeof e)for(var a in e)o(e,a);return e},e}();t.XDMChannel=s;var a=function(){function e(){var e=this;this._channels=[],this._handleMessageReceived=function(t){var n;if("string"==typeof t.data)try{n=JSON.parse(t.data)}catch(e){}if(n){for(var r=!1,o=void 0,i=0,s=e._channels;i<s.length;i++){var a=s[i];a.owns(t.source,t.origin,n)&&(o=a,r=a.onMessage(n)||r)}o&&!r&&(window.console&&console.error("No handler found on any channel for message: "+JSON.stringify(n)),n.instanceId&&o.error(n,new Error("The registered object "+n.instanceId+" could not be found.")))}},window.addEventListener("message",this._handleMessageReceived)}return e.prototype.addChannel=function(e,t){var n=new s(e,t);return this._channels.push(n),n},e.prototype.removeChannel=function(e){this._channels=this._channels.filter(function(t){return t!==e})},e}();t.globalObjectRegistry=new o,t.channelManager=new a});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc