Skip to content

Commit 7ac05ce

Browse files
Merge pull request #61 from gleanwork/speakeasy-sdk-regen-1759249969
chore: 🐝 Update SDK - Generate 0.11.0
2 parents edf7a05 + 8fe3fbc commit 7ac05ce

478 files changed

Lines changed: 35281 additions & 6120 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/instal
77
rmdir samples || true
88
mkdir samples
99

10-
npm install
11-
npm install -g ts-node
10+
npm install --ignore-scripts
11+
npm install -g ts-node --ignore-scripts
1212
npm link
1313
npm link @gleanwork/api-client
1414
TS_CONFIG_CONTENT=$(cat <<EOL

.speakeasy/gen.lock

Lines changed: 31 additions & 31 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ generation:
1919
auth:
2020
oAuth2ClientCredentialsEnabled: true
2121
oAuth2PasswordEnabled: true
22+
hoistGlobalSecurity: true
2223
mockServer:
2324
disabled: false
2425
tests:
26+
generateTests: true
2527
generateNewTests: true
2628
skipResponseBodyAssertions: true
2729
typescript:
28-
version: 0.10.5
30+
version: 0.11.0
2931
additionalDependencies:
3032
dependencies: {}
3133
devDependencies: {}

.speakeasy/glean-merged-spec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3799,6 +3799,7 @@ components:
37993799
- SEARCH
38003800
- SIDEBAR
38013801
- SUMMARY
3802+
- TASKS
38023803
issue:
38033804
type: string
38043805
description: The issue the user indicated in the feedback.

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
speakeasyVersion: 1.551.0
1+
speakeasyVersion: 1.631.5
22
sources:
33
Glean API:
44
sourceNamespace: glean-api-specs
5-
sourceRevisionDigest: sha256:8e30ec07a1e4d68c15f8d788704ddf4230cba6443cfebd960477c45f6ad3f563
6-
sourceBlobDigest: sha256:3c8246030e43ada387eaa07c5ddce8c7710d35f8c519057ce7d1541a3dd8aef2
5+
sourceRevisionDigest: sha256:e26b15f8d8e3781ac9b2d0167bcbdf95ac01a876716fdda482dce7e2d1f7ee1d
6+
sourceBlobDigest: sha256:caf2a61beb1f621f4c17121eb19113bddbda574eec8bf3a3e9e9be902e7adeaa
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1759193224
9+
- speakeasy-sdk-regen-1759249969
1010
Glean Client API:
1111
sourceNamespace: glean-client-api
1212
sourceRevisionDigest: sha256:aec0770b5bcca91068c3a844cb9ef4a091281f6cc3b7d86f2abef1bd6fb2b301
@@ -18,10 +18,10 @@ targets:
1818
glean:
1919
source: Glean API
2020
sourceNamespace: glean-api-specs
21-
sourceRevisionDigest: sha256:8e30ec07a1e4d68c15f8d788704ddf4230cba6443cfebd960477c45f6ad3f563
22-
sourceBlobDigest: sha256:3c8246030e43ada387eaa07c5ddce8c7710d35f8c519057ce7d1541a3dd8aef2
21+
sourceRevisionDigest: sha256:e26b15f8d8e3781ac9b2d0167bcbdf95ac01a876716fdda482dce7e2d1f7ee1d
22+
sourceBlobDigest: sha256:caf2a61beb1f621f4c17121eb19113bddbda574eec8bf3a3e9e9be902e7adeaa
2323
codeSamplesNamespace: glean-api-specs-typescript-code-samples
24-
codeSamplesRevisionDigest: sha256:89dfb1843dba80ceb447d1956c4bb0f75ea348c3f70073a8187b3593c60e7a33
24+
codeSamplesRevisionDigest: sha256:08435f3ef18a9ebd9eda58790384d9de8ed996b42ca679494f95bb92c019058d
2525
workflow:
2626
workflowVersion: 1.0.0
2727
speakeasyVersion: latest

FUNCTIONS.md

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ specific category of applications.
2121
```typescript
2222
import { GleanCore } from "@gleanwork/api-client/core.js";
2323
import { clientChatCreate } from "@gleanwork/api-client/funcs/clientChatCreate.js";
24-
import { SDKValidationError } from "@gleanwork/api-client/models/errors/sdkvalidationerror.js";
2524

2625
// Use `GleanCore` for best tree-shaking performance.
2726
// You can create one instance of it to use across an application.
@@ -41,28 +40,12 @@ async function run() {
4140
},
4241
],
4342
});
44-
45-
switch (true) {
46-
case res.ok:
47-
// The success case will be handled outside of the switch block
48-
break;
49-
case res.error instanceof SDKValidationError:
50-
// Pretty-print validation errors.
51-
return console.log(res.error.pretty());
52-
case res.error instanceof Error:
53-
return console.log(res.error);
54-
default:
55-
// TypeScript's type checking will fail on the following line if the above
56-
// cases were not exhaustive.
57-
res.error satisfies never;
58-
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
43+
if (res.ok) {
44+
const { value: result } = res;
45+
console.log(result);
46+
} else {
47+
console.log("clientChatCreate failed:", res.error);
5948
}
60-
61-
62-
const { value: result } = res;
63-
64-
// Handle the result
65-
console.log(result);
6649
}
6750

6851
run();

README.md

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ These API clients provide type-safe, idiomatic interfaces for working with Glean
7070
* [Available Resources and Operations](#available-resources-and-operations)
7171
* [Standalone functions](#standalone-functions)
7272
* [React hooks with TanStack Query](#react-hooks-with-tanstack-query)
73+
* [File uploads](#file-uploads)
7374
* [Retries](#retries)
7475
* [Error Handling](#error-handling)
7576
* [Server Selection](#server-selection)
@@ -113,12 +114,9 @@ bun add @tanstack/react-query react react-dom
113114
### Yarn
114115

115116
```bash
116-
yarn add @gleanwork/api-client zod
117+
yarn add @gleanwork/api-client
117118
# Install optional peer dependencies if you plan to use React hooks
118119
yarn add @tanstack/react-query react react-dom
119-
120-
# Note that Yarn does not install peer dependencies automatically. You will need
121-
# to install zod as shown above.
122120
```
123121

124122
> [!NOTE]
@@ -156,7 +154,6 @@ async function run() {
156154
],
157155
});
158156

159-
// Handle the result
160157
console.log(result);
161158
}
162159

@@ -186,7 +183,6 @@ async function run() {
186183
],
187184
});
188185

189-
// Handle the result
190186
console.log(result);
191187
}
192188

@@ -353,10 +349,6 @@ For more information on obtaining the appropriate token type, please contact you
353349
* [list](docs/sdks/entities/README.md#list) - List entities
354350
* [readPeople](docs/sdks/entities/README.md#readpeople) - Read people
355351

356-
357-
#### [client.governance.data](docs/sdks/data/README.md)
358-
359-
360352
#### [client.governance.data.policies](docs/sdks/policies/README.md)
361353

362354
* [retrieve](docs/sdks/policies/README.md#retrieve) - Gets specified policy
@@ -371,9 +363,6 @@ For more information on obtaining the appropriate token type, please contact you
371363
* [download](docs/sdks/reports/README.md#download) - Downloads violations CSV for report
372364
* [status](docs/sdks/reports/README.md#status) - Fetches report run status
373365

374-
#### [client.governance.documents](docs/sdks/governancedocuments/README.md)
375-
376-
377366
#### [client.governance.documents.visibilityoverrides](docs/sdks/visibilityoverrides/README.md)
378367

379368
* [list](docs/sdks/visibilityoverrides/README.md#list) - Fetches documents visibility
@@ -762,6 +751,43 @@ To learn about this feature and how to get started, check
762751
</details>
763752
<!-- End React hooks with TanStack Query [react-query] -->
764753

754+
<!-- Start File uploads [file-upload] -->
755+
## File uploads
756+
757+
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
758+
759+
> [!TIP]
760+
>
761+
> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
762+
>
763+
> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
764+
> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
765+
> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
766+
> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
767+
768+
```typescript
769+
import { Glean } from "@gleanwork/api-client";
770+
import { openAsBlob } from "node:fs";
771+
772+
const glean = new Glean({
773+
apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
774+
});
775+
776+
async function run() {
777+
const result = await glean.client.chat.uploadFiles({
778+
files: [
779+
await openAsBlob("example.file"),
780+
],
781+
});
782+
783+
console.log(result);
784+
}
785+
786+
run();
787+
788+
```
789+
<!-- End File uploads [file-upload] -->
790+
765791
<!-- Start Retries [retries] -->
766792
## Retries
767793

@@ -1078,7 +1104,7 @@ httpClient.addHook("requestError", (error, request) => {
10781104
console.groupEnd();
10791105
});
10801106

1081-
const sdk = new Glean({ httpClient });
1107+
const sdk = new Glean({ httpClient: httpClient });
10821108
```
10831109
<!-- End Custom HTTP Client [http-client] -->
10841110

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,14 @@ Based on:
278278
### Generated
279279
- [typescript v0.10.5] .
280280
### Releases
281-
- [NPM v0.10.5] https://www.npmjs.com/package/@gleanwork/api-client/v/0.10.5 - .
281+
- [NPM v0.10.5] https://www.npmjs.com/package/@gleanwork/api-client/v/0.10.5 - .
282+
283+
## 2025-09-30 21:42:46
284+
### Changes
285+
Based on:
286+
- OpenAPI Doc
287+
- Speakeasy CLI 1.631.5 (2.716.16) https://github.com/speakeasy-api/speakeasy
288+
### Generated
289+
- [typescript v0.11.0] .
290+
### Releases
291+
- [NPM v0.11.0] https://www.npmjs.com/package/@gleanwork/api-client/v/0.11.0 - .

USAGE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ async function run() {
1919
],
2020
});
2121

