commandbar 1.12.0 → 1.13.1

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 (44) hide show
  1. package/build/commandbar/src/shared/services/analytics/EventHandler.d.ts +2 -0
  2. package/build/commandbar-js/src/index.js +1 -1
  3. package/build/commandbar-js/src/init.d.ts +10 -1
  4. package/build/commandbar-js/src/snippet.d.ts +0 -1
  5. package/build/internal/src/client/CommandBarClientSDK.d.ts +5 -0
  6. package/build/internal/src/client/CommandBarProxySDK.d.ts +2 -3
  7. package/build/internal/src/client/SDKConfig.d.ts +1 -0
  8. package/build/internal/src/client/symbols.d.ts +2 -0
  9. package/build/internal/src/middleware/CommandFromClientV.d.ts +7 -0
  10. package/build/internal/src/middleware/OrganizationV.d.ts +104 -12
  11. package/build/internal/src/middleware/additionalResource.d.ts +208 -118
  12. package/build/internal/src/middleware/api.d.ts +7 -7
  13. package/build/internal/src/middleware/chat.d.ts +23641 -12011
  14. package/build/internal/src/middleware/checklist.d.ts +221 -121
  15. package/build/internal/src/middleware/command.d.ts +2611 -2021
  16. package/build/internal/src/middleware/endUser.d.ts +0 -32
  17. package/build/internal/src/middleware/experienceTemplate.d.ts +407 -223
  18. package/build/internal/src/middleware/experiencesSearch.d.ts +818 -657
  19. package/build/internal/src/middleware/flags.d.ts +9 -8
  20. package/build/internal/src/middleware/helpDocsSearch.d.ts +586 -471
  21. package/build/internal/src/middleware/helpers/actions.d.ts +83 -30
  22. package/build/internal/src/middleware/helpers/commandTemplate.d.ts +32 -6
  23. package/build/internal/src/middleware/helpers/rules.d.ts +19 -4
  24. package/build/internal/src/middleware/keyword.d.ts +82 -0
  25. package/build/internal/src/middleware/network.d.ts +2 -2
  26. package/build/internal/src/middleware/nudge.d.ts +520 -247
  27. package/build/internal/src/middleware/organization.d.ts +886 -607
  28. package/build/internal/src/middleware/organizationSettings.d.ts +282 -114
  29. package/build/internal/src/middleware/profile.d.ts +1 -1
  30. package/build/internal/src/middleware/recommendationSet.d.ts +208 -118
  31. package/build/internal/src/middleware/theme.d.ts +7 -0
  32. package/build/internal/src/middleware/types.d.ts +21 -20
  33. package/package.json +1 -1
  34. package/src/init.ts +13 -2
  35. package/src/snippet.ts +1 -14
  36. package/build/commandbar/src/shared/services/analytics/event-queue.d.ts +0 -13
  37. package/build/commandbar/src/shared/services/analytics/v2/client.d.ts +0 -54
  38. package/build/commandbar/src/shared/services/analytics/v2/helpers.d.ts +0 -6
  39. package/build/commandbar/src/shared/services/analytics/v2/schema.d.ts +0 -152
  40. package/build/commandbar/src/shared/services/analytics/v2/types.d.ts +0 -4
  41. package/build/internal/src/client/CommandBarSDK.d.ts +0 -99
  42. package/build/internal/src/client/globals.d.ts +0 -27
  43. package/build/internal/src/util/dispatchCustomEvent.d.ts +0 -14
  44. package/build/internal/src/util/sentry.d.ts +0 -23
@@ -1,11 +1,10 @@
1
- /*******************************************************************************/
2
1
  import * as t from 'io-ts';
3
2
  import { BatchEditorCommandResponseV, BatchOperationV, CommandV, EditorCommandV, EditorCommandLiteV, CommandLiteV, ContentTypeV } from './command';
4
3
  import { ArgumentMapV, ArgumentTypeV, ConditionV, ConditionOperatorV, StepArgumentTypeV, ContextArgumentV, SetArgumentV, DynamicArgumentV } from './helpers/argument';
5
4
  import { GenericBatchRequest } from './generics';
6
5
  import { OptionGroupRenderAsV } from './helpers/optionGroup';
7
6
  import { TemplateV, TemplateOptionsV, RequestTemplateV, VideoTemplateV } from './helpers/commandTemplate';
