@gleanwork/api-client 0.13.1 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/commonjs/__tests__/messages.test.js +1 -1
- package/dist/commonjs/__tests__/messages.test.js.map +1 -1
- package/dist/commonjs/__tests__/summarize.test.js +4 -3
- package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/agentsinsightsv2response.d.ts +4 -0
- package/dist/commonjs/models/components/agentsinsightsv2response.d.ts.map +1 -1
- package/dist/commonjs/models/components/agentsinsightsv2response.js +4 -0
- package/dist/commonjs/models/components/agentsinsightsv2response.js.map +1 -1
- package/dist/commonjs/models/components/chatmessagefragment.d.ts +1 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts +3 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/debugdatasourcestatusresponse.js.map +1 -1
- package/dist/commonjs/models/components/peragentinsight.d.ts +10 -0
- package/dist/commonjs/models/components/peragentinsight.d.ts.map +1 -1
- package/dist/commonjs/models/components/peragentinsight.js +4 -0
- package/dist/commonjs/models/components/peragentinsight.js.map +1 -1
- package/dist/esm/__tests__/messages.test.js +1 -1
- package/dist/esm/__tests__/messages.test.js.map +1 -1
- package/dist/esm/__tests__/summarize.test.js +4 -3
- package/dist/esm/__tests__/summarize.test.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/agentsinsightsv2response.d.ts +4 -0
- package/dist/esm/models/components/agentsinsightsv2response.d.ts.map +1 -1
- package/dist/esm/models/components/agentsinsightsv2response.js +4 -0
- package/dist/esm/models/components/agentsinsightsv2response.js.map +1 -1
- package/dist/esm/models/components/chatmessagefragment.d.ts +1 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts +3 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
- package/dist/esm/models/components/debugdatasourcestatusresponse.js.map +1 -1
- package/dist/esm/models/components/peragentinsight.d.ts +10 -0
- package/dist/esm/models/components/peragentinsight.d.ts.map +1 -1
- package/dist/esm/models/components/peragentinsight.js +4 -0
- package/dist/esm/models/components/peragentinsight.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/messages.test.ts +1 -1
- package/src/__tests__/summarize.test.ts +4 -3
- package/src/lib/config.ts +3 -3
- package/src/models/components/agentsinsightsv2response.ts +8 -0
- package/src/models/components/chatmessagefragment.ts +1 -1
- package/src/models/components/debugdatasourcestatusresponse.ts +3 -1
- package/src/models/components/peragentinsight.ts +14 -0
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/activity/README.md +0 -242
- package/docs/sdks/agents/README.md +0 -498
- package/docs/sdks/announcements/README.md +0 -137560
- package/docs/sdks/answers/README.md +0 -4966
- package/docs/sdks/chat/README.md +0 -967
- package/docs/sdks/clientauthentication/README.md +0 -98
- package/docs/sdks/clientdocuments/README.md +0 -457
- package/docs/sdks/clientshortcuts/README.md +0 -9340
- package/docs/sdks/collections/README.md +0 -4148
- package/docs/sdks/datasource/README.md +0 -98
- package/docs/sdks/datasources/README.md +0 -211
- package/docs/sdks/entities/README.md +0 -225
- package/docs/sdks/indexingauthentication/README.md +0 -93
- package/docs/sdks/indexingdocuments/README.md +0 -983
- package/docs/sdks/indexingshortcuts/README.md +0 -251
- package/docs/sdks/insights/README.md +0 -94
- package/docs/sdks/messages/README.md +0 -102
- package/docs/sdks/people/README.md +0 -1052
- package/docs/sdks/permissions/README.md +0 -1198
- package/docs/sdks/pins/README.md +0 -506
- package/docs/sdks/policies/README.md +0 -478
- package/docs/sdks/reports/README.md +0 -290
- package/docs/sdks/search/README.md +0 -986
- package/docs/sdks/tools/README.md +0 -208
- package/docs/sdks/verification/README.md +0 -276
- package/docs/sdks/visibilityoverrides/README.md +0 -192
- package/examples/README.md +0 -31
- package/src/__tests__/mockserver/README.md +0 -52
|
@@ -18,11 +18,12 @@ test("Summarize Summarize", async () => {
|
|
|
18
18
|
const result = await glean.client.documents.summarize({
|
|
19
19
|
documentSpecs: [
|
|
20
20
|
{
|
|
21
|
-
ugcType: "
|
|
22
|
-
contentId:
|
|
21
|
+
ugcType: "SHORTCUTS",
|
|
22
|
+
contentId: 602763,
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
|
|
25
|
+
ugcType: "SHORTCUTS",
|
|
26
|
+
contentId: 602763,
|
|
26
27
|
},
|
|
27
28
|
],
|
|
28
29
|
});
|
package/src/lib/config.ts
CHANGED
|
@@ -68,8 +68,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
68
68
|
export const SDK_METADATA = {
|
|
69
69
|
language: "typescript",
|
|
70
70
|
openapiDocVersion: "0.9.0",
|
|
71
|
-
sdkVersion: "0.13.
|
|
72
|
-
genVersion: "2.
|
|
71
|
+
sdkVersion: "0.13.3",
|
|
72
|
+
genVersion: "2.739.1",
|
|
73
73
|
userAgent:
|
|
74
|
-
"speakeasy-sdk/typescript 0.13.
|
|
74
|
+
"speakeasy-sdk/typescript 0.13.3 2.739.1 0.9.0 @gleanwork/api-client",
|
|
75
75
|
} as const;
|
|
@@ -53,6 +53,8 @@ export type AgentsInsightsV2Response = {
|
|
|
53
53
|
| undefined;
|
|
54
54
|
agentUsersInsights?: Array<AgentUsersInsight> | undefined;
|
|
55
55
|
dailyAgentRunsTimeseries?: LabeledCountInfo | undefined;
|
|
56
|
+
upvotesTimeseries?: LabeledCountInfo | undefined;
|
|
57
|
+
downvotesTimeseries?: LabeledCountInfo | undefined;
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
/** @internal */
|
|
@@ -73,6 +75,8 @@ export const AgentsInsightsV2Response$inboundSchema: z.ZodType<
|
|
|
73
75
|
).optional(),
|
|
74
76
|
agentUsersInsights: z.array(AgentUsersInsight$inboundSchema).optional(),
|
|
75
77
|
dailyAgentRunsTimeseries: LabeledCountInfo$inboundSchema.optional(),
|
|
78
|
+
upvotesTimeseries: LabeledCountInfo$inboundSchema.optional(),
|
|
79
|
+
downvotesTimeseries: LabeledCountInfo$inboundSchema.optional(),
|
|
76
80
|
});
|
|
77
81
|
|
|
78
82
|
/** @internal */
|
|
@@ -89,6 +93,8 @@ export type AgentsInsightsV2Response$Outbound = {
|
|
|
89
93
|
| undefined;
|
|
90
94
|
agentUsersInsights?: Array<AgentUsersInsight$Outbound> | undefined;
|
|
91
95
|
dailyAgentRunsTimeseries?: LabeledCountInfo$Outbound | undefined;
|
|
96
|
+
upvotesTimeseries?: LabeledCountInfo$Outbound | undefined;
|
|
97
|
+
downvotesTimeseries?: LabeledCountInfo$Outbound | undefined;
|
|
92
98
|
};
|
|
93
99
|
|
|
94
100
|
/** @internal */
|
|
@@ -109,6 +115,8 @@ export const AgentsInsightsV2Response$outboundSchema: z.ZodType<
|
|
|
109
115
|
).optional(),
|
|
110
116
|
agentUsersInsights: z.array(AgentUsersInsight$outboundSchema).optional(),
|
|
111
117
|
dailyAgentRunsTimeseries: LabeledCountInfo$outboundSchema.optional(),
|
|
118
|
+
upvotesTimeseries: LabeledCountInfo$outboundSchema.optional(),
|
|
119
|
+
downvotesTimeseries: LabeledCountInfo$outboundSchema.optional(),
|
|
112
120
|
});
|
|
113
121
|
|
|
114
122
|
/**
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./toolinfo.js";
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* Represents a part of a ChatMessage that originates from a single action/tool. It is designed to support rich data formats beyond simple text, allowing for a more dynamic and interactive chat experience. Each fragment can include various types of content, such as text, search queries, action information, and more. Also, each ChatMessageFragment should only have one of structuredResults, querySuggestion, writeAction, followupAction, agentRecommendation or file.
|
|
41
|
+
* Represents a part of a ChatMessage that originates from a single action/tool. It is designed to support rich data formats beyond simple text, allowing for a more dynamic and interactive chat experience. Each fragment can include various types of content, such as text, search queries, action information, and more. Also, each ChatMessageFragment should only have one of structuredResults, querySuggestion, writeAction, followupAction, agentRecommendation, followupRoutingSuggestion or file.
|
|
42
42
|
*/
|
|
43
43
|
export type ChatMessageFragment = {
|
|
44
44
|
/**
|
|
@@ -34,7 +34,9 @@ import {
|
|
|
34
34
|
|
|
35
35
|
export type DebugDatasourceStatusResponseCounts = {
|
|
36
36
|
/**
|
|
37
|
-
* A list of object types and corresponding upload counts
|
|
37
|
+
* A list of object types and corresponding upload counts. Note: This data may be cached and could be up to 3 hours stale.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
38
40
|
*/
|
|
39
41
|
uploaded?: Array<DatasourceObjectTypeDocumentCountEntry> | undefined;
|
|
40
42
|
/**
|
|
@@ -34,6 +34,14 @@ export type PerAgentInsight = {
|
|
|
34
34
|
* Total number of runs for this agent over the specified time period.
|
|
35
35
|
*/
|
|
36
36
|
runCount?: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Total number of upvotes for this agent over the specified time period.
|
|
39
|
+
*/
|
|
40
|
+
upvoteCount?: number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Total number of downvotes for this agent over the specified time period.
|
|
43
|
+
*/
|
|
44
|
+
downvoteCount?: number | undefined;
|
|
37
45
|
};
|
|
38
46
|
|
|
39
47
|
/** @internal */
|
|
@@ -47,6 +55,8 @@ export const PerAgentInsight$inboundSchema: z.ZodType<
|
|
|
47
55
|
icon: IconConfig$inboundSchema.optional(),
|
|
48
56
|
userCount: z.number().int().optional(),
|
|
49
57
|
runCount: z.number().int().optional(),
|
|
58
|
+
upvoteCount: z.number().int().optional(),
|
|
59
|
+
downvoteCount: z.number().int().optional(),
|
|
50
60
|
});
|
|
51
61
|
|
|
52
62
|
/** @internal */
|
|
@@ -56,6 +66,8 @@ export type PerAgentInsight$Outbound = {
|
|
|
56
66
|
icon?: IconConfig$Outbound | undefined;
|
|
57
67
|
userCount?: number | undefined;
|
|
58
68
|
runCount?: number | undefined;
|
|
69
|
+
upvoteCount?: number | undefined;
|
|
70
|
+
downvoteCount?: number | undefined;
|
|
59
71
|
};
|
|
60
72
|
|
|
61
73
|
/** @internal */
|
|
@@ -69,6 +81,8 @@ export const PerAgentInsight$outboundSchema: z.ZodType<
|
|
|
69
81
|
icon: IconConfig$outboundSchema.optional(),
|
|
70
82
|
userCount: z.number().int().optional(),
|
|
71
83
|
runCount: z.number().int().optional(),
|
|
84
|
+
upvoteCount: z.number().int().optional(),
|
|
85
|
+
downvoteCount: z.number().int().optional(),
|
|
72
86
|
});
|
|
73
87
|
|
|
74
88
|
/**
|
package/.devcontainer/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<div align="center">
|
|
3
|
-
<a href="https://codespaces.new/gleanwork/api-client-typescript.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
|
|
4
|
-
</div>
|
|
5
|
-
<br>
|
|
6
|
-
|
|
7
|
-
> **Remember to shutdown a GitHub Codespace when it is not in use!**
|
|
8
|
-
|
|
9
|
-
# Dev Containers Quick Start
|
|
10
|
-
|
|
11
|
-
The default location for usage snippets is the `samples` directory.
|
|
12
|
-
|
|
13
|
-
## Running a Usage Sample
|
|
14
|
-
|
|
15
|
-
A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
ts-node root.ts
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Generating Additional Usage Samples
|
|
22
|
-
|
|
23
|
-
The speakeasy CLI allows you to generate more usage snippets. Here's how:
|
|
24
|
-
|
|
25
|
-
- To generate a sample for a specific operation by providing an operation ID, use:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
speakeasy generate usage -s registry.speakeasyapi.dev/glean-el2/sdk/glean-api-specs -l typescript -i {INPUT_OPERATION_ID} -o ./samples
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
- To generate samples for an entire namespace (like a tag or group name), use:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
speakeasy generate usage -s registry.speakeasyapi.dev/glean-el2/sdk/glean-api-specs -l typescript -n {INPUT_TAG_NAME} -o ./samples
|
|
35
|
-
```
|
|
@@ -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 | \*/\* |
|