Skip to content

Commit 2f6476a

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.327.0
1 parent 1cb801e commit 2f6476a

34 files changed

+175
-115
lines changed
File renamed without changes.

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/esm
2+
/dist
3+
/.tshy
4+
/.tshy-*
15
/models
26
/sdk/models/errors
37
/sdk/types
@@ -10,9 +14,7 @@
1014
/.tsbuildinfo
1115
dist/
1216
node_modules/
13-
1417
# Custom ignores
1518
openapi.json
1619
openapi_client.json
17-
18-
.idea/
20+
.idea/

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55

66
/.eslintrc.js
77
/cjs
8+
/.tshy
9+
/.tshy-*

.speakeasy/gen.lock

Lines changed: 8 additions & 8 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: c209069202bc537f70476e86044130a0
4+
docChecksum: 3f2fbf3f00965b046a501b0642259d4e
55
docVersion: 1.0.39
6-
speakeasyVersion: 1.308.1
7-
generationVersion: 2.342.6
8-
releaseVersion: 0.11.3
9-
configChecksum: 9eaa07233a4c948e9f569fd1a387ceb8
6+
speakeasyVersion: 1.327.0
7+
generationVersion: 2.359.6
8+
releaseVersion: 0.12.0
9+
configChecksum: d7fea18f81ca96b0f79ee5eb84463306
1010
repoURL: https://github.com/Unstructured-IO/unstructured-js-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-js-client
@@ -15,14 +15,14 @@ features:
1515
typescript:
1616
additionalDependencies: 0.1.0
1717
constsAndDefaults: 0.1.5
18-
core: 3.9.14
18+
core: 3.11.3
1919
examples: 2.81.4
2020
globalSecurity: 2.82.9
2121
globalSecurityCallbacks: 0.1.0
2222
globalServerURLs: 2.82.4
2323
nameOverrides: 2.81.2
2424
nullables: 0.1.0
25-
openEnums: 0.1.0
25+
openEnums: 0.1.1
2626
responseFormat: 0.2.3
2727
retries: 2.83.0
2828
sdkHooks: 0.1.0
@@ -31,7 +31,7 @@ features:
3131
generatedFiles:
3232
- src/sdk/general.ts
3333
- src/sdk/sdk.ts
34-
- .eslintrc.js
34+
- .eslintrc.cjs
3535
- .npmignore
3636
- RUNTIMES.md
3737
- jsr.json

.speakeasy/workflow.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
speakeasyVersion: 1.308.1
1+
speakeasyVersion: 1.327.0
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:75c039c729d92b37dca8914b1b2f47e4f8a9775f1c77510896c906f925da24a9
6-
sourceBlobDigest: sha256:f116cfff59082526bec401f05b9660a39c37f7db24417e8ab7aaa65676622e3c
5+
sourceRevisionDigest: sha256:417143eb8d72dd1fb47f5ee454ed8f34609838779ce4e8665c335af184dd26ce
6+
sourceBlobDigest: sha256:9bd3b026a1fb54e14ec82a0d2dccb87085aff434685a4b3584862dd50febda06
77
tags:
88
- latest
99
- main
1010
targets:
1111
unstructed-typescript:
1212
source: my-source
1313
sourceNamespace: my-source
14-
sourceRevisionDigest: sha256:75c039c729d92b37dca8914b1b2f47e4f8a9775f1c77510896c906f925da24a9
15-
sourceBlobDigest: sha256:f116cfff59082526bec401f05b9660a39c37f7db24417e8ab7aaa65676622e3c
14+
sourceRevisionDigest: sha256:417143eb8d72dd1fb47f5ee454ed8f34609838779ce4e8665c335af184dd26ce
15+
sourceBlobDigest: sha256:9bd3b026a1fb54e14ec82a0d2dccb87085aff434685a4b3584862dd50febda06
1616
outLocation: /github/workspace/repo
1717
workflow:
1818
workflowVersion: 1.0.0

RELEASES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,14 @@ Based on:
354354
- [typescript v0.11.3] .
355355
### Releases
356356
- [NPM v0.11.3] https://www.npmjs.com/package/unstructured-client/v/0.11.3 - .
357+
358+
359+
## 2024-07-08 00:24:45
360+
### Changes
361+
Based on:
362+
- OpenAPI Doc
363+
- Speakeasy CLI 1.327.0 (2.359.6) https://github.com/speakeasy-api/speakeasy
364+
### Generated
365+
- [typescript v0.12.0] .
366+
### Releases
367+
- [NPM v0.12.0] https://www.npmjs.com/package/unstructured-client/v/0.12.0 - .

