Skip to content

Commit 9cb2db8

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.568.0
1 parent 4d6ffe2 commit 9cb2db8

22 files changed

+322
-135
lines changed

.speakeasy/gen.lock

Lines changed: 11 additions & 9 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: 251a87fb7643cd585e4ddf956bb1ae1f
5-
docVersion: 1.1.23
6-
speakeasyVersion: 1.555.3
7-
generationVersion: 2.620.2
8-
releaseVersion: 0.25.0
9-
configChecksum: 3cf3f043a49108bf9cbc7c2f2476b151
4+
docChecksum: 7c9084aa5b0e10020a8f9e2954f0637a
5+
docVersion: 1.1.25
6+
speakeasyVersion: 1.568.0
7+
generationVersion: 2.632.2
8+
releaseVersion: 0.25.1
9+
configChecksum: 0197c95e1e5ef91e7b26f9b0cdfe33ef
1010
repoURL: https://github.com/Unstructured-IO/unstructured-js-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-js-client
@@ -15,8 +15,8 @@ features:
1515
typescript:
1616
acceptHeaders: 2.81.2
1717
additionalDependencies: 0.1.0
18-
constsAndDefaults: 0.1.11
19-
core: 3.21.10
18+
constsAndDefaults: 0.1.12
19+
core: 3.21.11
2020
defaultEnabledRetries: 0.1.0
2121
enumUnions: 0.1.0
2222
envVarSecurityUsage: 0.1.2
@@ -32,7 +32,7 @@ features:
3232
retries: 2.83.0
3333
sdkHooks: 0.3.0
3434
serverIDs: 2.81.2
35-
unions: 2.85.8
35+
unions: 2.85.11
3636
uploadStreams: 0.1.0
3737
generatedFiles:
3838
- .gitattributes
@@ -100,9 +100,11 @@ generatedFiles:
100100
- src/sdk/models/errors/httpclienterrors.ts
101101
- src/sdk/models/errors/httpvalidationerror.ts
102102
- src/sdk/models/errors/index.ts
103+
- src/sdk/models/errors/responsevalidationerror.ts
103104
- src/sdk/models/errors/sdkerror.ts
104105
- src/sdk/models/errors/sdkvalidationerror.ts
105106
- src/sdk/models/errors/servererror.ts
107+
- src/sdk/models/errors/unstructuredclienterror.ts
106108
- src/sdk/models/operations/index.ts
107109
- src/sdk/models/operations/partition.ts
108110
- src/sdk/models/shared/index.ts

.speakeasy/workflow.lock

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

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,4 +614,14 @@ Based on:
614614
### Generated
615615
- [typescript v0.25.0] .
616616
### Releases
617-
- [NPM v0.25.0] https://www.npmjs.com/package/unstructured-client/v/0.25.0 - .
617+
- [NPM v0.25.0] https://www.npmjs.com/package/unstructured-client/v/0.25.0 - .
618+
619+
## 2025-06-21 00:32:15
620+
### Changes
621+
Based on:
622+
- OpenAPI Doc
623+
- Speakeasy CLI 1.568.0 (2.632.2) https://github.com/speakeasy-api/speakeasy
624+
### Generated
625+
- [typescript v0.25.1] .
626+
### Releases
627+
- [NPM v0.25.1] https://www.npmjs.com/package/unstructured-client/v/0.25.1 - .

