@gleanwork/api-client 0.13.2 → 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 (58) 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 +3 -2
  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/chatmessagefragment.d.ts +1 -1
  9. package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts +3 -1
  10. package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
  11. package/dist/commonjs/models/components/debugdatasourcestatusresponse.js.map +1 -1
  12. package/dist/esm/__tests__/messages.test.js +1 -1
  13. package/dist/esm/__tests__/messages.test.js.map +1 -1
  14. package/dist/esm/__tests__/summarize.test.js +3 -2
  15. package/dist/esm/__tests__/summarize.test.js.map +1 -1
  16. package/dist/esm/lib/config.d.ts +3 -3
  17. package/dist/esm/lib/config.js +3 -3
  18. package/dist/esm/models/components/chatmessagefragment.d.ts +1 -1
  19. package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts +3 -1
  20. package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
  21. package/dist/esm/models/components/debugdatasourcestatusresponse.js.map +1 -1
  22. package/examples/package-lock.json +1 -1
  23. package/jsr.json +1 -1
  24. package/package.json +1 -1
  25. package/src/__tests__/messages.test.ts +1 -1
  26. package/src/__tests__/summarize.test.ts +3 -2
  27. package/src/lib/config.ts +3 -3
  28. package/src/models/components/chatmessagefragment.ts +1 -1
  29. package/src/models/components/debugdatasourcestatusresponse.ts +3 -1
  30. package/.devcontainer/README.md +0 -35
  31. package/docs/sdks/activity/README.md +0 -242
  32. package/docs/sdks/agents/README.md +0 -498
  33. package/docs/sdks/announcements/README.md +0 -137560
  34. package/docs/sdks/answers/README.md +0 -4966
  35. package/docs/sdks/chat/README.md +0 -967
  36. package/docs/sdks/clientauthentication/README.md +0 -98
  37. package/docs/sdks/clientdocuments/README.md +0 -457
  38. package/docs/sdks/clientshortcuts/README.md +0 -9340
  39. package/docs/sdks/collections/README.md +0 -4148
  40. package/docs/sdks/datasource/README.md +0 -98
  41. package/docs/sdks/datasources/README.md +0 -211
  42. package/docs/sdks/entities/README.md +0 -225
  43. package/docs/sdks/indexingauthentication/README.md +0 -93
  44. package/docs/sdks/indexingdocuments/README.md +0 -983
  45. package/docs/sdks/indexingshortcuts/README.md +0 -251
  46. package/docs/sdks/insights/README.md +0 -94
  47. package/docs/sdks/messages/README.md +0 -102
  48. package/docs/sdks/people/README.md +0 -1052
  49. package/docs/sdks/permissions/README.md +0 -1198
  50. package/docs/sdks/pins/README.md +0 -506
  51. package/docs/sdks/policies/README.md +0 -478
  52. package/docs/sdks/reports/README.md +0 -290
  53. package/docs/sdks/search/README.md +0 -986
  54. package/docs/sdks/tools/README.md +0 -208
  55. package/docs/sdks/verification/README.md +0 -276
  56. package/docs/sdks/visibilityoverrides/README.md +0 -192
  57. package/examples/README.md +0 -31
  58. package/src/__tests__/mockserver/README.md +0 -52
