commandbar 1.9.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build/{internal/src/client → commandbar/src/shared/services/analytics}/EventHandler.d.ts +32 -10
- package/build/commandbar/src/shared/services/analytics/types.d.ts +77 -0
- package/build/commandbar-js/src/index.d.ts +2 -2
- package/build/commandbar-js/src/index.js +1 -1
- package/build/internal/src/client/AddContextOptions.d.ts +4 -0
- package/build/internal/src/client/CommandBarClientSDK.d.ts +46 -13
- package/build/internal/src/client/CommandBarSDK.d.ts +17 -10
- package/build/internal/src/client/SDKConfig.d.ts +3 -2
- package/build/internal/src/client/symbols.d.ts +5 -1
- package/build/internal/src/middleware/CommandFromClientV.d.ts +22 -10
- package/build/internal/src/middleware/IRecordSettings.d.ts +3 -0
- package/build/internal/src/middleware/OrganizationV.d.ts +200 -6
- package/build/internal/src/middleware/{ResourceSettingsV.d.ts → RecordSettingsV.d.ts} +2 -2
- package/build/internal/src/middleware/additionalResource.d.ts +96 -15
- package/build/internal/src/middleware/billing.d.ts +0 -2
- package/build/internal/src/middleware/chat.d.ts +2196 -176
- package/build/internal/src/middleware/checklist.d.ts +504 -63
- package/build/internal/src/middleware/command.d.ts +1809 -385
- package/build/internal/src/middleware/endUser.d.ts +33 -5
- package/build/internal/src/middleware/entityChanges.d.ts +17 -0
- package/build/internal/src/middleware/experienceTemplate.d.ts +59 -0
- package/build/internal/src/middleware/experiencesSearch.d.ts +3579 -0
- package/build/internal/src/middleware/flags.d.ts +20 -0
- package/build/internal/src/middleware/helpDocsIntegration.d.ts +9 -0
- package/build/internal/src/middleware/helpDocsSearch.d.ts +371 -35
- package/build/internal/src/middleware/helpers/actions.d.ts +66 -16
- package/build/internal/src/middleware/helpers/commandTemplate.d.ts +70 -8
- package/build/internal/src/middleware/helpers/copilotPersonality.d.ts +12 -0
- package/build/internal/src/middleware/helpers/goals.d.ts +4 -2
- package/build/internal/src/middleware/helpers/pushTrigger.d.ts +22 -0
- package/build/internal/src/middleware/helpers/rules.d.ts +45 -36
- package/build/internal/src/middleware/network.d.ts +15 -0
- package/build/internal/src/middleware/nudge.d.ts +1103 -124
- package/build/internal/src/middleware/organization.d.ts +1288 -61
- package/build/internal/src/middleware/organizationSettings.d.ts +320 -12
- package/build/internal/src/middleware/profile.d.ts +2 -0
- package/build/internal/src/middleware/recommendationSet.d.ts +96 -15
- package/build/internal/src/middleware/releases.d.ts +1 -1
- package/build/internal/src/middleware/theme.d.ts +431 -0
- package/build/internal/src/middleware/types.d.ts +52 -15
- package/build/internal/src/middleware/user.d.ts +1 -0
- package/build/internal/src/util/dispatchCustomEvent.d.ts +3 -3
- package/build/internal/src/util/operatingSystem.d.ts +2 -4
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/init.ts +12 -6
- package/src/snippet.ts +2 -2
- package/build/internal/src/client/AnalyticsEventTypes.d.ts +0 -1
- package/build/internal/src/middleware/IResourceSettings.d.ts +0 -3
- package/build/internal/src/middleware/dashboardFlags.d.ts +0 -9
package/src/index.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import Launcher, { getControlKey } from 'commandbar-launcher';
|
2
|
-
import { CommandBarClientSDK } from '
|
2
|
+
import type { CommandBarClientSDK } from '@commandbar/internal/src/client/CommandBarClientSDK';
|
3
3
|
|
4
4
|
export { default as init } from './init';
|
5
|
-
export { initProxySDK as initProxy } from '
|
5
|
+
export { initProxySDK as initProxy } from '@commandbar/internal/src/client/proxy';
|
6
6
|
export { snippet } from './snippet';
|
7
7
|
export { CommandBarClientSDK };
|
8
8
|
export { Launcher, getControlKey };
|
package/src/init.ts
CHANGED
@@ -5,7 +5,7 @@ import { getProxySDK } from '../../internal/src/client/proxy';
|
|
5
5
|
import { _configuration } from '../../internal/src/client/symbols';
|
6
6
|
import { IInitOptions } from '../../internal/src/middleware/types';
|
7
7
|
|
8
|
-
const getSrc = (org: string) => {
|
8
|
+
const getSrc = (org: string, nonce?: string) => {
|
9
9
|
let origin = 'https://api.commandbar.com';
|
10
10
|
const params = [];
|
11
11
|
|
@@ -21,6 +21,10 @@ const getSrc = (org: string) => {
|
|
21
21
|
params.push('lc=' + lc);
|
22
22
|
}
|
23
23
|
|
24
|
+
if (nonce) {
|
25
|
+
params.push('nonce=' + nonce);
|
26
|
+
}
|
27
|
+
|
24
28
|
const version = 2;
|
25
29
|
params.push('version=' + version);
|
26
30
|
|
@@ -28,14 +32,14 @@ const getSrc = (org: string) => {
|
|
28
32
|
return src;
|
29
33
|
};
|
30
34
|
|
31
|
-
const loadLatest = (org: string) => {
|
35
|
+
const loadLatest = (org: string, nonce?: string) => {
|
32
36
|
if (document.readyState !== 'complete') {
|
33
37
|
// NOTE: `once` is not supported by IE11 and this will cause a (minor!) memory leak.
|
34
|
-
window.addEventListener('load', loadLatest.bind(null, org), { capture: false, once: true });
|
38
|
+
window.addEventListener('load', loadLatest.bind(null, org, nonce), { capture: false, once: true });
|
35
39
|
return;
|
36
40
|
}
|
37
41
|
|
38
|
-
const src = getSrc(org);
|
42
|
+
const src = getSrc(org, nonce);
|
39
43
|
|
40
44
|
const el = document.createElement('script');
|
41
45
|
el.type = 'text/javascript';
|
@@ -75,9 +79,11 @@ const init = (org: string, opts: IInitOptions = DEFAULT_OPTS) => {
|
|
75
79
|
uuid: org,
|
76
80
|
environment: opts.environment,
|
77
81
|
version: opts.version,
|
78
|
-
config: opts.config,
|
82
|
+
config: opts.config, // TODO: We should update this type to correctly reflect the structure of the response from /config/ https://cmd-k.slack.com/archives/C0315KNU7FY/p1711558822136239?thread_ts=1711554558.063509&cid=C0315KNU7FY
|
83
|
+
nonce: opts.nonce,
|
79
84
|
};
|
80
|
-
|
85
|
+
|
86
|
+
loadLatest(org, opts.nonce);
|
81
87
|
};
|
82
88
|
|
83
89
|
export default init;
|
package/src/snippet.ts
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
/* eslint-disable no-template-curly-in-string */
|
2
2
|
/* eslint-disable prefer-rest-params */
|
3
3
|
|
4
|
-
import { _eventSubscriptions } from '../../internal/src/client/symbols';
|
5
|
-
|
6
4
|
/* eslint-disable @typescript-eslint/no-inferrable-types */
|
7
5
|
export const snippet = (org: string) => {
|
8
6
|
const polyfills = ['Object.assign', 'Symbol', 'Symbol.for'].join('%2C');
|
@@ -29,6 +27,8 @@ export const snippet = (org: string) => {
|
|
29
27
|
const _isProxy = Symbol.for('CommandBar::isProxy');
|
30
28
|
const _queue = Symbol.for('CommandBar::queue');
|
31
29
|
const _unwrap = Symbol.for('CommandBar::unwrap');
|
30
|
+
const _eventSubscriptions = Symbol.for('CommandBar::eventSubscriptions');
|
31
|
+
|
32
32
|
const params = [];
|
33
33
|
const lc = localStorage.getItem('commandbar.lc');
|
34
34
|
const origin = lc && lc.includes('local') ? 'http://localhost:8000' : 'https://api.commandbar.com';
|
@@ -1 +0,0 @@
|
|
1
|
-
export 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' | 'Sentry-Event' | 'User changed shortcut' | 'Preview shown' | 'Next step selected' | 'Preview link opened' | 'Preview engagement' | 'Nudge shown' | 'Nudge clicked' | 'Nudge completed' | 'Nudge dismissed' | 'Nudge snoozed' | 'Questlist shown' | 'Questlist engagement' | 'Questlist item engagement' | 'HelpHub opened' | 'HelpHub closed' | 'HelpHub unminimized' | 'HelpHub minimized' | 'HelpHub doc opened' | 'HelpHub doc closed' | 'HelpHub doc engagement' | 'HelpHub engagement' | 'No chat response';
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import * as t from 'io-ts';
|
2
|
-
export declare const DashboardFlagsV: t.TypeC<{
|
3
|
-
show_onboarding: t.BooleanC;
|
4
|
-
show_appsumo_onboarding: t.BooleanC;
|
5
|
-
}>;
|
6
|
-
export declare const DashboardFlagsPartialV: t.PartialC<{
|
7
|
-
show_onboarding: t.BooleanC;
|
8
|
-
show_appsumo_onboarding: t.BooleanC;
|
9
|
-
}>;
|