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