commandbar 1.6.13 → 1.6.16

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.
@@ -76,6 +76,7 @@ export declare class Organization {
76
76
  unfurl?: boolean | undefined;
77
77
  description_field?: string | undefined;
78
78
  icon?: string | undefined;
79
+ image?: string | undefined;
79
80
  sort_key?: number | undefined;
80
81
  max_options_count?: number | null | undefined;
81
82
  sortFunction?: any;
@@ -90,6 +91,17 @@ export declare class Organization {
90
91
  search_tab_instruction?: string | null | undefined;
91
92
  setting_pin_to_bottom?: boolean | undefined;
92
93
  track_recents?: boolean | undefined;
94
+ detail?: string | ({
95
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
96
+ value: string;
97
+ } & {
98
+ position?: "inline" | "popover" | undefined;
99
+ }) | (string | ({
100
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
101
+ value: string;
102
+ } & {
103
+ position?: "inline" | "popover" | undefined;
104
+ }))[] | null | undefined;
93
105
  };
94
106
  };
95
107
  should_show_onboarding: boolean;
@@ -146,6 +158,7 @@ export declare class Organization {
146
158
  unfurl?: boolean | undefined;
147
159
  description_field?: string | undefined;
148
160
  icon?: string | undefined;
161
+ image?: string | undefined;
149
162
  sort_key?: number | undefined;
150
163
  max_options_count?: number | null | undefined;
151
164
  sortFunction?: any;
@@ -160,6 +173,17 @@ export declare class Organization {
160
173
  search_tab_instruction?: string | null | undefined;
161
174
  setting_pin_to_bottom?: boolean | undefined;
162
175
  track_recents?: boolean | undefined;
176
+ detail?: string | ({
177
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
178
+ value: string;
179
+ } & {
180
+ position?: "inline" | "popover" | undefined;
181
+ }) | (string | ({
182
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
183
+ value: string;
184
+ } & {
185
+ position?: "inline" | "popover" | undefined;
186
+ }))[] | null | undefined;
163
187
  };
164
188
  };
165
189
  should_show_onboarding: boolean;
@@ -215,6 +239,7 @@ export declare class Organization {
215
239
  unfurl?: boolean | undefined;
216
240
  description_field?: string | undefined;
217
241
  icon?: string | undefined;
242
+ image?: string | undefined;
218
243
  sort_key?: number | undefined;
219
244
  max_options_count?: number | null | undefined;
220
245
  sortFunction?: any;
@@ -229,6 +254,17 @@ export declare class Organization {
229
254
  search_tab_instruction?: string | null | undefined;
230
255
  setting_pin_to_bottom?: boolean | undefined;
231
256
  track_recents?: boolean | undefined;
257
+ detail?: string | ({
258
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
259
+ value: string;
260
+ } & {
261
+ position?: "inline" | "popover" | undefined;
262
+ }) | (string | ({
263
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
264
+ value: string;
265
+ } & {
266
+ position?: "inline" | "popover" | undefined;
267
+ }))[] | null | undefined;
232
268
  };
233
269
  };
234
270
  should_show_onboarding: boolean;
@@ -352,6 +388,14 @@ export declare class Organization {
352
388
  object?: string | undefined;
353
389
  hoverTooltip?: boolean | undefined;
354
390
  operation?: "self" | "router" | "blank" | undefined;
391
+ }) | ({
392
+ type: "helpdoc";
393
+ value: string;
394
+ } & {} & {
395
+ commandType?: "object" | "independent" | "help" | undefined;
396
+ object?: string | undefined;
397
+ hoverTooltip?: boolean | undefined;
398
+ operation?: "self" | "router" | "blank" | undefined;
355
399
  });
