Skip to content

Commit 4d6ffe2

Browse files
chore: 🐝 Update SDK - Generate 0.25.0 (#153)
> [!IMPORTANT] > Linting report available at: <https://app.speakeasy.com/org/unstructured/unstructured5xr/linting-report/7abfd34b27aed1d39a1615a580258bf2> > OpenAPI Change report available at: <https://app.speakeasy.com/org/unstructured/unstructured5xr/changes-report/d830ab42cd1f45785ce0c24fd6561eac> # SDK update Based on: - OpenAPI Doc - Speakeasy CLI 1.555.3 (2.620.2) https://github.com/speakeasy-api/speakeasy ## Versioning Version Bump Type: [minor] - 🤖 (automated) ## OpenAPI Change Summary ``` └─┬Info └──[🔀] version (5:16) ``` | Document Element | Total Changes | Breaking Changes | |------------------|---------------|------------------| | info | 1 | 0 | ## TYPESCRIPT CHANGELOG ## sdkHooks: 0.3.0 - 2025-05-21 ### 🐝 New Features - add support for accessing sdk configuration in hooks *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 3.21.10 - 2025-05-30 ### 🐛 Bug Fixes - re-export HTTPClient from root index.ts *(commit by [@disintegrator](https://github.com/disintegrator))* Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent d7987e7 commit 4d6ffe2

File tree

23 files changed

+105
-77
lines changed

23 files changed

+105
-77
lines changed

.speakeasy/gen.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: f42cb8e6-e2ce-4565-b975-5a9f38b94d5a
33
management:
4-
docChecksum: 3e42d77bf491e4e7a999ec6d27d41fd1
5-
docVersion: 1.1.17
6-
speakeasyVersion: 1.552.0
7-
generationVersion: 2.610.0
8-
releaseVersion: 0.24.4
9-
configChecksum: c0e0d6524bed361c1a8ebeda0e6333df
4+
docChecksum: 251a87fb7643cd585e4ddf956bb1ae1f
5+
docVersion: 1.1.23
6+
speakeasyVersion: 1.555.3
7+
generationVersion: 2.620.2
8+
releaseVersion: 0.25.0
9+
configChecksum: 3cf3f043a49108bf9cbc7c2f2476b151
1010
repoURL: https://github.com/Unstructured-IO/unstructured-js-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-js-client
@@ -16,7 +16,7 @@ features:
1616
acceptHeaders: 2.81.2
1717
additionalDependencies: 0.1.0
1818
constsAndDefaults: 0.1.11
19-
core: 3.21.9
19+
core: 3.21.10
2020
defaultEnabledRetries: 0.1.0
2121
enumUnions: 0.1.0
2222
envVarSecurityUsage: 0.1.2
@@ -30,7 +30,7 @@ features:
3030
openEnums: 0.1.1
3131
responseFormat: 0.2.3
3232
retries: 2.83.0
33-
sdkHooks: 0.2.0
33+
sdkHooks: 0.3.0
3434
serverIDs: 2.81.2
3535
unions: 2.85.8
3636
uploadStreams: 0.1.0

.speakeasy/workflow.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.552.0
1+
speakeasyVersion: 1.555.3
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:11dc672fb20011d88c36c9e88092258b76ffe07dbf7d4d9493a4a8a63de97e0b
6-
sourceBlobDigest: sha256:d70162f1aa06e4b75fdb38608d8ca25948651246e8da161f0947af385732aff3
5+
sourceRevisionDigest: sha256:8eb1828e2c067201a3e864721b453543815bbbb71fb160723bb331bb01e4d9aa
6+
sourceBlobDigest: sha256:614c15b826e255f33812df0a7bb989a7bfb194167fa111162594664c04c2c5f4
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1748046653
10-
- 1.1.17
9+
- speakeasy-sdk-regen-1749083555
10+
- 1.1.23
1111
targets:
1212
unstructed-typescript:
1313
source: my-source
1414
sourceNamespace: my-source
15-
sourceRevisionDigest: sha256:11dc672fb20011d88c36c9e88092258b76ffe07dbf7d4d9493a4a8a63de97e0b
16-
sourceBlobDigest: sha256:d70162f1aa06e4b75fdb38608d8ca25948651246e8da161f0947af385732aff3
15+
sourceRevisionDigest: sha256:8eb1828e2c067201a3e864721b453543815bbbb71fb160723bb331bb01e4d9aa
16+
sourceBlobDigest: sha256:614c15b826e255f33812df0a7bb989a7bfb194167fa111162594664c04c2c5f4
1717
codeSamplesNamespace: my-source-typescript-code-samples
18-
codeSamplesRevisionDigest: sha256:116507a44839dec1f86e45a1a782df522e4ff29c592635c14f2f5e8196ec91d7
18+
codeSamplesRevisionDigest: sha256:145ca0fb688e7d825c8f66ba00ecfee5a960ce4ad2c9a07c0e7683306d0b92e2
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

FUNCTIONS.md

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ specific category of applications.
2222
import { openAsBlob } from "node:fs";
2323
import { UnstructuredClientCore } from "unstructured-client/core.js";
2424
import { generalPartition } from "unstructured-client/funcs/generalPartition.js";
25-
import { SDKValidationError } from "unstructured-client/sdk/models/errors/sdkvalidationerror.js";
26-
import { VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
25+
import { Strategy, VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
2726

2827
// Use `UnstructuredClientCore` for best tree-shaking performance.
2928
// You can create one instance of it to use across an application.
@@ -38,32 +37,17 @@ async function run() {
3837
1,
3938
10,
4039
],
40+
strategy: Strategy.Auto,
4141
vlmModel: VLMModel.Gpt4o,
4242
vlmModelProvider: VLMModelProvider.Openai,
4343
},
4444
});
45-
46-
switch (true) {
47-
case res.ok:
48-
// The success case will be handled outside of the switch block
49-
break;
50-
case res.error instanceof SDKValidationError:
51-
// Pretty-print validation errors.
52-
return console.log(res.error.pretty());
53-
case res.error instanceof Error:
54-
return console.log(res.error);
55-
default:
56-
// TypeScript's type checking will fail on the following line if the above
57-
// cases were not exhaustive.
58-
res.error satisfies never;
59-
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
45+
if (res.ok) {
46+
const { value: result } = res;
47+
console.log(result);
48+
} else {
49+
console.log("generalPartition failed:", res.error);
6050
}
61-
62-
63-
const { value: result } = res;
64-
65-
// Handle the result
66-
console.log(result);
6751
}
6852

