commandbar 1.7.0 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,60 +23,67 @@ import { NudgeV } from './nudge';
23
23
  import { TabV } from './tab';
24
24
  import { RuleExpressionAndV, RuleExpressionOrV, RuleExpressionV } from './helpers/rules';
25
25
  /*******************************************************************************/
26
- export declare type IContextType = t.TypeOf<typeof ContextV>;
27
- export declare type IUserType = t.TypeOf<typeof UserV>;
28
- export declare type ICommandType = t.TypeOf<typeof CommandV>;
29
- export declare type IEditorCommandType = t.TypeOf<typeof EditorCommandV>;
30
- export declare type IHelpSyncCommandType = t.TypeOf<typeof HelpSyncCommandV>;
26
+ export declare type IInitOptions = {
27
+ debug?: boolean;
28
+ environment?: string;
29
+ version?: string;
30
+ config?: IConfigEndpointResponse;
31
+ };
32
+ /*******************************************************************************/
33
+ export declare type IContextType = t.TypeOf<typeof ContextV> & unknown;
34
+ export declare type IUserType = t.TypeOf<typeof UserV> & unknown;
35
+ export declare type ICommandType = t.TypeOf<typeof CommandV> & unknown;
36
+ export declare type IEditorCommandType = t.TypeOf<typeof EditorCommandV> & unknown;
37
+ export declare type IHelpSyncCommandType = t.TypeOf<typeof HelpSyncCommandV> & unknown;
31
38
  export type { ICommandFromClientType } from './ICommandFromClientType';
32
- export declare type ICommandCategoryType = t.TypeOf<typeof CommandCategoryV>;
39
+ export declare type ICommandCategoryType = t.TypeOf<typeof CommandCategoryV> & unknown;
33
40
  export declare type IGuideType = t.TypeOf<typeof GuideV> & {
34
41
  preview?: boolean;
35
- };
36
- export declare type IHistoryEventType = t.TypeOf<typeof HistoryEventV>;
37
- export declare type IHelpDocsSyncType = t.TypeOf<typeof HelpDocsSyncV>;
38
- export declare type IHelpDocsIntegrationType = t.TypeOf<typeof HelpDocsIntegrationV>;
42
+ } & unknown;
43
+ export declare type IHistoryEventType = t.TypeOf<typeof HistoryEventV> & unknown;
44
+ export declare type IHelpDocsSyncType = t.TypeOf<typeof HelpDocsSyncV> & unknown;
45
+ export declare type IHelpDocsIntegrationType = t.TypeOf<typeof HelpDocsIntegrationV> & unknown;
39
46
  export type { IOrganizationType } from './OrganizationV';
40
- export declare type IOrganizationStatusType = t.TypeOf<typeof OrganizationStatusV>;
41
- export declare type IInternalSettingsType = t.TypeOf<typeof InternalSettingsV>;
42
- export declare type ISkinType = t.TypeOf<typeof SkinV>;
43
- export declare type IProfileType = t.TypeOf<typeof ProfileV>;
44
- export declare type IOrganizationSettingsType = t.TypeOf<typeof OrganizationSettingsV>;
45
- export declare type IPlaceholderType = t.TypeOf<typeof PlaceholderV>;
46
- export declare type ITabType = t.TypeOf<typeof TabV>;
47
- export declare type IEnvironmentType = t.TypeOf<typeof EnvironmentV>;
48
- export declare type IReleaseStep = t.TypeOf<typeof ReleaseStepV>;
49
- export declare type IRelease = t.TypeOf<typeof ReleaseV>;
50
- export declare type IEnvReleaseInfo = t.TypeOf<typeof EnvReleaseInfoV>;
47
+ export declare type IOrganizationStatusType = t.TypeOf<typeof OrganizationStatusV> & unknown;
48
+ export declare type IInternalSettingsType = t.TypeOf<typeof InternalSettingsV> & unknown;
49
+ export declare type ISkinType = t.TypeOf<typeof SkinV> & unknown;
50
+ export declare type IProfileType = t.TypeOf<typeof ProfileV> & unknown;
51
+ export declare type IOrganizationSettingsType = t.TypeOf<typeof OrganizationSettingsV> & unknown;
52
+ export declare type IPlaceholderType = t.TypeOf<typeof PlaceholderV> & unknown;
53
+ export declare type ITabType = t.TypeOf<typeof TabV> & unknown;
54
+ export declare type IEnvironmentType = t.TypeOf<typeof EnvironmentV> & unknown;
55
+ export declare type IReleaseStep = t.TypeOf<typeof ReleaseStepV> & unknown;
56
+ export declare type IRelease = t.TypeOf<typeof ReleaseV> & unknown;
57
+ export declare type IEnvReleaseInfo = t.TypeOf<typeof EnvReleaseInfoV> & unknown;
51
58
  /*******************************************************************************/
