@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
@@ -50,7 +50,324 @@ async function run() {
50
50
  person: {
51
51
  name: "George Clooney",
52
52
  obfuscatedId: "abc123",
53
- relatedDocuments: [],
53
+ relatedDocuments: [
54
+ {
55
+ querySuggestion: {
56
+ query: "app:github type:pull author:mortimer",
57
+ searchProviderInfo: {
58
+ name: "Google",
59
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
60
+ },
61
+ label: "Mortimer's PRs",
62
+ datasource: "github",
63
+ requestOptions: {
64
+ datasourceFilter: "JIRA",
65
+ datasourcesFilter: [
66
+ "JIRA",
67
+ ],
68
+ queryOverridesFacetFilters: true,
69
+ facetFilters: [
70
+ {
71
+ fieldName: "type",
72
+ values: [
73
+ {
74
+ value: "Spreadsheet",
75
+ relationType: "EQUALS",
76
+ },
77
+ {
78
+ value: "Presentation",
79
+ relationType: "EQUALS",
80
+ },
81
+ ],
82
+ },
83
+ ],
84
+ facetFilterSets: [
85
+ {
86
+ filters: [
87
+ {
88
+ fieldName: "type",
89
+ values: [
90
+ {
91
+ value: "Spreadsheet",
92
+ relationType: "EQUALS",
93
+ },
94
+ {
95
+ value: "Presentation",
96
+ relationType: "EQUALS",
97
+ },
98
+ ],
99
+ },
100
+ ],
101
+ },
102
+ {
103
+ filters: [
104
+ {
105
+ fieldName: "type",
106
+ values: [
107
+ {
108
+ value: "Spreadsheet",
109
+ relationType: "EQUALS",
110
+ },
111
+ {
112
+ value: "Presentation",
113
+ relationType: "EQUALS",
114
+ },
115
+ ],
116
+ },
117
+ ],
118
+ },
119
+ ],
120
+ facetBucketSize: 134365,
121
+ authTokens: [
122
+ {
123
+ accessToken: "123abc",
124
+ datasource: "gmail",
125
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
126
+ tokenType: "Bearer",
127
+ authUser: "1",
128
+ },
129
+ ],
130
+ },
131
+ ranges: [
132
+ {
133
+ startIndex: 796474,
134
+ document: {
135
+ metadata: {
136
+ datasource: "datasource",
137
+ objectType: "Feature Request",
138
+ container: "container",
139
+ parentId: "JIRA_EN-1337",
140
+ mimeType: "mimeType",
141
+ documentId: "documentId",
142
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
143
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
144
+ components: [
145
+ "Backend",
146
+ "Networking",
147
+ ],
148
+ status: "[\"Done\"]",
149
+ pins: [
150
+ {
151
+ audienceFilters: [
152
+ {
153
+ fieldName: "type",
154
+ values: [
155
+ {
156
+ value: "Spreadsheet",
157
+ relationType: "EQUALS",
158
+ },
159
+ {
160
+ value: "Presentation",
161
+ relationType: "EQUALS",
162
+ },
163
+ ],
164
+ },
165
+ ],
166
+ documentId: "<id>",
167
+ },
168
+ {
169
+ audienceFilters: [
170
+ {
171
+ fieldName: "type",
172
+ values: [
173
+ {
174
+ value: "Spreadsheet",
175
+ relationType: "EQUALS",
176
+ },
177
+ {
178
+ value: "Presentation",
179
+ relationType: "EQUALS",
180
+ },
181
+ ],
182
+ },
183
+ ],
184
+ documentId: "<id>",
185
+ },
186
+ {
187
+ audienceFilters: [
188
+ {
189
+ fieldName: "type",
190
+ values: [
191
+ {
192
+ value: "Spreadsheet",
193
+ relationType: "EQUALS",
194
+ },
195
+ {
196
+ value: "Presentation",
197
+ relationType: "EQUALS",
198
+ },
199
+ ],
200
+ },
201
+ ],
202
+ documentId: "<id>",
203
+ },
204
+ ],
205
+ collections: [
206
+ {
207
+ name: "<value>",
208
+ description: "fumigate convection though zowie",
209
+ audienceFilters: [
210
+ {
211
+ fieldName: "type",
212
+ values: [
213
+ {
214
+ value: "Spreadsheet",
215
+ relationType: "EQUALS",
216
+ },
217
+ {
218
+ value: "Presentation",
219
+ relationType: "EQUALS",
220
+ },
221
+ ],
222
+ },
223
+ ],
224
+ id: 496323,
225
+ items: [
226
+ {
227
+ collectionId: 782367,
228
+ shortcut: {
229
+ inputAlias: "<value>",
230
+ },
231
+ itemType: "URL",
232
+ },
233
+ ],
234
+ },
235
+ ],
236
+ interactions: {
237
+ reacts: [
238
+ {},
239
+ {},
240
+ {},
241
+ ],
242
+ shares: [
243
+ {
244
+ numDaysAgo: 219974,
245
+ },
246
+ {
247
+ numDaysAgo: 449221,
248
+ },
249
+ {
250
+ numDaysAgo: 427887,
251
+ },
252
+ ],
253
+ },
254
+ verification: {
255
+ state: "VERIFIED",
256
+ metadata: {
257
+ reminders: [
258
+ {
259
+ assignee: {
260
+ name: "George Clooney",
261
+ obfuscatedId: "abc123",
262
+ },
263
+ remindAt: 491427,
264
+ },
265
+ ],
266
+ lastReminder: {
267
+ assignee: {
268
+ name: "George Clooney",
269
+ obfuscatedId: "abc123",
270
+ },
271
+ remindAt: 490420,
272
+ },
273
+ },
274
+ },
275
+ shortcuts: [
276
+ {
277
+ inputAlias: "<value>",
278
+ },
279
+ ],
280
+ customData: {
281
+ "someCustomField": {},
282
+ },
283
+ },
284
+ },
285
+ },
286
+ ],
287
+ inputDetails: {
288
+ hasCopyPaste: true,
289
+ },
290
+ },
291
+ results: [
292
+ {
293
+ title: "title",
294
+ url: "https://example.com/foo/bar",
295
+ nativeAppUrl: "slack://foo/bar",
296
+ snippets: [
297
+ {
298
+ snippet: "snippet",
299
+ mimeType: "mimeType",
300
+ },
301
+ ],
302
+ },
303
+ ],
304
+ },
305
+ {
306
+ querySuggestion: {
307
+ query: "app:github type:pull author:mortimer",
308
+ searchProviderInfo: {
309
+ name: "Google",
310
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
311
+ },
312
+ label: "Mortimer's PRs",
313
+ datasource: "github",
314
+ requestOptions: {
315
+ datasourceFilter: "JIRA",
316
+ datasourcesFilter: [
317
+ "JIRA",
318
+ ],
319
+ queryOverridesFacetFilters: true,
320
+ facetFilters: [
321
+ {
322
+ fieldName: "type",
323
+ values: [
324
+ {
325
+ value: "Spreadsheet",
326
+ relationType: "EQUALS",
327
+ },
328
+ {
329
+ value: "Presentation",
330
+ relationType: "EQUALS",
331
+ },
332
+ ],
333
+ },
334
+ ],
335
+ facetFilterSets: [
336
+ {
337
+ filters: [
338
+ {
339
+ fieldName: "type",
340
+ values: [
341
+ {
342
+ value: "Spreadsheet",
343
+ relationType: "EQUALS",
344
+ },
345
+ {
346
+ value: "Presentation",
347
+ relationType: "EQUALS",
348
+ },
349
+ ],
350
+ },
351
+ ],
352
+ },
353
+ ],
354
+ facetBucketSize: 129663,
355
+ authTokens: [
356
+ {
357
+ accessToken: "123abc",
358
+ datasource: "gmail",
359
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
360
+ tokenType: "Bearer",
361
+ authUser: "1",
362
+ },
363
+ ],
364
+ },
365
+ inputDetails: {
366
+ hasCopyPaste: true,
367
+ },
368
+ },
369
+ },
370
+ ],
54
371
  metadata: {
55
372
  type: "FULL_TIME",
56
373
  title: "Actor",
@@ -67,12 +384,32 @@ async function run() {
67
384
  },
68
385
  ],
69
386
  querySuggestions: {
70
- suggestions: [],
387
+ suggestions: [
388
+ {
389
+ query: "app:github type:pull author:mortimer",
390
+ label: "Mortimer's PRs",
391
+ datasource: "github",
392
+ },
393
+ ],
71
394
  },
72
395
  inviteInfo: {
73
- invites: [],
396
+ invites: [
397
+ {},
398
+ {},
399
+ ],
74
400
  },
75
- customFields: [],
401
+ customFields: [
402
+ {
403
+ label: "<value>",
404
+ values: [
405
+ {},
406
+ ],
407
+ },
408
+ {
409
+ label: "<value>",
410
+ values: [],
411
+ },
412
+ ],
76
413
  badges: [
77
414
  {
78
415
  key: "deployment_name_new_hire",
@@ -89,86 +426,10 @@ async function run() {
89
426
  },
90
427
  role: "OWNER",
91
428
  },
92
- {
93
- role: "VERIFIER",
94
- },
95
- ],
96
- removedRoles: [
97
- {
98
- role: "VERIFIER",
99
- },
100
- {
101
- role: "ANSWER_MODERATOR",
102
- },
103
- {
104
- role: "OWNER",
105
- },
106
- ],
107
- roles: [
108
- {
109
- role: "ANSWER_MODERATOR",
110
- },
111
- {
112
- role: "OWNER",
113
- },
114
- {
115
- role: "VERIFIER",
116
- },
117
- ],
118
- combinedAnswerText: {
119
- 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.",
120
- },
121
- },
122
- });
123
-
124
- // Handle the result
125
- console.log(result);
126
- }
127
-
128
- run();
129
- ```
130
-
131
- ### Standalone function
132
-
133
- The standalone function version of this method:
134
-
135
- ```typescript
136
- import { GleanCore } from "@gleanwork/api-client/core.js";
137
- import { clientAnswersCreate } from "@gleanwork/api-client/funcs/clientAnswersCreate.js";
138
- import { RFCDate } from "@gleanwork/api-client/types";
139
-
140
- // Use `GleanCore` for best tree-shaking performance.
141
- // You can create one instance of it to use across an application.
142
- const glean = new GleanCore({
143
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
144
- });
145
-
146
- async function run() {
147
- const res = await clientAnswersCreate(glean, {
148
- data: {
149
- question: "Why is the sky blue?",
150
- bodyText: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
151
- audienceFilters: [
152
- {
153
- fieldName: "type",
154
- values: [
155
- {
156
- value: "Spreadsheet",
157
- relationType: "EQUALS",
158
- },
159
- {
160
- value: "Presentation",
161
- relationType: "EQUALS",
162
- },
163
- ],
164
- },
165
- ],
166
- addedRoles: [
167
429
  {
168
430
  person: {
169
431
  name: "George Clooney",
170
432
  obfuscatedId: "abc123",
171
- relatedDocuments: [],
172
433
  metadata: {
173
434
  type: "FULL_TIME",
174
435
  title: "Actor",
@@ -184,13 +445,8 @@ async function run() {
184
445
  handle: "<value>",
185
446
  },
186
447
  ],
187
- querySuggestions: {
188
- suggestions: [],
189
- },
190
- inviteInfo: {
191
- invites: [],
192
- },
193
- customFields: [],
448
+ querySuggestions: {},
449
+ inviteInfo: {},
194
450
  badges: [
195
451
  {
196
452
  key: "deployment_name_new_hire",
@@ -205,45 +461,1923 @@ async function run() {
205
461
  ],
206
462
  },
207
463
  },
208
- role: "OWNER",
209
- },
210
- {
211
464
  role: "VERIFIER",
212
465
  },
213
466
  ],
214
467
  removedRoles: [
215
468
  {
469
+ person: {
470
+ name: "George Clooney",
471
+ obfuscatedId: "abc123",
472
+ metadata: {
473
+ type: "FULL_TIME",
474
+ title: "Actor",
475
+ department: "Movies",
476
+ email: "george@example.com",
477
+ location: "Hollywood, CA",
478
+ phone: "6505551234",
479
+ photoUrl: "https://example.com/george.jpg",
480
+ startDate: new RFCDate("2000-01-23"),
481
+ datasourceProfile: [
482
+ {
483
+ datasource: "github",
484
+ handle: "<value>",
485
+ },
486
+ ],
487
+ querySuggestions: {},
488
+ inviteInfo: {},
489
+ badges: [
490
+ {
491
+ key: "deployment_name_new_hire",
492
+ displayName: "New hire",
493
+ iconConfig: {
494
+ color: "#343CED",
495
+ key: "person_icon",
496
+ iconType: "GLYPH",
497
+ name: "user",
498
+ },
499
+ },
500
+ ],
501
+ },
502
+ },
216
503
  role: "VERIFIER",
217
504
  },
218
505
  {
506
+ person: {
507
+ name: "George Clooney",
508
+ obfuscatedId: "abc123",
509
+ metadata: {
510
+ type: "FULL_TIME",
511
+ title: "Actor",
512
+ department: "Movies",
513
+ email: "george@example.com",
514
+ location: "Hollywood, CA",
515
+ phone: "6505551234",
516
+ photoUrl: "https://example.com/george.jpg",
517
+ startDate: new RFCDate("2000-01-23"),
518
+ datasourceProfile: [
519
+ {
520
+ datasource: "github",
521
+ handle: "<value>",
522
+ },
523
+ {
524
+ datasource: "github",
525
+ handle: "<value>",
526
+ },
527
+ {
528
+ datasource: "github",
529
+ handle: "<value>",
530
+ },
531
+ ],
532
+ querySuggestions: {},
533
+ inviteInfo: {},
534
+ badges: [
535
+ {
536
+ key: "deployment_name_new_hire",
537
+ displayName: "New hire",
538
+ iconConfig: {
539
+ color: "#343CED",
540
+ key: "person_icon",
541
+ iconType: "GLYPH",
542
+ name: "user",
543
+ },
544
+ },
545
+ ],
546
+ },
547
+ },
219
548
  role: "ANSWER_MODERATOR",
220
549
  },
221
550
  {
551
+ person: {
552
+ name: "George Clooney",
553
+ obfuscatedId: "abc123",
554
+ metadata: {
555
+ type: "FULL_TIME",
556
+ title: "Actor",
557
+ department: "Movies",
558
+ email: "george@example.com",
559
+ location: "Hollywood, CA",
560
+ phone: "6505551234",
561
+ photoUrl: "https://example.com/george.jpg",
562
+ startDate: new RFCDate("2000-01-23"),
563
+ datasourceProfile: [
564
+ {
565
+ datasource: "github",
566
+ handle: "<value>",
567
+ },
568
+ ],
569
+ querySuggestions: {},
570
+ inviteInfo: {},
571
+ badges: [
572
+ {
573
+ key: "deployment_name_new_hire",
574
+ displayName: "New hire",
575
+ iconConfig: {
576
+ color: "#343CED",
577
+ key: "person_icon",
578
+ iconType: "GLYPH",
579
+ name: "user",
580
+ },
581
+ },
582
+ ],
583
+ },
584
+ },
222
585
  role: "OWNER",
223
586
  },
224
587
  ],
225
588
  roles: [
226
589
  {
590
+ person: {
591
+ name: "George Clooney",
592
+ obfuscatedId: "abc123",
593
+ metadata: {
594
+ type: "FULL_TIME",
595
+ title: "Actor",
596
+ department: "Movies",
597
+ email: "george@example.com",
598
+ location: "Hollywood, CA",
599
+ phone: "6505551234",
600
+ photoUrl: "https://example.com/george.jpg",
601
+ startDate: new RFCDate("2000-01-23"),
602
+ datasourceProfile: [
603
+ {
604
+ datasource: "github",
605
+ handle: "<value>",
606
+ },
607
+ {
608
+ datasource: "github",
609
+ handle: "<value>",
610
+ },
611
+ ],
612
+ querySuggestions: {},
613
+ inviteInfo: {},
614
+ badges: [
615
+ {
616
+ key: "deployment_name_new_hire",
617
+ displayName: "New hire",
618
+ iconConfig: {
619
+ color: "#343CED",
620
+ key: "person_icon",
621
+ iconType: "GLYPH",
622
+ name: "user",
623
+ },
624
+ },
625
+ ],
626
+ },
627
+ },
227
628
  role: "ANSWER_MODERATOR",
228
629
  },
229
630
  {
230
- role: "OWNER",
231
- },
232
- {
233
- role: "VERIFIER",
234
- },
235
- ],
236
- combinedAnswerText: {
237
- 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.",
238
- },
239
- },
240
- });
241
-
242
- if (!res.ok) {
243
- throw res.error;
244
- }
631
+ person: {
632
+ name: "George Clooney",
633
+ obfuscatedId: "abc123",
634
+ metadata: {
635
+ type: "FULL_TIME",
636
+ title: "Actor",
637
+ department: "Movies",
638
+ email: "george@example.com",
639
+ location: "Hollywood, CA",
640
+ phone: "6505551234",
641
+ photoUrl: "https://example.com/george.jpg",
642
+ startDate: new RFCDate("2000-01-23"),
643
+ datasourceProfile: [
644
+ {
645
+ datasource: "github",
646
+ handle: "<value>",
647
+ },
648
+ {
649
+ datasource: "github",
650
+ handle: "<value>",
651
+ },
652
+ {
653
+ datasource: "github",
654
+ handle: "<value>",
655
+ },
656
+ ],
657
+ querySuggestions: {},
658
+ inviteInfo: {},
659
+ badges: [
660
+ {
661
+ key: "deployment_name_new_hire",
662
+ displayName: "New hire",
663
+ iconConfig: {
664
+ color: "#343CED",
665
+ key: "person_icon",
666
+ iconType: "GLYPH",
667
+ name: "user",
668
+ },
669
+ },
670
+ ],
671
+ },
672
+ },
673
+ role: "OWNER",
674
+ },
675
+ {
676
+ person: {
677
+ name: "George Clooney",
678
+ obfuscatedId: "abc123",
679
+ metadata: {
680
+ type: "FULL_TIME",
681
+ title: "Actor",
682
+ department: "Movies",
683
+ email: "george@example.com",
684
+ location: "Hollywood, CA",
685
+ phone: "6505551234",
686
+ photoUrl: "https://example.com/george.jpg",
687
+ startDate: new RFCDate("2000-01-23"),
688
+ datasourceProfile: [
689
+ {
690
+ datasource: "github",
691
+ handle: "<value>",
692
+ },
693
+ {
694
+ datasource: "github",
695
+ handle: "<value>",
696
+ },
697
+ {
698
+ datasource: "github",
699
+ handle: "<value>",
700
+ },
701
+ ],
702
+ querySuggestions: {},
703
+ inviteInfo: {},
704
+ badges: [
705
+ {
706
+ key: "deployment_name_new_hire",
707
+ displayName: "New hire",
708
+ iconConfig: {
709
+ color: "#343CED",
710
+ key: "person_icon",
711
+ iconType: "GLYPH",
712
+ name: "user",
713
+ },
714
+ },
715
+ ],
716
+ },
717
+ },
718
+ role: "VERIFIER",
719
+ },
720
+ ],
721
+ combinedAnswerText: {
722
+ 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.",
723
+ },
724
+ },
725
+ });
245
726
 
