@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
@@ -36,7 +36,324 @@ test("Answers Createanswer", async () => {
36
36
  person: {
37
37
  name: "George Clooney",
38
38
  obfuscatedId: "abc123",
39
- relatedDocuments: [],
39
+ relatedDocuments: [
40
+ {
41
+ querySuggestion: {
42
+ query: "app:github type:pull author:mortimer",
43
+ searchProviderInfo: {
44
+ name: "Google",
45
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
46
+ },
47
+ label: "Mortimer's PRs",
48
+ datasource: "github",
49
+ requestOptions: {
50
+ datasourceFilter: "JIRA",
51
+ datasourcesFilter: [
52
+ "JIRA",
53
+ ],
54
+ queryOverridesFacetFilters: true,
55
+ facetFilters: [
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
+ facetFilterSets: [
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
+ filters: [
90
+ {
91
+ fieldName: "type",
92
+ values: [
93
+ {
94
+ value: "Spreadsheet",
95
+ relationType: "EQUALS",
96
+ },
97
+ {
98
+ value: "Presentation",
99
+ relationType: "EQUALS",
100
+ },
101
+ ],
102
+ },
103
+ ],
104
+ },
105
+ ],
106
+ facetBucketSize: 134365,
107
+ authTokens: [
108
+ {
109
+ accessToken: "123abc",
110
+ datasource: "gmail",
111
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
112
+ tokenType: "Bearer",
113
+ authUser: "1",
114
+ },
115
+ ],
116
+ },
117
+ ranges: [
118
+ {
119
+ startIndex: 796474,
120
+ document: {
121
+ metadata: {
122
+ datasource: "datasource",
123
+ objectType: "Feature Request",
124
+ container: "container",
125
+ parentId: "JIRA_EN-1337",
126
+ mimeType: "mimeType",
127
+ documentId: "documentId",
128
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
129
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
130
+ components: [
131
+ "Backend",
132
+ "Networking",
133
+ ],
134
+ status: "[\"Done\"]",
135
+ pins: [
136
+ {
137
+ audienceFilters: [
138
+ {
139
+ fieldName: "type",
140
+ values: [
141
+ {
142
+ value: "Spreadsheet",
143
+ relationType: "EQUALS",
144
+ },
145
+ {
146
+ value: "Presentation",
147
+ relationType: "EQUALS",
148
+ },
149
+ ],
150
+ },
151
+ ],
152
+ documentId: "<id>",
153
+ },
154
+ {
155
+ audienceFilters: [
156
+ {
157
+ fieldName: "type",
158
+ values: [
159
+ {
160
+ value: "Spreadsheet",
161
+ relationType: "EQUALS",
162
+ },
163
+ {
164
+ value: "Presentation",
165
+ relationType: "EQUALS",
166
+ },
167
+ ],
168
+ },
169
+ ],
170
+ documentId: "<id>",
171
+ },
172
+ {
173
+ audienceFilters: [
174
+ {
175
+ fieldName: "type",
176
+ values: [
177
+ {
178
+ value: "Spreadsheet",
179
+ relationType: "EQUALS",
180
+ },
181
+ {
182
+ value: "Presentation",
183
+ relationType: "EQUALS",
184
+ },
185
+ ],
186
+ },
187
+ ],
188
+ documentId: "<id>",
189
+ },
190
+ ],
191
+ collections: [
192
+ {
193
+ name: "<value>",
194
+ description: "fumigate convection though zowie",
195
+ audienceFilters: [
196
+ {
197
+ fieldName: "type",
198
+ values: [
199
+ {
200
+ value: "Spreadsheet",
201
+ relationType: "EQUALS",
202
+ },
203
+ {
204
+ value: "Presentation",
205
+ relationType: "EQUALS",
206
+ },
207
+ ],
208
+ },
209
+ ],
210
+ id: 496323,
211
+ items: [
212
+ {
213
+ collectionId: 782367,
214
+ shortcut: {
215
+ inputAlias: "<value>",
216
+ },
217
+ itemType: "URL",
218
+ },
219
+ ],
220
+ },
221
+ ],
222
+ interactions: {
223
+ reacts: [
224
+ {},
225
+ {},
226
+ {},
227
+ ],
228
+ shares: [
229
+ {
230
+ numDaysAgo: 219974,
231
+ },
232
+ {
233
+ numDaysAgo: 449221,
234
+ },
235
+ {
236
+ numDaysAgo: 427887,
237
+ },
238
+ ],
239
+ },
240
+ verification: {
241
+ state: "VERIFIED",
242
+ metadata: {
243
+ reminders: [
244
+ {
245
+ assignee: {
246
+ name: "George Clooney",
247
+ obfuscatedId: "abc123",
248
+ },
249
+ remindAt: 491427,
250
+ },
251
+ ],
252
+ lastReminder: {
253
+ assignee: {
254
+ name: "George Clooney",
255
+ obfuscatedId: "abc123",
256
+ },
257
+ remindAt: 490420,
258
+ },
259
+ },
260
+ },
261
+ shortcuts: [
262
+ {
263
+ inputAlias: "<value>",
264
+ },
265
+ ],
266
+ customData: {
267
+ "someCustomField": {},
268
+ },
269
+ },
270
+ },
271
+ },
272
+ ],
273
+ inputDetails: {
274
+ hasCopyPaste: true,
275
+ },
276
+ },
277
+ results: [
278
+ {
279
+ title: "title",
280
+ url: "https://example.com/foo/bar",
281
+ nativeAppUrl: "slack://foo/bar",
282
+ snippets: [
283
+ {
284
+ snippet: "snippet",
285
+ mimeType: "mimeType",
286
+ },
287
+ ],
288
+ },
289
+ ],
290
+ },
291
+ {
292
+ querySuggestion: {
293
+ query: "app:github type:pull author:mortimer",
294
+ searchProviderInfo: {
295
+ name: "Google",
296
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
297
+ },
298
+ label: "Mortimer's PRs",
299
+ datasource: "github",
300
+ requestOptions: {
301
+ datasourceFilter: "JIRA",
302
+ datasourcesFilter: [
303
+ "JIRA",
304
+ ],
305
+ queryOverridesFacetFilters: true,
306
+ facetFilters: [
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
+ facetFilterSets: [
322
+ {
323
+ filters: [
324
+ {
325
+ fieldName: "type",
326
+ values: [
327
+ {
328
+ value: "Spreadsheet",
329
+ relationType: "EQUALS",
330
+ },
331
+ {
332
+ value: "Presentation",
333
+ relationType: "EQUALS",
334
+ },
335
+ ],
336
+ },
337
+ ],
338
+ },
339
+ ],
340
+ facetBucketSize: 129663,
341
+ authTokens: [
342
+ {
343
+ accessToken: "123abc",
344
+ datasource: "gmail",
345
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
346
+ tokenType: "Bearer",
347
+ authUser: "1",
348
+ },
349
+ ],
350
+ },
351
+ inputDetails: {
352
+ hasCopyPaste: true,
353
+ },
354
+ },
355
+ },
356
+ ],
40
357
  metadata: {
41
358
  type: "FULL_TIME",
42
359
  title: "Actor",
@@ -53,12 +370,32 @@ test("Answers Createanswer", async () => {
53
370
  },
54
371
  ],
55
372
  querySuggestions: {
56
- suggestions: [],
373
+ suggestions: [
374
+ {
375
+ query: "app:github type:pull author:mortimer",
376
+ label: "Mortimer's PRs",
377
+ datasource: "github",
378
+ },
379
+ ],
57
380
  },
58
381
  inviteInfo: {
59
- invites: [],
382
+ invites: [
383
+ {},
384
+ {},
385
+ ],
60
386
  },
61
- customFields: [],
387
+ customFields: [
388
+ {
389
+ label: "<value>",
390
+ values: [
391
+ {},
392
+ ],
393
+ },
394
+ {
395
+ label: "<value>",
396
+ values: [],
397
+ },
398
+ ],
62
399
  badges: [
63
400
  {
64
401
  key: "deployment_name_new_hire",
@@ -76,50 +413,316 @@ test("Answers Createanswer", async () => {
76
413
  role: "OWNER",
77
414
  },
78
415
  {
416
+ person: {
417
+ name: "George Clooney",
418
+ obfuscatedId: "abc123",
419
+ metadata: {
420
+ type: "FULL_TIME",
421
+ title: "Actor",
422
+ department: "Movies",
423
+ email: "george@example.com",
424
+ location: "Hollywood, CA",
425
+ phone: "6505551234",
426
+ photoUrl: "https://example.com/george.jpg",
427
+ startDate: new RFCDate("2000-01-23"),
428
+ datasourceProfile: [
429
+ {
430
+ datasource: "github",
431
+ handle: "<value>",
432
+ },
433
+ ],
434
+ querySuggestions: {},
435
+ inviteInfo: {},
436
+ badges: [
437
+ {
438
+ key: "deployment_name_new_hire",
439
+ displayName: "New hire",
440
+ iconConfig: {
441
+ color: "#343CED",
442
+ key: "person_icon",
443
+ iconType: "GLYPH",
444
+ name: "user",
445
+ },
446
+ },
447
+ ],
448
+ },
449
+ },
79
450
  role: "VERIFIER",
80
451
  },
81
452
  ],
82
453
  removedRoles: [
83
454
  {
455
+ person: {
456
+ name: "George Clooney",
457
+ obfuscatedId: "abc123",
458
+ metadata: {
459
+ type: "FULL_TIME",
460
+ title: "Actor",
461
+ department: "Movies",
462
+ email: "george@example.com",
463
+ location: "Hollywood, CA",
464
+ phone: "6505551234",
465
+ photoUrl: "https://example.com/george.jpg",
466
+ startDate: new RFCDate("2000-01-23"),
467
+ datasourceProfile: [
468
+ {
469
+ datasource: "github",
470
+ handle: "<value>",
471
+ },
472
+ ],
473
+ querySuggestions: {},
474
+ inviteInfo: {},
475
+ badges: [
476
+ {
477
+ key: "deployment_name_new_hire",
478
+ displayName: "New hire",
479
+ iconConfig: {
480
+ color: "#343CED",
481
+ key: "person_icon",
482
+ iconType: "GLYPH",
483
+ name: "user",
484
+ },
485
+ },
486
+ ],
487
+ },
488
+ },
84
489
  role: "VERIFIER",
85
490
  },
86
491
  {
492
+ person: {
493
+ name: "George Clooney",
494
+ obfuscatedId: "abc123",
495
+ metadata: {
496
+ type: "FULL_TIME",
497
+ title: "Actor",
498
+ department: "Movies",
499
+ email: "george@example.com",
500
+ location: "Hollywood, CA",
501
+ phone: "6505551234",
502
+ photoUrl: "https://example.com/george.jpg",
503
+ startDate: new RFCDate("2000-01-23"),
504
+ datasourceProfile: [
505
+ {
506
+ datasource: "github",
507
+ handle: "<value>",
508
+ },
509
+ {
510
+ datasource: "github",
511
+ handle: "<value>",
512
+ },
513
+ {
514
+ datasource: "github",
515
+ handle: "<value>",
516
+ },
517
+ ],
518
+ querySuggestions: {},
519
+ inviteInfo: {},
520
+ badges: [
521
+ {
522
+ key: "deployment_name_new_hire",
523
+ displayName: "New hire",
524
+ iconConfig: {
525
+ color: "#343CED",
526
+ key: "person_icon",
527
+ iconType: "GLYPH",
528
+ name: "user",
529
+ },
530
+ },
531
+ ],
532
+ },
533
+ },
87
534
  role: "ANSWER_MODERATOR",
88
535
  },
89
536
  {
537
+ person: {
538
+ name: "George Clooney",
539
+ obfuscatedId: "abc123",
540
+ metadata: {
541
+ type: "FULL_TIME",
542
+ title: "Actor",
543
+ department: "Movies",
544
+ email: "george@example.com",
545
+ location: "Hollywood, CA",
546
+ phone: "6505551234",
547
+ photoUrl: "https://example.com/george.jpg",
548
+ startDate: new RFCDate("2000-01-23"),
549
+ datasourceProfile: [
550
+ {
551
+ datasource: "github",
552
+ handle: "<value>",
553
+ },
554
+ ],
555
+ querySuggestions: {},
556
+ inviteInfo: {},
557
+ badges: [
558
+ {
559
+ key: "deployment_name_new_hire",
560
+ displayName: "New hire",
561
+ iconConfig: {
562
+ color: "#343CED",
563
+ key: "person_icon",
564
+ iconType: "GLYPH",
565
+ name: "user",
566
+ },
567
+ },
568
+ ],
569
+ },
570
+ },
90
571
  role: "OWNER",
91
572
  },
92
573
  ],
93
574
  roles: [
94
575
  {
576
+ person: {
577
+ name: "George Clooney",
578
+ obfuscatedId: "abc123",
579
+ metadata: {
580
+ type: "FULL_TIME",
581
+ title: "Actor",
582
+ department: "Movies",
583
+ email: "george@example.com",
584
+ location: "Hollywood, CA",
585
+ phone: "6505551234",
586
+ photoUrl: "https://example.com/george.jpg",
587
+ startDate: new RFCDate("2000-01-23"),
588
+ datasourceProfile: [
589
+ {
590
+ datasource: "github",
591
+ handle: "<value>",
592
+ },
593
+ {
594
+ datasource: "github",
595
+ handle: "<value>",
596
+ },
597
+ ],
598
+ querySuggestions: {},
599
+ inviteInfo: {},
600
+ badges: [
601
+ {
602
+ key: "deployment_name_new_hire",
603
+ displayName: "New hire",
604
+ iconConfig: {
605
+ color: "#343CED",
606
+ key: "person_icon",
607
+ iconType: "GLYPH",
608
+ name: "user",
609
+ },
610
+ },
611
+ ],
612
+ },
613
+ },
95
614
  role: "ANSWER_MODERATOR",
96
615
  },
97
616
  {
617
+ person: {
618
+ name: "George Clooney",
619
+ obfuscatedId: "abc123",
620
+ metadata: {
621
+ type: "FULL_TIME",
622
+ title: "Actor",
623
+ department: "Movies",
624
+ email: "george@example.com",
625
+ location: "Hollywood, CA",
626
+ phone: "6505551234",
627
+ photoUrl: "https://example.com/george.jpg",
628
+ startDate: new RFCDate("2000-01-23"),
629
+ datasourceProfile: [
630
+ {
631
+ datasource: "github",
632
+ handle: "<value>",
633
+ },
634
+ {
635
+ datasource: "github",
636
+ handle: "<value>",
637
+ },
638
+ {
639
+ datasource: "github",
640
+ handle: "<value>",
641
+ },
642
+ ],
643
+ querySuggestions: {},
644
+ inviteInfo: {},
645
+ badges: [
646
+ {
647
+ key: "deployment_name_new_hire",
648
+ displayName: "New hire",
649
+ iconConfig: {
650
+ color: "#343CED",
651
+ key: "person_icon",
652
+ iconType: "GLYPH",
653
+ name: "user",
654
+ },
655
+ },
656
+ ],
657
+ },
658
+ },
98
659
  role: "OWNER",
99
660
  },
100
661
  {
101
- role: "VERIFIER",
102
- },
103
- ],
104
- combinedAnswerText: {
105
- text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
106
- },
107
- },
108
- });
109
- expect(result).toBeDefined();
110
- });
111
- test("Answers Deleteanswer", async () => {
112
- const testHttpClient = createTestHTTPClient("deleteanswer");
113
- const glean = new Glean({
114
- serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
115
- httpClient: testHttpClient,
116
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "value",
117
- });
118
- await glean.client.answers.delete({
119
- id: 3,
120
- docId: "ANSWERS_answer_3",
121
- });
122
- });
662
+ person: {
663
+ name: "George Clooney",
664
+ obfuscatedId: "abc123",
665
+ metadata: {
666
+ type: "FULL_TIME",
667
+ title: "Actor",
668
+ department: "Movies",
669
+ email: "george@example.com",
670
+ location: "Hollywood, CA",
671
+ phone: "6505551234",
672
+ photoUrl: "https://example.com/george.jpg",
673
+ startDate: new RFCDate("2000-01-23"),
674
+ datasourceProfile: [
675
+ {
676
+ datasource: "github",
677
+ handle: "<value>",
678
+ },
679
+ {
680
+ datasource: "github",
681
+ handle: "<value>",
682
+ },
683
+ {
684
+ datasource: "github",
685
+ handle: "<value>",
686
+ },
687
+ ],
688
+ querySuggestions: {},
689
+ inviteInfo: {},
690
+ badges: [
691
+ {
692
+ key: "deployment_name_new_hire",
693
+ displayName: "New hire",
694
+ iconConfig: {
695
+ color: "#343CED",
696
+ key: "person_icon",
697
+ iconType: "GLYPH",
698
+ name: "user",
699
+ },
700
+ },
701
+ ],
702
+ },
703
+ },
704
+ role: "VERIFIER",
705
+ },
706
+ ],
707
+ combinedAnswerText: {
708
+ text: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
709
+ },
710
+ },
711
+ });
712
+ expect(result).toBeDefined();
713
+ });
714
+ test("Answers Deleteanswer", async () => {
715
+ const testHttpClient = createTestHTTPClient("deleteanswer");
716
+ const glean = new Glean({
717
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
718
+ httpClient: testHttpClient,
719
+ apiToken: process.env["GLEAN_API_TOKEN"] ?? "value",
720
+ });
721
+ await glean.client.answers.delete({
722
+ id: 3,
723
+ docId: "ANSWERS_answer_3",
724
+ });
725
+ });
123
726
  test("Answers Editanswer", async () => {
124
727
  const testHttpClient = createTestHTTPClient("editanswer");
125
728
  const glean = new Glean({
@@ -152,7 +755,402 @@ test("Answers Editanswer", async () => {
152
755
  person: {
153
756
  name: "George Clooney",
154
757
  obfuscatedId: "abc123",
155
- relatedDocuments: [],
758
+ relatedDocuments: [
759
+ {
760
+ querySuggestion: {
761
+ query: "app:github type:pull author:mortimer",
762
+ searchProviderInfo: {
763
+ name: "Google",
764
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
765
+ },
766
+ label: "Mortimer's PRs",
767
+ datasource: "github",
768
+ requestOptions: {
769
+ datasourceFilter: "JIRA",
770
+ datasourcesFilter: [
771
+ "JIRA",
772
+ ],
773
+ queryOverridesFacetFilters: true,
774
+ facetFilters: [
775
+ {
776
+ fieldName: "type",
777
+ values: [
778
+ {
779
+ value: "Spreadsheet",
780
+ relationType: "EQUALS",
781
+ },
782
+ {
783
+ value: "Presentation",
784
+ relationType: "EQUALS",
785
+ },
786
+ ],
787
+ },
788
+ ],
789
+ facetFilterSets: [
790
+ {
791
+ filters: [
792
+ {
793
+ fieldName: "type",
794
+ values: [
795
+ {
796
+ value: "Spreadsheet",
797
+ relationType: "EQUALS",
798
+ },
799
+ {
800
+ value: "Presentation",
801
+ relationType: "EQUALS",
802
+ },
803
+ ],
804
+ },
805
+ ],
806
+ },
807
+ {
808
+ filters: [
809
+ {
810
+ fieldName: "type",
811
+ values: [
812
+ {
813
+ value: "Spreadsheet",
814
+ relationType: "EQUALS",
815
+ },
816
+ {
817
+ value: "Presentation",
818
+ relationType: "EQUALS",
819
+ },
820
+ ],
821
+ },
822
+ ],
823
+ },
824
+ ],
825
+ facetBucketSize: 991464,
826
+ authTokens: [
827
+ {
828
+ accessToken: "123abc",
829
+ datasource: "gmail",
830
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
831
+ tokenType: "Bearer",
832
+ authUser: "1",
833
+ },
834
+ ],
835
+ },
836
+ ranges: [
837
+ {
838
+ startIndex: 488852,
839
+ document: {
840
+ metadata: {
841
+ datasource: "datasource",
842
+ objectType: "Feature Request",
843
+ container: "container",
844
+ parentId: "JIRA_EN-1337",
845
+ mimeType: "mimeType",
846
+ documentId: "documentId",
847
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
848
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
849
+ components: [
850
+ "Backend",
851
+ "Networking",
852
+ ],
853
+ status: "[\"Done\"]",
854
+ pins: [
855
+ {
856
+ audienceFilters: [
857
+ {
858
+ fieldName: "type",
859
+ values: [
860
+ {
861
+ value: "Spreadsheet",
862
+ relationType: "EQUALS",
863
+ },
864
+ {
865
+ value: "Presentation",
866
+ relationType: "EQUALS",
867
+ },
868
+ ],
869
+ },
870
+ ],
871
+ documentId: "<id>",
872
+ },
873
+ {
874
+ audienceFilters: [
875
+ {
876
+ fieldName: "type",
877
+ values: [
878
+ {
879
+ value: "Spreadsheet",
880
+ relationType: "EQUALS",
881
+ },
882
+ {
883
+ value: "Presentation",
884
+ relationType: "EQUALS",
885
+ },
886
+ ],
887
+ },
888
+ ],
889
+ documentId: "<id>",
890
+ },
891
+ {
892
+ audienceFilters: [
893
+ {
894
+ fieldName: "type",
895
+ values: [
896
+ {
897
+ value: "Spreadsheet",
898
+ relationType: "EQUALS",
899
+ },
900
+ {
901
+ value: "Presentation",
902
+ relationType: "EQUALS",
903
+ },
904
+ ],
905
+ },
906
+ ],
907
+ documentId: "<id>",
908
+ },
909
+ ],
910
+ collections: [
911
+ {
912
+ name: "<value>",
913
+ description: "eulogise whereas till mild than during meanwhile disapprove finer ha",
914
+ audienceFilters: [
915
+ {
916
+ fieldName: "type",
917
+ values: [
918
+ {
919
+ value: "Spreadsheet",
920
+ relationType: "EQUALS",
921
+ },
922
+ {
923
+ value: "Presentation",
924
+ relationType: "EQUALS",
925
+ },
926
+ ],
927
+ },
928
+ ],
929
+ id: 2984,
930
+ items: [
931
+ {
932
+ collectionId: 477967,
933
+ shortcut: {
934
+ inputAlias: "<value>",
935
+ },
936
+ itemType: "COLLECTION",
937
+ },
938
+ {
939
+ collectionId: 424273,
940
+ shortcut: {
941
+ inputAlias: "<value>",
942
+ },
943
+ itemType: "COLLECTION",
944
+ },
945
+ ],
946
+ },
947
+ ],
948
+ interactions: {
949
+ reacts: [
950
+ {},
951
+ ],
952
+ shares: [
953
+ {
954
+ numDaysAgo: 301848,
955
+ },
956
+ {
957
+ numDaysAgo: 657278,
958
+ },
959
+ ],
960
+ },
961
+ verification: {
962
+ state: "UNVERIFIED",
963
+ metadata: {
964
+ reminders: [
965
+ {
966
+ assignee: {
967
+ name: "George Clooney",
968
+ obfuscatedId: "abc123",
969
+ },
970
+ remindAt: 335191,
971
+ },
972
+ ],
973
+ lastReminder: {
974
+ assignee: {
975
+ name: "George Clooney",
976
+ obfuscatedId: "abc123",
977
+ },
978
+ remindAt: 532806,
979
+ },
980
+ },
981
+ },
982
+ shortcuts: [
983
+ {
984
+ inputAlias: "<value>",
985
+ },
986
+ {
987
+ inputAlias: "<value>",
988
+ },
989
+ {
990
+ inputAlias: "<value>",
991
+ },
992
+ ],
993
+ customData: {
994
+ "someCustomField": {},
995
+ },
996
+ },
997
+ },
998
+ },
999
+ {
1000
+ startIndex: 463392,
1001
+ document: {
1002
+ metadata: {
1003
+ datasource: "datasource",
1004
+ objectType: "Feature Request",
1005
+ container: "container",
1006
+ parentId: "JIRA_EN-1337",
1007
+ mimeType: "mimeType",
1008
+ documentId: "documentId",
1009
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
1010
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
1011
+ components: [
1012
+ "Backend",
1013
+ "Networking",
1014
+ ],
1015
+ status: "[\"Done\"]",
1016
+ interactions: {},
1017
+ verification: {
1018
+ state: "VERIFIED",
1019
+ metadata: {
1020
+ lastReminder: {
1021
+ assignee: {
1022
+ name: "George Clooney",
1023
+ obfuscatedId: "abc123",
1024
+ },
1025
+ remindAt: 58704,
1026
+ },
1027
+ },
1028
+ },
1029
+ customData: {
1030
+ "someCustomField": {},
1031
+ },
1032
+ },
1033
+ },
1034
+ },
1035
+ ],
1036
+ inputDetails: {
1037
+ hasCopyPaste: true,
1038
+ },
1039
+ },
1040
+ results: [
1041
+ {
1042
+ title: "title",
1043
+ url: "https://example.com/foo/bar",
1044
+ nativeAppUrl: "slack://foo/bar",
1045
+ snippets: [
1046
+ {
1047
+ snippet: "snippet",
1048
+ mimeType: "mimeType",
1049
+ },
1050
+ ],
1051
+ },
1052
+ ],
1053
+ },
1054
+ {
1055
+ querySuggestion: {
1056
+ query: "app:github type:pull author:mortimer",
1057
+ searchProviderInfo: {
1058
+ name: "Google",
1059
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
1060
+ },
1061
+ label: "Mortimer's PRs",
1062
+ datasource: "github",
1063
+ requestOptions: {
1064
+ datasourceFilter: "JIRA",
1065
+ datasourcesFilter: [
1066
+ "JIRA",
1067
+ ],
1068
+ queryOverridesFacetFilters: true,
1069
+ facetFilters: [
1070
+ {
1071
+ fieldName: "type",
1072
+ values: [
1073
+ {
1074
+ value: "Spreadsheet",
1075
+ relationType: "EQUALS",
1076
+ },
1077
+ {
1078
+ value: "Presentation",
1079
+ relationType: "EQUALS",
1080
+ },
1081
+ ],
1082
+ },
1083
+ ],
1084
+ facetFilterSets: [
1085
+ {
1086
+ filters: [
1087
+ {
1088
+ fieldName: "type",
1089
+ values: [
1090
+ {
1091
+ value: "Spreadsheet",
1092
+ relationType: "EQUALS",
1093
+ },
1094
+ {
1095
+ value: "Presentation",
1096
+ relationType: "EQUALS",
1097
+ },
1098
+ ],
1099
+ },
1100
+ ],
1101
+ },
1102
+ {
1103
+ filters: [
1104
+ {
1105
+ fieldName: "type",
1106
+ values: [
1107
+ {
1108
+ value: "Spreadsheet",
1109
+ relationType: "EQUALS",
1110
+ },
1111
+ {
1112
+ value: "Presentation",
1113
+ relationType: "EQUALS",
1114
+ },
1115
+ ],
1116
+ },
1117
+ ],
1118
+ },
1119
+ {
1120
+ filters: [
1121
+ {
1122
+ fieldName: "type",
1123
+ values: [
1124
+ {
1125
+ value: "Spreadsheet",
1126
+ relationType: "EQUALS",
1127
+ },
1128
+ {
1129
+ value: "Presentation",
1130
+ relationType: "EQUALS",
1131
+ },
1132
+ ],
1133
+ },
1134
+ ],
1135
+ },
1136
+ ],
1137
+ facetBucketSize: 326276,
1138
+ authTokens: [
1139
+ {
1140
+ accessToken: "123abc",
1141
+ datasource: "gmail",
1142
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
1143
+ tokenType: "Bearer",
1144
+ authUser: "1",
1145
+ },
1146
+ ],
1147
+ },
1148
+ inputDetails: {
1149
+ hasCopyPaste: true,
1150
+ },
1151
+ },
1152
+ },
1153
+ ],
156
1154
  metadata: {
157
1155
  type: "FULL_TIME",
158
1156
  title: "Actor",
@@ -169,12 +1167,29 @@ test("Answers Editanswer", async () => {
169
1167
  },
170
1168
  ],
171
1169
  querySuggestions: {
172
- suggestions: [],
1170
+ suggestions: [
1171
+ {
1172
+ query: "app:github type:pull author:mortimer",
1173
+ label: "Mortimer's PRs",
1174
+ datasource: "github",
1175
+ },
1176
+ ],
173
1177
  },
174
1178
  inviteInfo: {
175
- invites: [],
1179
+ invites: [
1180
+ {},
1181
+ {},
1182
+ {},
1183
+ ],
176
1184
  },
177
- customFields: [],
1185
+ customFields: [
1186
+ {
1187
+ label: "<value>",
1188
+ values: [
1189
+ {},
1190
+ ],
1191
+ },
1192
+ ],
178
1193
  badges: [
179
1194
  {
180
1195
  key: "deployment_name_new_hire",
@@ -192,28 +1207,298 @@ test("Answers Editanswer", async () => {
192
1207
  role: "EDITOR",
193
1208
  },
194
1209
  {
1210
+ person: {
1211
+ name: "George Clooney",
1212
+ obfuscatedId: "abc123",
1213
+ metadata: {
1214
+ type: "FULL_TIME",
1215
+ title: "Actor",
1216
+ department: "Movies",
1217
+ email: "george@example.com",
1218
+ location: "Hollywood, CA",
1219
+ phone: "6505551234",
1220
+ photoUrl: "https://example.com/george.jpg",
1221
+ startDate: new RFCDate("2000-01-23"),
1222
+ datasourceProfile: [
1223
+ {
1224
+ datasource: "github",
1225
+ handle: "<value>",
1226
+ },
1227
+ {
1228
+ datasource: "github",
1229
+ handle: "<value>",
1230
+ },
1231
+ ],
1232
+ querySuggestions: {},
1233
+ inviteInfo: {},
1234
+ badges: [
1235
+ {
1236
+ key: "deployment_name_new_hire",
1237
+ displayName: "New hire",
1238
+ iconConfig: {
1239
+ color: "#343CED",
1240
+ key: "person_icon",
1241
+ iconType: "GLYPH",
1242
+ name: "user",
1243
+ },
1244
+ },
1245
+ ],
1246
+ },
1247
+ },
195
1248
  role: "ANSWER_MODERATOR",
196
1249
  },
197
1250
  {
1251
+ person: {
1252
+ name: "George Clooney",
1253
+ obfuscatedId: "abc123",
1254
+ metadata: {
1255
+ type: "FULL_TIME",
1256
+ title: "Actor",
1257
+ department: "Movies",
1258
+ email: "george@example.com",
1259
+ location: "Hollywood, CA",
1260
+ phone: "6505551234",
1261
+ photoUrl: "https://example.com/george.jpg",
1262
+ startDate: new RFCDate("2000-01-23"),
1263
+ datasourceProfile: [
1264
+ {
1265
+ datasource: "github",
1266
+ handle: "<value>",
1267
+ },
1268
+ ],
1269
+ querySuggestions: {},
1270
+ inviteInfo: {},
1271
+ badges: [
1272
+ {
1273
+ key: "deployment_name_new_hire",
1274
+ displayName: "New hire",
1275
+ iconConfig: {
1276
+ color: "#343CED",
1277
+ key: "person_icon",
1278
+ iconType: "GLYPH",
1279
+ name: "user",
1280
+ },
1281
+ },
1282
+ ],
1283
+ },
1284
+ },
198
1285
  role: "OWNER",
199
1286
  },
200
1287
  ],
201
1288
  removedRoles: [
202
1289
  {
1290
+ person: {
1291
+ name: "George Clooney",
1292
+ obfuscatedId: "abc123",
1293
+ metadata: {
1294
+ type: "FULL_TIME",
1295
+ title: "Actor",
1296
+ department: "Movies",
1297
+ email: "george@example.com",
1298
+ location: "Hollywood, CA",
1299
+ phone: "6505551234",
1300
+ photoUrl: "https://example.com/george.jpg",
1301
+ startDate: new RFCDate("2000-01-23"),
1302
+ datasourceProfile: [
1303
+ {
1304
+ datasource: "github",
1305
+ handle: "<value>",
1306
+ },
1307
+ {
1308
+ datasource: "github",
1309
+ handle: "<value>",
1310
+ },
1311
+ {
1312
+ datasource: "github",
1313
+ handle: "<value>",
1314
+ },
1315
+ ],
1316
+ querySuggestions: {},
1317
+ inviteInfo: {},
1318
+ badges: [
1319
+ {
1320
+ key: "deployment_name_new_hire",
1321
+ displayName: "New hire",
1322
+ iconConfig: {
1323
+ color: "#343CED",
1324
+ key: "person_icon",
1325
+ iconType: "GLYPH",
1326
+ name: "user",
1327
+ },
1328
+ },
1329
+ ],
1330
+ },
1331
+ },
203
1332
  role: "OWNER",
204
1333
  },
205
1334
  {
1335
+ person: {
1336
+ name: "George Clooney",
1337
+ obfuscatedId: "abc123",
1338
+ metadata: {
1339
+ type: "FULL_TIME",
1340
+ title: "Actor",
1341
+ department: "Movies",
1342
+ email: "george@example.com",
1343
+ location: "Hollywood, CA",
1344
+ phone: "6505551234",
1345
+ photoUrl: "https://example.com/george.jpg",
1346
+ startDate: new RFCDate("2000-01-23"),
1347
+ datasourceProfile: [
1348
+ {
1349
+ datasource: "github",
1350
+ handle: "<value>",
1351
+ },
1352
+ {
1353
+ datasource: "github",
1354
+ handle: "<value>",
1355
+ },
1356
+ ],
1357
+ querySuggestions: {},
1358
+ inviteInfo: {},
1359
+ badges: [
1360
+ {
1361
+ key: "deployment_name_new_hire",
1362
+ displayName: "New hire",
1363
+ iconConfig: {
1364
+ color: "#343CED",
1365
+ key: "person_icon",
1366
+ iconType: "GLYPH",
1367
+ name: "user",
1368
+ },
1369
+ },
1370
+ ],
1371
+ },
1372
+ },
206
1373
  role: "VERIFIER",
207
1374
  },
208
1375
  ],
209
1376
  roles: [
210
1377
  {
1378
+ person: {
1379
+ name: "George Clooney",
1380
+ obfuscatedId: "abc123",
1381
+ metadata: {
1382
+ type: "FULL_TIME",
1383
+ title: "Actor",
1384
+ department: "Movies",
1385
+ email: "george@example.com",
1386
+ location: "Hollywood, CA",
1387
+ phone: "6505551234",
1388
+ photoUrl: "https://example.com/george.jpg",
1389
+ startDate: new RFCDate("2000-01-23"),
1390
+ datasourceProfile: [
1391
+ {
1392
+ datasource: "github",
1393
+ handle: "<value>",
1394
+ },
1395
+ {
1396
+ datasource: "github",
1397
+ handle: "<value>",
1398
+ },
1399
+ {
1400
+ datasource: "github",
1401
+ handle: "<value>",
1402
+ },
1403
+ ],
1404
+ querySuggestions: {},
1405
+ inviteInfo: {},
1406
+ badges: [
1407
+ {
1408
+ key: "deployment_name_new_hire",
1409
+ displayName: "New hire",
1410
+ iconConfig: {
1411
+ color: "#343CED",
1412
+ key: "person_icon",
1413
+ iconType: "GLYPH",
1414
+ name: "user",
1415
+ },
1416
+ },
1417
+ ],
1418
+ },
1419
+ },
211
1420
  role: "EDITOR",
212
1421
  },
213
1422
  {
1423
+ person: {
1424
+ name: "George Clooney",
1425
+ obfuscatedId: "abc123",
1426
+ metadata: {
1427
+ type: "FULL_TIME",
1428
+ title: "Actor",
1429
+ department: "Movies",
1430
+ email: "george@example.com",
1431
+ location: "Hollywood, CA",
1432
+ phone: "6505551234",
1433
+ photoUrl: "https://example.com/george.jpg",
1434
+ startDate: new RFCDate("2000-01-23"),
1435
+ datasourceProfile: [
1436
+ {
1437
+ datasource: "github",
1438
+ handle: "<value>",
1439
+ },
1440
+ ],
1441
+ querySuggestions: {},
1442
+ inviteInfo: {},
1443
+ badges: [
1444
+ {
1445
+ key: "deployment_name_new_hire",
1446
+ displayName: "New hire",
1447
+ iconConfig: {
1448
+ color: "#343CED",
1449
+ key: "person_icon",
1450
+ iconType: "GLYPH",
1451
+ name: "user",
1452
+ },
1453
+ },
1454
+ ],
1455
+ },
1456
+ },
214
1457
  role: "VERIFIER",
215
1458
  },
216
1459
  {
1460
+ person: {
1461
+ name: "George Clooney",
1462
+ obfuscatedId: "abc123",
1463
+ metadata: {
1464
+ type: "FULL_TIME",
1465
+ title: "Actor",
1466
+ department: "Movies",
1467
+ email: "george@example.com",
1468
+ location: "Hollywood, CA",
1469
+ phone: "6505551234",
1470
+ photoUrl: "https://example.com/george.jpg",
1471
+ startDate: new RFCDate("2000-01-23"),
1472
+ datasourceProfile: [
1473
+ {
1474
+ datasource: "github",
1475
+ handle: "<value>",
1476
+ },
1477
+ {
1478
+ datasource: "github",
1479
+ handle: "<value>",
1480
+ },
1481
+ {
1482
+ datasource: "github",
1483
+ handle: "<value>",
1484
+ },
1485
+ ],
1486
+ querySuggestions: {},
1487
+ inviteInfo: {},
1488
+ badges: [
1489
+ {
1490
+ key: "deployment_name_new_hire",
1491
+ displayName: "New hire",
1492
+ iconConfig: {
1493
+ color: "#343CED",
1494
+ key: "person_icon",
1495
+ iconType: "GLYPH",
1496
+ name: "user",
1497
+ },
1498
+ },
1499
+ ],
1500
+ },
1501
+ },
217
1502
  role: "ANSWER_MODERATOR",
218
1503
  },
219
1504
  ],