Skip to content

Commit

Permalink
chore: 🐝 Update SDK - Generate 0.17.0 (#111)
Browse files Browse the repository at this point in the history
> [!IMPORTANT]
> Linting report available at:
<https://app.speakeasy.com/org/unstructured/unstructured5xr/linting-report/6c992001320176a471c1952fc685b6de>
> OpenAPI Change report available at:
<https://app.speakeasy.com/org/unstructured/unstructured5xr/changes-report/1480bceeb03c91bc46bee8aa1716f276>
# SDK update
Based on:
- OpenAPI Doc  
- Speakeasy CLI 1.398.0 (2.415.8)
https://github.com/speakeasy-api/speakeasy
## OpenAPI Change Summary
No specification changes

Co-authored-by: speakeasybot <[email protected]>
  • Loading branch information
github-actions[bot] and speakeasybot authored Sep 17, 2024
1 parent 5166f33 commit 69cb604
Show file tree
Hide file tree
Showing 43 changed files with 1,977 additions and 1,795 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
node-version: 18
- name: Install dependencies
run: make install
- name: Build dependencies
run: make build
- name: Run linter
run: make check
- name: Run unit tests
Expand All @@ -48,5 +50,7 @@ jobs:
node-version: 18
- name: Install dependencies
run: make install
- name: Build dependencies
run: make build
- name: Run integration tests
run: make test-integration
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/__tests__
/funcs
/core.*
/esm
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/cjs
/.tshy
/.tshy-*
/__tests__
85 changes: 49 additions & 36 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ id: f42cb8e6-e2ce-4565-b975-5a9f38b94d5a
management:
docChecksum: 07648fa4a81409d493b04f9a0210053a
docVersion: 1.0.48
speakeasyVersion: 1.390.7
generationVersion: 2.409.8
releaseVersion: 0.16.0
configChecksum: 7d3a89591f1ead1b1ef84078be25d23c
speakeasyVersion: 1.398.0
generationVersion: 2.415.8
releaseVersion: 0.17.0
configChecksum: 2c276110c3d851f4c60673861a0ec379
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,9 @@ features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
core: 3.16.1
core: 3.17.3
defaultEnabledRetries: 0.1.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.1
examples: 2.81.4
globalSecurity: 2.82.11
Expand All @@ -32,16 +33,33 @@ features:
unions: 2.85.7
uploadStreams: 0.1.0
generatedFiles:
- src/funcs/generalPartition.ts
- src/sdk/general.ts
- src/sdk/sdk.ts
- .eslintrc.cjs
- .gitattributes
- .npmignore
- CONTRIBUTING.md
- FUNCTIONS.md
- RUNTIMES.md
- USAGE.md
- docs/sdk/models/errors/detail.md
- docs/sdk/models/errors/httpvalidationerror.md
- docs/sdk/models/errors/servererror.md
- docs/sdk/models/operations/partitionrequest.md
- docs/sdk/models/operations/partitionresponse.md
- docs/sdk/models/shared/chunkingstrategy.md
- docs/sdk/models/shared/files.md
- docs/sdk/models/shared/loc.md
- docs/sdk/models/shared/outputformat.md
- docs/sdk/models/shared/partitionparameters.md
- docs/sdk/models/shared/security.md
- docs/sdk/models/shared/strategy.md
- docs/sdk/models/shared/validationerror.md
- jsr.json
- package.json
- src/core.ts
- src/funcs/generalPartition.ts
- src/hooks/hooks.ts
- src/hooks/index.ts
- src/hooks/types.ts
- src/index.ts
- src/lib/base64.ts
- src/lib/config.ts
Expand All @@ -58,10 +76,21 @@ generatedFiles:
- src/lib/sdks.ts
- src/lib/security.ts
- src/lib/url.ts
- src/sdk/general.ts
- src/sdk/index.ts
- src/sdk/models/errors/httpclienterrors.ts
- src/sdk/models/errors/httpvalidationerror.ts
- src/sdk/models/errors/index.ts
- src/sdk/models/errors/sdkerror.ts
- src/sdk/models/errors/sdkvalidationerror.ts
- src/sdk/models/errors/servererror.ts
- src/sdk/models/operations/index.ts
- src/sdk/models/operations/partition.ts
- src/sdk/models/shared/index.ts
- src/sdk/models/shared/partitionparameters.ts
- src/sdk/models/shared/security.ts
- src/sdk/models/shared/validationerror.ts
- src/sdk/sdk.ts
- src/sdk/types/blobs.ts
- src/sdk/types/constdatetime.ts
- src/sdk/types/enums.ts
Expand All @@ -71,31 +100,15 @@ generatedFiles:
- src/sdk/types/rfcdate.ts
- src/sdk/types/streams.ts
- tsconfig.json
- src/sdk/models/operations/partition.ts
- src/sdk/models/errors/httpvalidationerror.ts
- src/sdk/models/errors/servererror.ts
- src/sdk/models/shared/validationerror.ts
- src/sdk/models/shared/partitionparameters.ts
- src/sdk/models/shared/security.ts
- src/sdk/models/errors/index.ts
- src/sdk/models/operations/index.ts
- src/sdk/models/shared/index.ts
- docs/sdk/models/operations/partitionrequest.md
- docs/sdk/models/operations/partitionresponse.md
- docs/sdk/models/errors/detail.md
- docs/sdk/models/errors/httpvalidationerror.md
- docs/sdk/models/errors/servererror.md
- docs/sdk/models/shared/loc.md
- docs/sdk/models/shared/validationerror.md
- docs/sdk/models/shared/chunkingstrategy.md
- docs/sdk/models/shared/files.md
- docs/sdk/models/shared/outputformat.md
- docs/sdk/models/shared/strategy.md
- docs/sdk/models/shared/partitionparameters.md
- docs/sdk/models/shared/security.md
- USAGE.md
- .gitattributes
- src/hooks/hooks.ts
- src/hooks/types.ts
- src/hooks/index.ts
- CONTRIBUTING.md
examples:
partition:
speakeasy-default-partition:
requestBody:
multipart/form-data: {"chunking_strategy": "by_title", "files": {"": "{\"summary\":\"File to be partitioned\",\"externalValue\":\"https://github.com/Unstructured-IO/unstructured/blob/98d3541909f64290b5efb65a226fc3ee8a7cc5ee/example-docs/layout-parser-paper.pdf\"}"}, "split_pdf_page_range": [1, 10], "strategy": "hi_res"}
responses:
"200":
application/json: [{"type": "Title", "element_id": "6aa0ff22f91bbe7e26e8e25ca8052acd", "text": "LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis", "metadata": {"languages": ["eng"], "page_number": 1, "filename": "layout-parser-paper.pdf", "filetype": "application/pdf"}}]
"422":
application/json: {"detail": "<value>"}
5XX:
application/json: {"detail": "An error occurred"}
7 changes: 3 additions & 4 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
speakeasyVersion: 1.390.7
speakeasyVersion: 1.398.0
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:38f3672383baa94018f7d826c034bf0f3e25ee8ed46d70c4633fc9661441c14b
sourceRevisionDigest: sha256:c94b4493c1e49e6f6a922e16c6ba45f067f862adb66542e7bd3355b195a3477e
sourceBlobDigest: sha256:108f49adb0607b20fc4d54949d36599c08c87c2d19e0a40e4bd5a2b91d9ac3e3
tags:
- latest
Expand All @@ -11,9 +11,8 @@ targets:
unstructed-typescript:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:38f3672383baa94018f7d826c034bf0f3e25ee8ed46d70c4633fc9661441c14b
sourceRevisionDigest: sha256:c94b4493c1e49e6f6a922e16c6ba45f067f862adb66542e7bd3355b195a3477e
sourceBlobDigest: sha256:108f49adb0607b20fc4d54949d36599c08c87c2d19e0a40e4bd5a2b91d9ac3e3
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 0.17.0

### Fixes
Improves retry mechanisms for splitting logic for PDFs to be more resilient to intermittent failures.
4 changes: 2 additions & 2 deletions 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("./sample-file"),
chunkingStrategy: ChunkingStrategy.Basic,
files: await openAsBlob("example.file"),
chunkingStrategy: ChunkingStrategy.ByTitle,
splitPdfPageRange: [
1,
10,
Expand Down
129 changes: 72 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,36 +163,39 @@ To change the default retry strategy for a single API call, simply provide a ret
```typescript
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import { ChunkingStrategy, Strategy } from "unstructured-client/sdk/models/shared";
import {
ChunkingStrategy,
Strategy,
} from "unstructured-client/sdk/models/shared";

const unstructuredClient = new UnstructuredClient();

async function run() {
const result = await unstructuredClient.general.partition(
{
partitionParameters: {
files: await openAsBlob("./sample-file"),
chunkingStrategy: ChunkingStrategy.ByTitle,
splitPdfPageRange: [1, 10],
strategy: Strategy.HiRes,
},
},
{
retries: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
}
);

// Handle the result
console.log(result);
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: ChunkingStrategy.ByTitle,
splitPdfPageRange: [
1,
10,
],
strategy: Strategy.HiRes,
},
}, {
retries: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});

// Handle the result
console.log(result);
}

run();
Expand All @@ -203,33 +206,39 @@ If you'd like to override the default retry strategy for all operations that sup
```typescript
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import { ChunkingStrategy, Strategy } from "unstructured-client/sdk/models/shared";
import {
ChunkingStrategy,
Strategy,
} from "unstructured-client/sdk/models/shared";

const unstructuredClient = new UnstructuredClient({
retryConfig: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
retryConfig: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
});

async function run() {
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("./sample-file"),
chunkingStrategy: ChunkingStrategy.ByTitle,
splitPdfPageRange: [1, 10],
strategy: Strategy.HiRes,
},
});
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: ChunkingStrategy.ByTitle,
splitPdfPageRange: [
1,
10,
],
strategy: Strategy.HiRes,
},
});

