Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.438.1
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Nov 12, 2024
1 parent 8d5c9a5 commit cc2277a
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ id: 7a2c976b-8158-4d12-8b59-c491e9e10cfd
management:
docChecksum: 1d3b55136fdbb238cda72c160e9237df
docVersion: 1.0.0
speakeasyVersion: 1.436.0
generationVersion: 2.455.2
releaseVersion: 0.14.5
configChecksum: c1dc563033c46c671493bc644a3c42d3
speakeasyVersion: 1.438.1
generationVersion: 2.457.2
releaseVersion: 0.14.6
configChecksum: e49e643eb64c854257117b42c5fc5dcb
repoURL: https://github.com/ding-live/ding-typescript.git
repoSubDirectory: .
installationURL: https://github.com/ding-live/ding-typescript
Expand Down
8 changes: 4 additions & 4 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
speakeasyVersion: 1.436.0
speakeasyVersion: 1.438.1
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:4ba7787d43166c7f4b5870456862401f988bc30ab329a624b8c580b8c54efb1f
sourceRevisionDigest: sha256:242e8e619169f59b761d58f48e0b8744def631dcabb2fd0c2b934c7ba74971ec
sourceBlobDigest: sha256:cdc65d23f585154d34e19b8e830d032f548ab8a33cfcbd00901a8432e5c93b4d
tags:
- latest
Expand All @@ -11,10 +11,10 @@ targets:
'@ding-live/ding':
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:4ba7787d43166c7f4b5870456862401f988bc30ab329a624b8c580b8c54efb1f
sourceRevisionDigest: sha256:242e8e619169f59b761d58f48e0b8744def631dcabb2fd0c2b934c7ba74971ec
sourceBlobDigest: sha256:cdc65d23f585154d34e19b8e830d032f548ab8a33cfcbd00901a8432e5c93b4d
codeSamplesNamespace: my-source-code-samples
codeSamplesRevisionDigest: sha256:924aa70d12d9d865dfffdda9793bcd7ea86129240fee8e3f502fdf78ca316c1e
codeSamplesRevisionDigest: sha256:a1b639af90ccfd00f240e4311a0a45f064d63ae8a6aca11bb6c657c5f98bae7e
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -656,4 +656,14 @@ Based on:
### Generated
- [typescript v0.14.5] .
### Releases
- [NPM v0.14.5] https://www.npmjs.com/package/@ding-live/ding/v/0.14.5 - .
- [NPM v0.14.5] https://www.npmjs.com/package/@ding-live/ding/v/0.14.5 - .

