Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.385.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Aug 31, 2024
1 parent f0b4d7e commit 0d3285c
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 31 deletions.
10 changes: 5 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ id: 7a2c976b-8158-4d12-8b59-c491e9e10cfd
management:
docChecksum: c2a5d8222f4117f238343d6187ef2751
docVersion: 1.0.0
speakeasyVersion: 1.376.0
generationVersion: 2.402.5
releaseVersion: 0.7.0
configChecksum: d6b3422ff4861231d3d321c66e7325f8
speakeasyVersion: 1.385.0
generationVersion: 2.407.2
releaseVersion: 0.7.1
configChecksum: 321dd521dce01188af879e495f74ed1f
repoURL: https://github.com/ding-live/ding-typescript.git
repoSubDirectory: .
installationURL: https://github.com/ding-live/ding-typescript
published: true
features:
typescript:
additionalDependencies: 0.1.0
core: 3.14.1
core: 3.14.2
defaultEnabledRetries: 0.1.0
envVarSecurityUsage: 0.1.1
examples: 2.81.4
Expand Down
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,33 @@

The Ding Typescript library provides convenient access to the Ding API from applications written in JS or TS.

<!-- Start Summary [summary] -->
## Summary

Ding: The OTP API allows you to send authentication codes to your users using their phone numbers.
<!-- End Summary [summary] -->

<!-- Start Table of Contents [toc] -->
## Table of Contents

* [SDK Installation](#sdk-installation)
* [Requirements](#requirements)
* [SDK Example Usage](#sdk-example-usage)
* [Available Resources and Operations](#available-resources-and-operations)
* [Standalone functions](#standalone-functions)
* [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 SDK Installation [installation] -->
## SDK Installation

The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.

### NPM

```bash
Expand Down Expand Up @@ -143,7 +167,7 @@ Validation errors can also occur when either method arguments or data returned f

```typescript
import { Ding } from "@ding-live/ding";
import { SDKValidationError } from "@ding-live/ding/models/errors";
import { ErrorResponse, SDKValidationError } from "@ding-live/ding/models/errors";

const ding = new Ding({
apiKey: "YOUR_API_KEY",
Expand All @@ -166,8 +190,9 @@ async function run() {
console.error(err.rawValue);
return;
}
case err instanceof errors.ErrorResponse: {
console.error(err); // handle exception
case err instanceof ErrorResponse: {
// Handle err.data$: ErrorResponseData
console.error(err);
return;
}
default: {
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,4 +386,14 @@ Based on:
### Generated
- [typescript v0.7.0] .
### Releases
- [NPM v0.7.0] https://www.npmjs.com/package/@ding-live/ding/v/0.7.0 - .
- [NPM v0.7.0] https://www.npmjs.com/package/@ding-live/ding/v/0.7.0 - .

## 2024-08-31 00:03:10
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.385.0 (2.407.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.7.1] .
### Releases
- [NPM v0.7.1] https://www.npmjs.com/package/@ding-live/ding/v/0.7.1 - .
6 changes: 1 addition & 5 deletions docs/sdks/ding/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Ding SDK


## Overview

Ding: The OTP API allows you to send authentication codes to your users using their phone numbers.

### Available Operations

Ding: The OTP API allows you to send authentication codes to your users using their phone numbers.
3 changes: 1 addition & 2 deletions docs/sdks/lookup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ async function run() {
run();
```


### Standalone function

The standalone function version of this method:
Expand Down Expand Up @@ -73,10 +72,10 @@ run();
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response

**Promise\<[components.LookupResponse](../../models/components/lookupresponse.md)\>**

### Errors

| Error Object | Status Code | Content Type |
Expand Down
15 changes: 7 additions & 8 deletions docs/sdks/otp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ async function run() {
run();
```


### Standalone function

The standalone function version of this method:
Expand Down Expand Up @@ -83,17 +82,18 @@ run();
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response

**Promise\<[components.CreateCheckResponse](../../models/components/createcheckresponse.md)\>**

### Errors

| Error Object | Status Code | Content Type |
| -------------------- | -------------------- | -------------------- |
| errors.ErrorResponse | 400 | application/json |
| errors.SDKError | 4xx-5xx | */* |


## createAuthentication

Send a code
Expand All @@ -120,7 +120,6 @@ async function run() {
run();
```


### Standalone function

The standalone function version of this method:
Expand Down Expand Up @@ -163,17 +162,18 @@ run();
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response

**Promise\<[components.CreateAuthenticationResponse](../../models/components/createauthenticationresponse.md)\>**

### Errors

| Error Object | Status Code | Content Type |
| -------------------- | -------------------- | -------------------- |
| errors.ErrorResponse | 400 | application/json |
| errors.SDKError | 4xx-5xx | */* |


## feedback

Send feedback
Expand Down Expand Up @@ -201,7 +201,6 @@ async function run() {
run();
```


### Standalone function

The standalone function version of this method:
Expand Down Expand Up @@ -245,16 +244,17 @@ run();
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response

**Promise\<[operations.FeedbackResponse](../../models/operations/feedbackresponse.md)\>**

### Errors

| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |


## retry

Perform a retry
Expand All @@ -278,7 +278,6 @@ async function run() {
run();
```


### Standalone function

The standalone function version of this method:
Expand Down Expand Up @@ -318,10 +317,10 @@ run();
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |


### Response

**Promise\<[components.RetryAuthenticationResponse](../../models/components/retryauthenticationresponse.md)\>**

### Errors

| Error Object | Status Code | Content Type |
Expand Down
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 0.7.0
version: 0.7.1
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@ding-live/ding",
"version": "0.7.0",
"version": "0.7.1",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ding-live/ding",
"version": "0.7.0",
"version": "0.7.1",
"author": "Ding",
"main": "./index.js",
"sideEffects": false,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "0.7.0",
genVersion: "2.402.5",
userAgent: "speakeasy-sdk/typescript 0.7.0 2.402.5 1.0.0 @ding-live/ding",
sdkVersion: "0.7.1",
genVersion: "2.407.2",
userAgent: "speakeasy-sdk/typescript 0.7.1 2.407.2 1.0.0 @ding-live/ding",
} as const;
13 changes: 12 additions & 1 deletion src/lib/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,20 @@ type SecurityInputOAuth2ClientCredentials = {
fieldName: string;
};

type SecurityInputCustom = {
type: "http:custom";
value: any | null | undefined;
fieldName: string;
};

export type SecurityInput =
| SecurityInputBasic
| SecurityInputBearer
| SecurityInputAPIKey
| SecurityInputOAuth2
| SecurityInputOAuth2ClientCredentials
| SecurityInputOIDC;
| SecurityInputOIDC
| SecurityInputCustom;

export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null {
const state: SecurityState = {
Expand All @@ -93,6 +100,8 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState |
return false;
} else if (o.type === "http:basic") {
return o.value.username != null || o.value.password != null;
} else if (o.type === "http:custom") {
return null;
} else if (typeof o.value === "string") {
return !!o.value;
} else {
Expand Down Expand Up @@ -126,6 +135,8 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState |
case "http:basic":
applyBasic(state, spec);
break;
case "http:custom":
break;
case "http:bearer":
applyBearer(state, spec);
break;
Expand Down

0 comments on commit 0d3285c

Please sign in to comment.