6953
run();

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ To change the default retry strategy for a single API call, simply provide a ret
206206
import { openAsBlob } from "node:fs";
207207
import { UnstructuredClient } from "unstructured-client";
208208
import {
209+
Strategy,
209210
VLMModel,
210211
VLMModelProvider,
211212
} from "unstructured-client/sdk/models/shared";
@@ -221,6 +222,7 @@ async function run() {
221222
1,
222223
10,
223224
],
225+
strategy: Strategy.Auto,
224226
vlmModel: VLMModel.Gpt4o,
225227
vlmModelProvider: VLMModelProvider.Openai,
226228
},
@@ -237,7 +239,6 @@ async function run() {
237239
},
238240
});
239241

240-
// Handle the result
241242
console.log(result);
242243
}
243244

@@ -250,6 +251,7 @@ If you'd like to override the default retry strategy for all operations that sup
250251
import { openAsBlob } from "node:fs";
251252
import { UnstructuredClient } from "unstructured-client";
252253
import {
254+
Strategy,
253255
VLMModel,
254256
VLMModelProvider,
255257
} from "unstructured-client/sdk/models/shared";
@@ -276,12 +278,12 @@ async function run() {
276278
1,
277279
10,
278280
],
281+
strategy: Strategy.Auto,
279282
vlmModel: VLMModel.Gpt4o,
280283
vlmModelProvider: VLMModelProvider.Openai,
281284
},
282285
});
283286

284-
// Handle the result
285287
console.log(result);
286288
}
287289

