Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ generation:
generateNewTests: true
skipResponseBodyAssertions: true
typescript:
version: 0.4.1
version: 0.4.2
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
1 change: 0 additions & 1 deletion .speakeasy/glean-merged-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ servers:
description: The instance name (typically the email domain without the TLD) that determines the deployment backend.
security:
- APIToken: []
- cookieAuth: []
paths:
/rest/api/v1/activity:
post:
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
speakeasyVersion: 1.546.1
speakeasyVersion: 1.546.2
sources:
Glean API:
sourceNamespace: glean-api-specs
sourceRevisionDigest: sha256:81bbab1ab458be7ad4d3b4e052629504f2dc32e0554426fc4bac347061fad35c
sourceBlobDigest: sha256:f2a2721aa0c1960218fc0a261ef3f689e2e78c399b36b7e6602e6ad8650206ac
sourceRevisionDigest: sha256:d6fa8702a32b71122384445deea1072af1cf22ed50c70ffc25cc87a25fc82612
sourceBlobDigest: sha256:393fd23b9e5d6d5f6929f86557b6b42c770f61271257cd10bc6a364b3ac8b053
tags:
- latest
- speakeasy-sdk-regen-1747427746
- speakeasy-sdk-regen-1747525140
Glean Client API:
sourceNamespace: glean-client-api
sourceRevisionDigest: sha256:aec0770b5bcca91068c3a844cb9ef4a091281f6cc3b7d86f2abef1bd6fb2b301
Expand All @@ -18,10 +18,10 @@ targets:
glean:
source: Glean API
sourceNamespace: glean-api-specs
sourceRevisionDigest: sha256:81bbab1ab458be7ad4d3b4e052629504f2dc32e0554426fc4bac347061fad35c
sourceBlobDigest: sha256:f2a2721aa0c1960218fc0a261ef3f689e2e78c399b36b7e6602e6ad8650206ac
sourceRevisionDigest: sha256:d6fa8702a32b71122384445deea1072af1cf22ed50c70ffc25cc87a25fc82612
sourceBlobDigest: sha256:393fd23b9e5d6d5f6929f86557b6b42c770f61271257cd10bc6a364b3ac8b053
codeSamplesNamespace: glean-api-specs-typescript-code-samples
codeSamplesRevisionDigest: sha256:1358474b54e3d4dbaa921df804234dfec0581c47c68ef033043c2ae1bf1e9083
codeSamplesRevisionDigest: sha256:9a5c91033699caa82c4c90f8ec92f3a1404ca8e85f72482308e415e70cc2d853
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
4 changes: 1 addition & 3 deletions FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ import { SDKValidationError } from "@gleanwork/api-client/models/errors/sdkvalid
// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down
12 changes: 3 additions & 9 deletions REACT_QUERY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ import { GleanProvider } from "@gleanwork/api-client/react-query";

const queryClient = new QueryClient();
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

// Retries are handled by the underlying SDK.
Expand Down Expand Up @@ -250,9 +248,7 @@ import { useClientAgentsRetrieveSuspense } from "@gleanwork/api-client/react-que

const queryClient = new QueryClient();
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

export function App() {
Expand Down Expand Up @@ -308,9 +304,7 @@ import { prefetchClientAgentsRetrieve } from "@gleanwork/api-client/react-query/
export default async function Page() {
const queryClient = new QueryClient();
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

await prefetchClientAgentsRetrieve(queryClient, glean, "<id>");
Expand Down
39 changes: 12 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -172,9 +170,7 @@ run();
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -204,21 +200,18 @@ run();

### Per-Client Security Schemes

This SDK supports the following security schemes globally:
This SDK supports the following security scheme globally:

| Name | Type | Scheme | Environment Variable |
| ------------ | ------ | ----------- | -------------------- |
| `apiToken` | http | HTTP Bearer | `GLEAN_API_TOKEN` |
| `cookieAuth` | apiKey | API key | `GLEAN_COOKIE_AUTH` |
| Name | Type | Scheme | Environment Variable |
| ---------- | ---- | ----------- | -------------------- |
| `apiToken` | http | HTTP Bearer | `GLEAN_API_TOKEN` |

You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
To authenticate with the API the `apiToken` parameter must be set when initializing the SDK client instance. For example:
```typescript
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -770,9 +763,7 @@ To change the default retry strategy for a single API call, simply provide a ret
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -834,9 +825,7 @@ const glean = new Glean({
},
retryConnectionErrors: false,
},
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -954,9 +943,7 @@ import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
instance: "<value>",
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -1000,9 +987,7 @@ import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
serverURL: "https://instance-name-be.glean.com",
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,14 @@ Based on:
### Generated
- [typescript v0.4.1] .
### Releases
- [NPM v0.4.1] https://www.npmjs.com/package/@gleanwork/api-client/v/0.4.1 - .
- [NPM v0.4.1] https://www.npmjs.com/package/@gleanwork/api-client/v/0.4.1 - .

## 2025-05-17 23:38:40
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.546.2 (2.604.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.4.2] .
### Releases
- [NPM v0.4.2] https://www.npmjs.com/package/@gleanwork/api-client/v/0.4.2 - .
8 changes: 2 additions & 6 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -33,9 +31,7 @@ run();
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down
3 changes: 1 addition & 2 deletions docs/models/components/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ let value: Security = {};

| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `apiToken` | *string* | :heavy_minus_sign: | N/A |
| `cookieAuth` | *string* | :heavy_minus_sign: | N/A |
| `apiToken` | *string* | :heavy_minus_sign: | N/A |
16 changes: 4 additions & 12 deletions docs/sdks/activity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ Report user activity that occurs on indexed documents such as viewing or editing
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -68,9 +66,7 @@ import { clientActivityReport } from "@gleanwork/api-client/funcs/clientActivity
// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -159,9 +155,7 @@ Report events that happen to results within a Glean client UI, such as search re
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -189,9 +183,7 @@ import { clientActivityFeedback } from "@gleanwork/api-client/funcs/clientActivi
// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down
40 changes: 10 additions & 30 deletions docs/sdks/agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ Get an agent by ID. This endpoint implements the LangChain Agent Protocol, speci
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand All @@ -47,9 +45,7 @@ import { clientAgentsRetrieve } from "@gleanwork/api-client/funcs/clientAgentsRe
// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -126,9 +122,7 @@ Get an agent's schemas by ID. This endpoint implements the LangChain Agent Proto
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand All @@ -152,9 +146,7 @@ import { clientAgentsRetrieveSchemas } from "@gleanwork/api-client/funcs/clientA
// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -231,9 +223,7 @@ List Agents available in this service. This endpoint implements the LangChain Ag
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand All @@ -257,9 +247,7 @@ import { clientAgentsList } from "@gleanwork/api-client/funcs/clientAgentsList.j
// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -324,9 +312,7 @@ Creates and triggers a run of an agent. Streams the output in SSE format. This e
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand All @@ -350,9 +336,7 @@ import { clientAgentsRunStream } from "@gleanwork/api-client/funcs/clientAgentsR
// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down Expand Up @@ -417,9 +401,7 @@ Creates and triggers a run of an agent. Waits for final output and then returns
import { Glean } from "@gleanwork/api-client";

const glean = new Glean({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand All @@ -443,9 +425,7 @@ import { clientAgentsRun } from "@gleanwork/api-client/funcs/clientAgentsRun.js"
// Use `GleanCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const glean = new GleanCore({
security: {
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
},
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
});

async function run() {
Expand Down
Loading