@gleanwork/api-client 0.1.0-beta.8 → 0.1.0-beta.9

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 (88) hide show
  1. package/README.md +16 -19
  2. package/dist/commonjs/__tests__/search.test.js +1 -1
  3. package/dist/commonjs/__tests__/search.test.js.map +1 -1
  4. package/dist/commonjs/funcs/{searchAutocomplete.d.ts → clientSearchAutocomplete.d.ts} +2 -2
  5. package/dist/commonjs/funcs/clientSearchAutocomplete.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/{searchAutocomplete.js → clientSearchAutocomplete.js} +3 -3
  7. package/dist/commonjs/funcs/clientSearchAutocomplete.js.map +1 -0
  8. package/dist/commonjs/lib/config.d.ts +2 -2
  9. package/dist/commonjs/lib/config.js +2 -2
  10. package/dist/commonjs/react-query/clientSearchAutocomplete.d.ts +23 -0
  11. package/dist/commonjs/react-query/clientSearchAutocomplete.d.ts.map +1 -0
  12. package/dist/commonjs/react-query/{searchAutocomplete.js → clientSearchAutocomplete.js} +13 -13
  13. package/dist/commonjs/react-query/clientSearchAutocomplete.js.map +1 -0
  14. package/dist/commonjs/react-query/index.d.ts +1 -1
  15. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  16. package/dist/commonjs/react-query/index.js +1 -1
  17. package/dist/commonjs/react-query/index.js.map +1 -1
  18. package/dist/commonjs/sdk/client.d.ts +2 -2
  19. package/dist/commonjs/sdk/client.d.ts.map +1 -1
  20. package/dist/commonjs/sdk/client.js +2 -2
  21. package/dist/commonjs/sdk/client.js.map +1 -1
  22. package/dist/commonjs/sdk/sdk.d.ts +0 -3
  23. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  24. package/dist/commonjs/sdk/sdk.js +0 -4
  25. package/dist/commonjs/sdk/sdk.js.map +1 -1
  26. package/dist/commonjs/sdk/search.d.ts +28 -0
  27. package/dist/commonjs/sdk/search.d.ts.map +1 -1
  28. package/dist/commonjs/sdk/search.js +42 -2
  29. package/dist/commonjs/sdk/search.js.map +1 -1
  30. package/dist/esm/__tests__/search.test.js +1 -1
  31. package/dist/esm/__tests__/search.test.js.map +1 -1
  32. package/dist/esm/funcs/{searchAutocomplete.d.ts → clientSearchAutocomplete.d.ts} +2 -2
  33. package/dist/esm/funcs/clientSearchAutocomplete.d.ts.map +1 -0
  34. package/dist/esm/funcs/{searchAutocomplete.js → clientSearchAutocomplete.js} +2 -2
  35. package/dist/esm/funcs/clientSearchAutocomplete.js.map +1 -0
  36. package/dist/esm/lib/config.d.ts +2 -2
  37. package/dist/esm/lib/config.js +2 -2
  38. package/dist/esm/react-query/clientSearchAutocomplete.d.ts +23 -0
  39. package/dist/esm/react-query/clientSearchAutocomplete.d.ts.map +1 -0
  40. package/dist/esm/react-query/{searchAutocomplete.js → clientSearchAutocomplete.js} +10 -10
  41. package/dist/esm/react-query/clientSearchAutocomplete.js.map +1 -0
  42. package/dist/esm/react-query/index.d.ts +1 -1
  43. package/dist/esm/react-query/index.d.ts.map +1 -1
  44. package/dist/esm/react-query/index.js +1 -1
  45. package/dist/esm/react-query/index.js.map +1 -1
  46. package/dist/esm/sdk/client.d.ts +2 -2
  47. package/dist/esm/sdk/client.d.ts.map +1 -1
  48. package/dist/esm/sdk/client.js +2 -2
  49. package/dist/esm/sdk/client.js.map +1 -1
  50. package/dist/esm/sdk/sdk.d.ts +0 -3
  51. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  52. package/dist/esm/sdk/sdk.js +0 -4
  53. package/dist/esm/sdk/sdk.js.map +1 -1
  54. package/dist/esm/sdk/search.d.ts +28 -0
  55. package/dist/esm/sdk/search.d.ts.map +1 -1
  56. package/dist/esm/sdk/search.js +42 -2
  57. package/dist/esm/sdk/search.js.map +1 -1
  58. package/docs/sdks/search/README.md +1489 -7
  59. package/jsr.json +1 -1
  60. package/package.json +1 -1
  61. package/src/__tests__/search.test.ts +1 -1
  62. package/src/funcs/{searchAutocomplete.ts → clientSearchAutocomplete.ts} +1 -1
  63. package/src/lib/config.ts +2 -2
  64. package/src/react-query/{searchAutocomplete.ts → clientSearchAutocomplete.ts} +19 -18
  65. package/src/react-query/index.ts +1 -1
  66. package/src/sdk/client.ts +4 -4
  67. package/src/sdk/sdk.ts +0 -6
  68. package/src/sdk/search.ts +74 -2
  69. package/dist/commonjs/funcs/searchAutocomplete.d.ts.map +0 -1
  70. package/dist/commonjs/funcs/searchAutocomplete.js.map +0 -1
  71. package/dist/commonjs/react-query/searchAutocomplete.d.ts +0 -23
  72. package/dist/commonjs/react-query/searchAutocomplete.d.ts.map +0 -1
  73. package/dist/commonjs/react-query/searchAutocomplete.js.map +0 -1
  74. package/dist/commonjs/sdk/clientsearch.d.ts +0 -33
  75. package/dist/commonjs/sdk/clientsearch.d.ts.map +0 -1
  76. package/dist/commonjs/sdk/clientsearch.js +0 -52
  77. package/dist/commonjs/sdk/clientsearch.js.map +0 -1
  78. package/dist/esm/funcs/searchAutocomplete.d.ts.map +0 -1
  79. package/dist/esm/funcs/searchAutocomplete.js.map +0 -1
  80. package/dist/esm/react-query/searchAutocomplete.d.ts +0 -23
  81. package/dist/esm/react-query/searchAutocomplete.d.ts.map +0 -1
  82. package/dist/esm/react-query/searchAutocomplete.js.map +0 -1
  83. package/dist/esm/sdk/clientsearch.d.ts +0 -33
  84. package/dist/esm/sdk/clientsearch.d.ts.map +0 -1
  85. package/dist/esm/sdk/clientsearch.js +0 -48
  86. package/dist/esm/sdk/clientsearch.js.map +0 -1
  87. package/docs/sdks/clientsearch/README.md +0 -1489
  88. package/src/sdk/clientsearch.ts +0 -81