52
- export declare type IBatchOperation = t.TypeOf<typeof BatchOperationV>;
53
- export declare type IBatchEditorCommandRequst = t.TypeOf<typeof GenericBatchRequest>;
54
- export declare type IBatchEditorCommandResponse = t.TypeOf<typeof BatchEditorCommandResponseV>;
59
+ export declare type IBatchOperation = t.TypeOf<typeof BatchOperationV> & unknown;
60
+ export declare type IBatchEditorCommandRequst = t.TypeOf<typeof GenericBatchRequest> & unknown;
61
+ export declare type IBatchEditorCommandResponse = t.TypeOf<typeof BatchEditorCommandResponseV> & unknown;
55
62
  /*******************************************************************************/
56
- export declare type IKeyEventCategory = t.TypeOf<typeof KeyEventV>;
57
- export declare type IArgumentMap = t.TypeOf<typeof ArgumentMapV>;
58
- export declare type IArgumentType = t.TypeOf<typeof ArgumentTypeV>;
59
- export declare type IStepArgumentType = t.TypeOf<typeof StepArgumentTypeV>;
60
- export declare type ITemplate = t.TypeOf<typeof TemplateV>;
61
- export declare type RequestTemplateType = t.TypeOf<typeof RequestTemplateV>;
62
- export declare type RequestType = t.TypeOf<typeof RequestV>;
63
- export declare type ITemplateOptions = t.TypeOf<typeof TemplateOptionsV>;
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>;
68
- export declare type IConditionType = t.TypeOf<typeof ConditionV>;
69
- export declare type IConditionOperatorType = t.TypeOf<typeof ConditionOperatorV>;
70
- export declare type IContextArgumentType = t.TypeOf<typeof ContextArgumentV>;
71
- export declare type ISetArgumentType = t.TypeOf<typeof SetArgumentV>;
72
- export declare type IDynamicArgumentType = t.TypeOf<typeof DynamicArgumentV>;
73
- export declare type IDependentArgumentType = t.TypeOf<typeof DependentArgumentV>;
74
- export declare type IFunctionArgumentType = t.TypeOf<typeof FunctionArgumentV>;
75
- export declare type OptionGroupRenderAsType = t.TypeOf<typeof OptionGroupRenderAsV>;
76
- export declare type INudgeType = t.TypeOf<typeof NudgeV>;
63
+ export declare type IKeyEventCategory = t.TypeOf<typeof KeyEventV> & unknown;
64
+ export declare type IArgumentMap = t.TypeOf<typeof ArgumentMapV> & unknown;
65
+ export declare type IArgumentType = t.TypeOf<typeof ArgumentTypeV> & unknown;
66
+ export declare type IStepArgumentType = t.TypeOf<typeof StepArgumentTypeV> & unknown;
67
+ export declare type ITemplate = t.TypeOf<typeof TemplateV> & unknown;
68
+ export declare type RequestTemplateType = t.TypeOf<typeof RequestTemplateV> & unknown;
69
+ export declare type RequestType = t.TypeOf<typeof RequestV> & unknown;
70
+ export declare type ITemplateOptions = t.TypeOf<typeof TemplateOptionsV> & unknown;
71
+ export declare type IEndUserType = t.TypeOf<typeof EndUserV> & unknown;
72
+ export declare type IRuleExpression = t.TypeOf<typeof RuleExpressionV> & unknown;
73
+ export declare type IRuleExpressionAnd = t.TypeOf<typeof RuleExpressionAndV> & unknown;
74
+ export declare type IRuleExpressionOr = t.TypeOf<typeof RuleExpressionOrV> & unknown;
75
+ export declare type IConditionType = t.TypeOf<typeof ConditionV> & unknown;
76
+ export declare type IConditionOperatorType = t.TypeOf<typeof ConditionOperatorV> & unknown;
77
+ export declare type IContextArgumentType = t.TypeOf<typeof ContextArgumentV> & unknown;
78
+ export declare type ISetArgumentType = t.TypeOf<typeof SetArgumentV> & unknown;
79
+ export declare type IDynamicArgumentType = t.TypeOf<typeof DynamicArgumentV> & unknown;
80
+ export declare type IDependentArgumentType = t.TypeOf<typeof DependentArgumentV> & unknown;
81
+ export declare type IFunctionArgumentType = t.TypeOf<typeof FunctionArgumentV> & unknown;
82
+ export declare type OptionGroupRenderAsType = t.TypeOf<typeof OptionGroupRenderAsV> & unknown;
83
+ export declare type INudgeType = t.TypeOf<typeof NudgeV> & unknown;
77
84
  export interface INudgeClientType {
78
85
  nudge: INudgeType;
79
- active: boolean;
86
+ passedConditionsInLastEvaluation: boolean;
80
87
  lastTriggeredTs?: number;
81
88
  }
