Skip to content

Commit 79e7716

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.390.2
1 parent ce4fdde commit 79e7716

File tree

121 files changed

+3001
-1420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+3001
-1420
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/funcs
2+
/core.*
13
/esm
24
/dist
35
/.tshy

.speakeasy/gen.lock

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 906577a1-c369-4ae0-9074-3e1b5123889d
33
management:
44
docChecksum: 936f0ff0f6ac9e56df38e51b2591854f
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.345.1
7-
generationVersion: 2.378.1
8-
releaseVersion: 3.0.0-alpha.3
9-
configChecksum: cebc642ac2f745eea63dbe6ff7652744
6+
speakeasyVersion: 1.390.2
7+
generationVersion: 2.409.0
8+
releaseVersion: 3.0.0-alpha.4
9+
configChecksum: 6dade758c80b0089295c521f395a6935
1010
repoURL: https://github.com/speakeasy-sdks/bar-typescript.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/speakeasy-sdks/bar-typescript
@@ -15,22 +15,29 @@ features:
1515
typescript:
1616
additionalDependencies: 0.1.0
1717
callbacks: 1.0.0
18-
core: 3.11.8
18+
core: 3.16.0
1919
defaultEnabledRetries: 0.1.0
20-
errors: 2.81.12
20+
envVarSecurityUsage: 0.1.1
21+
errors: 2.82.2
2122
examples: 2.81.4
2223
flattening: 2.81.1
23-
globalSecurity: 2.82.9
24+
globalSecurity: 2.82.11
2425
globalSecurityCallbacks: 0.1.0
2526
globalServerURLs: 2.82.4
2627
inputOutputModels: 2.82.0
27-
oauth2ClientCredentials: 0.1.4
28+
oauth2ClientCredentials: 0.2.0
2829
responseFormat: 0.2.3
2930
retries: 2.83.0
3031
sdkHooks: 0.1.0
3132
serverIDs: 2.81.2
3233
webhooks: 1.0.0
3334
generatedFiles:
35+
- src/funcs/authenticationAuthenticate.ts
36+
- src/funcs/drinksGetDrink.ts
37+
- src/funcs/drinksListDrinks.ts
38+
- src/funcs/ingredientsListIngredients.ts
39+
- src/funcs/ordersCreateOrder.ts
40+
- src/funcs/configSubscribeToWebhooks.ts
3441
- src/sdk/authentication.ts
3542
- src/sdk/drinks.ts
3643
- src/sdk/ingredients.ts
@@ -39,29 +46,39 @@ generatedFiles:
3946
- src/sdk/sdk.ts
4047
- .eslintrc.cjs
4148
- .npmignore
49+
- FUNCTIONS.md
4250
- RUNTIMES.md
4351
- jsr.json
4452
- package.json
53+
- src/core.ts
4554
- src/index.ts
4655
- src/lib/base64.ts
4756
- src/lib/config.ts
57+
- src/lib/dlv.ts
4858
- src/lib/encodings.ts
59+
- src/lib/files.ts
4960
- src/lib/http.ts
5061
- src/lib/is-plain-object.ts
62+
- src/lib/logger.ts
63+
- src/lib/matchers.ts
5164
- src/lib/primitives.ts
5265
- src/lib/retries.ts
5366
- src/lib/schemas.ts
5467
- src/lib/sdks.ts
5568
- src/lib/security.ts
5669
- src/lib/url.ts
5770
- src/sdk/index.ts
71+
- src/sdk/models/errors/httpclienterrors.ts
5872
- src/sdk/models/errors/sdkerror.ts
5973
- src/sdk/models/errors/sdkvalidationerror.ts
6074
- src/sdk/types/blobs.ts
75+
- src/sdk/types/constdatetime.ts
6176
- src/sdk/types/enums.ts
77+
- src/sdk/types/fp.ts
6278
- src/sdk/types/index.ts
6379
- src/sdk/types/operations.ts
6480
- src/sdk/types/rfcdate.ts
81+
- src/sdk/types/streams.ts
6582
- tsconfig.json
6683
- src/sdk/models/operations/authenticate.ts
6784
- src/sdk/models/operations/getdrink.ts
@@ -110,12 +127,10 @@ generatedFiles:
110127
- docs/sdk/models/shared/status.md
111128
- docs/sdk/models/shared/order.md
112129
- docs/sdk/models/shared/ordertype.md
113-
- docs/sdk/models/shared/orderinput.md
114130
- docs/sdk/models/shared/security.md
115131
- docs/sdk/models/shared/schemeclientcredentials.md
116132
- docs/sdk/models/shared/ingredient.md
117133
- docs/sdk/models/shared/ingredienttype.md
118-
- docs/sdk/models/shared/drinkinput.md
119134
- docs/sdk/models/errors/apierror.md
120135
- docs/sdk/models/callbacks/createorderorderupdateresponse.md
121136
- docs/sdk/models/callbacks/createorderorderupdaterequestbody.md

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ generation:
1010
auth:
1111
oAuth2ClientCredentialsEnabled: true
1212
typescript:
13-
version: 3.0.0-alpha.3
13+
version: 3.0.0-alpha.4
1414
additionalDependencies:
1515
dependencies: {}
1616
devDependencies: {}