246
- const { value: result } = res;
727
+ // Handle the result
728
+ console.log(result);
729
+ }
730
+
731
+ run();
732
+ ```
733
+
734
+ ### Standalone function
735
+
736
+ The standalone function version of this method:
737
+
738
+ ```typescript
739
+ import { GleanCore } from "@gleanwork/api-client/core.js";
740
+ import { clientAnswersCreate } from "@gleanwork/api-client/funcs/clientAnswersCreate.js";
741
+ import { RFCDate } from "@gleanwork/api-client/types";
742
+
743
+ // Use `GleanCore` for best tree-shaking performance.
744
+ // You can create one instance of it to use across an application.
745
+ const glean = new GleanCore({
746
+ apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
747
+ });
748
+
749
+ async function run() {
750
+ const res = await clientAnswersCreate(glean, {
751
+ data: {
752
+ question: "Why is the sky blue?",
753
+ bodyText: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
754
+ audienceFilters: [
755
+ {
756
+ fieldName: "type",
757
+ values: [
758
+ {
759
+ value: "Spreadsheet",
760
+ relationType: "EQUALS",
761
+ },
762
+ {
763
+ value: "Presentation",
764
+ relationType: "EQUALS",
765
+ },
766
+ ],
767
+ },
768
+ ],
769
+ addedRoles: [
770
+ {
771
+ person: {
772
+ name: "George Clooney",
773
+ obfuscatedId: "abc123",
774
+ relatedDocuments: [
775
+ {
776
+ querySuggestion: {
777
+ query: "app:github type:pull author:mortimer",
778
+ searchProviderInfo: {
779
+ name: "Google",
780
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
781
+ },
782
+ label: "Mortimer's PRs",
783
+ datasource: "github",
784
+ requestOptions: {
785
+ datasourceFilter: "JIRA",
786
+ datasourcesFilter: [
787
+ "JIRA",
788
+ ],
789
+ queryOverridesFacetFilters: true,
790
+ facetFilters: [
791
+ {
792
+ fieldName: "type",
793
+ values: [
794
+ {
795
+ value: "Spreadsheet",
796
+ relationType: "EQUALS",
797
+ },
798
+ {
799
+ value: "Presentation",
800
+ relationType: "EQUALS",
801
+ },
802
+ ],
803
+ },
804
+ ],
805
+ facetFilterSets: [
806
+ {
807
+ filters: [
808
+ {
809
+ fieldName: "type",
810
+ values: [
811
+ {
812
+ value: "Spreadsheet",
813
+ relationType: "EQUALS",
814
+ },
815
+ {
816
+ value: "Presentation",
817
+ relationType: "EQUALS",
818
+ },
819
+ ],
820
+ },
821
+ ],
822
+ },
823
+ {
824
+ filters: [
825
+ {
826
+ fieldName: "type",
827
+ values: [
828
+ {
829
+ value: "Spreadsheet",
830
+ relationType: "EQUALS",
831
+ },
832
+ {
833
+ value: "Presentation",
834
+ relationType: "EQUALS",
835
+ },
836
+ ],
837
+ },
838
+ ],
839
+ },
840
+ ],
841
+ facetBucketSize: 134365,
842
+ authTokens: [
843
+ {
844
+ accessToken: "123abc",
845
+ datasource: "gmail",
846
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
847
+ tokenType: "Bearer",
848
+ authUser: "1",
849
+ },
850
+ ],
851
+ },
852
+ ranges: [
853
+ {
854
+ startIndex: 796474,
855
+ document: {
856
+ metadata: {
857
+ datasource: "datasource",
858
+ objectType: "Feature Request",
859
+ container: "container",
860
+ parentId: "JIRA_EN-1337",
861
+ mimeType: "mimeType",
862
+ documentId: "documentId",
863
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
864
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
865
+ components: [
866
+ "Backend",
867
+ "Networking",
868
+ ],
869
+ status: "[\"Done\"]",
870
+ pins: [
871
+ {
872
+ audienceFilters: [
873
+ {
874
+ fieldName: "type",
875
+ values: [
876
+ {
877
+ value: "Spreadsheet",
878
+ relationType: "EQUALS",
879
+ },
880
+ {
881
+ value: "Presentation",
882
+ relationType: "EQUALS",
883
+ },
884
+ ],
885
+ },
886
+ ],
887
+ documentId: "<id>",
888
+ },
889
+ {
890
+ audienceFilters: [
891
+ {
892
+ fieldName: "type",
893
+ values: [
894
+ {
895
+ value: "Spreadsheet",
896
+ relationType: "EQUALS",
897
+ },
898
+ {
899
+ value: "Presentation",
900
+ relationType: "EQUALS",
901
+ },
902
+ ],
903
+ },
904
+ ],
905
+ documentId: "<id>",
906
+ },
907
+ {
908
+ audienceFilters: [
909
+ {
910
+ fieldName: "type",
911
+ values: [
912
+ {
913
+ value: "Spreadsheet",
914
+ relationType: "EQUALS",
915
+ },
916
+ {
917
+ value: "Presentation",
918
+ relationType: "EQUALS",
919
+ },
920
+ ],
921
+ },
922
+ ],
923
+ documentId: "<id>",
924
+ },
925
+ ],
926
+ collections: [
927
+ {
928
+ name: "<value>",
929
+ description: "fumigate convection though zowie",
930
+ audienceFilters: [
931
+ {
932
+ fieldName: "type",
933
+ values: [
934
+ {
935
+ value: "Spreadsheet",
936
+ relationType: "EQUALS",
937
+ },
938
+ {
939
+ value: "Presentation",
940
+ relationType: "EQUALS",
941
+ },
942
+ ],
943
+ },
944
+ ],
945
+ id: 496323,
946
+ items: [
947
+ {
948
+ collectionId: 782367,
949
+ shortcut: {
950
+ inputAlias: "<value>",
951
+ },
952
+ itemType: "URL",
953
+ },
954
+ ],
955
+ },
956
+ ],
957
+ interactions: {
958
+ reacts: [
959
+ {},
960
+ {},
961
+ {},
962
+ ],
963
+ shares: [
964
+ {
965
+ numDaysAgo: 219974,
966
+ },
967
+ {
968
+ numDaysAgo: 449221,
969
+ },
970
+ {
971
+ numDaysAgo: 427887,
972
+ },
973
+ ],
974
+ },
975
+ verification: {
976
+ state: "VERIFIED",
977
+ metadata: {
978
+ reminders: [
979
+ {
980
+ assignee: {
981
+ name: "George Clooney",
982
+ obfuscatedId: "abc123",
983
+ },
984
+ remindAt: 491427,
985
+ },
986
+ ],
987
+ lastReminder: {
988
+ assignee: {
989
+ name: "George Clooney",
990
+ obfuscatedId: "abc123",
991
+ },
992
+ remindAt: 490420,
993
+ },
994
+ },
995
+ },
996
+ shortcuts: [
997
+ {
998
+ inputAlias: "<value>",
999
+ },
1000
+ ],
1001
+ customData: {
1002
+ "someCustomField": {},
1003
+ },
1004
+ },
1005
+ },
1006
+ },
1007
+ ],
1008
+ inputDetails: {
1009
+ hasCopyPaste: true,
1010
+ },
1011
+ },
1012
+ results: [
1013
+ {
1014
+ title: "title",
1015
+ url: "https://example.com/foo/bar",
1016
+ nativeAppUrl: "slack://foo/bar",
1017
+ snippets: [
1018
+ {
1019
+ snippet: "snippet",
1020
+ mimeType: "mimeType",
1021
+ },
1022
+ ],
1023
+ },
1024
+ ],
1025
+ },
1026
+ {
1027
+ querySuggestion: {
1028
+ query: "app:github type:pull author:mortimer",
1029
+ searchProviderInfo: {
1030
+ name: "Google",
1031
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
1032
+ },
1033
+ label: "Mortimer's PRs",
1034
+ datasource: "github",
1035
+ requestOptions: {
1036
+ datasourceFilter: "JIRA",
1037
+ datasourcesFilter: [
1038
+ "JIRA",
1039
+ ],
1040
+ queryOverridesFacetFilters: true,
1041
+ facetFilters: [
1042
+ {
1043
+ fieldName: "type",
1044
+ values: [
1045
+ {
1046
+ value: "Spreadsheet",
1047
+ relationType: "EQUALS",
1048
+ },
1049
+ {
1050
+ value: "Presentation",
1051
+ relationType: "EQUALS",
1052
+ },
1053
+ ],
1054
+ },
1055
+ ],
1056
+ facetFilterSets: [
1057
+ {
1058
+ filters: [
1059
+ {
1060
+ fieldName: "type",
1061
+ values: [
1062
+ {
1063
+ value: "Spreadsheet",
1064
+ relationType: "EQUALS",
1065
+ },
1066
+ {
1067
+ value: "Presentation",
1068
+ relationType: "EQUALS",
1069
+ },
1070
+ ],
1071
+ },
1072
+ ],
1073
+ },
1074
+ ],
1075
+ facetBucketSize: 129663,
1076
+ authTokens: [
1077
+ {
1078
+ accessToken: "123abc",
1079
+ datasource: "gmail",
1080
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
1081
+ tokenType: "Bearer",
1082
+ authUser: "1",
1083
+ },
1084
+ ],
1085
+ },
1086
+ inputDetails: {
1087
+ hasCopyPaste: true,
1088
+ },
1089
+ },
1090
+ },
1091
+ ],
1092
+ metadata: {
1093
+ type: "FULL_TIME",
1094
+ title: "Actor",
1095
+ department: "Movies",
1096
+ email: "george@example.com",
1097
+ location: "Hollywood, CA",
1098
+ phone: "6505551234",
1099
+ photoUrl: "https://example.com/george.jpg",
1100
+ startDate: new RFCDate("2000-01-23"),
1101
+ datasourceProfile: [
1102
+ {
1103
+ datasource: "github",
1104
+ handle: "<value>",
1105
+ },
1106
+ ],
1107
+ querySuggestions: {
1108
+ suggestions: [
1109
+ {
1110
+ query: "app:github type:pull author:mortimer",
1111
+ label: "Mortimer's PRs",
1112
+ datasource: "github",
1113
+ },
1114
+ ],
1115
+ },
1116
+ inviteInfo: {
1117
+ invites: [
1118
+ {},
1119
+ {},
1120
+ ],
1121
+ },
1122
+ customFields: [
1123
+ {
1124
+ label: "<value>",
1125
+ values: [
1126
+ {},
1127
+ ],
1128
+ },
1129
+ {
1130
+ label: "<value>",
1131
+ values: [],
1132
+ },
1133
+ ],
1134
+ badges: [
1135
+ {
1136
+ key: "deployment_name_new_hire",
1137
+ displayName: "New hire",
1138
+ iconConfig: {
1139
+ color: "#343CED",
1140
+ key: "person_icon",
1141
+ iconType: "GLYPH",
1142
+ name: "user",
1143
+ },
1144
+ },
1145
+ ],
1146
+ },
1147
+ },
1148
+ role: "OWNER",
1149
+ },
1150
+ {
1151
+ person: {
1152
+ name: "George Clooney",
1153
+ obfuscatedId: "abc123",
1154
+ metadata: {
1155
+ type: "FULL_TIME",
1156
+ title: "Actor",
1157
+ department: "Movies",
1158
+ email: "george@example.com",
1159
+ location: "Hollywood, CA",
1160
+ phone: "6505551234",
1161
+ photoUrl: "https://example.com/george.jpg",
1162
+ startDate: new RFCDate("2000-01-23"),
1163
+ datasourceProfile: [
1164
+ {
1165
+ datasource: "github",
1166
+ handle: "<value>",
1167
+ },
1168
+ ],
1169
+ querySuggestions: {},
1170
+ inviteInfo: {},
1171
+ badges: [
1172
+ {
1173
+ key: "deployment_name_new_hire",
1174
+ displayName: "New hire",
1175
+ iconConfig: {
1176
+ color: "#343CED",
1177
+ key: "person_icon",
1178
+ iconType: "GLYPH",
1179
+ name: "user",
1180
+ },
1181
+ },
1182
+ ],
1183
+ },
1184
+ },
1185
+ role: "VERIFIER",
1186
+ },
1187
+ ],
1188
+ removedRoles: [
1189
+ {
1190
+ person: {
1191
+ name: "George Clooney",
1192
+ obfuscatedId: "abc123",
1193
+ metadata: {
1194
+ type: "FULL_TIME",
1195
+ title: "Actor",
1196
+ department: "Movies",
1197
+ email: "george@example.com",
1198
+ location: "Hollywood, CA",
1199
+ phone: "6505551234",
1200
+ photoUrl: "https://example.com/george.jpg",
1201
+ startDate: new RFCDate("2000-01-23"),
1202
+ datasourceProfile: [
1203
+ {
1204
+ datasource: "github",
1205
+ handle: "<value>",
1206
+ },
1207
+ ],
1208
+ querySuggestions: {},
1209
+ inviteInfo: {},
1210
+ badges: [
1211
+ {
1212
+ key: "deployment_name_new_hire",
1213
+ displayName: "New hire",
1214
+ iconConfig: {
1215
+ color: "#343CED",
1216
+ key: "person_icon",
1217
+ iconType: "GLYPH",
1218
+ name: "user",
1219
+ },
1220
+ },
1221
+ ],
1222
+ },
1223
+ },
1224
+ role: "VERIFIER",
1225
+ },
1226
+ {
1227
+ person: {
1228
+ name: "George Clooney",
1229
+ obfuscatedId: "abc123",
1230
+ metadata: {
1231
+ type: "FULL_TIME",
1232
+ title: "Actor",
1233
+ department: "Movies",
1234
+ email: "george@example.com",
1235
+ location: "Hollywood, CA",
1236
+ phone: "6505551234",
1237
+ photoUrl: "https://example.com/george.jpg",
1238
+ startDate: new RFCDate("2000-01-23"),
1239
+ datasourceProfile: [
1240
+ {
1241
+ datasource: "github",
1242
+ handle: "<value>",
1243
+ },
1244
+ {
1245
+ datasource: "github",
1246
+ handle: "<value>",
1247
+ },
1248
+ {
1249
+ datasource: "github",
1250
+ handle: "<value>",
1251
+ },
1252
+ ],
1253
+ querySuggestions: {},
1254
+ inviteInfo: {},
1255
+ badges: [
1256
+ {
1257
+ key: "deployment_name_new_hire",
1258
+ displayName: "New hire",
1259
+ iconConfig: {
1260
+ color: "#343CED",
1261
+ key: "person_icon",
1262
+ iconType: "GLYPH",
1263
+ name: "user",
1264
+ },
1265
+ },
1266
+ ],
1267
+ },
1268
+ },
1269
+ role: "ANSWER_MODERATOR",
1270
+ },
1271
+ {
1272
+ person: {
1273
+ name: "George Clooney",
1274
+ obfuscatedId: "abc123",
1275
+ metadata: {
1276
+ type: "FULL_TIME",
1277
+ title: "Actor",
1278
+ department: "Movies",
1279
+ email: "george@example.com",
1280
+ location: "Hollywood, CA",
1281
+ phone: "6505551234",
1282
+ photoUrl: "https://example.com/george.jpg",
1283
+ startDate: new RFCDate("2000-01-23"),
1284
+ datasourceProfile: [
1285
+ {
1286
+ datasource: "github",
1287
+ handle: "<value>",
1288
+ },
1289
+ ],
1290
+ querySuggestions: {},
1291
+ inviteInfo: {},
1292
+ badges: [
1293
+ {
1294
+ key: "deployment_name_new_hire",
1295
+ displayName: "New hire",
1296
+ iconConfig: {
1297
+ color: "#343CED",
1298
+ key: "person_icon",
1299
+ iconType: "GLYPH",
1300
+ name: "user",
1301
+ },
1302
+ },
1303
+ ],
1304
+ },
1305
+ },
1306
+ role: "OWNER",
1307
+ },
1308
+ ],
1309
+ roles: [
1310
+ {
1311
+ person: {
1312
+ name: "George Clooney",
1313
+ obfuscatedId: "abc123",
1314
+ metadata: {
1315
+ type: "FULL_TIME",
1316
+ title: "Actor",
1317
+ department: "Movies",
1318
+ email: "george@example.com",
1319
+ location: "Hollywood, CA",
1320
+ phone: "6505551234",
1321
+ photoUrl: "https://example.com/george.jpg",
1322
+ startDate: new RFCDate("2000-01-23"),
1323
+ datasourceProfile: [
1324
+ {
1325
+ datasource: "github",
1326
+ handle: "<value>",
1327
+ },
1328
+ {
1329
+ datasource: "github",
1330
+ handle: "<value>",
1331
+ },
1332
+ ],
1333
+ querySuggestions: {},
1334
+ inviteInfo: {},
1335
+ badges: [
1336
+ {
1337
+ key: "deployment_name_new_hire",
1338
+ displayName: "New hire",
1339
+ iconConfig: {
1340
+ color: "#343CED",
1341
+ key: "person_icon",
1342
+ iconType: "GLYPH",
1343
+ name: "user",
1344
+ },
1345
+ },
1346
+ ],
1347
+ },
1348
+ },
1349
+ role: "ANSWER_MODERATOR",
1350
+ },
1351
+ {
1352
+ person: {
1353
+ name: "George Clooney",
1354
+ obfuscatedId: "abc123",
1355
+ metadata: {
1356
+ type: "FULL_TIME",
1357
+ title: "Actor",
1358
+ department: "Movies",
1359
+ email: "george@example.com",
1360
+ location: "Hollywood, CA",
1361
+ phone: "6505551234",
1362
+ photoUrl: "https://example.com/george.jpg",
1363
+ startDate: new RFCDate("2000-01-23"),
1364
+ datasourceProfile: [
1365
+ {
1366
+ datasource: "github",
1367
+ handle: "<value>",
1368
+ },
1369
+ {
1370
+ datasource: "github",
1371
+ handle: "<value>",
1372
+ },
1373
+ {
1374
+ datasource: "github",
1375
+ handle: "<value>",
1376
+ },
1377
+ ],
1378
+ querySuggestions: {},
1379
+ inviteInfo: {},
1380
+ badges: [
1381
+ {
1382
+ key: "deployment_name_new_hire",
1383
+ displayName: "New hire",
1384
+ iconConfig: {
1385
+ color: "#343CED",
1386
+ key: "person_icon",
1387
+ iconType: "GLYPH",
1388
+ name: "user",
1389
+ },
1390
+ },
1391
+ ],
1392
+ },
1393
+ },
1394
+ role: "OWNER",
1395
+ },
1396
+ {
1397
+ person: {
1398
+ name: "George Clooney",
1399
+ obfuscatedId: "abc123",
1400
+ metadata: {
1401
+ type: "FULL_TIME",
1402
+ title: "Actor",
1403
+ department: "Movies",
1404
+ email: "george@example.com",
1405
+ location: "Hollywood, CA",
1406
+ phone: "6505551234",
1407
+ photoUrl: "https://example.com/george.jpg",
1408
+ startDate: new RFCDate("2000-01-23"),
1409
+ datasourceProfile: [
1410
+ {
1411
+ datasource: "github",
1412
+ handle: "<value>",
1413
+ },
1414
+ {
1415
+ datasource: "github",
1416
+ handle: "<value>",
1417
+ },
1418
+ {
1419
+ datasource: "github",
1420
+ handle: "<value>",
1421
+ },
1422
+ ],
1423
+ querySuggestions: {},
1424
+ inviteInfo: {},
1425
+ badges: [
1426
+ {
1427
+ key: "deployment_name_new_hire",
1428
+ displayName: "New hire",
1429
+ iconConfig: {
1430
+ color: "#343CED",
1431
+ key: "person_icon",
1432
+ iconType: "GLYPH",
1433
+ name: "user",
1434
+ },
1435
+ },
1436
+ ],
1437
+ },
1438
+ },
1439
+ role: "VERIFIER",
1440
+ },
1441
+ ],
1442
+ combinedAnswerText: {
1443
+ 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.",
1444
+ },
1445
+ },
1446
+ });
1447
+
1448
+ if (!res.ok) {
1449
+ throw res.error;
1450
+ }
1451
+
1452
+ const { value: result } = res;
1453
+
1454
+ // Handle the result
1455
+ console.log(result);
1456
+ }
1457
+
1458
+ run();
1459
+ ```
1460
+
1461
+ ### React hooks and utilities
1462
+
1463
+ This method can be used in React components through the following hooks and
1464
+ associated utilities.
1465
+
1466
+ > Check out [this guide][hook-guide] for information about each of the utilities
1467
+ > below and how to get started using React hooks.
1468
+
1469
+ [hook-guide]: ../../../REACT_QUERY.md
1470
+
1471
+ ```tsx
1472
+ import {
1473
+ // Mutation hook for triggering the API call.
1474
+ useClientAnswersCreateMutation
1475
+ } from "@gleanwork/api-client/react-query/clientAnswersCreate.js";
1476
+ ```
1477
+
1478
+ ### Parameters
1479
+
1480
+ | Parameter | Type | Required | Description |
1481
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1482
+ | `request` | [components.CreateAnswerRequest](../../models/components/createanswerrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1483
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1484
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1485
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1486
+
1487
+ ### Response
1488
+
1489
+ **Promise\<[components.Answer](../../models/components/answer.md)\>**
1490
+
1491
+ ### Errors
1492
+
1493
+ | Error Type | Status Code | Content Type |
1494
+ | ----------------- | ----------------- | ----------------- |
1495
+ | errors.GleanError | 4XX, 5XX | \*/\* |
1496
+
1497
+ ## delete
1498
+
1499
+ Delete an existing user-generated Answer.
1500
+
1501
+ ### Example Usage
1502
+
1503
+ ```typescript
1504
+ import { Glean } from "@gleanwork/api-client";
1505
+
1506
+ const glean = new Glean({
1507
+ apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1508
+ });
1509
+
1510
+ async function run() {
1511
+ await glean.client.answers.delete({
1512
+ id: 3,
1513
+ docId: "ANSWERS_answer_3",
1514
+ });
1515
+
1516
+
1517
+ }
1518
+
1519
+ run();
1520
+ ```
1521
+
1522
+ ### Standalone function
1523
+
1524
+ The standalone function version of this method:
1525
+
1526
+ ```typescript
1527
+ import { GleanCore } from "@gleanwork/api-client/core.js";
1528
+ import { clientAnswersDelete } from "@gleanwork/api-client/funcs/clientAnswersDelete.js";
1529
+
1530
+ // Use `GleanCore` for best tree-shaking performance.
1531
+ // You can create one instance of it to use across an application.
1532
+ const glean = new GleanCore({
1533
+ apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1534
+ });
1535
+
1536
+ async function run() {
1537
+ const res = await clientAnswersDelete(glean, {
1538
+ id: 3,
1539
+ docId: "ANSWERS_answer_3",
1540
+ });
1541
+
1542
+ if (!res.ok) {
1543
+ throw res.error;
1544
+ }
1545
+
1546
+ const { value: result } = res;
1547
+
1548
+
1549
+ }
1550
+
1551
+ run();
1552
+ ```
1553
+
1554
+ ### React hooks and utilities
1555
+
1556
+ This method can be used in React components through the following hooks and
1557
+ associated utilities.
1558
+
1559
+ > Check out [this guide][hook-guide] for information about each of the utilities
1560
+ > below and how to get started using React hooks.
1561
+
1562
+ [hook-guide]: ../../../REACT_QUERY.md
1563
+
1564
+ ```tsx
1565
+ import {
1566
+ // Mutation hook for triggering the API call.
1567
+ useClientAnswersDeleteMutation
1568
+ } from "@gleanwork/api-client/react-query/clientAnswersDelete.js";
1569
+ ```
1570
+
1571
+ ### Parameters
1572
+
1573
+ | Parameter | Type | Required | Description |
1574
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1575
+ | `request` | [components.DeleteAnswerRequest](../../models/components/deleteanswerrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1576
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1577
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1578
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1579
+
1580
+ ### Response
1581
+
1582
+ **Promise\<void\>**
1583
+
1584
+ ### Errors
1585
+
1586
+ | Error Type | Status Code | Content Type |
1587
+ | ----------------- | ----------------- | ----------------- |
1588
+ | errors.GleanError | 4XX, 5XX | \*/\* |
1589
+
1590
+ ## update
1591
+
1592
+ Update an existing user-generated Answer.
1593
+
1594
+ ### Example Usage
1595
+
1596
+ ```typescript
1597
+ import { Glean } from "@gleanwork/api-client";
1598
+ import { RFCDate } from "@gleanwork/api-client/types";
1599
+
1600
+ const glean = new Glean({
1601
+ apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1602
+ });
1603
+
1604
+ async function run() {
1605
+ const result = await glean.client.answers.update({
1606
+ id: 3,
1607
+ docId: "ANSWERS_answer_3",
1608
+ question: "Why is the sky blue?",
1609
+ bodyText: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
1610
+ audienceFilters: [
1611
+ {
1612
+ fieldName: "type",
1613
+ values: [
1614
+ {
1615
+ value: "Spreadsheet",
1616
+ relationType: "EQUALS",
1617
+ },
1618
+ {
1619
+ value: "Presentation",
1620
+ relationType: "EQUALS",
1621
+ },
1622
+ ],
1623
+ },
1624
+ ],
1625
+ addedRoles: [
1626
+ {
1627
+ person: {
1628
+ name: "George Clooney",
1629
+ obfuscatedId: "abc123",
1630
+ relatedDocuments: [
1631
+ {
1632
+ querySuggestion: {
1633
+ query: "app:github type:pull author:mortimer",
1634
+ searchProviderInfo: {
1635
+ name: "Google",
1636
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
1637
+ },
1638
+ label: "Mortimer's PRs",
1639
+ datasource: "github",
1640
+ requestOptions: {
1641
+ datasourceFilter: "JIRA",
1642
+ datasourcesFilter: [
1643
+ "JIRA",
1644
+ ],
1645
+ queryOverridesFacetFilters: true,
1646
+ facetFilters: [
1647
+ {
1648
+ fieldName: "type",
1649
+ values: [
1650
+ {
1651
+ value: "Spreadsheet",
1652
+ relationType: "EQUALS",
1653
+ },
1654
+ {
1655
+ value: "Presentation",
1656
+ relationType: "EQUALS",
1657
+ },
1658
+ ],
1659
+ },
1660
+ ],
1661
+ facetFilterSets: [
1662
+ {
1663
+ filters: [
1664
+ {
1665
+ fieldName: "type",
1666
+ values: [
1667
+ {
1668
+ value: "Spreadsheet",
1669
+ relationType: "EQUALS",
1670
+ },
1671
+ {
1672
+ value: "Presentation",
1673
+ relationType: "EQUALS",
1674
+ },
1675
+ ],
1676
+ },
1677
+ ],
1678
+ },
1679
+ {
1680
+ filters: [
1681
+ {
1682
+ fieldName: "type",
1683
+ values: [
1684
+ {
1685
+ value: "Spreadsheet",
1686
+ relationType: "EQUALS",
1687
+ },
1688
+ {
1689
+ value: "Presentation",
1690
+ relationType: "EQUALS",
1691
+ },
1692
+ ],
1693
+ },
1694
+ ],
1695
+ },
1696
+ ],
1697
+ facetBucketSize: 991464,
1698
+ authTokens: [
1699
+ {
1700
+ accessToken: "123abc",
1701
+ datasource: "gmail",
1702
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
1703
+ tokenType: "Bearer",
1704
+ authUser: "1",
1705
+ },
1706
+ ],
1707
+ },
1708
+ ranges: [
1709
+ {
1710
+ startIndex: 488852,
1711
+ document: {
1712
+ metadata: {
1713
+ datasource: "datasource",
1714
+ objectType: "Feature Request",
1715
+ container: "container",
1716
+ parentId: "JIRA_EN-1337",
1717
+ mimeType: "mimeType",
1718
+ documentId: "documentId",
1719
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
1720
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
1721
+ components: [
1722
+ "Backend",
1723
+ "Networking",
1724
+ ],
1725
+ status: "[\"Done\"]",
1726
+ pins: [
1727
+ {
1728
+ audienceFilters: [
1729
+ {
1730
+ fieldName: "type",
1731
+ values: [
1732
+ {
1733
+ value: "Spreadsheet",
1734
+ relationType: "EQUALS",
1735
+ },
1736
+ {
1737
+ value: "Presentation",
1738
+ relationType: "EQUALS",
1739
+ },
1740
+ ],
1741
+ },
1742
+ ],
1743
+ documentId: "<id>",
1744
+ },
1745
+ {
1746
+ audienceFilters: [
1747
+ {
1748
+ fieldName: "type",
1749
+ values: [
1750
+ {
1751
+ value: "Spreadsheet",
1752
+ relationType: "EQUALS",
1753
+ },
1754
+ {
1755
+ value: "Presentation",
1756
+ relationType: "EQUALS",
1757
+ },
1758
+ ],
1759
+ },
1760
+ ],
1761
+ documentId: "<id>",
1762
+ },
1763
+ {
1764
+ audienceFilters: [
1765
+ {
1766
+ fieldName: "type",
1767
+ values: [
1768
+ {
1769
+ value: "Spreadsheet",
1770
+ relationType: "EQUALS",
1771
+ },
1772
+ {
1773
+ value: "Presentation",
1774
+ relationType: "EQUALS",
1775
+ },
1776
+ ],
1777
+ },
1778
+ ],
1779
+ documentId: "<id>",
1780
+ },
1781
+ ],
1782
+ collections: [
1783
+ {
1784
+ name: "<value>",
1785
+ description: "eulogise whereas till mild than during meanwhile disapprove finer ha",
1786
+ audienceFilters: [
1787
+ {
1788
+ fieldName: "type",
1789
+ values: [
1790
+ {
1791
+ value: "Spreadsheet",
1792
+ relationType: "EQUALS",
1793
+ },
1794
+ {
1795
+ value: "Presentation",
1796
+ relationType: "EQUALS",
1797
+ },
1798
+ ],
1799
+ },
1800
+ ],
1801
+ id: 2984,
1802
+ items: [
1803
+ {
1804
+ collectionId: 477967,
1805
+ shortcut: {
1806
+ inputAlias: "<value>",
1807
+ },
1808
+ itemType: "COLLECTION",
1809
+ },
1810
+ {
1811
+ collectionId: 424273,
1812
+ shortcut: {
1813
+ inputAlias: "<value>",
1814
+ },
1815
+ itemType: "COLLECTION",
1816
+ },
1817
+ ],
1818
+ },
1819
+ ],
1820
+ interactions: {
1821
+ reacts: [
1822
+ {},
1823
+ ],
1824
+ shares: [
1825
+ {
1826
+ numDaysAgo: 301848,
1827
+ },
1828
+ {
1829
+ numDaysAgo: 657278,
1830
+ },
1831
+ ],
1832
+ },
1833
+ verification: {
1834
+ state: "UNVERIFIED",
1835
+ metadata: {
1836
+ reminders: [
1837
+ {
1838
+ assignee: {
1839
+ name: "George Clooney",
1840
+ obfuscatedId: "abc123",
1841
+ },
1842
+ remindAt: 335191,
1843
+ },
1844
+ ],
1845
+ lastReminder: {
1846
+ assignee: {
1847
+ name: "George Clooney",
1848
+ obfuscatedId: "abc123",
1849
+ },
1850
+ remindAt: 532806,
1851
+ },
1852
+ },
1853
+ },
1854
+ shortcuts: [
1855
+ {
1856
+ inputAlias: "<value>",
1857
+ },
1858
+ {
1859
+ inputAlias: "<value>",
1860
+ },
1861
+ {
1862
+ inputAlias: "<value>",
1863
+ },
1864
+ ],
1865
+ customData: {
1866
+ "someCustomField": {},
1867
+ },
1868
+ },
1869
+ },
1870
+ },
1871
+ {
1872
+ startIndex: 463392,
1873
+ document: {
1874
+ metadata: {
1875
+ datasource: "datasource",
1876
+ objectType: "Feature Request",
1877
+ container: "container",
1878
+ parentId: "JIRA_EN-1337",
1879
+ mimeType: "mimeType",
1880
+ documentId: "documentId",
1881
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
1882
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
1883
+ components: [
1884
+ "Backend",
1885
+ "Networking",
1886
+ ],
1887
+ status: "[\"Done\"]",
1888
+ interactions: {},
1889
+ verification: {
1890
+ state: "VERIFIED",
1891
+ metadata: {
1892
+ lastReminder: {
1893
+ assignee: {
1894
+ name: "George Clooney",
1895
+ obfuscatedId: "abc123",
1896
+ },
1897
+ remindAt: 58704,
1898
+ },
1899
+ },
1900
+ },
1901
+ customData: {
1902
+ "someCustomField": {},
1903
+ },
1904
+ },
1905
+ },
1906
+ },
1907
+ ],
1908
+ inputDetails: {
1909
+ hasCopyPaste: true,
1910
+ },
1911
+ },
1912
+ results: [
1913
+ {
1914
+ title: "title",
1915
+ url: "https://example.com/foo/bar",
1916
+ nativeAppUrl: "slack://foo/bar",
1917
+ snippets: [
1918
+ {
1919
+ snippet: "snippet",
1920
+ mimeType: "mimeType",
1921
+ },
1922
+ ],
1923
+ },
1924
+ ],
1925
+ },
1926
+ {
1927
+ querySuggestion: {
1928
+ query: "app:github type:pull author:mortimer",
1929
+ searchProviderInfo: {
1930
+ name: "Google",
1931
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
1932
+ },
1933
+ label: "Mortimer's PRs",
1934
+ datasource: "github",
1935
+ requestOptions: {
1936
+ datasourceFilter: "JIRA",
1937
+ datasourcesFilter: [
1938
+ "JIRA",
1939
+ ],
1940
+ queryOverridesFacetFilters: true,
1941
+ facetFilters: [
1942
+ {
1943
+ fieldName: "type",
1944
+ values: [
1945
+ {
1946
+ value: "Spreadsheet",
1947
+ relationType: "EQUALS",
1948
+ },
1949
+ {
1950
+ value: "Presentation",
1951
+ relationType: "EQUALS",
1952
+ },
1953
+ ],
1954
+ },
1955
+ ],
1956
+ facetFilterSets: [
1957
+ {
1958
+ filters: [
1959
+ {
1960
+ fieldName: "type",
1961
+ values: [
1962
+ {
1963
+ value: "Spreadsheet",
1964
+ relationType: "EQUALS",
1965
+ },
1966
+ {
1967
+ value: "Presentation",
1968
+ relationType: "EQUALS",
1969
+ },
1970
+ ],
1971
+ },
1972
+ ],
1973
+ },
1974
+ {
1975
+ filters: [
1976
+ {
1977
+ fieldName: "type",
1978
+ values: [
1979
+ {
1980
+ value: "Spreadsheet",
1981
+ relationType: "EQUALS",
1982
+ },
1983
+ {
1984
+ value: "Presentation",
1985
+ relationType: "EQUALS",
1986
+ },
1987
+ ],
1988
+ },
1989
+ ],
1990
+ },
1991
+ {
1992
+ filters: [
1993
+ {
1994
+ fieldName: "type",
1995
+ values: [
1996
+ {
1997
+ value: "Spreadsheet",
1998
+ relationType: "EQUALS",
1999
+ },
2000
+ {
2001
+ value: "Presentation",
2002
+ relationType: "EQUALS",
2003
+ },
2004
+ ],
2005
+ },
2006
+ ],
2007
+ },
2008
+ ],
2009
+ facetBucketSize: 326276,
2010
+ authTokens: [
2011
+ {
2012
+ accessToken: "123abc",
2013
+ datasource: "gmail",
2014
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
2015
+ tokenType: "Bearer",
2016
+ authUser: "1",
2017
+ },
2018
+ ],
2019
+ },
2020
+ inputDetails: {
2021
+ hasCopyPaste: true,
2022
+ },
2023
+ },
2024
+ },
2025
+ ],
2026
+ metadata: {
2027
+ type: "FULL_TIME",
2028
+ title: "Actor",
2029
+ department: "Movies",
2030
+ email: "george@example.com",
2031
+ location: "Hollywood, CA",
2032
+ phone: "6505551234",
2033
+ photoUrl: "https://example.com/george.jpg",
2034
+ startDate: new RFCDate("2000-01-23"),
2035
+ datasourceProfile: [
2036
+ {
2037
+ datasource: "github",
2038
+ handle: "<value>",
2039
+ },
2040
+ ],
2041
+ querySuggestions: {
2042
+ suggestions: [
2043
+ {
2044
+ query: "app:github type:pull author:mortimer",
2045
+ label: "Mortimer's PRs",
2046
+ datasource: "github",
2047
+ },
2048
+ ],
2049
+ },
2050
+ inviteInfo: {
2051
+ invites: [
2052
+ {},
2053
+ {},
2054
+ {},
2055
+ ],
2056
+ },
2057
+ customFields: [
2058
+ {
2059
+ label: "<value>",
2060
+ values: [
2061
+ {},
2062
+ ],
2063
+ },
2064
+ ],
2065
+ badges: [
2066
+ {
2067
+ key: "deployment_name_new_hire",
2068
+ displayName: "New hire",
2069
+ iconConfig: {
2070
+ color: "#343CED",
2071
+ key: "person_icon",
2072
+ iconType: "GLYPH",
2073
+ name: "user",
2074
+ },
2075
+ },
2076
+ ],
2077
+ },
2078
+ },
2079
+ role: "EDITOR",
2080
+ },
2081
+ {
2082
+ person: {
2083
+ name: "George Clooney",
2084
+ obfuscatedId: "abc123",
2085
+ metadata: {
2086
+ type: "FULL_TIME",
2087
+ title: "Actor",
2088
+ department: "Movies",
2089
+ email: "george@example.com",
2090
+ location: "Hollywood, CA",
2091
+ phone: "6505551234",
2092
+ photoUrl: "https://example.com/george.jpg",
2093
+ startDate: new RFCDate("2000-01-23"),
2094
+ datasourceProfile: [
2095
+ {
2096
+ datasource: "github",
2097
+ handle: "<value>",
2098
+ },
2099
+ {
2100
+ datasource: "github",
2101
+ handle: "<value>",
2102
+ },
2103
+ ],
2104
+ querySuggestions: {},
2105
+ inviteInfo: {},
2106
+ badges: [
2107
+ {
2108
+ key: "deployment_name_new_hire",
2109
+ displayName: "New hire",
2110
+ iconConfig: {
2111
+ color: "#343CED",
2112
+ key: "person_icon",
2113
+ iconType: "GLYPH",
2114
+ name: "user",
2115
+ },
2116
+ },
2117
+ ],
2118
+ },
2119
+ },
2120
+ role: "ANSWER_MODERATOR",
2121
+ },
2122
+ {
2123
+ person: {
2124
+ name: "George Clooney",
2125
+ obfuscatedId: "abc123",
2126
+ metadata: {
2127
+ type: "FULL_TIME",
2128
+ title: "Actor",
2129
+ department: "Movies",
2130
+ email: "george@example.com",
2131
+ location: "Hollywood, CA",
2132
+ phone: "6505551234",
2133
+ photoUrl: "https://example.com/george.jpg",
2134
+ startDate: new RFCDate("2000-01-23"),
2135
+ datasourceProfile: [
2136
+ {
2137
+ datasource: "github",
2138
+ handle: "<value>",
2139
+ },
2140
+ ],
2141
+ querySuggestions: {},
2142
+ inviteInfo: {},
2143
+ badges: [
2144
+ {
2145
+ key: "deployment_name_new_hire",
2146
+ displayName: "New hire",
2147
+ iconConfig: {
2148
+ color: "#343CED",
2149
+ key: "person_icon",
2150
+ iconType: "GLYPH",
2151
+ name: "user",
2152
+ },
2153
+ },
2154
+ ],
2155
+ },
2156
+ },
2157
+ role: "OWNER",
2158
+ },
2159
+ ],
2160
+ removedRoles: [
2161
+ {
2162
+ person: {
2163
+ name: "George Clooney",
2164
+ obfuscatedId: "abc123",
2165
+ metadata: {
2166
+ type: "FULL_TIME",
2167
+ title: "Actor",
2168
+ department: "Movies",
2169
+ email: "george@example.com",
2170
+ location: "Hollywood, CA",
2171
+ phone: "6505551234",
2172
+ photoUrl: "https://example.com/george.jpg",
2173
+ startDate: new RFCDate("2000-01-23"),
2174
+ datasourceProfile: [
2175
+ {
2176
+ datasource: "github",
2177
+ handle: "<value>",
2178
+ },
2179
+ {
2180
+ datasource: "github",
2181
+ handle: "<value>",
2182
+ },
2183
+ {
2184
+ datasource: "github",
2185
+ handle: "<value>",
2186
+ },
2187
+ ],
2188
+ querySuggestions: {},
2189
+ inviteInfo: {},
2190
+ badges: [
2191
+ {
2192
+ key: "deployment_name_new_hire",
2193
+ displayName: "New hire",
2194
+ iconConfig: {
2195
+ color: "#343CED",
2196
+ key: "person_icon",
2197
+ iconType: "GLYPH",
2198
+ name: "user",
2199
+ },
2200
+ },
2201
+ ],
2202
+ },
2203
+ },
2204
+ role: "OWNER",
2205
+ },
2206
+ {
2207
+ person: {
2208
+ name: "George Clooney",
2209
+ obfuscatedId: "abc123",
2210
+ metadata: {
2211
+ type: "FULL_TIME",
2212
+ title: "Actor",
2213
+ department: "Movies",
2214
+ email: "george@example.com",
2215
+ location: "Hollywood, CA",
2216
+ phone: "6505551234",
2217
+ photoUrl: "https://example.com/george.jpg",
2218
+ startDate: new RFCDate("2000-01-23"),
2219
+ datasourceProfile: [
2220
+ {
2221
+ datasource: "github",
2222
+ handle: "<value>",
2223
+ },
2224
+ {
2225
+ datasource: "github",
2226
+ handle: "<value>",
2227
+ },
2228
+ ],
2229
+ querySuggestions: {},
2230
+ inviteInfo: {},
2231
+ badges: [
2232
+ {
2233
+ key: "deployment_name_new_hire",
2234
+ displayName: "New hire",
2235
+ iconConfig: {
2236
+ color: "#343CED",
2237
+ key: "person_icon",
2238
+ iconType: "GLYPH",
2239
+ name: "user",
2240
+ },
2241
+ },
2242
+ ],
2243
+ },
2244
+ },
2245
+ role: "VERIFIER",
2246
+ },
2247
+ ],
2248
+ roles: [
2249
+ {
2250
+ person: {
2251
+ name: "George Clooney",
2252
+ obfuscatedId: "abc123",
2253
+ metadata: {
2254
+ type: "FULL_TIME",
2255
+ title: "Actor",
2256
+ department: "Movies",
2257
+ email: "george@example.com",
2258
+ location: "Hollywood, CA",
2259
+ phone: "6505551234",
2260
+ photoUrl: "https://example.com/george.jpg",
2261
+ startDate: new RFCDate("2000-01-23"),
2262
+ datasourceProfile: [
2263
+ {
2264
+ datasource: "github",
2265
+ handle: "<value>",
2266
+ },
2267
+ {
2268
+ datasource: "github",
2269
+ handle: "<value>",
2270
+ },
2271
+ {
2272
+ datasource: "github",
2273
+ handle: "<value>",
2274
+ },
2275
+ ],
2276
+ querySuggestions: {},
2277
+ inviteInfo: {},
2278
+ badges: [
2279
+ {
2280
+ key: "deployment_name_new_hire",
2281
+ displayName: "New hire",
2282
+ iconConfig: {
2283
+ color: "#343CED",
2284
+ key: "person_icon",
2285
+ iconType: "GLYPH",
2286
+ name: "user",
2287
+ },
2288
+ },
2289
+ ],
2290
+ },
2291
+ },
2292
+ role: "EDITOR",
2293
+ },
2294
+ {
2295
+ person: {
2296
+ name: "George Clooney",
2297
+ obfuscatedId: "abc123",
2298
+ metadata: {
2299
+ type: "FULL_TIME",
2300
+ title: "Actor",
2301
+ department: "Movies",
2302
+ email: "george@example.com",
2303
+ location: "Hollywood, CA",
2304
+ phone: "6505551234",
2305
+ photoUrl: "https://example.com/george.jpg",
2306
+ startDate: new RFCDate("2000-01-23"),
2307
+ datasourceProfile: [
2308
+ {
2309
+ datasource: "github",
2310
+ handle: "<value>",
2311
+ },
2312
+ ],
2313
+ querySuggestions: {},
2314
+ inviteInfo: {},
2315
+ badges: [
2316
+ {
2317
+ key: "deployment_name_new_hire",
2318
+ displayName: "New hire",
2319
+ iconConfig: {
2320
+ color: "#343CED",
2321
+ key: "person_icon",
2322
+ iconType: "GLYPH",
2323
+ name: "user",
2324
+ },
2325
+ },
2326
+ ],
2327
+ },
2328
+ },
2329
+ role: "VERIFIER",
2330
+ },
2331
+ {
2332
+ person: {
2333
+ name: "George Clooney",
2334
+ obfuscatedId: "abc123",
2335
+ metadata: {
2336
+ type: "FULL_TIME",
2337
+ title: "Actor",
2338
+ department: "Movies",
2339
+ email: "george@example.com",
2340
+ location: "Hollywood, CA",
2341
+ phone: "6505551234",
2342
+ photoUrl: "https://example.com/george.jpg",
2343
+ startDate: new RFCDate("2000-01-23"),
2344
+ datasourceProfile: [
2345
+ {
2346
+ datasource: "github",
2347
+ handle: "<value>",
2348
+ },
2349
+ {
2350
+ datasource: "github",
2351
+ handle: "<value>",
2352
+ },
2353
+ {
2354
+ datasource: "github",
2355
+ handle: "<value>",
2356
+ },
2357
+ ],
2358
+ querySuggestions: {},
2359
+ inviteInfo: {},
2360
+ badges: [
2361
+ {
2362
+ key: "deployment_name_new_hire",
2363
+ displayName: "New hire",
2364
+ iconConfig: {
2365
+ color: "#343CED",
2366
+ key: "person_icon",
2367
+ iconType: "GLYPH",
2368
+ name: "user",
2369
+ },
2370
+ },
2371
+ ],
2372
+ },
2373
+ },
2374
+ role: "ANSWER_MODERATOR",
2375
+ },
2376
+ ],
2377
+ combinedAnswerText: {
2378
+ 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.",
2379
+ },
2380
+ });
247
2381
 
248
2382
  // Handle the result
249
2383
  console.log(result);
@@ -252,74 +2386,14 @@ async function run() {
252
2386
  run();
253
2387
  ```
254
2388
 
255
- ### React hooks and utilities
256
-
257
- This method can be used in React components through the following hooks and
258
- associated utilities.
259
-
260
- > Check out [this guide][hook-guide] for information about each of the utilities
261
- > below and how to get started using React hooks.
262
-
263
- [hook-guide]: ../../../REACT_QUERY.md
264
-
265
- ```tsx
266
- import {
267
- // Mutation hook for triggering the API call.
268
- useClientAnswersCreateMutation
269
- } from "@gleanwork/api-client/react-query/clientAnswersCreate.js";
270
- ```
271
-
272
- ### Parameters
273
-
274
- | Parameter | Type | Required | Description |
275
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
276
- | `request` | [components.CreateAnswerRequest](../../models/components/createanswerrequest.md) | :heavy_check_mark: | The request object to use for the request. |
277
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
278
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
279
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
280
-
281
- ### Response
282
-
283
- **Promise\<[components.Answer](../../models/components/answer.md)\>**
284
-
285
- ### Errors
286
-
287
- | Error Type | Status Code | Content Type |
288
- | ----------------- | ----------------- | ----------------- |
289
- | errors.GleanError | 4XX, 5XX | \*/\* |
290
-
291
- ## delete
292
-
293
- Delete an existing user-generated Answer.
294
-
295
- ### Example Usage
296
-
297
- ```typescript
298
- import { Glean } from "@gleanwork/api-client";
299
-
300
- const glean = new Glean({
301
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
302
- });
303
-
304
- async function run() {
305
- await glean.client.answers.delete({
306
- id: 3,
307
- docId: "ANSWERS_answer_3",
308
- });
309
-
310
-
311
- }
312
-
313
- run();
314
- ```
315
-
316
2389
  ### Standalone function
317
2390
 
318
2391
  The standalone function version of this method:
319
2392
 
320
2393
  ```typescript
321
2394
  import { GleanCore } from "@gleanwork/api-client/core.js";
322
- import { clientAnswersDelete } from "@gleanwork/api-client/funcs/clientAnswersDelete.js";
2395
+ import { clientAnswersUpdate } from "@gleanwork/api-client/funcs/clientAnswersUpdate.js";
2396
+ import { RFCDate } from "@gleanwork/api-client/types";
323
2397
 
324
2398
  // Use `GleanCore` for best tree-shaking performance.
325
2399
  // You can create one instance of it to use across an application.
@@ -328,75 +2402,7 @@ const glean = new GleanCore({
328
2402
  });
329
2403
 
330
2404
  async function run() {
331
- const res = await clientAnswersDelete(glean, {
332
- id: 3,
333
- docId: "ANSWERS_answer_3",
334
- });
335
-
336
- if (!res.ok) {
337
- throw res.error;
338
- }
339
-
340
- const { value: result } = res;
341
-
342
-
343
- }
344
-
345
- run();
346
- ```
347
-
348
- ### React hooks and utilities
349
-
350
- This method can be used in React components through the following hooks and
351
- associated utilities.
352
-
353
- > Check out [this guide][hook-guide] for information about each of the utilities
354
- > below and how to get started using React hooks.
355
-
356
- [hook-guide]: ../../../REACT_QUERY.md
357
-
358
- ```tsx
359
- import {
360
- // Mutation hook for triggering the API call.
361
- useClientAnswersDeleteMutation
362
- } from "@gleanwork/api-client/react-query/clientAnswersDelete.js";
363
- ```
364
-
365
- ### Parameters
366
-
367
- | Parameter | Type | Required | Description |
368
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
369
- | `request` | [components.DeleteAnswerRequest](../../models/components/deleteanswerrequest.md) | :heavy_check_mark: | The request object to use for the request. |
370
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
371
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
372
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
373
-
374
- ### Response
375
-
376
- **Promise\<void\>**
377
-
378
- ### Errors
379
-
380
- | Error Type | Status Code | Content Type |
381
- | ----------------- | ----------------- | ----------------- |
382
- | errors.GleanError | 4XX, 5XX | \*/\* |
383
-
384
- ## update
385
-
386
- Update an existing user-generated Answer.
387
-
388
- ### Example Usage
389
-
390
- ```typescript
391
- import { Glean } from "@gleanwork/api-client";
392
- import { RFCDate } from "@gleanwork/api-client/types";
393
-
394
- const glean = new Glean({
395
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
396
- });
397
-
398
- async function run() {
399
- const result = await glean.client.answers.update({
2405
+ const res = await clientAnswersUpdate(glean, {
400
2406
  id: 3,
401
2407
  docId: "ANSWERS_answer_3",
402
2408
  question: "Why is the sky blue?",
@@ -413,15 +2419,510 @@ async function run() {
413
2419
  value: "Presentation",
414
2420
  relationType: "EQUALS",
415
2421
  },
416
- ],
2422
+ ],
2423
+ },
2424
+ ],
2425
+ addedRoles: [
2426
+ {
2427
+ person: {
2428
+ name: "George Clooney",
2429
+ obfuscatedId: "abc123",
2430
+ relatedDocuments: [
2431
+ {
2432
+ querySuggestion: {
2433
+ query: "app:github type:pull author:mortimer",
2434
+ searchProviderInfo: {
2435
+ name: "Google",
2436
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
2437
+ },
2438
+ label: "Mortimer's PRs",
2439
+ datasource: "github",
2440
+ requestOptions: {
2441
+ datasourceFilter: "JIRA",
2442
+ datasourcesFilter: [
2443
+ "JIRA",
2444
+ ],
2445
+ queryOverridesFacetFilters: true,
2446
+ facetFilters: [
2447
+ {
2448
+ fieldName: "type",
2449
+ values: [
2450
+ {
2451
+ value: "Spreadsheet",
2452
+ relationType: "EQUALS",
2453
+ },
2454
+ {
2455
+ value: "Presentation",
2456
+ relationType: "EQUALS",
2457
+ },
2458
+ ],
2459
+ },
2460
+ ],
2461
+ facetFilterSets: [
2462
+ {
2463
+ filters: [
2464
+ {
2465
+ fieldName: "type",
2466
+ values: [
2467
+ {
2468
+ value: "Spreadsheet",
2469
+ relationType: "EQUALS",
2470
+ },
2471
+ {
2472
+ value: "Presentation",
2473
+ relationType: "EQUALS",
2474
+ },
2475
+ ],
2476
+ },
2477
+ ],
2478
+ },
2479
+ {
2480
+ filters: [
2481
+ {
2482
+ fieldName: "type",
2483
+ values: [
2484
+ {
2485
+ value: "Spreadsheet",
2486
+ relationType: "EQUALS",
2487
+ },
2488
+ {
2489
+ value: "Presentation",
2490
+ relationType: "EQUALS",
2491
+ },
2492
+ ],
2493
+ },
2494
+ ],
2495
+ },
2496
+ ],
2497
+ facetBucketSize: 991464,
2498
+ authTokens: [
2499
+ {
2500
+ accessToken: "123abc",
2501
+ datasource: "gmail",
2502
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
2503
+ tokenType: "Bearer",
2504
+ authUser: "1",
2505
+ },
2506
+ ],
2507
+ },
2508
+ ranges: [
2509
+ {
2510
+ startIndex: 488852,
2511
+ document: {
2512
+ metadata: {
2513
+ datasource: "datasource",
2514
+ objectType: "Feature Request",
2515
+ container: "container",
2516
+ parentId: "JIRA_EN-1337",
2517
+ mimeType: "mimeType",
2518
+ documentId: "documentId",
2519
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
2520
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
2521
+ components: [
2522
+ "Backend",
2523
+ "Networking",
2524
+ ],
2525
+ status: "[\"Done\"]",
2526
+ pins: [
2527
+ {
2528
+ audienceFilters: [
2529
+ {
2530
+ fieldName: "type",
2531
+ values: [
2532
+ {
2533
+ value: "Spreadsheet",
2534
+ relationType: "EQUALS",
2535
+ },
2536
+ {
2537
+ value: "Presentation",
2538
+ relationType: "EQUALS",
2539
+ },
2540
+ ],
2541
+ },
2542
+ ],
2543
+ documentId: "<id>",
2544
+ },
2545
+ {
2546
+ audienceFilters: [
2547
+ {
2548
+ fieldName: "type",
2549
+ values: [
2550
+ {
2551
+ value: "Spreadsheet",
2552
+ relationType: "EQUALS",
2553
+ },
2554
+ {
2555
+ value: "Presentation",
2556
+ relationType: "EQUALS",
2557
+ },
2558
+ ],
2559
+ },
2560
+ ],
2561
+ documentId: "<id>",
2562
+ },
2563
+ {
2564
+ audienceFilters: [
2565
+ {
2566
+ fieldName: "type",
2567
+ values: [
2568
+ {
2569
+ value: "Spreadsheet",
2570
+ relationType: "EQUALS",
2571
+ },
2572
+ {
2573
+ value: "Presentation",
2574
+ relationType: "EQUALS",
2575
+ },
2576
+ ],
2577
+ },
2578
+ ],
2579
+ documentId: "<id>",
2580
+ },
2581
+ ],
2582
+ collections: [
2583
+ {
2584
+ name: "<value>",
2585
+ description: "eulogise whereas till mild than during meanwhile disapprove finer ha",
2586
+ audienceFilters: [
2587
+ {
2588
+ fieldName: "type",
2589
+ values: [
2590
+ {
2591
+ value: "Spreadsheet",
2592
+ relationType: "EQUALS",
2593
+ },
2594
+ {
2595
+ value: "Presentation",
2596
+ relationType: "EQUALS",
2597
+ },
2598
+ ],
2599
+ },
2600
+ ],
2601
+ id: 2984,
2602
+ items: [
2603
+ {
2604
+ collectionId: 477967,
2605
+ shortcut: {
2606
+ inputAlias: "<value>",
2607
+ },
2608
+ itemType: "COLLECTION",
2609
+ },
2610
+ {
2611
+ collectionId: 424273,
2612
+ shortcut: {
2613
+ inputAlias: "<value>",
2614
+ },
2615
+ itemType: "COLLECTION",
2616
+ },
2617
+ ],
2618
+ },
2619
+ ],
2620
+ interactions: {
2621
+ reacts: [
2622
+ {},
2623
+ ],
2624
+ shares: [
2625
+ {
2626
+ numDaysAgo: 301848,
2627
+ },
2628
+ {
2629
+ numDaysAgo: 657278,
2630
+ },
2631
+ ],
2632
+ },
2633
+ verification: {
2634
+ state: "UNVERIFIED",
2635
+ metadata: {
2636
+ reminders: [
2637
+ {
2638
+ assignee: {
2639
+ name: "George Clooney",
2640
+ obfuscatedId: "abc123",
2641
+ },
2642
+ remindAt: 335191,
2643
+ },
2644
+ ],
2645
+ lastReminder: {
2646
+ assignee: {
2647
+ name: "George Clooney",
2648
+ obfuscatedId: "abc123",
2649
+ },
2650
+ remindAt: 532806,
2651
+ },
2652
+ },
2653
+ },
2654
+ shortcuts: [
2655
+ {
2656
+ inputAlias: "<value>",
2657
+ },
2658
+ {
2659
+ inputAlias: "<value>",
2660
+ },
2661
+ {
2662
+ inputAlias: "<value>",
2663
+ },
2664
+ ],
2665
+ customData: {
2666
+ "someCustomField": {},
2667
+ },
2668
+ },
2669
+ },
2670
+ },
2671
+ {
2672
+ startIndex: 463392,
2673
+ document: {
2674
+ metadata: {
2675
+ datasource: "datasource",
2676
+ objectType: "Feature Request",
2677
+ container: "container",
2678
+ parentId: "JIRA_EN-1337",
2679
+ mimeType: "mimeType",
2680
+ documentId: "documentId",
2681
+ createTime: new Date("2000-01-23T04:56:07.000Z"),
2682
+ updateTime: new Date("2000-01-23T04:56:07.000Z"),
2683
+ components: [
2684
+ "Backend",
2685
+ "Networking",
2686
+ ],
2687
+ status: "[\"Done\"]",
2688
+ interactions: {},
2689
+ verification: {
2690
+ state: "VERIFIED",
2691
+ metadata: {
2692
+ lastReminder: {
2693
+ assignee: {
2694
+ name: "George Clooney",
2695
+ obfuscatedId: "abc123",
2696
+ },
2697
+ remindAt: 58704,
2698
+ },
2699
+ },
2700
+ },
2701
+ customData: {
2702
+ "someCustomField": {},
2703
+ },
2704
+ },
2705
+ },
2706
+ },
2707
+ ],
2708
+ inputDetails: {
2709
+ hasCopyPaste: true,
2710
+ },
2711
+ },
2712
+ results: [
2713
+ {
2714
+ title: "title",
2715
+ url: "https://example.com/foo/bar",
2716
+ nativeAppUrl: "slack://foo/bar",
2717
+ snippets: [
2718
+ {
2719
+ snippet: "snippet",
2720
+ mimeType: "mimeType",
2721
+ },
2722
+ ],
2723
+ },
2724
+ ],
2725
+ },
2726
+ {
2727
+ querySuggestion: {
2728
+ query: "app:github type:pull author:mortimer",
2729
+ searchProviderInfo: {
2730
+ name: "Google",
2731
+ searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
2732
+ },
2733
+ label: "Mortimer's PRs",
2734
+ datasource: "github",
2735
+ requestOptions: {
2736
+ datasourceFilter: "JIRA",
2737
+ datasourcesFilter: [
2738
+ "JIRA",
2739
+ ],
2740
+ queryOverridesFacetFilters: true,
2741
+ facetFilters: [
2742
+ {
2743
+ fieldName: "type",
2744
+ values: [
2745
+ {
2746
+ value: "Spreadsheet",
2747
+ relationType: "EQUALS",
2748
+ },
2749
+ {
2750
+ value: "Presentation",
2751
+ relationType: "EQUALS",
2752
+ },
2753
+ ],
2754
+ },
2755
+ ],
2756
+ facetFilterSets: [
2757
+ {
2758
+ filters: [
2759
+ {
2760
+ fieldName: "type",
2761
+ values: [
2762
+ {
2763
+ value: "Spreadsheet",
2764
+ relationType: "EQUALS",
2765
+ },
2766
+ {
2767
+ value: "Presentation",
2768
+ relationType: "EQUALS",
2769
+ },
2770
+ ],
2771
+ },
2772
+ ],
2773
+ },
2774
+ {
2775
+ filters: [
2776
+ {
2777
+ fieldName: "type",
2778
+ values: [
2779
+ {
2780
+ value: "Spreadsheet",
2781
+ relationType: "EQUALS",
2782
+ },
2783
+ {
2784
+ value: "Presentation",
2785
+ relationType: "EQUALS",
2786
+ },
2787
+ ],
2788
+ },
2789
+ ],
2790
+ },
2791
+ {
2792
+ filters: [
2793
+ {
2794
+ fieldName: "type",
2795
+ values: [
2796
+ {
2797
+ value: "Spreadsheet",
2798
+ relationType: "EQUALS",
2799
+ },
2800
+ {
2801
+ value: "Presentation",
2802
+ relationType: "EQUALS",
2803
+ },
2804
+ ],
2805
+ },
2806
+ ],
2807
+ },
2808
+ ],
2809
+ facetBucketSize: 326276,
2810
+ authTokens: [
2811
+ {
2812
+ accessToken: "123abc",
2813
+ datasource: "gmail",
2814
+ scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
2815
+ tokenType: "Bearer",
2816
+ authUser: "1",
2817
+ },
2818
+ ],
2819
+ },
2820
+ inputDetails: {
2821
+ hasCopyPaste: true,
2822
+ },
2823
+ },
2824
+ },
2825
+ ],
2826
+ metadata: {
2827
+ type: "FULL_TIME",
2828
+ title: "Actor",
2829
+ department: "Movies",
2830
+ email: "george@example.com",
2831
+ location: "Hollywood, CA",
2832
+ phone: "6505551234",
2833
+ photoUrl: "https://example.com/george.jpg",
2834
+ startDate: new RFCDate("2000-01-23"),
2835
+ datasourceProfile: [
2836
+ {
2837
+ datasource: "github",
2838
+ handle: "<value>",
2839
+ },
2840
+ ],
2841
+ querySuggestions: {
2842
+ suggestions: [
2843
+ {
2844
+ query: "app:github type:pull author:mortimer",
2845
+ label: "Mortimer's PRs",
2846
+ datasource: "github",
2847
+ },
2848
+ ],
2849
+ },
2850
+ inviteInfo: {
2851
+ invites: [
2852
+ {},
2853
+ {},
2854
+ {},
2855
+ ],
2856
+ },
2857
+ customFields: [
2858
+ {
2859
+ label: "<value>",
2860
+ values: [
2861
+ {},
2862
+ ],
2863
+ },
2864
+ ],
2865
+ badges: [
2866
+ {
2867
+ key: "deployment_name_new_hire",
2868
+ displayName: "New hire",
2869
+ iconConfig: {
2870
+ color: "#343CED",
2871
+ key: "person_icon",
2872
+ iconType: "GLYPH",
2873
+ name: "user",
2874
+ },
2875
+ },
2876
+ ],
2877
+ },
2878
+ },
2879
+ role: "EDITOR",
2880
+ },
2881
+ {
2882
+ person: {
2883
+ name: "George Clooney",
2884
+ obfuscatedId: "abc123",
2885
+ metadata: {
2886
+ type: "FULL_TIME",
2887
+ title: "Actor",
2888
+ department: "Movies",
2889
+ email: "george@example.com",
2890
+ location: "Hollywood, CA",
2891
+ phone: "6505551234",
2892
+ photoUrl: "https://example.com/george.jpg",
2893
+ startDate: new RFCDate("2000-01-23"),
2894
+ datasourceProfile: [
2895
+ {
2896
+ datasource: "github",
2897
+ handle: "<value>",
2898
+ },
2899
+ {
2900
+ datasource: "github",
2901
+ handle: "<value>",
2902
+ },
2903
+ ],
2904
+ querySuggestions: {},
2905
+ inviteInfo: {},
2906
+ badges: [
2907
+ {
2908
+ key: "deployment_name_new_hire",
2909
+ displayName: "New hire",
2910
+ iconConfig: {
2911
+ color: "#343CED",
2912
+ key: "person_icon",
2913
+ iconType: "GLYPH",
2914
+ name: "user",
2915
+ },
2916
+ },
2917
+ ],
2918
+ },
2919
+ },
2920
+ role: "ANSWER_MODERATOR",
417
2921
  },
418
- ],
419
- addedRoles: [
420
2922
  {
421
2923
  person: {
422
2924
  name: "George Clooney",
423
2925
  obfuscatedId: "abc123",
424
- relatedDocuments: [],
425
2926
  metadata: {
426
2927
  type: "FULL_TIME",
427
2928
  title: "Actor",
@@ -437,13 +2938,8 @@ async function run() {
437
2938
  handle: "<value>",
438
2939
  },
439
2940
  ],
440
- querySuggestions: {
441
- suggestions: [],
442
- },
443
- inviteInfo: {
444
- invites: [],
445
- },
446
- customFields: [],
2941
+ querySuggestions: {},
2942
+ inviteInfo: {},
447
2943
  badges: [
448
2944
  {
449
2945
  key: "deployment_name_new_hire",
@@ -458,88 +2954,14 @@ async function run() {
458
2954
  ],
459
2955
  },
460
2956
  },
461
- role: "EDITOR",
462
- },
463
- {
464
- role: "ANSWER_MODERATOR",
465
- },
466
- {
467
2957
  role: "OWNER",
468
2958
  },
469
2959
  ],
470
2960
  removedRoles: [
471
- {
472
- role: "OWNER",
473
- },
474
- {
475
- role: "VERIFIER",
476
- },
477
- ],
478
- roles: [
479
- {
480
- role: "EDITOR",
481
- },
482
- {
483
- role: "VERIFIER",
484
- },
485
- {
486
- role: "ANSWER_MODERATOR",
487
- },
488
- ],
489
- combinedAnswerText: {
490
- 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.",
491
- },
492
- });
493
-
494
- // Handle the result
495
- console.log(result);
496
- }
497
-
498
- run();
499
- ```
500
-
501
- ### Standalone function
502
-
503
- The standalone function version of this method:
504
-
505
- ```typescript
506
- import { GleanCore } from "@gleanwork/api-client/core.js";
507
- import { clientAnswersUpdate } from "@gleanwork/api-client/funcs/clientAnswersUpdate.js";
508
- import { RFCDate } from "@gleanwork/api-client/types";
509
-
510
- // Use `GleanCore` for best tree-shaking performance.
511
- // You can create one instance of it to use across an application.
512
- const glean = new GleanCore({
513
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
514
- });
515
-
516
- async function run() {
517
- const res = await clientAnswersUpdate(glean, {
518
- id: 3,
519
- docId: "ANSWERS_answer_3",
520
- question: "Why is the sky blue?",
521
- bodyText: "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
522
- audienceFilters: [
523
- {
524
- fieldName: "type",
525
- values: [
526
- {
527
- value: "Spreadsheet",
528
- relationType: "EQUALS",
529
- },
530
- {
531
- value: "Presentation",
532
- relationType: "EQUALS",
533
- },
534
- ],
535
- },
536
- ],
537
- addedRoles: [
538
2961
  {
539
2962
  person: {
540
2963
  name: "George Clooney",
541
2964
  obfuscatedId: "abc123",
542
- relatedDocuments: [],
543
2965
  metadata: {
544
2966
  type: "FULL_TIME",
545
2967
  title: "Actor",
@@ -554,14 +2976,17 @@ async function run() {
554
2976
  datasource: "github",
555
2977
  handle: "<value>",
556
2978
  },
2979
+ {
2980
+ datasource: "github",
2981
+ handle: "<value>",
2982
+ },
2983
+ {
2984
+ datasource: "github",
2985
+ handle: "<value>",
2986
+ },
557
2987
  ],
558
- querySuggestions: {
559
- suggestions: [],
560
- },
561
- inviteInfo: {
562
- invites: [],
563
- },
564
- customFields: [],
2988
+ querySuggestions: {},
2989
+ inviteInfo: {},
565
2990
  badges: [
566
2991
  {
567
2992
  key: "deployment_name_new_hire",
@@ -576,31 +3001,176 @@ async function run() {
576
3001
  ],
577
3002
  },
578
3003
  },
579
- role: "EDITOR",
580
- },
581
- {
582
- role: "ANSWER_MODERATOR",
583
- },
584
- {
585
- role: "OWNER",
586
- },
587
- ],
588
- removedRoles: [
589
- {
590
3004
  role: "OWNER",
591
3005
  },
592
3006
  {
3007
+ person: {
3008
+ name: "George Clooney",
3009
+ obfuscatedId: "abc123",
3010
+ metadata: {
3011
+ type: "FULL_TIME",
3012
+ title: "Actor",
3013
+ department: "Movies",
3014
+ email: "george@example.com",
3015
+ location: "Hollywood, CA",
3016
+ phone: "6505551234",
3017
+ photoUrl: "https://example.com/george.jpg",
3018
+ startDate: new RFCDate("2000-01-23"),
3019
+ datasourceProfile: [
3020
+ {
3021
+ datasource: "github",
3022
+ handle: "<value>",
3023
+ },
3024
+ {
3025
+ datasource: "github",
3026
+ handle: "<value>",
3027
+ },
3028
+ ],
3029
+ querySuggestions: {},
3030
+ inviteInfo: {},
3031
+ badges: [
3032
+ {
3033
+ key: "deployment_name_new_hire",
3034
+ displayName: "New hire",
3035
+ iconConfig: {
3036
+ color: "#343CED",
3037
+ key: "person_icon",
3038
+ iconType: "GLYPH",
3039
+ name: "user",
3040
+ },
3041
+ },
3042
+ ],
3043
+ },
3044
+ },
593
3045
  role: "VERIFIER",
594
3046
  },
595
3047
  ],
596
3048
  roles: [
597
3049
  {
3050
+ person: {
3051
+ name: "George Clooney",
3052
+ obfuscatedId: "abc123",
3053
+ metadata: {
3054
+ type: "FULL_TIME",
3055
+ title: "Actor",
3056
+ department: "Movies",
3057
+ email: "george@example.com",
3058
+ location: "Hollywood, CA",
3059
+ phone: "6505551234",
3060
+ photoUrl: "https://example.com/george.jpg",
3061
+ startDate: new RFCDate("2000-01-23"),
3062
+ datasourceProfile: [
3063
+ {
3064
+ datasource: "github",
3065
+ handle: "<value>",
3066
+ },
3067
+ {
3068
+ datasource: "github",
3069
+ handle: "<value>",
3070
+ },
3071
+ {
3072
+ datasource: "github",
3073
+ handle: "<value>",
3074
+ },
3075
+ ],
3076
+ querySuggestions: {},
3077
+ inviteInfo: {},
3078
+ badges: [
3079
+ {
3080
+ key: "deployment_name_new_hire",
3081
+ displayName: "New hire",
3082
+ iconConfig: {
3083
+ color: "#343CED",
3084
+ key: "person_icon",
3085
+ iconType: "GLYPH",
3086
+ name: "user",
3087
+ },
3088
+ },
3089
+ ],
3090
+ },
3091
+ },
598
3092
  role: "EDITOR",
599
3093
  },
600
3094
  {
3095
+ person: {
3096
+ name: "George Clooney",
3097
+ obfuscatedId: "abc123",
3098
+ metadata: {
3099
+ type: "FULL_TIME",
3100
+ title: "Actor",
3101
+ department: "Movies",
3102
+ email: "george@example.com",
3103
+ location: "Hollywood, CA",
3104
+ phone: "6505551234",
3105
+ photoUrl: "https://example.com/george.jpg",
3106
+ startDate: new RFCDate("2000-01-23"),
3107
+ datasourceProfile: [
3108
+ {
3109
+ datasource: "github",
3110
+ handle: "<value>",
3111
+ },
3112
+ ],
3113
+ querySuggestions: {},
3114
+ inviteInfo: {},
3115
+ badges: [
3116
+ {
3117
+ key: "deployment_name_new_hire",
3118
+ displayName: "New hire",
3119
+ iconConfig: {
3120
+ color: "#343CED",
3121
+ key: "person_icon",
3122
+ iconType: "GLYPH",
3123
+ name: "user",
3124
+ },
3125
+ },
3126
+ ],
3127
+ },
3128
+ },
601
3129
  role: "VERIFIER",
602
3130
  },
603
3131
  {
3132
+ person: {
3133
+ name: "George Clooney",
3134
+ obfuscatedId: "abc123",
3135
+ metadata: {
3136
+ type: "FULL_TIME",
3137
+ title: "Actor",
3138
+ department: "Movies",
3139
+ email: "george@example.com",
3140
+ location: "Hollywood, CA",
3141
+ phone: "6505551234",
3142
+ photoUrl: "https://example.com/george.jpg",
3143
+ startDate: new RFCDate("2000-01-23"),
3144
+ datasourceProfile: [
3145
+ {
3146
+ datasource: "github",
3147
+ handle: "<value>",
3148
+ },
3149
+ {
3150
+ datasource: "github",
3151
+ handle: "<value>",
3152
+ },
3153
+ {
3154
+ datasource: "github",
3155
+ handle: "<value>",
3156
+ },
3157
+ ],
3158
+ querySuggestions: {},
3159
+ inviteInfo: {},
3160
+ badges: [
3161
+ {
3162
+ key: "deployment_name_new_hire",
3163
+ displayName: "New hire",
3164
+ iconConfig: {
3165
+ color: "#343CED",
3166
+ key: "person_icon",
3167
+ iconType: "GLYPH",
3168
+ name: "user",
3169
+ },
3170
+ },
3171
+ ],
3172
+ },
3173
+ },
604
3174
  role: "ANSWER_MODERATOR",
605
3175
  },
606
3176
  ],