@gleanwork/api-client 0.13.1 → 0.13.3
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 +2 -1
- package/dist/commonjs/__tests__/messages.test.js +1 -1
- package/dist/commonjs/__tests__/messages.test.js.map +1 -1
- package/dist/commonjs/__tests__/summarize.test.js +4 -3
- package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/agentsinsightsv2response.d.ts +4 -0
- package/dist/commonjs/models/components/agentsinsightsv2response.d.ts.map +1 -1
- package/dist/commonjs/models/components/agentsinsightsv2response.js +4 -0
- package/dist/commonjs/models/components/agentsinsightsv2response.js.map +1 -1
- package/dist/commonjs/models/components/chatmessagefragment.d.ts +1 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts +3 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.js.map +1 -1
- package/dist/commonjs/models/components/peragentinsight.d.ts +10 -0
- package/dist/commonjs/models/components/peragentinsight.d.ts.map +1 -1
- package/dist/commonjs/models/components/peragentinsight.js +4 -0
- package/dist/commonjs/models/components/peragentinsight.js.map +1 -1
- package/dist/esm/__tests__/messages.test.js +1 -1
- package/dist/esm/__tests__/messages.test.js.map +1 -1
- package/dist/esm/__tests__/summarize.test.js +4 -3
- package/dist/esm/__tests__/summarize.test.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/agentsinsightsv2response.d.ts +4 -0
- package/dist/esm/models/components/agentsinsightsv2response.d.ts.map +1 -1
- package/dist/esm/models/components/agentsinsightsv2response.js +4 -0
- package/dist/esm/models/components/agentsinsightsv2response.js.map +1 -1
- package/dist/esm/models/components/chatmessagefragment.d.ts +1 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts +3 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.js.map +1 -1
- package/dist/esm/models/components/peragentinsight.d.ts +10 -0
- package/dist/esm/models/components/peragentinsight.d.ts.map +1 -1
- package/dist/esm/models/components/peragentinsight.js +4 -0
- package/dist/esm/models/components/peragentinsight.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/messages.test.ts +1 -1
- package/src/__tests__/summarize.test.ts +4 -3
- package/src/lib/config.ts +3 -3
- package/src/models/components/agentsinsightsv2response.ts +8 -0
- package/src/models/components/chatmessagefragment.ts +1 -1
- package/src/models/components/debugdatasourcestatusresponse.ts +3 -1
- package/src/models/components/peragentinsight.ts +14 -0
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/activity/README.md +0 -242
- package/docs/sdks/agents/README.md +0 -498
- package/docs/sdks/announcements/README.md +0 -137560
- package/docs/sdks/answers/README.md +0 -4966
- package/docs/sdks/chat/README.md +0 -967
- package/docs/sdks/clientauthentication/README.md +0 -98
- package/docs/sdks/clientdocuments/README.md +0 -457
- package/docs/sdks/clientshortcuts/README.md +0 -9340
- package/docs/sdks/collections/README.md +0 -4148
- package/docs/sdks/datasource/README.md +0 -98
- package/docs/sdks/datasources/README.md +0 -211
- package/docs/sdks/entities/README.md +0 -225
- package/docs/sdks/indexingauthentication/README.md +0 -93
- package/docs/sdks/indexingdocuments/README.md +0 -983
- package/docs/sdks/indexingshortcuts/README.md +0 -251
- package/docs/sdks/insights/README.md +0 -94
- package/docs/sdks/messages/README.md +0 -102
- package/docs/sdks/people/README.md +0 -1052
- package/docs/sdks/permissions/README.md +0 -1198
- package/docs/sdks/pins/README.md +0 -506
- package/docs/sdks/policies/README.md +0 -478
- package/docs/sdks/reports/README.md +0 -290
- package/docs/sdks/search/README.md +0 -986
- package/docs/sdks/tools/README.md +0 -208
- package/docs/sdks/verification/README.md +0 -276
- package/docs/sdks/visibilityoverrides/README.md +0 -192
- package/examples/README.md +0 -31
- package/src/__tests__/mockserver/README.md +0 -52
|
@@ -1,983 +0,0 @@
|
|
|
1
|
-
# IndexingDocuments
|
|
2
|
-
(*indexing.documents*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [addOrUpdate](#addorupdate) - Index document
|
|
9
|
-
* [index](#index) - Index documents
|
|
10
|
-
* [bulkIndex](#bulkindex) - Bulk index documents
|
|
11
|
-
* [processAll](#processall) - Schedules the processing of uploaded documents
|
|
12
|
-
* [delete](#delete) - Delete document
|
|
13
|
-
* [debug](#debug) - Beta: Get document information
|
|
14
|
-
|
|
15
|
-
* [debugMany](#debugmany) - Beta: Get information of a batch of documents
|
|
16
|
-
|
|
17
|
-
* [checkAccess](#checkaccess) - Check document access
|
|
18
|
-
* [~~status~~](#status) - Get document upload and indexing status :warning: **Deprecated**
|
|
19
|
-
* [~~count~~](#count) - Get document count :warning: **Deprecated**
|
|
20
|
-
|
|
21
|
-
## addOrUpdate
|
|
22
|
-
|
|
23
|
-
Adds a document to the index or updates an existing document.
|
|
24
|
-
|
|
25
|
-
### Example Usage
|
|
26
|
-
|
|
27
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/indexdocument" method="post" path="/api/index/v1/indexdocument" -->
|
|
28
|
-
```typescript
|
|
29
|
-
import { Glean } from "@gleanwork/api-client";
|
|
30
|
-
|
|
31
|
-
const glean = new Glean({
|
|
32
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
async function run() {
|
|
36
|
-
await glean.indexing.documents.addOrUpdate({
|
|
37
|
-
document: {
|
|
38
|
-
datasource: "<value>",
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
run();
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Standalone function
|
|
49
|
-
|
|
50
|
-
The standalone function version of this method:
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
54
|
-
import { indexingDocumentsAddOrUpdate } from "@gleanwork/api-client/funcs/indexingDocumentsAddOrUpdate.js";
|
|
55
|
-
|
|
56
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
57
|
-
// You can create one instance of it to use across an application.
|
|
58
|
-
const glean = new GleanCore({
|
|
59
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
async function run() {
|
|
63
|
-
const res = await indexingDocumentsAddOrUpdate(glean, {
|
|
64
|
-
document: {
|
|
65
|
-
datasource: "<value>",
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
if (res.ok) {
|
|
69
|
-
const { value: result } = res;
|
|
70
|
-
|
|
71
|
-
} else {
|
|
72
|
-
console.log("indexingDocumentsAddOrUpdate failed:", res.error);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
run();
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### React hooks and utilities
|
|
80
|
-
|
|
81
|
-
This method can be used in React components through the following hooks and
|
|
82
|
-
associated utilities.
|
|
83
|
-
|
|
84
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
85
|
-
> below and how to get started using React hooks.
|
|
86
|
-
|
|
87
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
88
|
-
|
|
89
|
-
```tsx
|
|
90
|
-
import {
|
|
91
|
-
// Mutation hook for triggering the API call.
|
|
92
|
-
useIndexingDocumentsAddOrUpdateMutation
|
|
93
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsAddOrUpdate.js";
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Parameters
|
|
97
|
-
|
|
98
|
-
| Parameter | Type | Required | Description |
|
|
99
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
100
|
-
| `request` | [components.IndexDocumentRequest](../../models/components/indexdocumentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
101
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
102
|
-
| `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. |
|
|
103
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
104
|
-
|
|
105
|
-
### Response
|
|
106
|
-
|
|
107
|
-
**Promise\<void\>**
|
|
108
|
-
|
|
109
|
-
### Errors
|
|
110
|
-
|
|
111
|
-
| Error Type | Status Code | Content Type |
|
|
112
|
-
| ----------------- | ----------------- | ----------------- |
|
|
113
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
114
|
-
|
|
115
|
-
## index
|
|
116
|
-
|
|
117
|
-
Adds or updates multiple documents in the index. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-indexing/choosing-indexdocuments-vs-bulkindexdocuments) documentation for an explanation of when to use this endpoint.
|
|
118
|
-
|
|
119
|
-
### Example Usage
|
|
120
|
-
|
|
121
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/indexdocuments" method="post" path="/api/index/v1/indexdocuments" -->
|
|
122
|
-
```typescript
|
|
123
|
-
import { Glean } from "@gleanwork/api-client";
|
|
124
|
-
|
|
125
|
-
const glean = new Glean({
|
|
126
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
async function run() {
|
|
130
|
-
await glean.indexing.documents.index({
|
|
131
|
-
datasource: "<value>",
|
|
132
|
-
documents: [],
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
run();
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Standalone function
|
|
142
|
-
|
|
143
|
-
The standalone function version of this method:
|
|
144
|
-
|
|
145
|
-
```typescript
|
|
146
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
147
|
-
import { indexingDocumentsIndex } from "@gleanwork/api-client/funcs/indexingDocumentsIndex.js";
|
|
148
|
-
|
|
149
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
150
|
-
// You can create one instance of it to use across an application.
|
|
151
|
-
const glean = new GleanCore({
|
|
152
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
async function run() {
|
|
156
|
-
const res = await indexingDocumentsIndex(glean, {
|
|
157
|
-
datasource: "<value>",
|
|
158
|
-
documents: [],
|
|
159
|
-
});
|
|
160
|
-
if (res.ok) {
|
|
161
|
-
const { value: result } = res;
|
|
162
|
-
|
|
163
|
-
} else {
|
|
164
|
-
console.log("indexingDocumentsIndex failed:", res.error);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
run();
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### React hooks and utilities
|
|
172
|
-
|
|
173
|
-
This method can be used in React components through the following hooks and
|
|
174
|
-
associated utilities.
|
|
175
|
-
|
|
176
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
177
|
-
> below and how to get started using React hooks.
|
|
178
|
-
|
|
179
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
180
|
-
|
|
181
|
-
```tsx
|
|
182
|
-
import {
|
|
183
|
-
// Mutation hook for triggering the API call.
|
|
184
|
-
useIndexingDocumentsIndexMutation
|
|
185
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsIndex.js";
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Parameters
|
|
189
|
-
|
|
190
|
-
| Parameter | Type | Required | Description |
|
|
191
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
192
|
-
| `request` | [components.IndexDocumentsRequest](../../models/components/indexdocumentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
193
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
194
|
-
| `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. |
|
|
195
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
196
|
-
|
|
197
|
-
### Response
|
|
198
|
-
|
|
199
|
-
**Promise\<void\>**
|
|
200
|
-
|
|
201
|
-
### Errors
|
|
202
|
-
|
|
203
|
-
| Error Type | Status Code | Content Type |
|
|
204
|
-
| ----------------- | ----------------- | ----------------- |
|
|
205
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
206
|
-
|
|
207
|
-
## bulkIndex
|
|
208
|
-
|
|
209
|
-
Replaces the documents in a datasource using paginated batch API calls. Please refer to the [bulk indexing](https://developers.glean.com/indexing/documents/bulk-upload-model) documentation for an explanation of how to use bulk endpoints.
|
|
210
|
-
|
|
211
|
-
### Example Usage
|
|
212
|
-
|
|
213
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/bulkindexdocuments" method="post" path="/api/index/v1/bulkindexdocuments" -->
|
|
214
|
-
```typescript
|
|
215
|
-
import { Glean } from "@gleanwork/api-client";
|
|
216
|
-
|
|
217
|
-
const glean = new Glean({
|
|
218
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
async function run() {
|
|
222
|
-
await glean.indexing.documents.bulkIndex({
|
|
223
|
-
uploadId: "<id>",
|
|
224
|
-
datasource: "<value>",
|
|
225
|
-
documents: [],
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
run();
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### Standalone function
|
|
235
|
-
|
|
236
|
-
The standalone function version of this method:
|
|
237
|
-
|
|
238
|
-
```typescript
|
|
239
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
240
|
-
import { indexingDocumentsBulkIndex } from "@gleanwork/api-client/funcs/indexingDocumentsBulkIndex.js";
|
|
241
|
-
|
|
242
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
243
|
-
// You can create one instance of it to use across an application.
|
|
244
|
-
const glean = new GleanCore({
|
|
245
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
async function run() {
|
|
249
|
-
const res = await indexingDocumentsBulkIndex(glean, {
|
|
250
|
-
uploadId: "<id>",
|
|
251
|
-
datasource: "<value>",
|
|
252
|
-
documents: [],
|
|
253
|
-
});
|
|
254
|
-
if (res.ok) {
|
|
255
|
-
const { value: result } = res;
|
|
256
|
-
|
|
257
|
-
} else {
|
|
258
|
-
console.log("indexingDocumentsBulkIndex failed:", res.error);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
run();
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### React hooks and utilities
|
|
266
|
-
|
|
267
|
-
This method can be used in React components through the following hooks and
|
|
268
|
-
associated utilities.
|
|
269
|
-
|
|
270
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
271
|
-
> below and how to get started using React hooks.
|
|
272
|
-
|
|
273
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
274
|
-
|
|
275
|
-
```tsx
|
|
276
|
-
import {
|
|
277
|
-
// Mutation hook for triggering the API call.
|
|
278
|
-
useIndexingDocumentsBulkIndexMutation
|
|
279
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsBulkIndex.js";
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
### Parameters
|
|
283
|
-
|
|
284
|
-
| Parameter | Type | Required | Description |
|
|
285
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
286
|
-
| `request` | [components.BulkIndexDocumentsRequest](../../models/components/bulkindexdocumentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
287
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
288
|
-
| `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. |
|
|
289
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
290
|
-
|
|
291
|
-
### Response
|
|
292
|
-
|
|
293
|
-
**Promise\<void\>**
|
|
294
|
-
|
|
295
|
-
### Errors
|
|
296
|
-
|
|
297
|
-
| Error Type | Status Code | Content Type |
|
|
298
|
-
| ----------------- | ----------------- | ----------------- |
|
|
299
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
300
|
-
|
|
301
|
-
## processAll
|
|
302
|
-
|
|
303
|
-
Schedules the immediate processing of documents uploaded through the indexing API. By default the uploaded documents will be processed asynchronously but this API can be used to schedule processing of all documents on demand.
|
|
304
|
-
|
|
305
|
-
If a `datasource` parameter is specified, processing is limited to that custom datasource. Without it, processing applies to all documents across all custom datasources.
|
|
306
|
-
#### Rate Limits
|
|
307
|
-
This endpoint is rate-limited to one usage every 3 hours. Exceeding this limit results in a 429 response code. Here's how the rate limit works:
|
|
308
|
-
1. Calling `/processalldocuments` for datasource `foo` prevents another call for `foo` for 3 hours.
|
|
309
|
-
2. Calling `/processalldocuments` for datasource `foo` doesn't affect immediate calls for `bar`.
|
|
310
|
-
3. Calling `/processalldocuments` for all datasources prevents any datasource calls for 3 hours.
|
|
311
|
-
4. Calling `/processalldocuments` for datasource `foo` doesn't affect immediate calls for all datasources.
|
|
312
|
-
|
|
313
|
-
For more frequent document processing, contact Glean support.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
### Example Usage
|
|
317
|
-
|
|
318
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/processalldocuments" method="post" path="/api/index/v1/processalldocuments" -->
|
|
319
|
-
```typescript
|
|
320
|
-
import { Glean } from "@gleanwork/api-client";
|
|
321
|
-
|
|
322
|
-
const glean = new Glean({
|
|
323
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
async function run() {
|
|
327
|
-
await glean.indexing.documents.processAll();
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
run();
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
### Standalone function
|
|
336
|
-
|
|
337
|
-
The standalone function version of this method:
|
|
338
|
-
|
|
339
|
-
```typescript
|
|
340
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
341
|
-
import { indexingDocumentsProcessAll } from "@gleanwork/api-client/funcs/indexingDocumentsProcessAll.js";
|
|
342
|
-
|
|
343
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
344
|
-
// You can create one instance of it to use across an application.
|
|
345
|
-
const glean = new GleanCore({
|
|
346
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
async function run() {
|
|
350
|
-
const res = await indexingDocumentsProcessAll(glean);
|
|
351
|
-
if (res.ok) {
|
|
352
|
-
const { value: result } = res;
|
|
353
|
-
|
|
354
|
-
} else {
|
|
355
|
-
console.log("indexingDocumentsProcessAll failed:", res.error);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
run();
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
### React hooks and utilities
|
|
363
|
-
|
|
364
|
-
This method can be used in React components through the following hooks and
|
|
365
|
-
associated utilities.
|
|
366
|
-
|
|
367
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
368
|
-
> below and how to get started using React hooks.
|
|
369
|
-
|
|
370
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
371
|
-
|
|
372
|
-
```tsx
|
|
373
|
-
import {
|
|
374
|
-
// Mutation hook for triggering the API call.
|
|
375
|
-
useIndexingDocumentsProcessAllMutation
|
|
376
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsProcessAll.js";
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
### Parameters
|
|
380
|
-
|
|
381
|
-
| Parameter | Type | Required | Description |
|
|
382
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
383
|
-
| `request` | [components.ProcessAllDocumentsRequest](../../models/components/processalldocumentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
384
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
385
|
-
| `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. |
|
|
386
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
387
|
-
|
|
388
|
-
### Response
|
|
389
|
-
|
|
390
|
-
**Promise\<void\>**
|
|
391
|
-
|
|
392
|
-
### Errors
|
|
393
|
-
|
|
394
|
-
| Error Type | Status Code | Content Type |
|
|
395
|
-
| ----------------- | ----------------- | ----------------- |
|
|
396
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
397
|
-
|
|
398
|
-
## delete
|
|
399
|
-
|
|
400
|
-
Deletes the specified document from the index. Succeeds if document is not present.
|
|
401
|
-
|
|
402
|
-
### Example Usage
|
|
403
|
-
|
|
404
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/deletedocument" method="post" path="/api/index/v1/deletedocument" -->
|
|
405
|
-
```typescript
|
|
406
|
-
import { Glean } from "@gleanwork/api-client";
|
|
407
|
-
|
|
408
|
-
const glean = new Glean({
|
|
409
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
410
|
-
});
|
|
411
|
-
|
|
412
|
-
async function run() {
|
|
413
|
-
await glean.indexing.documents.delete({
|
|
414
|
-
datasource: "<value>",
|
|
415
|
-
objectType: "<value>",
|
|
416
|
-
id: "<id>",
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
run();
|
|
423
|
-
```
|
|
424
|
-
|
|
425
|
-
### Standalone function
|
|
426
|
-
|
|
427
|
-
The standalone function version of this method:
|
|
428
|
-
|
|
429
|
-
```typescript
|
|
430
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
431
|
-
import { indexingDocumentsDelete } from "@gleanwork/api-client/funcs/indexingDocumentsDelete.js";
|
|
432
|
-
|
|
433
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
434
|
-
// You can create one instance of it to use across an application.
|
|
435
|
-
const glean = new GleanCore({
|
|
436
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
async function run() {
|
|
440
|
-
const res = await indexingDocumentsDelete(glean, {
|
|
441
|
-
datasource: "<value>",
|
|
442
|
-
objectType: "<value>",
|
|
443
|
-
id: "<id>",
|
|
444
|
-
});
|
|
445
|
-
if (res.ok) {
|
|
446
|
-
const { value: result } = res;
|
|
447
|
-
|
|
448
|
-
} else {
|
|
449
|
-
console.log("indexingDocumentsDelete failed:", res.error);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
run();
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
### React hooks and utilities
|
|
457
|
-
|
|
458
|
-
This method can be used in React components through the following hooks and
|
|
459
|
-
associated utilities.
|
|
460
|
-
|
|
461
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
462
|
-
> below and how to get started using React hooks.
|
|
463
|
-
|
|
464
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
465
|
-
|
|
466
|
-
```tsx
|
|
467
|
-
import {
|
|
468
|
-
// Mutation hook for triggering the API call.
|
|
469
|
-
useIndexingDocumentsDeleteMutation
|
|
470
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsDelete.js";
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
### Parameters
|
|
474
|
-
|
|
475
|
-
| Parameter | Type | Required | Description |
|
|
476
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
477
|
-
| `request` | [components.DeleteDocumentRequest](../../models/components/deletedocumentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
478
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
479
|
-
| `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. |
|
|
480
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
481
|
-
|
|
482
|
-
### Response
|
|
483
|
-
|
|
484
|
-
**Promise\<void\>**
|
|
485
|
-
|
|
486
|
-
### Errors
|
|
487
|
-
|
|
488
|
-
| Error Type | Status Code | Content Type |
|
|
489
|
-
| ----------------- | ----------------- | ----------------- |
|
|
490
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
491
|
-
|
|
492
|
-
## debug
|
|
493
|
-
|
|
494
|
-
Gives various information that would help in debugging related to a particular document. Currently in beta, might undergo breaking changes without prior notice.
|
|
495
|
-
|
|
496
|
-
Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
### Example Usage
|
|
500
|
-
|
|
501
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/debug/{datasource}/document" method="post" path="/api/index/v1/debug/{datasource}/document" -->
|
|
502
|
-
```typescript
|
|
503
|
-
import { Glean } from "@gleanwork/api-client";
|
|
504
|
-
|
|
505
|
-
const glean = new Glean({
|
|
506
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
async function run() {
|
|
510
|
-
const result = await glean.indexing.documents.debug({
|
|
511
|
-
objectType: "Article",
|
|
512
|
-
docId: "art123",
|
|
513
|
-
}, "<value>");
|
|
514
|
-
|
|
515
|
-
console.log(result);
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
run();
|
|
519
|
-
```
|
|
520
|
-
|
|
521
|
-
### Standalone function
|
|
522
|
-
|
|
523
|
-
The standalone function version of this method:
|
|
524
|
-
|
|
525
|
-
```typescript
|
|
526
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
527
|
-
import { indexingDocumentsDebug } from "@gleanwork/api-client/funcs/indexingDocumentsDebug.js";
|
|
528
|
-
|
|
529
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
530
|
-
// You can create one instance of it to use across an application.
|
|
531
|
-
const glean = new GleanCore({
|
|
532
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
async function run() {
|
|
536
|
-
const res = await indexingDocumentsDebug(glean, {
|
|
537
|
-
objectType: "Article",
|
|
538
|
-
docId: "art123",
|
|
539
|
-
}, "<value>");
|
|
540
|
-
if (res.ok) {
|
|
541
|
-
const { value: result } = res;
|
|
542
|
-
console.log(result);
|
|
543
|
-
} else {
|
|
544
|
-
console.log("indexingDocumentsDebug failed:", res.error);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
run();
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
### React hooks and utilities
|
|
552
|
-
|
|
553
|
-
This method can be used in React components through the following hooks and
|
|
554
|
-
associated utilities.
|
|
555
|
-
|
|
556
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
557
|
-
> below and how to get started using React hooks.
|
|
558
|
-
|
|
559
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
560
|
-
|
|
561
|
-
```tsx
|
|
562
|
-
import {
|
|
563
|
-
// Mutation hook for triggering the API call.
|
|
564
|
-
useIndexingDocumentsDebugMutation
|
|
565
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsDebug.js";
|
|
566
|
-
```
|
|
567
|
-
|
|
568
|
-
### Parameters
|
|
569
|
-
|
|
570
|
-
| Parameter | Type | Required | Description |
|
|
571
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
572
|
-
| `datasource` | *string* | :heavy_check_mark: | The datasource to which the document belongs |
|
|
573
|
-
| `debugDocumentRequest` | [components.DebugDocumentRequest](../../models/components/debugdocumentrequest.md) | :heavy_check_mark: | N/A |
|
|
574
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
575
|
-
| `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. |
|
|
576
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
577
|
-
|
|
578
|
-
### Response
|
|
579
|
-
|
|
580
|
-
**Promise\<[components.DebugDocumentResponse](../../models/components/debugdocumentresponse.md)\>**
|
|
581
|
-
|
|
582
|
-
### Errors
|
|
583
|
-
|
|
584
|
-
| Error Type | Status Code | Content Type |
|
|
585
|
-
| ----------------- | ----------------- | ----------------- |
|
|
586
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
587
|
-
|
|
588
|
-
## debugMany
|
|
589
|
-
|
|
590
|
-
Gives various information that would help in debugging related to a batch of documents. Currently in beta, might undergo breaking changes without prior notice.
|
|
591
|
-
|
|
592
|
-
Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
### Example Usage
|
|
596
|
-
|
|
597
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/debug/{datasource}/documents" method="post" path="/api/index/v1/debug/{datasource}/documents" -->
|
|
598
|
-
```typescript
|
|
599
|
-
import { Glean } from "@gleanwork/api-client";
|
|
600
|
-
|
|
601
|
-
const glean = new Glean({
|
|
602
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
603
|
-
});
|
|
604
|
-
|
|
605
|
-
async function run() {
|
|
606
|
-
const result = await glean.indexing.documents.debugMany({
|
|
607
|
-
debugDocuments: [
|
|
608
|
-
{
|
|
609
|
-
objectType: "Article",
|
|
610
|
-
docId: "art123",
|
|
611
|
-
},
|
|
612
|
-
],
|
|
613
|
-
}, "<value>");
|
|
614
|
-
|
|
615
|
-
console.log(result);
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
run();
|
|
619
|
-
```
|
|
620
|
-
|
|
621
|
-
### Standalone function
|
|
622
|
-
|
|
623
|
-
The standalone function version of this method:
|
|
624
|
-
|
|
625
|
-
```typescript
|
|
626
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
627
|
-
import { indexingDocumentsDebugMany } from "@gleanwork/api-client/funcs/indexingDocumentsDebugMany.js";
|
|
628
|
-
|
|
629
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
630
|
-
// You can create one instance of it to use across an application.
|
|
631
|
-
const glean = new GleanCore({
|
|
632
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
633
|
-
});
|
|
634
|
-
|
|
635
|
-
async function run() {
|
|
636
|
-
const res = await indexingDocumentsDebugMany(glean, {
|
|
637
|
-
debugDocuments: [
|
|
638
|
-
{
|
|
639
|
-
objectType: "Article",
|
|
640
|
-
docId: "art123",
|
|
641
|
-
},
|
|
642
|
-
],
|
|
643
|
-
}, "<value>");
|
|
644
|
-
if (res.ok) {
|
|
645
|
-
const { value: result } = res;
|
|
646
|
-
console.log(result);
|
|
647
|
-
} else {
|
|
648
|
-
console.log("indexingDocumentsDebugMany failed:", res.error);
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
run();
|
|
653
|
-
```
|
|
654
|
-
|
|
655
|
-
### React hooks and utilities
|
|
656
|
-
|
|
657
|
-
This method can be used in React components through the following hooks and
|
|
658
|
-
associated utilities.
|
|
659
|
-
|
|
660
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
661
|
-
> below and how to get started using React hooks.
|
|
662
|
-
|
|
663
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
664
|
-
|
|
665
|
-
```tsx
|
|
666
|
-
import {
|
|
667
|
-
// Mutation hook for triggering the API call.
|
|
668
|
-
useIndexingDocumentsDebugManyMutation
|
|
669
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsDebugMany.js";
|
|
670
|
-
```
|
|
671
|
-
|
|
672
|
-
### Parameters
|
|
673
|
-
|
|
674
|
-
| Parameter | Type | Required | Description |
|
|
675
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
676
|
-
| `datasource` | *string* | :heavy_check_mark: | The datasource to which the document belongs |
|
|
677
|
-
| `debugDocumentsRequest` | [components.DebugDocumentsRequest](../../models/components/debugdocumentsrequest.md) | :heavy_check_mark: | N/A |
|
|
678
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
679
|
-
| `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. |
|
|
680
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
681
|
-
|
|
682
|
-
### Response
|
|
683
|
-
|
|
684
|
-
**Promise\<[components.DebugDocumentsResponse](../../models/components/debugdocumentsresponse.md)\>**
|
|
685
|
-
|
|
686
|
-
### Errors
|
|
687
|
-
|
|
688
|
-
| Error Type | Status Code | Content Type |
|
|
689
|
-
| ----------------- | ----------------- | ----------------- |
|
|
690
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
691
|
-
|
|
692
|
-
## checkAccess
|
|
693
|
-
|
|
694
|
-
Check if a given user has access to access a document in a custom datasource
|
|
695
|
-
|
|
696
|
-
Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
### Example Usage
|
|
700
|
-
|
|
701
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/checkdocumentaccess" method="post" path="/api/index/v1/checkdocumentaccess" -->
|
|
702
|
-
```typescript
|
|
703
|
-
import { Glean } from "@gleanwork/api-client";
|
|
704
|
-
|
|
705
|
-
const glean = new Glean({
|
|
706
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
707
|
-
});
|
|
708
|
-
|
|
709
|
-
async function run() {
|
|
710
|
-
const result = await glean.indexing.documents.checkAccess({
|
|
711
|
-
datasource: "<value>",
|
|
712
|
-
objectType: "<value>",
|
|
713
|
-
docId: "<id>",
|
|
714
|
-
userEmail: "<value>",
|
|
715
|
-
});
|
|
716
|
-
|
|
717
|
-
console.log(result);
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
run();
|
|
721
|
-
```
|
|
722
|
-
|
|
723
|
-
### Standalone function
|
|
724
|
-
|
|
725
|
-
The standalone function version of this method:
|
|
726
|
-
|
|
727
|
-
```typescript
|
|
728
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
729
|
-
import { indexingDocumentsCheckAccess } from "@gleanwork/api-client/funcs/indexingDocumentsCheckAccess.js";
|
|
730
|
-
|
|
731
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
732
|
-
// You can create one instance of it to use across an application.
|
|
733
|
-
const glean = new GleanCore({
|
|
734
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
735
|
-
});
|
|
736
|
-
|
|
737
|
-
async function run() {
|
|
738
|
-
const res = await indexingDocumentsCheckAccess(glean, {
|
|
739
|
-
datasource: "<value>",
|
|
740
|
-
objectType: "<value>",
|
|
741
|
-
docId: "<id>",
|
|
742
|
-
userEmail: "<value>",
|
|
743
|
-
});
|
|
744
|
-
if (res.ok) {
|
|
745
|
-
const { value: result } = res;
|
|
746
|
-
console.log(result);
|
|
747
|
-
} else {
|
|
748
|
-
console.log("indexingDocumentsCheckAccess failed:", res.error);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
run();
|
|
753
|
-
```
|
|
754
|
-
|
|
755
|
-
### React hooks and utilities
|
|
756
|
-
|
|
757
|
-
This method can be used in React components through the following hooks and
|
|
758
|
-
associated utilities.
|
|
759
|
-
|
|
760
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
761
|
-
> below and how to get started using React hooks.
|
|
762
|
-
|
|
763
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
764
|
-
|
|
765
|
-
```tsx
|
|
766
|
-
import {
|
|
767
|
-
// Mutation hook for triggering the API call.
|
|
768
|
-
useIndexingDocumentsCheckAccessMutation
|
|
769
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsCheckAccess.js";
|
|
770
|
-
```
|
|
771
|
-
|
|
772
|
-
### Parameters
|
|
773
|
-
|
|
774
|
-
| Parameter | Type | Required | Description |
|
|
775
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
776
|
-
| `request` | [components.CheckDocumentAccessRequest](../../models/components/checkdocumentaccessrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
777
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
778
|
-
| `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. |
|
|
779
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
780
|
-
|
|
781
|
-
### Response
|
|
782
|
-
|
|
783
|
-
**Promise\<[components.CheckDocumentAccessResponse](../../models/components/checkdocumentaccessresponse.md)\>**
|
|
784
|
-
|
|
785
|
-
### Errors
|
|
786
|
-
|
|
787
|
-
| Error Type | Status Code | Content Type |
|
|
788
|
-
| ----------------- | ----------------- | ----------------- |
|
|
789
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
790
|
-
|
|
791
|
-
## ~~status~~
|
|
792
|
-
|
|
793
|
-
Intended for debugging/validation. Fetches the current upload and indexing status of documents.
|
|
794
|
-
|
|
795
|
-
Tip: Use [/debug/{datasource}/document](https://developers.glean.com/indexing/debugging/datasource-document) for richer information.
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
799
|
-
|
|
800
|
-
### Example Usage
|
|
801
|
-
|
|
802
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/getdocumentstatus" method="post" path="/api/index/v1/getdocumentstatus" -->
|
|
803
|
-
```typescript
|
|
804
|
-
import { Glean } from "@gleanwork/api-client";
|
|
805
|
-
|
|
806
|
-
const glean = new Glean({
|
|
807
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
808
|
-
});
|
|
809
|
-
|
|
810
|
-
async function run() {
|
|
811
|
-
const result = await glean.indexing.documents.status({
|
|
812
|
-
datasource: "<value>",
|
|
813
|
-
objectType: "<value>",
|
|
814
|
-
docId: "<id>",
|
|
815
|
-
});
|
|
816
|
-
|
|
817
|
-
console.log(result);
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
run();
|
|
821
|
-
```
|
|
822
|
-
|
|
823
|
-
### Standalone function
|
|
824
|
-
|
|
825
|
-
The standalone function version of this method:
|
|
826
|
-
|
|
827
|
-
```typescript
|
|
828
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
829
|
-
import { indexingDocumentsStatus } from "@gleanwork/api-client/funcs/indexingDocumentsStatus.js";
|
|
830
|
-
|
|
831
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
832
|
-
// You can create one instance of it to use across an application.
|
|
833
|
-
const glean = new GleanCore({
|
|
834
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
835
|
-
});
|
|
836
|
-
|
|
837
|
-
async function run() {
|
|
838
|
-
const res = await indexingDocumentsStatus(glean, {
|
|
839
|
-
datasource: "<value>",
|
|
840
|
-
objectType: "<value>",
|
|
841
|
-
docId: "<id>",
|
|
842
|
-
});
|
|
843
|
-
if (res.ok) {
|
|
844
|
-
const { value: result } = res;
|
|
845
|
-
console.log(result);
|
|
846
|
-
} else {
|
|
847
|
-
console.log("indexingDocumentsStatus failed:", res.error);
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
run();
|
|
852
|
-
```
|
|
853
|
-
|
|
854
|
-
### React hooks and utilities
|
|
855
|
-
|
|
856
|
-
This method can be used in React components through the following hooks and
|
|
857
|
-
associated utilities.
|
|
858
|
-
|
|
859
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
860
|
-
> below and how to get started using React hooks.
|
|
861
|
-
|
|
862
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
863
|
-
|
|
864
|
-
```tsx
|
|
865
|
-
import {
|
|
866
|
-
// Mutation hook for triggering the API call.
|
|
867
|
-
useIndexingDocumentsStatusMutation
|
|
868
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsStatus.js";
|
|
869
|
-
```
|
|
870
|
-
|
|
871
|
-
### Parameters
|
|
872
|
-
|
|
873
|
-
| Parameter | Type | Required | Description |
|
|
874
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
875
|
-
| `request` | [components.GetDocumentStatusRequest](../../models/components/getdocumentstatusrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
876
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
877
|
-
| `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. |
|
|
878
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
879
|
-
|
|
880
|
-
### Response
|
|
881
|
-
|
|
882
|
-
**Promise\<[components.GetDocumentStatusResponse](../../models/components/getdocumentstatusresponse.md)\>**
|
|
883
|
-
|
|
884
|
-
### Errors
|
|
885
|
-
|
|
886
|
-
| Error Type | Status Code | Content Type |
|
|
887
|
-
| ----------------- | ----------------- | ----------------- |
|
|
888
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|
|
889
|
-
|
|
890
|
-
## ~~count~~
|
|
891
|
-
|
|
892
|
-
Fetches document count for the specified custom datasource.
|
|
893
|
-
|
|
894
|
-
Tip: Use [/debug/{datasource}/status](https://developers.glean.com/indexing/debugging/datasource-status) for richer information.
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
898
|
-
|
|
899
|
-
### Example Usage
|
|
900
|
-
|
|
901
|
-
<!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/getdocumentcount" method="post" path="/api/index/v1/getdocumentcount" -->
|
|
902
|
-
```typescript
|
|
903
|
-
import { Glean } from "@gleanwork/api-client";
|
|
904
|
-
|
|
905
|
-
const glean = new Glean({
|
|
906
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
async function run() {
|
|
910
|
-
const result = await glean.indexing.documents.count({
|
|
911
|
-
datasource: "<value>",
|
|
912
|
-
});
|
|
913
|
-
|
|
914
|
-
console.log(result);
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
run();
|
|
918
|
-
```
|
|
919
|
-
|
|
920
|
-
### Standalone function
|
|
921
|
-
|
|
922
|
-
The standalone function version of this method:
|
|
923
|
-
|
|
924
|
-
```typescript
|
|
925
|
-
import { GleanCore } from "@gleanwork/api-client/core.js";
|
|
926
|
-
import { indexingDocumentsCount } from "@gleanwork/api-client/funcs/indexingDocumentsCount.js";
|
|
927
|
-
|
|
928
|
-
// Use `GleanCore` for best tree-shaking performance.
|
|
929
|
-
// You can create one instance of it to use across an application.
|
|
930
|
-
const glean = new GleanCore({
|
|
931
|
-
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
|
|
932
|
-
});
|
|
933
|
-
|
|
934
|
-
async function run() {
|
|
935
|
-
const res = await indexingDocumentsCount(glean, {
|
|
936
|
-
datasource: "<value>",
|
|
937
|
-
});
|
|
938
|
-
if (res.ok) {
|
|
939
|
-
const { value: result } = res;
|
|
940
|
-
console.log(result);
|
|
941
|
-
} else {
|
|
942
|
-
console.log("indexingDocumentsCount failed:", res.error);
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
run();
|
|
947
|
-
```
|
|
948
|
-
|
|
949
|
-
### React hooks and utilities
|
|
950
|
-
|
|
951
|
-
This method can be used in React components through the following hooks and
|
|
952
|
-
associated utilities.
|
|
953
|
-
|
|
954
|
-
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
955
|
-
> below and how to get started using React hooks.
|
|
956
|
-
|
|
957
|
-
[hook-guide]: ../../../REACT_QUERY.md
|
|
958
|
-
|
|
959
|
-
```tsx
|
|
960
|
-
import {
|
|
961
|
-
// Mutation hook for triggering the API call.
|
|
962
|
-
useIndexingDocumentsCountMutation
|
|
963
|
-
} from "@gleanwork/api-client/react-query/indexingDocumentsCount.js";
|
|
964
|
-
```
|
|
965
|
-
|
|
966
|
-
### Parameters
|
|
967
|
-
|
|
968
|
-
| Parameter | Type | Required | Description |
|
|
969
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
970
|
-
| `request` | [components.GetDocumentCountRequest](../../models/components/getdocumentcountrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
971
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
972
|
-
| `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. |
|
|
973
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
974
|
-
|
|
975
|
-
### Response
|
|
976
|
-
|
|
977
|
-
**Promise\<[components.GetDocumentCountResponse](../../models/components/getdocumentcountresponse.md)\>**
|
|
978
|
-
|
|
979
|
-
### Errors
|
|
980
|
-
|
|
981
|
-
| Error Type | Status Code | Content Type |
|
|
982
|
-
| ----------------- | ----------------- | ----------------- |
|
|
983
|
-
| errors.GleanError | 4XX, 5XX | \*/\* |
|