.speakeasy/workflow.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
speakeasyVersion: 1.345.1
1+
speakeasyVersion: 1.390.2
22
sources:
33
bar-api:
44
sourceNamespace: bar-api
5-
sourceRevisionDigest: sha256:c0f425f6e60dd28c12f8bc8b1afe6a571208e4134a68cb18e81d22d36f08c141
5+
sourceRevisionDigest: sha256:4c6416e76a74c28ffc1e8b232db51bc8f97b856f43e92fdc4ea1b02819c2f87a
66
sourceBlobDigest: sha256:2b4f4ee668d9bf6ba862927bef3aeabcdb101f163915ec8a1736b274d3152a5f
77
tags:
88
- latest
@@ -11,10 +11,10 @@ targets:
1111
bar-typescript:
1212
source: bar-api
1313
sourceNamespace: bar-api
14-
sourceRevisionDigest: sha256:c0f425f6e60dd28c12f8bc8b1afe6a571208e4134a68cb18e81d22d36f08c141
14+
sourceRevisionDigest: sha256:4c6416e76a74c28ffc1e8b232db51bc8f97b856f43e92fdc4ea1b02819c2f87a
1515
sourceBlobDigest: sha256:2b4f4ee668d9bf6ba862927bef3aeabcdb101f163915ec8a1736b274d3152a5f
1616
codeSamplesNamespace: code-samples-typescript-bar-typescript
17-
codeSamplesRevisionDigest: sha256:eead1e63d1101fa618f1e0ccf7726f3d8c2231a72b9c35d7d19d68dc034456d0
17+
codeSamplesRevisionDigest: sha256:b47c99f1d5ca3c8f0d44477b5ba55c2064cf073e568e83cdd80563f768624b8e
1818
outLocation: /github/workspace/repo
1919
workflow:
2020
workflowVersion: 1.0.0

FUNCTIONS.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Standalone Functions
2+
3+
> [!NOTE]
4+
> This section is useful if you are using a bundler and targetting browsers and
5+
> runtimes where the size of an application affects performance and load times.
6+
7+
Every method in this SDK is also available as a standalone function. This
8+
alternative API is suitable when targetting the browser or serverless runtimes
9+
and using a bundler to build your application since all unused functionality
10+
will be tree-shaken away. This includes code for unused methods, Zod schemas,
11+
encoding helpers and response handlers. The result is dramatically smaller
12+
impact on the application's final bundle size which grows very slowly as you use
13+
more and more functionality from this SDK.
14+
15+
Calling methods through the main SDK class remains a valid and generally more
16+
more ergonomic option. Standalone functions represent an optimisation for a
17+
specific category of applications.
18+
19+
## Example
20+
21+
```typescript
22+
import { BarSDKCore } from "@speakeasy-sdks/speakeasy-bar/core.js";
23+
import { drinksListDrinks } from "@speakeasy-sdks/speakeasy-bar/funcs/drinksListDrinks.js";
24+
import { SDKValidationError } from "@speakeasy-sdks/speakeasy-bar/sdk/models/errors/sdkvalidationerror.js";
25+
26+
// Use `BarSDKCore` for best tree-shaking performance.
27+
// You can create one instance of it to use across an application.
28+
const barSDK = new BarSDKCore({
29+
security: {
30+
apiKey: "<YOUR_API_KEY_HERE>",
31+
},
32+
});
33+
34+
async function run() {
35+
const res = await drinksListDrinks(barSDK);
36+
37+
switch (true) {
38+
case res.ok:
39+
// The success case will be handled outside of the switch block
40+
break;
41+
case res.error instanceof SDKValidationError:
42+
// Pretty-print validation errors.
43+
return console.log(res.error.pretty());
44+
case res.error instanceof Error:
45+
return console.log(res.error);
46+
default:
47+
// TypeScript's type checking will fail on the following line if the above
48+
// cases were not exhaustive.
49+
res.error satisfies never;
50+
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
51+
}
52+
53+
54+
const { value: result } = res;
55+
56+
// Handle the result
57+
console.log(result)
58+
}
59+
60+
run();
61+
```
62+
63+
## Result types
64+
65+
Standalone functions differ from SDK methods in that they return a
66+
`Result<Value, Error>` type to capture _known errors_ and document them using
67+
the type system. By avoiding throwing errors, application code maintains clear
68+
control flow and error-handling become part of the regular flow of application
69+
code.
70+
71+
> We use the term "known errors" because standalone functions, and JavaScript
72+
> code in general, can still throw unexpected errors such as `TypeError`s,
73+
> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
74+
> something this SDK addresses in the future. Nevertheless, there is still a lot
75+
> of benefit from capturing most errors and turning them into values.
76+
77+
The second reason for this style of programming is because these functions will
78+
typically be used in front-end applications where exception throwing is
79+
sometimes discouraged or considered unidiomatic. React and similar ecosystems
80+
and libraries tend to promote this style of programming so that components
81+
render useful content under all states (loading, success, error and so on).
82+
83+
The general pattern when calling standalone functions looks like this:
84+
85+
```typescript
86+
import { Core } from "<sdk-package-name>";
87+
import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
88+
89+
const client = new Core();
90+
91+
async function run() {
92+
const result = await fetchSomething(client, { id: "123" });
93+
if (!result.ok) {
94+
// You can throw the error or handle it. It's your choice now.
95+
throw result.error;
96+
}
97+
98+
console.log(result.value);
99+
}
100+
101+
run();
102+
```
103+
104+
Notably, `result.error` above will have an explicit type compared to a try-catch
105+
variation where the error in the catch block can only be of type `unknown` (or
106+
`any` depending on your TypeScript settings).

0 commit comments

Comments
 (0)