8
- import { ActionV, CommandActionV, LabeledActionV, OpenChatActionV, NudgeActionV, QuestlistActionV, RequestV, OpenChatActionTypeV, CommandActionMetaTypeV } from './helpers/actions';
7
+ import { ActionV, CommandActionV, LabeledActionV, OpenChatActionV, NudgeActionV, QuestlistActionV, RequestV, OpenChatActionTypeV, CommandActionMetaTypeV, ChatHandoffActionV, ChatHandoffActionTypeV } from './helpers/actions';
9
8
  import { CommandCategoryV } from './commandCategory';
10
9
  import { OrganizationStatusV, KeyEventV, RecordSettingsByContextKeyV, InternalSettingsV, OrganizationV } from './organization';
11
10
  import { OrganizationSettingsV } from './organizationSettings';
@@ -31,7 +30,7 @@ import { AudienceV } from './helpers/audience';
31
30
  import { AdditionalResourceV } from './additionalResource';
32
31
  import { RecommendationSetV } from './recommendationSet';
33
32
  import { BillingProfileV, UsageV } from './billing';
34
- import { UserMessageV, AIMessageV, AIMessageExtraV, MessageV, AIAnswerPayloadV, AIAnswerV, ContinuationsPayloadV, ContinuationV, CreateAnswerFeedbackPayloadV, QuestionSuggestionsPayloadV, QuestionSuggestionsV, ExperienceV, CreateChatPayloadV, ChatV, CopilotSettingsPreviewV, HandoffPayloadV, ExternalChatPayloadV, ExternalChatHistoryV } from './chat';
33
+ import { UserMessageV, AIMessageV, AIMessageExtraV, MessageV, AIAnswerPayloadV, AIAnswerV, ContinuationsPayloadV, ContinuationV, CreateAnswerFeedbackPayloadV, QuestionSuggestionsPayloadV, QuestionSuggestionsV, ExperienceV, CreateChatPayloadV, ChatV, CopilotSettingsPreviewV, HandoffPayloadV, ExternalChatPayloadV, ExternalChatHistoryV, ChatOwnershipV, UserAttachmentV, SourceDocV } from './chat';
35
34
  import { HelpDocHitV, SearchHelpDocsPayloadV, SearchHelpDocsResponseV } from './helpDocsSearch';
36
35
  import { ExperienceHitV, ExperienceTypeOptions, SearchExperiencesPayloadV, SearchExperiencesResponseV } from './experiencesSearch';
37
36
  import { HelpHubLauncherSettingsV, HelpHubSearchActionsV } from './helpHub';
@@ -42,23 +41,7 @@ import { ExperienceTemplateV } from './experienceTemplate';
42
41
  import { APIV } from './api';
43
42
  import { LocalizedMessagePatchV, LocalizedMessageV, LocalizedMessages } from './localizedMessage';
44
43
  import { WorkflowV } from './workflow';
45
- /*******************************************************************************/
46
- export type IInitOptions = {
47
- apiOrigin?: string;
48
- cdnOrigin?: string;
49
- debug?: boolean;
50
- environment?: string;
51
- version?: string;
52
- config?: any;
53
- nonce?: string;
54
- silentMode?: boolean;
55
- };
56
- /** Additional foobar init options */
57
- export declare const SUPPORTED_FOOBAR_INIT_DEPLOYMENT_OPTIONS: readonly ["dev", "labs", "prod"];
58
- export type IInitOptionsFoobar = IInitOptions & {
59
- deployment?: (typeof SUPPORTED_FOOBAR_INIT_DEPLOYMENT_OPTIONS)[number];
60
- disable_analytics?: boolean;
61
- };
44
+ import { KeywordV } from './keyword';
62
45
  /*******************************************************************************/
63
46
  export type IContextType = t.TypeOf<typeof ContextV> & unknown;
64
47
  export type IUserType = t.TypeOf<typeof UserV> & unknown;
@@ -132,6 +115,11 @@ export type INudgePinStepType = INudgeStepType & {
132
115
  type: 'pin';
133
116
  };
134
117
  };
118
+ export type INudgeCursorStepType = INudgePinStepType & {
119
+ form_factor: {
120
+ copilot_intro: true;
121
+ };
122
+ };
135
123
  export type INudgeAnchorableStepType = INudgeTooltipStepType | INudgePinStepType;
136
124
  export type INudgeStepContentBlockType = t.TypeOf<typeof NudgeContentBlockV> & unknown;
137
125
  export type INudgeStepContentMarkdownBlockType = t.TypeOf<typeof NudgeContentMarkdownBlockV> & unknown;
@@ -151,10 +139,13 @@ export type INudgeClientType = {
151
139
  passedConditionsInLastEvaluation: boolean;
152
140
  lastTriggeredTs?: number;
153
141
  };
