Skip to content

chore: 🐝 Update SDK - Generate 0.25.1 #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
20 changes: 11 additions & 9 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: f42cb8e6-e2ce-4565-b975-5a9f38b94d5a
management:
docChecksum: 251a87fb7643cd585e4ddf956bb1ae1f
docVersion: 1.1.23
speakeasyVersion: 1.555.3
generationVersion: 2.620.2
releaseVersion: 0.25.0
configChecksum: 3cf3f043a49108bf9cbc7c2f2476b151
docChecksum: 7c9084aa5b0e10020a8f9e2954f0637a
docVersion: 1.1.25
speakeasyVersion: 1.568.0
generationVersion: 2.632.2
releaseVersion: 0.25.1
configChecksum: 0197c95e1e5ef91e7b26f9b0cdfe33ef
repoURL: https://github.com/Unstructured-IO/unstructured-js-client.git
repoSubDirectory: .
installationURL: https://github.com/Unstructured-IO/unstructured-js-client
Expand All @@ -15,8 +15,8 @@ features:
typescript:
acceptHeaders: 2.81.2
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
core: 3.21.10
constsAndDefaults: 0.1.12
core: 3.21.11
defaultEnabledRetries: 0.1.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.2
Expand All @@ -32,7 +32,7 @@ features:
retries: 2.83.0
sdkHooks: 0.3.0
serverIDs: 2.81.2
unions: 2.85.8
unions: 2.85.11
uploadStreams: 0.1.0
generatedFiles:
- .gitattributes
Expand Down Expand Up @@ -100,9 +100,11 @@ generatedFiles:
- src/sdk/models/errors/httpclienterrors.ts
- src/sdk/models/errors/httpvalidationerror.ts
- src/sdk/models/errors/index.ts
- src/sdk/models/errors/responsevalidationerror.ts
- src/sdk/models/errors/sdkerror.ts
- src/sdk/models/errors/sdkvalidationerror.ts
- src/sdk/models/errors/servererror.ts
- src/sdk/models/errors/unstructuredclienterror.ts
- src/sdk/models/operations/index.ts
- src/sdk/models/operations/partition.ts
- src/sdk/models/shared/index.ts
Expand Down
16 changes: 8 additions & 8 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.555.3
speakeasyVersion: 1.568.0
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:8eb1828e2c067201a3e864721b453543815bbbb71fb160723bb331bb01e4d9aa
sourceBlobDigest: sha256:614c15b826e255f33812df0a7bb989a7bfb194167fa111162594664c04c2c5f4
sourceRevisionDigest: sha256:594365bf5284e8d4e6602a17b0cacdd329dff7dcb7b1deb59777c08127b1743d
sourceBlobDigest: sha256:f4c50c20ad68fa323d17d43c86d87f2ecc0d7c90c837ff57f9e05812e494f982
tags:
- latest
- speakeasy-sdk-regen-1749083555
- 1.1.23
- speakeasy-sdk-regen-1749947818
- 1.1.25
targets:
unstructed-typescript:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:8eb1828e2c067201a3e864721b453543815bbbb71fb160723bb331bb01e4d9aa
sourceBlobDigest: sha256:614c15b826e255f33812df0a7bb989a7bfb194167fa111162594664c04c2c5f4
sourceRevisionDigest: sha256:594365bf5284e8d4e6602a17b0cacdd329dff7dcb7b1deb59777c08127b1743d
sourceBlobDigest: sha256:f4c50c20ad68fa323d17d43c86d87f2ecc0d7c90c837ff57f9e05812e494f982
codeSamplesNamespace: my-source-typescript-code-samples
codeSamplesRevisionDigest: sha256:145ca0fb688e7d825c8f66ba00ecfee5a960ce4ad2c9a07c0e7683306d0b92e2
codeSamplesRevisionDigest: sha256:ed0de85af2807af3b8511f78ce04c3da0687d34ce8d73068430ffd80a7b2e479
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,4 +614,14 @@ Based on:
### Generated
- [typescript v0.25.0] .
### Releases
- [NPM v0.25.0] https://www.npmjs.com/package/unstructured-client/v/0.25.0 - .
- [NPM v0.25.0] https://www.npmjs.com/package/unstructured-client/v/0.25.0 - .

