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