Skip to content

Commit

Permalink
Merge pull request #40 from hathora/speakeasy-sdk-regen-1721355528
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate 2.5.1
  • Loading branch information
gwprice115 authored Jul 24, 2024
2 parents 4aa4eb3 + c03f660 commit ab0f81c
Show file tree
Hide file tree
Showing 18 changed files with 344 additions and 1,500 deletions.
1,702 changes: 257 additions & 1,445 deletions .speakeasy/codeSamples.yaml

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
lockVersion: 2.0.0
id: 1b06df09-5141-4b14-b0b7-5415dbf16cfb
management:
docChecksum: aab9fbbed986e8a2acaae5f2f1efe3f9
docChecksum: 9a202a3dffb804a6396c0137bce9b822
docVersion: 0.0.1
speakeasyVersion: 1.337.1
generationVersion: 2.373.2
releaseVersion: 2.5.0
configChecksum: afcb732e0198a14e8dc095f4c5604f66
speakeasyVersion: 1.345.4
generationVersion: 2.378.3
releaseVersion: 2.5.1
configChecksum: 93ad0df54fed52ace24d75b9cca3da90
repoURL: https://github.com/hathora/cloud-sdk-typescript.git
installationURL: https://github.com/hathora/cloud-sdk-typescript
published: true
features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.5
core: 3.11.7
core: 3.11.9
defaultEnabledRetries: 0.1.0
deprecations: 2.81.1
downloadStreams: 0.1.1
Expand All @@ -31,7 +31,7 @@ features:
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.1.0
unions: 2.85.5
unions: 2.85.6
generatedFiles:
- src/sdk/appsv1.ts
- src/sdk/authv1.ts
Expand Down
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.337.1
speakeasyVersion: 1.345.4
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:6f05e45136b9d440fed3278a6e5ee2c9240307e0f3098cbe98bf7cbda4dcf829
sourceBlobDigest: sha256:2e7168b386b1b5d4bf6a2d6b4022095c8a7c6a8228fb734ce2f38fd6704363d0
sourceRevisionDigest: sha256:dbde55f9b77b7952fb8b1d491fbd428c231122deb0fc282fa01308deae2e240a
sourceBlobDigest: sha256:2fa5ced81a7d0b7782bdf710269d1c07cd00397e7628cb49e289e5fe22e9be38
tags:
- latest
- main
targets:
hathora-typescript:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:6f05e45136b9d440fed3278a6e5ee2c9240307e0f3098cbe98bf7cbda4dcf829
sourceBlobDigest: sha256:2e7168b386b1b5d4bf6a2d6b4022095c8a7c6a8228fb734ce2f38fd6704363d0
sourceRevisionDigest: sha256:dbde55f9b77b7952fb8b1d491fbd428c231122deb0fc282fa01308deae2e240a
sourceBlobDigest: sha256:2fa5ced81a7d0b7782bdf710269d1c07cd00397e7628cb49e289e5fe22e9be38
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,4 +550,14 @@ Based on:
### Generated
- [typescript v2.5.0] .
### Releases
- [NPM v2.5.0] https://www.npmjs.com/package/@hathora/cloud-sdk-typescript/v/2.5.0 - .
- [NPM v2.5.0] https://www.npmjs.com/package/@hathora/cloud-sdk-typescript/v/2.5.0 - .

## 2024-07-24 00:14:03
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.345.4 (2.378.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v2.5.1] .
### Releases
- [NPM v2.5.1] https://www.npmjs.com/package/@hathora/cloud-sdk-typescript/v/2.5.1 - .
2 changes: 1 addition & 1 deletion docs/models/components/orgmember.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `lastLogin` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | |
| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | |
| `joinedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | |
| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | |
| `invitedBy` | *string* | :heavy_check_mark: | N/A | [email protected] |
| `userEmail` | *string* | :heavy_check_mark: | A user's email. | [email protected] |
Expand Down
2 changes: 1 addition & 1 deletion docs/models/operations/runbuildrequestbody.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [operations.RunBuildFile](../../models/operations/runbuildfile.md) | :heavy_check_mark: | N/A |
| `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [operations.RunBuildFile](../../models/operations/runbuildfile.md) | :heavy_minus_sign: | N/A |
5 changes: 1 addition & 4 deletions docs/sdks/buildsv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,14 @@ Builds a game server artifact from a tarball you provide. Pass in the `buildId`

