commandbar 1.11.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/build/commandbar/src/shared/services/analytics/EventHandler.d.ts +2 -2
  2. package/build/commandbar/src/shared/services/analytics/types.d.ts +2 -2
  3. package/build/commandbar/src/shared/services/analytics/v2/client.d.ts +2 -3
  4. package/build/commandbar/src/shared/services/analytics/v2/schema.d.ts +1 -1
  5. package/build/commandbar-js/src/index.d.ts +2 -2
  6. package/build/commandbar-js/src/index.js +1 -1
  7. package/build/commandbar-js/src/snippet.d.ts +1 -2
  8. package/build/internal/src/client/CommandBarClientSDK.d.ts +2 -1
  9. package/build/internal/src/client/CommandBarSDK.d.ts +3 -3
  10. package/build/internal/src/middleware/CommandFromClientV.d.ts +3 -0
  11. package/build/internal/src/middleware/OrganizationV.d.ts +58 -4
  12. package/build/internal/src/middleware/additionalResource.d.ts +36 -9
  13. package/build/internal/src/middleware/api.d.ts +8 -0
  14. package/build/internal/src/middleware/chat.d.ts +439 -76
  15. package/build/internal/src/middleware/checklist.d.ts +48 -10
  16. package/build/internal/src/middleware/command.d.ts +259 -46
  17. package/build/internal/src/middleware/endUser.d.ts +1 -1
  18. package/build/internal/src/middleware/experienceTemplate.d.ts +72 -16
  19. package/build/internal/src/middleware/experiencesSearch.d.ts +77 -14
  20. package/build/internal/src/middleware/flags.d.ts +4 -5
  21. package/build/internal/src/middleware/helpDocsSearch.d.ts +55 -10
  22. package/build/internal/src/middleware/helpHub.d.ts +1 -0
  23. package/build/internal/src/middleware/helpers/actions.d.ts +21 -6
  24. package/build/internal/src/middleware/helpers/commandTemplate.d.ts +14 -2
  25. package/build/internal/src/middleware/helpers/rules.d.ts +2 -0
  26. package/build/internal/src/middleware/keyword.d.ts +82 -0
  27. package/build/internal/src/middleware/network.d.ts +2 -2
  28. package/build/internal/src/middleware/nudge.d.ts +104 -24
  29. package/build/internal/src/middleware/organization.d.ts +161 -16
  30. package/build/internal/src/middleware/organizationSettings.d.ts +100 -8
  31. package/build/internal/src/middleware/recommendationSet.d.ts +36 -9
  32. package/build/internal/src/middleware/theme.d.ts +74 -0
  33. package/build/internal/src/middleware/types.d.ts +10 -2
  34. package/build/internal/src/middleware/workflow.d.ts +16 -0
  35. package/build/internal/src/util/sentry.d.ts +2 -2
  36. package/package.json +4 -2
  37. package/src/index.ts +2 -2
  38. package/src/init.ts +5 -1
  39. package/src/snippet.ts +2 -10
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "commandbar",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
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",
7
7
  "sideEffects": false,
8
8
  "scripts": {
9
9
  "clean": "rimraf build",
10
- "build": "NODE_ENV=production webpack build && tsc",
10
+ "build": "NODE_ENV=production webpack build && tsc && tsc-alias",
11
11
  "minify-snippet": "tsx scripts/minify-snippet.ts",
12
12
  "prepublishOnly": "yarn run clean && yarn run build",
13
13
  "test": "jest --runInBand",
@@ -26,6 +26,8 @@
26
26
  "@types/jest": "^29.5.3",
27
27
  "jest": "^29.7.0",
28
28
  "rimraf": "3.0.2",
29
+ "tsc-alias": "^1.8.8",
30
+ "tsconfig-paths-webpack-plugin": "^4.1.0",
29
31
  "tsx": "^4.9.3",
30
32
  "typescript": "5.1.5",
31
33
  "webpack": "^5.74.0"
package/src/index.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import Launcher, { getControlKey } from 'commandbar-launcher';
2
- import type { CommandBarClientSDK } from '@commandbar/internal/src/client/CommandBarClientSDK';
2
+ import type { CommandBarClientSDK } from '@commandbar/internal/client/CommandBarClientSDK';
3
3
 
4
4
  export { default as init } from './init';
5
- export { initProxySDK as initProxy } from '@commandbar/internal/src/client/proxy';
5
+ export { initProxySDK as initProxy } from '@commandbar/internal/client/proxy';
6
6
  export { CommandBarClientSDK };
7
7
  export { Launcher, getControlKey };
8
8
 
package/src/init.ts CHANGED
@@ -10,10 +10,14 @@ const getSrc = (org: string, opts: IInitOptions) => {
10
10
  const params = [];
11
11
 
12
12
  const lc = localStorage.getItem('commandbar.lc');
13
- if (lc && lc.includes('local')) {
13
+ if (lc && lc.includes('api=local')) {
14
14
  // for debugging purposes
15
15
  origin = 'http://localhost:8000';
16
16
  }
17
+ if (lc && lc.includes('api=preview_')) {
18
+ const branchIdentifier = /api=preview_([^;$]+)/.exec(lc)?.[1];
19
+ origin = `https://${branchIdentifier}.commandbar.xyz:8000`;
20
+ }
17
21
 
18
22
  let src = origin + '/latest/' + org;
19
23
 
package/src/snippet.ts CHANGED
@@ -2,11 +2,10 @@
2
2
  /* eslint-disable prefer-rest-params */
3
3
 
4
4
  /* eslint-disable @typescript-eslint/no-inferrable-types */
5
- let org = '<org_id>';
5
+ const org = '<org_id>';
6
6
  let api = 'https://api.commandbar.com';
7
7
  let cdn: string | undefined = undefined;
8
8
 
9
- const polyfills = ['Object.assign', 'Symbol', 'Symbol.for'].join('%2C');
10
9
  const w = window as unknown as Record<string, unknown>;
11
10
 
12
11
  function loadScript(src: string, async = false) {
@@ -90,11 +89,4 @@ function bootstrap() {
90
89
  loadScript(`${api}/latest/${org}?${params.join('&')}`, true);
91
90
  }
92
91
 
93
- if (typeof Object.assign === 'undefined' || typeof Symbol === 'undefined' || typeof Symbol.for === 'undefined') {
94
- w.__CommandBarBootstrap__ = bootstrap;
95
- loadScript(
96
- 'https://polyfill.io/v3/polyfill.min.js?version=3.101.0&callback=__CommandBarBootstrap__&features=' + polyfills,
97
- );
98
- } else {
99
- bootstrap();
100
- }
92
+ bootstrap();