Skip to content

Commit

Permalink
Merge pull request #605 from codatio/speakeasy-sdk-regen-1721040961
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate Platform library PLATFORM-LIBRARY
  • Loading branch information
dcoplowe authored Jul 15, 2024
2 parents 04a1961 + 8c424f9 commit 5fd7e6f
Show file tree
Hide file tree
Showing 21 changed files with 844 additions and 1,202 deletions.
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
speakeasyVersion: 1.331.2
speakeasyVersion: 1.335.0
sources:
platform-source:
sourceNamespace: platform-source
sourceRevisionDigest: sha256:14df481219fad245cca40b9bc118b435d81cf76644db91eb6cd141e1ae052504
sourceBlobDigest: sha256:5d647abdc8820166576203f4baf8ce52892bd5e7a527a4d2ddeeb588ec287226
sourceRevisionDigest: sha256:1f88ea09cba05cb945981f0185460998a8c63dbd279d10d572fba8649dec3760
sourceBlobDigest: sha256:8461db5b6c843570b6ff727124765eb954df06da28d53266341141ed64997942
tags:
- latest
- main
targets:
platform-library:
source: platform-source
sourceNamespace: platform-source
sourceRevisionDigest: sha256:14df481219fad245cca40b9bc118b435d81cf76644db91eb6cd141e1ae052504
sourceBlobDigest: sha256:5d647abdc8820166576203f4baf8ce52892bd5e7a527a4d2ddeeb588ec287226
sourceRevisionDigest: sha256:1f88ea09cba05cb945981f0185460998a8c63dbd279d10d572fba8649dec3760
sourceBlobDigest: sha256:8461db5b6c843570b6ff727124765eb954df06da28d53266341141ed64997942
outLocation: ./platform
workflow:
workflowVersion: 1.0.0
Expand Down
9 changes: 5 additions & 4 deletions platform/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ id: 6a970e30-8d0a-42f0-a8ce-621dfe880a1d
management:
docChecksum: ced98ff1180e32d5026f7d960a49babc
docVersion: 3.0.0
speakeasyVersion: 1.331.2
generationVersion: 2.366.1
releaseVersion: 3.0.2
configChecksum: b24049153b9330a7ac090f5c5932bd8b
speakeasyVersion: 1.335.0
generationVersion: 2.370.2
releaseVersion: 3.1.0
configChecksum: 59c10bbb42aaf2478116ff0936eb9226
repoURL: https://github.com/codatio/client-sdk-typescript.git
repoSubDirectory: platform
installationURL: https://gitpkg.now.sh/codatio/client-sdk-typescript/platform
Expand All @@ -16,6 +16,7 @@ features:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.5
core: 3.11.6
defaultEnabledRetries: 0.1.0
deprecations: 2.81.1
examples: 2.81.4
globalSecurity: 2.82.9
Expand Down
10 changes: 9 additions & 1 deletion platform/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,12 @@ Based on:
- OpenAPI Doc
- Speakeasy CLI 1.331.2 (2.366.1) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v3.0.2] ./platform
- [typescript v3.0.2] ./platform

## 2024-07-15 10:55:54
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.335.0 (2.370.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v3.1.0] ./platform
2 changes: 1 addition & 1 deletion platform/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 3.0.2
version: 3.1.0
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
2 changes: 1 addition & 1 deletion platform/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@codat/platform",
"version": "3.0.2",
"version": "3.1.0",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions platform/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 platform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codat/platform",
"version": "3.0.2",
"version": "3.1.0",
"author": "Codat",
"main": "./index.js",
"sideEffects": false,
Expand Down
6 changes: 3 additions & 3 deletions platform/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "3.0.0",
sdkVersion: "3.0.2",
genVersion: "2.366.1",
userAgent: "speakeasy-sdk/typescript 3.0.2 2.366.1 3.0.0 @codat/platform",
sdkVersion: "3.1.0",
genVersion: "2.370.2",
userAgent: "speakeasy-sdk/typescript 3.1.0 2.370.2 3.0.0 @codat/platform",
} as const;
52 changes: 37 additions & 15 deletions platform/src/lib/sdks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { ResponseMatcher, HTTPClient, matchStatusCode } from "./http.js";
import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./security.js";
import { retry, RetryConfig } from "./retries.js";
import { pathToFunc } from "./url.js";
import { encodeForm } from "./encodings.js";
import { stringToBase64 } from "./base64.js";
Expand All @@ -17,6 +18,14 @@ export type RequestOptions = {
* `fetchOptions.signal` is set then it will take precedence over this option.
*/
timeoutMs?: number;
/**
* Set or override a retry policy on HTTP calls.
*/
retries?: RetryConfig;
/**
* Specifies the status codes which should be retried using the given retry policy.
*/
retryCodes?: string[];
/**
* Sets various request options on the `fetch` call made by an SDK method.
*
Expand Down Expand Up @@ -154,27 +163,40 @@ export class ClientSDK {
}

protected async do$(
req: Request,
request: Request,
options: {
context: HookContext;
errorCodes: number | string | (number | string)[];
retryConfig?: RetryConfig | undefined;
retryCodes?: string[] | undefined;
}
): Promise<Response> {
const { context, errorCodes } = options;

let response = await this.client.request(await this.hooks$.beforeRequest(context, req));

if (matchStatusCode(response, errorCodes)) {
const result = await this.hooks$.afterError(context, response, null);
if (result.error) {
throw result.error;
}
response = result.response || response;
} else {
response = await this.hooks$.afterSuccess(context, response);
}

return response;
const retryConfig = options.retryConfig || { strategy: "none" };
const retryCodes = options.retryCodes || [];

return retry(
async () => {
const req = request.clone();

let response = await this.client.request(
await this.hooks$.beforeRequest(context, req)
);

if (matchStatusCode(response, errorCodes)) {
const result = await this.hooks$.afterError(context, response, null);
if (result.error) {
throw result.error;
}
response = result.response || response;
} else {
response = await this.hooks$.afterSuccess(context, response);
}

return response;
},
{ config: retryConfig, statusCodes: retryCodes }
);
}

protected matcher<Result>(): ResponseMatcher<Result> {
Expand Down
Loading

0 comments on commit 5fd7e6f

Please sign in to comment.