commandbar 1.6.1 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- !function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.commandbar=r():t.commandbar=r()}(this,(function(){return(()=>{var t={296:(t,r,e)=>{"use strict";var o=e(102),n=e(307),i=e(339),a=e(957),s=e(246),c=t.exports=function(t,r){var e,n,c,u,l;return arguments.length<2||"string"!=typeof t?(u=r,r=t,t=null):u=arguments[2],o(t)?(e=s.call(t,"c"),n=s.call(t,"e"),c=s.call(t,"w")):(e=c=!0,n=!1),l={value:r,configurable:e,enumerable:n,writable:c},u?i(a(u),l):l};c.gs=function(t,r,e){var c,u,l,f;return"string"!=typeof t?(l=e,e=r,r=t,t=null):l=arguments[3],o(r)?n(r)?o(e)?n(e)||(l=e,e=void 0):e=void 0:(l=r,r=e=void 0):r=void 0,o(t)?(c=s.call(t,"c"),u=s.call(t,"e")):(c=!0,u=!1),f={get:r,set:e,configurable:c,enumerable:u},l?i(a(l),f):f}},817:t=>{"use strict";t.exports=function(){}},339:(t,r,e)=>{"use strict";t.exports=e(994)()?Object.assign:e(963)},994:t=>{"use strict";t.exports=function(){var t,r=Object.assign;return"function"==typeof r&&(r(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},963:(t,r,e)=>{"use strict";var o=e(450),n=e(836),i=Math.max;t.exports=function(t,r){var e,a,s,c=i(arguments.length,2);for(t=Object(n(t)),s=function(o){try{t[o]=r[o]}catch(t){e||(e=t)}},a=1;a<c;++a)o(r=arguments[a]).forEach(s);if(void 0!==e)throw e;return t}},349:(t,r,e)=>{"use strict";var o=e(817)();t.exports=function(t){return t!==o&&null!==t}},450:(t,r,e)=>{"use strict";t.exports=e(446)()?Object.keys:e(177)},446:t=>{"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},177:(t,r,e)=>{"use strict";var o=e(349),n=Object.keys;t.exports=function(t){return n(o(t)?Object(t):t)}},957:(t,r,e)=>{"use strict";var o=e(349),n=Array.prototype.forEach,i=Object.create,a=function(t,r){var e;for(e in t)r[e]=t[e]};t.exports=function(t){var r=i(null);return n.call(arguments,(function(t){o(t)&&a(Object(t),r)})),r}},836:(t,r,e)=>{"use strict";var o=e(349);t.exports=function(t){if(!o(t))throw new TypeError("Cannot use null or undefined");return t}},246:(t,r,e)=>{"use strict";t.exports=e(711)()?String.prototype.contains:e(370)},711:t=>{"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}},370:t=>{"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},992:(t,r,e)=>{"use strict";e(98).polyfill()},98:t=>{"use strict";function r(t,r){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),o=1;o<arguments.length;o++){var n=arguments[o];if(null!=n)for(var i=Object.keys(Object(n)),a=0,s=i.length;a<s;a++){var c=i[a],u=Object.getOwnPropertyDescriptor(n,c);void 0!==u&&u.enumerable&&(e[c]=n[c])}}return e}t.exports={assign:r,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:r})}}},769:(t,r,e)=>{"use strict";e(614)()||Object.defineProperty(e(119),"Symbol",{value:e(798),configurable:!0,enumerable:!1,writable:!0})},614:(t,r,e)=>{"use strict";var o=e(119),n={object:!0,symbol:!0};t.exports=function(){var t,r=o.Symbol;if("function"!=typeof r)return!1;t=r("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof r.iterator]&&!!n[typeof r.toPrimitive]&&!!n[typeof r.toStringTag]}},64:t=>{"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},573:(t,r,e)=>{"use strict";var o=e(296),n=Object.create,i=Object.defineProperty,a=Object.prototype,s=n(null);t.exports=function(t){for(var r,e,n=0;s[t+(n||"")];)++n;return s[t+=n||""]=!0,i(a,r="@@"+t,o.gs(null,(function(t){e||(e=!0,i(this,r,o(t)),e=!1)}))),r}},572:(t,r,e)=>{"use strict";var o=e(296),n=e(119).Symbol;t.exports=function(t){return Object.defineProperties(t,{hasInstance:o("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:o("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:o("",n&&n.iterator||t("iterator")),match:o("",n&&n.match||t("match")),replace:o("",n&&n.replace||t("replace")),search:o("",n&&n.search||t("search")),species:o("",n&&n.species||t("species")),split:o("",n&&n.split||t("split")),toPrimitive:o("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:o("",n&&n.toStringTag||t("toStringTag")),unscopables:o("",n&&n.unscopables||t("unscopables"))})}},781:(t,r,e)=>{"use strict";var o=e(296),n=e(11),i=Object.create(null);t.exports=function(t){return Object.defineProperties(t,{for:o((function(r){return i[r]?i[r]:i[r]=t(String(r))})),keyFor:o((function(t){var r;for(r in n(t),i)if(i[r]===t)return r}))})}},798:(t,r,e)=>{"use strict";var o,n,i,a=e(296),s=e(11),c=e(119).Symbol,u=e(573),l=e(572),f=e(781),p=Object.create,d=Object.defineProperties,m=Object.defineProperty;if("function"==typeof c)try{String(c()),i=!0}catch(t){}else c=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return o(t)},t.exports=o=function t(r){var e;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?c(r):(e=p(n.prototype),r=void 0===r?"":String(r),d(e,{__description__:a("",r),__name__:a("",u(r))}))},l(o),f(o),d(n.prototype,{constructor:a(o),toString:a("",(function(){return this.__name__}))}),d(o.prototype,{toString:a((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:a((function(){return s(this)}))}),m(o.prototype,o.toPrimitive,a("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),m(o.prototype,o.toStringTag,a("c","Symbol")),m(n.prototype,o.toStringTag,a("c",o.prototype[o.toStringTag])),m(n.prototype,o.toPrimitive,a("c",o.prototype[o.toPrimitive]))},11:(t,r,e)=>{"use strict";var o=e(64);t.exports=function(t){if(!o(t))throw new TypeError(t+" is not a symbol");return t}},308:t=>{var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},119:(t,r,e)=>{"use strict";t.exports=e(801)()?globalThis:e(308)},801:t=>{"use strict";t.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}},656:(t,r,e)=>{"use strict";var o;(o="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)||"undefined"!=typeof navigator&&"ReactNative"===navigator.product?e.g:self).Proxy||(o.Proxy=e(659)(),o.Proxy.revocable=o.Proxy.revocable)},659:t=>{t.exports=function(){let t,r=null;function e(t){return!!t&&("object"==typeof t||"function"==typeof t)}function o(t){if(null!==t&&!e(t))throw new TypeError("Object prototype may only be an Object or null: "+t)}const n=Object,i=Boolean(n.create)||!({__proto__:null}instanceof n),a=n.create||(i?function(t){return o(t),{__proto__:t}}:function(t){if(o(t),null===t)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var r=function(){};return r.prototype=t,new r}),s=function(){return null},c=n.getPrototypeOf||([].__proto__===Array.prototype?function(t){const r=t.__proto__;return e(r)?r:null}:s);return t=function(u,l){if(void 0===(this&&this instanceof t?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!e(u)||!e(l))throw new TypeError("Cannot create proxy with a non-object as target or handler");let f=function(){};r=function(){u=null,f=function(t){throw new TypeError(`Cannot perform '${t}' on a proxy that has been revoked`)}},setTimeout((function(){r=null}),0);const p=l;l={get:null,set:null,apply:null,construct:null};for(let t in p){if(!(t in l))throw new TypeError(`Proxy polyfill does not support trap '${t}'`);l[t]=p[t]}"function"==typeof p&&(l.apply=p.apply.bind(p));const d=c(u);let m,y=!1,b=!1;"function"==typeof u?(m=function(){const t=this&&this.constructor===m,r=Array.prototype.slice.call(arguments);return f(t?"construct":"apply"),t&&l.construct?l.construct.call(this,u,r):!t&&l.apply?l.apply(u,this,r):t?(r.unshift(u),new(u.bind.apply(u,r))):u.apply(this,r)},y=!0):u instanceof Array?(m=[],b=!0):m=i||null!==d?a(d):{};const _=l.get?function(t){return f("get"),l.get(this,t,m)}:function(t){return f("get"),this[t]},v=l.set?function(t,r){f("set"),l.set(this,t,r,m)}:function(t,r){f("set"),this[t]=r},g=n.getOwnPropertyNames(u),h={};g.forEach((function(t){if((y||b)&&t in m)return;const r=n.getOwnPropertyDescriptor(u,t),e={enumerable:Boolean(r.enumerable),get:_.bind(u,t),set:v.bind(u,t)};n.defineProperty(m,t,e),h[t]=!0}));let w=!0;if(y||b){const t=n.setPrototypeOf||([].__proto__===Array.prototype?function(t,r){return o(r),t.__proto__=r,t}:s);d&&t(m,d)||(w=!1)}if(l.get||!w)for(let t in u)h[t]||n.defineProperty(m,t,{get:_.bind(u,t)});return n.seal(u),n.seal(m),m},t.revocable=function(e,o){return{proxy:new t(e,o),revoke:r}},t}},956:function(t,r,e){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},o.apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),e(656),e(992),e(769);var n=e(737),i=e(207),a=function(t){if("complete"===document.readyState){var r=function(t){var r="https://api.commandbar.com",e=[],o=localStorage.getItem("commandbar.lc");o&&o.includes("local")?r="http://localhost:8000":o||"10d7dc04"!==t||(r="https://api-cu.commandbar.com");var n=r+"/latest/"+t;return o&&e.push("lc="+o),e.push("version=2"),n+"?"+e.join("&")}(t),e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=r,document.head.appendChild(e)}else window.addEventListener("load",a.bind(null,t),{capture:!1,once:!0})},s={debug:!1};r.default=function(t,r){void 0===r&&(r=s);var e=o(o({},s),r);t?(e.debug&&console.log("CommandBar init..."),n.getProxySDK()[i._configuration]={uuid:t},a(t)):console.error("No org specified for CommandBar.init")}},890:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.snippet=void 0,r.snippet=function(t){var r=["Object.assign","Symbol","Symbol.for"].join("%2C"),e=window;function o(t,r){void 0===r&&(r=!1),"complete"!==document.readyState&&window.addEventListener("load",o.bind(null,t,r),{capture:!1,once:!0});var e=document.createElement("script");e.type="text/javascript",e.async=r,e.src=t,document.head.appendChild(e)}function n(){var r;if(void 0===e.CommandBar){delete e.__CommandBarBootstrap__;var n=Symbol.for("CommandBar::configuration"),i=Symbol.for("CommandBar::orgConfig"),a=Symbol.for("CommandBar::disposed"),s=Symbol.for("CommandBar::isProxy"),c=Symbol.for("CommandBar::queue"),u=Symbol.for("CommandBar::unwrap"),l=[],f=localStorage.getItem("commandbar.lc"),p=f&&f.includes("local")?"http://localhost:8000":"https://api.commandbar.com",d=Object.assign(((r={})[n]={uuid:t},r[i]={},r[a]=!1,r[s]=!0,r[c]=new Array,r[u]=function(){return d},r),e.CommandBar),m=["addCommand","boot","getShortcuts"],y=d;Object.assign(d,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),e.CommandBar=new Proxy(d,{get:function(t,r){return r in y?d[r]:m.includes(r)?function(){var t=Array.prototype.slice.call(arguments);return new Promise((function(e,o){t.unshift(r,e,o),d[c].push(t)}))}:function(){var t=Array.prototype.slice.call(arguments);t.unshift(r),d[c].push(t)}}}),null!==f&&l.push("lc="+f),l.push("version=2"),o(p+"/latest/"+t+"?"+l.join("&"),!0)}}void 0===Object.assign||"undefined"==typeof Symbol||void 0===Symbol.for?(e.__CommandBarBootstrap__=n,o("https://polyfill.io/v3/polyfill.min.js?version=3.101.0&callback=__CommandBarBootstrap__&features="+r)):n()}},343:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ASYNC_METHODS=void 0,r.ASYNC_METHODS=["addCommand","boot","getShortcuts"]},737:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.initProxySDK=r.getProxySDK=void 0;var o=e(314),n=e(343),i=e(207);function a(){var t,r,e,o,a=window.CommandBar,s=window.CommandBar;Array.isArray(null==a?void 0:a.q)||"string"==typeof(null==a?void 0:a.uid)?(e=null==a?void 0:a.uid,o=null==a?void 0:a.q):(e=null===(r=null==s?void 0:s[i._configuration])||void 0===r?void 0:r.uuid,o=null==s?void 0:s[i._queue]);var c=((t={})[i._configuration]={uuid:"string"==typeof e?e:""},t[i._disposed]=!1,t[i._isProxy]=!0,t[i._queue]=Array.isArray(o)?o:[],t[i._unwrap]=function(){return c},t),u=c;Object.assign(c,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),window.CommandBar=new Proxy(c,{get:function(t,r){return r in u?u[r]:n.ASYNC_METHODS.includes(r)?function(){var t=Array.prototype.slice.call(arguments);return new Promise((function(e,o){t.unshift(r,e,o),c[i._queue].push(t)}))}:function(){var t=Array.prototype.slice.call(arguments);t.unshift(r),c[i._queue].push(t)}}})}r.getProxySDK=function(){var t=window.CommandBar;return(o.isDisposed(t)||"boolean"!=typeof t[i._isProxy])&&a(),window.CommandBar[i._unwrap]()},r.initProxySDK=a},207:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._userAttributes=r._user=r._unwrap=r._state=r._showMessage=r._showGuide=r._setTestMode=r._setPreviewMode=r._setDashboard=r._search=r._reporter=r._report=r._reloadOrganization=r._reloadCommands=r._queue=r._programmaticTheme=r._perf=r._orgConfig=r._loadEditor=r._isProxy=r._instanceAttributes=r._disposed=r._dispose=r._dispatch=r._configUser=r._configure=r._configuration=r._access=void 0,r._access=Symbol.for("CommandBar::access"),r._configuration=Symbol.for("CommandBar::configuration"),r._configure=Symbol.for("CommandBar::configure"),r._configUser=Symbol.for("CommandBar::configUser"),r._dispatch=Symbol.for("CommandBar::dispatch"),r._dispose=Symbol.for("CommandBar::dispose"),r._disposed=Symbol.for("CommandBar::disposed"),r._instanceAttributes=Symbol.for("CommandBar::instanceAttributes"),r._isProxy=Symbol.for("CommandBar::isProxy"),r._loadEditor=Symbol.for("CommandBar::loadEditor"),r._orgConfig=Symbol.for("CommandBar::orgConfig"),r._perf=Symbol.for("CommandBar::perf"),r._programmaticTheme=Symbol.for("CommandBar::programmaticTheme"),r._queue=Symbol.for("CommandBar::queue"),r._reloadCommands=Symbol.for("CommandBar::reloadCommands"),r._reloadOrganization=Symbol.for("CommandBar::reloadOrganization"),r._report=Symbol.for("CommandBar::report"),r._reporter=Symbol.for("CommandBar::reporter"),r._search=Symbol.for("CommandBar::search"),r._setDashboard=Symbol.for("CommandBar::setDashboard"),r._setPreviewMode=Symbol.for("CommandBar::setPreviewMode"),r._setTestMode=Symbol.for("CommandBar::setTestMode"),r._showGuide=Symbol.for("CommandBar::showGuide"),r._showMessage=Symbol.for("CommandBar::showMessage"),r._state=Symbol.for("CommandBar::state"),r._unwrap=Symbol.for("CommandBar::unwrap"),r._user=Symbol.for("CommandBar::user"),r._userAttributes=Symbol.for("CommandBar::userAttributes")},314:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.dispose=r.isDisposed=r.isDisposable=void 0;var o=e(207),n=function(t){return void 0!==t&&void 0!==t.dispose},i=function(t){return void 0!==t&&void 0!==t[o._dispose]};r.isDisposable=function(t){return void 0===t||n(t)||i(t)},r.isDisposed=function(t){return void 0===t||n(t)&&!0===t._disposed||i(t)&&!0===t[o._disposed]},r.dispose=function(t){void 0!==t&&(i(t)?t[o._dispose]():t.dispose())}},111:(t,r,e)=>{"use strict";var o=e(666);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!o(t)}},617:(t,r,e)=>{"use strict";var o=e(102),n={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!o(t)&&hasOwnProperty.call(n,typeof t)}},307:(t,r,e)=>{"use strict";var o=e(111),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(t){return!!o(t)&&!n.test(i.call(t))}},666:(t,r,e)=>{"use strict";var o=e(617);t.exports=function(t){if(!o(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},102:t=>{"use strict";t.exports=function(t){return null!=t}}},r={};function e(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return t[o].call(i.exports,i,i.exports,e),i.exports}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var o={};return(()=>{"use strict";var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.CommandBarClientSDK=void 0;var r=e(343);Object.defineProperty(t,"CommandBarClientSDK",{enumerable:!0,get:function(){return r.CommandBarClientSDK}});var n=e(956);Object.defineProperty(t,"init",{enumerable:!0,get:function(){return n.default}});var i=e(737);Object.defineProperty(t,"initProxy",{enumerable:!0,get:function(){return i.initProxySDK}});var a=e(890);Object.defineProperty(t,"snippet",{enumerable:!0,get:function(){return a.snippet}})})(),o})()}));
1
+ !function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.commandbar=r():t.commandbar=r()}(this,(function(){return(()=>{var t={296:(t,r,e)=>{"use strict";var o=e(102),n=e(307),i=e(339),a=e(957),s=e(246),c=t.exports=function(t,r){var e,n,c,u,l;return arguments.length<2||"string"!=typeof t?(u=r,r=t,t=null):u=arguments[2],o(t)?(e=s.call(t,"c"),n=s.call(t,"e"),c=s.call(t,"w")):(e=c=!0,n=!1),l={value:r,configurable:e,enumerable:n,writable:c},u?i(a(u),l):l};c.gs=function(t,r,e){var c,u,l,f;return"string"!=typeof t?(l=e,e=r,r=t,t=null):l=arguments[3],o(r)?n(r)?o(e)?n(e)||(l=e,e=void 0):e=void 0:(l=r,r=e=void 0):r=void 0,o(t)?(c=s.call(t,"c"),u=s.call(t,"e")):(c=!0,u=!1),f={get:r,set:e,configurable:c,enumerable:u},l?i(a(l),f):f}},817:t=>{"use strict";t.exports=function(){}},339:(t,r,e)=>{"use strict";t.exports=e(994)()?Object.assign:e(963)},994:t=>{"use strict";t.exports=function(){var t,r=Object.assign;return"function"==typeof r&&(r(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},963:(t,r,e)=>{"use strict";var o=e(450),n=e(836),i=Math.max;t.exports=function(t,r){var e,a,s,c=i(arguments.length,2);for(t=Object(n(t)),s=function(o){try{t[o]=r[o]}catch(t){e||(e=t)}},a=1;a<c;++a)o(r=arguments[a]).forEach(s);if(void 0!==e)throw e;return t}},349:(t,r,e)=>{"use strict";var o=e(817)();t.exports=function(t){return t!==o&&null!==t}},450:(t,r,e)=>{"use strict";t.exports=e(446)()?Object.keys:e(177)},446:t=>{"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},177:(t,r,e)=>{"use strict";var o=e(349),n=Object.keys;t.exports=function(t){return n(o(t)?Object(t):t)}},957:(t,r,e)=>{"use strict";var o=e(349),n=Array.prototype.forEach,i=Object.create,a=function(t,r){var e;for(e in t)r[e]=t[e]};t.exports=function(t){var r=i(null);return n.call(arguments,(function(t){o(t)&&a(Object(t),r)})),r}},836:(t,r,e)=>{"use strict";var o=e(349);t.exports=function(t){if(!o(t))throw new TypeError("Cannot use null or undefined");return t}},246:(t,r,e)=>{"use strict";t.exports=e(711)()?String.prototype.contains:e(370)},711:t=>{"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}},370:t=>{"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},992:(t,r,e)=>{"use strict";e(98).polyfill()},98:t=>{"use strict";function r(t,r){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),o=1;o<arguments.length;o++){var n=arguments[o];if(null!=n)for(var i=Object.keys(Object(n)),a=0,s=i.length;a<s;a++){var c=i[a],u=Object.getOwnPropertyDescriptor(n,c);void 0!==u&&u.enumerable&&(e[c]=n[c])}}return e}t.exports={assign:r,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:r})}}},769:(t,r,e)=>{"use strict";e(614)()||Object.defineProperty(e(119),"Symbol",{value:e(798),configurable:!0,enumerable:!1,writable:!0})},614:(t,r,e)=>{"use strict";var o=e(119),n={object:!0,symbol:!0};t.exports=function(){var t,r=o.Symbol;if("function"!=typeof r)return!1;t=r("test symbol");try{String(t)}catch(t){return!1}return!!n[typeof r.iterator]&&!!n[typeof r.toPrimitive]&&!!n[typeof r.toStringTag]}},64:t=>{"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&"Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag])}},573:(t,r,e)=>{"use strict";var o=e(296),n=Object.create,i=Object.defineProperty,a=Object.prototype,s=n(null);t.exports=function(t){for(var r,e,n=0;s[t+(n||"")];)++n;return s[t+=n||""]=!0,i(a,r="@@"+t,o.gs(null,(function(t){e||(e=!0,i(this,r,o(t)),e=!1)}))),r}},572:(t,r,e)=>{"use strict";var o=e(296),n=e(119).Symbol;t.exports=function(t){return Object.defineProperties(t,{hasInstance:o("",n&&n.hasInstance||t("hasInstance")),isConcatSpreadable:o("",n&&n.isConcatSpreadable||t("isConcatSpreadable")),iterator:o("",n&&n.iterator||t("iterator")),match:o("",n&&n.match||t("match")),replace:o("",n&&n.replace||t("replace")),search:o("",n&&n.search||t("search")),species:o("",n&&n.species||t("species")),split:o("",n&&n.split||t("split")),toPrimitive:o("",n&&n.toPrimitive||t("toPrimitive")),toStringTag:o("",n&&n.toStringTag||t("toStringTag")),unscopables:o("",n&&n.unscopables||t("unscopables"))})}},781:(t,r,e)=>{"use strict";var o=e(296),n=e(11),i=Object.create(null);t.exports=function(t){return Object.defineProperties(t,{for:o((function(r){return i[r]?i[r]:i[r]=t(String(r))})),keyFor:o((function(t){var r;for(r in n(t),i)if(i[r]===t)return r}))})}},798:(t,r,e)=>{"use strict";var o,n,i,a=e(296),s=e(11),c=e(119).Symbol,u=e(573),l=e(572),f=e(781),p=Object.create,d=Object.defineProperties,m=Object.defineProperty;if("function"==typeof c)try{String(c()),i=!0}catch(t){}else c=null;n=function(t){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return o(t)},t.exports=o=function t(r){var e;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return i?c(r):(e=p(n.prototype),r=void 0===r?"":String(r),d(e,{__description__:a("",r),__name__:a("",u(r))}))},l(o),f(o),d(n.prototype,{constructor:a(o),toString:a("",(function(){return this.__name__}))}),d(o.prototype,{toString:a((function(){return"Symbol ("+s(this).__description__+")"})),valueOf:a((function(){return s(this)}))}),m(o.prototype,o.toPrimitive,a("",(function(){var t=s(this);return"symbol"==typeof t?t:t.toString()}))),m(o.prototype,o.toStringTag,a("c","Symbol")),m(n.prototype,o.toStringTag,a("c",o.prototype[o.toStringTag])),m(n.prototype,o.toPrimitive,a("c",o.prototype[o.toPrimitive]))},11:(t,r,e)=>{"use strict";var o=e(64);t.exports=function(t){if(!o(t))throw new TypeError(t+" is not a symbol");return t}},308:t=>{var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},119:(t,r,e)=>{"use strict";t.exports=e(801)()?globalThis:e(308)},801:t=>{"use strict";t.exports=function(){return"object"==typeof globalThis&&!!globalThis&&globalThis.Array===Array}},656:(t,r,e)=>{"use strict";var o;(o="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)||"undefined"!=typeof navigator&&"ReactNative"===navigator.product?e.g:self).Proxy||(o.Proxy=e(659)(),o.Proxy.revocable=o.Proxy.revocable)},659:t=>{t.exports=function(){let t,r=null;function e(t){return!!t&&("object"==typeof t||"function"==typeof t)}function o(t){if(null!==t&&!e(t))throw new TypeError("Object prototype may only be an Object or null: "+t)}const n=Object,i=Boolean(n.create)||!({__proto__:null}instanceof n),a=n.create||(i?function(t){return o(t),{__proto__:t}}:function(t){if(o(t),null===t)throw new SyntaxError("Native Object.create is required to create objects with null prototype");var r=function(){};return r.prototype=t,new r}),s=function(){return null},c=n.getPrototypeOf||([].__proto__===Array.prototype?function(t){const r=t.__proto__;return e(r)?r:null}:s);return t=function(u,l){if(void 0===(this&&this instanceof t?this.constructor:void 0))throw new TypeError("Constructor Proxy requires 'new'");if(!e(u)||!e(l))throw new TypeError("Cannot create proxy with a non-object as target or handler");let f=function(){};r=function(){u=null,f=function(t){throw new TypeError(`Cannot perform '${t}' on a proxy that has been revoked`)}},setTimeout((function(){r=null}),0);const p=l;l={get:null,set:null,apply:null,construct:null};for(let t in p){if(!(t in l))throw new TypeError(`Proxy polyfill does not support trap '${t}'`);l[t]=p[t]}"function"==typeof p&&(l.apply=p.apply.bind(p));const d=c(u);let m,y=!1,b=!1;"function"==typeof u?(m=function(){const t=this&&this.constructor===m,r=Array.prototype.slice.call(arguments);return f(t?"construct":"apply"),t&&l.construct?l.construct.call(this,u,r):!t&&l.apply?l.apply(u,this,r):t?(r.unshift(u),new(u.bind.apply(u,r))):u.apply(this,r)},y=!0):u instanceof Array?(m=[],b=!0):m=i||null!==d?a(d):{};const _=l.get?function(t){return f("get"),l.get(this,t,m)}:function(t){return f("get"),this[t]},v=l.set?function(t,r){f("set"),l.set(this,t,r,m)}:function(t,r){f("set"),this[t]=r},h=n.getOwnPropertyNames(u),g={};h.forEach((function(t){if((y||b)&&t in m)return;const r=n.getOwnPropertyDescriptor(u,t),e={enumerable:Boolean(r.enumerable),get:_.bind(u,t),set:v.bind(u,t)};n.defineProperty(m,t,e),g[t]=!0}));let S=!0;if(y||b){const t=n.setPrototypeOf||([].__proto__===Array.prototype?function(t,r){return o(r),t.__proto__=r,t}:s);d&&t(m,d)||(S=!1)}if(l.get||!S)for(let t in u)g[t]||n.defineProperty(m,t,{get:_.bind(u,t)});return n.seal(u),n.seal(m),m},t.revocable=function(e,o){return{proxy:new t(e,o),revoke:r}},t}},14:function(t,r,e){"use strict";var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.CommandBarClientSDK=r.snippet=r.initProxy=r.init=void 0;var n=e(343);Object.defineProperty(r,"CommandBarClientSDK",{enumerable:!0,get:function(){return n.CommandBarClientSDK}});var i=e(956);Object.defineProperty(r,"init",{enumerable:!0,get:function(){return o(i).default}});var a=e(737);Object.defineProperty(r,"initProxy",{enumerable:!0,get:function(){return a.initProxySDK}});var s=e(890);Object.defineProperty(r,"snippet",{enumerable:!0,get:function(){return s.snippet}})},956:function(t,r,e){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var r,e=1,o=arguments.length;e<o;e++)for(var n in r=arguments[e])Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n]);return t},o.apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),e(656),e(992),e(769);var n=e(737),i=e(207),a=function(t){if("complete"===document.readyState){var r=function(t){var r="https://api.commandbar.com",e=[],o=localStorage.getItem("commandbar.lc");o&&o.includes("local")?r="http://localhost:8000":o||"10d7dc04"!==t||(r="https://api-cu.commandbar.com");var n=r+"/latest/"+t;return o&&e.push("lc="+o),e.push("version=2"),n+"?"+e.join("&")}(t),e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=r,document.head.appendChild(e)}else window.addEventListener("load",a.bind(null,t),{capture:!1,once:!0})},s={debug:!1};r.default=function(t,r){void 0===r&&(r=s);var e=o(o({},s),r);t?(e.debug&&console.log("CommandBar init...",{environment:r.environment,version:r.version}),(0,n.getProxySDK)()[i._configuration]={uuid:t,environment:r.environment,version:r.version},a(t)):console.error("No org specified for CommandBar.init")}},890:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.snippet=void 0,r.snippet=function(t){var r=["Object.assign","Symbol","Symbol.for"].join("%2C"),e=window;function o(t,r){void 0===r&&(r=!1),"complete"!==document.readyState&&window.addEventListener("load",o.bind(null,t,r),{capture:!1,once:!0});var e=document.createElement("script");e.type="text/javascript",e.async=r,e.src=t,document.head.appendChild(e)}function n(){var r;if(void 0===e.CommandBar){delete e.__CommandBarBootstrap__;var n=Symbol.for("CommandBar::configuration"),i=Symbol.for("CommandBar::orgConfig"),a=Symbol.for("CommandBar::disposed"),s=Symbol.for("CommandBar::isProxy"),c=Symbol.for("CommandBar::queue"),u=Symbol.for("CommandBar::unwrap"),l=[],f=localStorage.getItem("commandbar.lc"),p=f&&f.includes("local")?"http://localhost:8000":"https://api.commandbar.com",d=Object.assign(((r={})[n]={uuid:t},r[i]={},r[a]=!1,r[s]=!0,r[c]=new Array,r[u]=function(){return d},r),e.CommandBar),m=["addCommand","boot","getShortcuts"],y=d;Object.assign(d,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),e.CommandBar=new Proxy(d,{get:function(t,r){return r in y?d[r]:m.includes(r)?function(){var t=Array.prototype.slice.call(arguments);return new Promise((function(e,o){t.unshift(r,e,o),d[c].push(t)}))}:function(){var t=Array.prototype.slice.call(arguments);t.unshift(r),d[c].push(t)}}}),null!==f&&l.push("lc=".concat(f)),l.push("version=2"),o("".concat(p,"/latest/").concat(t,"?").concat(l.join("&")),!0)}}void 0===Object.assign||"undefined"==typeof Symbol||void 0===Symbol.for?(e.__CommandBarBootstrap__=n,o("https://polyfill.io/v3/polyfill.min.js?version=3.101.0&callback=__CommandBarBootstrap__&features="+r)):n()}},343:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ASYNC_METHODS=void 0,r.ASYNC_METHODS=["addCommand","boot","getShortcuts"]},737:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.initProxySDK=r.getProxySDK=void 0;var o=e(314),n=e(343),i=e(207);function a(){var t,r,e,o,a=window.CommandBar,s=window.CommandBar;Array.isArray(null==a?void 0:a.q)||"string"==typeof(null==a?void 0:a.uid)?(e=null==a?void 0:a.uid,o=null==a?void 0:a.q):(e=null===(r=null==s?void 0:s[i._configuration])||void 0===r?void 0:r.uuid,o=null==s?void 0:s[i._queue]);var c=((t={})[i._configuration]={uuid:"string"==typeof e?e:""},t[i._disposed]=!1,t[i._isProxy]=!0,t[i._queue]=Array.isArray(o)?o:[],t[i._unwrap]=function(){return c},t),u=c;Object.assign(c,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),window.CommandBar=new Proxy(c,{get:function(t,r){return r in u?u[r]:n.ASYNC_METHODS.includes(r)?function(){var t=Array.prototype.slice.call(arguments);return new Promise((function(e,o){t.unshift(r,e,o),c[i._queue].push(t)}))}:function(){var t=Array.prototype.slice.call(arguments);t.unshift(r),c[i._queue].push(t)}}})}r.getProxySDK=function(){var t=window.CommandBar;return((0,o.isDisposed)(t)||"boolean"!=typeof t[i._isProxy])&&a(),window.CommandBar[i._unwrap]()},r.initProxySDK=a},207:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r._userAttributes=r._user=r._unwrap=r._state=r._showMessage=r._showGuide=r._setEditorVisible=r._setTestMode=r._setPreviewMode=r._setDashboard=r._search=r._reporter=r._report=r._reloadPlaceholders=r._reloadOrganization=r._reloadCommands=r._queue=r._programmaticTheme=r._perf=r._orgConfig=r._loadEditor=r._isProxy=r._instanceAttributes=r._disposed=r._dispose=r._dispatch=r._configUser=r._configure=r._configuration=r._access=void 0,r._access=Symbol.for("CommandBar::access"),r._configuration=Symbol.for("CommandBar::configuration"),r._configure=Symbol.for("CommandBar::configure"),r._configUser=Symbol.for("CommandBar::configUser"),r._dispatch=Symbol.for("CommandBar::dispatch"),r._dispose=Symbol.for("CommandBar::dispose"),r._disposed=Symbol.for("CommandBar::disposed"),r._instanceAttributes=Symbol.for("CommandBar::instanceAttributes"),r._isProxy=Symbol.for("CommandBar::isProxy"),r._loadEditor=Symbol.for("CommandBar::loadEditor"),r._orgConfig=Symbol.for("CommandBar::orgConfig"),r._perf=Symbol.for("CommandBar::perf"),r._programmaticTheme=Symbol.for("CommandBar::programmaticTheme"),r._queue=Symbol.for("CommandBar::queue"),r._reloadCommands=Symbol.for("CommandBar::reloadCommands"),r._reloadOrganization=Symbol.for("CommandBar::reloadOrganization"),r._reloadPlaceholders=Symbol.for("CommandBar::reloadPlaceholders"),r._report=Symbol.for("CommandBar::report"),r._reporter=Symbol.for("CommandBar::reporter"),r._search=Symbol.for("CommandBar::search"),r._setDashboard=Symbol.for("CommandBar::setDashboard"),r._setPreviewMode=Symbol.for("CommandBar::setPreviewMode"),r._setTestMode=Symbol.for("CommandBar::setTestMode"),r._setEditorVisible=Symbol.for("CommandBar::setEditorVisible"),r._showGuide=Symbol.for("CommandBar::showGuide"),r._showMessage=Symbol.for("CommandBar::showMessage"),r._state=Symbol.for("CommandBar::state"),r._unwrap=Symbol.for("CommandBar::unwrap"),r._user=Symbol.for("CommandBar::user"),r._userAttributes=Symbol.for("CommandBar::userAttributes")},314:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.dispose=r.isDisposed=r.isDisposable=void 0;var o=e(207),n=function(t){return void 0!==t&&void 0!==t.dispose},i=function(t){return void 0!==t&&void 0!==t[o._dispose]};r.isDisposable=function(t){return void 0===t||n(t)||i(t)},r.isDisposed=function(t){return void 0===t||n(t)&&!0===t._disposed||i(t)&&!0===t[o._disposed]},r.dispose=function(t){void 0!==t&&(i(t)?t[o._dispose]():t.dispose())}},111:(t,r,e)=>{"use strict";var o=e(666);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!o(t)}},617:(t,r,e)=>{"use strict";var o=e(102),n={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!o(t)&&hasOwnProperty.call(n,typeof t)}},307:(t,r,e)=>{"use strict";var o=e(111),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(t){return!!o(t)&&!n.test(i.call(t))}},666:(t,r,e)=>{"use strict";var o=e(617);t.exports=function(t){if(!o(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},102:t=>{"use strict";t.exports=function(t){return null!=t}}},r={};function e(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return t[o].call(i.exports,i,i.exports,e),i.exports}return e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e(14)})()}));
@@ -3,6 +3,8 @@ import 'es6-object-assign/auto';
3
3
  import 'es6-symbol/implement';
