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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/react-query
/.speakeasy/reports
/__tests__
/funcs
/core.*
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
**/*
!/FUNCTIONS.md
!/RUNTIMES.md
!/REACT_QUERY.md
!/**/*.ts
!/**/*.js
!/**/*.map
Expand Down
31 changes: 18 additions & 13 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
lockVersion: 2.0.0
id: f42cb8e6-e2ce-4565-b975-5a9f38b94d5a
management:
docChecksum: 0ecb1bbbef6c9805d6a3edcc0afd098a
docVersion: 1.0.51
speakeasyVersion: 1.422.1
generationVersion: 2.438.15
releaseVersion: 0.18.2
configChecksum: ca25abf7161ef39bf7793f0e79caf68e
docChecksum: 4717c00d28425bfad21b5c8706ed4ca7
docVersion: 1.0.58
speakeasyVersion: 1.468.6
generationVersion: 2.493.13
releaseVersion: 0.19.0
configChecksum: 756522998ca4a24ef07ae29599125e94
repoURL: https://github.com/Unstructured-IO/unstructured-js-client.git
repoSubDirectory: .
installationURL: https://github.com/Unstructured-IO/unstructured-js-client
published: true
features:
typescript:
acceptHeaders: 2.81.2
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
core: 3.18.2
core: 3.18.14
defaultEnabledRetries: 0.1.0
enumUnions: 0.1.0
envVarSecurityUsage: 0.1.1
examples: 2.81.4
globalSecurity: 2.82.11
envVarSecurityUsage: 0.1.2
examples: 2.81.5
globalSecurity: 2.82.12
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.4
nameOverrides: 2.81.2
nullables: 0.1.0
openEnums: 0.1.1
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.1.0
sdkHooks: 0.2.0
serverIDs: 2.81.2
unions: 2.85.7
unions: 2.85.8
uploadStreams: 0.1.0
generatedFiles:
- .eslintrc.cjs
- .gitattributes
- .npmignore
- CONTRIBUTING.md
- FUNCTIONS.md
- RUNTIMES.md
- USAGE.md
- docs/lib/utils/retryconfig.md
- docs/sdk/models/errors/detail.md
- docs/sdk/models/errors/httpvalidationerror.md
- docs/sdk/models/errors/servererror.md
Expand All @@ -53,6 +54,8 @@ generatedFiles:
- docs/sdk/models/shared/security.md
- docs/sdk/models/shared/strategy.md
- docs/sdk/models/shared/validationerror.md
- docs/sdks/general/README.md
- docs/sdks/unstructuredclient/README.md
- jsr.json
- package.json
- src/core.ts
Expand Down Expand Up @@ -108,7 +111,9 @@ examples:
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"}}]
text/csv: "<value>"
"422":
application/json: {"detail": []}
5XX:
application/json: {"detail": "An error occurred"}
generatedTests: {}
17 changes: 11 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
speakeasyVersion: 1.422.1
speakeasyVersion: 1.468.6
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:7904e30126e3e30e77b56f6d901513e7009cbdc1d433dd7f6baa7da71a31b79a
sourceBlobDigest: sha256:4747157b44baaa540a909f6947d16b08b096845a816819d9b0d35d074561fb68
sourceRevisionDigest: sha256:3ce862c538447f14371df47b3eb07ae3ac20d1dd7f127ecaafbdbda175e5f967
sourceBlobDigest: sha256:5b768ce3d603f07d017095a42738571836d3d0698c1713bf9b184a6235cffdd2
tags:
- latest
- main
- speakeasy-sdk-regen-1731198560
- 1.0.58
targets:
unstructed-typescript:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:7904e30126e3e30e77b56f6d901513e7009cbdc1d433dd7f6baa7da71a31b79a
sourceBlobDigest: sha256:4747157b44baaa540a909f6947d16b08b096845a816819d9b0d35d074561fb68
sourceRevisionDigest: sha256:3ce862c538447f14371df47b3eb07ae3ac20d1dd7f127ecaafbdbda175e5f967
sourceBlobDigest: sha256:5b768ce3d603f07d017095a42738571836d3d0698c1713bf9b184a6235cffdd2
codeSamplesNamespace: my-source-typescript-code-samples
codeSamplesRevisionDigest: sha256:36362ca76ec0ffe7ab5d84c904a5e4ecb16158194fedd282fa1c2bb0399b91fa
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand All @@ -33,3 +36,5 @@ workflow:
token: $NPM_TOKEN
codeSamples:
output: codeSamples.yaml
registry:
location: registry.speakeasyapi.dev/unstructured/unstructured5xr/my-source-typescript-code-samples
2 changes: 2 additions & 0 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ targets:
token: $NPM_TOKEN
codeSamples:
output: codeSamples.yaml
registry:
location: registry.speakeasyapi.dev/unstructured/unstructured5xr/my-source-typescript-code-samples
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,17 @@ client.general.partition({
<!-- Start Table of Contents [toc] -->
## Table of Contents
<!-- $toc-max-depth=2 -->
* [SDK Installation](#sdk-installation)
* [SDK Example Usage](#sdk-example-usage)
* [Change the base URL](#change-the-base-url)
* [Custom HTTP Client](#custom-http-client)
* [Retries](#retries)
* [Requirements](#requirements)
* [Standalone functions](#standalone-functions)
* [File uploads](#file-uploads)
* [Debugging](#debugging)
* [SDK Installation](#sdk-installation)
* [Requirements](#requirements)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Standalone functions](#standalone-functions)
* [File uploads](#file-uploads)
* [Retries](#retries)
* [Error Handling](#error-handling)
* [Server Selection](#server-selection)
* [Custom HTTP Client](#custom-http-client)
* [Authentication](#authentication)
* [Debugging](#debugging)
<!-- End Table of Contents [toc] -->
<!-- Start Requirements [requirements] -->
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,14 @@ Based on:
### Generated
- [typescript v0.18.2] .
### Releases
- [NPM v0.18.2] https://www.npmjs.com/package/unstructured-client/v/0.18.2 - .
- [NPM v0.18.2] https://www.npmjs.com/package/unstructured-client/v/0.18.2 - .

## 2025-01-15 00:27:25
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.468.6 (2.493.13) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.19.0] .
### Releases
- [NPM v0.19.0] https://www.npmjs.com/package/unstructured-client/v/0.19.0 - .
28 changes: 27 additions & 1 deletion RUNTIMES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Supported JavaScript runtimes

This SDK is intended to be used in JavaScript runtimes that support the following features:
This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:

* [Web Fetch API][web-fetch]
* [Web Streams API][web-streams] and in particular `ReadableStream`
Expand All @@ -20,3 +20,29 @@ Runtime environments that are explicitly supported are:
- Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])

[deno-file-streaming]: https://github.com/denoland/deno/issues/11018

## Recommended TypeScript compiler options

The following `tsconfig.json` options are recommended for projects using this
SDK in order to get static type support for features like async iterables,
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
so on):

[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
[abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
[request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response

```jsonc
{
"compilerOptions": {
"target": "es2020", // or higher
"lib": ["es2020", "dom", "dom.iterable"],
}
}
```

While `target` can be set to older ECMAScript versions, it may result in extra,
unnecessary compatibility code being generated if you are not targeting old
runtimes.
24 changes: 24 additions & 0 deletions docs/lib/utils/retryconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# RetryConfig

Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies.

## Fields

| Name | Type | Description | Example |
| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- |
| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` |
| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | |
| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` |

## BackoffStrategy

The backoff strategy allows retrying a request with an exponential backoff between each retry.

### Fields

| Name | Type | Description | Example |
| ------------------ | ------------ | ----------------------------------------- | -------- |
| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` |
| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` |
| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` |
| `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` |
13 changes: 7 additions & 6 deletions docs/sdk/models/operations/partitionresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { PartitionResponse } from "unstructured-client/sdk/models/operations";

let value: PartitionResponse = {
contentType: "<value>",
statusCode: 306,
rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" },
}),
elements: [
{
"type": "Title",
Expand All @@ -23,10 +27,6 @@ let value: PartitionResponse = {
},
},
],
statusCode: 306,
rawResponse: new Response("{\"message\": \"hello world\"}", {
headers: { "Content-Type": "application/json" },
}),
};
```

Expand All @@ -35,6 +35,7 @@ let value: PartitionResponse = {
| Field | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `elements` | Record<string, *any*>[] | :heavy_minus_sign: | Successful Response |
| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation |
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `rawResponse` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `csvElements` | *string* | :heavy_minus_sign: | Successful Response |
| `elements` | Record<string, *any*>[] | :heavy_minus_sign: | Successful Response |
Loading
Loading