22-
// Handle the result
2322
console.log(result);
2423
}
2524

@@ -47,7 +46,6 @@ async function run() {
4746
],
4847
});
4948

50-
// Handle the result
5149
console.log(result);
5250
}
5351

docs/models/components/addcollectionitemsresponse.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import { AddCollectionItemsResponse } from "@gleanwork/api-client/models/compone
88
let value: AddCollectionItemsResponse = {
99
collection: {
1010
name: "<value>",
11-
description: "jaggedly anti triumphantly frenetically eek with",
12-
addedRoles: [],
13-
removedRoles: [],
11+
description:
12+
"feline charming fast vibraphone immediately viciously creator",
1413
audienceFilters: [
1514
{
1615
fieldName: "type",
@@ -26,7 +25,7 @@ let value: AddCollectionItemsResponse = {
2625
],
2726
},
2827
],
29-
id: 320120,
28+
id: 278414,
3029
creator: {
3130
name: "George Clooney",
3231
obfuscatedId: "abc123",
@@ -35,9 +34,36 @@ let value: AddCollectionItemsResponse = {
3534
name: "George Clooney",
3635
obfuscatedId: "abc123",
3736
},
38-
items: [],
39-
children: [],
40-
roles: [],
37+
children: [
38+
{
39+
name: "<value>",
40+
description: "design cappelletti kettledrum",
41+
audienceFilters: [
42+
{
43+
fieldName: "type",
44+
values: [
45+
{
46+
value: "Spreadsheet",
47+
relationType: "EQUALS",
48+
},
49+
{
50+
value: "Presentation",
51+
relationType: "EQUALS",
52+
},
53+
],
54+
},
55+
],
56+
id: 635422,
57+
creator: {
58+
name: "George Clooney",
59+
obfuscatedId: "abc123",
60+
},
61+
updatedBy: {
62+
name: "George Clooney",
63+
obfuscatedId: "abc123",
64+
},
65+
},
66+
],
4167
},
4268
};
4369
```

0 commit comments

Comments
 (0)