Skip to content

Commit

Permalink
Merge pull request #14 from Codehagen/speakeasy-sdk-regen-1718150699
Browse files Browse the repository at this point in the history
  • Loading branch information
Codehagen committed Jun 12, 2024
2 parents c004b7f + 9902e0a commit e8a5269
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ id: 6250b250-1f28-403b-a1c6-452ade2211c7
management:
docChecksum: 277eb484dd0b1cc1e11e50240c91e379
docVersion: 1.0.0
speakeasyVersion: 1.300.0
generationVersion: 2.338.14
releaseVersion: 0.1.16
configChecksum: 6550b1a1d05e865dc32f8fa00eaa62e0
speakeasyVersion: 1.305.0
generationVersion: 2.340.3
releaseVersion: 0.1.17
configChecksum: c83c953da9e55f845100b95278227408
repoURL: https://github.com/Codehagen/dingify-sdk.git
installationURL: https://github.com/Codehagen/dingify-sdk
published: true
features:
typescript:
additionalDependencies: 0.1.0
core: 3.9.12
core: 3.9.13
globalSecurity: 2.82.9
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 0.1.16
version: 0.1.17
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
6 changes: 3 additions & 3 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
speakeasyVersion: 1.300.0
speakeasyVersion: 1.305.0
sources:
sample-source:
sourceNamespace: sample-source
sourceRevisionDigest: sha256:8ec93a27d72b5be37988df1a21934323640a0b424d346ad469df09447941047e
sourceRevisionDigest: sha256:5a43107f609c305119beb2a0b58525fd013ea8b233753afba52306dccad21875
sourceBlobDigest: sha256:cbed9d93c9141a3cb32d5922de1f7db6c4afbe92ac04620db41dea7ea4abf063
tags:
- latest
Expand All @@ -11,7 +11,7 @@ targets:
my-first-target:
source: sample-source
sourceNamespace: sample-source
sourceRevisionDigest: sha256:8ec93a27d72b5be37988df1a21934323640a0b424d346ad469df09447941047e
sourceRevisionDigest: sha256:5a43107f609c305119beb2a0b58525fd013ea8b233753afba52306dccad21875
sourceBlobDigest: sha256:cbed9d93c9141a3cb32d5922de1f7db6c4afbe92ac04620db41dea7ea4abf063
outLocation: /github/workspace/repo
workflow:
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,14 @@ Based on:
### Generated
- [typescript v0.1.16] .
### Releases
- [NPM v0.1.16] https://www.npmjs.com/package/dingify/v/0.1.16 - .
- [NPM v0.1.16] https://www.npmjs.com/package/dingify/v/0.1.16 - .

## 2024-06-12 00:04:56
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.305.0 (2.340.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.1.17] .
### Releases
- [NPM v0.1.17] https://www.npmjs.com/package/dingify/v/0.1.17 - .
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": "dingify",
"version": "0.1.16",
"version": "0.1.17",
"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": "dingify",
"version": "0.1.16",
"version": "0.1.17",
"author": "Speakeasy",
"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 @@ -54,7 +54,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "0.1.16",
genVersion: "2.338.14",
userAgent: "speakeasy-sdk/typescript 0.1.16 2.338.14 1.0.0 dingify",
sdkVersion: "0.1.17",
genVersion: "2.340.3",
userAgent: "speakeasy-sdk/typescript 0.1.17 2.340.3 1.0.0 dingify",
} as const;
46 changes: 46 additions & 0 deletions src/lib/encodings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,49 @@ function mapDefinedEntries<K, V, R>(

return acc;
}

export function queryJoin(...args: string[]): string {
return args.filter(Boolean).join("&");
}

type QueryEncoderOptions = {
explode?: boolean;
charEncoding?: "percent" | "none";
};

type QueryEncoder = (
key: string,
value: unknown,
options?: QueryEncoderOptions,
) => string;

type BulkQueryEncoder = (
values: Record<string, unknown>,
options?: QueryEncoderOptions,
) => string;

export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
const bulkEncode = function (
values: Record<string, unknown>,
options?: QueryEncoderOptions,
): string {
const opts: QueryEncoderOptions = {
...options,
explode: options?.explode ?? true,
charEncoding: options?.charEncoding ?? "percent",
};

const encoded = Object.entries(values).map(([key, value]) => {
return f(key, value, opts);
});
return queryJoin(...encoded);
};

return bulkEncode;
}

export const encodeJSONQuery = queryEncoder(encodeJSON);
export const encodeFormQuery = queryEncoder(encodeForm);
export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
4 changes: 2 additions & 2 deletions src/sdk/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { SDKHooks } from "../hooks";
import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config";
import * as enc$ from "../lib/encodings";
import { encodeJSON as encodeJSON$ } from "../lib/encodings";
import { HTTPClient } from "../lib/http";
import * as schemas$ from "../lib/schemas";
import { ClientSDK, RequestOptions } from "../lib/sdks";
Expand Down Expand Up @@ -60,7 +60,7 @@ export class Events extends ClientSDK {
"Input validation failed"
);
const body$ =
payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true });

const path$ = this.templateURLComponent("/events")();

Expand Down

0 comments on commit e8a5269

Please sign in to comment.