## 2025-06-23 00:35:22
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.568.0 (2.632.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.25.1] .
### Releases
- [NPM v0.25.1] https://www.npmjs.com/package/unstructured-client/v/0.25.1 - .
4 changes: 3 additions & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 0.25.0
version: 0.25.1
additionalDependencies:
dependencies:
async: ^3.2.5
Expand All @@ -25,7 +25,9 @@ typescript:
peerDependencies: {}
additionalPackageJSON: {}
author: Unstructured
baseErrorName: UnstructuredClientError
clientServerStatusCodesAsErrors: true
constFieldsAlwaysOptional: true
defaultErrorName: SDKError
enableCustomCodeRegions: false
enableMCPServer: true
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "unstructured-client",
"version": "0.25.0",
"version": "0.25.1",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unstructured-client",
"version": "0.25.0",
"version": "0.25.1",
"author": "Unstructured",
"type": "module",
"bin": {
Expand Down
60 changes: 39 additions & 21 deletions src/funcs/generalPartition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

import { UnstructuredClientCore } from "../core.js";
import { appendForm, encodeSimple } from "../lib/encodings.js";
import { readableStreamToArrayBuffer } from "../lib/files.js";
import {
getContentTypeFromFileName,
readableStreamToArrayBuffer,
} from "../lib/files.js";
import * as M from "../lib/matchers.js";
import { compactMap } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
Expand All @@ -19,8 +22,9 @@ import {
UnexpectedClientError,
} from "../sdk/models/errors/httpclienterrors.js";
import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { UnstructuredClientError } from "../sdk/models/errors/unstructuredclienterror.js";
import * as operations from "../sdk/models/operations/index.js";
import { APICall, APIPromise } from "../sdk/types/async.js";
import { isBlobLike } from "../sdk/types/blobs.js";
Expand All @@ -47,13 +51,14 @@ export function generalPartition(
operations.PartitionResponse,
| errors.HTTPValidationError
| errors.ServerError
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| UnstructuredClientError
| ResponseValidationError
| ConnectionError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
| InvalidRequestError
| UnexpectedClientError
| SDKValidationError
>
> {
return new APIPromise($do(
Expand All @@ -73,13 +78,14 @@ async function $do(
operations.PartitionResponse,
| errors.HTTPValidationError
| errors.ServerError
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| UnstructuredClientError
| ResponseValidationError
| ConnectionError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
| InvalidRequestError
| UnexpectedClientError
| SDKValidationError
>,
APICall,
]
Expand All @@ -101,14 +107,25 @@ async function $do(
const buffer = await readableStreamToArrayBuffer(
payload.partition_parameters.files.content,
);
const blob = new Blob([buffer], { type: "application/octet-stream" });
appendForm(body, "files", blob);
const contentType =
getContentTypeFromFileName(payload.partition_parameters.files.fileName)
|| "application/octet-stream";
const blob = new Blob([buffer], { type: contentType });
appendForm(
body,
"files",
blob,
payload.partition_parameters.files.fileName,
);
} else {
const contentType =
getContentTypeFromFileName(payload.partition_parameters.files.fileName)
|| "application/octet-stream";
appendForm(
body,
"files",
new Blob([payload.partition_parameters.files.content], {
type: "application/octet-stream",
type: contentType,
}),
payload.partition_parameters.files.fileName,
);
Expand Down Expand Up @@ -415,13 +432,14 @@ async function $do(
operations.PartitionResponse,
| errors.HTTPValidationError
| errors.ServerError
| SDKError
| SDKValidationError
| UnexpectedClientError
| InvalidRequestError
| UnstructuredClientError
| ResponseValidationError
| ConnectionError
| RequestAbortedError
| RequestTimeoutError
| ConnectionError
| InvalidRequestError
| UnexpectedClientError
| SDKValidationError
>(
M.json(200, operations.PartitionResponse$inboundSchema),
M.text(200, operations.PartitionResponse$inboundSchema, {
Expand All @@ -430,7 +448,7 @@ async function $do(
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
M.fail("4XX"),
M.jsonErr("5XX", errors.ServerError$inboundSchema),
)(response, { extraFields: responseFields });
)(response, req, { extraFields: responseFields });
if (!result.ok) {
return [result, { status: "complete", request: req, response }];
}
Expand Down
8 changes: 4 additions & 4 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {

export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.1.23",
sdkVersion: "0.25.0",
genVersion: "2.620.2",
openapiDocVersion: "1.1.25",
sdkVersion: "0.25.1",
genVersion: "2.632.2",
userAgent:
"speakeasy-sdk/typescript 0.25.0 2.620.2 1.1.23 unstructured-client",
"speakeasy-sdk/typescript 0.25.1 2.632.2 1.1.25 unstructured-client",
} as const;
42 changes: 42 additions & 0 deletions src/lib/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,45 @@ export async function readableStreamToArrayBuffer(

return concatenatedChunks.buffer as ArrayBuffer;
}

/**
* Determines the MIME content type based on a file's extension.
* Returns null if the extension is not recognized.
*/
export function getContentTypeFromFileName(fileName: string): string | null {
if (!fileName) return null;

const ext = fileName.toLowerCase().split(".").pop();
if (!ext) return null;

const mimeTypes: Record<string, string> = {
json: "application/json",
xml: "application/xml",
html: "text/html",
htm: "text/html",
txt: "text/plain",
csv: "text/csv",
pdf: "application/pdf",
png: "image/png",
jpg: "image/jpeg",
jpeg: "image/jpeg",
gif: "image/gif",
svg: "image/svg+xml",
js: "application/javascript",
css: "text/css",
zip: "application/zip",
tar: "application/x-tar",
gz: "application/gzip",
mp4: "video/mp4",
mp3: "audio/mpeg",
wav: "audio/wav",
webp: "image/webp",
ico: "image/x-icon",
woff: "font/woff",
woff2: "font/woff2",
ttf: "font/ttf",
otf: "font/otf",
};

return mimeTypes[ext] || null;
}
Loading