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