commandbar 1.6.16 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,8 +21,9 @@ export declare const NudgeV: t.IntersectionC<[t.TypeC<{
21
21
  }>;
22
22
  timeout_ms: t.UnionC<[t.NumberC, t.NullC]>;
23
23
  frequency_limit: t.UnionC<[t.LiteralC<"no_limit">, t.LiteralC<"once_per_session">, t.LiteralC<"once_per_user">]>;
24
+ }>, t.PartialC<{
24
25
  is_live: t.BooleanC;
25
- }>, t.PartialC<{}>]>;
26
+ }>]>;
26
27
  export declare class Nudge {
27
28
  static decode: (data: any) => {
28
29
  id: number;
@@ -46,8 +47,9 @@ export declare class Nudge {
46
47
  };
47
48
  timeout_ms: number | null;
48
49
  frequency_limit: "no_limit" | "once_per_session" | "once_per_user";
49
- is_live: boolean;
50
- } & {};
50
+ } & {
51
+ is_live?: boolean | undefined;
52
+ };
51
53
  static create: (object: {
52
54
  id: number;
53
55
  organization: string;
@@ -70,8 +72,9 @@ export declare class Nudge {
70
72
  };
71
73
  timeout_ms: number | null;
72
74
  frequency_limit: "no_limit" | "once_per_session" | "once_per_user";
73
- is_live: boolean;
74
- } & {}, onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<{
75
+ } & {
76
+ is_live?: boolean | undefined;
77
+ }, onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<{
75
78
  id: number;
76
79
  organization: string;
77
80
  slug: string;
@@ -93,8 +96,9 @@ export declare class Nudge {
93
96
  };
94
97
  timeout_ms: number | null;
95
98
  frequency_limit: "no_limit" | "once_per_session" | "once_per_user";
96
- is_live: boolean;
97
- } & {}>;
99
+ } & {
100
+ is_live?: boolean | undefined;
101
+ }>;
98
102
  static update: (object: {
99
103
  id: number;
100
104
  organization: string;
@@ -117,8 +121,9 @@ export declare class Nudge {
117
121
  };
118
122
  timeout_ms: number | null;
119
123
  frequency_limit: "no_limit" | "once_per_session" | "once_per_user";
120
- is_live: boolean;
121
- } & {}, onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<{
124
+ } & {
125
+ is_live?: boolean | undefined;
126
+ }, onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<{
122
127
  id: number;
123
128
  organization: string;
124
129
  slug: string;
@@ -140,8 +145,9 @@ export declare class Nudge {
140
145
  };
141
146
  timeout_ms: number | null;
142
147
  frequency_limit: "no_limit" | "once_per_session" | "once_per_user";
143
- is_live: boolean;
144
- } & {}>;
148
+ } & {
149
+ is_live?: boolean | undefined;
150
+ }>;
145
151
  static delete: (id: string | number, onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<void>;
146
152
  static list: (onSuccess?: (() => void) | undefined, onError?: ((err: string) => void) | undefined) => Promise<({
147
153
  id: number;
@@ -165,8 +171,9 @@ export declare class Nudge {
165
171
  };
166
172
  timeout_ms: number | null;
167
173
  frequency_limit: "no_limit" | "once_per_session" | "once_per_user";
168
- is_live: boolean;
169
- } & {})[]>;
174
+ } & {
175
+ is_live?: boolean | undefined;
176
+ })[]>;
170
177
  static read: (arg0: string, params?: Record<string, string> | undefined, callbacks?: {
171
178
  onSuccess?: (() => void) | undefined;
172
179
  onError?: ((err: string) => void) | undefined;
@@ -192,6 +199,7 @@ export declare class Nudge {
192
199
  };
193
200
  timeout_ms: number | null;
194
201
  frequency_limit: "no_limit" | "once_per_session" | "once_per_user";
195
- is_live: boolean;
196
- } & {}>;
202
+ } & {
203
+ is_live?: boolean | undefined;
204
+ }>;
197
205
  }
