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