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.1 to 2.0.2

2

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

@@ -5,0 +5,0 @@ "repository": {

@@ -98,3 +98,3 @@ /**

*/
export declare function init(options?: IExtensionInitOptions): void;
export declare function init(options?: IExtensionInitOptions): Promise<void>;
/**

@@ -118,19 +118,19 @@ * Register a callback that gets called once the initial setup/handshake has completed.

[key: string]: any;
} | undefined;
};
/**
* Gets the information about the contribution that first caused this extension to load.
*/
export declare function getContributionId(): string | undefined;
export declare function getContributionId(): string;
/**
* Gets information about the current user
*/
export declare function getUser(): IUserContext | undefined;
export declare function getUser(): IUserContext;
/**
* Gets information about the host (i.e. an Azure DevOps organization) that the page is targeting
*/
export declare function getHost(): IHostContext | undefined;
export declare function getHost(): IHostContext;
/**
* Get the context about the extension that owns the content that is being hosted
*/
export declare function getExtensionContext(): IExtensionContext | undefined;
export declare function getExtensionContext(): IExtensionContext;
/**

@@ -137,0 +137,0 @@ * Get the contribution with the given contribution id. The returned contribution has a method to get a registered object within that contribution.

@@ -89,4 +89,3 @@ var __assign = (this && this.__assign) || Object.assign || function(t) {

function init(options) {
// Run this after current execution path is complete - allows objects to get initialized
window.setTimeout(function () {
return new Promise(function (resolve) {
var initOptions = __assign({}, options, { sdkVersion: exports.sdkVersion });

@@ -97,7 +96,5 @@ parentChannel.invokeRemoteMethod("initialHandshake", hostControlId, [initOptions]).then(function (handshakeData) {

var context = handshakeData.context;
if (context) {
extensionContext = context.extension;
userContext = context.user;
hostContext = context.host;
}
extensionContext = context.extension;
userContext = context.user;
hostContext = context.host;
if (handshakeData.themeData) {

@@ -107,4 +104,5 @@ applyTheme(handshakeData.themeData);

resolveReady();
resolve();
});
}, 0);
});
}

@@ -138,2 +136,5 @@ exports.init = init;

exports.notifyLoadFailed = notifyLoadFailed;
function getWaitForReadyError(method) {
return "Attempted to call " + method + "() before init() was complete. Wait for init to complete or place within a ready() callback.";
}
/**

@@ -143,2 +144,5 @@ * Get the configuration data passed in the initial handshake from the parent frame

function getConfiguration() {
if (!initialConfiguration) {
throw new Error(getWaitForReadyError("getConfiguration"));
}
return initialConfiguration;

@@ -151,2 +155,5 @@ }

function getContributionId() {
if (!initialContributionId) {
throw new Error(getWaitForReadyError("getContributionId"));
}
return initialContributionId;

@@ -159,2 +166,5 @@ }

function getUser() {
if (!userContext) {
throw new Error(getWaitForReadyError("getUser"));
}
return userContext;

@@ -167,2 +177,5 @@ }

function getHost() {
if (!hostContext) {
throw new Error(getWaitForReadyError("getHost"));
}
return hostContext;

@@ -175,2 +188,5 @@ }

function getExtensionContext() {
if (!extensionContext) {
throw new Error(getWaitForReadyError("getExtensionContext"));
}
return extensionContext;

@@ -177,0 +193,0 @@ }

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

var __assign=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},__awaiter=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function u(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(u,a)}c((o=o.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function n(n){return function(u){return function(n){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,r&&(i=2&n[0]?r.return:n[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,n[1])).done)return i;switch(r=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++,r=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],r=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,u])}}var o,r,i,u,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u};define(["require","exports","./XDM"],function(e,t,n){"use strict";function o(e,t){var n,o=window;"function"==typeof o.CustomEvent?n=new o.CustomEvent(e,t):(t=t||{bubbles:!1,cancelable:!1},(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail)),window.dispatchEvent(n)}function r(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){return[2,g]})})}function i(e){l||((l=document.createElement("style")).type="text/css",document.head.appendChild(l));var t=[];if(e)for(var n in e)t.push("--"+n+": "+e[n]);l.innerText=":root { "+t.join("; ")+" } body { color: var(--text-primary-color) }",o("themeApplied",{detail:e})}Object.defineProperty(t,"__esModule",{value:!0}),t.sdkVersion=3;var u,a,c,s,f,l,d,h="DevOps.HostControl",v="DevOps.ServiceManager",p=n.channelManager.addChannel(window.parent),g=new Promise(function(e){d=e});p.getObjectRegistry().register("DevOps.SdkClient",{dispatchEvent:o}),t.init=function(e){window.setTimeout(function(){var n=__assign({},e,{sdkVersion:t.sdkVersion});p.invokeRemoteMethod("initialHandshake",h,[n]).then(function(e){a=e.initialConfig||{},c=e.contributionId;var t=e.context;t&&(u=t.extension,s=t.user,f=t.host),e.themeData&&i(e.themeData),d()})},0)},t.ready=r,t.notifyLoadSucceeded=function(){return p.invokeRemoteMethod("notifyLoadSucceeded",h)},t.notifyLoadFailed=function(e){return p.invokeRemoteMethod("notifyLoadFailed",h,[e])},t.getConfiguration=function(){return a},t.getContributionId=function(){return c},t.getUser=function(){return s},t.getHost=function(){return f},t.getExtensionContext=function(){return u},t.getService=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,r().then(function(){return p.invokeRemoteMethod("getService",v,[e])})]})})},t.register=function(e,t){p.getObjectRegistry().register(e,t)},t.unregister=function(e){p.getObjectRegistry().unregister(e)},t.getAccessToken=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){return[2,p.invokeRemoteMethod("getAccessToken",h).then(function(e){return e.token})]})})},t.getAppToken=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){return[2,p.invokeRemoteMethod("getAppToken",h).then(function(e){return e.token})]})})},t.resize=function(e,t){var n=document.body;if(n){var o="number"==typeof e?e:n?n.scrollWidth:void 0,r="number"==typeof t?t:n?n.scrollHeight:void 0;p.invokeRemoteMethod("resize",h,[o,r])}},t.applyTheme=i});
var __assign=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},__awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(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(u,a)}c((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function n(n){return function(u){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,u])}}var r,o,i,u,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return u={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u};define(["require","exports","./XDM"],function(e,t,n){"use strict";function r(e,t){var n,r=window;"function"==typeof r.CustomEvent?n=new r.CustomEvent(e,t):(t=t||{bubbles:!1,cancelable:!1},(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail)),window.dispatchEvent(n)}function o(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){return[2,w]})})}function i(e){return"Attempted to call "+e+"() before init() was complete. Wait for init to complete or place within a ready() callback."}function u(e){d||((d=document.createElement("style")).type="text/css",document.head.appendChild(d));var t=[];if(e)for(var n in e)t.push("--"+n+": "+e[n]);d.innerText=":root { "+t.join("; ")+" } body { color: var(--text-primary-color) }",r("themeApplied",{detail:e})}Object.defineProperty(t,"__esModule",{value:!0}),t.sdkVersion=3;var a,c,s,f,l,d,h,v="DevOps.HostControl",p="DevOps.ServiceManager",g=n.channelManager.addChannel(window.parent),w=new Promise(function(e){h=e});g.getObjectRegistry().register("DevOps.SdkClient",{dispatchEvent:r}),t.init=function(e){return new Promise(function(n){var r=__assign({},e,{sdkVersion:t.sdkVersion});g.invokeRemoteMethod("initialHandshake",v,[r]).then(function(e){c=e.initialConfig||{},s=e.contributionId;var t=e.context;a=t.extension,f=t.user,l=t.host,e.themeData&&u(e.themeData),h(),n()})})},t.ready=o,t.notifyLoadSucceeded=function(){return g.invokeRemoteMethod("notifyLoadSucceeded",v)},t.notifyLoadFailed=function(e){return g.invokeRemoteMethod("notifyLoadFailed",v,[e])},t.getConfiguration=function(){if(!c)throw new Error(i("getConfiguration"));return c},t.getContributionId=function(){if(!s)throw new Error(i("getContributionId"));return s},t.getUser=function(){if(!f)throw new Error(i("getUser"));return f},t.getHost=function(){if(!l)throw new Error(i("getHost"));return l},t.getExtensionContext=function(){if(!a)throw new Error(i("getExtensionContext"));return a},t.getService=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,o().then(function(){return g.invokeRemoteMethod("getService",p,[e])})]})})},t.register=function(e,t){g.getObjectRegistry().register(e,t)},t.unregister=function(e){g.getObjectRegistry().unregister(e)},t.getAccessToken=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){return[2,g.invokeRemoteMethod("getAccessToken",v).then(function(e){return e.token})]})})},t.getAppToken=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){return[2,g.invokeRemoteMethod("getAppToken",v).then(function(e){return e.token})]})})},t.resize=function(e,t){var n=document.body;if(n){var r="number"==typeof e?e:n?n.scrollWidth:void 0,o="number"==typeof t?t:n?n.scrollHeight:void 0;g.invokeRemoteMethod("resize",v,[r,o])}},t.applyTheme=u});
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