commandbar 1.6.11 → 1.6.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/build/commandbar-js/src/index.js +1 -1
  2. package/build/internal/src/client/AddContextOptions.d.ts +5 -0
  3. package/build/internal/src/client/CommandBarClientSDK.d.ts +55 -5
  4. package/build/internal/src/client/CommandBarProxySDK.d.ts +4 -4
  5. package/build/internal/src/client/CommandBarSDK.d.ts +4 -7
  6. package/build/internal/src/client/EventHandler.d.ts +3 -3
  7. package/build/internal/src/client/OrgConfig.d.ts +5 -0
  8. package/build/internal/src/client/SentryReporter.d.ts +24 -3
  9. package/build/internal/src/client/symbols.d.ts +1 -0
  10. package/build/internal/src/middleware/CommandFromClientV.d.ts +47 -3
  11. package/build/internal/src/middleware/OrganizationV.d.ts +16 -0
  12. package/build/internal/src/middleware/ResourceSettingsV.d.ts +4 -0
  13. package/build/internal/src/middleware/command.d.ts +1632 -213
  14. package/build/internal/src/middleware/commandCategory.d.ts +16 -0
  15. package/build/internal/src/middleware/detailPreview.d.ts +4 -2
  16. package/build/internal/src/middleware/generics.d.ts +10 -10
  17. package/build/internal/src/middleware/helpers/argument.d.ts +156 -0
  18. package/build/internal/src/middleware/helpers/commandTemplate.d.ts +34 -0
  19. package/build/internal/src/middleware/helpers/rules.d.ts +29 -26
  20. package/build/internal/src/middleware/nudge.d.ts +189 -0
  21. package/build/internal/src/middleware/organization.d.ts +164 -13
  22. package/build/internal/src/middleware/releases.d.ts +1 -1
  23. package/build/internal/src/middleware/types.d.ts +90 -10
  24. package/build/internal/src/middleware/user.d.ts +3 -1
  25. package/package.json +2 -4
  26. package/src/init.ts +6 -2
@@ -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},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,config:r.config},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"],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"]},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._shareProgrammaticCommands=r._shareContextSettings=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._shareContextSettings=Symbol.for("CommandBar::shareContextSettings"),r._shareProgrammaticCommands=Symbol.for("CommandBar::shareProgrammaticCommands"),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)})()}));
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 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)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}},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");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){var e;void 0===r&&(r=s);var c=o(o({},s),r);t?(null===(e=(0,n.getProxySDK)()[i._configuration])||void 0===e?void 0:e.uuid)?console.warn("CommandBar init was called more than once. Skipping the redundant initialization..."):(c.debug&&console.log("CommandBar init...",{environment:r.environment,version:r.version}),(0,n.getProxySDK)()[i._configuration]={uuid:t,environment:r.environment,version:r.version,config:r.config},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"],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.DEFAULT_INSTANCE_ATTRIBUTES=r.ASYNC_METHODS=void 0,r.ASYNC_METHODS=["addCommand","boot"],r.DEFAULT_INSTANCE_ATTRIBUTES={canOpenEditor:!0,formFactor:{type:"modal"}}},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._shareProgrammaticCommands=r._shareContextSettings=r._setEditorVisible=r._setTestMode=r._setPreviewMode=r._setDashboard=r._search=r._reporter=r._report=r._reloadNudges=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._reloadNudges=Symbol.for("CommandBar::reloadNudges"),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._shareContextSettings=Symbol.for("CommandBar::shareContextSettings"),r._shareProgrammaticCommands=Symbol.for("CommandBar::shareProgrammaticCommands"),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)})()}));
@@ -15,6 +15,11 @@ export interface SearchResultsPaginated {
15
15
  }
16
16
  export declare type SearchFunction = (input: string) => DataRow[] | Promise<DataRow[]>;
17
17
  export declare type SearchFunctionPaginated = (input: string, pagination?: unknown) => SearchResultsPaginated | Promise<SearchResultsPaginated>;
18
+ export declare type MultiSearchFunction = (input: string) => {
19
+ [key: string]: DataRow[];
20
+ } | Promise<{
21
+ [key: string]: DataRow[];
22
+ }>;
18
23
  /** Options to customize CommandBar properties for `key`. */
