@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,1198 +0,0 @@
1
- # Permissions
2
- (*indexing.permissions*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [updatePermissions](#updatepermissions) - Update document permissions
9
- * [indexUser](#indexuser) - Index user
10
- * [bulkIndexUsers](#bulkindexusers) - Bulk index users
11
- * [indexGroup](#indexgroup) - Index group
12
- * [bulkIndexGroups](#bulkindexgroups) - Bulk index groups
13
- * [indexMembership](#indexmembership) - Index membership
14
- * [bulkIndexMemberships](#bulkindexmemberships) - Bulk index memberships for a group
15
- * [processMemberships](#processmemberships) - Schedules the processing of group memberships
16
- * [deleteUser](#deleteuser) - Delete user
17
- * [deleteGroup](#deletegroup) - Delete group
18
- * [deleteMembership](#deletemembership) - Delete membership
19
- * [authorizeBetaUsers](#authorizebetausers) - Beta users
20
-
21
- ## updatePermissions
22
-
23
- Updates the permissions for a given document without modifying document content.
24
-
25
- ### Example Usage
26
-
27
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/updatepermissions" method="post" path="/api/index/v1/updatepermissions" -->
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.permissions.updatePermissions({
37
- datasource: "<value>",
38
- permissions: {},
39
- });
40
-
41
-
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 { indexingPermissionsUpdatePermissions } from "@gleanwork/api-client/funcs/indexingPermissionsUpdatePermissions.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 indexingPermissionsUpdatePermissions(glean, {
63
- datasource: "<value>",
64
- permissions: {},
65
- });
66
- if (res.ok) {
67
- const { value: result } = res;
68
-
69
- } else {
70
- console.log("indexingPermissionsUpdatePermissions failed:", res.error);
71
- }
72
- }
73
-
74
- run();
75
- ```
76
-
77
- ### React hooks and utilities
78
-
79
- This method can be used in React components through the following hooks and
80
- associated utilities.
81
-
82
- > Check out [this guide][hook-guide] for information about each of the utilities
83
- > below and how to get started using React hooks.
84
-
85
- [hook-guide]: ../../../REACT_QUERY.md
86
-
87
- ```tsx
88
- import {
89
- // Mutation hook for triggering the API call.
90
- useIndexingPermissionsUpdatePermissionsMutation
91
- } from "@gleanwork/api-client/react-query/indexingPermissionsUpdatePermissions.js";
92
- ```
93
-
94
- ### Parameters
95
-
96
- | Parameter | Type | Required | Description |
97
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
98
- | `request` | [components.UpdatePermissionsRequest](../../models/components/updatepermissionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
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\<void\>**
106
-
107
- ### Errors
108
-
109
- | Error Type | Status Code | Content Type |
110
- | ----------------- | ----------------- | ----------------- |
111
- | errors.GleanError | 4XX, 5XX | \*/\* |
112
-
113
- ## indexUser
114
-
115
- Adds a datasource user or updates an existing user.
116
-
117
- ### Example Usage
118
-
119
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/indexuser" method="post" path="/api/index/v1/indexuser" -->
120
- ```typescript
121
- import { Glean } from "@gleanwork/api-client";
122
-
123
- const glean = new Glean({
124
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
125
- });
126
-
127
- async function run() {
128
- await glean.indexing.permissions.indexUser({
129
- datasource: "<value>",
130
- user: {
131
- email: "Art.Schaden@hotmail.com",
132
- name: "<value>",
133
- },
134
- });
135
-
136
-
137
- }
138
-
139
- run();
140
- ```
141
-
142
- ### Standalone function
143
-
144
- The standalone function version of this method:
145
-
146
- ```typescript
147
- import { GleanCore } from "@gleanwork/api-client/core.js";
148
- import { indexingPermissionsIndexUser } from "@gleanwork/api-client/funcs/indexingPermissionsIndexUser.js";
149
-
150
- // Use `GleanCore` for best tree-shaking performance.
151
- // You can create one instance of it to use across an application.
152
- const glean = new GleanCore({
153
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
154
- });
155
-
156
- async function run() {
157
- const res = await indexingPermissionsIndexUser(glean, {
158
- datasource: "<value>",
159
- user: {
160
- email: "Art.Schaden@hotmail.com",
161
- name: "<value>",
162
- },
163
- });
164
- if (res.ok) {
165
- const { value: result } = res;
166
-
167
- } else {
168
- console.log("indexingPermissionsIndexUser failed:", res.error);
169
- }
170
- }
171
-
172
- run();
173
- ```
174
-
175
- ### React hooks and utilities
176
-
177
- This method can be used in React components through the following hooks and
178
- associated utilities.
179
-
180
- > Check out [this guide][hook-guide] for information about each of the utilities
181
- > below and how to get started using React hooks.
182
-
183
- [hook-guide]: ../../../REACT_QUERY.md
184
-
185
- ```tsx
186
- import {
187
- // Mutation hook for triggering the API call.
188
- useIndexingPermissionsIndexUserMutation
189
- } from "@gleanwork/api-client/react-query/indexingPermissionsIndexUser.js";
190
- ```
191
-
192
- ### Parameters
193
-
194
- | Parameter | Type | Required | Description |
195
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
196
- | `request` | [components.IndexUserRequest](../../models/components/indexuserrequest.md) | :heavy_check_mark: | The request object to use for the request. |
197
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
198
- | `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. |
199
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
200
-
201
- ### Response
202
-
203
- **Promise\<void\>**
204
-
205
- ### Errors
206
-
207
- | Error Type | Status Code | Content Type |
208
- | ----------------- | ----------------- | ----------------- |
209
- | errors.GleanError | 4XX, 5XX | \*/\* |
210
-
211
- ## bulkIndexUsers
212
-
213
- Replaces the users 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.
214
-
215
- ### Example Usage
216
-
217
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/bulkindexusers" method="post" path="/api/index/v1/bulkindexusers" -->
218
- ```typescript
219
- import { Glean } from "@gleanwork/api-client";
220
-
221
- const glean = new Glean({
222
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
223
- });
224
-
225
- async function run() {
226
- await glean.indexing.permissions.bulkIndexUsers({
227
- uploadId: "<id>",
228
- datasource: "<value>",
229
- users: [
230
- {
231
- email: "Ivory_Cummerata@hotmail.com",
232
- name: "<value>",
233
- },
234
- {
235
- email: "Ivory_Cummerata@hotmail.com",
236
- name: "<value>",
237
- },
238
- {
239
- email: "Ivory_Cummerata@hotmail.com",
240
- name: "<value>",
241
- },
242
- ],
243
- });
244
-
245
-
246
- }
247
-
248
- run();
249
- ```
250
-
251
- ### Standalone function
252
-
253
- The standalone function version of this method:
254
-
255
- ```typescript
256
- import { GleanCore } from "@gleanwork/api-client/core.js";
257
- import { indexingPermissionsBulkIndexUsers } from "@gleanwork/api-client/funcs/indexingPermissionsBulkIndexUsers.js";
258
-
259
- // Use `GleanCore` for best tree-shaking performance.
260
- // You can create one instance of it to use across an application.
261
- const glean = new GleanCore({
262
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
263
- });
264
-
265
- async function run() {
266
- const res = await indexingPermissionsBulkIndexUsers(glean, {
267
- uploadId: "<id>",
268
- datasource: "<value>",
269
- users: [
270
- {
271
- email: "Ivory_Cummerata@hotmail.com",
272
- name: "<value>",
273
- },
274
- {
275
- email: "Ivory_Cummerata@hotmail.com",
276
- name: "<value>",
277
- },
278
- {
279
- email: "Ivory_Cummerata@hotmail.com",
280
- name: "<value>",
281
- },
282
- ],
283
- });
284
- if (res.ok) {
285
- const { value: result } = res;
286
-
287
- } else {
288
- console.log("indexingPermissionsBulkIndexUsers failed:", res.error);
289
- }
290
- }
291
-
292
- run();
293
- ```
294
-
295
- ### React hooks and utilities
296
-
297
- This method can be used in React components through the following hooks and
298
- associated utilities.
299
-
300
- > Check out [this guide][hook-guide] for information about each of the utilities
301
- > below and how to get started using React hooks.
302
-
303
- [hook-guide]: ../../../REACT_QUERY.md
304
-
305
- ```tsx
306
- import {
307
- // Mutation hook for triggering the API call.
308
- useIndexingPermissionsBulkIndexUsersMutation
309
- } from "@gleanwork/api-client/react-query/indexingPermissionsBulkIndexUsers.js";
310
- ```
311
-
312
- ### Parameters
313
-
314
- | Parameter | Type | Required | Description |
315
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
316
- | `request` | [components.BulkIndexUsersRequest](../../models/components/bulkindexusersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
317
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
318
- | `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. |
319
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
320
-
321
- ### Response
322
-
323
- **Promise\<void\>**
324
-
325
- ### Errors
326
-
327
- | Error Type | Status Code | Content Type |
328
- | ----------------- | ----------------- | ----------------- |
329
- | errors.GleanError | 4XX, 5XX | \*/\* |
330
-
331
- ## indexGroup
332
-
333
- Add or update a group in the datasource.
334
-
335
- ### Example Usage
336
-
337
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/indexgroup" method="post" path="/api/index/v1/indexgroup" -->
338
- ```typescript
339
- import { Glean } from "@gleanwork/api-client";
340
-
341
- const glean = new Glean({
342
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
343
- });
344
-
345
- async function run() {
346
- await glean.indexing.permissions.indexGroup({
347
- datasource: "<value>",
348
- group: {
349
- name: "<value>",
350
- },
351
- });
352
-
353
-
354
- }
355
-
356
- run();
357
- ```
358
-
359
- ### Standalone function
360
-
361
- The standalone function version of this method:
362
-
363
- ```typescript
364
- import { GleanCore } from "@gleanwork/api-client/core.js";
365
- import { indexingPermissionsIndexGroup } from "@gleanwork/api-client/funcs/indexingPermissionsIndexGroup.js";
366
-
367
- // Use `GleanCore` for best tree-shaking performance.
368
- // You can create one instance of it to use across an application.
369
- const glean = new GleanCore({
370
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
371
- });
372
-
373
- async function run() {
374
- const res = await indexingPermissionsIndexGroup(glean, {
375
- datasource: "<value>",
376
- group: {
377
- name: "<value>",
378
- },
379
- });
380
- if (res.ok) {
381
- const { value: result } = res;
382
-
383
- } else {
384
- console.log("indexingPermissionsIndexGroup failed:", res.error);
385
- }
386
- }
387
-
388
- run();
389
- ```
390
-
391
- ### React hooks and utilities
392
-
393
- This method can be used in React components through the following hooks and
394
- associated utilities.
395
-
396
- > Check out [this guide][hook-guide] for information about each of the utilities
397
- > below and how to get started using React hooks.
398
-
399
- [hook-guide]: ../../../REACT_QUERY.md
400
-
401
- ```tsx
402
- import {
403
- // Mutation hook for triggering the API call.
404
- useIndexingPermissionsIndexGroupMutation
405
- } from "@gleanwork/api-client/react-query/indexingPermissionsIndexGroup.js";
406
- ```
407
-
408
- ### Parameters
409
-
410
- | Parameter | Type | Required | Description |
411
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
412
- | `request` | [components.IndexGroupRequest](../../models/components/indexgrouprequest.md) | :heavy_check_mark: | The request object to use for the request. |
413
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
414
- | `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. |
415
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
416
-
417
- ### Response
418
-
419
- **Promise\<void\>**
420
-
421
- ### Errors
422
-
423
- | Error Type | Status Code | Content Type |
424
- | ----------------- | ----------------- | ----------------- |
425
- | errors.GleanError | 4XX, 5XX | \*/\* |
426
-
427
- ## bulkIndexGroups
428
-
429
- Replaces the groups 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.
430
-
431
- ### Example Usage
432
-
433
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/bulkindexgroups" method="post" path="/api/index/v1/bulkindexgroups" -->
434
- ```typescript
435
- import { Glean } from "@gleanwork/api-client";
436
-
437
- const glean = new Glean({
438
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
439
- });
440
-
441
- async function run() {
442
- await glean.indexing.permissions.bulkIndexGroups({
443
- uploadId: "<id>",
444
- datasource: "<value>",
445
- groups: [
446
- {
447
- name: "<value>",
448
- },
449
- {
450
- name: "<value>",
451
- },
452
- ],
453
- });
454
-
455
-
456
- }
457
-
458
- run();
459
- ```
460
-
461
- ### Standalone function
462
-
463
- The standalone function version of this method:
464
-
465
- ```typescript
466
- import { GleanCore } from "@gleanwork/api-client/core.js";
467
- import { indexingPermissionsBulkIndexGroups } from "@gleanwork/api-client/funcs/indexingPermissionsBulkIndexGroups.js";
468
-
469
- // Use `GleanCore` for best tree-shaking performance.
470
- // You can create one instance of it to use across an application.
471
- const glean = new GleanCore({
472
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
473
- });
474
-
475
- async function run() {
476
- const res = await indexingPermissionsBulkIndexGroups(glean, {
477
- uploadId: "<id>",
478
- datasource: "<value>",
479
- groups: [
480
- {
481
- name: "<value>",
482
- },
483
- {
484
- name: "<value>",
485
- },
486
- ],
487
- });
488
- if (res.ok) {
489
- const { value: result } = res;
490
-
491
- } else {
492
- console.log("indexingPermissionsBulkIndexGroups failed:", res.error);
493
- }
494
- }
495
-
496
- run();
497
- ```
498
-
499
- ### React hooks and utilities
500
-
501
- This method can be used in React components through the following hooks and
502
- associated utilities.
503
-
504
- > Check out [this guide][hook-guide] for information about each of the utilities
505
- > below and how to get started using React hooks.
506
-
507
- [hook-guide]: ../../../REACT_QUERY.md
508
-
509
- ```tsx
510
- import {
511
- // Mutation hook for triggering the API call.
512
- useIndexingPermissionsBulkIndexGroupsMutation
513
- } from "@gleanwork/api-client/react-query/indexingPermissionsBulkIndexGroups.js";
514
- ```
515
-
516
- ### Parameters
517
-
518
- | Parameter | Type | Required | Description |
519
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
520
- | `request` | [components.BulkIndexGroupsRequest](../../models/components/bulkindexgroupsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
521
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
522
- | `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. |
523
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
524
-
525
- ### Response
526
-
527
- **Promise\<void\>**
528
-
529
- ### Errors
530
-
531
- | Error Type | Status Code | Content Type |
532
- | ----------------- | ----------------- | ----------------- |
533
- | errors.GleanError | 4XX, 5XX | \*/\* |
534
-
535
- ## indexMembership
536
-
537
- Add the memberships of a group in the datasource.
538
-
539
- ### Example Usage
540
-
541
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/indexmembership" method="post" path="/api/index/v1/indexmembership" -->
542
- ```typescript
543
- import { Glean } from "@gleanwork/api-client";
544
-
545
- const glean = new Glean({
546
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
547
- });
548
-
549
- async function run() {
550
- await glean.indexing.permissions.indexMembership({
551
- datasource: "<value>",
552
- membership: {
553
- groupName: "<value>",
554
- },
555
- });
556
-
557
-
558
- }
559
-
560
- run();
561
- ```
562
-
563
- ### Standalone function
564
-
565
- The standalone function version of this method:
566
-
567
- ```typescript
568
- import { GleanCore } from "@gleanwork/api-client/core.js";
569
- import { indexingPermissionsIndexMembership } from "@gleanwork/api-client/funcs/indexingPermissionsIndexMembership.js";
570
-
571
- // Use `GleanCore` for best tree-shaking performance.
572
- // You can create one instance of it to use across an application.
573
- const glean = new GleanCore({
574
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
575
- });
576
-
577
- async function run() {
578
- const res = await indexingPermissionsIndexMembership(glean, {
579
- datasource: "<value>",
580
- membership: {
581
- groupName: "<value>",
582
- },
583
- });
584
- if (res.ok) {
585
- const { value: result } = res;
586
-
587
- } else {
588
- console.log("indexingPermissionsIndexMembership failed:", res.error);
589
- }
590
- }
591
-
592
- run();
593
- ```
594
-
595
- ### React hooks and utilities
596
-
597
- This method can be used in React components through the following hooks and
598
- associated utilities.
599
-
600
- > Check out [this guide][hook-guide] for information about each of the utilities
601
- > below and how to get started using React hooks.
602
-
603
- [hook-guide]: ../../../REACT_QUERY.md
604
-
605
- ```tsx
606
- import {
607
- // Mutation hook for triggering the API call.
608
- useIndexingPermissionsIndexMembershipMutation
609
- } from "@gleanwork/api-client/react-query/indexingPermissionsIndexMembership.js";
610
- ```
611
-
612
- ### Parameters
613
-
614
- | Parameter | Type | Required | Description |
615
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
616
- | `request` | [components.IndexMembershipRequest](../../models/components/indexmembershiprequest.md) | :heavy_check_mark: | The request object to use for the request. |
617
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
618
- | `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. |
619
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
620
-
621
- ### Response
622
-
623
- **Promise\<void\>**
624
-
625
- ### Errors
626
-
627
- | Error Type | Status Code | Content Type |
628
- | ----------------- | ----------------- | ----------------- |
629
- | errors.GleanError | 4XX, 5XX | \*/\* |
630
-
631
- ## bulkIndexMemberships
632
-
633
- Replaces the memberships for a group 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.
634
-
635
- ### Example Usage
636
-
637
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/bulkindexmemberships" method="post" path="/api/index/v1/bulkindexmemberships" -->
638
- ```typescript
639
- import { Glean } from "@gleanwork/api-client";
640
-
641
- const glean = new Glean({
642
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
643
- });
644
-
645
- async function run() {
646
- await glean.indexing.permissions.bulkIndexMemberships({
647
- uploadId: "<id>",
648
- datasource: "<value>",
649
- memberships: [
650
- {},
651
- {},
652
- {},
653
- ],
654
- });
655
-
656
-
657
- }
658
-
659
- run();
660
- ```
661
-
662
- ### Standalone function
663
-
664
- The standalone function version of this method:
665
-
666
- ```typescript
667
- import { GleanCore } from "@gleanwork/api-client/core.js";
668
- import { indexingPermissionsBulkIndexMemberships } from "@gleanwork/api-client/funcs/indexingPermissionsBulkIndexMemberships.js";
669
-
670
- // Use `GleanCore` for best tree-shaking performance.
671
- // You can create one instance of it to use across an application.
672
- const glean = new GleanCore({
673
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
674
- });
675
-
676
- async function run() {
677
- const res = await indexingPermissionsBulkIndexMemberships(glean, {
678
- uploadId: "<id>",
679
- datasource: "<value>",
680
- memberships: [
681
- {},
682
- {},
683
- {},
684
- ],
685
- });
686
- if (res.ok) {
687
- const { value: result } = res;
688
-
689
- } else {
690
- console.log("indexingPermissionsBulkIndexMemberships failed:", res.error);
691
- }
692
- }
693
-
694
- run();
695
- ```
696
-
697
- ### React hooks and utilities
698
-
699
- This method can be used in React components through the following hooks and
700
- associated utilities.
701
-
702
- > Check out [this guide][hook-guide] for information about each of the utilities
703
- > below and how to get started using React hooks.
704
-
705
- [hook-guide]: ../../../REACT_QUERY.md
706
-
707
- ```tsx
708
- import {
709
- // Mutation hook for triggering the API call.
710
- useIndexingPermissionsBulkIndexMembershipsMutation
711
- } from "@gleanwork/api-client/react-query/indexingPermissionsBulkIndexMemberships.js";
712
- ```
713
-
714
- ### Parameters
715
-
716
- | Parameter | Type | Required | Description |
717
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
718
- | `request` | [components.BulkIndexMembershipsRequest](../../models/components/bulkindexmembershipsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
719
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
720
- | `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. |
721
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
722
-
723
- ### Response
724
-
725
- **Promise\<void\>**
726
-
727
- ### Errors
728
-
729
- | Error Type | Status Code | Content Type |
730
- | ----------------- | ----------------- | ----------------- |
731
- | errors.GleanError | 4XX, 5XX | \*/\* |
732
-
733
- ## processMemberships
734
-
735
- Schedules the immediate processing of all group memberships uploaded through the indexing API. By default the uploaded group memberships will be processed asynchronously but this API can be used to schedule processing of all memberships on demand.
736
-
737
-
738
- ### Example Usage
739
-
740
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/processallmemberships" method="post" path="/api/index/v1/processallmemberships" -->
741
- ```typescript
742
- import { Glean } from "@gleanwork/api-client";
743
-
744
- const glean = new Glean({
745
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
746
- });
747
-
748
- async function run() {
749
- await glean.indexing.permissions.processMemberships();
750
-
751
-
752
- }
753
-
754
- run();
755
- ```
756
-
757
- ### Standalone function
758
-
759
- The standalone function version of this method:
760
-
761
- ```typescript
762
- import { GleanCore } from "@gleanwork/api-client/core.js";
763
- import { indexingPermissionsProcessMemberships } from "@gleanwork/api-client/funcs/indexingPermissionsProcessMemberships.js";
764
-
765
- // Use `GleanCore` for best tree-shaking performance.
766
- // You can create one instance of it to use across an application.
767
- const glean = new GleanCore({
768
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
769
- });
770
-
771
- async function run() {
772
- const res = await indexingPermissionsProcessMemberships(glean);
773
- if (res.ok) {
774
- const { value: result } = res;
775
-
776
- } else {
777
- console.log("indexingPermissionsProcessMemberships failed:", res.error);
778
- }
779
- }
780
-
781
- run();
782
- ```
783
-
784
- ### React hooks and utilities
785
-
786
- This method can be used in React components through the following hooks and
787
- associated utilities.
788
-
789
- > Check out [this guide][hook-guide] for information about each of the utilities
790
- > below and how to get started using React hooks.
791
-
792
- [hook-guide]: ../../../REACT_QUERY.md
793
-
794
- ```tsx
795
- import {
796
- // Mutation hook for triggering the API call.
797
- useIndexingPermissionsProcessMembershipsMutation
798
- } from "@gleanwork/api-client/react-query/indexingPermissionsProcessMemberships.js";
799
- ```
800
-
801
- ### Parameters
802
-
803
- | Parameter | Type | Required | Description |
804
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
805
- | `request` | [components.ProcessAllMembershipsRequest](../../models/components/processallmembershipsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
806
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
807
- | `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. |
808
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
809
-
810
- ### Response
811
-
812
- **Promise\<void\>**
813
-
814
- ### Errors
815
-
816
- | Error Type | Status Code | Content Type |
817
- | ----------------- | ----------------- | ----------------- |
818
- | errors.GleanError | 4XX, 5XX | \*/\* |
819
-
820
- ## deleteUser
821
-
822
- Delete the user from the datasource. Silently succeeds if user is not present.
823
-
824
- ### Example Usage
825
-
826
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/deleteuser" method="post" path="/api/index/v1/deleteuser" -->
827
- ```typescript
828
- import { Glean } from "@gleanwork/api-client";
829
-
830
- const glean = new Glean({
831
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
832
- });
833
-
834
- async function run() {
835
- await glean.indexing.permissions.deleteUser({
836
- datasource: "<value>",
837
- email: "Ed.Johnston@gmail.com",
838
- });
839
-
840
-
841
- }
842
-
843
- run();
844
- ```
845
-
846
- ### Standalone function
847
-
848
- The standalone function version of this method:
849
-
850
- ```typescript
851
- import { GleanCore } from "@gleanwork/api-client/core.js";
852
- import { indexingPermissionsDeleteUser } from "@gleanwork/api-client/funcs/indexingPermissionsDeleteUser.js";
853
-
854
- // Use `GleanCore` for best tree-shaking performance.
855
- // You can create one instance of it to use across an application.
856
- const glean = new GleanCore({
857
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
858
- });
859
-
860
- async function run() {
861
- const res = await indexingPermissionsDeleteUser(glean, {
862
- datasource: "<value>",
863
- email: "Ed.Johnston@gmail.com",
864
- });
865
- if (res.ok) {
866
- const { value: result } = res;
867
-
868
- } else {
869
- console.log("indexingPermissionsDeleteUser failed:", res.error);
870
- }
871
- }
872
-
873
- run();
874
- ```
875
-
876
- ### React hooks and utilities
877
-
878
- This method can be used in React components through the following hooks and
879
- associated utilities.
880
-
881
- > Check out [this guide][hook-guide] for information about each of the utilities
882
- > below and how to get started using React hooks.
883
-
884
- [hook-guide]: ../../../REACT_QUERY.md
885
-
886
- ```tsx
887
- import {
888
- // Mutation hook for triggering the API call.
889
- useIndexingPermissionsDeleteUserMutation
890
- } from "@gleanwork/api-client/react-query/indexingPermissionsDeleteUser.js";
891
- ```
892
-
893
- ### Parameters
894
-
895
- | Parameter | Type | Required | Description |
896
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
897
- | `request` | [components.DeleteUserRequest](../../models/components/deleteuserrequest.md) | :heavy_check_mark: | The request object to use for the request. |
898
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
899
- | `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. |
900
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
901
-
902
- ### Response
903
-
904
- **Promise\<void\>**
905
-
906
- ### Errors
907
-
908
- | Error Type | Status Code | Content Type |
909
- | ----------------- | ----------------- | ----------------- |
910
- | errors.GleanError | 4XX, 5XX | \*/\* |
911
-
912
- ## deleteGroup
913
-
914
- Delete group from the datasource. Silently succeeds if group is not present.
915
-
916
- ### Example Usage
917
-
918
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/deletegroup" method="post" path="/api/index/v1/deletegroup" -->
919
- ```typescript
920
- import { Glean } from "@gleanwork/api-client";
921
-
922
- const glean = new Glean({
923
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
924
- });
925
-
926
- async function run() {
927
- await glean.indexing.permissions.deleteGroup({
928
- datasource: "<value>",
929
- groupName: "<value>",
930
- });
931
-
932
-
933
- }
934
-
935
- run();
936
- ```
937
-
938
- ### Standalone function
939
-
940
- The standalone function version of this method:
941
-
942
- ```typescript
943
- import { GleanCore } from "@gleanwork/api-client/core.js";
944
- import { indexingPermissionsDeleteGroup } from "@gleanwork/api-client/funcs/indexingPermissionsDeleteGroup.js";
945
-
946
- // Use `GleanCore` for best tree-shaking performance.
947
- // You can create one instance of it to use across an application.
948
- const glean = new GleanCore({
949
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
950
- });
951
-
952
- async function run() {
953
- const res = await indexingPermissionsDeleteGroup(glean, {
954
- datasource: "<value>",
955
- groupName: "<value>",
956
- });
957
- if (res.ok) {
958
- const { value: result } = res;
959
-
960
- } else {
961
- console.log("indexingPermissionsDeleteGroup failed:", res.error);
962
- }
963
- }
964
-
965
- run();
966
- ```
967
-
968
- ### React hooks and utilities
969
-
970
- This method can be used in React components through the following hooks and
971
- associated utilities.
972
-
973
- > Check out [this guide][hook-guide] for information about each of the utilities
974
- > below and how to get started using React hooks.
975
-
976
- [hook-guide]: ../../../REACT_QUERY.md
977
-
978
- ```tsx
979
- import {
980
- // Mutation hook for triggering the API call.
981
- useIndexingPermissionsDeleteGroupMutation
982
- } from "@gleanwork/api-client/react-query/indexingPermissionsDeleteGroup.js";
983
- ```
984
-
985
- ### Parameters
986
-
987
- | Parameter | Type | Required | Description |
988
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
989
- | `request` | [components.DeleteGroupRequest](../../models/components/deletegrouprequest.md) | :heavy_check_mark: | The request object to use for the request. |
990
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
991
- | `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. |
992
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
993
-
994
- ### Response
995
-
996
- **Promise\<void\>**
997
-
998
- ### Errors
999
-
1000
- | Error Type | Status Code | Content Type |
1001
- | ----------------- | ----------------- | ----------------- |
1002
- | errors.GleanError | 4XX, 5XX | \*/\* |
1003
-
1004
- ## deleteMembership
1005
-
1006
- Delete membership to a group in the specified datasource. Silently succeeds if membership is not present.
1007
-
1008
- ### Example Usage
1009
-
1010
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/deletemembership" method="post" path="/api/index/v1/deletemembership" -->
1011
- ```typescript
1012
- import { Glean } from "@gleanwork/api-client";
1013
-
1014
- const glean = new Glean({
1015
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1016
- });
1017
-
1018
- async function run() {
1019
- await glean.indexing.permissions.deleteMembership({
1020
- datasource: "<value>",
1021
- membership: {
1022
- groupName: "<value>",
1023
- },
1024
- });
1025
-
1026
-
1027
- }
1028
-
1029
- run();
1030
- ```
1031
-
1032
- ### Standalone function
1033
-
1034
- The standalone function version of this method:
1035
-
1036
- ```typescript
1037
- import { GleanCore } from "@gleanwork/api-client/core.js";
1038
- import { indexingPermissionsDeleteMembership } from "@gleanwork/api-client/funcs/indexingPermissionsDeleteMembership.js";
1039
-
1040
- // Use `GleanCore` for best tree-shaking performance.
1041
- // You can create one instance of it to use across an application.
1042
- const glean = new GleanCore({
1043
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1044
- });
1045
-
1046
- async function run() {
1047
- const res = await indexingPermissionsDeleteMembership(glean, {
1048
- datasource: "<value>",
1049
- membership: {
1050
- groupName: "<value>",
1051
- },
1052
- });
1053
- if (res.ok) {
1054
- const { value: result } = res;
1055
-
1056
- } else {
1057
- console.log("indexingPermissionsDeleteMembership failed:", res.error);
1058
- }
1059
- }
1060
-
1061
- run();
1062
- ```
1063
-
1064
- ### React hooks and utilities
1065
-
1066
- This method can be used in React components through the following hooks and
1067
- associated utilities.
1068
-
1069
- > Check out [this guide][hook-guide] for information about each of the utilities
1070
- > below and how to get started using React hooks.
1071
-
1072
- [hook-guide]: ../../../REACT_QUERY.md
1073
-
1074
- ```tsx
1075
- import {
1076
- // Mutation hook for triggering the API call.
1077
- useIndexingPermissionsDeleteMembershipMutation
1078
- } from "@gleanwork/api-client/react-query/indexingPermissionsDeleteMembership.js";
1079
- ```
1080
-
1081
- ### Parameters
1082
-
1083
- | Parameter | Type | Required | Description |
1084
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1085
- | `request` | [components.DeleteMembershipRequest](../../models/components/deletemembershiprequest.md) | :heavy_check_mark: | The request object to use for the request. |
1086
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1087
- | `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. |
1088
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1089
-
1090
- ### Response
1091
-
1092
- **Promise\<void\>**
1093
-
1094
- ### Errors
1095
-
1096
- | Error Type | Status Code | Content Type |
1097
- | ----------------- | ----------------- | ----------------- |
1098
- | errors.GleanError | 4XX, 5XX | \*/\* |
1099
-
1100
- ## authorizeBetaUsers
1101
-
1102
- Allow the datasource be visible to the specified beta users. The default behaviour is datasource being visible to all users if it is enabled and not visible to any user if it is not enabled.
1103
-
1104
- ### Example Usage
1105
-
1106
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/betausers" method="post" path="/api/index/v1/betausers" -->
1107
- ```typescript
1108
- import { Glean } from "@gleanwork/api-client";
1109
-
1110
- const glean = new Glean({
1111
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1112
- });
1113
-
1114
- async function run() {
1115
- await glean.indexing.permissions.authorizeBetaUsers({
1116
- datasource: "<value>",
1117
- emails: [
1118
- "Neil92@gmail.com",
1119
- "Alejandrin_Boyer4@hotmail.com",
1120
- "Shyanne_McLaughlin95@hotmail.com",
1121
- ],
1122
- });
1123
-
1124
-
1125
- }
1126
-
1127
- run();
1128
- ```
1129
-
1130
- ### Standalone function
1131
-
1132
- The standalone function version of this method:
1133
-
1134
- ```typescript
1135
- import { GleanCore } from "@gleanwork/api-client/core.js";
1136
- import { indexingPermissionsAuthorizeBetaUsers } from "@gleanwork/api-client/funcs/indexingPermissionsAuthorizeBetaUsers.js";
1137
-
1138
- // Use `GleanCore` for best tree-shaking performance.
1139
- // You can create one instance of it to use across an application.
1140
- const glean = new GleanCore({
1141
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1142
- });
1143
-
1144
- async function run() {
1145
- const res = await indexingPermissionsAuthorizeBetaUsers(glean, {
1146
- datasource: "<value>",
1147
- emails: [
1148
- "Neil92@gmail.com",
1149
- "Alejandrin_Boyer4@hotmail.com",
1150
- "Shyanne_McLaughlin95@hotmail.com",
1151
- ],
1152
- });
1153
- if (res.ok) {
1154
- const { value: result } = res;
1155
-
1156
- } else {
1157
- console.log("indexingPermissionsAuthorizeBetaUsers failed:", res.error);
1158
- }
1159
- }
1160
-
1161
- run();
1162
- ```
1163
-
1164
- ### React hooks and utilities
1165
-
1166
- This method can be used in React components through the following hooks and
1167
- associated utilities.
1168
-
1169
- > Check out [this guide][hook-guide] for information about each of the utilities
1170
- > below and how to get started using React hooks.
1171
-
1172
- [hook-guide]: ../../../REACT_QUERY.md
1173
-
1174
- ```tsx
1175
- import {
1176
- // Mutation hook for triggering the API call.
1177
- useIndexingPermissionsAuthorizeBetaUsersMutation
1178
- } from "@gleanwork/api-client/react-query/indexingPermissionsAuthorizeBetaUsers.js";
1179
- ```
1180
-
1181
- ### Parameters
1182
-
1183
- | Parameter | Type | Required | Description |
1184
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1185
- | `request` | [components.GreenlistUsersRequest](../../models/components/greenlistusersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1186
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1187
- | `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. |
1188
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1189
-
1190
- ### Response
1191
-
1192
- **Promise\<void\>**
1193
-
1194
- ### Errors
1195
-
1196
- | Error Type | Status Code | Content Type |
1197
- | ----------------- | ----------------- | ----------------- |
1198
- | errors.GleanError | 4XX, 5XX | \*/\* |