142
+ export type IKeyword = t.TypeOf<typeof KeywordV> & unknown;
154
143
  export type IExperienceTemplate = t.TypeOf<typeof ExperienceTemplateV> & unknown;
155
144
  export type LabeledAction = t.TypeOf<typeof LabeledActionV> & unknown;
156
145
  export type OpenChatAction = t.TypeOf<typeof OpenChatActionV> & unknown;
157
146
  export type OpenChatActionType = t.TypeOf<typeof OpenChatActionTypeV> & unknown;
147
+ export type ChatHandoffAction = t.TypeOf<typeof ChatHandoffActionV> & unknown;
148
+ export type ChatHandoffActionType = t.TypeOf<typeof ChatHandoffActionTypeV> & unknown;
158
149
  export type QuestlistAction = t.TypeOf<typeof QuestlistActionV> & unknown;
159
150
  export type NudgeAction = t.TypeOf<typeof NudgeActionV> & unknown;
160
151
  export type CommandAction = t.TypeOf<typeof CommandActionV> & unknown;
@@ -176,11 +167,13 @@ export type NudgeInteractions = t.TypeOf<typeof NudgeInteractionsV> & unknown;
176
167
  export type IMessageType = t.TypeOf<typeof MessageV> & unknown;
177
168
  export type IUserMessageType = t.TypeOf<typeof UserMessageV> & unknown;
178
169
  export type IAIMessageType = t.TypeOf<typeof AIMessageV> & unknown;
170
+ export type IUserAttachmentType = t.TypeOf<typeof UserAttachmentV> & unknown;
179
171
  export type IAIMessageExtraType = t.TypeOf<typeof AIMessageExtraV> & unknown;
180
172
  export type IQuestionSuggestionsType = t.TypeOf<typeof QuestionSuggestionsV> & unknown;
181
173
  export type IQuestionSuggestionsPayloadType = t.TypeOf<typeof QuestionSuggestionsPayloadV> & unknown;
182
174
  export type ICreateChatPayloadType = t.TypeOf<typeof CreateChatPayloadV> & unknown;
183
175
  export type IContinuationType = t.TypeOf<typeof ContinuationV> & unknown;
176
+ export type ISourceDocType = t.TypeOf<typeof SourceDocV> & unknown;
184
177
  export type IExperienceType = t.TypeOf<typeof ExperienceV> & unknown;
185
178
  export type IContinuationsPayloadType = t.TypeOf<typeof ContinuationsPayloadV> & unknown;
186
179
  export type IAIAnswerType = t.TypeOf<typeof AIAnswerV> & unknown;
@@ -188,6 +181,7 @@ export type IAIAnswerPayloadType = t.TypeOf<typeof AIAnswerPayloadV> & unknown;
188
181
  export type IHandoffPayloadType = t.TypeOf<typeof HandoffPayloadV> & unknown;
189
182
  export type IExternalChatPayloadType = t.TypeOf<typeof ExternalChatPayloadV> & unknown;
190
183
  export type IExternalChatHistoryType = t.TypeOf<typeof ExternalChatHistoryV> & unknown;
184
+ export type IChatOwnershipType = t.TypeOf<typeof ChatOwnershipV> & unknown;
191
185
  export type ICreateAnswerFeedbackPayloadType = t.TypeOf<typeof CreateAnswerFeedbackPayloadV> & unknown;
192
186
  export type ISearchHelpDocsPayloadType = t.TypeOf<typeof SearchHelpDocsPayloadV> & unknown;
193
187
  export type ISearchHelpDocsResponseType = t.TypeOf<typeof SearchHelpDocsResponseV> & unknown;
@@ -264,6 +258,7 @@ export type IConfigEndpointResponse = {
264
258
  };
265
259
  localized_messages: LocalizedMessages;
266
260
  themes?: IThemeType[];
261
+ keywords: IKeyword[];
267
262
  };