// Handle the result
console.log(result);
// Handle the result
console.log(result);
}

run();
Expand Down Expand Up @@ -327,22 +336,28 @@ Certain SDK methods accept files as part of a multi-part request. It is possible
```typescript
import { openAsBlob } from "node:fs";
import { UnstructuredClient } from "unstructured-client";
import { ChunkingStrategy, Strategy } from "unstructured-client/sdk/models/shared";
import {
ChunkingStrategy,
Strategy,
} from "unstructured-client/sdk/models/shared";

const unstructuredClient = new UnstructuredClient();

async function run() {
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("./sample-file"),
chunkingStrategy: ChunkingStrategy.ByTitle,
splitPdfPageRange: [1, 10],
strategy: Strategy.HiRes,
},
});
const result = await unstructuredClient.general.partition({
partitionParameters: {
files: await openAsBlob("example.file"),
chunkingStrategy: ChunkingStrategy.ByTitle,
splitPdfPageRange: [
1,
10,
],
strategy: Strategy.HiRes,
},
});

// Handle the result
console.log(result);
// Handle the result
console.log(result);
}

run();
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,14 @@ Based on:
### Generated
- [typescript v0.16.0] .
### Releases
- [NPM v0.16.0] https://www.npmjs.com/package/unstructured-client/v/0.16.0 - .
- [NPM v0.16.0] https://www.npmjs.com/package/unstructured-client/v/0.16.0 - .

## 2024-09-17 00:22:00
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.398.0 (2.415.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.17.0] .
### Releases
- [NPM v0.17.0] https://www.npmjs.com/package/unstructured-client/v/0.17.0 - .
Loading

0 comments on commit 69cb604

Please sign in to comment.