RUNTIMES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This SDK is intended to be used in JavaScript runtimes that support the following features:
44

55
* [Web Fetch API][web-fetch]
6-
* [Web Streams API][web-streams] and in particular `ReadableStream`
6+
* [Web Streams API](web-streams) and in particular `ReadableStream`
77
* [Async iterables][async-iter] using `Symbol.asyncIterator`
88

99
[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

docs/sdk/models/errors/detail.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
# Detail
22

3+
4+
## Supported Types
5+
6+
### `shared.ValidationError[]`
7+
8+
```typescript
9+
const value: shared.ValidationError[] = /* values here */
10+
```
11+
12+
### `string`
13+
14+
```typescript
15+
const value: string = /* values here */
16+
```
17+

docs/sdk/models/shared/loc.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
# Loc
22

3+
4+
## Supported Types
5+
6+
### `string`
7+
8+
```typescript
9+
const value: string = /* values here */
10+
```
11+
12+
### `number`
13+
14+
```typescript
15+
const value: number = /* values here */
16+
```
17+

gen.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ generation:
1010
auth:
1111
oAuth2ClientCredentialsEnabled: false
1212
typescript:
13-
version: 0.11.3
13+
version: 0.12.0
1414
additionalDependencies:
1515
dependencies:
1616
async: ^3.2.5
@@ -38,7 +38,9 @@ typescript:
3838
license: MIT
3939
maxMethodParams: 0
4040
methodArguments: require-security-and-request
41+
moduleFormat: commonjs
4142
outputModelSuffix: output
4243
packageName: unstructured-client
4344
responseFormat: envelope
4445
templateVersion: v2
46+
useIndexModules: 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.11.3",
5+
"version": "0.12.0",
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "unstructured-client",
3-
"version": "0.11.3",
4-
"author": "Unstructured",
3+
"version": "0.12.0",
4+
"author": "Unstructured",
55
"main": "./index.js",
66
"sideEffects": false,
77
"repository": {

src/hooks/hooks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
33
*/
44

5-
import { RequestInput } from "../lib/http";
5+
import { RequestInput } from "../lib/http.js";
66
import {
77
AfterErrorContext,
88
AfterErrorHook,
@@ -15,9 +15,9 @@ import {
1515
Hooks,
1616
SDKInitHook,
1717
SDKInitOptions,
18-
} from "./types";
18+
} from "./types.js";
1919

20-
import { initHooks } from "./registration";
20+
import { initHooks } from "./registration.js";
2121

2222
export class SDKHooks implements Hooks {
2323
sdkInitHooks: SDKInitHook[] = [];

src/hooks/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
33
*/
44

5-
export * from "./types";
6-
export * from "./hooks";
5+
export * from "./types.js";
6+
export * from "./hooks.js";

src/hooks/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
33
*/
44

5-
import { HTTPClient, RequestInput } from "../lib/http";
5+
import { HTTPClient, RequestInput } from "../lib/http.js";
66

77
export type HookContext = {
88
operationID: string;

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
33
*/
44

5-
export * from "./sdk";
6-
export * from "./lib/config";
5+
export * from "./sdk/sdk.js";
6+
export * from "./lib/config.js";

src/lib/config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
33
*/
44

5-
import * as shared from "../sdk/models/shared";
6-
import { HTTPClient } from "./http";
7-
import { RetryConfig } from "./retries";
8-
import { Params, pathToFunc } from "./url";
5+
import * as shared from "../sdk/models/shared/index.js";
6+
import { HTTPClient } from "./http.js";
7+
import { RetryConfig } from "./retries.js";
8+
import { Params, pathToFunc } from "./url.js";
99

1010
/**
1111
* Hosted API Free
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
6161
export const SDK_METADATA = {
6262
language: "typescript",
6363
openapiDocVersion: "1.0.39",
64-
sdkVersion: "0.11.3",
65-
genVersion: "2.342.6",
66-
userAgent: "speakeasy-sdk/typescript 0.11.3 2.342.6 1.0.39 unstructured-client",
64+
sdkVersion: "0.12.0",
65+
genVersion: "2.359.6",
66+
userAgent: "speakeasy-sdk/typescript 0.12.0 2.359.6 1.0.39 unstructured-client",
6767
} as const;

src/lib/encodings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
33
*/
44

5-
import { bytesToBase64 } from "./base64";
6-
import { isPlainObject } from "./is-plain-object";
5+
import { bytesToBase64 } from "./base64.js";
6+
import { isPlainObject } from "./is-plain-object.js";
77

88
export class EncodingError extends Error {
99
constructor(message: string) {

src/lib/http.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*/
44

55
import { never as znever } from "zod";
6-
import { parse } from "./schemas";
7-
import { isPlainObject } from "./is-plain-object";
8-
import * as errors from "../sdk/models/errors";
6+
import { parse } from "./schemas.js";
7+
import { isPlainObject } from "./is-plain-object.js";
8+
import { SDKError } from "../sdk/models/errors/sdkerror.js";
99

1010
export type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
1111

@@ -406,7 +406,7 @@ export class ResponseMatcher<Result> {
406406
}
407407
if (pred == null) {
408408
const responseBody = await response.text();
409-
throw new errors.SDKError(
409+
throw new SDKError(
410410
"Unexpected API response status or content-type",
411411
response,
412412
responseBody
@@ -446,11 +446,7 @@ export class ResponseMatcher<Result> {
446446
const resultKey = pred.key || options?.resultKey;
447447
let data: unknown;
448448
if (pred.fail) {
449-
throw new errors.SDKError(
450-
"API error occurred",
451-
response,
452-
typeof raw === "string" ? raw : ""
453-
);
449+
throw new SDKError("API error occurred", response, typeof raw === "string" ? raw : "");
454450
} else if (pred.err) {
455451
data = {
456452
...options?.extraFields,

src/lib/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import { output, ZodEffects, ZodError, ZodObject, ZodRawShape, ZodTypeAny } from "zod";
6-
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror";
6+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
77

88
/**
99
* Utility function that executes some code which may throw a ZodError. It

src/lib/sdks.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
33
*/
44

5-
import { ResponseMatcher, HTTPClient, matchStatusCode } from "./http";
6-
import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./security";
7-
import { pathToFunc } from "./url";
8-
import { encodeForm } from "./encodings";
9-
import { stringToBase64 } from "./base64";
10-
import { SDKHooks, HookContext } from "../hooks";
5+
import { ResponseMatcher, HTTPClient, matchStatusCode } from "./http.js";
6+
import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./security.js";
7+
import { pathToFunc } from "./url.js";
8+
import { encodeForm } from "./encodings.js";
9+
import { stringToBase64 } from "./base64.js";
10+
import { SDK_METADATA } from "./config.js";
11+
import { SDKHooks } from "../hooks/hooks.js";
12+
import { HookContext } from "../hooks/types.js";
1113

1214
export type RequestOptions = {
1315
fetchOptions?: Omit<RequestInit, "method" | "body">;
@@ -21,8 +23,20 @@ type RequestConfig = {
2123
body?: RequestInit["body"];
2224
headers?: HeadersInit;
2325
security?: SecurityState | null;
26+
uaHeader?: string;
2427
};
2528

29+
const gt: unknown = typeof globalThis === "undefined" ? null : globalThis;
30+
const webWorkerLike =
31+
typeof gt === "object" &&
32+
gt != null &&
33+
"importScripts" in gt &&
34+
typeof gt["importScripts"] === "function";
35+
const isBrowserLike =
36+
webWorkerLike ||
37+
(typeof navigator !== "undefined" && "serviceWorker" in navigator) ||
38+
typeof window === "object";
39+
2640
export class ClientSDK {
2741
private readonly client: HTTPClient;
2842
protected readonly baseURL: URL | null;
@@ -99,6 +113,12 @@ export class ClientSDK {
99113
headers.set(k, v);
100114
}
101115

116+
// Only set user agent header in non-browser-like environments since CORS
117+
// policy disallows setting it in browsers e.g. Chrome throws an error.
118+
if (!isBrowserLike) {
119+
headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
120+
}
121+
102122
const input = this.hooks$.beforeCreateRequest(context, {
103123
url: reqURL,
104124
options: {

src/lib/security.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
33
*/
44

5-
import * as shared from "../sdk/models/shared";
5+
import * as shared from "../sdk/models/shared/index.js";
66

77
export enum SecurityErrorCode {
88
Incomplete = "incomplete",

0 commit comments

Comments
 (0)