268
263
  export type IConfigType = {
269
264
  commands: ICommandType[];
@@ -282,6 +277,7 @@ export type IConfigType = {
282
277
  flags: Flags;
283
278
  localized_messages: LocalizedMessages;
284
279
  themes: IThemeType[];
280
+ keywords: IKeyword[];
285
281
  };
286
282
  export type { IRecordSettings } from './IRecordSettings';
287
283
  export type IRecordSettingsByContextKey = t.TypeOf<typeof RecordSettingsByContextKeyV> & unknown;
@@ -292,3 +288,8 @@ export declare const isResource: (option: any) => option is IResourceType;
292
288
  export declare const isContextArgument: (argument: IArgumentType) => argument is IContextArgumentType;
293
289
  export declare const isTimeArgument: (argument: IArgumentType) => argument is IDynamicArgumentType;
294
290
  export declare const isSurveyBlock: (block: INudgeStepContentBlockType) => block is INudgeStepSurveyBlockType;
291
+ export type WidgetTableauSelection = {
292
+ type: 'all' | 'nudge' | 'checklist' | 'spotlight' | 'helphub' | 'copilot';
293
+ id: string | number;
294
+ nudgeStepIndex?: number;
295
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commandbar",
3
- "version": "1.12.0",
3
+ "version": "1.13.1",
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
@@ -3,14 +3,13 @@ import 'es6-object-assign/auto';
3
3
  import 'es6-symbol/implement';
4
4
  import { getProxySDK } from '../../internal/src/client/proxy';
5
5
  import { _configuration } from '../../internal/src/client/symbols';
6
- import { IInitOptions } from '../../internal/src/middleware/types';
7
6
 
8
7
  const getSrc = (org: string, opts: IInitOptions) => {
9
8
  let origin = opts.apiOrigin || 'https://api.commandbar.com';
10
9
  const params = [];
11
10
 
12
11
  const lc = localStorage.getItem('commandbar.lc');
13
- if (lc && lc.includes('api=local')) {
12
+ if (lc && lc.includes('local')) {
14
13
  // for debugging purposes
15
14
  origin = 'http://localhost:8000';
16
15
  }
@@ -60,6 +59,18 @@ const loadLatest = (org: string, opts: IInitOptions) => {
60
59
  document.head.appendChild(el);
61
60
  };
62
61
 
62
+ export type IInitOptions = {
63
+ apiOrigin?: string;
64
+ cdnOrigin?: string;
65
+
66
+ debug?: boolean;
67
+ environment?: string;
68
+ version?: string;
69
+ config?: any;
70
+ nonce?: string;
71
+ silentMode?: boolean;
72
+ };
73
+
63
74
  const DEFAULT_OPTS = {
64
75
  debug: false,
65
76
  silentMode: false,
package/src/snippet.ts CHANGED
@@ -6,7 +6,6 @@ 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) {
@@ -38,11 +37,6 @@ function bootstrap() {
38
37
  api = 'http://localhost:8000';
39
38
  cdn = undefined;
40
39
  }
41
- if (lc && lc.includes('api=preview_')) {
42
- const branchIdentifier = /api=preview_([^;$]+)/.exec(lc)?.[1];
43
- api = `https://${branchIdentifier}.commandbar.xyz:8000`;
44
- cdn = undefined;
45
- }
46
40
 
47
41
  const proxy = Object.assign(
48
42
  {
@@ -95,11 +89,4 @@ function bootstrap() {
95
89
  loadScript(`${api}/latest/${org}?${params.join('&')}`, true);
96
90
  }
97
91
 
98
- if (typeof Object.assign === 'undefined' || typeof Symbol === 'undefined' || typeof Symbol.for === 'undefined') {
99
- w.__CommandBarBootstrap__ = bootstrap;
100
- loadScript(
101
- 'https://polyfill.io/v3/polyfill.min.js?version=3.101.0&callback=__CommandBarBootstrap__&features=' + polyfills,
102
- );
103
- } else {
104
- bootstrap();
105
- }
92
+ bootstrap();
@@ -1,13 +0,0 @@
1
- type FlushOptions = {
2
- useSendBeacon?: boolean;
3
- };
4
- export declare class EventQueue<E> {
5
- _queue: E[];
6
- maxQueueSize: number;
7
- handleEvents: (events: E[], options: FlushOptions) => void;
8
- constructor(handleEvents: (events: E[], options: FlushOptions) => void, maxQueueSize?: number);
9
- enqueue(event: E, forceFlush?: boolean): void;
10
- flush(options?: FlushOptions): void;
11
- destroy(): void;
12
- }
13
- export {};
@@ -1,54 +0,0 @@
1
- import { CBEvent, CBEventName, CBRawEvent } from './types';
2
- import { CBEventProperties } from './schema';
3
- import { IDecideResponseType } from '../../../../../../internal/src/middleware/types';
4
- export declare class AnalyticsV2 {
5
- hasBooted: boolean;
6
- private enabled;
7
- private eventQueue;
8
- private decide;
9
- private applyEnrichments;
10
- private applyScrubbers;
11
- constructor(applyEnrichments?: (event: CBRawEvent & Partial<CBEvent>, meta: {
12
- decide: {
13
- user_property_targeting: boolean | null | undefined;
14
- nudges: {
15
- [x: string]: boolean | {
16
- [x: string]: any;
17
- } | null | undefined;
18
- [x: number]: boolean | {
19
- [x: string]: any;
20
- } | null | undefined;
21
- } | null | undefined;
22
- checklists: {
23
- [x: string]: boolean | {
24
- [x: string]: any;
25
- } | null | undefined;
26
- [x: number]: boolean | {
27
- [x: string]: any;
28
- } | null | undefined;
29
- } | null | undefined;
30
- recommendation_sets: {
31
- [x: string]: boolean | {
32
- [x: string]: any;
33
- } | null | undefined;
34
- [x: number]: boolean | {
35
- [x: string]: any;
36
- } | null | undefined;
37
- } | null | undefined;
38
- commands: {
39
- [x: string]: boolean | {
40
- [x: string]: any;
41
- } | null | undefined;
42
- [x: number]: boolean | {
43
- [x: string]: any;
44
- } | null | undefined;
45
- } | null | undefined;
46
- } | null | undefined;
47
- }) => CBEvent, applyScrubbers?: (event: CBEvent) => CBEvent);
48
- flushServerQueue(useSendBeacon?: boolean): void;
49
- track(name: CBEventName, properties?: CBEventProperties, additionalProperties?: Partial<Omit<CBEvent, 'name' | 'properties'>>, forceFlush?: boolean): void;
50
- identifyAsAdmin(): void;
51
- setBootStatus(hasBooted: boolean): void;
52
- setDecide(decide: IDecideResponseType | null | undefined): void;
53
- enable(): void;
54
- }
@@ -1,6 +0,0 @@
1
- export declare const shouldReportToServer: () => boolean;
2
- export declare const isSilentMode: () => boolean;
3
- export type ScrubberType = (typeof allowedCategories)[number];
4
- declare const allowedCategories: readonly ["commands", "help_hub_search", "user_inputs_and_deadends", "records", "urls"];
5
- export declare const getEventAttributeBlockList: () => (typeof allowedCategories)[number][];
6
- export {};
@@ -1,152 +0,0 @@
1
- /**
2
- * This file was automatically generated by json-schema-to-typescript.
3
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
- * and run json-schema-to-typescript to regenerate this file.
5
- */
6
- export interface CBClientEvent {
7
- /**
8
- * The version of the schema used.
9
- */
10
- version: 1 | 2;
11
- name: "cb:identify" | "cb:decide" | "cb:pageview" | "cb:click" | "cb:input" | "cb:nudge_viewed" | "cb:nudge_dismissed" | "cb:nudge_snoozed" | "cb:nudge_cta_clicked" | "cb:nudge_survey_submitted" | "cb:nudge_checklist_item_skipped" | "cb:nudge_checklist_item_completed" | "cb:nudge_checklist_completed" | "cb:assistance_modal_opened" | "cb:assistance_modal_closed" | "cb:copilot_viewed" | "cb:copilot_chat_started" | "cb:copilot_chat_restarted" | "cb:copilot_chat_message_sent" | "cb:copilot_chat_message_feedback" | "cb:copilot_follow_up_clicked" | "cb:copilot_source_clicked" | "cb:copilot_link_clicked" | "cb:copilot_experience_clicked" | "cb:helphub_viewed" | "cb:helphub_search_input" | "cb:helphub_search_executed" | "cb:helphub_search_result_clicked" | "cb:helphub_suggested_query_clicked" | "cb:helphub_doc_link_copied" | "cb:helphub_additional_resource_clicked" | "cb:helphub_recommendation_clicked" | "cb:spotlight_opened" | "cb:spotlight_closed" | "cb:spotlight_search_input" | "cb:spotlight_search_executed" | "cb:spotlight_search_result_clicked" | "cb:action_executed" | "cb:content_viewed" | "cb:content_closed" | "cb:content_link_clicked" | "cb:content_scrolled" | "cb:content_play_clicked" | "cb:content_pause_clicked";
12
- /**
13
- * Whether the user is an admin of the related organization.
14
- */
15
- is_admin: boolean;
16
- /**
17
- * Whether the event was fired while in simulate mode.
18
- */
19
- is_simulated: boolean;
20
- /**
21
- * Object containing key-value pairs of user properties.
22
- */
23
- end_user_properties: {
24
- [k: string]: unknown;
25
- };
26
- /**
27
- * Object containing the response from /decide/.
28
- */
29
- decide?: {
30
- [k: string]: unknown;
31
- };
32
- /**
33
- * The unique identifier for the organization.
34
- */
35
- organization_key: string;
36
- /**
37
- * The unique identifier for the user generating the event.
38
- */
39
- distinct_id: string;
40
- /**
41
- * The unique identifier for the anonymous user generating the event.
42
- */
43
- anon_distinct_id: string | null;
44
- /**
45
- * The timestamp when the event occurred, including timezone information. Must be in ISO 8601 format.
46
- */
47
- timestamp: string;
48
- /**
49
- * The timestamp when the event was sent to the server.
50
- */
51
- sent_at: string;
52
- /**
53
- * Object containing key-value pairs, where keys are package names and values are their respective version strings.
54
- */
55
- client_version?: {
56
- [k: string]: string;
57
- };
58
- /**
59
- * A special code used during the launch process.
60
- */
61
- launch_code?: string;
62
- /**
63
- * Detailed information about the current web page.
64
- */
65
- page: {
66
- /**
67
- * The domain of the current URL.
68
- */
69
- domain: string;
70
- /**
71
- * The hash segment of the current URL, typically following a '#'.
72
- */
73
- hash: string;
74
- /**
75
- * The path of the current URL, typically following the domain and a '/'.
76
- */
77
- path: string;
78
- /**
79
- * The query string of the current URL, typically following a '?'.
80
- */
81
- query: string;
82
- /**
83
- * The title of the current web page.
84
- */
85
- title: string;
86
- };
87
- user_agent?: string | null;
88
- /**
89
- * List of scrubbers used to scrub the event.
90
- */
91
- scrubbers: string[];
92
- source?: CBEventSource;
93
- properties: CBEventProperties;
94
- /**
95
- * Serialized state of the current nudge or null if not applicable.
96
- */
97
- nudge?: {
98
- [k: string]: unknown;
99
- };
100
- /**
101
- * Serialized state of Copilot or null if not applicable.
102
- */
103
- copilot?: {
104
- [k: string]: unknown;
105
- };
106
- /**
107
- * Serialized state of HelpHub or null if not applicable.
108
- */
109
- helphub?: {
110
- [k: string]: unknown;
111
- };
112
- /**
113
- * Serialized state of Spotlight or null if not applicable.
114
- */
115
- spotlight?: {
116
- [k: string]: unknown;
117
- };
118
- /**
119
- * Serialized state of the current action or null if not applicable.
120
- */
121
- action?: {
122
- [k: string]: unknown;
123
- };
124
- /**
125
- * Serialized state of the current content or null if not applicable.
126
- */
127
- content?: {
128
- [k: string]: unknown;
129
- };
130
- }
131
- /**
132
- * Information about the source of the event.
133
- */
134
- export interface CBEventSource {
135
- /**
136
- * The type of the source.
137
- */
138
- type: string;
139
- /**
140
- * The unique identifier of the source.
141
- */
142
- id?: string;
143
- /**
144
- * Additional properties.
145
- */
146
- properties?: {
147
- [k: string]: unknown;
148
- };
149
- }
150
- export interface CBEventProperties {
151
- [k: string]: unknown;
152
- }
@@ -1,4 +0,0 @@
1
- import type { CBClientEvent } from './schema';
2
- export type CBRawEvent = Pick<CBClientEvent, 'name' | 'properties'>;
3
- export type CBEvent = Omit<CBClientEvent, 'sent_at'>;
4
- export type CBEventName = CBClientEvent['name'];
@@ -1,99 +0,0 @@
1
- import { TUpdateEditorRouteDetails } from '../util/dispatchCustomEvent';
2
- import { CommandBarClientSDK, InstanceAttributes, MetaAttributes, Metadata, ProductConfig, ProductDebugOptions } from './CommandBarClientSDK';
3
- import type { Hub } from '@sentry/browser';
4
- import { _analytics, _configuration, _configure, _configUser, _dispose, _disposed, _eventSubscriptions, _userProperties, _isProxy, _loadEditor, _perf, _programmaticTheme, _reload, _reloadCommands, _reloadOrganization, _reloadPlaceholders, _reloadNudges, _reloadHelpHub, _startNudgeDebug, _showNudgeStepMock, _closeNudgeMocks, _stopChecklistPreview, _stopNudgeDebug, _reloadChecklists, _report, _search, _sentry, _setDashboard, _setPreviewMode, _setTestMode, _showGuide, _showMessage, _user, _instanceAttributes, _setEditorVisible, _shareConfig, _shareContextSettings, _shareProgrammaticCommands, _metaAttributes, _previewChecklist, _shareEditorRouteWithBar, _fingerprint, _updateEditorRoute, _startDebug, _stopDebug, _previewRecommendationSet, _previewCopilotSettings, _stopRecommendationSetPreview, _getDebugSnapshot, _updateEditorPreviewDevice, _getEditorPreviewDevice, _shareTrackedEvents, _setThemeV2, _showWidgetTableau, _setActiveChat, _getActiveChat } from './symbols';
5
- import { SDKConfig } from './SDKConfig';
6
- import { IChecklist, ICommandType, IConfigType, ICopilotSettingsPreviewType, INudgeType, IRecommendationSet, IRecordSettingsByContextKey, IThemeV2Type } from '../middleware/types';
7
- import { DeviceType } from '../util/operatingSystem';
8
- import type { EVENT_NAME } from '../../../commandbar/src/shared/services/analytics/types';
9
- import type { EventSubscriber } from '../../../commandbar/src/shared/services/analytics/EventHandler';
10
- import type { AnalyticsV2 } from '../../../commandbar/src/shared/services/analytics/v2/client';
11
- export type { SDKConfig } from './SDKConfig';
12
- export declare const _reloadTargets: string[];
13
- export interface CommandBarInternalSDK {
14
- [_instanceAttributes]: InstanceAttributes;
15
- [_metaAttributes]: MetaAttributes;
16
- [_perf]: boolean;
17
- [_programmaticTheme]: string | undefined;
18
- [_sentry]: Hub | undefined;
19
- [_search]: string;
20
- [_user]: string | null | undefined;
21
- [_fingerprint]: string | undefined;
22
- [_userProperties]: Metadata | undefined;
23
- [_analytics]: AnalyticsV2;
24
- [_eventSubscriptions]: Map<symbol, EventSubscriber> | undefined;
25
- /** @deprecated */
26
- readonly [_configure]: (uuid: string) => void;
27
- readonly [_configuration]: SDKConfig;
28
- readonly [_configUser]: () => Promise<void>;
29
- readonly [_dispose]: () => void;
30
- readonly [_disposed]: false;
31
- readonly [_isProxy]: false;
32
- readonly [_loadEditor]: () => void;
33
- readonly [_shareEditorRouteWithBar]: (path: string) => void;
34
- readonly [_updateEditorPreviewDevice]: (device: DeviceType) => void;
35
- readonly [_getEditorPreviewDevice]: () => DeviceType;
36
- readonly [_reload]: (reloadTargets: (typeof _reloadTargets)[number][]) => void;
37
- readonly [_reloadCommands]: (preLoadedConfig?: IConfigType) => void;
38
- readonly [_reloadOrganization]: (preLoadedConfig?: IConfigType) => void;
39
- readonly [_reloadPlaceholders]: (preLoadedConfig?: IConfigType) => void;
40
- readonly [_reloadNudges]: (preLoadedConfig?: IConfigType) => void;
41
- readonly [_reloadHelpHub]: (preLoadedConfig?: IConfigType) => void;
42
- readonly [_previewRecommendationSet]: (data: {
43
- recommendationSet?: IRecommendationSet;
44
- }) => void;
45
- readonly [_previewCopilotSettings]: (data: {
46
- settings: ICopilotSettingsPreviewType;
47
- }) => void;
48
- readonly [_stopRecommendationSetPreview]: () => void;
49
- readonly [_startNudgeDebug]: (data: {
50
- nudge: INudgeType;
51
- }) => void;
52
- readonly [_showNudgeStepMock]: (data: {
53
- nudge: INudgeType;
54
- stepIndex: number;
55
- forceOpen?: boolean;
56
- }) => void;
57
- readonly [_closeNudgeMocks]: () => void;
58
- readonly [_stopChecklistPreview]: () => void;
59
- readonly [_stopNudgeDebug]: (data: {
60
- index?: number;
61
- }) => void;
62
- readonly [_previewChecklist]: (data: {
63
- checklist: IChecklist;
64
- clearData?: boolean;
65
- }) => void;
66
- readonly [_reloadChecklists]: () => void;
67
- readonly [_setThemeV2]: (themeV2: IThemeV2Type, mode: 'light_mode' | 'dark_mode') => void;
68
- readonly [_showWidgetTableau]: (show: boolean) => void;
69
- readonly [_setActiveChat]: (chatId: string | null) => void;
70
- readonly [_getActiveChat]: () => string | null;
71
- /** @deprecated */
72
- readonly [_report]: (event: EVENT_NAME, data?: Metadata) => void;
73
- /** @deprecated */
74
- readonly [_setDashboard]: (element: HTMLElement) => void;
75
- readonly [_setPreviewMode]: (on: boolean) => void;
76
- readonly [_setTestMode]: (on: boolean) => void;
77
- readonly [_setEditorVisible]: (visible: boolean) => void;
78
- readonly [_shareContextSettings]: () => {
79
- local: IRecordSettingsByContextKey;
80
- server: IRecordSettingsByContextKey;
81
- };
82
- readonly [_shareConfig]: () => any;
83
- readonly [_shareProgrammaticCommands]: () => ICommandType[];
84
- readonly [_shareTrackedEvents]: () => {
85
- trackedEvents: string[];
86
- };
87
- readonly [_startDebug]: (data: ProductDebugOptions) => void;
88
- readonly [_stopDebug]: (product?: ProductConfig[number]) => void;
89
- readonly [_getDebugSnapshot]: (data?: {
90
- nudgeId?: INudgeType['id'];
91
- stepIndex?: number;
92
- }) => void;
93
- readonly [_updateEditorRoute]: (data: TUpdateEditorRouteDetails) => void;
94
- /** @deprecated */
95
- readonly [_showGuide]: (eventName: string, preview?: boolean) => void;
96
- /** @deprecated */
97
- readonly [_showMessage]: (eventName: string, preview?: boolean) => void;
98
- }
99
- export type CommandBarSDK = CommandBarInternalSDK & CommandBarClientSDK;
@@ -1,27 +0,0 @@
1
- import { CommandBarClientSDK } from './CommandBarClientSDK';
2
- import { CommandBarSDK } from './CommandBarSDK';
3
- declare global {
4
- interface Navigator {
5
- brave?: {
6
- isBrave(): Promise<boolean>;
7
- };
8
- }
9
- interface Window {
10
- CommandBar: CommandBarClientSDK;
11
- _CommandBarTmpQueueProcessing: CommandBarSDK | undefined;
12
- Navigator: Navigator;
13
- _cbIsWebView?: boolean;
14
- }
15
- }
16
- export { initProxySDK, getProxySDK } from './proxy';
17
- /**
18
- * Returns the CommandBar global SDK.
19
- * The SDK object might be a proxy instead if `initSDK` has not yet been called.
20
- */
21
- export declare function getSDK(): CommandBarSDK;
22
- /**
23
- * Returns the CommandBar global, coerced to match the client interface.
24
- * The SDK object might be a proxy instead if `initSDK` has not yet been called.
25
- */
26
- export declare function getClientSDK(): CommandBarClientSDK;
27
- export declare const SDK_INTERNAL_PREFIX = "__commandbar_INTERNAL_";
@@ -1,14 +0,0 @@
1
- import type { INudgeType } from '../middleware/types';
2
- export type TUpdateEditorRouteDetails = {
3
- type: 'nudge';
4
- nudge: INudgeType;
5
- stepIndex: number;
6
- } | {
7
- type: 'checklist';
8
- checklistId: string | number;
9
- } | {
10
- type: 'route';
11
- route_replacement: string;
12
- action?: string;
13
- };
14
- export declare function dispatchCustomEvent<T>(eventType: string, detail: T, canBubble?: boolean, cancelable?: boolean): CustomEvent<T>;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { Hub } from '@sentry/core';
3
- export declare const SENTRY_COMMANDBAR_DSN = "https://ebf252b62885436e858a66d157aee9ea@o451734.ingest.sentry.io/5608348";
4
- export declare const sentryHubFactory: (dsn: string) => Hub | undefined;
5
- export declare const initSentryAndAddToSdk: () => void;
6
- export declare const getSentry: () => Hub | undefined;
7
- export declare const startSentryTransaction: (context: import("@sentry/types").TransactionContext, customSamplingContext?: import("@sentry/types").CustomSamplingContext | undefined) => import("@sentry/browser").Transaction | null | undefined;
8
- interface Props {
9
- children: React.ReactNode;
10
- }
11
- interface State {
12
- error: boolean;
13
- }
14
- export declare class SentryErrorBoundary extends React.Component<Props, State> {
15
- constructor(props: Props);
16
- captureRejection: (ev: PromiseRejectionEvent) => void;
17
- static getDerivedStateFromError(_error: Error): {
18
- error: boolean;
19
- };
20
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
21
- render(): React.ReactNode;
22
- }
23
- export {};