gen.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ generation:
1414
oAuth2ClientCredentialsEnabled: false
1515
oAuth2PasswordEnabled: false
1616
typescript:
17-
version: 0.25.0
17+
version: 0.25.1
1818
additionalDependencies:
1919
dependencies:
2020
async: ^3.2.5
@@ -25,7 +25,9 @@ typescript:
2525
peerDependencies: {}
2626
additionalPackageJSON: {}
2727
author: Unstructured
28+
baseErrorName: UnstructuredClientError
2829
clientServerStatusCodesAsErrors: true
30+
constFieldsAlwaysOptional: true
2931
defaultErrorName: SDKError
3032
enableCustomCodeRegions: false
3133
enableMCPServer: true

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.25.0",
5+
"version": "0.25.1",
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.25.0",
3+
"version": "0.25.1",
44
"author": "Unstructured",
55
"type": "module",
66
"bin": {

src/funcs/generalPartition.ts

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
import { UnstructuredClientCore } from "../core.js";
66
import { appendForm, encodeSimple } from "../lib/encodings.js";
7-
import { readableStreamToArrayBuffer } from "../lib/files.js";
7+
import {
8+
getContentTypeFromFileName,
9+
readableStreamToArrayBuffer,
10+
} from "../lib/files.js";
811
import * as M from "../lib/matchers.js";
912
import { compactMap } from "../lib/primitives.js";
1013
import { safeParse } from "../lib/schemas.js";
@@ -19,8 +22,9 @@ import {
1922
UnexpectedClientError,
2023
} from "../sdk/models/errors/httpclienterrors.js";
2124
import * as errors from "../sdk/models/errors/index.js";
22-
import { SDKError } from "../sdk/models/errors/sdkerror.js";
25+
import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js";
2326
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
27+
import { UnstructuredClientError } from "../sdk/models/errors/unstructuredclienterror.js";
2428
import * as operations from "../sdk/models/operations/index.js";
2529
import { APICall, APIPromise } from "../sdk/types/async.js";
2630
import { isBlobLike } from "../sdk/types/blobs.js";
@@ -47,13 +51,14 @@ export function generalPartition(
4751
operations.PartitionResponse,
4852
| errors.HTTPValidationError
4953
| errors.ServerError
50-
| SDKError
51-
| SDKValidationError
52-
| UnexpectedClientError
53-
| InvalidRequestError
54+
| UnstructuredClientError
55+
| ResponseValidationError
56+
| ConnectionError
5457
| RequestAbortedError
5558
| RequestTimeoutError
56-
| ConnectionError
59+
| InvalidRequestError
60+
| UnexpectedClientError
61+
| SDKValidationError
5762
>
5863
> {
5964
return new APIPromise($do(
@@ -73,13 +78,14 @@ async function $do(
7378
operations.PartitionResponse,
7479
| errors.HTTPValidationError
7580
| errors.ServerError
76-
| SDKError
77-
| SDKValidationError
78-
| UnexpectedClientError
79-
| InvalidRequestError
81+
| UnstructuredClientError
82+
| ResponseValidationError
83+
| ConnectionError
8084
| RequestAbortedError
8185
| RequestTimeoutError
82-
| ConnectionError
86+
| InvalidRequestError
87+
| UnexpectedClientError
88+
| SDKValidationError
8389
>,
8490
APICall,
8591
]
@@ -101,14 +107,25 @@ async function $do(
101107
const buffer = await readableStreamToArrayBuffer(
102108
payload.partition_parameters.files.content,
103109
);
104-
const blob = new Blob([buffer], { type: "application/octet-stream" });
105-
appendForm(body, "files", blob);
110+
const contentType =
111+
getContentTypeFromFileName(payload.partition_parameters.files.fileName)
112+
|| "application/octet-stream";
113+
const blob = new Blob([buffer], { type: contentType });
114+
appendForm(
115+
body,
116+
"files",
117+
blob,
118+
payload.partition_parameters.files.fileName,
119+
);
106120
} else {
121+
const contentType =
122+
getContentTypeFromFileName(payload.partition_parameters.files.fileName)
123+
|| "application/octet-stream";
107124
appendForm(
108125
body,
109126
"files",
110127
new Blob([payload.partition_parameters.files.content], {
111-
type: "application/octet-stream",
128+
type: contentType,
112129
}),
113130
payload.partition_parameters.files.fileName,
114131
);
@@ -415,13 +432,14 @@ async function $do(
415432
operations.PartitionResponse,
416433
| errors.HTTPValidationError
417434
| errors.ServerError
418-
| SDKError
419-
| SDKValidationError
420-
| UnexpectedClientError
421-
| InvalidRequestError
435+
| UnstructuredClientError
436+
| ResponseValidationError
437+
| ConnectionError
422438
| RequestAbortedError
423439
| RequestTimeoutError
424-
| ConnectionError
440+
| InvalidRequestError
441+
| UnexpectedClientError
442+
| SDKValidationError
425443
>(
426444
M.json(200, operations.PartitionResponse$inboundSchema),
427445
M.text(200, operations.PartitionResponse$inboundSchema, {
@@ -430,7 +448,7 @@ async function $do(
430448
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
431449
M.fail("4XX"),
432450
M.jsonErr("5XX", errors.ServerError$inboundSchema),
433-
)(response, { extraFields: responseFields });
451+
)(response, req, { extraFields: responseFields });
434452
if (!result.ok) {
435453
return [result, { status: "complete", request: req, response }];
436454
}

src/lib/config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
6767

6868
export const SDK_METADATA = {
6969
language: "typescript",
70-
openapiDocVersion: "1.1.23",
71-
sdkVersion: "0.25.0",
72-
genVersion: "2.620.2",
70+
openapiDocVersion: "1.1.25",
71+
sdkVersion: "0.25.1",
72+
genVersion: "2.632.2",
7373
userAgent:
74-
"speakeasy-sdk/typescript 0.25.0 2.620.2 1.1.23 unstructured-client",
74+
"speakeasy-sdk/typescript 0.25.1 2.632.2 1.1.25 unstructured-client",
7575
} as const;

src/lib/files.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,45 @@ export async function readableStreamToArrayBuffer(
3838

3939
return concatenatedChunks.buffer as ArrayBuffer;
4040
}
41+
42+
/**
43+
* Determines the MIME content type based on a file's extension.
44+
* Returns null if the extension is not recognized.
45+
*/
46+
export function getContentTypeFromFileName(fileName: string): string | null {
47+
if (!fileName) return null;
48+
49+
const ext = fileName.toLowerCase().split(".").pop();
50+
if (!ext) return null;
51+
52+
const mimeTypes: Record<string, string> = {
53+
json: "application/json",
54+
xml: "application/xml",
55+
html: "text/html",
56+
htm: "text/html",
57+
txt: "text/plain",
58+
csv: "text/csv",
59+
pdf: "application/pdf",
60+
png: "image/png",
61+
jpg: "image/jpeg",
62+
jpeg: "image/jpeg",
63+
gif: "image/gif",
64+
svg: "image/svg+xml",
65+
js: "application/javascript",
66+
css: "text/css",
67+
zip: "application/zip",
68+
tar: "application/x-tar",
69+
gz: "application/gzip",
70+
mp4: "video/mp4",
71+
mp3: "audio/mpeg",
72+
wav: "audio/wav",
73+
webp: "image/webp",
74+
ico: "image/x-icon",
75+
woff: "font/woff",
76+
woff2: "font/woff2",
77+
ttf: "font/ttf",
78+
otf: "font/otf",
79+
};
80+
81+
return mimeTypes[ext] || null;
82+
}

0 commit comments

Comments
 (0)