Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.378.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Aug 23, 2024
1 parent 981d7bc commit 76e1015
Show file tree
Hide file tree
Showing 25 changed files with 478 additions and 38 deletions.
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
speakeasyVersion: 1.358.0
speakeasyVersion: 1.378.0
sources:
source1:
sourceNamespace: source-1
sourceRevisionDigest: sha256:43b4af33fd10f1d52fac01050c20e2a986c02d1ecee1c8767e2a4401fa11b4ca
sourceBlobDigest: sha256:1a4c3b826ca1582151421c98b2b5afa74709fafdf3e3b6ba5b1f09e53a2856a9
sourceRevisionDigest: sha256:00d024558a05b3efdf72d1e2e3fbe7070c818b431d7f3f054b0418ba11990f53
sourceBlobDigest: sha256:7c35756702030633a8d2ebb1d378d34f883126319b06edcd798ac7bb2fddb189
tags:
- latest
- main
Expand All @@ -23,8 +23,8 @@ targets:
lending:
source: source1
sourceNamespace: source-1
sourceRevisionDigest: sha256:43b4af33fd10f1d52fac01050c20e2a986c02d1ecee1c8767e2a4401fa11b4ca
sourceBlobDigest: sha256:1a4c3b826ca1582151421c98b2b5afa74709fafdf3e3b6ba5b1f09e53a2856a9
sourceRevisionDigest: sha256:00d024558a05b3efdf72d1e2e3fbe7070c818b431d7f3f054b0418ba11990f53
sourceBlobDigest: sha256:7c35756702030633a8d2ebb1d378d34f883126319b06edcd798ac7bb2fddb189
outLocation: lending
workflow:
workflowVersion: 1.0.0
Expand Down
13 changes: 8 additions & 5 deletions lending/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ id: 7caa457a-d738-4713-931d-4e4f19784732
management:
docChecksum: 1bdb7a6f8bf3995d4b40475228403253
docVersion: 1.0.0
speakeasyVersion: 1.358.0
generationVersion: 2.390.6
releaseVersion: 0.2.2
configChecksum: 63917ada50b374c303e582a59f5fc038
speakeasyVersion: 1.378.0
generationVersion: 2.404.3
releaseVersion: 0.3.0
configChecksum: fee200003c4b846aa0f5a286dcd7a2ef
repoURL: https://github.com/ryan-timothy-albert/sample-ts-monorepo.git
repoSubDirectory: lending
installationURL: https://gitpkg.now.sh/ryan-timothy-albert/sample-ts-monorepo/lending
published: true
features:
typescript:
additionalDependencies: 0.1.0
core: 3.12.3
core: 3.14.1
defaultEnabledRetries: 0.1.0
envVarSecurityUsage: 0.1.1
globalSecurityCallbacks: 0.1.0
Expand All @@ -30,6 +30,7 @@ generatedFiles:
- src/sdk/sdk.ts
- .eslintrc.cjs
- .npmignore
- FUNCTIONS.md
- RUNTIMES.md
- jsr.json
- package.json
Expand All @@ -41,6 +42,7 @@ generatedFiles:
- src/lib/encodings.ts
- src/lib/http.ts
- src/lib/is-plain-object.ts
- src/lib/logger.ts
- src/lib/matchers.ts
- src/lib/primitives.ts
- src/lib/retries.ts
Expand All @@ -53,6 +55,7 @@ generatedFiles:
- src/models/errors/sdkerror.ts
- src/models/errors/sdkvalidationerror.ts
- src/types/blobs.ts
- src/types/constdatetime.ts
- src/types/enums.ts
- src/types/fp.ts
- src/types/index.ts
Expand Down
2 changes: 1 addition & 1 deletion lending/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
typescript:
version: 0.2.2
version: 0.3.0
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
102 changes: 102 additions & 0 deletions lending/FUNCTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Standalone Functions

> [!NOTE]
> This section is useful if you are using a bundler and targetting browsers and
> runtimes where the size of an application affects performance and load times.
Every method in this SDK is also available as a standalone function. This
alternative API is suitable when targetting the browser or serverless runtimes
and using a bundler to build your application since all unused functionality
will be tree-shaken away. This includes code for unused methods, Zod schemas,
encoding helpers and response handlers. The result is dramatically smaller
impact on the application's final bundle size which grows very slowly as you use
more and more functionality from this SDK.

Calling methods through the main SDK class remains a valid and generally more
more ergonomic option. Standalone functions represent an optimisation for a
specific category of applications.

## Example

```typescript
import { LendingSDKCore } from "ryan-lending/core.js";
import { petsListPets } from "ryan-lending/funcs/petsListPets.js";
import { SDKValidationError } from "ryan-lending/models/errors/sdkvalidationerror.js";

// Use `LendingSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const lendingSDK = new LendingSDKCore();