4
4
  interface IInitOptions {
5
5
  debug?: boolean;
6
+ environment?: string;
7
+ version?: string;
6
8
  }
7
9
  /**
8
10
  * Initializes CommandBar and injects the scripts required to load it into the <head> of the document. After calling
@@ -10,7 +12,7 @@ interface IInitOptions {
10
12
  * finished loading yet.
11
13
  *
12
14
  * @param {string} org Your organization ID, which can be found [here](https://app.commandbar.com/docs/getting-started/installation#step-1:-install-commandbar).
13
- * @param {IInitOptions} [opts] Additional options to use for initialization: `debug` will enable additional logging
15
+ * @param {IInitOptions} [opts] Additional options to use for initialization: `debug` will enable additional logging, `environment` specifies the environment to load config from
14
16
  * output.
15
17
  */
16
18
  declare const init: (org: string, opts?: IInitOptions) => void;
@@ -1 +1 @@
1
- export declare type EVENT_NAME = 'Identify' | 'New session' | 'End session' | 'Load Performance' | 'New search' | 'Exited' | 'Search input' | 'Onboarding tooltip shown' | 'Tooltip shown' | 'Onboarding started' | 'Onboarding exited' | 'Onboarding completed' | 'Abandoned search' | 'No results for query' | 'Command suggestion' | 'Command execution' | 'Unavailable shortcut' | 'Clicked branding' | 'Survey response' | 'Client-Error' | 'Internal-Error';
1
+ export declare type EVENT_NAME = 'Identify' | 'New session' | 'End session' | 'Load Performance' | 'New search' | 'Exited' | 'Search input' | 'Onboarding tooltip shown' | 'Tooltip shown' | 'Onboarding started' | 'Onboarding exited' | 'Onboarding completed' | 'Abandoned search' | 'No results for query' | 'Command suggestion' | 'Command execution' | 'Unavailable shortcut' | 'Clicked branding' | 'Survey response' | 'Client-Error' | 'Internal-Error' | 'Internal-Event';
@@ -10,9 +10,13 @@ export declare type Metadata = Record<string, unknown>;
10
10
  export declare type UserAttributes = Record<string, unknown>;
