Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 4c6872c

Browse files
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.260.6 (#47)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent 2977443 commit 4c6872c

File tree

19 files changed

+95
-47
lines changed

19 files changed

+95
-47
lines changed

.speakeasy/gen.lock

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ id: 2f8b2839-3001-46b4-b5e0-cec0aad583ed
33
management:
44
docChecksum: 2401c7030f847f72ab31c8f75de58a66
55
docVersion: 0.2.0
6-
speakeasyVersion: 1.257.1
7-
generationVersion: 2.308.2
8-
releaseVersion: 0.2.8
9-
configChecksum: 7f4440ef5511489d871961cca99331f5
6+
speakeasyVersion: 1.260.6
7+
generationVersion: 2.311.1
8+
releaseVersion: 0.3.0
9+
configChecksum: a5ef199e8eaf4f35475bc5e2dda2090c
1010
repoURL: https://github.com/StyraInc/opa-typescript.git
1111
installationURL: https://github.com/StyraInc/opa-typescript
1212
published: true
1313
features:
1414
typescript:
1515
constsAndDefaults: 0.1.5
16-
core: 3.7.2
16+
core: 3.8.0
1717
examples: 2.81.3
1818
flattening: 2.81.1
1919
globalServerURLs: 2.82.4
@@ -22,6 +22,7 @@ features:
2222
generatedFiles:
2323
- src/sdk/sdk.ts
2424
- RUNTIMES.md
25+
- jsr.json
2526
- package.json
2627
- src/lib/base64.ts
2728
- src/lib/config.ts

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ generation:
1212
auth:
1313
oAuth2ClientCredentialsEnabled: false
1414
typescript:
15-
version: 0.2.8
15+
version: 0.3.0
1616
additionalDependencies:
1717
dependencies: {}
1818
devDependencies:

.speakeasy/workflow.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.257.1
1+
speakeasyVersion: 1.260.6
22
sources:
33
openapi: {}
44
targets:

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,14 @@ Based on:
118118
### Generated
119119
- [typescript v0.2.8] .
120120
### Releases
121-
- [NPM v0.2.8] https://www.npmjs.com/package/@styra/opa/v/0.2.8 - .
121+
- [NPM v0.2.8] https://www.npmjs.com/package/@styra/opa/v/0.2.8 - .
122+
123+
## 2024-04-19 00:14:11
124+
### Changes
125+
Based on:
126+
- OpenAPI Doc
127+
- Speakeasy CLI 1.260.6 (2.311.1) https://github.com/speakeasy-api/speakeasy
128+
### Generated
129+
- [typescript v0.3.0] .
130+
### Releases
131+
- [NPM v0.3.0] https://www.npmjs.com/package/@styra/opa/v/0.3.0 - .

jsr.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
3+
{
4+
"name": "@styra/opa",
5+
"version": "0.3.0",
6+
"exports": {
7+
".": "./src/index.ts",
8+
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
9+
"./sdk/models/components": "./src/sdk/models/components/index.ts",
10+
"./sdk/models/operations": "./src/sdk/models/operations/index.ts",
11+
"./lib/config": "./src/lib/config.ts",
12+
"./lib/http": "./src/lib/http.ts",
13+
"./lib/retries": "./src/lib/retries.ts",
14+
"./lib/sdks": "./src/lib/sdks.ts",
15+
"./types": "./src/types/index.ts"
16+
},
17+
"publish": {
18+
"include": [
19+
"LICENSE",
20+
"README.md",
21+
"RUNTIMES.md",
22+
"USAGE.md",
23+
"src/**/*.ts"
24+
]
25+
}
26+
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@styra/opa",
3-
"version": "0.2.8",
3+
"version": "0.3.0",
44
"author": "Styra",
55
"main": "./index.js",
66
"sideEffects": false,

src/lib/config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { HTTPClient } from "./http";
66
import { RetryConfig } from "./retries";
7-
import { pathToFunc } from "./url";
7+
import { Params, pathToFunc } from "./url";
88

99
/**
1010
* Contains the list of servers available to the SDK
@@ -35,7 +35,7 @@ export type SDKOptions = {
3535
export function serverURLFromOptions(options: SDKOptions): URL | null {
3636
let serverURL = options.serverURL;
3737

38-
const params: Record<string, string> = {};
38+
const params: Params = {};
3939

4040
if (!serverURL) {
4141
const serverIdx = options.serverIdx ?? 0;
@@ -49,10 +49,10 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
4949
return new URL(u);
5050
}
5151

52-
export const SDK_METADATA = Object.freeze({
52+
export const SDK_METADATA = {
5353
language: "typescript",
5454
openapiDocVersion: "0.2.0",
55-
sdkVersion: "0.2.8",
56-
genVersion: "2.308.2",
57-
userAgent: "speakeasy-sdk/typescript 0.2.8 2.308.2 0.2.0 @styra/opa",
58-
});
55+
sdkVersion: "0.3.0",
56+
genVersion: "2.311.1",
57+
userAgent: "speakeasy-sdk/typescript 0.3.0 2.311.1 0.2.0 @styra/opa",
58+
} as const;

src/lib/encodings.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function encodeMatrix(
1515
key: string,
1616
value: unknown,
1717
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
18-
) {
18+
): string {
1919
let out = "";
2020
const pairs: [string, unknown][] = options?.explode
2121
? explode(key, value)
@@ -65,7 +65,7 @@ export function encodeLabel(
6565
key: string,
6666
value: unknown,
6767
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
68-
) {
68+
): string {
6969
let out = "";
7070
const pairs: [string, unknown][] = options?.explode
7171
? explode(key, value)
@@ -100,7 +100,13 @@ export function encodeLabel(
100100
return out;
101101
}
102102

103-
function formEncoder(sep: string) {
103+
type FormEncoder = (
104+
key: string,
105+
value: unknown,
106+
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
107+
) => string;
108+
109+
function formEncoder(sep: string): FormEncoder {
104110
return (
105111
key: string,
106112
value: unknown,
@@ -157,7 +163,7 @@ export function encodeBodyForm(
157163
key: string,
158164
value: unknown,
159165
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
160-
) {
166+
): string {
161167
let out = "";
162168
const pairs: [string, unknown][] = options?.explode
163169
? explode(key, value)
@@ -200,7 +206,7 @@ export function encodeDeepObject(
200206
key: string,
201207
value: unknown,
202208
options?: { charEncoding?: "percent" | "none" },
203-
) {
209+
): string {
204210
if (value == null) {
205211
return "";
206212
}
@@ -247,7 +253,7 @@ export function encodeJSON(
247253
key: string,
248254
value: unknown,
249255
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
250-
) {
256+
): string {
251257
if (typeof value === "undefined") {
252258
return "";
253259
}
@@ -265,7 +271,7 @@ export const encodeSimple = (
265271
key: string,
266272
value: unknown,
267273
options?: { explode?: boolean; charEncoding?: "percent" | "none" },
268-
) => {
274+
): string => {
269275
let out = "";
270276
const pairs: [string, unknown][] = options?.explode
271277
? explode(key, value)
@@ -337,7 +343,7 @@ function serializeValue(value: unknown): string {
337343
return `${value}`;
338344
}
339345

340-
function jsonReplacer(_: string, value: unknown) {
346+
function jsonReplacer(_: string, value: unknown): unknown {
341347
if (value instanceof Uint8Array) {
342348
return bytesToBase64(value);
343349
} else {

src/lib/http.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ export type Fetcher = (
77
init?: RequestInit,
88
) => Promise<Response>;
99

10-
type Awaitable<T> = T | Promise<T>;
10+
export type Awaitable<T> = T | Promise<T>;
1111

1212
const DEFAULT_FETCHER: Fetcher = (input, init) => fetch(input, init);
1313

1414
export interface HTTPClientOptions {
1515
fetcher?: Fetcher;
1616
}
1717

18-
type BeforeRequestHook = (req: Request) => Awaitable<Request | void>;
19-
type RequestErrorHook = (err: unknown, req: Request) => Awaitable<void>;
20-
type ResponseHook = (res: Response, req: Request) => Awaitable<void>;
18+
export type BeforeRequestHook = (req: Request) => Awaitable<Request | void>;
19+
export type RequestErrorHook = (err: unknown, req: Request) => Awaitable<void>;
20+
export type ResponseHook = (res: Response, req: Request) => Awaitable<void>;
2121

2222
export class HTTPClient {
2323
private fetcher: Fetcher;
@@ -100,7 +100,7 @@ export class HTTPClient {
100100
| [hook: "beforeRequest", fn: BeforeRequestHook]
101101
| [hook: "requestError", fn: RequestErrorHook]
102102
| [hook: "response", fn: ResponseHook]
103-
) {
103+
): this {
104104
let target: unknown[];
105105
if (args[0] === "beforeRequest") {
106106
target = this.requestHooks;
@@ -120,7 +120,7 @@ export class HTTPClient {
120120
return this;
121121
}
122122

123-
clone() {
123+
clone(): HTTPClient {
124124
const child = new HTTPClient(this.options);
125125
child.requestHooks = this.requestHooks.slice();
126126
child.requestErrorHooks = this.requestErrorHooks.slice();
@@ -160,7 +160,7 @@ const codeRangeRE = new RegExp("^[0-9]xx$", "i");
160160
export function matchStatusCode(
161161
response: Response,
162162
codes: number | string | (number | string)[],
163-
) {
163+
): boolean {
164164
const actual = `${response.status}`;
165165
const expectedCodes = Array.isArray(codes) ? codes : [codes];
166166
if (!expectedCodes.length) {

0 commit comments

Comments
 (0)