19
24
  export interface AddContextOptions {
20
25
  /** quickFind allows the `key` to be searchable from the top-level of the Bar, alongside commands. */
@@ -2,7 +2,7 @@ import { AddContextOptions, ArgumentOptions, DataRow, RecordOptions } from './Ad
2
2
  import { EventHandler } from './EventHandler';
3
3
  import { ICommandFromClientType } from '../middleware/ICommandFromClientType';
4
4
  import { IResourceSettings } from '../middleware/IResourceSettings';
5
- import { ICommandCategoryType, DetailPreviewType, DataRowMedata } from '../middleware/types';
5
+ import { ICommandCategoryType, DetailPreviewType, DataRowMedata, ISkinType } from '../middleware/types';
6
6
  export type { DataRow } from './AddContextOptions';
7
7
  export type { DataRowMedata } from '../middleware/types';
8
8
  export declare const ASYNC_METHODS: Array<keyof CommandBarClientSDK>;
@@ -26,10 +26,21 @@ export declare type CommandDetails = {
26
26
  customShortcut: string | undefined;
27
27
  };
28
28
  export declare type UserAttributes = Record<string, unknown>;
29
+ export declare type ModalFormFactor = {
30
+ type: 'modal';
31
+ };
32
+ export declare type InlineFormFactor = {
33
+ type: 'inline';
34
+ rootElement: string;
35
+ };
36
+ export declare type FormFactorConfig = ModalFormFactor | InlineFormFactor;
37
+ export declare type FormFactor = Pick<FormFactorConfig, 'type'>;
29
38
  export declare type InstanceAttributes = {
30
- canOpenEditor?: boolean;
39
+ canOpenEditor: boolean;
31
40
  hmac?: string;
41
+ formFactor: FormFactorConfig;
32
42
  };
43
+ export declare const DEFAULT_INSTANCE_ATTRIBUTES: InstanceAttributes;
33
44
  export declare type CallbackFunction<T, U = Metadata> = (args: T, context: U) => void;
34
45
  export declare type ContextLoader = (chosenValues?: undefined | Record<string, unknown[]>) => unknown;
35
46
  export declare type RecordsOrArgumentListLoader = (chosenValues?: undefined | Record<string, unknown[]>) => DataRow[];
@@ -120,6 +131,25 @@ export declare type CommandBarClientSDK = Readonly<{
120
131
  * [eventData you pass to .boot()](https://app.commandbar.com/sdk#boot-eventdata) will be added to each event.
121
132
  */
122
133
  addEventHandler(eventHandler: EventHandler): Promise<void>;
134
+ /**
135
+ * Captures Nudges to be handled by your code. Nudges are a way to send a messages to the user.
136
+ * They are defined in the editor with a trigger and conditions. When the trigger occurs, and the conditions are met,
137
+ * the nudgeHandler is called with the nudge information.
138
+ *
139
+ * You can handle this as you would other in-app messages / notifications / toasts.
140
+ *
141
+ * @param nudgeHandler A function for handling nudges. It is passed an object with the following properties:
142
+ * * `slug`: The slug of the nudge
143
+ * * `content`: The content of the nudge
144
+ * * `onClick`: The default on click behavior for the nudge. E.g., if a nudge is defined in the editor
145
+ * to execute a command on click, then calling `onClick` will execute that command.
146
+ **/
147
+ addNudgeHandler(nudgeHandler: ({ slug, content, onClick, timeout, }: {
148
+ slug: string;
149
+ content: string;
150
+ onClick: () => void;
151
+ timeout: number | null;
152
+ }) => void): void;
123
153
  /**
124
154
  * Add a record action for a key
125
155
  *
@@ -152,6 +182,13 @@ export declare type CommandBarClientSDK = Readonly<{
152
182
  * @see [RecordOptions](#RecordOptions).
153
183
  */
154
184
  addRecords(key: string, initial: DataRow[] | RecordsOrArgumentListLoader, options?: RecordOptions): void;
185
+ /**
186
+ * Adds a search endpoint to CommandBar that returns results for multiple record types.
187
+ *
188
+ * @param onInputChange search endpoint to call for the specified record keys
189
+ * @param keys Record keys that this search endppoint covers
190
+ */
191
+ addMultiSearch(onInputChange: (input: string) => Promise<any>, keys: string[]): void;
155
192
  /**
156
193
  * 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).
157
194
  *
@@ -170,11 +207,17 @@ export declare type CommandBarClientSDK = Readonly<{
170
207
  * filter on these attributes from the analytics page in your dashboard. In addition, events passed to a supplied
171
208
  * event handler will include metadata you provide via `boot`.
172
209
  */
173
- boot(id: string, userAttributes?: UserAttributes, instanceAttributes?: InstanceAttributes): Promise<void>;
210
+ boot(id: string, userAttributes?: UserAttributes, instanceAttributes?: Partial<InstanceAttributes>): Promise<void>;
174
211
  /**
175
212
  * @deprecated Passing an object to boot will be deprecated in a future version of CommandBar.
176
213
  */
177
214
  boot(opts: BootOptions): Promise<void>;
215
+ /**
216
+ * Changes the Bar form factor; can be set to either Modal (the default) or Inline.
217
+ *
218
+ * @param formFactorConfig either {type: 'modal'} or {type: 'inline', rootElement: (id of an element on the page) or an HTMLElement}
219
+ */
220
+ setFormFactor(formFactorConfig: FormFactorConfig): Promise<void>;
178
221
  clearActiveObject(contextKey: string): void;
179
222
  close(): void;
180
223
  /**
@@ -247,7 +290,7 @@ export declare type CommandBarClientSDK = Readonly<{
247
290
  * @param slug Component slug
248
291
  * @param getHTML Function that returns an html string to be rendered as the component
249
292
  */
250
- setCustomComponent(slug: 'header' | 'input' | 'sidepanel' | 'footer' | 'navPaneHeader' | 'navPaneFooter', getHTML: (step?: 'base' | 'multiselect' | 'longtextinput' | 'textinput' | 'select') => string): void;
293
+ setCustomComponent(slug: 'header' | 'input' | 'sidepanel' | 'footer' | 'navPaneHeader' | 'navPaneFooter', getHTML: (step?: 'base' | 'multiselect' | 'longtextinput' | 'textinput' | 'select' | 'dashboard') => string): void;
251
294
  /**
252
295
  * Similar to `addContext`, but also removes any keys that are omitted from the supplied `ctx` from context. It may be
253
296
  * helpful to use this to make large context changes, such as when a user logs out.
@@ -274,7 +317,7 @@ export declare type CommandBarClientSDK = Readonly<{
274
317
  * @param theme A hex color. Using 'light' or 'dark' will trigger CommandBar's default light or dark theme.
275
318
  * @param [primaryColor] A hex color.
276
319
  */
277
- setTheme(theme: string | 'light' | 'dark', primaryColor?: string): void;
320
+ setTheme(theme: string | 'light' | 'dark' | Pick<ISkinType, 'logo' | 'skin'>, primaryColor?: string): void;
278
321
  /**
279
322
  * Returns dictionary representing the current callbacks currently stored within CommandBar. The keys represent
280
323
  * callback keys, and the values are the supplied functions.
@@ -282,6 +325,13 @@ export declare type CommandBarClientSDK = Readonly<{
282
325
  shareCallbacks(): Record<string, CallbackFunction<unknown>>;
283
326
  /** Returns the key value dictionary representing the current state of context */
284
327
  shareContext(): Metadata;
328
+ /**
329
+ * Get information about the current status of CommandBar
330
+ */
331
+ shareState(): {
332
+ isBooted: boolean;
333
+ currentInput: string;
334
+ };
285
335
  /**
286
336
  * Make CommandBar unavailable to the user. Does nothing unless `.boot` has been called. `shutdown` is typically used
287
337
  * to make CommandBar unavailable after logout.
@@ -1,5 +1,5 @@
1
- import { SentryReporter } from './SentryReporter';
2
- import { SDKConfig, OrgConfig } from './CommandBarSDK';
1
+ import { OrgConfig } from './OrgConfig';
2
+ import { SDKConfig } from './CommandBarSDK';
3
3
  import { _configuration, _disposed, _isProxy, _queue, _reporter, _unwrap, _orgConfig } from './symbols';
4
4
  /**
5
5
  * A proxy object that absorbs function calls into a queue that can be later consumed. The queue contains the name of
@@ -11,7 +11,7 @@ import { _configuration, _disposed, _isProxy, _queue, _reporter, _unwrap, _orgCo
11
11
  export declare type CommandBarProxySDK = CommandBarProxyGlobal & Record<string, Function> & {
12
12
  [_configuration]?: Function | Partial<SDKConfig>;
13
13
  [_orgConfig]?: Function | OrgConfig;
14
- [_reporter]?: Function | SentryReporter;
14
+ [_reporter]?: Function | any;
15
15
  };
16
16
  /**
17
17
  * The global SDK object, which is usually hidden behind a Proxy at `window.CommandBar`. Use
@@ -42,7 +42,7 @@ export interface CommandBarProxyGlobal {
42
42
  [_unwrap]: () => CommandBarProxyGlobal;
43
43
  [_configuration]?: Partial<SDKConfig>;
44
44
  [_orgConfig]?: OrgConfig;
45
- [_reporter]?: SentryReporter;
45
+ [_reporter]?: any;
46
46
  }
47
47
  /** Tests if the given object is a "proxy" SDK object that has not yet been upgraded to a client SDK object. */
48
48
  export declare function isProxySDK(x: unknown): x is CommandBarProxySDK;
@@ -1,18 +1,14 @@
1
1
  import { CommandBarClientSDK, InstanceAttributes, Metadata } from './CommandBarClientSDK';
2
2
  import { EVENT_NAME } from './AnalyticsEventTypes';
3
3
  import { SentryReporter } from './SentryReporter';
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, _shareContextSettings, _shareProgrammaticCommands } from './symbols';
4
+ import { _access, _configuration, _configure, _configUser, _dispose, _disposed, _userAttributes, _isProxy, _loadEditor, _orgConfig, _perf, _programmaticTheme, _reloadCommands, _reloadOrganization, _reloadPlaceholders, _reloadNudges, _report, _reporter, _search, _setDashboard, _setPreviewMode, _setTestMode, _showGuide, _showMessage, _user, _instanceAttributes, _setEditorVisible, _shareContextSettings, _shareProgrammaticCommands } from './symbols';
5
5
  import { SDKConfig } from './SDKConfig';
6
6
  import { ICommandType, IResourceSettingsByContextKey } from '../middleware/types';
7
- export interface OrgConfig {
8
- name?: string;
9
- silent?: boolean;
10
- eventAttributeBlockList?: string[];
11
- }
7
+ import { OrgConfig } from './OrgConfig';
12
8
  export type { SDKConfig } from './SDKConfig';
13
9
  export interface CommandBarSDK extends CommandBarClientSDK {
14
10
  [_access]: string | undefined;
15
- [_instanceAttributes]: InstanceAttributes | undefined;
11
+ [_instanceAttributes]: InstanceAttributes;
16
12
  [_perf]: boolean;
17
13
  [_programmaticTheme]: string | undefined;
18
14
  [_reporter]: SentryReporter | undefined;
@@ -31,6 +27,7 @@ export interface CommandBarSDK extends CommandBarClientSDK {
31
27
  readonly [_reloadCommands]: () => void;
32
28
  readonly [_reloadOrganization]: () => void;
33
29
  readonly [_reloadPlaceholders]: () => void;
30
+ readonly [_reloadNudges]: () => void;
34
31
  /** @deprecated */
35
32
  readonly [_report]: (event: EVENT_NAME, data?: Metadata) => void;
36
33
  /** @deprecated */
@@ -28,7 +28,7 @@ export interface ClosedEvent {
28
28
  export interface CommandExecutionEvent {
29
29
  /** Event data passed for `command_execution` events. */
30
30
  /** The category id of the command. Only provided if the command has a category. */
31
- category?: number | null;
31
+ category?: string | number | null;
32
32
  /**
33
33
  * The unique id of the command. For commands defined via the Editor, the value will be a number. For programmatic
34
34
  * commands, the `name` (string) provided will be used.
@@ -49,7 +49,7 @@ export interface CommandExecutionEvent {
49
49
  /** command_ids of previously executed commands in the session */
50
50
  previousCommands?: string[];
51
51
  /** Command types, as defined at: https://www.commandbar.com/docs/commands/types/overview */
52
- commandType?: 'admin' | 'link' | 'script' | 'clickByXpath' | 'clickBySelector' | 'click' | 'callback' | 'builtin' | 'webhook' | 'request' | 'appcues';
52
+ commandType?: 'admin' | 'link' | 'script' | 'clickByXpath' | 'clickBySelector' | 'click' | 'callback' | 'builtin' | 'webhook' | 'request' | 'video' | 'helpdoc' | 'appcues';
53
53
  }
54
54
  export interface EndUserShortcutChangedEvent {
55
55
  /** Event data passed for `command_execution` events. */
@@ -84,7 +84,7 @@ export interface OpenedEvent {
84
84
  * [commandbar-launcher](https://www.npmjs.com/package/commandbar-launcher) component register as programmatic
85
85
  * opens.
86
86
  */
87
- trigger: 'launcher' | 'keyboard' | 'programmatic';
87
+ trigger: 'launcher' | 'keyboard' | 'programmatic' | 'nudge';
88
88
  /** The placeholder showing when the user opened the bar. */
89
89
  placeholder: string;
90
90
  }
@@ -0,0 +1,5 @@
1
+ export interface OrgConfig {
2
+ name?: string;
3
+ silent?: boolean;
4
+ eventAttributeBlockList?: string[];
5
+ }
@@ -1,7 +1,5 @@
1
- import { Hub } from '@sentry/react';
2
1
  import { IOrganizationType } from '../middleware/OrganizationV';
3
2
  import { PublicDisposable } from '../util/Disposable';
4
- declare type HubInstance = InstanceType<typeof Hub>;
5
3
  declare type ExtraData = Record<string, unknown>;
6
4
  export interface UserScopeOptions {
7
5
  configuration: {
@@ -17,9 +15,32 @@ export interface UserScopeOptions {
17
15
  session: string;
18
16
  userId?: string;
19
17
  }
18
+ declare enum Severity {
19
+ Fatal = "fatal",
20
+ Error = "error",
21
+ Warning = "warning",
22
+ Log = "log",
23
+ Info = "info",
24
+ Debug = "debug",
25
+ Critical = "critical"
26
+ }
27
+ interface Breadcrumb {
28
+ type?: string;
29
+ level?: Severity;
30
+ event_id?: string;
31
+ category?: string;
32
+ message?: string;
33
+ data?: {
34
+ [key: string]: any;
35
+ };
36
+ timestamp?: number;
37
+ }
38
+ interface BreadcrumbHint {
39
+ [key: string]: any;
40
+ }
20
41
  export declare abstract class SentryReporter implements PublicDisposable {
21
42
  _disposed: boolean;
22
- breadcrumb: HubInstance['addBreadcrumb'];
43
+ breadcrumb: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void;
23
44
  dispose(): void;
24
45
  /**
25
46
  * Report an error to Sentry. The first argument must either be a string or error object, and optionally an error
@@ -15,6 +15,7 @@ export declare const _queue: unique symbol;
15
15
  export declare const _reloadCommands: unique symbol;
16
16
  export declare const _reloadOrganization: unique symbol;
17
17
  export declare const _reloadPlaceholders: unique symbol;
18
+ export declare const _reloadNudges: unique symbol;
18
19
  export declare const _report: unique symbol;
19
20
  export declare const _reporter: unique symbol;
20
21
  export declare const _search: unique symbol;
@@ -67,6 +67,7 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
67
67
  hotkey_win: t.StringC;
68
68
  tags: t.ArrayC<t.StringC>;
69
69
  explanation: t.StringC;
70
+ heading: t.StringC;
70
71
  sort_key: t.UnionC<[t.NumberC, t.NullC]>;
71
72
  arguments: t.RecordC<t.StringC, t.UnionC<[t.IntersectionC<[t.TypeC<{
72
73
  type: t.LiteralC<"context">;
@@ -89,6 +90,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
89
90
  allow_create_label: t.StringC;
90
91
  show_in_record_action_list: t.BooleanC;
91
92
  show_in_default_list: t.BooleanC;
93
+ auto_choose: t.BooleanC;
94
+ is_private: t.BooleanC;
92
95
  }>]>, t.IntersectionC<[t.TypeC<{
93
96
  type: t.LiteralC<"set">;
94
97
  value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>, t.ArrayC<t.UnknownRecordC>]>;
@@ -108,6 +111,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
108
111
  loaded: t.ArrayC<t.AnyC>;
109
112
  allow_create: t.BooleanC;
110
113
  allow_create_label: t.StringC;
114
+ auto_choose: t.BooleanC;
115
+ is_private: t.BooleanC;
111
116
  }>]>, t.IntersectionC<[t.TypeC<{
112
117
  type: t.LiteralC<"provided">;
113
118
  value: t.UnionC<[t.LiteralC<"text">, t.LiteralC<"time">]>;
@@ -128,6 +133,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
128
133
  dateTimeArgumentTypeId: t.NumberC;
129
134
  allow_create: t.BooleanC;
130
135
  allow_create_label: t.StringC;
136
+ auto_choose: t.BooleanC;
137
+ is_private: t.BooleanC;
131
138
  }>]>, t.IntersectionC<[t.TypeC<{
132
139
  type: t.LiteralC<"dependent">;
133
140
  value: t.StringC;
@@ -147,6 +154,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
147
154
  loaded: t.ArrayC<t.AnyC>;
148
155
  allow_create: t.BooleanC;
149
156
  allow_create_label: t.StringC;
157
+ auto_choose: t.BooleanC;
158
+ is_private: t.BooleanC;
150
159
  }>]>, t.IntersectionC<[t.TypeC<{
151
160
  type: t.LiteralC<"function">;
152
161
  value: t.StringC;
@@ -166,6 +175,35 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
166
175
  loaded: t.ArrayC<t.AnyC>;
167
176
  allow_create: t.BooleanC;
168
177
  allow_create_label: t.StringC;
178
+ auto_choose: t.BooleanC;
179
+ is_private: t.BooleanC;
180
+ }>]>, t.IntersectionC<[t.TypeC<{
181
+ type: t.UnionC<[t.LiteralC<"video">, t.LiteralC<"html">]>;
182
+ value: t.IntersectionC<[t.TypeC<{
183
+ source: t.StringC;
184
+ }>, t.PartialC<{
185
+ title: t.StringC;
186
+ description: t.StringC;
187
+ url: t.StringC;
188
+ }>]>;
189
+ order_key: t.NumberC;
190
+ }>, t.PartialC<{
191
+ label: t.StringC;
192
+ chosen: t.UnionC<[t.StringC, t.NumberC]>;
193
+ selected: t.ArrayC<t.AnyC>;
194
+ input_type: t.StringC;
195
+ preselected_key: t.StringC;
196
+ label_field: t.StringC;
197
+ availability_condition: t.ArrayC<t.TypeC<{
198
+ field: t.StringC;
199
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
200
+ value: t.UnionC<[t.StringC, t.UndefinedC]>;
201
+ }>>;
202
+ loaded: t.ArrayC<t.AnyC>;
203
+ allow_create: t.BooleanC;
204
+ allow_create_label: t.StringC;
205
+ is_private: t.BooleanC;
206
+ auto_choose: t.BooleanC;
169
207
  }>]>]>>;
170
208
  category: t.UnionC<[t.NumberC, t.StringC, t.NullC]>;
171
209
  icon: t.UnionC<[t.StringC, t.NullC]>;
@@ -242,11 +280,17 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
242
280
  value: t.StringC;
243
281
  reason: t.StringC;
244
282
  }>]>]>>;
245
- detail: t.UnionC<[t.StringC, t.TypeC<{
283
+ availability_expression: t.ArrayC<t.Type<import("./helpers/rules").RuleExpression, import("./helpers/rules").RuleExpression, unknown>>;
284
+ recommend_expression: t.ArrayC<t.Type<import("./helpers/rules").RuleExpression, import("./helpers/rules").RuleExpression, unknown>>;
285
+ detail: t.UnionC<[t.StringC, t.IntersectionC<[t.TypeC<{
246
286
  type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.NullC]>;
247
287
  value: t.StringC;
248
- }>, t.ArrayC<t.TypeC<{
288
+ }>, t.PartialC<{
289
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
290
+ }>]>, t.ArrayC<t.IntersectionC<[t.TypeC<{
249
291
  type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.NullC]>;
250
292
  value: t.StringC;
251
- }>>]>;
293
+ }>, t.PartialC<{
294
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
295
+ }>]>>]>;
252
296
  }>]>;
@@ -33,6 +33,8 @@ declare const OrganizationAdditionalV: t.TypeC<{
33
33
  show_with_no_results: t.BooleanC;
34
34
  search_tab_enabled: t.BooleanC;
35
35
  search_tab_name: t.UnionC<[t.StringC, t.NullC]>;
36
+ slash_filter_enabled: t.BooleanC;
37
+ slash_filter_keyword: t.UnionC<[t.StringC, t.NullC]>;
36
38
  search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
37
39
  setting_pin_to_bottom: t.BooleanC;
38
40
  track_recents: t.BooleanC;
@@ -54,6 +56,12 @@ declare const OrganizationAdditionalV: t.TypeC<{
54
56
  releases_enabled: t.BooleanC;
55
57
  fallback_commands: t.ArrayC<t.NumberC>;
56
58
  tab_direction: t.UnionC<[t.LiteralC<"horizontal">, t.LiteralC<"vertical">]>;
59
+ recommended_tab_enabled: t.BooleanC;
60
+ recents_tab_enabled: t.BooleanC;
61
+ recommended_tab_instruction: t.StringC;
62
+ recents_tab_instruction: t.StringC;
63
+ hotload_help_docs: t.BooleanC;
64
+ slash_filters_enabled: t.BooleanC;
57
65
  }>;
58
66
  export declare const defaults: t.TypeOf<typeof OrganizationAdditionalV>;
59
67
  export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
@@ -94,6 +102,8 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
94
102
  show_with_no_results: t.BooleanC;
95
103
  search_tab_enabled: t.BooleanC;
96
104
  search_tab_name: t.UnionC<[t.StringC, t.NullC]>;
105
+ slash_filter_enabled: t.BooleanC;
106
+ slash_filter_keyword: t.UnionC<[t.StringC, t.NullC]>;
97
107
  search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
98
108
  setting_pin_to_bottom: t.BooleanC;
99
109
  track_recents: t.BooleanC;
@@ -115,6 +125,12 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
115
125
  releases_enabled: t.BooleanC;
116
126
  fallback_commands: t.ArrayC<t.NumberC>;
117
127
  tab_direction: t.UnionC<[t.LiteralC<"horizontal">, t.LiteralC<"vertical">]>;
128
+ recommended_tab_enabled: t.BooleanC;
129
+ recents_tab_enabled: t.BooleanC;
130
+ recommended_tab_instruction: t.StringC;
131
+ recents_tab_instruction: t.StringC;
132
+ hotload_help_docs: t.BooleanC;
133
+ slash_filters_enabled: t.BooleanC;
118
134
  }>]>;
119
135
  export declare type IOrganizationType = t.TypeOf<typeof OrganizationV>;
120
136
  export {};
@@ -25,6 +25,8 @@ export declare const ResourceSettingsV: t.PartialC<{
25
25
  show_with_no_results: t.BooleanC;
26
26
  search_tab_enabled: t.BooleanC;
27
27
  search_tab_name: t.UnionC<[t.StringC, t.NullC]>;
28
+ slash_filter_enabled: t.BooleanC;
29
+ slash_filter_keyword: t.UnionC<[t.StringC, t.NullC]>;
28
30
  search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
29
31
  setting_pin_to_bottom: t.BooleanC;
30
32
  track_recents: t.BooleanC;
@@ -51,6 +53,8 @@ export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.Parti
51
53
  show_with_no_results: t.BooleanC;
52
54
  search_tab_enabled: t.BooleanC;
53
55
  search_tab_name: t.UnionC<[t.StringC, t.NullC]>;
56
+ slash_filter_enabled: t.BooleanC;
57
+ slash_filter_keyword: t.UnionC<[t.StringC, t.NullC]>;
54
58
  search_tab_instruction: t.UnionC<[t.StringC, t.NullC]>;
55
59
  setting_pin_to_bottom: t.BooleanC;
56
60
  track_recents: t.BooleanC;