@@ -299,7 +299,7 @@ export declare class Organization {
299
299
  type: "admin";
300
300
  value: string;
301
301
  } & {} & {
302
- commandType?: "object" | "independent" | "help" | undefined;
302
+ commandType?: "object" | "help" | "independent" | undefined;
303
303
  object?: string | undefined;
304
304
  hoverTooltip?: boolean | undefined;
305
305
  operation?: "self" | "router" | "blank" | undefined;
@@ -307,7 +307,7 @@ export declare class Organization {
307
307
  type: "callback";
308
308
  value: string;
309
309
  } & {} & {
310
- commandType?: "object" | "independent" | "help" | undefined;
310
+ commandType?: "object" | "help" | "independent" | undefined;
311
311
  object?: string | undefined;
312
312
  hoverTooltip?: boolean | undefined;
313
313
  operation?: "self" | "router" | "blank" | undefined;
@@ -315,7 +315,7 @@ export declare class Organization {
315
315
  type: "link";
316
316
  value: string;
317
317
  } & {} & {
318
- commandType?: "object" | "independent" | "help" | undefined;
318
+ commandType?: "object" | "help" | "independent" | undefined;
319
319
  object?: string | undefined;
320
320
  hoverTooltip?: boolean | undefined;
321
321
  operation?: "self" | "router" | "blank" | undefined;
@@ -323,7 +323,7 @@ export declare class Organization {
323
323
  type: "click" | "clickByXpath" | "clickBySelector";
324
324
  value: string[];
325
325
  } & {} & {
326
- commandType?: "object" | "independent" | "help" | undefined;
326
+ commandType?: "object" | "help" | "independent" | undefined;
327
327
  object?: string | undefined;
328
328
  hoverTooltip?: boolean | undefined;
329
329
  operation?: "self" | "router" | "blank" | undefined;
@@ -331,7 +331,7 @@ export declare class Organization {
331
331
  type: "builtin";
332
332
  value: string;
333
333
  } & {} & {
334
- commandType?: "object" | "independent" | "help" | undefined;
334
+ commandType?: "object" | "help" | "independent" | undefined;
335
335
  object?: string | undefined;
336
336
  hoverTooltip?: boolean | undefined;
337
337
  operation?: "self" | "router" | "blank" | undefined;
@@ -339,7 +339,7 @@ export declare class Organization {
339
339
  type: "webhook";
340
340
  value: string;
341
341
  } & {} & {
342
- commandType?: "object" | "independent" | "help" | undefined;
342
+ commandType?: "object" | "help" | "independent" | undefined;
343
343
  object?: string | undefined;
344
344
  hoverTooltip?: boolean | undefined;
345
345
  operation?: "self" | "router" | "blank" | undefined;
@@ -347,7 +347,7 @@ export declare class Organization {
347
347
  type: "script";
348
348
  value: string;
349
349
  } & {} & {
350
- commandType?: "object" | "independent" | "help" | undefined;
350
+ commandType?: "object" | "help" | "independent" | undefined;
351
351
  object?: string | undefined;
352
352
  hoverTooltip?: boolean | undefined;
353
353
  operation?: "self" | "router" | "blank" | undefined;
@@ -368,7 +368,7 @@ export declare class Organization {
368
368
  onError?: string | undefined;
369
369
  };
370
370
  } & {} & {
371
- commandType?: "object" | "independent" | "help" | undefined;
371
+ commandType?: "object" | "help" | "independent" | undefined;
372
372
  object?: string | undefined;
373
373
  hoverTooltip?: boolean | undefined;
374
374
  operation?: "self" | "router" | "blank" | undefined;
@@ -376,7 +376,7 @@ export declare class Organization {
376
376
  type: "appcues";
377
377
  value: string;
378
378
  } & {} & {
379
- commandType?: "object" | "independent" | "help" | undefined;
379
+ commandType?: "object" | "help" | "independent" | undefined;
380
380
  object?: string | undefined;
381
381
  hoverTooltip?: boolean | undefined;
382
382
  operation?: "self" | "router" | "blank" | undefined;
@@ -384,7 +384,7 @@ export declare class Organization {
384
384
  type: "video";
385
385
  value: string;
386
386
  } & {} & {
387
- commandType?: "object" | "independent" | "help" | undefined;
387
+ commandType?: "object" | "help" | "independent" | undefined;
388
388
  object?: string | undefined;
389
389
  hoverTooltip?: boolean | undefined;
390
390
  operation?: "self" | "router" | "blank" | undefined;
@@ -392,7 +392,7 @@ export declare class Organization {
392
392
  type: "helpdoc";
393
393
  value: string;
394
394
  } & {} & {
395
- commandType?: "object" | "independent" | "help" | undefined;
395
+ commandType?: "object" | "help" | "independent" | undefined;
396
396
  object?: string | undefined;
397
397
  hoverTooltip?: boolean | undefined;
398
398
  operation?: "self" | "router" | "blank" | undefined;
@@ -547,14 +547,14 @@ export declare class Organization {
547
547
  };
548
548
  tags: string[];
549
549
  availability_rules: ({
550
- type: "url" | "context" | "element";
550
+ type: "url" | "element" | "context";
551
551
  operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
552
552
  } & {
553
553
  field?: string | undefined;
554
554
  value?: string | undefined;
555
555
  reason?: string | undefined;
556
556
  })[] | (({
557
- type: "url" | "context" | "element";
557
+ type: "url" | "element" | "context";
558
558
  operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
559
559
  } & {
560
560
  field?: string | undefined;
@@ -567,7 +567,7 @@ export declare class Organization {
567
567
  reason?: string | undefined;
568
568
  }))[];
569
569
  recommend_rules: (({
570
- type: "url" | "context" | "element";
570
+ type: "url" | "element" | "context";
571
571
  operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
572
572
  } & {
573
573
  field?: string | undefined;
@@ -581,7 +581,7 @@ export declare class Organization {
581
581
  value?: null | undefined;
582
582
  reason?: null | undefined;
583
583
  }))[] | (({
584
- type: "url" | "context" | "element";
584
+ type: "url" | "element" | "context";
585
585
  operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
586
586
  } & {
587
587
  field?: string | undefined;
@@ -124,7 +124,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
124
124
  type: "admin";
125
125
  value: string;
126
126
  } & {} & {
127
- commandType?: "object" | "independent" | "help" | undefined;
127
+ commandType?: "object" | "help" | "independent" | undefined;
128
128
  object?: string | undefined;
129
129
  hoverTooltip?: boolean | undefined;
130
130
  operation?: "self" | "router" | "blank" | undefined;
@@ -132,7 +132,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
132
132
  type: "callback";
133
133
  value: string;
134
134
  } & {} & {
135
- commandType?: "object" | "independent" | "help" | undefined;
135
+ commandType?: "object" | "help" | "independent" | undefined;
136
136
  object?: string | undefined;
137
137
  hoverTooltip?: boolean | undefined;
138
138
  operation?: "self" | "router" | "blank" | undefined;
@@ -140,7 +140,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
140
140
  type: "link";
141
141
  value: string;
142
142
  } & {} & {
143
- commandType?: "object" | "independent" | "help" | undefined;
143
+ commandType?: "object" | "help" | "independent" | undefined;
144
144
  object?: string | undefined;
145
145
  hoverTooltip?: boolean | undefined;
146
146
  operation?: "self" | "router" | "blank" | undefined;
@@ -148,7 +148,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
148
148
  type: "click" | "clickByXpath" | "clickBySelector";
149
149
  value: string[];
150
150
  } & {} & {
151
- commandType?: "object" | "independent" | "help" | undefined;
151
+ commandType?: "object" | "help" | "independent" | undefined;
152
152
  object?: string | undefined;
153
153
  hoverTooltip?: boolean | undefined;
154
154
  operation?: "self" | "router" | "blank" | undefined;
@@ -156,7 +156,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
156
156
  type: "builtin";
157
157
  value: string;
158
158
  } & {} & {
159
- commandType?: "object" | "independent" | "help" | undefined;
159
+ commandType?: "object" | "help" | "independent" | undefined;
160
160
  object?: string | undefined;
161
161
  hoverTooltip?: boolean | undefined;
162
162
  operation?: "self" | "router" | "blank" | undefined;
@@ -164,7 +164,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
164
164
  type: "webhook";
165
165
  value: string;
166
166
  } & {} & {
167
- commandType?: "object" | "independent" | "help" | undefined;
167
+ commandType?: "object" | "help" | "independent" | undefined;
168
168
  object?: string | undefined;
169
169
  hoverTooltip?: boolean | undefined;
170
170
  operation?: "self" | "router" | "blank" | undefined;
@@ -172,7 +172,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
172
172
  type: "script";
173
173
  value: string;
174
174
  } & {} & {
175
- commandType?: "object" | "independent" | "help" | undefined;
175
+ commandType?: "object" | "help" | "independent" | undefined;
176
176
  object?: string | undefined;
177
177
  hoverTooltip?: boolean | undefined;
178
178
  operation?: "self" | "router" | "blank" | undefined;
@@ -193,7 +193,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
193
193
  onError?: string | undefined;
194
194
  };
195
195
  } & {} & {
196
- commandType?: "object" | "independent" | "help" | undefined;
196
+ commandType?: "object" | "help" | "independent" | undefined;
197
197
  object?: string | undefined;
198
198
  hoverTooltip?: boolean | undefined;
199
199
  operation?: "self" | "router" | "blank" | undefined;
@@ -201,7 +201,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
201
201
  type: "appcues";
202
202
  value: string;
203
203
  } & {} & {
204
- commandType?: "object" | "independent" | "help" | undefined;
204
+ commandType?: "object" | "help" | "independent" | undefined;
205
205
  object?: string | undefined;
206
206
  hoverTooltip?: boolean | undefined;
207
207
  operation?: "self" | "router" | "blank" | undefined;
@@ -209,7 +209,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
209
209
  type: "video";
210
210
  value: string;
211
211
  } & {} & {
212
- commandType?: "object" | "independent" | "help" | undefined;
212
+ commandType?: "object" | "help" | "independent" | undefined;
213
213
  object?: string | undefined;
214
214
  hoverTooltip?: boolean | undefined;
215
215
  operation?: "self" | "router" | "blank" | undefined;
@@ -217,7 +217,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
217
217
  type: "helpdoc";
218
218
  value: string;
219
219
  } & {} & {
220
- commandType?: "object" | "independent" | "help" | undefined;
220
+ commandType?: "object" | "help" | "independent" | undefined;
221
221
  object?: string | undefined;
222
222
  hoverTooltip?: boolean | undefined;
223
223
  operation?: "self" | "router" | "blank" | undefined;
@@ -372,7 +372,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
372
372
  };
373
373
  tags: string[];
374
374
  availability_rules: ({
375
- type: "url" | "context" | "element";
375
+ type: "url" | "element" | "context";
376
376
  operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
377
377
  } & {
378
378
  field?: string | undefined;
@@ -380,7 +380,7 @@ export declare const isCommand: (command?: ICommandType | any) => command is {
380
380
  reason?: string | undefined;
381
381
  })[];
382
382
  recommend_rules: (({
383
- type: "url" | "context" | "element";
383
+ type: "url" | "element" | "context";
384
384
  operator: "includes" | "endsWith" | "startsWith" | "is" | "isTruthy" | "isFalsy" | "isNot" | "isTrue" | "isFalse" | "doesNotInclude" | "matchesRegex" | "isGreaterThan" | "isLessThan" | "isDefined" | "isNotDefined" | "classnameOnPage" | "idOnPage";
385
385
  } & {
386
386
  field?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commandbar",
3
- "version": "1.6.16",
3
+ "version": "1.7.0",
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",
@@ -18,9 +18,13 @@
18
18
  "author": "",
19
19
  "license": "ISC",
20
20
  "dependencies": {
21
+ "commandbar-launcher": "^1.1.9",
21
22
  "fp-ts": "2.10.5",
22
23
  "io-ts": "2.2.13"
23
24
  },
24
- "devDependencies": {},
25
- "peerDependencies": {}
25
+ "devDependencies": {
26
+ "rimraf": "3.0.2",
27
+ "typescript": "4.6.2",
28
+ "webpack": "5.74.0"
29
+ }
26
30
  }
@@ -0,0 +1,7 @@
1
+ declare module 'commandbar-launcher' {
2
+ import { CSSProperties, FC } from 'react';
3
+
4
+ export const getControlKey: () => string;
5
+ const Launcher: FC<{ text: string; style: CSSProperties }>;
6
+ export default Launcher;
7
+ }
package/src/index.ts CHANGED
@@ -1,9 +1,11 @@
1
+ import Launcher, { getControlKey } from 'commandbar-launcher';
1
2
  import { CommandBarClientSDK } from '../../internal/src/client/CommandBarClientSDK';
2
3
 
3
4
  export { default as init } from './init';
4
5
  export { initProxySDK as initProxy } from '../../internal/src/client/proxy';
5
6
  export { snippet } from './snippet';
6
7
  export { CommandBarClientSDK };
8
+ export { Launcher, getControlKey };
7
9
 
8
10
  declare global {
9
11
  interface Window {
package/src/snippet.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  /* eslint-disable no-template-curly-in-string */
2
2
  /* eslint-disable prefer-rest-params */
3
+
4
+ import { _eventSubscriptions } from '../../internal/src/client/symbols';
5
+
3
6
  /* eslint-disable @typescript-eslint/no-inferrable-types */
4
7
  export const snippet = (org: string) => {
5
8
  const polyfills = ['Object.assign', 'Symbol', 'Symbol.for'].join('%2C');
@@ -38,11 +41,12 @@ export const snippet = (org: string) => {
38
41
  [_isProxy]: true,
39
42
  [_queue]: new Array<unknown>(),
40
43
  [_unwrap]: () => proxy,
44
+ [_eventSubscriptions]: undefined,
41
45
  },
42
46
  w.CommandBar,
43
47
  );
44
48
 
45
- const ASYNC_METHODS = ['addCommand', 'boot'];
49
+ const ASYNC_METHODS = ['addCommand', 'boot', 'addEventSubscriber'];
46
50
 
47
51
  const sdk = proxy;
48
52