```typescript
import { HathoraCloud } from "@hathora/cloud-sdk-typescript";
import { openAsBlob } from "node:fs";

const hathoraCloud = new HathoraCloud({
hathoraDevToken: "<YOUR_BEARER_TOKEN_HERE>",
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
});

async function run() {
const result = await hathoraCloud.buildsV2.runBuild(1, {
file: await openAsBlob("./sample-file"),
}, "app-af469a92-5b45-4565-b3c4-b79878de67d2");
const result = await hathoraCloud.buildsV2.runBuild(1, {}, "app-af469a92-5b45-4565-b3c4-b79878de67d2");

// Handle the result
console.log(result)
Expand Down
8 changes: 4 additions & 4 deletions docs/sdks/organizationsv1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ run();
**Promise\<void\>**
### Errors

| Error Object | Status Code | Content Type |
| ---------------- | ---------------- | ---------------- |
| errors.ApiError | 401,404,429,500 | application/json |
| errors.SDKError | 4xx-5xx | */* |
| Error Object | Status Code | Content Type |
| ------------------- | ------------------- | ------------------- |
| errors.ApiError | 401,404,422,429,500 | application/json |
| errors.SDKError | 4xx-5xx | */* |

## getOrgPendingInvites

Expand Down
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ management:
generationVersion: 2.188.3
speakeasyVersion: 1.120.0
typescript:
version: 2.5.0
version: 2.5.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": "@hathora/cloud-sdk-typescript",
"version": "2.5.0",
"version": "2.5.1",
"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": "@hathora/cloud-sdk-typescript",
"version": "2.5.0",
"version": "2.5.1",
"author": "Hathora",
"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 @@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "0.0.1",
sdkVersion: "2.5.0",
genVersion: "2.373.2",
userAgent: "speakeasy-sdk/typescript 2.5.0 2.373.2 0.0.1 @hathora/cloud-sdk-typescript",
sdkVersion: "2.5.1",
genVersion: "2.378.3",
userAgent: "speakeasy-sdk/typescript 2.5.1 2.378.3 0.0.1 @hathora/cloud-sdk-typescript",
} as const;
30 changes: 24 additions & 6 deletions src/lib/encodings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,32 @@ export function encodeDeepObject(
return "";
}

if (!isPlainObject(value)) {
throw new EncodingError(
`Value of parameter '${key}' which uses deepObject encoding must be an object`,
);
}

return encodeDeepObjectObject(key, value, options);
}

export function encodeDeepObjectObject(
key: string,
value: unknown,
options?: { charEncoding?: "percent" | "none" },
): string {
if (value == null) {
return "";
}

let out = "";

const encodeString = (v: string) => {
return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
};

if (!isPlainObject(value)) {
throw new EncodingError(
`Value of parameter '${key}' which uses deepObject encoding must be an object`,
);
throw new EncodingError(`Expected parameter '${key}' to be an object.`);
}

Object.entries(value).forEach(([ck, cv]) => {
Expand All @@ -232,9 +248,11 @@ export function encodeDeepObject(
const pk = `${key}[${ck}]`;

if (isPlainObject(cv)) {
throw new EncodingError(
`Value of parameter field '${pk}' cannot be an array or object.`,
);
const objOut = encodeDeepObjectObject(pk, cv, options);

out += `&${objOut}`;

return;
}

const pairs: unknown[] = Array.isArray(cv) ? cv : [cv];
Expand Down
8 changes: 4 additions & 4 deletions src/models/components/orgmember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as z from "zod";

export type OrgMember = {
lastLogin?: Date | undefined;
updatedAt: Date;
joinedAt: Date;
createdAt: Date;
invitedBy: string;
/**
Expand All @@ -26,7 +26,7 @@ export const OrgMember$inboundSchema: z.ZodType<OrgMember, z.ZodTypeDef, unknown
.datetime({ offset: true })
.transform((v) => new Date(v))
.optional(),
updatedAt: z
joinedAt: z
.string()
.datetime({ offset: true })
.transform((v) => new Date(v)),
Expand All @@ -42,7 +42,7 @@ export const OrgMember$inboundSchema: z.ZodType<OrgMember, z.ZodTypeDef, unknown
/** @internal */
export type OrgMember$Outbound = {
lastLogin?: string | undefined;
updatedAt: string;
joinedAt: string;
createdAt: string;
invitedBy: string;
userEmail: string;
Expand All @@ -56,7 +56,7 @@ export const OrgMember$outboundSchema: z.ZodType<OrgMember$Outbound, z.ZodTypeDe
.date()
.transform((v) => v.toISOString())
.optional(),
updatedAt: z.date().transform((v) => v.toISOString()),
joinedAt: z.date().transform((v) => v.toISOString()),
createdAt: z.date().transform((v) => v.toISOString()),
invitedBy: z.string(),
userEmail: z.string(),
Expand Down
11 changes: 7 additions & 4 deletions src/models/operations/runbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type RunBuildFile = {
};

export type RunBuildRequestBody = {
file: RunBuildFile | Blob;
file?: RunBuildFile | Blob | undefined;
};

export type RunBuildRequest = {
Expand Down Expand Up @@ -100,12 +100,12 @@ export const RunBuildRequestBody$inboundSchema: z.ZodType<
z.ZodTypeDef,
unknown
> = z.object({
file: z.lazy(() => RunBuildFile$inboundSchema),
file: z.lazy(() => RunBuildFile$inboundSchema).optional(),
});

/** @internal */
export type RunBuildRequestBody$Outbound = {
file: RunBuildFile$Outbound | Blob;
file?: RunBuildFile$Outbound | Blob | undefined;
};

/** @internal */
Expand All @@ -114,7 +114,10 @@ export const RunBuildRequestBody$outboundSchema: z.ZodType<
z.ZodTypeDef,
RunBuildRequestBody
> = z.object({
file: z.lazy(() => RunBuildFile$outboundSchema).or(blobLikeSchema),
file: z
.lazy(() => RunBuildFile$outboundSchema)
.or(blobLikeSchema)
.optional(),
});

/**
Expand Down
20 changes: 12 additions & 8 deletions src/sdk/buildsv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,18 @@ export class BuildsV2 extends ClientSDK {
);
const body$ = new FormData();

if (isBlobLike(payload$.RequestBody.file)) {
body$.append("file", payload$.RequestBody.file);
} else {
body$.append(
"file",
new Blob([payload$.RequestBody.file.content], { type: "application/octet-stream" }),
payload$.RequestBody.file.fileName
);
if (payload$.RequestBody.file !== undefined) {
if (isBlobLike(payload$.RequestBody.file)) {
body$.append("file", payload$.RequestBody.file);
} else {
body$.append(
"file",
new Blob([payload$.RequestBody.file.content], {
type: "application/octet-stream",
}),
payload$.RequestBody.file.fileName
);
}
}

const pathParams$ = {
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/organizationsv1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export class OrganizationsV1 extends ClientSDK {

const response = await this.do$(request$, {
context,
errorCodes: ["401", "404", "429", "4XX", "500", "5XX"],
errorCodes: ["401", "404", "422", "429", "4XX", "500", "5XX"],
retryConfig: options?.retries || this.options$.retryConfig,
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
});
Expand All @@ -392,7 +392,7 @@ export class OrganizationsV1 extends ClientSDK {

const [result$] = await this.matcher<void>()
.void(204, z.void())
.json([401, 404, 429, 500], errors.ApiError$inboundSchema, { err: true })
.json([401, 404, 422, 429, 500], errors.ApiError$inboundSchema, { err: true })
.fail(["4XX", "5XX"])
.match(response, { extraFields: responseFields$ });

Expand Down

0 comments on commit ab0f81c

Please sign in to comment.