@@ -378,6 +380,7 @@ Certain SDK methods accept files as part of a multi-part request. It is possible
378380
import { openAsBlob } from "node:fs";
379381
import { UnstructuredClient } from "unstructured-client";
380382
import {
383+
Strategy,
381384
VLMModel,
382385
VLMModelProvider,
383386
} from "unstructured-client/sdk/models/shared";
@@ -393,12 +396,12 @@ async function run() {
393396
1,
394397
10,
395398
],
399+
strategy: Strategy.Auto,
396400
vlmModel: VLMModel.Gpt4o,
397401
vlmModelProvider: VLMModelProvider.Openai,
398402
},
399403
});
400404

401-
// Handle the result
402405
console.log(result);
403406
}
404407

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,4 +604,14 @@ Based on:
604604
### Generated
605605
- [typescript v0.24.4] .
606606
### Releases
607-
- [NPM v0.24.4] https://www.npmjs.com/package/unstructured-client/v/0.24.4 - .
607+
- [NPM v0.24.4] https://www.npmjs.com/package/unstructured-client/v/0.24.4 - .
608+
609+
## 2025-06-05 00:32:18
610+
### Changes
611+
Based on:
612+
- OpenAPI Doc
613+
- Speakeasy CLI 1.555.3 (2.620.2) https://github.com/speakeasy-api/speakeasy
614+
### Generated
615+
- [typescript v0.25.0] .
616+
### Releases
617+
- [NPM v0.25.0] https://www.npmjs.com/package/unstructured-client/v/0.25.0 - .

USAGE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { openAsBlob } from "node:fs";
44
import { UnstructuredClient } from "unstructured-client";
55
import {
6+
Strategy,
67
VLMModel,
78
VLMModelProvider,
89
} from "unstructured-client/sdk/models/shared";
@@ -18,12 +19,12 @@ async function run() {
1819
1,
1920
10,
2021
],
22+
strategy: Strategy.Auto,
2123
vlmModel: VLMModel.Gpt4o,
2224
vlmModelProvider: VLMModelProvider.Openai,
2325
},
2426
});
2527

26-
// Handle the result
2728
console.log(result);
2829
}
2930

codeSamples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ actions:
88
"x-codeSamples":
99
- "lang": "typescript"
1010
"label": "partition"
11-
"source": "import { openAsBlob } from \"node:fs\";\nimport { UnstructuredClient } from \"unstructured-client\";\nimport { VLMModel, VLMModelProvider } from \"unstructured-client/sdk/models/shared\";\n\nconst unstructuredClient = new UnstructuredClient();\n\nasync function run() {\n const result = await unstructuredClient.general.partition({\n partitionParameters: {\n files: await openAsBlob(\"example.file\"),\n vlmModelProvider: VLMModelProvider.Openai,\n vlmModel: VLMModel.Gpt4o,\n chunkingStrategy: \"by_title\",\n splitPdfPageRange: [\n 1,\n 10,\n ],\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
11+
"source": "import { openAsBlob } from \"node:fs\";\nimport { UnstructuredClient } from \"unstructured-client\";\nimport { Strategy, VLMModel, VLMModelProvider } from \"unstructured-client/sdk/models/shared\";\n\nconst unstructuredClient = new UnstructuredClient();\n\nasync function run() {\n const result = await unstructuredClient.general.partition({\n partitionParameters: {\n files: await openAsBlob(\"example.file\"),\n strategy: Strategy.Auto,\n vlmModelProvider: VLMModelProvider.Openai,\n vlmModel: VLMModel.Gpt4o,\n chunkingStrategy: \"by_title\",\n splitPdfPageRange: [\n 1,\n 10,\n ],\n },\n });\n\n console.log(result);\n}\n\nrun();"

