@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,98 +0,0 @@
1
- # Datasource
2
- (*indexing.datasource*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [status](#status) - Beta: Get datasource status
9
-
10
-
11
- ## status
12
-
13
- Gather information about the datasource's overall status. Currently in beta, might undergo breaking changes without prior notice.
14
-
15
- Tip: Refer to the [Troubleshooting tutorial](https://developers.glean.com/indexing/debugging/datasource-config) for more information.
16
-
17
-
18
- ### Example Usage
19
-
20
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/debug/{datasource}/status" method="post" path="/api/index/v1/debug/{datasource}/status" -->
21
- ```typescript
22
- import { Glean } from "@gleanwork/api-client";
23
-
24
- const glean = new Glean({
25
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
26
- });
27
-
28
- async function run() {
29
- const result = await glean.indexing.datasource.status("<value>");
30
-
31
- console.log(result);
32
- }
33
-
34
- run();
35
- ```
36
-
37
- ### Standalone function
38
-
39
- The standalone function version of this method:
40
-
41
- ```typescript
42
- import { GleanCore } from "@gleanwork/api-client/core.js";
43
- import { indexingDatasourceStatus } from "@gleanwork/api-client/funcs/indexingDatasourceStatus.js";
44
-
45
- // Use `GleanCore` for best tree-shaking performance.
46
- // You can create one instance of it to use across an application.
47
- const glean = new GleanCore({
48
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
49
- });
50
-
51
- async function run() {
52
- const res = await indexingDatasourceStatus(glean, "<value>");
53
- if (res.ok) {
54
- const { value: result } = res;
55
- console.log(result);
56
- } else {
57
- console.log("indexingDatasourceStatus failed:", res.error);
58
- }
59
- }
60
-
61
- run();
62
- ```
63
-
64
- ### React hooks and utilities
65
-
66
- This method can be used in React components through the following hooks and
67
- associated utilities.
68
-
69
- > Check out [this guide][hook-guide] for information about each of the utilities
70
- > below and how to get started using React hooks.
71
-
72
- [hook-guide]: ../../../REACT_QUERY.md
73
-
74
- ```tsx
75
- import {
76
- // Mutation hook for triggering the API call.
77
- useIndexingDatasourceStatusMutation
78
- } from "@gleanwork/api-client/react-query/indexingDatasourceStatus.js";
79
- ```
80
-
81
- ### Parameters
82
-
83
- | Parameter | Type | Required | Description |
84
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
85
- | `datasource` | *string* | :heavy_check_mark: | The datasource to get debug status for. |
86
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
87
- | `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. |
88
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
89
-
90
- ### Response
91
-
92
- **Promise\<[components.DebugDatasourceStatusResponse](../../models/components/debugdatasourcestatusresponse.md)\>**
93
-
94
- ### Errors
95
-
96
- | Error Type | Status Code | Content Type |
97
- | ----------------- | ----------------- | ----------------- |
98
- | errors.GleanError | 4XX, 5XX | \*/\* |
@@ -1,211 +0,0 @@
1
- # Datasources
2
- (*indexing.datasources*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [add](#add) - Add or update datasource
9
- * [retrieveConfig](#retrieveconfig) - Get datasource config
10
-
11
- ## add
12
-
13
- Add or update a custom datasource and its schema.
14
-
15
- ### Example Usage
16
-
17
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/adddatasource" method="post" path="/api/index/v1/adddatasource" -->
18
- ```typescript
19
- import { Glean } from "@gleanwork/api-client";
20
-
21
- const glean = new Glean({
22
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
23
- });
24
-
25
- async function run() {
26
- await glean.indexing.datasources.add({
27
- name: "<value>",
28
- urlRegex: "https://example-company.datasource.com/.*",
29
- quicklinks: [
30
- {
31
- iconConfig: {
32
- color: "#343CED",
33
- key: "person_icon",
34
- iconType: "GLYPH",
35
- name: "user",
36
- },
37
- },
38
- ],
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 { indexingDatasourcesAdd } from "@gleanwork/api-client/funcs/indexingDatasourcesAdd.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 indexingDatasourcesAdd(glean, {
63
- name: "<value>",
64
- urlRegex: "https://example-company.datasource.com/.*",
65
- quicklinks: [
66
- {
67
- iconConfig: {
68
- color: "#343CED",
69
- key: "person_icon",
70
- iconType: "GLYPH",
71
- name: "user",
72
- },
73
- },
74
- ],
75
- });
76
- if (res.ok) {
77
- const { value: result } = res;
78
-
79
- } else {
80
- console.log("indexingDatasourcesAdd failed:", res.error);
81
- }
82
- }
83
-
84
- run();
85
- ```
86
-
87
- ### React hooks and utilities
88
-
89
- This method can be used in React components through the following hooks and
90
- associated utilities.
91
-
92
- > Check out [this guide][hook-guide] for information about each of the utilities
93
- > below and how to get started using React hooks.
94
-
95
- [hook-guide]: ../../../REACT_QUERY.md
96
-
97
- ```tsx
98
- import {
99
- // Mutation hook for triggering the API call.
100
- useIndexingDatasourcesAddMutation
101
- } from "@gleanwork/api-client/react-query/indexingDatasourcesAdd.js";
102
- ```
103
-
104
- ### Parameters
105
-
106
- | Parameter | Type | Required | Description |
107
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
108
- | `request` | [components.CustomDatasourceConfig](../../models/components/customdatasourceconfig.md) | :heavy_check_mark: | The request object to use for the request. |
109
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
110
- | `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. |
111
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
112
-
113
- ### Response
114
-
115
- **Promise\<void\>**
116
-
117
- ### Errors
118
-
119
- | Error Type | Status Code | Content Type |
120
- | ----------------- | ----------------- | ----------------- |
121
- | errors.GleanError | 4XX, 5XX | \*/\* |
122
-
123
- ## retrieveConfig
124
-
125
- Fetches the datasource config for the specified custom datasource.
126
-
127
- ### Example Usage
128
-
129
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/getdatasourceconfig" method="post" path="/api/index/v1/getdatasourceconfig" -->
130
- ```typescript
131
- import { Glean } from "@gleanwork/api-client";
132
-
133
- const glean = new Glean({
134
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
135
- });
136
-
137
- async function run() {
138
- const result = await glean.indexing.datasources.retrieveConfig({
139
- datasource: "<value>",
140
- });
141
-
142
- console.log(result);
143
- }
144
-
145
- run();
146
- ```
147
-
148
- ### Standalone function
149
-
150
- The standalone function version of this method:
151
-
152
- ```typescript
153
- import { GleanCore } from "@gleanwork/api-client/core.js";
154
- import { indexingDatasourcesRetrieveConfig } from "@gleanwork/api-client/funcs/indexingDatasourcesRetrieveConfig.js";
155
-
156
- // Use `GleanCore` for best tree-shaking performance.
157
- // You can create one instance of it to use across an application.
158
- const glean = new GleanCore({
159
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
160
- });
161
-
162
- async function run() {
163
- const res = await indexingDatasourcesRetrieveConfig(glean, {
164
- datasource: "<value>",
165
- });
166
- if (res.ok) {
167
- const { value: result } = res;
168
- console.log(result);
169
- } else {
170
- console.log("indexingDatasourcesRetrieveConfig failed:", res.error);
171
- }
172
- }
173
-
174
- run();
175
- ```
176
-
177
- ### React hooks and utilities
178
-
179
- This method can be used in React components through the following hooks and
180
- associated utilities.
181
-
182
- > Check out [this guide][hook-guide] for information about each of the utilities
183
- > below and how to get started using React hooks.
184
-
185
- [hook-guide]: ../../../REACT_QUERY.md
186
-
187
- ```tsx
188
- import {
189
- // Mutation hook for triggering the API call.
190
- useIndexingDatasourcesRetrieveConfigMutation
191
- } from "@gleanwork/api-client/react-query/indexingDatasourcesRetrieveConfig.js";
192
- ```
193
-
194
- ### Parameters
195
-
196
- | Parameter | Type | Required | Description |
197
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
198
- | `request` | [components.GetDatasourceConfigRequest](../../models/components/getdatasourceconfigrequest.md) | :heavy_check_mark: | The request object to use for the request. |
199
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
200
- | `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. |
201
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
202
-
203
- ### Response
204
-
205
- **Promise\<[components.CustomDatasourceConfig](../../models/components/customdatasourceconfig.md)\>**
206
-
207
- ### Errors
208
-
209
- | Error Type | Status Code | Content Type |
210
- | ----------------- | ----------------- | ----------------- |
211
- | errors.GleanError | 4XX, 5XX | \*/\* |
@@ -1,225 +0,0 @@
1
- # Entities
2
- (*client.entities*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List entities
9
- * [readPeople](#readpeople) - Read people
10
-
11
- ## list
12
-
13
- List some set of details for all entities that fit the given criteria and return in the requested order. Does not support negation in filters, assumes relation type EQUALS. There is a limit of 10000 entities that can be retrieved via this endpoint, except when using FULL_DIRECTORY request type for people entities.
14
-
15
- ### Example Usage
16
-
17
- <!-- UsageSnippet language="typescript" operationID="listentities" method="post" path="/rest/api/v1/listentities" -->
18
- ```typescript
19
- import { Glean } from "@gleanwork/api-client";
20
-
21
- const glean = new Glean({
22
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
23
- });
24
-
25
- async function run() {
26
- const result = await glean.client.entities.list({
27
- filter: [
28
- {
29
- fieldName: "type",
30
- values: [
31
- {
32
- value: "Spreadsheet",
33
- relationType: "EQUALS",
34
- },
35
- {
36
- value: "Presentation",
37
- relationType: "EQUALS",
38
- },
39
- ],
40
- },
41
- ],
42
- pageSize: 100,
43
- });
44
-
45
- console.log(result);
46
- }
47
-
48
- run();
49
- ```
50
-
51
- ### Standalone function
52
-
53
- The standalone function version of this method:
54
-
55
- ```typescript
56
- import { GleanCore } from "@gleanwork/api-client/core.js";
57
- import { clientEntitiesList } from "@gleanwork/api-client/funcs/clientEntitiesList.js";
58
-
59
- // Use `GleanCore` for best tree-shaking performance.
60
- // You can create one instance of it to use across an application.
61
- const glean = new GleanCore({
62
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
63
- });
64
-
65
- async function run() {
66
- const res = await clientEntitiesList(glean, {
67
- filter: [
68
- {
69
- fieldName: "type",
70
- values: [
71
- {
72
- value: "Spreadsheet",
73
- relationType: "EQUALS",
74
- },
75
- {
76
- value: "Presentation",
77
- relationType: "EQUALS",
78
- },
79
- ],
80
- },
81
- ],
82
- pageSize: 100,
83
- });
84
- if (res.ok) {
85
- const { value: result } = res;
86
- console.log(result);
87
- } else {
88
- console.log("clientEntitiesList failed:", res.error);
89
- }
90
- }
91
-
92
- run();
93
- ```
94
-
95
- ### React hooks and utilities
96
-
97
- This method can be used in React components through the following hooks and
98
- associated utilities.
99
-
100
- > Check out [this guide][hook-guide] for information about each of the utilities
101
- > below and how to get started using React hooks.
102
-
103
- [hook-guide]: ../../../REACT_QUERY.md
104
-
105
- ```tsx
106
- import {
107
- // Mutation hook for triggering the API call.
108
- useClientEntitiesListMutation
109
- } from "@gleanwork/api-client/react-query/clientEntitiesList.js";
110
- ```
111
-
112
- ### Parameters
113
-
114
- | Parameter | Type | Required | Description |
115
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
116
- | `request` | [components.ListEntitiesRequest](../../models/components/listentitiesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
117
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
118
- | `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. |
119
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
120
-
121
- ### Response
122
-
123
- **Promise\<[components.ListEntitiesResponse](../../models/components/listentitiesresponse.md)\>**
124
-
125
- ### Errors
126
-
127
- | Error Type | Status Code | Content Type |
128
- | ----------------- | ----------------- | ----------------- |
129
- | errors.GleanError | 4XX, 5XX | \*/\* |
130
-
131
- ## readPeople
132
-
133
- Read people details for the given IDs.
134
-
135
- ### Example Usage
136
-
137
- <!-- UsageSnippet language="typescript" operationID="people" method="post" path="/rest/api/v1/people" -->
138
- ```typescript
139
- import { Glean } from "@gleanwork/api-client";
140
-
141
- const glean = new Glean({
142
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
143
- });
144
-
145
- async function run() {
146
- const result = await glean.client.entities.readPeople({
147
- obfuscatedIds: [
148
- "abc123",
149
- "abc456",
150
- ],
151
- });
152
-
153
- console.log(result);
154
- }
155
-
156
- run();
157
- ```
158
-
159
- ### Standalone function
160
-
161
- The standalone function version of this method:
162
-
163
- ```typescript
164
- import { GleanCore } from "@gleanwork/api-client/core.js";
165
- import { clientEntitiesReadPeople } from "@gleanwork/api-client/funcs/clientEntitiesReadPeople.js";
166
-
167
- // Use `GleanCore` for best tree-shaking performance.
168
- // You can create one instance of it to use across an application.
169
- const glean = new GleanCore({
170
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
171
- });
172
-
173
- async function run() {
174
- const res = await clientEntitiesReadPeople(glean, {
175
- obfuscatedIds: [
176
- "abc123",
177
- "abc456",
178
- ],
179
- });
180
- if (res.ok) {
181
- const { value: result } = res;
182
- console.log(result);
183
- } else {
184
- console.log("clientEntitiesReadPeople failed:", res.error);
185
- }
186
- }
187
-
188
- run();
189
- ```
190
-
191
- ### React hooks and utilities
192
-
193
- This method can be used in React components through the following hooks and
194
- associated utilities.
195
-
196
- > Check out [this guide][hook-guide] for information about each of the utilities
197
- > below and how to get started using React hooks.
198
-
199
- [hook-guide]: ../../../REACT_QUERY.md
200
-
201
- ```tsx
202
- import {
203
- // Mutation hook for triggering the API call.
204
- useClientEntitiesReadPeopleMutation
205
- } from "@gleanwork/api-client/react-query/clientEntitiesReadPeople.js";
206
- ```
207
-
208
- ### Parameters
209
-
210
- | Parameter | Type | Required | Description |
211
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
212
- | `request` | [components.PeopleRequest](../../models/components/peoplerequest.md) | :heavy_check_mark: | The request object to use for the request. |
213
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
214
- | `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. |
215
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
216
-
217
- ### Response
218
-
219
- **Promise\<[components.PeopleResponse](../../models/components/peopleresponse.md)\>**
220
-
221
- ### Errors
222
-
223
- | Error Type | Status Code | Content Type |
224
- | ----------------- | ----------------- | ----------------- |
225
- | errors.GleanError | 4XX, 5XX | \*/\* |
@@ -1,93 +0,0 @@
1
- # IndexingAuthentication
2
- (*indexing.authentication*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [rotateToken](#rotatetoken) - Rotate token
9
-
10
- ## rotateToken
11
-
12
- Rotates the secret value inside the Indexing API token and returns the new raw secret. All other properties of the token are unchanged. In order to rotate the secret value, include the token as the bearer token in the `/rotatetoken` request. Please refer to [Token rotation](https://developers.glean.com/indexing/authentication/token-rotation) documentation for more information.
13
-
14
- ### Example Usage
15
-
16
- <!-- UsageSnippet language="typescript" operationID="post_/api/index/v1/rotatetoken" method="post" path="/api/index/v1/rotatetoken" -->
17
- ```typescript
18
- import { Glean } from "@gleanwork/api-client";
19
-
20
- const glean = new Glean({
21
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
22
- });
23
-
24
- async function run() {
25
- const result = await glean.indexing.authentication.rotateToken();
26
-
27
- console.log(result);
28
- }
29
-
30
- run();
31
- ```
32
-
33
- ### Standalone function
34
-
35
- The standalone function version of this method:
36
-
37
- ```typescript
38
- import { GleanCore } from "@gleanwork/api-client/core.js";
39
- import { indexingAuthenticationRotateToken } from "@gleanwork/api-client/funcs/indexingAuthenticationRotateToken.js";
40
-
41
- // Use `GleanCore` for best tree-shaking performance.
42
- // You can create one instance of it to use across an application.
43
- const glean = new GleanCore({
44
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
45
- });
46
-
47
- async function run() {
48
- const res = await indexingAuthenticationRotateToken(glean);
49
- if (res.ok) {
50
- const { value: result } = res;
51
- console.log(result);
52
- } else {
53
- console.log("indexingAuthenticationRotateToken failed:", res.error);
54
- }
55
- }
56
-
57
- run();
58
- ```
59
-
60
- ### React hooks and utilities
61
-
62
- This method can be used in React components through the following hooks and
63
- associated utilities.
64
-
65
- > Check out [this guide][hook-guide] for information about each of the utilities
66
- > below and how to get started using React hooks.
67
-
68
- [hook-guide]: ../../../REACT_QUERY.md
69
-
70
- ```tsx
71
- import {
72
- // Mutation hook for triggering the API call.
73
- useIndexingAuthenticationRotateTokenMutation
74
- } from "@gleanwork/api-client/react-query/indexingAuthenticationRotateToken.js";
75
- ```
76
-
77
- ### Parameters
78
-
79
- | Parameter | Type | Required | Description |
80
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
81
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
82
- | `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. |
83
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
84
-
85
- ### Response
86
-
87
- **Promise\<[components.RotateTokenResponse](../../models/components/rotatetokenresponse.md)\>**
88
-
89
- ### Errors
90
-
91
- | Error Type | Status Code | Content Type |
92
- | ----------------- | ----------------- | ----------------- |
93
- | errors.GleanError | 4XX, 5XX | \*/\* |