async function run() {
const res = await petsListPets(lendingSDK, {});

switch (true) {
case res.ok:
// The success case will be handled outside of the switch block
break;
case res.error instanceof SDKValidationError:
// Pretty-print validation errors.
return console.log(res.error.pretty());
case res.error instanceof Error:
return console.log(res.error);
default:
// TypeScript's type checking will fail on the following line if the above
// cases were not exhaustive.
res.error satisfies never;
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
}


const { value: result } = res;

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

run();
```

## Result types

Standalone functions differ from SDK methods in that they return a
`Result<Value, Error>` type to capture _known errors_ and document them using
the type system. By avoiding throwing errors, application code maintains clear
control flow and error-handling become part of the regular flow of application
code.

> We use the term "known errors" because standalone functions, and JavaScript
> code in general, can still throw unexpected errors such as `TypeError`s,
> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
> something this SDK addresses in the future. Nevertheless, there is still a lot
> of benefit from capturing most errors and turning them into values.
The second reason for this style of programming is because these functions will
typically be used in front-end applications where exception throwing is
sometimes discouraged or considered unidiomatic. React and similar ecosystems
and libraries tend to promote this style of programming so that components
render useful content under all states (loading, success, error and so on).

The general pattern when calling standalone functions looks like this:

```typescript
import { Core } from "<sdk-package-name>";
import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";

const client = new Core();

async function run() {
const result = await fetchSomething(client, { id: "123" });
if (!result.ok) {
// You can throw the error or handle it. It's your choice now.
throw result.error;
}

console.log(result.value);
}

run();
```

Notably, `result.error` above will have an explicit type compared to a try-catch
variation where the error in the catch block can only be of type `unknown` (or
`any` depending on your TypeScript settings).
40 changes: 40 additions & 0 deletions lending/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,46 @@ run();
```
<!-- End Retries [retries] -->

<!-- Start Standalone functions [standalone-funcs] -->
## Standalone functions

All the methods listed above are available as standalone functions. These
functions are ideal for use in applications running in the browser, serverless
runtimes or other environments where application bundle size is a primary
concern. When using a bundler to build your application, all unused
functionality will be either excluded from the final bundle or tree-shaken away.

To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).

<details>

<summary>Available standalone functions</summary>

- [petsCreatePets](docs/sdks/pets/README.md#createpets)
- [petsListPets](docs/sdks/pets/README.md#listpets)
- [petsShowPetById](docs/sdks/pets/README.md#showpetbyid)


</details>
<!-- End Standalone functions [standalone-funcs] -->

<!-- Start Debugging [debug] -->
## Debugging

You can setup your SDK to emit debug logs for SDK requests and responses.

You can pass a logger that matches `console`'s interface as an SDK option.

> [!WARNING]
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
```typescript
import { LendingSDK } from "ryan-lending";

const sdk = new LendingSDK({ debugLogger: console });
```
<!-- End Debugging [debug] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# Development
Expand Down
12 changes: 11 additions & 1 deletion lending/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,14 @@ Based on:
### Generated
- [typescript v0.2.2] lending
### Releases
- [NPM v0.2.2] https://www.npmjs.com/package/ryan-lending/v/0.2.2 - lending
- [NPM v0.2.2] https://www.npmjs.com/package/ryan-lending/v/0.2.2 - lending

## 2024-08-23 16:13:10
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.378.0 (2.404.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.3.0] lending
### Releases
- [NPM v0.3.0] https://www.npmjs.com/package/ryan-lending/v/0.3.0 - lending
10 changes: 10 additions & 0 deletions lending/docs/models/components/errort.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# ErrorT

## Example Usage

```typescript
import { ErrorT } from "ryan-lending/models/components";

let value: ErrorT = {
code: 847252,
message: "<value>",
};
```

## Fields

Expand Down
10 changes: 10 additions & 0 deletions lending/docs/models/components/pet.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Pet

## Example Usage

```typescript
import { Pet } from "ryan-lending/models/components";

let value: Pet = {
id: 544883,
name: "<value>",
};
```

## Fields

Expand Down
7 changes: 7 additions & 0 deletions lending/docs/models/operations/listpetsrequest.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ListPetsRequest

## Example Usage

```typescript
import { ListPetsRequest } from "ryan-lending/models/operations";

let value: ListPetsRequest = {};
```

## Fields

Expand Down
15 changes: 15 additions & 0 deletions lending/docs/models/operations/listpetsresponse.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# ListPetsResponse

## Example Usage

```typescript
import { ListPetsResponse } from "ryan-lending/models/operations";

let value: ListPetsResponse = {
headers: {
key: ["<value>"],
},
result: {
code: 844266,
message: "<value>",
},
};
```

## Fields

Expand Down
10 changes: 10 additions & 0 deletions lending/docs/models/operations/listpetsresponseresult.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# ListPetsResponseResult

## Example Usage

```typescript
import { ListPetsResponseResult } from "ryan-lending/models/operations";

let value: ListPetsResponseResult = {
code: 592845,
message: "<value>",
};
```

## Supported Types

Expand Down
9 changes: 9 additions & 0 deletions lending/docs/models/operations/showpetbyidrequest.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# ShowPetByIdRequest

## Example Usage

```typescript
import { ShowPetByIdRequest } from "ryan-lending/models/operations";

let value: ShowPetByIdRequest = {
petId: "<value>",
};
```

## Fields

Expand Down
10 changes: 10 additions & 0 deletions lending/docs/models/operations/showpetbyidresponse.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# ShowPetByIdResponse

## Example Usage

```typescript
import { ShowPetByIdResponse } from "ryan-lending/models/operations";

let value: ShowPetByIdResponse = {
code: 857946,
message: "<value>",
};
```

## Supported Types

Expand Down
6 changes: 1 addition & 5 deletions lending/docs/sdks/lendingsdk/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# LendingSDK


## Overview

### Available Operations

## Overview
Loading

0 comments on commit 76e1015

Please sign in to comment.