commandbar 1.6.12 → 1.6.13

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.
@@ -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. */
@@ -163,6 +163,13 @@ export declare type CommandBarClientSDK = Readonly<{
163
163
  * @see [RecordOptions](#RecordOptions).
164
164
  */
165
165
  addRecords(key: string, initial: DataRow[] | RecordsOrArgumentListLoader, options?: RecordOptions): void;
166
+ /**
167
+ * Adds a search endpoint to CommandBar that returns results for multiple record types.
168
+ *
169
+ * @param onInputChange search endpoint to call for the specified record keys
170
+ * @param keys Record keys that this search endppoint covers
171
+ */
172
+ addMultiSearch(onInputChange: (input: string) => Promise<any>, keys: string[]): void;
166
173
  /**
167
174
  * 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).
168
175
  *
@@ -264,7 +271,7 @@ export declare type CommandBarClientSDK = Readonly<{
264
271
  * @param slug Component slug
265
272
  * @param getHTML Function that returns an html string to be rendered as the component
266
273
  */
267
- setCustomComponent(slug: 'header' | 'input' | 'sidepanel' | 'footer' | 'navPaneHeader' | 'navPaneFooter', getHTML: (step?: 'base' | 'multiselect' | 'longtextinput' | 'textinput' | 'select') => string): void;
274
+ setCustomComponent(slug: 'header' | 'input' | 'sidepanel' | 'footer' | 'navPaneHeader' | 'navPaneFooter', getHTML: (step?: 'base' | 'multiselect' | 'longtextinput' | 'textinput' | 'select' | 'dashboard') => string): void;
268
275
  /**
269
276
  * Similar to `addContext`, but also removes any keys that are omitted from the supplied `ctx` from context. It may be
270
277
  * helpful to use this to make large context changes, such as when a user logs out.
@@ -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' | 'appcues';
53
53
  }
54
54
  export interface EndUserShortcutChangedEvent {
55
55
  /** Event data passed for `command_execution` events. */
@@ -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
@@ -90,6 +90,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
90
90
  allow_create_label: t.StringC;
91
91
  show_in_record_action_list: t.BooleanC;
92
92
  show_in_default_list: t.BooleanC;
93
+ auto_choose: t.BooleanC;
94
+ is_private: t.BooleanC;
93
95
  }>]>, t.IntersectionC<[t.TypeC<{
94
96
  type: t.LiteralC<"set">;
95
97
  value: t.UnionC<[t.ArrayC<t.StringC>, t.ArrayC<t.NumberC>, t.ArrayC<t.UnknownRecordC>]>;
@@ -109,6 +111,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
109
111
  loaded: t.ArrayC<t.AnyC>;
110
112
  allow_create: t.BooleanC;
111
113
  allow_create_label: t.StringC;
114
+ auto_choose: t.BooleanC;
115
+ is_private: t.BooleanC;
112
116
  }>]>, t.IntersectionC<[t.TypeC<{
113
117
  type: t.LiteralC<"provided">;
114
118
  value: t.UnionC<[t.LiteralC<"text">, t.LiteralC<"time">]>;
@@ -129,6 +133,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
129
133
  dateTimeArgumentTypeId: t.NumberC;
130
134
  allow_create: t.BooleanC;
131
135
  allow_create_label: t.StringC;
136
+ auto_choose: t.BooleanC;
137
+ is_private: t.BooleanC;
132
138
  }>]>, t.IntersectionC<[t.TypeC<{
133
139
  type: t.LiteralC<"dependent">;
134
140
  value: t.StringC;
@@ -148,6 +154,8 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
148
154
  loaded: t.ArrayC<t.AnyC>;
149
155
  allow_create: t.BooleanC;
150
156
  allow_create_label: t.StringC;
157
+ auto_choose: t.BooleanC;
158
+ is_private: t.BooleanC;
151
159
  }>]>, t.IntersectionC<[t.TypeC<{
152
160
  type: t.LiteralC<"function">;
153
161
  value: t.StringC;
@@ -167,6 +175,34 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
167
175
  loaded: t.ArrayC<t.AnyC>;
168
176
  allow_create: t.BooleanC;
169
177
  allow_create_label: t.StringC;
178
+ auto_choose: t.BooleanC;
179
+ is_private: t.BooleanC;
180
+ }>]>, t.IntersectionC<[t.TypeC<{
181
+ type: t.LiteralC<"video">;
182
+ value: t.IntersectionC<[t.TypeC<{
183
+ source: t.StringC;
184
+ }>, t.PartialC<{
185
+ title: t.StringC;
186
+ description: t.StringC;
187
+ }>]>;
188
+ order_key: t.NumberC;
189
+ }>, t.PartialC<{
190
+ label: t.StringC;
191
+ chosen: t.UnionC<[t.StringC, t.NumberC]>;
192
+ selected: t.ArrayC<t.AnyC>;
193
+ input_type: t.StringC;
194
+ preselected_key: t.StringC;
195
+ label_field: t.StringC;
196
+ availability_condition: t.ArrayC<t.TypeC<{
197
+ field: t.StringC;
198
+ operator: t.UnionC<[t.LiteralC<"==">, t.LiteralC<"!=">, t.LiteralC<"isTruthy">, t.LiteralC<"isFalsy">]>;
199
+ value: t.UnionC<[t.StringC, t.UndefinedC]>;
200
+ }>>;
201
+ loaded: t.ArrayC<t.AnyC>;
202
+ allow_create: t.BooleanC;
203
+ allow_create_label: t.StringC;
204
+ is_private: t.BooleanC;
205
+ auto_choose: t.BooleanC;
170
206
  }>]>]>>;
171
207
  category: t.UnionC<[t.NumberC, t.StringC, t.NullC]>;
172
208
  icon: t.UnionC<[t.StringC, t.NullC]>;
@@ -243,11 +279,15 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
243
279
  value: t.StringC;
244
280
  reason: t.StringC;
245
281
  }>]>]>>;
246
- detail: t.UnionC<[t.StringC, t.TypeC<{
282
+ detail: t.UnionC<[t.StringC, t.IntersectionC<[t.TypeC<{
247
283
  type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.NullC]>;
248
284
  value: t.StringC;
249
- }>, t.ArrayC<t.TypeC<{
285
+ }>, t.PartialC<{
286
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
287
+ }>]>, t.ArrayC<t.IntersectionC<[t.TypeC<{
250
288
  type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"react">, t.LiteralC<"video">, t.NullC]>;
251
289
  value: t.StringC;
252
- }>>]>;
290
+ }>, t.PartialC<{
291
+ position: t.UnionC<[t.LiteralC<"inline">, t.LiteralC<"popover">]>;
292
+ }>]>>]>;
253
293
  }>]>;