azure-devops-extension-sdk
Advanced tools
Comparing version 2.0.2 to 2.0.3
{ | ||
"name": "azure-devops-extension-sdk", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Azure DevOps web extension JavaScript library.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -5,3 +5,3 @@ # Azure DevOps Web Extension SDK | ||
Client SDK and TypeScript declare files for developing [Azure DevOps extensions](https://docs.microsoft.com/en-us/azure/devops/extend/overview). | ||
Client SDK for developing [Azure DevOps extensions](https://docs.microsoft.com/en-us/azure/devops/extend/overview). | ||
@@ -16,2 +16,4 @@ The client SDK enables web extensions to communicate to the host frame. It can be used to: | ||
A full API reference of can be found [here](https://docs.microsoft.com/en-us/javascript-typescript/azure-devops-extension-sdk). | ||
## Get started with a new extension | ||
@@ -42,3 +44,3 @@ | ||
## API | ||
Full API reference of DevOps.SDK.js can be found at [Core Client SDK](https://docs.microsoft.com/en-us/azure/devops/extend/reference/client/core-sdk) page. | ||
A full API reference of can be found [here](https://docs.microsoft.com/en-us/javascript-typescript/azure-devops-extension-sdk). | ||
@@ -45,0 +47,0 @@ |
16
SDK.d.ts
@@ -81,3 +81,3 @@ /** | ||
/** | ||
* Full id of the extension {publisher}.{extension} | ||
* Full id of the extension <publisher>.<extension> | ||
*/ | ||
@@ -97,3 +97,3 @@ id: string; | ||
* | ||
* @param options Initialization options for the extension. | ||
* @param options - Initialization options for the extension. | ||
*/ | ||
@@ -139,3 +139,3 @@ export declare function init(options?: IExtensionInitOptions): Promise<void>; | ||
* | ||
* @param contributionId Id of the contribution to get | ||
* @param contributionId - Id of the contribution to get | ||
*/ | ||
@@ -146,4 +146,4 @@ export declare function getService<T>(contributionId: string): Promise<T>; | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
* @param instanceId - unique id of the registered object | ||
* @param instance - Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
*/ | ||
@@ -154,3 +154,3 @@ export declare function register<T = any>(instanceId: string, instance: T): void; | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instanceId - unique id of the registered object | ||
*/ | ||
@@ -169,4 +169,4 @@ export declare function unregister(instanceId: string): void; | ||
* | ||
* @param width Optional width, defaults to scrollWidth | ||
* @param height Optional height, defaults to scrollHeight | ||
* @param width - Optional width, defaults to scrollWidth | ||
* @param height - Optional height, defaults to scrollHeight | ||
*/ | ||
@@ -173,0 +173,0 @@ export declare function resize(width?: number, height?: number): void; |
17
SDK.js
@@ -86,3 +86,3 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
* | ||
* @param options Initialization options for the extension. | ||
* @param options - Initialization options for the extension. | ||
*/ | ||
@@ -101,2 +101,5 @@ function init(options) { | ||
applyTheme(handshakeData.themeData); | ||
window.addEventListener("themeChanged", function (ev) { | ||
applyTheme(ev.detail.data); | ||
}); | ||
} | ||
@@ -191,3 +194,3 @@ resolveReady(); | ||
* | ||
* @param contributionId Id of the contribution to get | ||
* @param contributionId - Id of the contribution to get | ||
*/ | ||
@@ -207,4 +210,4 @@ function getService(contributionId) { | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
* @param instanceId - unique id of the registered object | ||
* @param instance - Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
*/ | ||
@@ -218,3 +221,3 @@ function register(instanceId, instance) { | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instanceId - unique id of the registered object | ||
*/ | ||
@@ -250,4 +253,4 @@ function unregister(instanceId) { | ||
* | ||
* @param width Optional width, defaults to scrollWidth | ||
* @param height Optional height, defaults to scrollHeight | ||
* @param width - Optional width, defaults to scrollWidth | ||
* @param height - Optional height, defaults to scrollHeight | ||
*/ | ||
@@ -254,0 +257,0 @@ function resize(width, height) { |
@@ -1,1 +0,1 @@ | ||
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}); | ||
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 a(e){try{c(r.next(e))}catch(e){i(e)}}function u(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(a,u)}c((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function n(n){return function(a){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;u;)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 u.label++,{value:n[1],done:!1};case 5:u.label++,o=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(i=u.trys,!(i=i.length>0&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}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,a])}}var r,o,i,a,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};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 a(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 u,c,s,f,l,d,h,v="DevOps.HostControl",g="DevOps.ServiceManager",p=n.channelManager.addChannel(window.parent),w=new Promise(function(e){h=e});p.getObjectRegistry().register("DevOps.SdkClient",{dispatchEvent:r}),t.init=function(e){return new Promise(function(n){var r=__assign({},e,{sdkVersion:t.sdkVersion});p.invokeRemoteMethod("initialHandshake",v,[r]).then(function(e){c=e.initialConfig||{},s=e.contributionId;var t=e.context;u=t.extension,f=t.user,l=t.host,e.themeData&&(a(e.themeData),window.addEventListener("themeChanged",function(e){a(e.detail.data)})),h(),n()})})},t.ready=o,t.notifyLoadSucceeded=function(){return p.invokeRemoteMethod("notifyLoadSucceeded",v)},t.notifyLoadFailed=function(e){return p.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(!u)throw new Error(i("getExtensionContext"));return u},t.getService=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,o().then(function(){return p.invokeRemoteMethod("getService",g,[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",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,p.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;p.invokeRemoteMethod("resize",v,[r,o])}},t.applyTheme=a}); |
54
XDM.d.ts
@@ -10,6 +10,6 @@ import "es6-promise/auto"; | ||
* | ||
* @param method Name of the method to invoke | ||
* @param instanceId unique id of the registered object | ||
* @param params Arguments to the method to invoke | ||
* @param instanceContextData Optional context data to pass to a registered object's factory method | ||
* @param method - Name of the method to invoke | ||
* @param instanceId - unique id of the registered object | ||
* @param params - Arguments to the method to invoke | ||
* @param instanceContextData - Optional context data to pass to a registered object's factory method | ||
*/ | ||
@@ -20,4 +20,4 @@ invokeRemoteMethod<T>(methodName: string, instanceId: string, params?: any[], instanceContextData?: Object): Promise<T>; | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param contextData Optional context data to pass to a registered object's factory method | ||
* @param instanceId - unique id of the registered object | ||
* @param contextData - Optional context data to pass to a registered object's factory method | ||
*/ | ||
@@ -39,4 +39,4 @@ getRemoteObjectProxy<T>(instanceId: string, contextData?: Object): Promise<T>; | ||
* | ||
* @param window Target iframe window to communicate with | ||
* @param targetOrigin Url of the target iframe (if known) | ||
* @param window - Target iframe window to communicate with | ||
* @param targetOrigin - Url of the target iframe (if known) | ||
*/ | ||
@@ -47,3 +47,3 @@ addChannel(window: Window, targetOrigin?: string): IXDMChannel; | ||
* | ||
* @param channel The channel to remove from the channel manager | ||
* @param channel - The channel to remove from the channel manager | ||
*/ | ||
@@ -59,4 +59,4 @@ removeChannel(channel: IXDMChannel): void; | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
* @param instanceId - unique id of the registered object | ||
* @param instance - Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
*/ | ||
@@ -69,3 +69,3 @@ register(instanceId: string, instance: Object | { | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instanceId - unique id of the registered object | ||
*/ | ||
@@ -76,4 +76,4 @@ unregister(instanceId: string): void; | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param contextData Optional context data to pass to the contructor of an object factory method | ||
* @param instanceId - unique id of the registered object | ||
* @param contextData - Optional context data to pass to the contructor of an object factory method | ||
*/ | ||
@@ -114,4 +114,4 @@ getInstance<T>(instanceId: string, contextData?: Object): T | undefined; | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
* @param instanceId - unique id of the registered object | ||
* @param instance - Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
*/ | ||
@@ -124,3 +124,3 @@ register(instanceId: string, instance: Object | { | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instanceId - unique id of the registered object | ||
*/ | ||
@@ -131,4 +131,4 @@ unregister(instanceId: string): void; | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param contextData Optional context data to pass to a registered object's factory method | ||
* @param instanceId - unique id of the registered object | ||
* @param contextData - Optional context data to pass to a registered object's factory method | ||
*/ | ||
@@ -161,7 +161,7 @@ getInstance<T>(instanceId: string, contextData?: Object): T | undefined; | ||
* | ||
* @param method Name of the method to invoke | ||
* @param instanceId unique id of the registered object | ||
* @param params Arguments to the method to invoke | ||
* @param instanceContextData Optional context data to pass to a registered object's factory method | ||
* @param serializationSettings Optional serialization settings | ||
* @param method - Name of the method to invoke | ||
* @param instanceId - unique id of the registered object | ||
* @param params - Arguments to the method to invoke | ||
* @param instanceContextData - Optional context data to pass to a registered object's factory method | ||
* @param serializationSettings - Optional serialization settings | ||
*/ | ||
@@ -172,4 +172,4 @@ invokeRemoteMethod<T>(methodName: string, instanceId: string, params?: any[], instanceContextData?: Object, serializationSettings?: ISerializationSettings): Promise<T>; | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param contextData Optional context data to pass to a registered object's factory method | ||
* @param instanceId - unique id of the registered object | ||
* @param contextData - Optional context data to pass to a registered object's factory method | ||
*/ | ||
@@ -182,3 +182,3 @@ getRemoteObjectProxy<T>(instanceId: string, contextData?: Object): Promise<T>; | ||
* | ||
* @param rpcMessage Message data | ||
* @param rpcMessage - Message data | ||
* @return True if the message was handled by this channel. Otherwise false. | ||
@@ -185,0 +185,0 @@ */ |
30
XDM.js
@@ -60,4 +60,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instance Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
* @param instanceId - unique id of the registered object | ||
* @param instance - Either: (1) an object instance, or (2) a function that takes optional context data and returns an object instance. | ||
*/ | ||
@@ -70,3 +70,3 @@ XDMObjectRegistry.prototype.register = function (instanceId, instance) { | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param instanceId - unique id of the registered object | ||
*/ | ||
@@ -79,4 +79,4 @@ XDMObjectRegistry.prototype.unregister = function (instanceId) { | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param contextData Optional context data to pass to a registered object's factory method | ||
* @param instanceId - unique id of the registered object | ||
* @param contextData - Optional context data to pass to a registered object's factory method | ||
*/ | ||
@@ -129,7 +129,7 @@ XDMObjectRegistry.prototype.getInstance = function (instanceId, contextData) { | ||
* | ||
* @param method Name of the method to invoke | ||
* @param instanceId unique id of the registered object | ||
* @param params Arguments to the method to invoke | ||
* @param instanceContextData Optional context data to pass to a registered object's factory method | ||
* @param serializationSettings Optional serialization settings | ||
* @param method - Name of the method to invoke | ||
* @param instanceId - unique id of the registered object | ||
* @param params - Arguments to the method to invoke | ||
* @param instanceContextData - Optional context data to pass to a registered object's factory method | ||
* @param serializationSettings - Optional serialization settings | ||
*/ | ||
@@ -163,4 +163,4 @@ XDMChannel.prototype.invokeRemoteMethod = function (methodName, instanceId, params, instanceContextData, serializationSettings) { | ||
* | ||
* @param instanceId unique id of the registered object | ||
* @param contextData Optional context data to pass to a registered object's factory method | ||
* @param instanceId - unique id of the registered object | ||
* @param contextData - Optional context data to pass to a registered object's factory method | ||
*/ | ||
@@ -222,3 +222,3 @@ XDMChannel.prototype.getRemoteObjectProxy = function (instanceId, contextData) { | ||
* | ||
* @param rpcMessage Message data | ||
* @param rpcMessage - Message data | ||
* @return True if the message was handled by this channel. Otherwise false. | ||
@@ -514,4 +514,4 @@ */ | ||
* | ||
* @param window Target iframe window to communicate with | ||
* @param targetOrigin Url of the target iframe (if known) | ||
* @param window - Target iframe window to communicate with | ||
* @param targetOrigin - Url of the target iframe (if known) | ||
*/ | ||
@@ -518,0 +518,0 @@ XDMChannelManager.prototype.addChannel = function (window, targetOrigin) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67426
1170
48