11
11
  export declare type InstanceAttributes = {
12
12
  canOpenEditor?: boolean;
13
+ hmac?: string;
13
14
  };
14
15
  export declare type CallbackFunction<T, U = Metadata> = (args: T, context: U) => void;
15
16
  export declare type ContextLoader = (chosenValues?: undefined | Record<string, unknown[]>) => unknown;
17
+ export declare type CallbackMap = {
18
+ [name: string]: CallbackFunction<any, any>;
19
+ };
16
20
  export declare type CommandBarClientSDK = Readonly<{
17
21
  /**
18
22
  * Adds a callback function to CommandBar. The callback function provided is mapped to `callbackKey`, and can be
@@ -24,9 +28,7 @@ export declare type CommandBarClientSDK = Readonly<{
24
28
  * * `context`: A dictionary reflecting the state of context when the callback was triggered by a command execution
25
29
  */
26
30
  addCallback<T, U>(callbackKey: string, callbackFn: CallbackFunction<T, U>): void;
27
- addCallbacks(callbacks: {
28
- [name: string]: (...args: unknown[]) => unknown;
29
- }): void;
31
+ addCallbacks(callbacks: CallbackMap): void;
30
32
  /**
31
33
  * Add a command to CommandBar.
32
34
  *
@@ -82,7 +84,7 @@ export declare type CommandBarClientSDK = Readonly<{
82
84
  * * `eventData`: Event attributes (will differ based on the type of event). In addition to the data below, any
83
85
  * [eventData you pass to .boot()](https://app.commandbar.com/sdk#boot-eventdata) will be added to each event.
84
86
  */
85
- addEventHandler(eventHandler: EventHandler): void;
87
+ addEventHandler(eventHandler: EventHandler): Promise<void>;
86
88
  /**
87
89
  * Sets a router function that link command can use to update the page's URL without triggering a reload. To lean more about using `addRouter` see [Adding a router](https://app.commandbar.com/docs/commands/actions/link#link-types).
88
90
  *
@@ -153,6 +155,13 @@ export declare type CommandBarClientSDK = Readonly<{
153
155
  */
154
156
  removeContext(keyToRemove: string): void;
155
157
  setActiveObject(contextKey: string, objectLabel: string | string[], categoryName?: string): void;
158
+ /**
159
+ * Overrides certain components with provided options. Ask the CommandBar team if you're interested in this feature.
160
+ * Custom UI components are only available for enterprise customers. Please contact CommandBar.
161
+ * @param slug Component slug
162
+ * @param getHTML Function that returns an html string to be rendered as the component
163
+ */
164
+ setCustomComponent(slug: 'header' | 'footer' | 'input', getHTML: () => string): void;
156
165
  /**
157
166
  * Similar to `addContext`, but also removes any keys that are omitted from the supplied `ctx` from context. It may be
158
167
  * helpful to use this to make large context changes, such as when a user logs out.
@@ -165,11 +174,21 @@ export declare type CommandBarClientSDK = Readonly<{
165
174
  customID?: string | number;
166
175
  }): void;
167
176
  /**
168
- * Changes the background of the CommandBar to the supplied color.
177
+ * This method will override the hotkey used by the current user to summon CommandBar.
169
178
  *
170
- * @param color A hex color. Using 'light' or 'dark' will trigger CommandBar's default light or dark theme.
179
+ * Please note that this method will only work if your Organization as End User Customizable Shortcuts enabled.
180
+ *
181
+ * @param {string} hotkey Any mousetrap.js compliant string (e.g. 'mod+k')
182
+ * @returns {boolean} Returns false if the hotkey string is invalid
171
183
  */
172
- setTheme(color: string | 'light' | 'dark'): void;
184
+ setSummonHotkey(hotkey: string): boolean;
185
+ /**
186
+ * Changes the background and primary color of the CommandBar to the supplied color.
187
+ *
188
+ * @param theme A hex color. Using 'light' or 'dark' will trigger CommandBar's default light or dark theme.
189
+ * @param [primaryColor] A hex color.
190
+ */
191
+ setTheme(theme: string | 'light' | 'dark', primaryColor?: string): void;
173
192
  /**
174
193
  * Returns dictionary representing the current callbacks currently stored within CommandBar. The keys represent
175
194
  * callback keys, and the values are the supplied functions.
@@ -182,6 +201,17 @@ export declare type CommandBarClientSDK = Readonly<{
182
201
  * to make CommandBar unavailable after logout.
183
202
  */
184
203
  shutdown(): void;
204
+ /**
205
+ * Manually trigger client search functions.
206
+ *
207
+ * Allows search functions to be re-triggered with the same input text.
208
+ */
209
+ triggerSearchFunctions(): void;
185
210
  /** @deprecated Use addContext instead. */
186
211
  updateContextSettings(key: string, settings: IResourceSettings): void;
212
+ /**
213
+ * Completely remove CommandBar from the page. You will need to re-run the snippet or call the init() function again
214
+ * (depending on your deployment method) to load CommandBar again.
215
+ */
216
+ unmount(): void;
187
217
  }>;
