commandbar 1.6.8 → 1.6.9
Sign up to get free protection for your applications and to get access to all the features.
- package/build/commandbar-js/src/init.d.ts +1 -1
- package/build/internal/src/client/AddContextOptions.d.ts +16 -2
- package/build/internal/src/client/CommandBarClientSDK.d.ts +11 -1
- package/build/internal/src/middleware/CommandFromClientV.d.ts +32 -0
- package/build/internal/src/middleware/ICommandFromClientType.d.ts +2 -0
- package/build/internal/src/middleware/OrganizationV.d.ts +14 -4
- package/build/internal/src/middleware/ResourceSettingsV.d.ts +14 -2
- package/build/internal/src/middleware/command.d.ts +492 -0
- package/build/internal/src/middleware/commandCategory.d.ts +6 -0
- package/build/internal/src/middleware/detailPreview.d.ts +17 -0
- package/build/internal/src/middleware/generics.d.ts +6 -2
- package/build/internal/src/middleware/helpers/commandTemplate.d.ts +62 -0
- package/build/internal/src/middleware/helpers/optionGroup.d.ts +2 -0
- package/build/internal/src/middleware/organization.d.ts +135 -54
- package/build/internal/src/middleware/types.d.ts +42 -1
- package/package.json +1 -1
- package/src/init.ts +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import 'proxy-polyfill';
|
2
2
|
import 'es6-object-assign/auto';
|
3
3
|
import 'es6-symbol/implement';
|
4
|
-
import { IConfigEndpointResponse } from '
|
4
|
+
import { IConfigEndpointResponse } from '../../internal/src/middleware/types';
|
5
5
|
interface IInitOptions {
|
6
6
|
debug?: boolean;
|
7
7
|
environment?: string;
|
@@ -30,6 +30,10 @@ export interface AddContextOptions {
|
|
30
30
|
quickFind?: boolean;
|
31
31
|
/** Turn on unfurling for `key`. */
|
32
32
|
unfurl?: boolean;
|
33
|
+
/** Show records by default with no input */
|
34
|
+
showInDefaultEmptyState?: boolean;
|
35
|
+
/** Sort key */
|
36
|
+
categorySortKey?: number;
|
33
37
|
};
|
34
38
|
/** Options to customize the style of `key` objects. */
|
35
39
|
renderOptions?: {
|
@@ -49,7 +53,10 @@ export interface AddContextOptions {
|
|
49
53
|
* A list of object fields to be searched. If a custom `searchFunction` is provided, matches will be highlighted in
|
50
54
|
* these fields. Field names will be transformed from _camelCase_ or _snake_case_ into _Sentence case_.
|
51
55
|
*/
|
52
|
-
fields?: string
|
56
|
+
fields?: (string | {
|
57
|
+
key: string;
|
58
|
+
label: string;
|
59
|
+
})[];
|
53
60
|
/**
|
54
61
|
* Adds a custom search function to CommandBar for `key`. This custom search function should take a single argument `input` and return an array of results.
|
55
62
|
*
|
@@ -81,7 +88,10 @@ export interface ArgumentOptions {
|
|
81
88
|
* A list of object fields to be searched. If a custom `searchFunction` is provided, matches will be highlighted in
|
82
89
|
* these fields. Field names will be transformed from _camelCase_ or _snake_case_ into _Sentence case_.
|
83
90
|
*/
|
84
|
-
searchableFields?: string
|
91
|
+
searchableFields?: (string | {
|
92
|
+
key: string;
|
93
|
+
label: string;
|
94
|
+
})[];
|
85
95
|
onInputChange?: SearchFunction | SearchFunctionPaginated;
|
86
96
|
}
|
87
97
|
export interface RecordOptions extends ArgumentOptions {
|
@@ -90,5 +100,9 @@ export interface RecordOptions extends ArgumentOptions {
|
|
90
100
|
categoryName?: string;
|
91
101
|
/** Turn on unfurling for `key`. */
|
92
102
|
unfurl?: boolean;
|
103
|
+
/** Show records by default with no input */
|
104
|
+
showInDefaultEmptyState?: boolean;
|
105
|
+
/** Sort key */
|
106
|
+
categorySortKey?: number;
|
93
107
|
};
|
94
108
|
}
|
@@ -2,7 +2,9 @@ import { AddContextOptions, ArgumentOptions, DataRow, RecordOptions } from './Ad
|
|
2
2
|
import { EventHandler } from './EventHandler';
|
3
3
|
import { ICommandFromClientType } from '../middleware/ICommandFromClientType';
|
4
4
|
import { IResourceSettings } from '../middleware/IResourceSettings';
|
5
|
-
import { ICommandCategoryType } from '../middleware/types';
|
5
|
+
import { ICommandCategoryType, DetailPreviewType, DataRowMedata } from '../middleware/types';
|
6
|
+
export type { DataRow } from './AddContextOptions';
|
7
|
+
export type { DataRowMedata } from '../middleware/types';
|
6
8
|
export declare const ASYNC_METHODS: Array<keyof CommandBarClientSDK>;
|
7
9
|
export declare type BootOptions = string | (UserAttributes & {
|
8
10
|
id: string;
|
@@ -181,6 +183,14 @@ export declare type CommandBarClientSDK = Readonly<{
|
|
181
183
|
* @param id The command id to execute. For commands defined via the Editor, you can find this id in the Editor by selecting "Copy code" in the command's ellipsis menu. For commands defined via the SDK, this is the `name` field.
|
182
184
|
*/
|
183
185
|
execute(id: number | string): void;
|
186
|
+
/**
|
187
|
+
* Defines a function
|
188
|
+
*
|
189
|
+
* @param fn The preview detail generator function. It should accept the following arguments:
|
190
|
+
* * `row` {any}
|
191
|
+
* * `node` {any}
|
192
|
+
*/
|
193
|
+
generateDetailPreview(fn: (data: DataRow, metadata: DataRowMedata) => undefined | DetailPreviewType): void;
|
184
194
|
/**
|
185
195
|
* Returns an array returning all commands that fit the optional filter function. By default, all commands are returned
|
186
196
|
* @param filter A function that filters out commands based on its properties. These are:
|
@@ -33,6 +33,31 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
|
|
33
33
|
object: t.StringC;
|
34
34
|
hoverTooltip: t.BooleanC;
|
35
35
|
operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
|
36
|
+
}>]>]>, t.IntersectionC<[t.TypeC<{
|
37
|
+
type: t.LiteralC<"request">;
|
38
|
+
value: t.IntersectionC<[t.TypeC<{
|
39
|
+
method: t.UnionC<[t.LiteralC<"get">, t.LiteralC<"delete">, t.LiteralC<"head">, t.LiteralC<"options">, t.LiteralC<"post">, t.LiteralC<"put">, t.LiteralC<"patch">]>;
|
40
|
+
url: t.StringC;
|
41
|
+
}>, t.PartialC<{
|
42
|
+
headers: t.UnknownRecordC;
|
43
|
+
body: t.UnknownRecordC;
|
44
|
+
onSend: t.StringC;
|
45
|
+
onSuccess: t.StringC;
|
46
|
+
onError: t.StringC;
|
47
|
+
}>]>;
|
48
|
+
}>, t.IntersectionC<[t.TypeC<{}>, t.PartialC<{
|
49
|
+
commandType: t.UnionC<[t.LiteralC<"independent">, t.LiteralC<"object">, t.LiteralC<"help">]>;
|
50
|
+
object: t.StringC;
|
51
|
+
hoverTooltip: t.BooleanC;
|
52
|
+
operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
|
53
|
+
}>]>]>, t.IntersectionC<[t.TypeC<{
|
54
|
+
type: t.LiteralC<"appcues">;
|
55
|
+
value: t.StringC;
|
56
|
+
}>, t.IntersectionC<[t.TypeC<{}>, t.PartialC<{
|
57
|
+
commandType: t.UnionC<[t.LiteralC<"independent">, t.LiteralC<"object">, t.LiteralC<"help">]>;
|
58
|
+
object: t.StringC;
|
59
|
+
hoverTooltip: t.BooleanC;
|
60
|
+
operation: t.UnionC<[t.LiteralC<"router">, t.LiteralC<"self">, t.LiteralC<"blank">, t.UndefinedC]>;
|
36
61
|
}>]>]>]>;
|
37
62
|
text: t.StringC;
|
38
63
|
}>, t.PartialC<{
|
@@ -217,4 +242,11 @@ export declare const CommandFromClientV: t.IntersectionC<[t.TypeC<{
|
|
217
242
|
value: t.StringC;
|
218
243
|
reason: t.StringC;
|
219
244
|
}>]>]>>;
|
245
|
+
detail: t.UnionC<[t.StringC, t.TypeC<{
|
246
|
+
type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"reader">, t.LiteralC<"react">]>;
|
247
|
+
value: t.StringC;
|
248
|
+
}>, t.ArrayC<t.TypeC<{
|
249
|
+
type: t.UnionC<[t.LiteralC<"plaintext">, t.LiteralC<"markdown">, t.LiteralC<"html">, t.LiteralC<"reader">, t.LiteralC<"react">]>;
|
250
|
+
value: t.StringC;
|
251
|
+
}>>]>;
|
220
252
|
}>]>;
|
@@ -1,3 +1,5 @@
|
|
1
1
|
import * as t from 'io-ts';
|
2
2
|
import { CommandFromClientV } from './CommandFromClientV';
|
3
|
+
import { ContextArgumentV } from './helpers/argument';
|
3
4
|
export declare type ICommandFromClientType = t.TypeOf<typeof CommandFromClientV>;
|
5
|
+
export declare type IContextArgument = t.TypeOf<typeof ContextArgumentV>;
|
@@ -16,7 +16,10 @@ declare const OrganizationAdditionalV: t.TypeC<{
|
|
16
16
|
search: t.BooleanC;
|
17
17
|
label_field: t.StringC;
|
18
18
|
useCategory: t.BooleanC;
|
19
|
-
search_fields: t.ArrayC<t.StringC
|
19
|
+
search_fields: t.ArrayC<t.UnionC<[t.StringC, t.TypeC<{
|
20
|
+
key: t.StringC;
|
21
|
+
label: t.StringC;
|
22
|
+
}>]>>;
|
20
23
|
auto_execute: t.BooleanC;
|
21
24
|
unfurl: t.BooleanC;
|
22
25
|
description_field: t.StringC;
|
@@ -25,6 +28,7 @@ declare const OrganizationAdditionalV: t.TypeC<{
|
|
25
28
|
max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
|
26
29
|
sortFunction: t.AnyC;
|
27
30
|
default_command_id: t.UnionC<[t.NumberC, t.StringC, t.UndefinedC]>;
|
31
|
+
render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
|
28
32
|
showResources: t.BooleanC;
|
29
33
|
show_with_no_results: t.BooleanC;
|
30
34
|
search_tab_enabled: t.BooleanC;
|
@@ -42,7 +46,8 @@ declare const OrganizationAdditionalV: t.TypeC<{
|
|
42
46
|
allow_event_handlers: t.BooleanC;
|
43
47
|
in_bar_feedback: t.BooleanC;
|
44
48
|
summon_hotkey_override: t.UnionC<[t.StringC, t.NullC]>;
|
45
|
-
end_user_hotkeys: t.BooleanC
|
49
|
+
end_user_hotkeys: t.UnionC<[t.UndefinedC, t.BooleanC]>;
|
50
|
+
end_user_shortcuts_enabled: t.BooleanC;
|
46
51
|
releases_available: t.BooleanC;
|
47
52
|
releases_enabled: t.BooleanC;
|
48
53
|
}>;
|
@@ -68,7 +73,10 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
68
73
|
search: t.BooleanC;
|
69
74
|
label_field: t.StringC;
|
70
75
|
useCategory: t.BooleanC;
|
71
|
-
search_fields: t.ArrayC<t.StringC
|
76
|
+
search_fields: t.ArrayC<t.UnionC<[t.StringC, t.TypeC<{
|
77
|
+
key: t.StringC;
|
78
|
+
label: t.StringC;
|
79
|
+
}>]>>;
|
72
80
|
auto_execute: t.BooleanC;
|
73
81
|
unfurl: t.BooleanC;
|
74
82
|
description_field: t.StringC;
|
@@ -77,6 +85,7 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
77
85
|
max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
|
78
86
|
sortFunction: t.AnyC;
|
79
87
|
default_command_id: t.UnionC<[t.NumberC, t.StringC, t.UndefinedC]>;
|
88
|
+
render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
|
80
89
|
showResources: t.BooleanC;
|
81
90
|
show_with_no_results: t.BooleanC;
|
82
91
|
search_tab_enabled: t.BooleanC;
|
@@ -94,7 +103,8 @@ export declare const OrganizationV: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
94
103
|
allow_event_handlers: t.BooleanC;
|
95
104
|
in_bar_feedback: t.BooleanC;
|
96
105
|
summon_hotkey_override: t.UnionC<[t.StringC, t.NullC]>;
|
97
|
-
end_user_hotkeys: t.BooleanC
|
106
|
+
end_user_hotkeys: t.UnionC<[t.UndefinedC, t.BooleanC]>;
|
107
|
+
end_user_shortcuts_enabled: t.BooleanC;
|
98
108
|
releases_available: t.BooleanC;
|
99
109
|
releases_enabled: t.BooleanC;
|
100
110
|
}>]>;
|
@@ -1,10 +1,17 @@
|
|
1
1
|
import * as t from 'io-ts';
|
2
|
+
export declare const SearchFieldConfigV: t.TypeC<{
|
3
|
+
key: t.StringC;
|
4
|
+
label: t.StringC;
|
5
|
+
}>;
|
2
6
|
export declare const ResourceSettingsV: t.PartialC<{
|
3
7
|
name: t.StringC;
|
4
8
|
search: t.BooleanC;
|
5
9
|
label_field: t.StringC;
|
6
10
|
useCategory: t.BooleanC;
|
7
|
-
search_fields: t.ArrayC<t.StringC
|
11
|
+
search_fields: t.ArrayC<t.UnionC<[t.StringC, t.TypeC<{
|
12
|
+
key: t.StringC;
|
13
|
+
label: t.StringC;
|
14
|
+
}>]>>;
|
8
15
|
auto_execute: t.BooleanC;
|
9
16
|
unfurl: t.BooleanC;
|
10
17
|
description_field: t.StringC;
|
@@ -13,6 +20,7 @@ export declare const ResourceSettingsV: t.PartialC<{
|
|
13
20
|
max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
|
14
21
|
sortFunction: t.AnyC;
|
15
22
|
default_command_id: t.UnionC<[t.NumberC, t.StringC, t.UndefinedC]>;
|
23
|
+
render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
|
16
24
|
showResources: t.BooleanC;
|
17
25
|
show_with_no_results: t.BooleanC;
|
18
26
|
search_tab_enabled: t.BooleanC;
|
@@ -25,7 +33,10 @@ export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.Parti
|
|
25
33
|
search: t.BooleanC;
|
26
34
|
label_field: t.StringC;
|
27
35
|
useCategory: t.BooleanC;
|
28
|
-
search_fields: t.ArrayC<t.StringC
|
36
|
+
search_fields: t.ArrayC<t.UnionC<[t.StringC, t.TypeC<{
|
37
|
+
key: t.StringC;
|
38
|
+
label: t.StringC;
|
39
|
+
}>]>>;
|
29
40
|
auto_execute: t.BooleanC;
|
30
41
|
unfurl: t.BooleanC;
|
31
42
|
description_field: t.StringC;
|
@@ -34,6 +45,7 @@ export declare const ResourceSettingsByContextKeyV: t.RecordC<t.StringC, t.Parti
|
|
34
45
|
max_options_count: t.UnionC<[t.NumberC, t.NullC]>;
|
35
46
|
sortFunction: t.AnyC;
|
36
47
|
default_command_id: t.UnionC<[t.NumberC, t.StringC, t.UndefinedC]>;
|
48
|
+
render_as: t.UnionC<[t.LiteralC<"list">, t.LiteralC<"grid">]>;
|
37
49
|
showResources: t.BooleanC;
|
38
50
|
show_with_no_results: t.BooleanC;
|
39
51
|
search_tab_enabled: t.BooleanC;
|