356
400
  } & {
357
401
  disabledReason?: string | undefined;
@@ -359,6 +403,7 @@ export declare class Organization {
359
403
  name?: string | undefined;
360
404
  last_available?: string | null | undefined;
361
405
  modified?: string | undefined;
406
+ isAsync?: boolean | undefined;
362
407
  } & {
363
408
  arguments: {
364
409
  [x: string]: ({
@@ -472,12 +517,13 @@ export declare class Organization {
472
517
  auto_choose?: boolean | undefined;
473
518
  is_private?: boolean | undefined;
474
519
  }) | ({
475
- type: "video";
520
+ type: "html" | "video";
476
521
  value: {
477
522
  source: string;
478
523
  } & {
479
524
  title?: string | undefined;
480
525
  description?: string | undefined;
526
+ url?: string | undefined;
481
527
  };
482
528
  order_key: number;
483
529
  } & {
@@ -507,22 +553,56 @@ export declare class Organization {
507
553
  field?: string | undefined;
508
554
  value?: string | undefined;
509
555
  reason?: string | undefined;
510
- })[];
556
+ })[] | (({
557
+ type: "url" | "context" | "element";
558
+ operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
559
+ } & {
560
+ field?: string | undefined;
561
+ value?: string | undefined;
562
+ reason?: string | undefined;
563
+ }) | ({
564
+ type: "named_rule";
565
+ rule_id: number;
566
+ } & {
567
+ reason?: string | undefined;
568
+ }))[];
511
569
  recommend_rules: (({
570
+ type: "url" | "context" | "element";
571
+ operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
572
+ } & {
573
+ field?: string | undefined;
574
+ value?: string | undefined;
575
+ reason?: string | undefined;
576
+ }) | ({
512
577
  type: "always";
513
578
  } & {
514
579
  operator?: null | undefined;
515
580
  field?: null | undefined;
516
581
  value?: null | undefined;
517
582
  reason?: null | undefined;
518
- }) | ({
583
+ }))[] | (({
519
584
  type: "url" | "context" | "element";
520
585
  operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
521
586
  } & {
522
587
  field?: string | undefined;
523
588
  value?: string | undefined;
524
589
  reason?: string | undefined;
590
+ }) | ({
591
+ type: "named_rule";
592
+ rule_id: number;
593
+ } & {
594
+ reason?: string | undefined;
595
+ }) | ({
596
+ type: "always";
597
+ } & {
598
+ operator?: null | undefined;
599
+ field?: null | undefined;
600
+ value?: null | undefined;
601
+ reason?: null | undefined;
525
602
  }))[];
603
+ availability_expression: import("./helpers/rules").RuleExpression;
604
+ recommend_expression: import("./helpers/rules").RuleExpression;
605
+ always_recommend: boolean;
526
606
  confirm: string;
527
607
  shortcut: string[];
528
608
  explanation: string;
@@ -531,6 +611,7 @@ export declare class Organization {
531
611
  category: number | null;
532
612
  sort_key: number | null;
533
613
  icon: string | null;
614
+ image: string | null;
534
615
  celebrate: boolean | {
535
616
  angle?: number | undefined;
536
617
  spread?: number | undefined;
@@ -551,16 +632,20 @@ export declare class Organization {
551
632
  hotkey_mac: string;
552
633
  hotkey_win: string;
553
634
  detail: string | ({
554
- type: "html" | "video" | "plaintext" | "markdown" | "react" | null;
635
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
555
636
  value: string;
556
637
  } & {
557
638
  position?: "inline" | "popover" | undefined;
558
639
  }) | (string | ({
559
- type: "html" | "video" | "plaintext" | "markdown" | "react" | null;
640
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
560
641
  value: string;
561
642
  } & {
562
643
  position?: "inline" | "popover" | undefined;
563
644
  }))[] | null;
645
+ next_steps: (string | number)[];
646
+ } & {
647
+ third_party_source?: string | null | undefined;
648
+ third_party_id?: string | null | undefined;
564
649
  })[]>;
565
650
  static listCommandCategories: (orgUID: string) => Promise<({
566
651
  id: number;
@@ -569,6 +654,7 @@ export declare class Organization {
569
654
  } & {} & {
570
655
  sort_key: number | null;
571
656
  icon: string | null;
657
+ image: string | null;
572
658
  render_as: "grid" | "list";
573
659
  setting_hide_before_search: boolean;
574
660
  setting_max_options_count: number | null;
@@ -604,14 +690,7 @@ export declare class Organization {
604
690
  static listRules: (orgUID: string) => Promise<{
605
691
  id: number;
606
692
  name: string;
607
- conditions: ({
608
- type: "url" | "context" | "element";
609
- operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
610
- } & {
611
- field?: string | undefined;
612
- value?: string | undefined;
613
- reason?: string | undefined;
614
- })[];
693
+ expression: import("./helpers/rules").RuleExpression;
615
694
  }[]>;
616
695
  static userHasAccess: (uuid: string, user: string) => Promise<{
617
696
  username: string;
@@ -778,6 +857,7 @@ export declare class Organization {
778
857
  unfurl?: boolean | undefined;
779
858
  description_field?: string | undefined;
780
859
  icon?: string | undefined;
860
+ image?: string | undefined;
781
861
  sort_key?: number | undefined;
782
862
  max_options_count?: number | null | undefined;
783
863
  sortFunction?: any;
@@ -792,6 +872,17 @@ export declare class Organization {
792
872
  search_tab_instruction?: string | null | undefined;
793
873
  setting_pin_to_bottom?: boolean | undefined;
794
874
  track_recents?: boolean | undefined;
875
+ detail?: string | ({
876
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
877
+ value: string;
878
+ } & {
879
+ position?: "inline" | "popover" | undefined;
880
+ }) | (string | ({
881
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
882
+ value: string;
883
+ } & {
884
+ position?: "inline" | "popover" | undefined;
885
+ }))[] | null | undefined;
795
886
  };
796
887
  };
797
888
  should_show_onboarding: boolean;
@@ -9,6 +9,15 @@ export declare const SkinV: t.IntersectionC<[t.TypeC<{
9
9
  }>, t.PartialC<{
10
10
  logo: t.UnionC<[t.StringC, t.NullC]>;
11
11
  }>]>;
12
+ export declare const SkinPatchV: t.PartialC<{
13
+ id: t.StringC;
14
+ slug: t.StringC;
15
+ name: t.StringC;
16
+ default: t.BooleanC;
17
+ skin: t.AnyC;
18
+ organization: t.StringC;
19
+ logo: t.UnionC<[t.StringC, t.NullC]>;
20
+ }>;
12
21
  export declare class Skin {
13
22
  static list: (onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<({
14
23
  id: string;
@@ -52,7 +61,15 @@ export declare class Skin {
52
61
  } & {
53
62
  logo?: string | null | undefined;
54
63
  }>;
55
- static create: (object: {}, onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<{
64
+ static create: (object: {
65
+ id?: string | undefined;
66
+ slug?: string | undefined;
67
+ name?: string | undefined;
68
+ default?: boolean | undefined;
69
+ skin?: any;
70
+ organization?: string | undefined;
71
+ logo?: string | null | undefined;
72
+ }, onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<{
56
73
  id: string;
57
74
  slug: string;
58
75
  name: string;
@@ -0,0 +1,27 @@
1
+ import * as t from 'io-ts';
2
+ export declare const TabV: t.TypeC<{
3
+ id: t.NumberC;
4
+ organization: t.UnionC<[t.NumberC, t.StringC]>;
5
+ category_ids: t.ArrayC<t.NumberC>;
6
+ sort_key: t.NumberC;
7
+ icon: t.UnionC<[t.StringC, t.NullC]>;
8
+ label: t.StringC;
9
+ header: t.UnionC<[t.StringC, t.NullC]>;
10
+ description: t.StringC;
11
+ placeholder: t.UnionC<[t.StringC, t.NullC]>;
12
+ render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
13
+ }>;
14
+ export declare class Tab {
15
+ static decode: (data: any) => {
16
+ id: number;
17
+ organization: string | number;
18
+ category_ids: number[];
19
+ sort_key: number;
20
+ icon: string | null;
21
+ label: string;
22
+ header: string | null;
23
+ description: string;
24
+ placeholder: string | null;
25
+ render_as: "grid" | "list";
26
+ };
27
+ }
@@ -19,6 +19,9 @@ import { ProfileV } from './profile';
19
19
  import { PlaceholderV } from './placeholder';
20
20
  import { EnvReleaseInfoV, ReleaseStepV, ReleaseV } from './releases';
21
21
  import { EnvironmentV } from './environment';
22
+ import { NudgeV } from './nudge';
23
+ import { TabV } from './tab';
24
+ import { RuleExpressionAndV, RuleExpressionOrV, RuleExpressionV } from './helpers/rules';
22
25
  /*******************************************************************************/
23
26
  export declare type IContextType = t.TypeOf<typeof ContextV>;
24
27
  export declare type IUserType = t.TypeOf<typeof UserV>;
@@ -40,6 +43,7 @@ export declare type ISkinType = t.TypeOf<typeof SkinV>;
40
43
  export declare type IProfileType = t.TypeOf<typeof ProfileV>;
41
44
  export declare type IOrganizationSettingsType = t.TypeOf<typeof OrganizationSettingsV>;
42
45
  export declare type IPlaceholderType = t.TypeOf<typeof PlaceholderV>;
46
+ export declare type ITabType = t.TypeOf<typeof TabV>;
43
47
  export declare type IEnvironmentType = t.TypeOf<typeof EnvironmentV>;
44
48
  export declare type IReleaseStep = t.TypeOf<typeof ReleaseStepV>;
45
49
  export declare type IRelease = t.TypeOf<typeof ReleaseV>;
@@ -58,6 +62,9 @@ export declare type RequestTemplateType = t.TypeOf<typeof RequestTemplateV>;
58
62
  export declare type RequestType = t.TypeOf<typeof RequestV>;
59
63
  export declare type ITemplateOptions = t.TypeOf<typeof TemplateOptionsV>;
60
64
  export declare type IEndUserType = t.TypeOf<typeof EndUserV>;
65
+ export declare type IRuleExpression = t.TypeOf<typeof RuleExpressionV>;
66
+ export declare type IRuleExpressionAnd = t.TypeOf<typeof RuleExpressionAndV>;
67
+ export declare type IRuleExpressionOr = t.TypeOf<typeof RuleExpressionOrV>;
61
68
  export declare type IConditionType = t.TypeOf<typeof ConditionV>;
62
69
  export declare type IConditionOperatorType = t.TypeOf<typeof ConditionOperatorV>;
63
70
  export declare type IContextArgumentType = t.TypeOf<typeof ContextArgumentV>;
@@ -66,6 +73,12 @@ export declare type IDynamicArgumentType = t.TypeOf<typeof DynamicArgumentV>;
66
73
  export declare type IDependentArgumentType = t.TypeOf<typeof DependentArgumentV>;
67
74
  export declare type IFunctionArgumentType = t.TypeOf<typeof FunctionArgumentV>;
68
75
  export declare type OptionGroupRenderAsType = t.TypeOf<typeof OptionGroupRenderAsV>;
76
+ export declare type INudgeType = t.TypeOf<typeof NudgeV>;
77
+ export interface INudgeClientType {
78
+ nudge: INudgeType;
79
+ active: boolean;
80
+ lastTriggeredTs?: number;
81
+ }
69
82
  export interface ICommandInput {
70
83
  text: string;
71
84
  command: ICommandType;
@@ -82,7 +95,7 @@ export interface IUserContext {
82
95
  [variable: string]: any;
83
96
  }
84
97
  export interface ICallbackMap {
85
- [variable: string]: (...args: any[]) => any;
98
+ [variable: string]: (...args: any[]) => unknown;
86
99
  }
87
100
  export interface IResourceType extends IUserContext {
88
101
  _cbLinkedCommmands: Array<{
@@ -96,10 +109,12 @@ export declare type IConfigEndpointResponse = {
96
109
  organization: any;
97
110
  environments_with_versions?: any[];
98
111
  placeholders?: any[];
112
+ nudges?: INudgeType[];
113
+ tabs?: ITabType[];
99
114
  };
100
115
  export type { IResourceSettings } from './IResourceSettings';
101
116
  export declare type IResourceSettingsByContextKey = t.TypeOf<typeof ResourceSettingsByContextKeyV>;
102
- export type { DetailPreviewObjectType, DetailPreviewType, DataRowMedata } from './detailPreview';
117
+ export type { DetailPreviewObjectType, DetailPreviewType, DataRowMetadata } from './detailPreview';
103
118
  /*******************************************************************************/
104
119
  export declare const isCommand: (command?: ICommandType | any) => command is {
105
120
  id: number;
@@ -198,6 +213,14 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
198
213
  object?: string | undefined;
199
214
  hoverTooltip?: boolean | undefined;
200
215
  operation?: "self" | "router" | "blank" | undefined;
216
+ }) | ({
217
+ type: "helpdoc";
218
+ value: string;
219
+ } & {} & {
220
+ commandType?: "object" | "independent" | "help" | undefined;
221
+ object?: string | undefined;
222
+ hoverTooltip?: boolean | undefined;
223
+ operation?: "self" | "router" | "blank" | undefined;
201
224
  });
202
225
  } & {
203
226
  disabledReason?: string | undefined;
@@ -205,6 +228,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
205
228
  name?: string | undefined;
206
229
  last_available?: string | null | undefined;
207
230
  modified?: string | undefined;
231
+ isAsync?: boolean | undefined;
208
232
  } & {
209
233
  arguments: {
210
234
  [x: string]: ({
@@ -318,12 +342,13 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
318
342
  auto_choose?: boolean | undefined;
319
343
  is_private?: boolean | undefined;
320
344
  }) | ({
321
- type: "video";
345
+ type: "html" | "video";
322
346
  value: {
323
347
  source: string;
324
348
  } & {
325
349
  title?: string | undefined;
326
350
  description?: string | undefined;
351
+ url?: string | undefined;
327
352
  };
328
353
  order_key: number;
329
354
  } & {
@@ -355,20 +380,23 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
355
380
  reason?: string | undefined;
356
381
  })[];
357
382
  recommend_rules: (({
358
- type: "always";
359
- } & {
360
- operator?: null | undefined;
361
- field?: null | undefined;
362
- value?: null | undefined;
363
- reason?: null | undefined;
364
- }) | ({
365
383
  type: "url" | "context" | "element";
366
384
  operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
367
385
  } & {
368
386
  field?: string | undefined;
369
387
  value?: string | undefined;
370
388
  reason?: string | undefined;
389
+ }) | ({
390
+ type: "always";
391
+ } & {
392
+ operator?: null | undefined;
393
+ field?: null | undefined;
394
+ value?: null | undefined;
395
+ reason?: null | undefined;
371
396
  }))[];
397
+ availability_expression: import("./helpers/rules").RuleExpression | null;
398
+ recommend_expression: import("./helpers/rules").RuleExpression | null;
399
+ always_recommend: boolean;
372
400
  confirm: string;
373
401
  shortcut: string[];
374
402
  explanation: string;
@@ -377,6 +405,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
377
405
  category: number | null;
378
406
  sort_key: number | null;
379
407
  icon: string | null;
408
+ image: string | null;
380
409
  celebrate: boolean | {
381
410
  angle?: number | undefined;
382
411
  spread?: number | undefined;
@@ -397,16 +426,20 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
397
426
  hotkey_mac: string;
398
427
  hotkey_win: string;
399
428
  detail: string | ({
400
- type: "html" | "video" | "plaintext" | "markdown" | "react" | null;
429
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
401
430
  value: string;
402
431
  } & {
403
432
  position?: "inline" | "popover" | undefined;
404
433
  }) | (string | ({
405
- type: "html" | "video" | "plaintext" | "markdown" | "react" | null;
434
+ type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
406
435
  value: string;
407
436
  } & {
408
437
  position?: "inline" | "popover" | undefined;
409
438
  }))[] | null;
439
+ next_steps: (string | number)[];
440
+ } & {
441
+ third_party_source?: string | null | undefined;
442
+ third_party_id?: string | null | undefined;
410
443
  };
411
444
  export declare const isResource: (option: any) => option is IResourceType;
412
445
  export declare const isContextArgument: (argument: IArgumentType) => argument is {
@@ -10,5 +10,5 @@ export declare const UserV: t.IntersectionC<[t.TypeC<{
10
10
  has_updated_password: t.BooleanC;
11
11
  is_active: t.BooleanC;
12
12
  }>, t.PartialC<{
13
- intercom_hash: t.StringC;
13
+ atlas_hash: t.StringC;
14
14
  }>]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commandbar",
3
- "version": "1.6.13",
3
+ "version": "1.6.16",
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",