@@ -1,22 +1,20 @@
1
1
  import { CommandBarClientSDK, InstanceAttributes, Metadata } from './CommandBarClientSDK';
2
- import { EVENT_NAME } from './Reporting';
2
+ import { EVENT_NAME } from './AnalyticsEventTypes';
3
3
  import { SentryReporter } from './SentryReporter';
4
- import { _access, _configuration, _configure, _configUser, _dispatch, _dispose, _disposed, _userAttributes, _isProxy, _loadEditor, _orgConfig, _perf, _programmaticTheme, _reloadCommands, _reloadOrganization, _report, _reporter, _search, _setDashboard, _setPreviewMode, _setTestMode, _showGuide, _showMessage, _state, _user, _instanceAttributes } from './symbols';
4
+ import { _access, _configuration, _configure, _configUser, _dispose, _disposed, _userAttributes, _isProxy, _loadEditor, _orgConfig, _perf, _programmaticTheme, _reloadCommands, _reloadOrganization, _reloadPlaceholders, _report, _reporter, _search, _setDashboard, _setPreviewMode, _setTestMode, _showGuide, _showMessage, _user, _instanceAttributes, _setEditorVisible } from './symbols';
5
5
  import { SDKConfig } from './SDKConfig';
6
6
  export interface OrgConfig {
7
7
  name?: string;
8
8
  silent?: boolean;
9
9
  }