## 2024-11-12 00:03:19
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.438.1 (2.457.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.14.6] .
### Releases
- [NPM v0.14.6] https://www.npmjs.com/package/@ding-live/ding/v/0.14.6 - .
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 0.14.5
version: 0.14.6
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.14.5",
"version": "0.14.6",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.14.5",
"version": "0.14.6",
"author": "Ding",
"main": "./index.js",
"sideEffects": false,
Expand Down
3 changes: 3 additions & 0 deletions src/funcs/lookupLookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ export async function lookupLookup(
const context = {
operationID: "lookup",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
3 changes: 3 additions & 0 deletions src/funcs/otpCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export async function otpCheck(
const context = {
operationID: "check",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
3 changes: 3 additions & 0 deletions src/funcs/otpCreateAuthentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export async function otpCreateAuthentication(
const context = {
operationID: "create-authentication",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
3 changes: 3 additions & 0 deletions src/funcs/otpFeedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export async function otpFeedback(
const context = {
operationID: "feedback",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
3 changes: 3 additions & 0 deletions src/funcs/otpGetAuthenticationStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export async function otpGetAuthenticationStatus(
const context = {
operationID: "getAuthenticationStatus",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
3 changes: 3 additions & 0 deletions src/funcs/otpRetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export async function otpRetry(
const context = {
operationID: "retry",
oAuth2Scopes: [],

resolvedSecurity: requestSecurity,

securitySource: client._options.apiKey,
retryConfig: options?.retries
|| client._options.retryConfig
Expand Down
2 changes: 2 additions & 0 deletions src/hooks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

import { HTTPClient, RequestInput } from "../lib/http.js";
import { RetryConfig } from "../lib/retries.js";
import { SecurityState } from "../lib/security.js";

export type HookContext = {
operationID: string;
oAuth2Scopes?: string[];
securitySource?: any | (() => Promise<any>);
retryConfig: RetryConfig;
resolvedSecurity: SecurityState | null;
};

export type Awaitable<T> = T | Promise<T>;
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.14.5",
genVersion: "2.455.2",
userAgent: "speakeasy-sdk/typescript 0.14.5 2.455.2 1.0.0 @ding-live/ding",
sdkVersion: "0.14.6",
genVersion: "2.457.2",
userAgent: "speakeasy-sdk/typescript 0.14.6 2.457.2 1.0.0 @ding-live/ding",
} as const;
20 changes: 20 additions & 0 deletions src/lib/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/

class InvariantError extends Error {
constructor(message: string) {
super(message);
this.name = "InvariantError";
}
}

export function invariant(
condition: unknown,
message: string,
): asserts condition {
if (!condition) {
throw new InvariantError(message);
}
}

export type ExactPartial<T> = {
[P in keyof T]?: T[P] | undefined;
};

export type Remap<Inp, Mapping extends { [k in keyof Inp]?: string | null }> = {
[k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */
? Mapping[k]
Expand Down
42 changes: 39 additions & 3 deletions src/lib/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

import * as components from "../models/components/index.js";

type OAuth2PasswordFlow = {
username: string;
password?: string | undefined;
clientID: string;
clientSecret?: string | undefined;
tokenURL: string;
};

export enum SecurityErrorCode {
Incomplete = "incomplete",
UnrecognisedSecurityType = "unrecognized_security_type",
Expand Down Expand Up @@ -37,6 +45,7 @@ export type SecurityState = {
headers: Record<string, string>;
queryParams: Record<string, string>;
cookies: Record<string, string>;
oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" };
};

type SecurityInputBasic = {
Expand Down Expand Up @@ -73,7 +82,18 @@ type SecurityInputOAuth2 = {

type SecurityInputOAuth2ClientCredentials = {
type: "oauth2:client_credentials";
value: string | null | undefined;
value:
| { clientID?: string | undefined; clientSecret?: string | undefined }
| null
| undefined;
};

type SecurityInputOAuth2PasswordCredentials = {
type: "oauth2:password";
value:
| string
| null
| undefined;
fieldName: string;
};

Expand All @@ -89,6 +109,7 @@ export type SecurityInput =
| SecurityInputAPIKey
| SecurityInputOAuth2
| SecurityInputOAuth2ClientCredentials
| SecurityInputOAuth2PasswordCredentials
| SecurityInputOIDC
| SecurityInputCustom;

Expand All @@ -100,6 +121,7 @@ export function resolveSecurity(
headers: {},
queryParams: {},
cookies: {},
oauth2: { type: "none" },
};

const option = options.find((opts) => {
Expand All @@ -110,6 +132,12 @@ export function resolveSecurity(
return o.value.username != null || o.value.password != null;
} else if (o.type === "http:custom") {
return null;
} else if (o.type === "oauth2:password") {
return (
typeof o.value === "string" && !!o.value
);
} else if (o.type === "oauth2:client_credentials") {
return o.value.clientID != null || o.value.clientSecret != null;
} else if (typeof o.value === "string") {
return !!o.value;
} else {
Expand Down Expand Up @@ -152,6 +180,9 @@ export function resolveSecurity(
case "oauth2":
applyBearer(state, spec);
break;
case "oauth2:password":
applyBearer(state, spec);
break;
case "oauth2:client_credentials":
break;
case "openIdConnect":
Expand Down Expand Up @@ -179,9 +210,13 @@ function applyBasic(

function applyBearer(
state: SecurityState,
spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC,
spec:
| SecurityInputBearer
| SecurityInputOAuth2
| SecurityInputOIDC
| SecurityInputOAuth2PasswordCredentials,
) {
if (spec.value == null) {
if (typeof spec.value !== "string" || !spec.value) {
return;
}

Expand All @@ -192,6 +227,7 @@ function applyBearer(

state.headers[spec.fieldName] = value;
}

export function resolveGlobalSecurity(
security: Partial<components.Security> | null | undefined,
): SecurityState | null {
Expand Down

0 comments on commit cc2277a

Please sign in to comment.