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
18 changes: 9 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: 836a71c214bbd252ed63f3ce3ba6b20f
docVersion: 1.1.4
speakeasyVersion: 1.526.0
generationVersion: 2.563.0
releaseVersion: 0.24.0
configChecksum: bf57ed240e6647b8f46d61e7a668981f
docChecksum: 9e84e8d53fbc7c48d4bf35240b476a5b
docVersion: 1.1.7
speakeasyVersion: 1.531.0
generationVersion: 2.568.2
releaseVersion: 0.24.1
configChecksum: e318c02067c106739f38d2f8e11f5407
repoURL: https://github.com/Unstructured-IO/unstructured-js-client.git
repoSubDirectory: .
installationURL: https://github.com/Unstructured-IO/unstructured-js-client
Expand All @@ -16,15 +16,15 @@ features:
acceptHeaders: 2.81.2
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
core: 3.21.4
core: 3.21.5
defaultEnabledRetries: 0.1.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.2
examples: 2.81.5
globalSecurity: 2.82.13
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.4
mcpServer: 0.9.0
mcpServer: 0.9.1
nameOverrides: 2.81.2
nullables: 0.1.1
openEnums: 0.1.1
Expand Down Expand Up @@ -133,5 +133,5 @@ examples:
application/json: {"detail": []}
5XX:
application/json: {"detail": "An error occurred"}
examplesVersion: 1.0.0
examplesVersion: 1.0.1
generatedTests: {}
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.526.0
speakeasyVersion: 1.531.0
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:48993802cc67795e3789ee890eef5fe1c982a2b35e88e24945abe11831725e11
sourceBlobDigest: sha256:a010b23fbfe96d4c7f91bffa6d9247d90e8e0f499e7b99f81f0d30af125517cf
sourceRevisionDigest: sha256:7560ec216c554bca569c62c9ab518f0218f24cfb66f0e57b136b07d2c0a9b73e
sourceBlobDigest: sha256:2f8e18d1de0c41db8af50b06c236c6e68fe38a884a4f04aef5a04591af60cb7b
tags:
- latest
- speakeasy-sdk-regen-1743121795
- 1.1.4
- speakeasy-sdk-regen-1744072198
- 1.1.7
targets:
unstructed-typescript:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:48993802cc67795e3789ee890eef5fe1c982a2b35e88e24945abe11831725e11
sourceBlobDigest: sha256:a010b23fbfe96d4c7f91bffa6d9247d90e8e0f499e7b99f81f0d30af125517cf
sourceRevisionDigest: sha256:7560ec216c554bca569c62c9ab518f0218f24cfb66f0e57b136b07d2c0a9b73e
sourceBlobDigest: sha256:2f8e18d1de0c41db8af50b06c236c6e68fe38a884a4f04aef5a04591af60cb7b
codeSamplesNamespace: my-source-typescript-code-samples
codeSamplesRevisionDigest: sha256:088b6af4d3d80368306b838d59c11f499eea3ec8fa83c000175d551671195cb5
codeSamplesRevisionDigest: sha256:aea1e9a86c9c9aec7564f8fdc04f3e75a6a02912b25a3cd7c57c7ff3c8e320ee
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
2 changes: 1 addition & 1 deletion FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const unstructuredClient = new UnstructuredClientCore();
async function run() {
const res = await generalPartition(unstructuredClient, {
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: "by_title",
files: await openAsBlob("example.file"),
splitPdfPageRange: [
1,
10,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ const unstructuredClient = new UnstructuredClient();
async function run() {
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: "by_title",
files: await openAsBlob("example.file"),
splitPdfPageRange: [
1,
10,
Expand Down Expand Up @@ -270,8 +270,8 @@ const unstructuredClient = new UnstructuredClient({
async function run() {
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: "by_title",
files: await openAsBlob("example.file"),
splitPdfPageRange: [
1,
10,
Expand Down Expand Up @@ -387,8 +387,8 @@ const unstructuredClient = new UnstructuredClient();
async function run() {
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: "by_title",
files: await openAsBlob("example.file"),
splitPdfPageRange: [
1,
10,
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,4 +564,14 @@ Based on:
### Generated
- [typescript v0.24.0] .
### Releases
- [NPM v0.24.0] https://www.npmjs.com/package/unstructured-client/v/0.24.0 - .
- [NPM v0.24.0] https://www.npmjs.com/package/unstructured-client/v/0.24.0 - .

## 2025-04-08 00:29:42
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.531.0 (2.568.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.24.1] .
### Releases
- [NPM v0.24.1] https://www.npmjs.com/package/unstructured-client/v/0.24.1 - .
2 changes: 1 addition & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const unstructuredClient = new UnstructuredClient();
async function run() {
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: "by_title",
files: await openAsBlob("example.file"),
splitPdfPageRange: [
1,
10,
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/models/errors/detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const value: shared.ValidationError[] = [
{
loc: [
715190,
569227,
],
msg: "<value>",
type: "<value>",
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/models/shared/loc.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ const value: string = "<value>";
### `number`

```typescript
const value: number = 602763;
const value: number = 128403;
```

2 changes: 1 addition & 1 deletion docs/sdk/models/shared/outputformat.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The format of the response. Supported formats are application/json and text/csv.
```typescript
import { OutputFormat } from "unstructured-client/sdk/models/shared";

let value: OutputFormat = OutputFormat.TextCsv;
let value: OutputFormat = OutputFormat.ApplicationJson;
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/models/shared/partitionparameters.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/sdk/models/shared/strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The strategy to use for partitioning PDF/image. Options are fast, hi_res, auto.
```typescript
import { Strategy } from "unstructured-client/sdk/models/shared";

let value: Strategy = Strategy.HiRes;
let value: Strategy = Strategy.Vlm;
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/models/shared/validationerror.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ValidationError } from "unstructured-client/sdk/models/shared";

let value: ValidationError = {
loc: [
423655,
598752,
],
msg: "<value>",
type: "<value>",
Expand Down
1 change: 1 addition & 0 deletions docs/sdk/models/shared/vlmmodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This is an open enum. Unrecognized values will be captured as the `Unrecognized<
| Name | Value |
| -------------------------------------------- | -------------------------------------------- |
| `Claude35Sonnet20241022` | claude-3-5-sonnet-20241022 |
| `Claude37Sonnet20250219` | claude-3-7-sonnet-20250219 |
| `Gpt4o` | gpt-4o |
| `Gemini15Pro` | gemini-1.5-pro |
| `UsAmazonNovaProV10` | us.amazon.nova-pro-v1:0 |
Expand Down
4 changes: 2 additions & 2 deletions docs/sdks/general/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const unstructuredClient = new UnstructuredClient();
async function run() {
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: "by_title",
files: await openAsBlob("example.file"),
splitPdfPageRange: [
1,
10,
Expand Down Expand Up @@ -58,8 +58,8 @@ const unstructuredClient = new UnstructuredClientCore();
async function run() {
const res = await generalPartition(unstructuredClient, {
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: "by_title",
files: await openAsBlob("example.file"),
splitPdfPageRange: [
1,
10,
Expand Down
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 0.24.0
version: 0.24.1
additionalDependencies:
dependencies:
async: ^3.2.5
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.24.0",
"version": "0.24.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.24.0",
"version": "0.24.1",
"author": "Unstructured",
"type": "module",
"bin": {
Expand Down
13 changes: 4 additions & 9 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { Params, pathToFunc } from "./url.js";
* Serverless SaaS API
*/
export const ServerSaasApi = "saas-api";
/**
* Hosted API Free
*/
export const ServerFreeApi = "free-api";
/**
* Development server
*/
Expand All @@ -25,7 +21,6 @@ export const ServerDevelopment = "development";
*/
export const ServerList = {
[ServerSaasApi]: "https://api.unstructuredapp.io",
[ServerFreeApi]: "https://api.unstructured.io",
[ServerDevelopment]: "http://localhost:8000",
} as const;

Expand Down Expand Up @@ -68,9 +63,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {

export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.1.4",
sdkVersion: "0.24.0",
genVersion: "2.563.0",
openapiDocVersion: "1.1.7",
sdkVersion: "0.24.1",
genVersion: "2.568.2",
userAgent:
"speakeasy-sdk/typescript 0.24.0 2.563.0 1.1.4 unstructured-client",
"speakeasy-sdk/typescript 0.24.1 2.568.2 1.1.7 unstructured-client",
} as const;
2 changes: 1 addition & 1 deletion src/mcp-server/mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const routes = buildRouteMap({
export const app = buildApplication(routes, {
name: "mcp",
versionInfo: {
currentVersion: "0.24.0",
currentVersion: "0.24.1",
},
});

Expand Down
9 changes: 8 additions & 1 deletion src/mcp-server/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ export function createRegisterPrompt(
prompt: PromptDefinition<A>,
): void => {
const scopes = prompt.scopes ?? [];
if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) {
if (allowedScopes.size > 0 && scopes.length === 0) {
return;
}

if (
allowedScopes.size > 0
&& !scopes.every((s: MCPScope) => allowedScopes.has(s))
) {
return;
}

Expand Down
18 changes: 16 additions & 2 deletions src/mcp-server/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ export function createRegisterResource(
): (resource: ResourceDefinition) => void {
return (resource: ResourceDefinition): void => {
const scopes = resource.scopes ?? [];
if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) {
if (allowedScopes.size > 0 && scopes.length === 0) {
return;
}

if (
allowedScopes.size > 0
&& !scopes.every((s: MCPScope) => allowedScopes.has(s))
) {
return;
}

Expand Down Expand Up @@ -137,7 +144,14 @@ export function createRegisterResourceTemplate(
): (resource: ResourceTemplateDefinition) => void {
return (resource: ResourceTemplateDefinition): void => {
const scopes = resource.scopes ?? [];
if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) {
if (allowedScopes.size > 0 && scopes.length === 0) {
return;
}

if (
allowedScopes.size > 0
&& !scopes.every((s: MCPScope) => allowedScopes.has(s))
) {
return;
}

Expand Down
6 changes: 3 additions & 3 deletions src/mcp-server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
createRegisterResource,
createRegisterResourceTemplate,
} from "./resources.js";
import { MCPScope, mcpScopes } from "./scopes.js";
import { MCPScope } from "./scopes.js";
import { registerMCPExtensions } from "./server.extensions.js";
import { createRegisterTool } from "./tools.js";
import { tool$generalPartition } from "./tools/generalPartition.js";
Expand All @@ -27,7 +27,7 @@ export function createMCPServer(deps: {
}) {
const server = new McpServer({
name: "UnstructuredClient",
version: "0.24.0",
version: "0.24.1",
});

const client = new UnstructuredClientCore({
Expand All @@ -36,7 +36,7 @@ export function createMCPServer(deps: {
server: deps.server,
});

const scopes = new Set(deps.scopes ?? mcpScopes);
const scopes = new Set(deps.scopes);

const allowedTools = deps.allowedTools && new Set(deps.allowedTools);
const tool = createRegisterTool(
Expand Down
9 changes: 6 additions & 3 deletions src/mcp-server/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,15 @@ export function createRegisterTool(
return;
}

const toolScopes = tool.scopes ?? [];
if (allowedScopes.size > 0 && toolScopes.length === 0) {
const scopes = tool.scopes ?? [];
if (allowedScopes.size > 0 && scopes.length === 0) {
return;
}

if (!toolScopes.every((s) => allowedScopes.has(s))) {
if (
allowedScopes.size > 0
&& !scopes.every((s: MCPScope) => allowedScopes.has(s))
) {
return;
}

Expand Down
Loading