10
10
  export { SDKConfig } from './SDKConfig';
11
- export interface CommandBarSDK<State = unknown, Dispatch = unknown> extends CommandBarClientSDK {
11
+ export interface CommandBarSDK extends CommandBarClientSDK {
12
12
  [_access]: string | undefined;
13
- [_dispatch]: Dispatch;
14
13
  [_instanceAttributes]: InstanceAttributes | undefined;
15
14
  [_perf]: boolean;
16
15
  [_programmaticTheme]: string | undefined;
17
16
  [_reporter]: SentryReporter | undefined;
18
17
  [_search]: string;
19
- [_state]: State;
20
18
  [_user]: string | undefined;
21
19
  [_userAttributes]: Metadata | undefined;
22
20
  /** @deprecated */
@@ -30,13 +28,15 @@ export interface CommandBarSDK<State = unknown, Dispatch = unknown> extends Comm
30
28
  readonly [_orgConfig]: OrgConfig;
31
29
  readonly [_reloadCommands]: () => void;
32
30
  readonly [_reloadOrganization]: () => void;
33
- /** @deprecated Vinay: Always thought this could be cool, but seems unlikely */
31
+ readonly [_reloadPlaceholders]: () => void;
32
+ /** @deprecated */
34
33
  readonly [_report]: (event: EVENT_NAME, data?: Metadata) => void;
35
- /** @deprecated Vinay: One day maybe but not now */
34
+ /** @deprecated */
36
35
  readonly [_setDashboard]: (element: HTMLElement) => void;
37
36
  readonly [_setPreviewMode]: (on: boolean) => void;
38
37
  readonly [_setTestMode]: (on: boolean) => void;
39
- /** @deprecated Vinay: Should ditch this feature */
38
+ readonly [_setEditorVisible]: (visible: boolean) => void;
39
+ /** @deprecated */
40
40
  readonly [_showGuide]: (eventName: string, preview?: boolean) => void;
41
41
  /** @deprecated */
42
42
  readonly [_showMessage]: (eventName: string, preview?: boolean) => void;
@@ -57,6 +57,8 @@ export interface OpenedEvent {
57
57
  * opens.
58
58
  */
59
59
  trigger: 'launcher' | 'keyboard' | 'programmatic';
60
+ /** The placeholder showing when the user opened the bar. */
61
+ placeholder: string;
60
62
  }
61
63
  export declare type OpenedEventTrigger = OpenedEvent['trigger'];
62
64
  export interface NoResultsForQueryEvent {
@@ -4,4 +4,6 @@ export interface SDKConfig {
4
4
  proxy: string;
5
5
  session: string;
6
6
  uuid: string;
7
+ environment?: string;
8
+ version?: string;
7
9
  }
@@ -14,12 +14,14 @@ export declare const _programmaticTheme: unique symbol;
14
14
  export declare const _queue: unique symbol;
15
15
  export declare const _reloadCommands: unique symbol;
16
16
  export declare const _reloadOrganization: unique symbol;
17
+ export declare const _reloadPlaceholders: unique symbol;
17
18
  export declare const _report: unique symbol;
18
19
  export declare const _reporter: unique symbol;
19
20
  export declare const _search: unique symbol;
20
21
  export declare const _setDashboard: unique symbol;
21
22
  export declare const _setPreviewMode: unique symbol;
22
23
  export declare const _setTestMode: unique symbol;
24
+ export declare const _setEditorVisible: unique symbol;
23
25
  export declare const _showGuide: unique symbol;
24
26
  export declare const _showMessage: unique symbol;
25
27
  export declare const _state: unique symbol;
@@ -17,11 +17,29 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
17
17
  object: t.StringC;
18
18
  hoverTooltip: t.BooleanC;
19
19
  operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
20
+ }>]>]>, t.IntersectionC<[t.TypeC<{
21
+ type: t.LiteralC<"webhook">;
22
+ value: t.StringC;
23
+ }>, t.IntersectionC<[t.TypeC<{}>, t.PartialC<{
24
+ commandType: t.UnionC<[t.LiteralC<"independent">, t.LiteralC<"object">, t.LiteralC<"help">]>;
25
+ object: t.StringC;
26
+ hoverTooltip: t.BooleanC;
27
+ operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
28
+ }>]>]>, t.IntersectionC<[t.TypeC<{
29
+ type: t.UnionC<[t.LiteralC<"click">, t.LiteralC<"clickBySelector">, t.LiteralC<"clickByXpath">]>;
30
+ value: t.ArrayC<t.StringC>;
31
+ }>, t.IntersectionC<[t.TypeC<{}>, t.PartialC<{
32
+ commandType: t.UnionC<[t.LiteralC<"independent">, t.LiteralC<"object">, t.LiteralC<"help">]>;
33
+ object: t.StringC;
34
+ hoverTooltip: t.BooleanC;
35
+ operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
20
36
  }>]>]>]>;