82
89
  export interface ICommandInput {
@@ -94,6 +101,13 @@ export declare type IHistoryType = Array<{
94
101
  export interface IUserContext {
95
102
  [variable: string]: any;
96
103
  }
104
+ export interface EventWithTimestamp {
105
+ eventName: string;
106
+ properties: {
107
+ [prop: string]: any;
108
+ };
109
+ timestamp: number;
110
+ }
97
111
  export interface ICallbackMap {
98
112
  [variable: string]: (...args: any[]) => unknown;
99
113
  }
@@ -113,401 +127,11 @@ export declare type IConfigEndpointResponse = {
113
127
  tabs?: ITabType[];
114
128
  };
115
129
  export type { IResourceSettings } from './IResourceSettings';
116
- export declare type IResourceSettingsByContextKey = t.TypeOf<typeof ResourceSettingsByContextKeyV>;
130
+ export declare type IResourceSettingsByContextKey = t.TypeOf<typeof ResourceSettingsByContextKeyV> & unknown;
117
131
  export type { DetailPreviewObjectType, DetailPreviewType, DataRowMetadata } from './detailPreview';
118
132
  /*******************************************************************************/
119
- export declare const isCommand: (command?: ICommandType | any) => command is {
120
- id: number;
121
- organization: string | number;
122
- text: string;
123
- template: ({
124
- type: "admin";
125
- value: string;
126
- } & {} & {
127
- commandType?: "object" | "help" | "independent" | undefined;
128
- object?: string | undefined;
129
- hoverTooltip?: boolean | undefined;
130
- operation?: "self" | "router" | "blank" | undefined;
131
- }) | ({
132
- type: "callback";
133
- value: string;
134
- } & {} & {
135
- commandType?: "object" | "help" | "independent" | undefined;
136
- object?: string | undefined;
137
- hoverTooltip?: boolean | undefined;
138
- operation?: "self" | "router" | "blank" | undefined;
139
- }) | ({
140
- type: "link";
141
- value: string;
142
- } & {} & {
143
- commandType?: "object" | "help" | "independent" | undefined;
144
- object?: string | undefined;
145
- hoverTooltip?: boolean | undefined;
146
- operation?: "self" | "router" | "blank" | undefined;
147
- }) | ({
148
- type: "click" | "clickByXpath" | "clickBySelector";
149
- value: string[];
150
- } & {} & {
151
- commandType?: "object" | "help" | "independent" | undefined;
152
- object?: string | undefined;
153
- hoverTooltip?: boolean | undefined;
154
- operation?: "self" | "router" | "blank" | undefined;
155
- }) | ({
156
- type: "builtin";
157
- value: string;
158
- } & {} & {
159
- commandType?: "object" | "help" | "independent" | undefined;
160
- object?: string | undefined;
161
- hoverTooltip?: boolean | undefined;
162
- operation?: "self" | "router" | "blank" | undefined;
163
- }) | ({
164
- type: "webhook";
165
- value: string;
166
- } & {} & {
167
- commandType?: "object" | "help" | "independent" | undefined;
168
- object?: string | undefined;
169
- hoverTooltip?: boolean | undefined;
170
- operation?: "self" | "router" | "blank" | undefined;
171
- }) | ({
172
- type: "script";
173
- value: string;
174
- } & {} & {
175
- commandType?: "object" | "help" | "independent" | undefined;
176
- object?: string | undefined;
177
- hoverTooltip?: boolean | undefined;
178
- operation?: "self" | "router" | "blank" | undefined;
179
- }) | ({
180
- type: "request";
181
- value: {
182
- method: "head" | "options" | "get" | "delete" | "post" | "put" | "patch";
183
- url: string;
184
- } & {
185
- headers?: {
186
- [key: string]: unknown;
187
- } | undefined;
188
- body?: {
189
- [key: string]: unknown;
190
- } | undefined;
191
- onSend?: string | undefined;
192
- onSuccess?: string | undefined;
193
- onError?: string | undefined;
194
- };
195
- } & {} & {
196
- commandType?: "object" | "help" | "independent" | undefined;
197
- object?: string | undefined;
198
- hoverTooltip?: boolean | undefined;
199
- operation?: "self" | "router" | "blank" | undefined;
200
- }) | ({
201
- type: "appcues";
202
- value: string;
203
- } & {} & {
204
- commandType?: "object" | "help" | "independent" | undefined;
205
- object?: string | undefined;
206
- hoverTooltip?: boolean | undefined;
207
- operation?: "self" | "router" | "blank" | undefined;
208
- }) | ({
209
- type: "video";
210
- value: string;
211
- } & {} & {
212
- commandType?: "object" | "help" | "independent" | undefined;
213
- object?: string | undefined;
214
- hoverTooltip?: boolean | undefined;
215
- operation?: "self" | "router" | "blank" | undefined;
216
- }) | ({
217
- type: "helpdoc";
218
- value: string;
219
- } & {} & {
220
- commandType?: "object" | "help" | "independent" | undefined;
221
- object?: string | undefined;
222
- hoverTooltip?: boolean | undefined;
223
- operation?: "self" | "router" | "blank" | undefined;
224
- });
225
- } & {
226
- disabledReason?: string | undefined;
227
- source?: string | undefined;
228
- name?: string | undefined;
229
- last_available?: string | null | undefined;
230
- modified?: string | undefined;
231
- isAsync?: boolean | undefined;
232
- } & {
233
- arguments: {
234
- [x: string]: ({
235
- type: "context";
236
- value: string;
237
- order_key: number;
238
- } & {
239
- label?: string | undefined;
240
- chosen?: string | number | undefined;
241
- selected?: any[] | undefined;
242
- input_type?: string | undefined;
243
- preselected_key?: string | undefined;
244
- label_field?: string | undefined;
245
- availability_condition?: {
246
- field: string;
247
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
248
- value: string | undefined;
249
- }[] | undefined;
250
- loaded?: any[] | undefined;
251
- allow_create?: boolean | undefined;
252
- allow_create_label?: string | undefined;
253
- show_in_record_action_list?: boolean | undefined;
254
- show_in_default_list?: boolean | undefined;
255
- auto_choose?: boolean | undefined;
256
- is_private?: boolean | undefined;
257
- }) | ({
258
- type: "set";
259
- value: string[] | number[] | {
260
- [key: string]: unknown;
261
- }[];
262
- order_key: number;
263
- } & {
264
- label?: string | undefined;
265
- chosen?: string | number | undefined;
266
- selected?: any[] | undefined;
267
- input_type?: string | undefined;
268
- preselected_key?: string | undefined;
269
- label_field?: string | undefined;
270
- availability_condition?: {
271
- field: string;
272
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
273
- value: string | undefined;
274
- }[] | undefined;
275
- loaded?: any[] | undefined;
276
- allow_create?: boolean | undefined;
277
- allow_create_label?: string | undefined;
278
- auto_choose?: boolean | undefined;
279
- is_private?: boolean | undefined;
280
- }) | ({
281
- type: "provided";
282
- value: "time" | "text";
283
- order_key: number;
284
- } & {
285
- label?: string | undefined;
286
- chosen?: string | number | undefined;
287
- selected?: any[] | undefined;
288
- input_type?: string | undefined;
289
- preselected_key?: string | undefined;
290
- label_field?: string | undefined;
291
- availability_condition?: {
292
- field: string;
293
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
294
- value: string | undefined;
295
- }[] | undefined;
296
- loaded?: any[] | undefined;
297
- dateTimeArgumentTypeId?: number | undefined;
298
- allow_create?: boolean | undefined;
299
- allow_create_label?: string | undefined;
300
- auto_choose?: boolean | undefined;
301
- is_private?: boolean | undefined;
302
- }) | ({
303
- type: "dependent";
304
- value: string;
305
- order_key: number;
306
- } & {
307
- label?: string | undefined;
308
- chosen?: string | number | undefined;
309
- selected?: any[] | undefined;
310
- input_type?: string | undefined;
311
- preselected_key?: string | undefined;
312
- label_field?: string | undefined;
313
- availability_condition?: {
314
- field: string;
315
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
316
- value: string | undefined;
317
- }[] | undefined;
318
- loaded?: any[] | undefined;
319
- allow_create?: boolean | undefined;
320
- allow_create_label?: string | undefined;
321
- auto_choose?: boolean | undefined;
322
- is_private?: boolean | undefined;
323
- }) | ({
324
- type: "function";
325
- value: string;
326
- order_key: number;
327
- } & {
328
- label?: string | undefined;
329
- chosen?: string | number | undefined;
330
- selected?: any[] | undefined;
331
- input_type?: string | undefined;
332
- preselected_key?: string | undefined;
333
- label_field?: string | undefined;
334
- availability_condition?: {
335
- field: string;
336
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
337
- value: string | undefined;
338
- }[] | undefined;
339
- loaded?: any[] | undefined;
340
- allow_create?: boolean | undefined;
341
- allow_create_label?: string | undefined;
342
- auto_choose?: boolean | undefined;
343
- is_private?: boolean | undefined;
344
- }) | ({
345
- type: "html" | "video";
346
- value: {
347
- source: string;
348
- } & {
349
- title?: string | undefined;
350
- description?: string | undefined;
351
- url?: string | undefined;
352
- };
353
- order_key: number;
354
- } & {
355
- label?: string | undefined;
356
- chosen?: string | number | undefined;
357
- selected?: any[] | undefined;
358
- input_type?: string | undefined;
359
- preselected_key?: string | undefined;
360
- label_field?: string | undefined;
361
- availability_condition?: {
362
- field: string;
363
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
364
- value: string | undefined;
365
- }[] | undefined;
366
- loaded?: any[] | undefined;
367
- allow_create?: boolean | undefined;
368
- allow_create_label?: string | undefined;
369
- is_private?: boolean | undefined;
370
- auto_choose?: boolean | undefined;
371
- });
372
- };
373
- tags: string[];
374
- availability_rules: ({
375
- type: "url" | "element" | "context";
376
- operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
377
- } & {
378
- field?: string | undefined;
379
- value?: string | undefined;
380
- reason?: string | undefined;
381
- })[];
382
- recommend_rules: (({
383
- type: "url" | "element" | "context";
384
- operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
385
- } & {
386
- field?: string | undefined;
387
- value?: string | undefined;
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;
396
- }))[];
397
- availability_expression: import("./helpers/rules").RuleExpression | null;
398
- recommend_expression: import("./helpers/rules").RuleExpression | null;
399
- always_recommend: boolean;
400
- confirm: string;
401
- shortcut: string[];
402
- explanation: string;
403
- heading: string;
404
- is_live: boolean;
405
- category: number | null;
406
- sort_key: number | null;
407
- icon: string | null;
408
- image: string | null;
409
- celebrate: boolean | {
410
- angle?: number | undefined;
411
- spread?: number | undefined;
412
- width?: string | undefined;
413
- height?: string | undefined;
414
- duration?: number | undefined;
415
- dragFriction?: number | undefined;
416
- stagger?: number | undefined;
417
- startVelocity?: number | undefined;
418
- elementCount?: number | undefined;
419
- decay?: number | undefined;
420
- colors?: string[] | undefined;
421
- random?: any;
422
- } | null;
423
- recommend_sort_key: number | null;
424
- shortcut_mac: string[];
425
- shortcut_win: string[];
426
- hotkey_mac: string;
427
- hotkey_win: string;
428
- detail: string | ({
429
- type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
430
- value: string;
431
- } & {
432
- position?: "inline" | "popover" | undefined;
433
- }) | (string | ({
434
- type: "html" | "video" | "plaintext" | "markdown" | "react" | "component";
435
- value: string;
436
- } & {
437
- position?: "inline" | "popover" | undefined;
438
- }))[] | null;
439
- next_steps: (string | number)[];
440
- } & {
441
- third_party_source?: string | null | undefined;
442
- third_party_id?: string | null | undefined;
443
- };
133
+ export declare const isCommand: (command?: ICommandType | any) => command is ICommandType;
444
134
  export declare const isResource: (option: any) => option is IResourceType;
445
- export declare const isContextArgument: (argument: IArgumentType) => argument is {
446
- type: "context";
447
- value: string;
448
- order_key: number;
449
- } & {
450
- label?: string | undefined;
451
- chosen?: string | number | undefined;
452
- selected?: any[] | undefined;
453
- input_type?: string | undefined;
454
- preselected_key?: string | undefined;
455
- label_field?: string | undefined;
456
- availability_condition?: {
457
- field: string;
458
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
459
- value: string | undefined;
460
- }[] | undefined;
461
- loaded?: any[] | undefined;
462
- allow_create?: boolean | undefined;
463
- allow_create_label?: string | undefined;
464
- show_in_record_action_list?: boolean | undefined;
465
- show_in_default_list?: boolean | undefined;
466
- auto_choose?: boolean | undefined;
467
- is_private?: boolean | undefined;
468
- };
469
- export declare const isTimeArgument: (argument: IArgumentType) => argument is {
470
- type: "provided";
471
- value: "time" | "text";
472
- order_key: number;
473
- } & {
474
- label?: string | undefined;
475
- chosen?: string | number | undefined;
476
- selected?: any[] | undefined;
477
- input_type?: string | undefined;
478
- preselected_key?: string | undefined;
479
- label_field?: string | undefined;
480
- availability_condition?: {
481
- field: string;
482
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
483
- value: string | undefined;
484
- }[] | undefined;
485
- loaded?: any[] | undefined;
486
- dateTimeArgumentTypeId?: number | undefined;
487
- allow_create?: boolean | undefined;
488
- allow_create_label?: string | undefined;
489
- auto_choose?: boolean | undefined;
490
- is_private?: boolean | undefined;
491
- };
492
- export declare const isFunctionArgument: (argument: IArgumentType) => argument is {
493
- type: "function";
494
- value: string;
495
- order_key: number;
496
- } & {
497
- label?: string | undefined;
498
- chosen?: string | number | undefined;
499
- selected?: any[] | undefined;
500
- input_type?: string | undefined;
501
- preselected_key?: string | undefined;
502
- label_field?: string | undefined;
503
- availability_condition?: {
504
- field: string;
505
- operator: "==" | "!=" | "isTruthy" | "isFalsy";
506
- value: string | undefined;
507
- }[] | undefined;
508
- loaded?: any[] | undefined;
509
- allow_create?: boolean | undefined;
510
- allow_create_label?: string | undefined;
511
- auto_choose?: boolean | undefined;
512
- is_private?: boolean | undefined;
513
- };
135
+ export declare const isContextArgument: (argument: IArgumentType) => argument is IContextArgumentType;
136
+ export declare const isTimeArgument: (argument: IArgumentType) => argument is IDynamicArgumentType;
137
+ export declare const isFunctionArgument: (argument: IArgumentType) => argument is IFunctionArgumentType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commandbar",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
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",
@@ -20,11 +20,12 @@
20
20
  "dependencies": {
21
21
  "commandbar-launcher": "^1.1.9",
22
22
  "fp-ts": "2.10.5",
23
- "io-ts": "2.2.13"
23
+ "io-ts": "^2.2.14",
24
+ "react-hot-toast": "^2.3.0"
24
25
  },
25
26
  "devDependencies": {
26
27
  "rimraf": "3.0.2",
27
28
  "typescript": "4.6.2",
28
- "webpack": "5.74.0"
29
+ "webpack": "^5.74.0"
29
30
  }
30
31
  }
package/src/init.ts CHANGED
@@ -3,14 +3,7 @@ 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 { IConfigEndpointResponse } from '../../internal/src/middleware/types';
7
-
8
- interface IInitOptions {
9
- debug?: boolean;
10
- environment?: string;
11
- version?: string;
12
- config?: IConfigEndpointResponse;
13
- }
6
+ import { IInitOptions } from '../../internal/src/middleware/types';
14
7
 
15
8
  const getSrc = (org: string) => {
16
9
  let origin = 'https://api.commandbar.com';
package/src/snippet.ts CHANGED
@@ -46,7 +46,7 @@ export const snippet = (org: string) => {
46
46
  w.CommandBar,
47
47
  );
48
48
 
49
- const ASYNC_METHODS = ['addCommand', 'boot', 'addEventSubscriber'];
49
+ const ASYNC_METHODS_SNIPPET = ['addCommand', 'boot', 'addEventSubscriber', 'addRecordAction', 'setFormFactor'];
50
50
 
51
51
  const sdk = proxy;
52
52
 
@@ -58,7 +58,7 @@ export const snippet = (org: string) => {
58
58
  w.CommandBar = new Proxy(proxy, {
59
59
  get: function (_, prop) {
60
60
  if (prop in sdk) return proxy[prop];
61
- if (ASYNC_METHODS.includes(prop as string)) {
61
+ if (ASYNC_METHODS_SNIPPET.includes(prop as string)) {
62
62
  return function () {
63
63
  // eslint-disable-next-line prefer-rest-params
64
64
  const a = Array.prototype.slice.call(arguments);
package/webpack.config.js CHANGED
@@ -1,4 +1,5 @@
1
1
  const path = require('path');
2
+ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
2
3
 
3
4
  module.exports = {
4
5
  mode: 'production',
@@ -27,4 +28,8 @@ module.exports = {
27
28
  extensions: ['.ts', '.js', '.json', '.tsx'],
28
29
  },
29
30
  stats: 'minimal',
31
+ plugins: [process.env.ENABLE_STATSFILE_GENERATION && new BundleAnalyzerPlugin({
32
+ analyzerMode: 'disabled',
33
+ generateStatsFile: true
34
+ })].filter(Boolean),
30
35
  };