@@ -1,1489 +0,0 @@
1
- # ClientSearch
2
- (*client.search*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [queryAsAdmin](#queryasadmin) - Search the index (admin)
9
- * [retrieveFeed](#retrievefeed) - Feed of documents and events
10
- * [recommendations](#recommendations) - Recommend documents
11
- * [query](#query) - Search
12
-
13
- ## queryAsAdmin
14
-
15
- Retrieves results for search query without respect for permissions. This is available only to privileged users.
16
-
17
- ### Example Usage
18
-
19
- ```typescript
20
- import { Glean } from "@gleanwork/api-client";
21
- import { RFCDate } from "@gleanwork/api-client/types";
22
-
23
- const glean = new Glean({
24
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
25
- });
26
-
27
- async function run() {
28
- const result = await glean.client.search.queryAsAdmin({
29
- trackingToken: "trackingToken",
30
- sourceDocument: {
31
- metadata: {
32
- datasource: "datasource",
33
- objectType: "Feature Request",
34
- container: "container",
35
- parentId: "JIRA_EN-1337",
36
- mimeType: "mimeType",
37
- documentId: "documentId",
38
- createTime: new Date("2000-01-23T04:56:07.000Z"),
39
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
40
- author: {
41
- name: "George Clooney",
42
- obfuscatedId: "abc123",
43
- relatedDocuments: [],
44
- metadata: {
45
- type: "FULL_TIME",
46
- title: "Actor",
47
- department: "Movies",
48
- email: "george@example.com",
49
- location: "Hollywood, CA",
50
- phone: "6505551234",
51
- photoUrl: "https://example.com/george.jpg",
52
- startDate: new RFCDate("2000-01-23"),
53
- datasourceProfile: [
54
- {
55
- datasource: "github",
56
- handle: "<value>",
57
- },
58
- {
59
- datasource: "github",
60
- handle: "<value>",
61
- },
62
- ],
63
- querySuggestions: {
64
- suggestions: [],
65
- },
66
- inviteInfo: {
67
- invites: [],
68
- },
69
- customFields: [],
70
- badges: [
71
- {
72
- key: "deployment_name_new_hire",
73
- displayName: "New hire",
74
- iconConfig: {
75
- color: "#343CED",
76
- key: "person_icon",
77
- iconType: "GLYPH",
78
- name: "user",
79
- },
80
- },
81
- ],
82
- },
83
- },
84
- owner: {
85
- name: "George Clooney",
86
- obfuscatedId: "abc123",
87
- },
88
- mentionedPeople: [],
89
- components: [
90
- "Backend",
91
- "Networking",
92
- ],
93
- status: "[\"Done\"]",
94
- pins: [],
95
- assignedTo: {
96
- name: "George Clooney",
97
- obfuscatedId: "abc123",
98
- },
99
- updatedBy: {
100
- name: "George Clooney",
101
- obfuscatedId: "abc123",
102
- },
103
- collections: [],
104
- interactions: {
105
- reacts: [],
106
- shares: [],
107
- },
108
- verification: {
109
- state: "UNVERIFIED",
110
- metadata: {
111
- lastVerifier: {
112
- name: "George Clooney",
113
- obfuscatedId: "abc123",
114
- },
115
- reminders: [],
116
- lastReminder: {
117
- assignee: {
118
- name: "George Clooney",
119
- obfuscatedId: "abc123",
120
- },
121
- requestor: {
122
- name: "George Clooney",
123
- obfuscatedId: "abc123",
124
- },
125
- remindAt: 554738,
126
- },
127
- candidateVerifiers: [],
128
- },
129
- },
130
- shortcuts: [],
131
- customData: {
132
- "someCustomField": {},
133
- },
134
- contactPerson: {
135
- name: "George Clooney",
136
- obfuscatedId: "abc123",
137
- },
138
- },
139
- },
140
- pageSize: 100,
141
- maxSnippetSize: 400,
142
- query: "vacation policy",
143
- inputDetails: {
144
- hasCopyPaste: true,
145
- },
146
- requestOptions: {
147
- datasourceFilter: "JIRA",
148
- datasourcesFilter: [
149
- "JIRA",
150
- ],
151
- queryOverridesFacetFilters: true,
152
- facetFilters: [
153
- {
154
- fieldName: "type",
155
- values: [
156
- {
157
- value: "Spreadsheet",
158
- relationType: "EQUALS",
159
- },
160
- {
161
- value: "Presentation",
162
- relationType: "EQUALS",
163
- },
164
- ],
165
- },
166
- ],
167
- facetFilterSets: [
168
- {
169
- filters: [
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
- },
185
- {
186
- filters: [
187
- {
188
- fieldName: "type",
189
- values: [
190
- {
191
- value: "Spreadsheet",
192
- relationType: "EQUALS",
193
- },
194
- {
195
- value: "Presentation",
196
- relationType: "EQUALS",
197
- },
198
- ],
199
- },
200
- ],
201
- },
202
- {
203
- filters: [
204
- {
205
- fieldName: "type",
206
- values: [
207
- {
208
- value: "Spreadsheet",
209
- relationType: "EQUALS",
210
- },
211
- {
212
- value: "Presentation",
213
- relationType: "EQUALS",
214
- },
215
- ],
216
- },
217
- ],
218
- },
219
- ],
220
- facetBucketSize: 171751,
221
- authTokens: [
222
- {
223
- accessToken: "123abc",
224
- datasource: "gmail",
225
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
226
- tokenType: "Bearer",
227
- authUser: "1",
228
- },
229
- ],
230
- },
231
- timeoutMillis: 5000,
232
- people: [
233
- {
234
- name: "George Clooney",
235
- obfuscatedId: "abc123",
236
- },
237
- ],
238
- });
239
-
240
- // Handle the result
241
- console.log(result);
242
- }
243
-
244
- run();
245
- ```
246
-
247
- ### Standalone function
248
-
249
- The standalone function version of this method:
250
-
251
- ```typescript
252
- import { GleanCore } from "@gleanwork/api-client/core.js";
253
- import { clientSearchQueryAsAdmin } from "@gleanwork/api-client/funcs/clientSearchQueryAsAdmin.js";
254
- import { RFCDate } from "@gleanwork/api-client/types";
255
-
256
- // Use `GleanCore` for best tree-shaking performance.
257
- // You can create one instance of it to use across an application.
258
- const glean = new GleanCore({
259
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
260
- });
261
-
262
- async function run() {
263
- const res = await clientSearchQueryAsAdmin(glean, {
264
- trackingToken: "trackingToken",
265
- sourceDocument: {
266
- metadata: {
267
- datasource: "datasource",
268
- objectType: "Feature Request",
269
- container: "container",
270
- parentId: "JIRA_EN-1337",
271
- mimeType: "mimeType",
272
- documentId: "documentId",
273
- createTime: new Date("2000-01-23T04:56:07.000Z"),
274
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
275
- author: {
276
- name: "George Clooney",
277
- obfuscatedId: "abc123",
278
- relatedDocuments: [],
279
- metadata: {
280
- type: "FULL_TIME",
281
- title: "Actor",
282
- department: "Movies",
283
- email: "george@example.com",
284
- location: "Hollywood, CA",
285
- phone: "6505551234",
286
- photoUrl: "https://example.com/george.jpg",
287
- startDate: new RFCDate("2000-01-23"),
288
- datasourceProfile: [
289
- {
290
- datasource: "github",
291
- handle: "<value>",
292
- },
293
- {
294
- datasource: "github",
295
- handle: "<value>",
296
- },
297
- ],
298
- querySuggestions: {
299
- suggestions: [],
300
- },
301
- inviteInfo: {
302
- invites: [],
303
- },
304
- customFields: [],
305
- badges: [
306
- {
307
- key: "deployment_name_new_hire",
308
- displayName: "New hire",
309
- iconConfig: {
310
- color: "#343CED",
311
- key: "person_icon",
312
- iconType: "GLYPH",
313
- name: "user",
314
- },
315
- },
316
- ],
317
- },
318
- },
319
- owner: {
320
- name: "George Clooney",
321
- obfuscatedId: "abc123",
322
- },
323
- mentionedPeople: [],
324
- components: [
325
- "Backend",
326
- "Networking",
327
- ],
328
- status: "[\"Done\"]",
329
- pins: [],
330
- assignedTo: {
331
- name: "George Clooney",
332
- obfuscatedId: "abc123",
333
- },
334
- updatedBy: {
335
- name: "George Clooney",
336
- obfuscatedId: "abc123",
337
- },
338
- collections: [],
339
- interactions: {
340
- reacts: [],
341
- shares: [],
342
- },
343
- verification: {
344
- state: "UNVERIFIED",
345
- metadata: {
346
- lastVerifier: {
347
- name: "George Clooney",
348
- obfuscatedId: "abc123",
349
- },
350
- reminders: [],
351
- lastReminder: {
352
- assignee: {
353
- name: "George Clooney",
354
- obfuscatedId: "abc123",
355
- },
356
- requestor: {
357
- name: "George Clooney",
358
- obfuscatedId: "abc123",
359
- },
360
- remindAt: 554738,
361
- },
362
- candidateVerifiers: [],
363
- },
364
- },
365
- shortcuts: [],
366
- customData: {
367
- "someCustomField": {},
368
- },
369
- contactPerson: {
370
- name: "George Clooney",
371
- obfuscatedId: "abc123",
372
- },
373
- },
374
- },
375
- pageSize: 100,
376
- maxSnippetSize: 400,
377
- query: "vacation policy",
378
- inputDetails: {
379
- hasCopyPaste: true,
380
- },
381
- requestOptions: {
382
- datasourceFilter: "JIRA",
383
- datasourcesFilter: [
384
- "JIRA",
385
- ],
386
- queryOverridesFacetFilters: true,
387
- facetFilters: [
388
- {
389
- fieldName: "type",
390
- values: [
391
- {
392
- value: "Spreadsheet",
393
- relationType: "EQUALS",
394
- },
395
- {
396
- value: "Presentation",
397
- relationType: "EQUALS",
398
- },
399
- ],
400
- },
401
- ],
402
- facetFilterSets: [
403
- {
404
- filters: [
405
- {
406
- fieldName: "type",
407
- values: [
408
- {
409
- value: "Spreadsheet",
410
- relationType: "EQUALS",
411
- },
412
- {
413
- value: "Presentation",
414
- relationType: "EQUALS",
415
- },
416
- ],
417
- },
418
- ],
419
- },
420
- {
421
- filters: [
422
- {
423
- fieldName: "type",
424
- values: [
425
- {
426
- value: "Spreadsheet",
427
- relationType: "EQUALS",
428
- },
429
- {
430
- value: "Presentation",
431
- relationType: "EQUALS",
432
- },
433
- ],
434
- },
435
- ],
436
- },
437
- {
438
- filters: [
439
- {
440
- fieldName: "type",
441
- values: [
442
- {
443
- value: "Spreadsheet",
444
- relationType: "EQUALS",
445
- },
446
- {
447
- value: "Presentation",
448
- relationType: "EQUALS",
449
- },
450
- ],
451
- },
452
- ],
453
- },
454
- ],
455
- facetBucketSize: 171751,
456
- authTokens: [
457
- {
458
- accessToken: "123abc",
459
- datasource: "gmail",
460
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
461
- tokenType: "Bearer",
462
- authUser: "1",
463
- },
464
- ],
465
- },
466
- timeoutMillis: 5000,
467
- people: [
468
- {
469
- name: "George Clooney",
470
- obfuscatedId: "abc123",
471
- },
472
- ],
473
- });
474
-
475
- if (!res.ok) {
476
- throw res.error;
477
- }
478
-
479
- const { value: result } = res;
480
-
481
- // Handle the result
482
- console.log(result);
483
- }
484
-
485
- run();
486
- ```
487
-
488
- ### React hooks and utilities
489
-
490
- This method can be used in React components through the following hooks and
491
- associated utilities.
492
-
493
- > Check out [this guide][hook-guide] for information about each of the utilities
494
- > below and how to get started using React hooks.
495
-
496
- [hook-guide]: ../../../REACT_QUERY.md
497
-
498
- ```tsx
499
- import {
500
- // Mutation hook for triggering the API call.
501
- useClientSearchQueryAsAdminMutation
502
- } from "@gleanwork/api-client/react-query/clientSearchQueryAsAdmin.js";
503
- ```
504
-
505
- ### Parameters
506
-
507
- | Parameter | Type | Required | Description |
508
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
509
- | `request` | [components.SearchRequest](../../models/components/searchrequest.md) | :heavy_check_mark: | The request object to use for the request. |
510
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
511
- | `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. |
512
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
513
-
514
- ### Response
515
-
516
- **Promise\<[components.SearchResponse](../../models/components/searchresponse.md)\>**
517
-
518
- ### Errors
519
-
520
- | Error Type | Status Code | Content Type |
521
- | --------------------- | --------------------- | --------------------- |
522
- | errors.GleanDataError | 403, 422 | application/json |
523
- | errors.GleanError | 4XX, 5XX | \*/\* |
524
-
525
- ## retrieveFeed
526
-
527
- The personalized feed/home includes different types of contents including suggestions, recents, calendar events and many more.
528
-
529
- ### Example Usage
530
-
531
- ```typescript
532
- import { Glean } from "@gleanwork/api-client";
533
-
534
- const glean = new Glean({
535
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
536
- });
537
-
538
- async function run() {
539
- const result = await glean.client.search.retrieveFeed({
540
- timeoutMillis: 5000,
541
- });
542
-
543
- // Handle the result
544
- console.log(result);
545
- }
546
-
547
- run();
548
- ```
549
-
550
- ### Standalone function
551
-
552
- The standalone function version of this method:
553
-
554
- ```typescript
555
- import { GleanCore } from "@gleanwork/api-client/core.js";
556
- import { clientSearchRetrieveFeed } from "@gleanwork/api-client/funcs/clientSearchRetrieveFeed.js";
557
-
558
- // Use `GleanCore` for best tree-shaking performance.
559
- // You can create one instance of it to use across an application.
560
- const glean = new GleanCore({
561
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
562
- });
563
-
564
- async function run() {
565
- const res = await clientSearchRetrieveFeed(glean, {
566
- timeoutMillis: 5000,
567
- });
568
-
569
- if (!res.ok) {
570
- throw res.error;
571
- }
572
-
573
- const { value: result } = res;
574
-
575
- // Handle the result
576
- console.log(result);
577
- }
578
-
579
- run();
580
- ```
581
-
582
- ### React hooks and utilities
583
-
584
- This method can be used in React components through the following hooks and
585
- associated utilities.
586
-
587
- > Check out [this guide][hook-guide] for information about each of the utilities
588
- > below and how to get started using React hooks.
589
-
590
- [hook-guide]: ../../../REACT_QUERY.md
591
-
592
- ```tsx
593
- import {
594
- // Mutation hook for triggering the API call.
595
- useClientSearchRetrieveFeedMutation
596
- } from "@gleanwork/api-client/react-query/clientSearchRetrieveFeed.js";
597
- ```
598
-
599
- ### Parameters
600
-
601
- | Parameter | Type | Required | Description |
602
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
603
- | `request` | [components.FeedRequest](../../models/components/feedrequest.md) | :heavy_check_mark: | The request object to use for the request. |
604
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
605
- | `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. |
606
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
607
-
608
- ### Response
609
-
610
- **Promise\<[components.FeedResponse](../../models/components/feedresponse.md)\>**
611
-
612
- ### Errors
613
-
614
- | Error Type | Status Code | Content Type |
615
- | ----------------- | ----------------- | ----------------- |
616
- | errors.GleanError | 4XX, 5XX | \*/\* |
617
-
618
- ## recommendations
619
-
620
- Retrieve recommended documents for the given URL or Glean Document ID.
621
-
622
- ### Example Usage
623
-
624
- ```typescript
625
- import { Glean } from "@gleanwork/api-client";
626
- import { RFCDate } from "@gleanwork/api-client/types";
627
-
628
- const glean = new Glean({
629
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
630
- });
631
-
632
- async function run() {
633
- const result = await glean.client.search.recommendations({
634
- sourceDocument: {
635
- metadata: {
636
- datasource: "datasource",
637
- objectType: "Feature Request",
638
- container: "container",
639
- parentId: "JIRA_EN-1337",
640
- mimeType: "mimeType",
641
- documentId: "documentId",
642
- createTime: new Date("2000-01-23T04:56:07.000Z"),
643
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
644
- author: {
645
- name: "George Clooney",
646
- obfuscatedId: "abc123",
647
- relatedDocuments: [],
648
- metadata: {
649
- type: "FULL_TIME",
650
- title: "Actor",
651
- department: "Movies",
652
- email: "george@example.com",
653
- location: "Hollywood, CA",
654
- phone: "6505551234",
655
- photoUrl: "https://example.com/george.jpg",
656
- startDate: new RFCDate("2000-01-23"),
657
- datasourceProfile: [
658
- {
659
- datasource: "github",
660
- handle: "<value>",
661
- },
662
- {
663
- datasource: "github",
664
- handle: "<value>",
665
- },
666
- ],
667
- querySuggestions: {
668
- suggestions: [],
669
- },
670
- inviteInfo: {
671
- invites: [],
672
- },
673
- customFields: [],
674
- badges: [
675
- {
676
- key: "deployment_name_new_hire",
677
- displayName: "New hire",
678
- iconConfig: {
679
- color: "#343CED",
680
- key: "person_icon",
681
- iconType: "GLYPH",
682
- name: "user",
683
- },
684
- },
685
- ],
686
- },
687
- },
688
- owner: {
689
- name: "George Clooney",
690
- obfuscatedId: "abc123",
691
- },
692
- mentionedPeople: [],
693
- components: [
694
- "Backend",
695
- "Networking",
696
- ],
697
- status: "[\"Done\"]",
698
- pins: [],
699
- assignedTo: {
700
- name: "George Clooney",
701
- obfuscatedId: "abc123",
702
- },
703
- updatedBy: {
704
- name: "George Clooney",
705
- obfuscatedId: "abc123",
706
- },
707
- collections: [],
708
- interactions: {
709
- reacts: [],
710
- shares: [],
711
- },
712
- verification: {
713
- state: "UNVERIFIED",
714
- metadata: {
715
- lastVerifier: {
716
- name: "George Clooney",
717
- obfuscatedId: "abc123",
718
- },
719
- reminders: [],
720
- lastReminder: {
721
- assignee: {
722
- name: "George Clooney",
723
- obfuscatedId: "abc123",
724
- },
725
- requestor: {
726
- name: "George Clooney",
727
- obfuscatedId: "abc123",
728
- },
729
- remindAt: 578719,
730
- },
731
- candidateVerifiers: [],
732
- },
733
- },
734
- shortcuts: [],
735
- customData: {
736
- "someCustomField": {},
737
- },
738
- contactPerson: {
739
- name: "George Clooney",
740
- obfuscatedId: "abc123",
741
- },
742
- },
743
- },
744
- pageSize: 100,
745
- maxSnippetSize: 400,
746
- requestOptions: {
747
- facetFilterSets: [
748
- {
749
- filters: [
750
- {
751
- fieldName: "type",
752
- values: [
753
- {
754
- value: "Spreadsheet",
755
- relationType: "EQUALS",
756
- },
757
- {
758
- value: "Presentation",
759
- relationType: "EQUALS",
760
- },
761
- ],
762
- },
763
- ],
764
- },
765
- ],
766
- context: {},
767
- },
768
- });
769
-
770
- // Handle the result
771
- console.log(result);
772
- }
773
-
774
- run();
775
- ```
776
-
777
- ### Standalone function
778
-
779
- The standalone function version of this method:
780
-
781
- ```typescript
782
- import { GleanCore } from "@gleanwork/api-client/core.js";
783
- import { clientSearchRecommendations } from "@gleanwork/api-client/funcs/clientSearchRecommendations.js";
784
- import { RFCDate } from "@gleanwork/api-client/types";
785
-
786
- // Use `GleanCore` for best tree-shaking performance.
787
- // You can create one instance of it to use across an application.
788
- const glean = new GleanCore({
789
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
790
- });
791
-
792
- async function run() {
793
- const res = await clientSearchRecommendations(glean, {
794
- sourceDocument: {
795
- metadata: {
796
- datasource: "datasource",
797
- objectType: "Feature Request",
798
- container: "container",
799
- parentId: "JIRA_EN-1337",
800
- mimeType: "mimeType",
801
- documentId: "documentId",
802
- createTime: new Date("2000-01-23T04:56:07.000Z"),
803
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
804
- author: {
805
- name: "George Clooney",
806
- obfuscatedId: "abc123",
807
- relatedDocuments: [],
808
- metadata: {
809
- type: "FULL_TIME",
810
- title: "Actor",
811
- department: "Movies",
812
- email: "george@example.com",
813
- location: "Hollywood, CA",
814
- phone: "6505551234",
815
- photoUrl: "https://example.com/george.jpg",
816
- startDate: new RFCDate("2000-01-23"),
817
- datasourceProfile: [
818
- {
819
- datasource: "github",
820
- handle: "<value>",
821
- },
822
- {
823
- datasource: "github",
824
- handle: "<value>",
825
- },
826
- ],
827
- querySuggestions: {
828
- suggestions: [],
829
- },
830
- inviteInfo: {
831
- invites: [],
832
- },
833
- customFields: [],
834
- badges: [
835
- {
836
- key: "deployment_name_new_hire",
837
- displayName: "New hire",
838
- iconConfig: {
839
- color: "#343CED",
840
- key: "person_icon",
841
- iconType: "GLYPH",
842
- name: "user",
843
- },
844
- },
845
- ],
846
- },
847
- },
848
- owner: {
849
- name: "George Clooney",
850
- obfuscatedId: "abc123",
851
- },
852
- mentionedPeople: [],
853
- components: [
854
- "Backend",
855
- "Networking",
856
- ],
857
- status: "[\"Done\"]",
858
- pins: [],
859
- assignedTo: {
860
- name: "George Clooney",
861
- obfuscatedId: "abc123",
862
- },
863
- updatedBy: {
864
- name: "George Clooney",
865
- obfuscatedId: "abc123",
866
- },
867
- collections: [],
868
- interactions: {
869
- reacts: [],
870
- shares: [],
871
- },
872
- verification: {
873
- state: "UNVERIFIED",
874
- metadata: {
875
- lastVerifier: {
876
- name: "George Clooney",
877
- obfuscatedId: "abc123",
878
- },
879
- reminders: [],
880
- lastReminder: {
881
- assignee: {
882
- name: "George Clooney",
883
- obfuscatedId: "abc123",
884
- },
885
- requestor: {
886
- name: "George Clooney",
887
- obfuscatedId: "abc123",
888
- },
889
- remindAt: 578719,
890
- },
891
- candidateVerifiers: [],
892
- },
893
- },
894
- shortcuts: [],
895
- customData: {
896
- "someCustomField": {},
897
- },
898
- contactPerson: {
899
- name: "George Clooney",
900
- obfuscatedId: "abc123",
901
- },
902
- },
903
- },
904
- pageSize: 100,
905
- maxSnippetSize: 400,
906
- requestOptions: {
907
- facetFilterSets: [
908
- {
909
- filters: [
910
- {
911
- fieldName: "type",
912
- values: [
913
- {
914
- value: "Spreadsheet",
915
- relationType: "EQUALS",
916
- },
917
- {
918
- value: "Presentation",
919
- relationType: "EQUALS",
920
- },
921
- ],
922
- },
923
- ],
924
- },
925
- ],
926
- context: {},
927
- },
928
- });
929
-
930
- if (!res.ok) {
931
- throw res.error;
932
- }
933
-
934
- const { value: result } = res;
935
-
936
- // Handle the result
937
- console.log(result);
938
- }
939
-
940
- run();
941
- ```
942
-
943
- ### React hooks and utilities
944
-
945
- This method can be used in React components through the following hooks and
946
- associated utilities.
947
-
948
- > Check out [this guide][hook-guide] for information about each of the utilities
949
- > below and how to get started using React hooks.
950
-
951
- [hook-guide]: ../../../REACT_QUERY.md
952
-
953
- ```tsx
954
- import {
955
- // Mutation hook for triggering the API call.
956
- useClientSearchRecommendationsMutation
957
- } from "@gleanwork/api-client/react-query/clientSearchRecommendations.js";
958
- ```
959
-
960
- ### Parameters
961
-
962
- | Parameter | Type | Required | Description |
963
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
964
- | `request` | [components.RecommendationsRequest](../../models/components/recommendationsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
965
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
966
- | `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. |
967
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
968
-
969
- ### Response
970
-
971
- **Promise\<[components.ResultsResponse](../../models/components/resultsresponse.md)\>**
972
-
973
- ### Errors
974
-
975
- | Error Type | Status Code | Content Type |
976
- | ----------------- | ----------------- | ----------------- |
977
- | errors.GleanError | 4XX, 5XX | \*/\* |
978
-
979
- ## query
980
-
981
- Retrieve results from the index for the given query and filters.
982
-
983
- ### Example Usage
984
-
985
- ```typescript
986
- import { Glean } from "@gleanwork/api-client";
987
- import { RFCDate } from "@gleanwork/api-client/types";
988
-
989
- const glean = new Glean({
990
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
991
- });
992
-
993
- async function run() {
994
- const result = await glean.client.search.query({
995
- trackingToken: "trackingToken",
996
- sourceDocument: {
997
- metadata: {
998
- datasource: "datasource",
999
- objectType: "Feature Request",
1000
- container: "container",
1001
- parentId: "JIRA_EN-1337",
1002
- mimeType: "mimeType",
1003
- documentId: "documentId",
1004
- createTime: new Date("2000-01-23T04:56:07.000Z"),
1005
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
1006
- author: {
1007
- name: "George Clooney",
1008
- obfuscatedId: "abc123",
1009
- relatedDocuments: [],
1010
- metadata: {
1011
- type: "FULL_TIME",
1012
- title: "Actor",
1013
- department: "Movies",
1014
- email: "george@example.com",
1015
- location: "Hollywood, CA",
1016
- phone: "6505551234",
1017
- photoUrl: "https://example.com/george.jpg",
1018
- startDate: new RFCDate("2000-01-23"),
1019
- datasourceProfile: [
1020
- {
1021
- datasource: "github",
1022
- handle: "<value>",
1023
- },
1024
- {
1025
- datasource: "github",
1026
- handle: "<value>",
1027
- },
1028
- ],
1029
- querySuggestions: {
1030
- suggestions: [],
1031
- },
1032
- inviteInfo: {
1033
- invites: [],
1034
- },
1035
- customFields: [],
1036
- badges: [
1037
- {
1038
- key: "deployment_name_new_hire",
1039
- displayName: "New hire",
1040
- iconConfig: {
1041
- color: "#343CED",
1042
- key: "person_icon",
1043
- iconType: "GLYPH",
1044
- name: "user",
1045
- },
1046
- },
1047
- ],
1048
- },
1049
- },
1050
- owner: {
1051
- name: "George Clooney",
1052
- obfuscatedId: "abc123",
1053
- },
1054
- mentionedPeople: [],
1055
- components: [
1056
- "Backend",
1057
- "Networking",
1058
- ],
1059
- status: "[\"Done\"]",
1060
- pins: [],
1061
- assignedTo: {
1062
- name: "George Clooney",
1063
- obfuscatedId: "abc123",
1064
- },
1065
- updatedBy: {
1066
- name: "George Clooney",
1067
- obfuscatedId: "abc123",
1068
- },
1069
- collections: [],
1070
- interactions: {
1071
- reacts: [],
1072
- shares: [],
1073
- },
1074
- verification: {
1075
- state: "UNVERIFIED",
1076
- metadata: {
1077
- lastVerifier: {
1078
- name: "George Clooney",
1079
- obfuscatedId: "abc123",
1080
- },
1081
- reminders: [],
1082
- lastReminder: {
1083
- assignee: {
1084
- name: "George Clooney",
1085
- obfuscatedId: "abc123",
1086
- },
1087
- requestor: {
1088
- name: "George Clooney",
1089
- obfuscatedId: "abc123",
1090
- },
1091
- remindAt: 554738,
1092
- },
1093
- candidateVerifiers: [],
1094
- },
1095
- },
1096
- shortcuts: [],
1097
- customData: {
1098
- "someCustomField": {},
1099
- },
1100
- contactPerson: {
1101
- name: "George Clooney",
1102
- obfuscatedId: "abc123",
1103
- },
1104
- },
1105
- },
1106
- pageSize: 100,
1107
- maxSnippetSize: 400,
1108
- query: "vacation policy",
1109
- inputDetails: {
1110
- hasCopyPaste: true,
1111
- },
1112
- requestOptions: {
1113
- datasourceFilter: "JIRA",
1114
- datasourcesFilter: [
1115
- "JIRA",
1116
- ],
1117
- queryOverridesFacetFilters: true,
1118
- facetFilters: [
1119
- {
1120
- fieldName: "type",
1121
- values: [
1122
- {
1123
- value: "Spreadsheet",
1124
- relationType: "EQUALS",
1125
- },
1126
- {
1127
- value: "Presentation",
1128
- relationType: "EQUALS",
1129
- },
1130
- ],
1131
- },
1132
- ],
1133
- facetFilterSets: [
1134
- {
1135
- filters: [
1136
- {
1137
- fieldName: "type",
1138
- values: [
1139
- {
1140
- value: "Spreadsheet",
1141
- relationType: "EQUALS",
1142
- },
1143
- {
1144
- value: "Presentation",
1145
- relationType: "EQUALS",
1146
- },
1147
- ],
1148
- },
1149
- ],
1150
- },
1151
- {
1152
- filters: [
1153
- {
1154
- fieldName: "type",
1155
- values: [
1156
- {
1157
- value: "Spreadsheet",
1158
- relationType: "EQUALS",
1159
- },
1160
- {
1161
- value: "Presentation",
1162
- relationType: "EQUALS",
1163
- },
1164
- ],
1165
- },
1166
- ],
1167
- },
1168
- {
1169
- filters: [
1170
- {
1171
- fieldName: "type",
1172
- values: [
1173
- {
1174
- value: "Spreadsheet",
1175
- relationType: "EQUALS",
1176
- },
1177
- {
1178
- value: "Presentation",
1179
- relationType: "EQUALS",
1180
- },
1181
- ],
1182
- },
1183
- ],
1184
- },
1185
- ],
1186
- facetBucketSize: 171751,
1187
- authTokens: [
1188
- {
1189
- accessToken: "123abc",
1190
- datasource: "gmail",
1191
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
1192
- tokenType: "Bearer",
1193
- authUser: "1",
1194
- },
1195
- ],
1196
- },
1197
- timeoutMillis: 5000,
1198
- people: [
1199
- {
1200
- name: "George Clooney",
1201
- obfuscatedId: "abc123",
1202
- },
1203
- ],
1204
- });
1205
-
1206
- // Handle the result
1207
- console.log(result);
1208
- }
1209
-
1210
- run();
1211
- ```
1212
-
1213
- ### Standalone function
1214
-
1215
- The standalone function version of this method:
1216
-
1217
- ```typescript
1218
- import { GleanCore } from "@gleanwork/api-client/core.js";
1219
- import { clientSearchQuery } from "@gleanwork/api-client/funcs/clientSearchQuery.js";
1220
- import { RFCDate } from "@gleanwork/api-client/types";
1221
-
1222
- // Use `GleanCore` for best tree-shaking performance.
1223
- // You can create one instance of it to use across an application.
1224
- const glean = new GleanCore({
1225
- bearerAuth: process.env["GLEAN_BEARER_AUTH"] ?? "",
1226
- });
1227
-
1228
- async function run() {
1229
- const res = await clientSearchQuery(glean, {
1230
- trackingToken: "trackingToken",
1231
- sourceDocument: {
1232
- metadata: {
1233
- datasource: "datasource",
1234
- objectType: "Feature Request",
1235
- container: "container",
1236
- parentId: "JIRA_EN-1337",
1237
- mimeType: "mimeType",
1238
- documentId: "documentId",
1239
- createTime: new Date("2000-01-23T04:56:07.000Z"),
1240
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
1241
- author: {
1242
- name: "George Clooney",
1243
- obfuscatedId: "abc123",
1244
- relatedDocuments: [],
1245
- metadata: {
1246
- type: "FULL_TIME",
1247
- title: "Actor",
1248
- department: "Movies",
1249
- email: "george@example.com",
1250
- location: "Hollywood, CA",
1251
- phone: "6505551234",
1252
- photoUrl: "https://example.com/george.jpg",
1253
- startDate: new RFCDate("2000-01-23"),
1254
- datasourceProfile: [
1255
- {
1256
- datasource: "github",
1257
- handle: "<value>",
1258
- },
1259
- {
1260
- datasource: "github",
1261
- handle: "<value>",
1262
- },
1263
- ],
1264
- querySuggestions: {
1265
- suggestions: [],
1266
- },
1267
- inviteInfo: {
1268
- invites: [],
1269
- },
1270
- customFields: [],
1271
- badges: [
1272
- {
1273
- key: "deployment_name_new_hire",
1274
- displayName: "New hire",
1275
- iconConfig: {
1276
- color: "#343CED",
1277
- key: "person_icon",
1278
- iconType: "GLYPH",
1279
- name: "user",
1280
- },
1281
- },
1282
- ],
1283
- },
1284
- },
1285
- owner: {
1286
- name: "George Clooney",
1287
- obfuscatedId: "abc123",
1288
- },
1289
- mentionedPeople: [],
1290
- components: [
1291
- "Backend",
1292
- "Networking",
1293
- ],
1294
- status: "[\"Done\"]",
1295
- pins: [],
1296
- assignedTo: {
1297
- name: "George Clooney",
1298
- obfuscatedId: "abc123",
1299
- },
1300
- updatedBy: {
1301
- name: "George Clooney",
1302
- obfuscatedId: "abc123",
1303
- },
1304
- collections: [],
1305
- interactions: {
1306
- reacts: [],
1307
- shares: [],
1308
- },
1309
- verification: {
1310
- state: "UNVERIFIED",
1311
- metadata: {
1312
- lastVerifier: {
1313
- name: "George Clooney",
1314
- obfuscatedId: "abc123",
1315
- },
1316
- reminders: [],
1317
- lastReminder: {
1318
- assignee: {
1319
- name: "George Clooney",
1320
- obfuscatedId: "abc123",
1321
- },
1322
- requestor: {
1323
- name: "George Clooney",
1324
- obfuscatedId: "abc123",
1325
- },
1326
- remindAt: 554738,
1327
- },
1328
- candidateVerifiers: [],
1329
- },
1330
- },
1331
- shortcuts: [],
1332
- customData: {
1333
- "someCustomField": {},
1334
- },
1335
- contactPerson: {
1336
- name: "George Clooney",
1337
- obfuscatedId: "abc123",
1338
- },
1339
- },
1340
- },
1341
- pageSize: 100,
1342
- maxSnippetSize: 400,
1343
- query: "vacation policy",
1344
- inputDetails: {
1345
- hasCopyPaste: true,
1346
- },
1347
- requestOptions: {
1348
- datasourceFilter: "JIRA",
1349
- datasourcesFilter: [
1350
- "JIRA",
1351
- ],
1352
- queryOverridesFacetFilters: true,
1353
- facetFilters: [
1354
- {
1355
- fieldName: "type",
1356
- values: [
1357
- {
1358
- value: "Spreadsheet",
1359
- relationType: "EQUALS",
1360
- },
1361
- {
1362
- value: "Presentation",
1363
- relationType: "EQUALS",
1364
- },
1365
- ],
1366
- },
1367
- ],
1368
- facetFilterSets: [
1369
- {
1370
- filters: [
1371
- {
1372
- fieldName: "type",
1373
- values: [
1374
- {
1375
- value: "Spreadsheet",
1376
- relationType: "EQUALS",
1377
- },
1378
- {
1379
- value: "Presentation",
1380
- relationType: "EQUALS",
1381
- },
1382
- ],
1383
- },
1384
- ],
1385
- },
1386
- {
1387
- filters: [
1388
- {
1389
- fieldName: "type",
1390
- values: [
1391
- {
1392
- value: "Spreadsheet",
1393
- relationType: "EQUALS",
1394
- },
1395
- {
1396
- value: "Presentation",
1397
- relationType: "EQUALS",
1398
- },
1399
- ],
1400
- },
1401
- ],
1402
- },
1403
- {
1404
- filters: [
1405
- {
1406
- fieldName: "type",
1407
- values: [
1408
- {
1409
- value: "Spreadsheet",
1410
- relationType: "EQUALS",
1411
- },
1412
- {
1413
- value: "Presentation",
1414
- relationType: "EQUALS",
1415
- },
1416
- ],
1417
- },
1418
- ],
1419
- },
1420
- ],
1421
- facetBucketSize: 171751,
1422
- authTokens: [
1423
- {
1424
- accessToken: "123abc",
1425
- datasource: "gmail",
1426
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
1427
- tokenType: "Bearer",
1428
- authUser: "1",
1429
- },
1430
- ],
1431
- },
1432
- timeoutMillis: 5000,
1433
- people: [
1434
- {
1435
- name: "George Clooney",
1436
- obfuscatedId: "abc123",
1437
- },
1438
- ],
1439
- });
1440
-
1441
- if (!res.ok) {
1442
- throw res.error;
1443
- }
1444
-
1445
- const { value: result } = res;
1446
-
1447
- // Handle the result
1448
- console.log(result);
1449
- }
1450
-
1451
- run();
1452
- ```
1453
-
1454
- ### React hooks and utilities
1455
-
1456
- This method can be used in React components through the following hooks and
1457
- associated utilities.
1458
-
1459
- > Check out [this guide][hook-guide] for information about each of the utilities
1460
- > below and how to get started using React hooks.
1461
-
1462
- [hook-guide]: ../../../REACT_QUERY.md
1463
-
1464
- ```tsx
1465
- import {
1466
- // Mutation hook for triggering the API call.
1467
- useClientSearchQueryMutation
1468
- } from "@gleanwork/api-client/react-query/clientSearchQuery.js";
1469
- ```
1470
-
1471
- ### Parameters
1472
-
1473
- | Parameter | Type | Required | Description |
1474
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1475
- | `request` | [components.SearchRequest](../../models/components/searchrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1476
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1477
- | `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. |
1478
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1479
-
1480
- ### Response
1481
-
1482
- **Promise\<[components.SearchResponse](../../models/components/searchresponse.md)\>**
1483
-
1484
- ### Errors
1485
-
1486
- | Error Type | Status Code | Content Type |
1487
- | --------------------- | --------------------- | --------------------- |
1488
- | errors.GleanDataError | 403, 422 | application/json |
1489
- | errors.GleanError | 4XX, 5XX | \*/\* |