21
37
  text: t.StringC;
22
38
  }>, t.PartialC<{
23
39
  shortcut_mac: t.ArrayC<t.StringC>;
24
40
  shortcut_win: t.ArrayC<t.StringC>;
41
+ hotkey_mac: t.StringC;
42
+ hotkey_win: t.StringC;
25
43
  tags: t.ArrayC<t.StringC>;
26
44
  explanation: t.StringC;
27
45
  sort_key: t.UnionC<[t.NumberC, t.NullC]>;
@@ -38,7 +56,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
38
56
  label_field: t.StringC;
39
57
  availability_condition: t.ArrayC<t.TypeC<{
40
58
  field: t.StringC;
41
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
59
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
42
60
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
43
61
  }>>;
44
62
  loaded: t.ArrayC<t.AnyC>;
@@ -46,7 +64,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
46
64
  allow_create_label: t.StringC;
47
65
  }>]>, t.IntersectionC<[t.TypeC<{
48
66
  type: t.LiteralC<"set">;
49
- value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>]>;
67
+ value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>, t.ArrayC<t.UnknownRecordC>]>;
50
68
  order_key: t.NumberC;
51
69
  }>, t.PartialC<{
52
70
  label: t.StringC;
@@ -57,7 +75,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
57
75
  label_field: t.StringC;
58
76
  availability_condition: t.ArrayC<t.TypeC<{
59
77
  field: t.StringC;
60
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
78
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
61
79
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
62
80
  }>>;
63
81
  loaded: t.ArrayC<t.AnyC>;
@@ -76,7 +94,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
76
94
  label_field: t.StringC;
77
95
  availability_condition: t.ArrayC<t.TypeC<{
78
96
  field: t.StringC;
79
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
97
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
80
98
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
81
99
  }>>;
82
100
  loaded: t.ArrayC<t.AnyC>;
@@ -96,7 +114,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
96
114
  label_field: t.StringC;
97
115
  availability_condition: t.ArrayC<t.TypeC<{
98
116
  field: t.StringC;
99
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
117
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
100
118
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
101
119
  }>>;
102
120
  loaded: t.ArrayC<t.AnyC>;
@@ -115,7 +133,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
115
133
  label_field: t.StringC;
116
134
  availability_condition: t.ArrayC<t.TypeC<{
117
135
  field: t.StringC;
118
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
136
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
119
137
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
120
138
  }>>;
121
139
  loaded: t.ArrayC<t.AnyC>;
@@ -132,11 +150,11 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
132
150
  endsWith: null;
133
151
  startsWith: null;
134
152
  is: null;
153
+ isTruthy: null;
154
+ isFalsy: null;
135
155
  isNot: null;
136
156
  isTrue: null;
137
157
  isFalse: null;
138
- isTruthy: null;
139
- isFalsy: null;
140
158
  doesNotInclude: null;
141
159
  matchesRegex: null;
142
160
  isGreaterThan: null;
@@ -149,6 +167,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
149
167
  }>, t.PartialC<{
150
168
  field: t.StringC;
151
169
  value: t.StringC;
170
+ reason: t.StringC;
152
171
  }>]>>;
153
172
  recommend_rules: t.ArrayC<t.IntersectionC<[t.TypeC<{
154
173
  type: t.UnionC<[t.LiteralC<"context">, t.LiteralC<"url">, t.LiteralC<"element">, t.LiteralC<"always">]>;
@@ -158,11 +177,11 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
158
177
  endsWith: null;
159
178
  startsWith: null;
160
179
  is: null;
180
+ isTruthy: null;
181
+ isFalsy: null;
161
182
  isNot: null;
162
183
  isTrue: null;
163
184
  isFalse: null;
164
- isTruthy: null;
165
- isFalsy: null;
166
185
  doesNotInclude: null;
167
186
  matchesRegex: null;
168
187
  isGreaterThan: null;
@@ -174,5 +193,6 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
174
193
  }>;
175
194
  field: t.StringC;
176
195
  value: t.StringC;
196
+ reason: t.StringC;
177
197
  }>]>>;
178
198
  }>]>;
@@ -1,8 +1,57 @@
1
1
  import * as t from 'io-ts';
