@gleanwork/api-client 0.2.0 → 0.3.0

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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -10
  3. package/dist/commonjs/__tests__/adminsearch.test.js +1783 -12
  4. package/dist/commonjs/__tests__/adminsearch.test.js.map +1 -1
  5. package/dist/commonjs/__tests__/announcements.test.js +3922 -2
  6. package/dist/commonjs/__tests__/announcements.test.js.map +1 -1
  7. package/dist/commonjs/__tests__/answers.test.js +1315 -30
  8. package/dist/commonjs/__tests__/answers.test.js.map +1 -1
  9. package/dist/commonjs/__tests__/chat.test.js +19803 -1532
  10. package/dist/commonjs/__tests__/chat.test.js.map +1 -1
  11. package/dist/commonjs/__tests__/clientsearch.test.js +3850 -142
  12. package/dist/commonjs/__tests__/clientsearch.test.js.map +1 -1
  13. package/dist/commonjs/__tests__/clientshortcuts.test.js +1051 -8
  14. package/dist/commonjs/__tests__/clientshortcuts.test.js.map +1 -1
  15. package/dist/commonjs/__tests__/collections.test.js +1053 -8
  16. package/dist/commonjs/__tests__/collections.test.js.map +1 -1
  17. package/dist/commonjs/lib/config.d.ts +6 -6
  18. package/dist/commonjs/lib/config.d.ts.map +1 -1
  19. package/dist/commonjs/lib/config.js +5 -5
  20. package/dist/commonjs/lib/config.js.map +1 -1
  21. package/dist/esm/__tests__/adminsearch.test.js +1783 -12
  22. package/dist/esm/__tests__/adminsearch.test.js.map +1 -1
  23. package/dist/esm/__tests__/announcements.test.js +3922 -2
  24. package/dist/esm/__tests__/announcements.test.js.map +1 -1
  25. package/dist/esm/__tests__/answers.test.js +1315 -30
  26. package/dist/esm/__tests__/answers.test.js.map +1 -1
  27. package/dist/esm/__tests__/chat.test.js +19803 -1532
  28. package/dist/esm/__tests__/chat.test.js.map +1 -1
  29. package/dist/esm/__tests__/clientsearch.test.js +3850 -142
  30. package/dist/esm/__tests__/clientsearch.test.js.map +1 -1
  31. package/dist/esm/__tests__/clientshortcuts.test.js +1051 -8
  32. package/dist/esm/__tests__/clientshortcuts.test.js.map +1 -1
  33. package/dist/esm/__tests__/collections.test.js +1053 -8
  34. package/dist/esm/__tests__/collections.test.js.map +1 -1
  35. package/dist/esm/lib/config.d.ts +6 -6
  36. package/dist/esm/lib/config.d.ts.map +1 -1
  37. package/dist/esm/lib/config.js +5 -5
  38. package/dist/esm/lib/config.js.map +1 -1
  39. package/docs/sdks/announcements/README.md +7846 -4
  40. package/docs/sdks/answers/README.md +2910 -340
  41. package/docs/sdks/clientshortcuts/README.md +2120 -34
  42. package/docs/sdks/collections/README.md +2124 -34
  43. package/docs/sdks/search/README.md +11601 -643
  44. package/jsr.json +1 -1
  45. package/package.json +2 -1
  46. package/src/__tests__/adminsearch.test.ts +1790 -12
  47. package/src/__tests__/announcements.test.ts +3936 -2
  48. package/src/__tests__/answers.test.ts +1324 -30
  49. package/src/__tests__/chat.test.ts +20119 -1599
  50. package/src/__tests__/clientsearch.test.ts +3867 -146
  51. package/src/__tests__/clientshortcuts.test.ts +1061 -8
  52. package/src/__tests__/collections.test.ts +1062 -8
  53. package/src/lib/config.ts +7 -7