@@ -1,242 +0,0 @@
1
- # Activity
2
- (*client.activity*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [report](#report) - Report document activity
9
- * [feedback](#feedback) - Report client activity
10
-
11
- ## report
12
-
13
- Report user activity that occurs on indexed documents such as viewing or editing. This signal improves search quality.
14
-
15
- ### Example Usage
16
-
17
- <!-- UsageSnippet language="typescript" operationID="activity" method="post" path="/rest/api/v1/activity" -->
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.client.activity.report({
27
- events: [
28
- {
29
- action: "HISTORICAL_VIEW",
30
- timestamp: new Date("2000-01-23T04:56:07.000Z"),
31
- url: "https://example.com/",
32
- },
33
- {
34
- action: "SEARCH",
35
- params: {
36
- query: "query",
37
- },
38
- timestamp: new Date("2000-01-23T04:56:07.000Z"),
39
- url: "https://example.com/search?q=query",
40
- },
41
- {
42
- action: "VIEW",
43
- params: {
44
- duration: 20,
45
- referrer: "https://example.com/document",
46
- },
47
- timestamp: new Date("2000-01-23T04:56:07.000Z"),
48
- url: "https://example.com/",
49
- },
50
- ],
51
- });
52
-
53
-
54
- }
55
-
56
- run();
57
- ```
58
-
59
- ### Standalone function
60
-
61
- The standalone function version of this method:
62
-
63
- ```typescript
64
- import { GleanCore } from "@gleanwork/api-client/core.js";
65
- import { clientActivityReport } from "@gleanwork/api-client/funcs/clientActivityReport.js";
66
-
67
- // Use `GleanCore` for best tree-shaking performance.
68
- // You can create one instance of it to use across an application.
69
- const glean = new GleanCore({
70
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
71
- });
72
-
73
- async function run() {
74
- const res = await clientActivityReport(glean, {
75
- events: [
76
- {
77
- action: "HISTORICAL_VIEW",
78
- timestamp: new Date("2000-01-23T04:56:07.000Z"),
79
- url: "https://example.com/",
80
- },
81
- {
82
- action: "SEARCH",
83
- params: {
84
- query: "query",
85
- },
86
- timestamp: new Date("2000-01-23T04:56:07.000Z"),
87
- url: "https://example.com/search?q=query",
88
- },
89
- {
90
- action: "VIEW",
91
- params: {
92
- duration: 20,
93
- referrer: "https://example.com/document",
94
- },
95
- timestamp: new Date("2000-01-23T04:56:07.000Z"),
96
- url: "https://example.com/",
97
- },
98
- ],
99
- });
100
- if (res.ok) {
101
- const { value: result } = res;
102
-
103
- } else {
104
- console.log("clientActivityReport failed:", res.error);
105
- }
106
- }
107
-
108
- run();
109
- ```
110
-
111
- ### React hooks and utilities
112
-
113
- This method can be used in React components through the following hooks and
114
- associated utilities.
115
-
116
- > Check out [this guide][hook-guide] for information about each of the utilities
117
- > below and how to get started using React hooks.
118
-
119
- [hook-guide]: ../../../REACT_QUERY.md
120
-
121
- ```tsx
122
- import {
123
- // Mutation hook for triggering the API call.
124
- useClientActivityReportMutation
125
- } from "@gleanwork/api-client/react-query/clientActivityReport.js";
126
- ```
127
-
128
- ### Parameters
129
-
130
- | Parameter | Type | Required | Description |
131
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
132
- | `request` | [components.Activity](../../models/components/activity.md) | :heavy_check_mark: | The request object to use for the request. |
133
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
134
- | `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. |
135
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
136
-
137
- ### Response
138
-
139
- **Promise\<void\>**
140
-
141
- ### Errors
142
-
143
- | Error Type | Status Code | Content Type |
144
- | ----------------- | ----------------- | ----------------- |
145
- | errors.GleanError | 4XX, 5XX | \*/\* |
146
-
147
- ## feedback
148
-
149
- Report events that happen to results within a Glean client UI, such as search result views and clicks. This signal improves search quality.
150
-
151
- ### Example Usage
152
-
153
- <!-- UsageSnippet language="typescript" operationID="feedback" method="post" path="/rest/api/v1/feedback" -->
154
- ```typescript
155
- import { Glean } from "@gleanwork/api-client";
156
-
157
- const glean = new Glean({
158
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
159
- });
160
-
161
- async function run() {
162
- await glean.client.activity.feedback({
163
- trackingTokens: [
164
- "trackingTokens",
165
- ],
166
- event: "VIEW",
167
- });
168
-
169
-
170
- }
171
-
172
- run();
173
- ```
174
-
175
- ### Standalone function
176
-
177
- The standalone function version of this method:
178
-
179
- ```typescript
180
- import { GleanCore } from "@gleanwork/api-client/core.js";
181
- import { clientActivityFeedback } from "@gleanwork/api-client/funcs/clientActivityFeedback.js";
182
-
183
- // Use `GleanCore` for best tree-shaking performance.
184
- // You can create one instance of it to use across an application.
185
- const glean = new GleanCore({
186
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
187
- });
188
-
189
- async function run() {
190
- const res = await clientActivityFeedback(glean, {
191
- trackingTokens: [
192
- "trackingTokens",
193
- ],
194
- event: "VIEW",
195
- });
196
- if (res.ok) {
197
- const { value: result } = res;
198
-
199
- } else {
200
- console.log("clientActivityFeedback failed:", res.error);
201
- }
202
- }
203
-
204
- run();
205
- ```
206
-
207
- ### React hooks and utilities
208
-
209
- This method can be used in React components through the following hooks and
210
- associated utilities.
211
-
212
- > Check out [this guide][hook-guide] for information about each of the utilities
213
- > below and how to get started using React hooks.
214
-
215
- [hook-guide]: ../../../REACT_QUERY.md
216
-
217
- ```tsx
218
- import {
219
- // Mutation hook for triggering the API call.
220
- useClientActivityFeedbackMutation
221
- } from "@gleanwork/api-client/react-query/clientActivityFeedback.js";
222
- ```
223
-
224
- ### Parameters
225
-
226
- | Parameter | Type | Required | Description | Example |
227
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
228
- | `feedbackQueryParameter` | *string* | :heavy_minus_sign: | A URL encoded versions of Feedback. This is useful for requests. | |
229
- | `feedback1` | [components.Feedback](../../models/components/feedback.md) | :heavy_minus_sign: | N/A | [object Object] |
230
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
231
- | `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. | |
232
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
233
-
234
- ### Response
235
-
236
- **Promise\<void\>**
237
-
238
- ### Errors
239
-
240
- | Error Type | Status Code | Content Type |
241
- | ----------------- | ----------------- | ----------------- |
242
- | errors.GleanError | 4XX, 5XX | \*/\* |