2
- export declare const OrganizationV: t.IntersectionC<[t.TypeC<{
2
+ declare const OrganizationAdditionalV: t.TypeC<{
3
+ launcher_type: t.UnionC<[t.LiteralC<"minimal">, t.LiteralC<"alternate">, t.LiteralC<"prompt">, t.LiteralC<"none">]>;
4
+ launcher_position: t.UnionC<[t.LiteralC<"topRight">, t.LiteralC<"topLeft">, t.LiteralC<"bottomRight">, t.LiteralC<"bottomLeft">]>;
5
+ show_launcher_recommendations: t.BooleanC;
6
+ recommendations_type: t.UnionC<[t.LiteralC<"None">, t.LiteralC<"Custom">, t.LiteralC<"Algorithm">]>;
7
+ launcher_offset_x: t.NumberC;
8
+ launcher_offset_y: t.NumberC;
9
+ theme: t.ObjectC;
10
+ icon: t.StringC;
11
+ icon_suggest: t.StringC;
12
+ icon_tutorial: t.StringC;
13
+ icon_go_forward: t.StringC;
14
+ resource_options: t.RecordC<t.StringC, t.PartialC<{
15
+ name: t.StringC;
16
+ search: t.BooleanC;
17
+ label_field: t.StringC;
18
+ useCategory: t.BooleanC;
19
+ search_fields: t.ArrayC<t.StringC>;
20
+ auto_execute: t.BooleanC;
21
+ unfurl: t.BooleanC;
22
+ description_field: t.StringC;
23
+ icon: t.StringC;
24
+ sort_key: t.NumberC;
25
+ max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
26
+ sortFunction: t.AnyC;
27
+ default_command_id: t.UnionC<[t.NumberC, t.UndefinedC]>;
28
+ showResources: t.BooleanC;
29
+ show_with_no_results: t.BooleanC;
30
+ search_tab_enabled: t.BooleanC;
31
+ search_tab_name: t.UnionC<[t.StringC, t.NullC]>;
32
+ search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
33
+ setting_pin_to_bottom: t.BooleanC;
34
+ }>>;
35
+ should_show_onboarding: t.BooleanC;
36
+ last_snippet_request: t.UnionC<[t.StringC, t.NullC]>;
37
+ last_snippet_request_in_production: t.UnionC<[t.StringC, t.NullC]>;
38
+ branding: t.StringC;
39
+ custom_call_to_action: t.StringC;
40
+ search_fuzzy_threshold: t.UnionC<[t.NumberC, t.NullC]>;
41
+ show_skin_editor: t.BooleanC;
42
+ allow_event_handlers: t.BooleanC;
43
+ in_bar_feedback: t.BooleanC;
44
+ summon_hotkey_override: t.UnionC<[t.StringC, t.NullC]>;
45
+ end_user_hotkeys: t.BooleanC;
46
+ releases_available: t.BooleanC;
47
+ releases_enabled: t.BooleanC;
48
+ }>;
49
+ export declare const defaults: t.TypeOf<typeof OrganizationAdditionalV>;
50
+ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
3
51
  id: t.UnionC<[t.NumberC, t.StringC]>;
4
52
  name: t.StringC;
5
53
  created: t.StringC;
54
+ }>, t.PartialC<{}>]>, t.TypeC<{
6
55
  launcher_type: t.UnionC<[t.LiteralC<"minimal">, t.LiteralC<"alternate">, t.LiteralC<"prompt">, t.LiteralC<"none">]>;
7
56
  launcher_position: t.UnionC<[t.LiteralC<"topRight">, t.LiteralC<"topLeft">, t.LiteralC<"bottomRight">, t.LiteralC<"bottomLeft">]>;
8
57
  show_launcher_recommendations: t.BooleanC;
@@ -30,6 +79,10 @@ export declare const OrganizationV: t.IntersectionC<[t.TypeC<{
30
79
  default_command_id: t.UnionC<[t.NumberC, t.UndefinedC]>;
31
80
  showResources: t.BooleanC;
32
81
  show_with_no_results: t.BooleanC;
82
+ search_tab_enabled: t.BooleanC;
83
+ search_tab_name: t.UnionC<[t.StringC, t.NullC]>;
84
+ search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
85
+ setting_pin_to_bottom: t.BooleanC;
33
86
  }>>;
34
87
  should_show_onboarding: t.BooleanC;
35
88
  last_snippet_request: t.UnionC<[t.StringC, t.NullC]>;
@@ -40,5 +93,10 @@ export declare const OrganizationV: t.IntersectionC<[t.TypeC<{
40
93
  show_skin_editor: t.BooleanC;
41
94
  allow_event_handlers: t.BooleanC;
42
95
  in_bar_feedback: t.BooleanC;
43
- }>, t.PartialC<{}>]>;
96
+ summon_hotkey_override: t.UnionC<[t.StringC, t.NullC]>;
97
+ end_user_hotkeys: t.BooleanC;
98
+ releases_available: t.BooleanC;
99
+ releases_enabled: t.BooleanC;
100
+ }>]>;
44
101
  export declare type IOrganizationType = t.TypeOf<typeof OrganizationV>;
102
+ export {};
@@ -15,6 +15,10 @@ export declare const ResourceSettingsV: t.PartialC<{
15
15
  default_command_id: t.UnionC<[t.NumberC, t.UndefinedC]>;
16
16
  showResources: t.BooleanC;
17
17
  show_with_no_results: t.BooleanC;
18
+ search_tab_enabled: t.BooleanC;
19
+ search_tab_name: t.UnionC<[t.StringC, t.NullC]>;
20
+ search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
21
+ setting_pin_to_bottom: t.BooleanC;
18
22
  }>;
19
23
  export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.PartialC<{
20
24
  name: t.StringC;
@@ -32,4 +36,8 @@ export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.Parti
32
36
  default_command_id: t.UnionC<[t.NumberC, t.UndefinedC]>;
33
37
  showResources: t.BooleanC;
34
38
  show_with_no_results: t.BooleanC;
39
+ search_tab_enabled: t.BooleanC;
40
+ search_tab_name: t.UnionC<[t.StringC, t.NullC]>;
41
+ search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
42
+ setting_pin_to_bottom: t.BooleanC;
35
43
  }>>;
@@ -1,10 +1,10 @@
1
1
  /*******************************************************************************/
2
2
  import * as t from 'io-ts';
3
3
  /*******************************************************************************/
4
- export declare const ConditionOperatorV: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
4
+ export declare const ConditionOperatorV: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
5
5
  export declare const ConditionV: t.TypeC<{
6
6
  field: t.StringC;
7
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
7
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
8
8
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
9
9
  }>;