@@ -23,7 +23,328 @@ test("Client Shortcuts Createshortcut", async () => {
23
23
  person: {
24
24
  name: "George Clooney",
25
25
  obfuscatedId: "abc123",
26
- relatedDocuments: [],
26
+ relatedDocuments: [
27
+ {
28
+ querySuggestion: {
29
+ query: "app:github type:pull author:mortimer",
30
+ searchProviderInfo: {
31
+ name: "Google",
32
+ searchLinkUrlTemplate:
33
+ "https://www.google.com/search?q={query}&hl=en",
34
+ },
35
+ label: "Mortimer's PRs",
36
+ datasource: "github",
37
+ requestOptions: {
38
+ datasourceFilter: "JIRA",
39
+ datasourcesFilter: [
40
+ "JIRA",
41
+ ],
42
+ queryOverridesFacetFilters: true,
43
+ facetFilters: [
44
+ {
45
+ fieldName: "type",
46
+ values: [
47
+ {
48
+ value: "Spreadsheet",
49
+ relationType: "EQUALS",
50
+ },
51
+ {
52
+ value: "Presentation",
53
+ relationType: "EQUALS",
54
+ },
55
+ ],
56
+ },
57
+ ],
58
+ facetFilterSets: [
59
+ {
60
+ filters: [
61
+ {
62
+ fieldName: "type",
63
+ values: [
64
+ {
65
+ value: "Spreadsheet",
66
+ relationType: "EQUALS",
67
+ },
68
+ {
69
+ value: "Presentation",
70
+ relationType: "EQUALS",
71
+ },
72
+ ],
73
+ },
74
+ ],
75
+ },
76
+ {
77
+ filters: [
78
+ {
79
+ fieldName: "type",
80
+ values: [
81
+ {
82
+ value: "Spreadsheet",
83
+ relationType: "EQUALS",
84
+ },
85
+ {
86
+ value: "Presentation",
87
+ relationType: "EQUALS",
88
+ },
89
+ ],
90
+ },
91
+ ],
92
+ },
93
+ ],
94
+ facetBucketSize: 134365,
95
+ authTokens: [
96
+ {
97
+ accessToken: "123abc",
98
+ datasource: "gmail",
99
+ scope:
100
+ "email profile https://www.googleapis.com/auth/gmail.readonly",
101
+ tokenType: "Bearer",
102
+ authUser: "1",
103
+ },
104
+ ],
105
+ },
106
+ ranges: [
107
+ {
108
+ startIndex: 796474,
109
+ document: {
110
+ metadata: {
111
+ datasource: "datasource",
112
+ objectType: "Feature Request",
113
+ container: "container",
114
+ parentId: "JIRA_EN-1337",
115
+ mimeType: "mimeType",
116
+ documentId: "documentId",
117
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
118
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
119
+ components: [
120
+ "Backend",
121
+ "Networking",
122
+ ],
123
+ status: "[\"Done\"]",
124
+ pins: [
125
+ {
126
+ audienceFilters: [
127
+ {
128
+ fieldName: "type",
129
+ values: [
130
+ {
131
+ value: "Spreadsheet",
132
+ relationType: "EQUALS",
133
+ },
134
+ {
135
+ value: "Presentation",
136
+ relationType: "EQUALS",
137
+ },
138
+ ],
139
+ },
140
+ ],
141
+ documentId: "<id>",
142
+ },
143
+ {
144
+ audienceFilters: [
145
+ {
146
+ fieldName: "type",
147
+ values: [
148
+ {
149
+ value: "Spreadsheet",
150
+ relationType: "EQUALS",
151
+ },
152
+ {
153
+ value: "Presentation",
154
+ relationType: "EQUALS",
155
+ },
156
+ ],
157
+ },
158
+ ],
159
+ documentId: "<id>",
160
+ },
161
+ {
162
+ audienceFilters: [
163
+ {
164
+ fieldName: "type",
165
+ values: [
166
+ {
167
+ value: "Spreadsheet",
168
+ relationType: "EQUALS",
169
+ },
170
+ {
171
+ value: "Presentation",
172
+ relationType: "EQUALS",
173
+ },
174
+ ],
175
+ },
176
+ ],
177
+ documentId: "<id>",
178
+ },
179
+ ],
180
+ collections: [
181
+ {
182
+ name: "<value>",
183
+ description: "fumigate convection though zowie",
184
+ audienceFilters: [
185
+ {
186
+ fieldName: "type",
187
+ values: [
188
+ {
189
+ value: "Spreadsheet",
190
+ relationType: "EQUALS",
191
+ },
192
+ {
193
+ value: "Presentation",
194
+ relationType: "EQUALS",
195
+ },
196
+ ],
197
+ },
198
+ ],
199
+ id: 496323,
200
+ items: [
201
+ {
202
+ collectionId: 782367,
203
+ shortcut: {
204
+ inputAlias: "<value>",
205
+ },
206
+ itemType: "URL",
207
+ },
208
+ ],
209
+ },
210
+ ],
211
+ interactions: {
212
+ reacts: [
213
+ {},
214
+ {},
215
+ {},
216
+ ],
217
+ shares: [
218
+ {
219
+ numDaysAgo: 219974,
220
+ },
221
+ {
222
+ numDaysAgo: 449221,
223
+ },
224
+ {
225
+ numDaysAgo: 427887,
226
+ },
227
+ ],
228
+ },
229
+ verification: {
230
+ state: "VERIFIED",
231
+ metadata: {
232
+ reminders: [
233
+ {
234
+ assignee: {
235
+ name: "George Clooney",
236
+ obfuscatedId: "abc123",
237
+ },
238
+ remindAt: 491427,
239
+ },
240
+ ],
241
+ lastReminder: {
242
+ assignee: {
243
+ name: "George Clooney",
244
+ obfuscatedId: "abc123",
245
+ },
246
+ remindAt: 490420,
247
+ },
248
+ },
249
+ },
250
+ shortcuts: [
251
+ {
252
+ inputAlias: "<value>",
253
+ },
254
+ ],
255
+ customData: {
256
+ "someCustomField": {},
257
+ },
258
+ },
259
+ },
260
+ },
261
+ ],
262
+ inputDetails: {
263
+ hasCopyPaste: true,
264
+ },
265
+ },
266
+ results: [
267
+ {
268
+ title: "title",
269
+ url: "https://example.com/foo/bar",
270
+ nativeAppUrl: "slack://foo/bar",
271
+ snippets: [
272
+ {
273
+ snippet: "snippet",
274
+ mimeType: "mimeType",
275
+ },
276
+ ],
277
+ },
278
+ ],
279
+ },
280
+ {
281
+ querySuggestion: {
282
+ query: "app:github type:pull author:mortimer",
283
+ searchProviderInfo: {
284
+ name: "Google",
285
+ searchLinkUrlTemplate:
286
+ "https://www.google.com/search?q={query}&hl=en",
287
+ },
288
+ label: "Mortimer's PRs",
289
+ datasource: "github",
290
+ requestOptions: {
291
+ datasourceFilter: "JIRA",
292
+ datasourcesFilter: [
293
+ "JIRA",
294
+ ],
295
+ queryOverridesFacetFilters: true,
296
+ facetFilters: [
297
+ {
298
+ fieldName: "type",
299
+ values: [
300
+ {
301
+ value: "Spreadsheet",
302
+ relationType: "EQUALS",
303
+ },
304
+ {
305
+ value: "Presentation",
306
+ relationType: "EQUALS",
307
+ },
308
+ ],
309
+ },
310
+ ],
311
+ facetFilterSets: [
312
+ {
313
+ filters: [
314
+ {
315
+ fieldName: "type",
316
+ values: [
317
+ {
318
+ value: "Spreadsheet",
319
+ relationType: "EQUALS",
320
+ },
321
+ {
322
+ value: "Presentation",
323
+ relationType: "EQUALS",
324
+ },
325
+ ],
326
+ },
327
+ ],
328
+ },
329
+ ],
330
+ facetBucketSize: 129663,
331
+ authTokens: [
332
+ {
333
+ accessToken: "123abc",
334
+ datasource: "gmail",
335
+ scope:
336
+ "email profile https://www.googleapis.com/auth/gmail.readonly",
337
+ tokenType: "Bearer",
338
+ authUser: "1",
339
+ },
340
+ ],
341
+ },
342
+ inputDetails: {
343
+ hasCopyPaste: true,
344
+ },
345
+ },
346
+ },
347
+ ],
27
348
  metadata: {
28
349
  type: "FULL_TIME",
29
350
  title: "Actor",
@@ -40,12 +361,32 @@ test("Client Shortcuts Createshortcut", async () => {
40
361
  },
41
362
  ],
42
363
  querySuggestions: {
43
- suggestions: [],
364
+ suggestions: [
365
+ {
366
+ query: "app:github type:pull author:mortimer",
367
+ label: "Mortimer's PRs",
368
+ datasource: "github",
369
+ },
370
+ ],
44
371
  },
45
372
  inviteInfo: {
46
- invites: [],
373
+ invites: [
374
+ {},
375
+ {},
376
+ ],
47
377
  },
48
- customFields: [],
378
+ customFields: [
379
+ {
380
+ label: "<value>",
381
+ values: [
382
+ {},
383
+ ],
384
+ },
385
+ {
386
+ label: "<value>",
387
+ values: [],
388
+ },
389
+ ],
49
390
  badges: [
50
391
  {
51
392
  key: "deployment_name_new_hire",
@@ -63,17 +404,161 @@ test("Client Shortcuts Createshortcut", async () => {
63
404
  role: "OWNER",
64
405
  },
65
406
  {
407
+ person: {
408
+ name: "George Clooney",
409
+ obfuscatedId: "abc123",
410
+ metadata: {
411
+ type: "FULL_TIME",
412
+ title: "Actor",
413
+ department: "Movies",
414
+ email: "george@example.com",
415
+ location: "Hollywood, CA",
416
+ phone: "6505551234",
417
+ photoUrl: "https://example.com/george.jpg",
418
+ startDate: new RFCDate("2000-01-23"),
419
+ datasourceProfile: [
420
+ {
421
+ datasource: "github",
422
+ handle: "<value>",
423
+ },
424
+ ],
425
+ querySuggestions: {},
426
+ inviteInfo: {},
427
+ badges: [
428
+ {
429
+ key: "deployment_name_new_hire",
430
+ displayName: "New hire",
431
+ iconConfig: {
432
+ color: "#343CED",
433
+ key: "person_icon",
434
+ iconType: "GLYPH",
435
+ name: "user",
436
+ },
437
+ },
438
+ ],
439
+ },
440
+ },
66
441
  role: "VERIFIER",
67
442
  },
68
443
  ],
69
444
  removedRoles: [
70
445
  {
446
+ person: {
447
+ name: "George Clooney",
448
+ obfuscatedId: "abc123",
449
+ metadata: {
450
+ type: "FULL_TIME",
451
+ title: "Actor",
452
+ department: "Movies",
453
+ email: "george@example.com",
454
+ location: "Hollywood, CA",
455
+ phone: "6505551234",
456
+ photoUrl: "https://example.com/george.jpg",
457
+ startDate: new RFCDate("2000-01-23"),
458
+ datasourceProfile: [
459
+ {
460
+ datasource: "github",
461
+ handle: "<value>",
462
+ },
463
+ ],
464
+ querySuggestions: {},
465
+ inviteInfo: {},
466
+ badges: [
467
+ {
468
+ key: "deployment_name_new_hire",
469
+ displayName: "New hire",
470
+ iconConfig: {
471
+ color: "#343CED",
472
+ key: "person_icon",
473
+ iconType: "GLYPH",
474
+ name: "user",
475
+ },
476
+ },
477
+ ],
478
+ },
479
+ },
71
480
  role: "VERIFIER",
72
481
  },
73
482
  {
483
+ person: {
484
+ name: "George Clooney",
485
+ obfuscatedId: "abc123",
486
+ metadata: {
487
+ type: "FULL_TIME",
488
+ title: "Actor",
489
+ department: "Movies",
490
+ email: "george@example.com",
491
+ location: "Hollywood, CA",
492
+ phone: "6505551234",
493
+ photoUrl: "https://example.com/george.jpg",
494
+ startDate: new RFCDate("2000-01-23"),
495
+ datasourceProfile: [
496
+ {
497
+ datasource: "github",
498
+ handle: "<value>",
499
+ },
500
+ {
501
+ datasource: "github",
502
+ handle: "<value>",
503
+ },
504
+ {
505
+ datasource: "github",
506
+ handle: "<value>",
507
+ },
508
+ ],
509
+ querySuggestions: {},
510
+ inviteInfo: {},
511
+ badges: [
512
+ {
513
+ key: "deployment_name_new_hire",
514
+ displayName: "New hire",
515
+ iconConfig: {
516
+ color: "#343CED",
517
+ key: "person_icon",
518
+ iconType: "GLYPH",
519
+ name: "user",
520
+ },
521
+ },
522
+ ],
523
+ },
524
+ },
74
525
  role: "ANSWER_MODERATOR",
75
526
  },
76
527
  {
528
+ person: {
529
+ name: "George Clooney",
530
+ obfuscatedId: "abc123",
531
+ metadata: {
532
+ type: "FULL_TIME",
533
+ title: "Actor",
534
+ department: "Movies",
535
+ email: "george@example.com",
536
+ location: "Hollywood, CA",
537
+ phone: "6505551234",
538
+ photoUrl: "https://example.com/george.jpg",
539
+ startDate: new RFCDate("2000-01-23"),
540
+ datasourceProfile: [
541
+ {
542
+ datasource: "github",
543
+ handle: "<value>",
544
+ },
545
+ ],
546
+ querySuggestions: {},
547
+ inviteInfo: {},
548
+ badges: [
549
+ {
550
+ key: "deployment_name_new_hire",
551
+ displayName: "New hire",
552
+ iconConfig: {
553
+ color: "#343CED",
554
+ key: "person_icon",
555
+ iconType: "GLYPH",
556
+ name: "user",
557
+ },
558
+ },
559
+ ],
560
+ },
561
+ },
77
562
  role: "OWNER",
78
563
  },
79
564
  ],
@@ -155,7 +640,397 @@ test("Client Shortcuts Updateshortcut", async () => {
155
640
  person: {
156
641
  name: "George Clooney",
157
642
  obfuscatedId: "abc123",
158
- relatedDocuments: [],
643
+ relatedDocuments: [
644
+ {
645
+ querySuggestion: {
646
+ query: "app:github type:pull author:mortimer",
647
+ searchProviderInfo: {
648
+ name: "Google",
649
+ searchLinkUrlTemplate:
650
+ "https://www.google.com/search?q={query}&hl=en",
651
+ },
652
+ label: "Mortimer's PRs",
653
+ datasource: "github",
654
+ requestOptions: {
655
+ datasourceFilter: "JIRA",
656
+ datasourcesFilter: [
657
+ "JIRA",
658
+ ],
659
+ queryOverridesFacetFilters: true,
660
+ facetFilters: [
661
+ {
662
+ fieldName: "type",
663
+ values: [
664
+ {
665
+ value: "Spreadsheet",
666
+ relationType: "EQUALS",
667
+ },
668
+ {
669
+ value: "Presentation",
670
+ relationType: "EQUALS",
671
+ },
672
+ ],
673
+ },
674
+ ],
675
+ facetFilterSets: [
676
+ {
677
+ filters: [
678
+ {
679
+ fieldName: "type",
680
+ values: [
681
+ {
682
+ value: "Spreadsheet",
683
+ relationType: "EQUALS",
684
+ },
685
+ {
686
+ value: "Presentation",
687
+ relationType: "EQUALS",
688
+ },
689
+ ],
690
+ },
691
+ ],
692
+ },
693
+ {
694
+ filters: [
695
+ {
696
+ fieldName: "type",
697
+ values: [
698
+ {
699
+ value: "Spreadsheet",
700
+ relationType: "EQUALS",
701
+ },
702
+ {
703
+ value: "Presentation",
704
+ relationType: "EQUALS",
705
+ },
706
+ ],
707
+ },
708
+ ],
709
+ },
710
+ {
711
+ filters: [
712
+ {
713
+ fieldName: "type",
714
+ values: [
715
+ {
716
+ value: "Spreadsheet",
717
+ relationType: "EQUALS",
718
+ },
719
+ {
720
+ value: "Presentation",
721
+ relationType: "EQUALS",
722
+ },
723
+ ],
724
+ },
725
+ ],
726
+ },
727
+ ],
728
+ facetBucketSize: 627690,
729
+ authTokens: [
730
+ {
731
+ accessToken: "123abc",
732
+ datasource: "gmail",
733
+ scope:
734
+ "email profile https://www.googleapis.com/auth/gmail.readonly",
735
+ tokenType: "Bearer",
736
+ authUser: "1",
737
+ },
738
+ ],
739
+ },
740
+ ranges: [
741
+ {
742
+ startIndex: 984008,
743
+ document: {
744
+ metadata: {
745
+ datasource: "datasource",
746
+ objectType: "Feature Request",
747
+ container: "container",
748
+ parentId: "JIRA_EN-1337",
749
+ mimeType: "mimeType",
750
+ documentId: "documentId",
751
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
752
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
753
+ components: [
754
+ "Backend",
755
+ "Networking",
756
+ ],
757
+ status: "[\"Done\"]",
758
+ pins: [
759
+ {
760
+ audienceFilters: [
761
+ {
762
+ fieldName: "type",
763
+ values: [
764
+ {
765
+ value: "Spreadsheet",
766
+ relationType: "EQUALS",
767
+ },
768
+ {
769
+ value: "Presentation",
770
+ relationType: "EQUALS",
771
+ },
772
+ ],
773
+ },
774
+ ],
775
+ documentId: "<id>",
776
+ },
777
+ ],
778
+ collections: [
779
+ {
780
+ name: "<value>",
781
+ description: "for drat underneath sticky yuck even",
782
+ audienceFilters: [
783
+ {
784
+ fieldName: "type",
785
+ values: [
786
+ {
787
+ value: "Spreadsheet",
788
+ relationType: "EQUALS",
789
+ },
790
+ {
791
+ value: "Presentation",
792
+ relationType: "EQUALS",
793
+ },
794
+ ],
795
+ },
796
+ ],
797
+ id: 996168,
798
+ items: [
799
+ {
800
+ collectionId: 392671,
801
+ shortcut: {
802
+ inputAlias: "<value>",
803
+ },
804
+ itemType: "TEXT",
805
+ },
806
+ {
807
+ collectionId: 845914,
808
+ shortcut: {
809
+ inputAlias: "<value>",
810
+ },
811
+ itemType: "URL",
812
+ },
813
+ ],
814
+ },
815
+ {
816
+ name: "<value>",
817
+ description:
818
+ "duh now mechanically during since anxiously lightly ultimately",
819
+ audienceFilters: [
820
+ {
821
+ fieldName: "type",
822
+ values: [
823
+ {
824
+ value: "Spreadsheet",
825
+ relationType: "EQUALS",
826
+ },
827
+ {
828
+ value: "Presentation",
829
+ relationType: "EQUALS",
830
+ },
831
+ ],
832
+ },
833
+ ],
834
+ id: 958595,
835
+ },
836
+ {
837
+ name: "<value>",
838
+ description:
839
+ "whereas anenst habit onto worriedly revoke hm eminent sham",
840
+ audienceFilters: [
841
+ {
842
+ fieldName: "type",
843
+ values: [
844
+ {
845
+ value: "Spreadsheet",
846
+ relationType: "EQUALS",
847
+ },
848
+ {
849
+ value: "Presentation",
850
+ relationType: "EQUALS",
851
+ },
852
+ ],
853
+ },
854
+ ],
855
+ id: 115263,
856
+ },
857
+ ],
858
+ interactions: {
859
+ reacts: [
860
+ {},
861
+ {},
862
+ {},
863
+ ],
864
+ shares: [
865
+ {
866
+ numDaysAgo: 691669,
867
+ },
868
+ {
869
+ numDaysAgo: 202116,
870
+ },
871
+ ],
872
+ },
873
+ verification: {
874
+ state: "UNVERIFIED",
875
+ metadata: {
876
+ reminders: [
877
+ {
878
+ assignee: {
879
+ name: "George Clooney",
880
+ obfuscatedId: "abc123",
881
+ },
882
+ remindAt: 246216,
883
+ },
884
+ ],
885
+ lastReminder: {
886
+ assignee: {
887
+ name: "George Clooney",
888
+ obfuscatedId: "abc123",
889
+ },
890
+ remindAt: 778241,
891
+ },
892
+ },
893
+ },
894
+ shortcuts: [
895
+ {
896
+ inputAlias: "<value>",
897
+ },
898
+ {
899
+ inputAlias: "<value>",
900
+ },
901
+ {
902
+ inputAlias: "<value>",
903
+ },
904
+ ],
905
+ customData: {
906
+ "someCustomField": {},
907
+ },
908
+ },
909
+ },
910
+ },
911
+ {
912
+ startIndex: 698908,
913
+ document: {
914
+ metadata: {
915
+ datasource: "datasource",
916
+ objectType: "Feature Request",
917
+ container: "container",
918
+ parentId: "JIRA_EN-1337",
919
+ mimeType: "mimeType",
920
+ documentId: "documentId",
921
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
922
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
923
+ components: [
924
+ "Backend",
925
+ "Networking",
926
+ ],
927
+ status: "[\"Done\"]",
928
+ interactions: {},
929
+ verification: {
930
+ state: "UNVERIFIED",
931
+ metadata: {
932
+ lastReminder: {
933
+ assignee: {
934
+ name: "George Clooney",
935
+ obfuscatedId: "abc123",
936
+ },
937
+ remindAt: 451776,
938
+ },
939
+ },
940
+ },
941
+ customData: {
942
+ "someCustomField": {},
943
+ },
944
+ },
945
+ },
946
+ },
947
+ ],
948
+ inputDetails: {
949
+ hasCopyPaste: true,
950
+ },
951
+ },
952
+ results: [
953
+ {
954
+ title: "title",
955
+ url: "https://example.com/foo/bar",
956
+ nativeAppUrl: "slack://foo/bar",
957
+ snippets: [
958
+ {
959
+ snippet: "snippet",
960
+ mimeType: "mimeType",
961
+ },
962
+ ],
963
+ },
964
+ ],
965
+ },
966
+ {
967
+ querySuggestion: {
968
+ query: "app:github type:pull author:mortimer",
969
+ searchProviderInfo: {
970
+ name: "Google",
971
+ searchLinkUrlTemplate:
972
+ "https://www.google.com/search?q={query}&hl=en",
973
+ },
974
+ label: "Mortimer's PRs",
975
+ datasource: "github",
976
+ requestOptions: {
977
+ datasourceFilter: "JIRA",
978
+ datasourcesFilter: [
979
+ "JIRA",
980
+ ],
981
+ queryOverridesFacetFilters: true,
982
+ facetFilters: [
983
+ {
984
+ fieldName: "type",
985
+ values: [
986
+ {
987
+ value: "Spreadsheet",
988
+ relationType: "EQUALS",
989
+ },
990
+ {
991
+ value: "Presentation",
992
+ relationType: "EQUALS",
993
+ },
994
+ ],
995
+ },
996
+ ],
997
+ facetFilterSets: [
998
+ {
999
+ filters: [
1000
+ {
1001
+ fieldName: "type",
1002
+ values: [
1003
+ {
1004
+ value: "Spreadsheet",
1005
+ relationType: "EQUALS",
1006
+ },
1007
+ {
1008
+ value: "Presentation",
1009
+ relationType: "EQUALS",
1010
+ },
1011
+ ],
1012
+ },
1013
+ ],
1014
+ },
1015
+ ],
1016
+ facetBucketSize: 158724,
1017
+ authTokens: [
1018
+ {
1019
+ accessToken: "123abc",
1020
+ datasource: "gmail",
1021
+ scope:
1022
+ "email profile https://www.googleapis.com/auth/gmail.readonly",
1023
+ tokenType: "Bearer",
1024
+ authUser: "1",
1025
+ },
1026
+ ],
1027
+ },
1028
+ inputDetails: {
1029
+ hasCopyPaste: true,
1030
+ },
1031
+ },
1032
+ },
1033
+ ],
159
1034
  metadata: {
160
1035
  type: "FULL_TIME",
161
1036
  title: "Actor",
@@ -180,12 +1055,34 @@ test("Client Shortcuts Updateshortcut", async () => {
180
1055
  },
181
1056
  ],
182
1057
  querySuggestions: {
183
- suggestions: [],
1058
+ suggestions: [
1059
+ {
1060
+ query: "app:github type:pull author:mortimer",
1061
+ label: "Mortimer's PRs",
1062
+ datasource: "github",
1063
+ },
1064
+ ],
184
1065
  },
185
1066
  inviteInfo: {
186
- invites: [],
1067
+ invites: [
1068
+ {},
1069
+ {},
1070
+ ],
187
1071
  },
188
- customFields: [],
1072
+ customFields: [
1073
+ {
1074
+ label: "<value>",
1075
+ values: [
1076
+ {},
1077
+ {},
1078
+ {},
1079
+ ],
1080
+ },
1081
+ {
1082
+ label: "<value>",
1083
+ values: [],
1084
+ },
1085
+ ],
189
1086
  badges: [
190
1087
  {
191
1088
  key: "deployment_name_new_hire",
@@ -203,17 +1100,173 @@ test("Client Shortcuts Updateshortcut", async () => {
203
1100
  role: "ANSWER_MODERATOR",
204
1101
  },
205
1102
  {
1103
+ person: {
1104
+ name: "George Clooney",
1105
+ obfuscatedId: "abc123",
1106
+ metadata: {
1107
+ type: "FULL_TIME",
1108
+ title: "Actor",
1109
+ department: "Movies",
1110
+ email: "george@example.com",
1111
+ location: "Hollywood, CA",
1112
+ phone: "6505551234",
1113
+ photoUrl: "https://example.com/george.jpg",
1114
+ startDate: new RFCDate("2000-01-23"),
1115
+ datasourceProfile: [
1116
+ {
1117
+ datasource: "github",
1118
+ handle: "<value>",
1119
+ },
1120
+ {
1121
+ datasource: "github",
1122
+ handle: "<value>",
1123
+ },
1124
+ {
1125
+ datasource: "github",
1126
+ handle: "<value>",
1127
+ },
1128
+ ],
1129
+ querySuggestions: {},
1130
+ inviteInfo: {},
1131
+ badges: [
1132
+ {
1133
+ key: "deployment_name_new_hire",
1134
+ displayName: "New hire",
1135
+ iconConfig: {
1136
+ color: "#343CED",
1137
+ key: "person_icon",
1138
+ iconType: "GLYPH",
1139
+ name: "user",
1140
+ },
1141
+ },
1142
+ ],
1143
+ },
1144
+ },
206
1145
  role: "EDITOR",
207
1146
  },
208
1147
  ],
209
1148
  removedRoles: [
210
1149
  {
1150
+ person: {
1151
+ name: "George Clooney",
1152
+ obfuscatedId: "abc123",
1153
+ metadata: {
1154
+ type: "FULL_TIME",
1155
+ title: "Actor",
1156
+ department: "Movies",
1157
+ email: "george@example.com",
1158
+ location: "Hollywood, CA",
1159
+ phone: "6505551234",
1160
+ photoUrl: "https://example.com/george.jpg",
1161
+ startDate: new RFCDate("2000-01-23"),
1162
+ datasourceProfile: [
1163
+ {
1164
+ datasource: "github",
1165
+ handle: "<value>",
1166
+ },
1167
+ {
1168
+ datasource: "github",
1169
+ handle: "<value>",
1170
+ },
1171
+ ],
1172
+ querySuggestions: {},
1173
+ inviteInfo: {},
1174
+ badges: [
1175
+ {
1176
+ key: "deployment_name_new_hire",
1177
+ displayName: "New hire",
1178
+ iconConfig: {
1179
+ color: "#343CED",
1180
+ key: "person_icon",
1181
+ iconType: "GLYPH",
1182
+ name: "user",
1183
+ },
1184
+ },
1185
+ ],
1186
+ },
1187
+ },
211
1188
  role: "VIEWER",
212
1189
  },
213
1190
  {
1191
+ person: {
1192
+ name: "George Clooney",
1193
+ obfuscatedId: "abc123",
1194
+ metadata: {
1195
+ type: "FULL_TIME",
1196
+ title: "Actor",
1197
+ department: "Movies",
1198
+ email: "george@example.com",
1199
+ location: "Hollywood, CA",
1200
+ phone: "6505551234",
1201
+ photoUrl: "https://example.com/george.jpg",
1202
+ startDate: new RFCDate("2000-01-23"),
1203
+ datasourceProfile: [
1204
+ {
1205
+ datasource: "github",
1206
+ handle: "<value>",
1207
+ },
1208
+ {
1209
+ datasource: "github",
1210
+ handle: "<value>",
1211
+ },
1212
+ ],
1213
+ querySuggestions: {},
1214
+ inviteInfo: {},
1215
+ badges: [
1216
+ {
1217
+ key: "deployment_name_new_hire",
1218
+ displayName: "New hire",
1219
+ iconConfig: {
1220
+ color: "#343CED",
1221
+ key: "person_icon",
1222
+ iconType: "GLYPH",
1223
+ name: "user",
1224
+ },
1225
+ },
1226
+ ],
1227
+ },
1228
+ },
214
1229
  role: "OWNER",
215
1230
  },
216
1231
  {
1232
+ person: {
1233
+ name: "George Clooney",
1234
+ obfuscatedId: "abc123",
1235
+ metadata: {
1236
+ type: "FULL_TIME",
1237
+ title: "Actor",
1238
+ department: "Movies",
1239
+ email: "george@example.com",
1240
+ location: "Hollywood, CA",
1241
+ phone: "6505551234",
1242
+ photoUrl: "https://example.com/george.jpg",
1243
+ startDate: new RFCDate("2000-01-23"),
1244
+ datasourceProfile: [
1245
+ {
1246
+ datasource: "github",
1247
+ handle: "<value>",
1248
+ },
1249
+ {
1250
+ datasource: "github",
1251
+ handle: "<value>",
1252
+ },
1253
+ ],
1254
+ querySuggestions: {},
1255
+ inviteInfo: {},
1256
+ badges: [
1257
+ {
1258
+ key: "deployment_name_new_hire",
1259
+ displayName: "New hire",
1260
+ iconConfig: {
1261
+ color: "#343CED",
1262
+ key: "person_icon",
1263
+ iconType: "GLYPH",
1264
+ name: "user",
1265
+ },
1266
+ },
1267
+ ],
1268
+ },
1269
+ },
217
1270
  role: "VIEWER",
218
1271
  },
219
1272
  ],