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