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