10
10
  export declare const ContextArgumentV: t.IntersectionC<[t.TypeC<{
@@ -20,7 +20,7 @@ export declare const ContextArgumentV: t.IntersectionC<[t.TypeC<{
20
20
  label_field: t.StringC;
21
21
  availability_condition: t.ArrayC<t.TypeC<{
22
22
  field: t.StringC;
23
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
23
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
24
24
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
25
25
  }>>;
26
26
  loaded: t.ArrayC<t.AnyC>;
@@ -29,7 +29,7 @@ export declare const ContextArgumentV: t.IntersectionC<[t.TypeC<{
29
29
  }>]>;
30
30
  export declare const SetArgumentV: t.IntersectionC<[t.TypeC<{
31
31
  type: t.LiteralC<"set">;
32
- value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>]>;
32
+ value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>, t.ArrayC<t.UnknownRecordC>]>;
33
33
  order_key: t.NumberC;
34
34
  }>, t.PartialC<{
35
35
  label: t.StringC;
@@ -40,7 +40,7 @@ export declare const SetArgumentV: t.IntersectionC<[t.TypeC<{
40
40
  label_field: t.StringC;
41
41
  availability_condition: t.ArrayC<t.TypeC<{
42
42
  field: t.StringC;
43
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
43
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
44
44
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
45
45
  }>>;
46
46
  loaded: t.ArrayC<t.AnyC>;
@@ -60,7 +60,7 @@ export declare const DynamicArgumentV: t.IntersectionC<[t.TypeC<{
60
60
  label_field: t.StringC;
61
61
  availability_condition: t.ArrayC<t.TypeC<{
62
62
  field: t.StringC;
63
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
63
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
64
64
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
65
65
  }>>;
66
66
  loaded: t.ArrayC<t.AnyC>;
@@ -81,7 +81,7 @@ export declare const DependentArgumentV: t.IntersectionC<[t.TypeC<{
81
81
  label_field: t.StringC;
82
82
  availability_condition: t.ArrayC<t.TypeC<{
83
83
  field: t.StringC;
84
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
84
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
85
85
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
86
86
  }>>;
87
87
  loaded: t.ArrayC<t.AnyC>;
@@ -101,7 +101,7 @@ export declare const FunctionArgumentV: t.IntersectionC<[t.TypeC<{
101
101
  label_field: t.StringC;
102
102
  availability_condition: t.ArrayC<t.TypeC<{
103
103
  field: t.StringC;
104
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
104
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
105
105
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
106
106
  }>>;
107
107
  loaded: t.ArrayC<t.AnyC>;
@@ -121,7 +121,7 @@ export declare const ArgumentTypeV: t.UnionC<[t.IntersectionC<[t.TypeC<{
121
121
  label_field: t.StringC;
122
122
  availability_condition: t.ArrayC<t.TypeC<{
123
123
  field: t.StringC;
124
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
124
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
125
125
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
126
126
  }>>;
127
127
  loaded: t.ArrayC<t.AnyC>;
@@ -129,7 +129,7 @@ export declare const ArgumentTypeV: t.UnionC<[t.IntersectionC<[t.TypeC<{
129
129
  allow_create_label: t.StringC;
130
130
  }>]>, t.IntersectionC<[t.TypeC<{
131
131
  type: t.LiteralC<"set">;
132
- value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>]>;
132
+ value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>, t.ArrayC<t.UnknownRecordC>]>;
133
133
  order_key: t.NumberC;
134
134
  }>, t.PartialC<{
135
135
  label: t.StringC;
@@ -140,7 +140,7 @@ export declare const ArgumentTypeV: t.UnionC<[t.IntersectionC<[t.TypeC<{
140
140
  label_field: t.StringC;
141
141
  availability_condition: t.ArrayC<t.TypeC<{
142
142
  field: t.StringC;
143
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
143
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
144
144
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
145
145
  }>>;
146
146
  loaded: t.ArrayC<t.AnyC>;
@@ -159,7 +159,7 @@ export declare const ArgumentTypeV: t.UnionC<[t.IntersectionC<[t.TypeC<{
159
159
  label_field: t.StringC;
160
160
  availability_condition: t.ArrayC<t.TypeC<{
161
161
  field: t.StringC;
162
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
162
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
163
163
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
164
164
  }>>;
165
165
  loaded: t.ArrayC<t.AnyC>;
@@ -179,7 +179,7 @@ export declare const ArgumentTypeV: t.UnionC<[t.IntersectionC<[t.TypeC<{
179
179
  label_field: t.StringC;
180
180
  availability_condition: t.ArrayC<t.TypeC<{
181
181
  field: t.StringC;
182
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
182
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
183
183
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
184
184
  }>>;
185
185
  loaded: t.ArrayC<t.AnyC>;
@@ -198,7 +198,7 @@ export declare const ArgumentTypeV: t.UnionC<[t.IntersectionC<[t.TypeC<{
198
198
  label_field: t.StringC;
199
199
  availability_condition: t.ArrayC<t.TypeC<{
200
200
  field: t.StringC;
201
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
201
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
202
202
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
203
203
  }>>;
204
204
  loaded: t.ArrayC<t.AnyC>;
@@ -218,7 +218,7 @@ export declare const ArgumentMapV: t.RecordC<t.StringC, t.UnionC<[t.Intersection
218
218
  label_field: t.StringC;
219
219
  availability_condition: t.ArrayC<t.TypeC<{
220
220
  field: t.StringC;
221
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
221
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
222
222
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
223
223
  }>>;
224
224
  loaded: t.ArrayC<t.AnyC>;
@@ -226,7 +226,7 @@ export declare const ArgumentMapV: t.RecordC<t.StringC, t.UnionC<[t.Intersection
226
226
  allow_create_label: t.StringC;
227
227
  }>]>, t.IntersectionC<[t.TypeC<{
228
228
  type: t.LiteralC<"set">;
229
- value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>]>;
229
+ value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>, t.ArrayC<t.UnknownRecordC>]>;
230
230
  order_key: t.NumberC;
231
231
  }>, t.PartialC<{
232
232
  label: t.StringC;
@@ -237,7 +237,7 @@ export declare const ArgumentMapV: t.RecordC<t.StringC, t.UnionC<[t.Intersection
237
237
  label_field: t.StringC;
238
238
  availability_condition: t.ArrayC<t.TypeC<{
239
239
  field: t.StringC;
240
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
240
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
241
241
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
242
242
  }>>;
243
243
  loaded: t.ArrayC<t.AnyC>;
@@ -256,7 +256,7 @@ export declare const ArgumentMapV: t.RecordC<t.StringC, t.UnionC<[t.Intersection
256
256
  label_field: t.StringC;
257
257
  availability_condition: t.ArrayC<t.TypeC<{
258
258
  field: t.StringC;
259
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
259
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
260
260
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
261
261
  }>>;
262
262
  loaded: t.ArrayC<t.AnyC>;
@@ -276,7 +276,7 @@ export declare const ArgumentMapV: t.RecordC<t.StringC, t.UnionC<[t.Intersection
276
276
  label_field: t.StringC;
277
277
  availability_condition: t.ArrayC<t.TypeC<{
278
278
  field: t.StringC;
279
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
279
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
280
280
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
281
281
  }>>;
282
282
  loaded: t.ArrayC<t.AnyC>;
@@ -295,7 +295,7 @@ export declare const ArgumentMapV: t.RecordC<t.StringC, t.UnionC<[t.Intersection
295
295
  label_field: t.StringC;
296
296
  availability_condition: t.ArrayC<t.TypeC<{
297
297
  field: t.StringC;
298
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
298
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
299
299
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
300
300
  }>>;
301
301
  loaded: t.ArrayC<t.AnyC>;
@@ -318,7 +318,7 @@ export declare const StepArgumentTypeV: t.IntersectionC<[t.TypeC<{
318
318
  label_field: t.StringC;
319
319
  availability_condition: t.ArrayC<t.TypeC<{
320
320
  field: t.StringC;
321
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
321
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
322
322
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
323
323
  }>>;
324
324
  loaded: t.ArrayC<t.AnyC>;
@@ -326,7 +326,7 @@ export declare const StepArgumentTypeV: t.IntersectionC<[t.TypeC<{
326
326
  allow_create_label: t.StringC;
327
327
  }>]>, t.IntersectionC<[t.TypeC<{
328
328
  type: t.LiteralC<"set">;
329
- value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>]>;
329
+ value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>, t.ArrayC<t.UnknownRecordC>]>;
330
330
  order_key: t.NumberC;
331
331
  }>, t.PartialC<{
332
332
  label: t.StringC;
@@ -337,7 +337,7 @@ export declare const StepArgumentTypeV: t.IntersectionC<[t.TypeC<{
337
337
  label_field: t.StringC;
338
338
  availability_condition: t.ArrayC<t.TypeC<{
339
339
  field: t.StringC;
340
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
340
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
341
341
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
342
342
  }>>;
343
343
  loaded: t.ArrayC<t.AnyC>;
@@ -356,7 +356,7 @@ export declare const StepArgumentTypeV: t.IntersectionC<[t.TypeC<{
356
356
  label_field: t.StringC;
357
357
  availability_condition: t.ArrayC<t.TypeC<{
358
358
  field: t.StringC;
359
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
359
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
360
360
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
361
361
  }>>;
362
362
  loaded: t.ArrayC<t.AnyC>;
@@ -376,7 +376,7 @@ export declare const StepArgumentTypeV: t.IntersectionC<[t.TypeC<{
376
376
  label_field: t.StringC;
377
377
  availability_condition: t.ArrayC<t.TypeC<{
378
378
  field: t.StringC;
379
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
379
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
380
380
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
381
381
  }>>;
382
382
  loaded: t.ArrayC<t.AnyC>;
@@ -395,7 +395,7 @@ export declare const StepArgumentTypeV: t.IntersectionC<[t.TypeC<{
395
395
  label_field: t.StringC;
396
396
  availability_condition: t.ArrayC<t.TypeC<{
397
397
  field: t.StringC;
398
- operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">]>;
398
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
399
399
  value: t.UnionC<[t.StringC, t.UndefinedC]>;
400
400
  }>>;
401
401
  loaded: t.ArrayC<t.AnyC>;
@@ -5,11 +5,11 @@ declare const OperatorV: t.KeyofC<{
5
5
  endsWith: null;
6
6
  startsWith: null;
7
7
  is: null;
8
+ isTruthy: null;
9
+ isFalsy: null;
8
10
  isNot: null;
9
11
  isTrue: null;
10
12
  isFalse: null;
11
- isTruthy: null;
12
- isFalsy: null;
13
13
  doesNotInclude: null;
14
14
  matchesRegex: null;
15
15
  isGreaterThan: null;
@@ -26,11 +26,11 @@ export declare const AvailabilityRuleV: t.IntersectionC<[t.TypeC<{
26
26
  endsWith: null;
27
27
  startsWith: null;
28
28
  is: null;
29
+ isTruthy: null;
30
+ isFalsy: null;
29
31
  isNot: null;
30
32
  isTrue: null;
31
33
  isFalse: null;
32
- isTruthy: null;
33
- isFalsy: null;
34
34
  doesNotInclude: null;
35
35
  matchesRegex: null;
36
36
  isGreaterThan: null;
@@ -43,6 +43,7 @@ export declare const AvailabilityRuleV: t.IntersectionC<[t.TypeC<{
43
43
  }>, t.PartialC<{
44
44
  field: t.StringC;
45
45
  value: t.StringC;
46
+ reason: t.StringC;
46
47
  }>]>;
47
48
  export declare const RecommendationRuleV: t.IntersectionC<[t.TypeC<{
48
49
  type: t.UnionC<[t.LiteralC<"context">, t.LiteralC<"url">, t.LiteralC<"element">, t.LiteralC<"always">]>;
@@ -52,11 +53,11 @@ export declare const RecommendationRuleV: t.IntersectionC<[t.TypeC<{
52
53
  endsWith: null;
53
54
  startsWith: null;
54
55
  is: null;
56
+ isTruthy: null;
57
+ isFalsy: null;
55
58
  isNot: null;
56
59
  isTrue: null;
57
60
  isFalse: null;
58
- isTruthy: null;
59
- isFalsy: null;
60
61
  doesNotInclude: null;
61
62
  matchesRegex: null;
62
63
  isGreaterThan: null;
@@ -68,6 +69,7 @@ export declare const RecommendationRuleV: t.IntersectionC<[t.TypeC<{
68
69
  }>;
69
70
  field: t.StringC;
70
71
  value: t.StringC;
72
+ reason: t.StringC;
71
73
  }>]>;
72
74
  export declare type IRuleOperator = t.TypeOf<typeof OperatorV>;
73
75
  export declare type IAvailabilityRule = t.TypeOf<typeof AvailabilityRuleV>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commandbar",
3
- "version": "1.6.1",
3
+ "version": "1.6.4",
4
4
  "description": "Javascript Utility for CommandBar",
5
5
  "main": "build/commandbar-js/src/index.js",
6
6
  "types": "build/commandbar-js/src/index.d.ts",
package/src/init.ts CHANGED
@@ -6,6 +6,8 @@ import { _configuration } from '../../internal/src/client/symbols';
6
6
 
7
7
  interface IInitOptions {
8
8
  debug?: boolean;
9
+ environment?: string;
10
+ version?: string;
9
11
  }
10
12
 
11
13
  const getSrc = (org: string) => {
@@ -57,7 +59,7 @@ const DEFAULT_OPTS = { debug: false };
57
59
  * finished loading yet.
58
60
  *
59
61
  * @param {string} org Your organization ID, which can be found [here](https://app.commandbar.com/docs/getting-started/installation#step-1:-install-commandbar).
60
- * @param {IInitOptions} [opts] Additional options to use for initialization: `debug` will enable additional logging
62
+ * @param {IInitOptions} [opts] Additional options to use for initialization: `debug` will enable additional logging, `environment` specifies the environment to load config from
61
63
  * output.
62
64
  */
63
65
  const init = (org: string, opts: IInitOptions = DEFAULT_OPTS) => {
@@ -68,9 +70,9 @@ const init = (org: string, opts: IInitOptions = DEFAULT_OPTS) => {
68
70
  return;
69
71
  }
70
72
 
71
- config.debug && console.log('CommandBar init...');
73
+ config.debug && console.log('CommandBar init...', { environment: opts.environment, version: opts.version });
72
74
 
73
- getProxySDK()[_configuration] = { uuid: org };
75
+ getProxySDK()[_configuration] = { uuid: org, environment: opts.environment, version: opts.version };
74
76
  loadLatest(org);
75
77
  };
76
78