docs/sdk/models/errors/detail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
const value: shared.ValidationError[] = [
1010
{
1111
loc: [
12-
569227,
12+
"<value>",
1313
],
1414
msg: "<value>",
1515
type: "<value>",

docs/sdk/models/shared/strategy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto.
77
```typescript
88
import { Strategy } from "unstructured-client/sdk/models/shared";
99

10-
let value: Strategy = Strategy.Vlm;
10+
let value: Strategy = Strategy.Auto;
1111
```
1212

1313
## Values

docs/sdk/models/shared/validationerror.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ValidationError } from "unstructured-client/sdk/models/shared";
77

88
let value: ValidationError = {
99
loc: [
10-
598752,
10+
929957,
1111
],
1212
msg: "<value>",
1313
type: "<value>",

docs/sdks/general/README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Description
1616
```typescript
1717
import { openAsBlob } from "node:fs";
1818
import { UnstructuredClient } from "unstructured-client";
19-
import { VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
19+
import { Strategy, VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
2020

2121
const unstructuredClient = new UnstructuredClient();
2222

@@ -29,12 +29,12 @@ async function run() {
2929
1,
3030
10,
3131
],
32+
strategy: Strategy.Auto,
3233
vlmModel: VLMModel.Gpt4o,
3334
vlmModelProvider: VLMModelProvider.Openai,
3435
},
3536
});
3637

37-
// Handle the result
3838
console.log(result);
3939
}
4040

@@ -49,7 +49,7 @@ The standalone function version of this method:
4949
import { openAsBlob } from "node:fs";
5050
import { UnstructuredClientCore } from "unstructured-client/core.js";
5151
import { generalPartition } from "unstructured-client/funcs/generalPartition.js";
52-
import { VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
52+
import { Strategy, VLMModel, VLMModelProvider } from "unstructured-client/sdk/models/shared";
5353

5454
// Use `UnstructuredClientCore` for best tree-shaking performance.
5555
// You can create one instance of it to use across an application.
@@ -64,19 +64,17 @@ async function run() {
6464
1,
6565
10,
6666
],
67+
strategy: Strategy.Auto,
6768
vlmModel: VLMModel.Gpt4o,
6869
vlmModelProvider: VLMModelProvider.Openai,
6970
},
7071
});
71-
72-
if (!res.ok) {
73-
throw res.error;
72+
if (res.ok) {
73+
const { value: result } = res;
74+
console.log(result);
75+
} else {
76+
console.log("generalPartition failed:", res.error);
7477
}
75-
76-
const { value: result } = res;
77-
78-
// Handle the result
79-
console.log(result);
8078
}
8179

8280
run();

gen.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ generation:
33
sdkClassName: unstructured_client
44
usageSnippets:
55
optionalPropertyRendering: withExample
6+
sdkInitStyle: constructor
67
fixes:
78
nameResolutionFeb2025: false
89
parameterOrderingFeb2024: false
@@ -13,7 +14,7 @@ generation:
1314
oAuth2ClientCredentialsEnabled: false
1415
oAuth2PasswordEnabled: false
1516
typescript:
16-
version: 0.24.4
17+
version: 0.25.0
1718
additionalDependencies:
1819
dependencies:
1920
async: ^3.2.5

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "unstructured-client",
5-
"version": "0.24.4",
5+
"version": "0.25.0",
66
"exports": {
77
".": "./src/index.ts",
88
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unstructured-client",
3-
"version": "0.24.4",
3+
"version": "0.25.0",
44
"author": "Unstructured",
55
"type": "module",
66
"bin": {

src/funcs/generalPartition.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ async function $do(
357357
const requestSecurity = resolveGlobalSecurity(securityInput);
358358

359359
const context = {
360+
options: client._options,
360361
baseURL: options?.serverURL ?? client._baseURL ?? "",
361362
operationID: "partition",
362363
oAuth2Scopes: [],
@@ -387,6 +388,7 @@ async function $do(
387388
path: path,
388389
headers: headers,
389390
body: body,
391+
userAgent: client._options.userAgent,
390392
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
391393
}, options);
392394
if (!requestRes.ok) {

src/hooks/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
33
*/
44

5+
import { SDKOptions } from "../lib/config.js";
56
import { HTTPClient, RequestInput } from "../lib/http.js";
67
import { RetryConfig } from "../lib/retries.js";
78
import { SecurityState } from "../lib/security.js";
@@ -13,6 +14,7 @@ export type HookContext = {
1314
securitySource?: any | (() => Promise<any>);
1415
retryConfig: RetryConfig;
1516
resolvedSecurity: SecurityState | null;
17+
options: SDKOptions;
1618
};
1719

1820
export type Awaitable<T> = T | Promise<T>;

0 commit comments

Comments
 (0)