Skip to content

Commit 24351dc

Browse files
committed
updates and start linting
1 parent 1082cec commit 24351dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2595
-2108
lines changed

.speakeasy/gen.lock

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 8b6cd71c-ea04-44da-af45-e43968b5928d
33
management:
4-
docChecksum: 591fccdc6b495b1230644174853f9113
4+
docChecksum: 2e56a000b1486d774bf299b99ef6d4ef
55
docVersion: 1.0.0
66
speakeasyVersion: 1.666.0
77
generationVersion: 2.768.0
8-
releaseVersion: 0.2.1
9-
configChecksum: 20b0e93ec59772256ddbc8cfd514e30e
8+
releaseVersion: 0.2.2
9+
configChecksum: eab7e61a24e830c367d7deebb355351e
1010
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
1111
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
1212
published: true
@@ -108,6 +108,7 @@ generatedFiles:
108108
- docs/models/costdetails.md
109109
- docs/models/createchargerequest.md
110110
- docs/models/datacollection.md
111+
- docs/models/debug.md
111112
- docs/models/defaultparameters.md
112113
- docs/models/edgenetworktimeoutresponseerrordata.md
113114
- docs/models/effort.md
@@ -1504,7 +1505,7 @@ examples:
15041505
use_rss_chat_links: "<value>"
15051506
responses:
15061507
"200":
1507-
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
1508+
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": 0.00003, "completion": 0.00006}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
15081509
application/rss+xml: "<value>"
15091510
default:
15101511
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
@@ -1516,7 +1517,7 @@ examples:
15161517
speakeasy-default-list-models-user:
15171518
responses:
15181519
"200":
1519-
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
1520+
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": 0.00003, "completion": 0.00006}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
15201521
default:
15211522
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
15221523
"401":
@@ -1531,7 +1532,7 @@ examples:
15311532
slug: "<value>"
15321533
responses:
15331534
"200":
1534-
application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true}]}}
1535+
application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": 0.00003, "completion": 0.00006}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true}]}}
15351536
default:
15361537
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
15371538
4XX:
@@ -1546,7 +1547,7 @@ examples:
15461547
speakeasy-default-list-endpoints-zdr:
15471548
responses:
15481549
"200":
1549-
application/json: {"data": [{"name": "<value>", "model_name": "<value>", "context_length": 8891.09, "pricing": {"prompt": "1000", "completion": 1000}, "provider_name": "OpenAI", "tag": "<value>", "quantization": "fp16", "max_completion_tokens": 4685.25, "max_prompt_tokens": 22.7, "supported_parameters": ["temperature"], "uptime_last_30m": 6060.66, "supports_implicit_caching": true}]}
1550+
application/json: {"data": [{"name": "<value>", "model_name": "<value>", "context_length": 8891.09, "pricing": {"prompt": 1000, "completion": 1000}, "provider_name": "OpenAI", "tag": "<value>", "quantization": "fp16", "max_completion_tokens": 4685.25, "max_prompt_tokens": 22.7, "supported_parameters": ["temperature"], "uptime_last_30m": 6060.66, "supports_implicit_caching": true}]}
15501551
default:
15511552
application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"}
15521553
"500":
@@ -1742,7 +1743,7 @@ examples:
17421743
speakeasy-default-list-embeddings-models:
17431744
responses:
17441745
"200":
1745-
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
1746+
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": 0.00003, "completion": 0.00006}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
17461747
"400":
17471748
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
17481749
"500":

.speakeasy/gen.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ generation:
3131
skipResponseBodyAssertions: false
3232
preApplyUnionDiscriminators: true
3333
typescript:
34-
version: 0.2.1
35-
compileCommand:
36-
- pnpm
37-
- install
34+
version: 0.2.2
3835
acceptHeaderEnum: false
3936
additionalDependencies:
4037
dependencies: {}
@@ -65,6 +62,9 @@ typescript:
6562
author: OpenRouter
6663
baseErrorName: OpenRouterError
6764
clientServerStatusCodesAsErrors: true
65+
compileCommand:
66+
- pnpm
67+
- install
6868
constFieldsAlwaysOptional: false
6969
defaultErrorName: OpenRouterDefaultError
7070
enableCustomCodeRegions: true

.speakeasy/in.openapi.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,11 +3535,7 @@ components:
35353535
performed.
35363536
example: price
35373537
BigNumberUnion:
3538-
anyOf:
3539-
- type: number
3540-
- type: string
3541-
- type: number
3542-
example: 1000
3538+
type: number
35433539
description: A value in string or number format that is a large number
35443540
example: 1000
35453541
OpenResponsesRequest:
@@ -5195,6 +5191,11 @@ components:
51955191
- type: 'null'
51965192
user:
51975193
type: string
5194+
debug:
5195+
type: object
5196+
properties:
5197+
echo_upstream_body:
5198+
type: boolean
51985199
required:
51995200
- messages
52005201
ChatResponseChoice:

.speakeasy/out.openapi.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,11 +3554,7 @@ components:
35543554
example: price
35553555
x-speakeasy-unknown-values: allow
35563556
BigNumberUnion:
3557-
anyOf:
3558-
- type: number
3559-
- type: string
3560-
- type: number
3561-
example: 1000
3557+
type: number
35623558
description: A value in string or number format that is a large number
35633559
example: 1000
35643560
OpenResponsesRequest:
@@ -5219,6 +5215,11 @@ components:
52195215
- type: 'null'
52205216
user:
52215217
type: string
5218+
debug:
5219+
type: object
5220+
properties:
5221+
echo_upstream_body:
5222+
type: boolean
52225223
required:
52235224
- messages
52245225
ChatResponseChoice:

.speakeasy/workflow.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ speakeasyVersion: 1.666.0
22
sources:
33
OpenRouter API:
44
sourceNamespace: open-router-chat-completions-api
5-
sourceRevisionDigest: sha256:430fa9a22e960fd04a393c99eb3c967b11b5fbda6b19a104bfcd745efe887df3
6-
sourceBlobDigest: sha256:c65ea29dcae3bb0b31cba1f207741a8a835620bc6e8921e614a7c371055d850c
5+
sourceRevisionDigest: sha256:cd1857f445240e3746f1dc3f6bba496a03fc6b442fd91ab5797dd739dfa4059f
6+
sourceBlobDigest: sha256:2c87fff91b43230ee61055b32842695d123b7936b016aa136af01c86ecb4b7bb
77
tags:
88
- latest
99
- 1.0.0
1010
targets:
1111
openrouter:
1212
source: OpenRouter API
1313
sourceNamespace: open-router-chat-completions-api
14-
sourceRevisionDigest: sha256:430fa9a22e960fd04a393c99eb3c967b11b5fbda6b19a104bfcd745efe887df3
15-
sourceBlobDigest: sha256:c65ea29dcae3bb0b31cba1f207741a8a835620bc6e8921e614a7c371055d850c
14+
sourceRevisionDigest: sha256:cd1857f445240e3746f1dc3f6bba496a03fc6b442fd91ab5797dd739dfa4059f
15+
sourceBlobDigest: sha256:2c87fff91b43230ee61055b32842695d123b7936b016aa136af01c86ecb4b7bb
1616
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:4fb983d31ef998eb30f12c38e07fb278a3054a1def2a61c418d71d553c648a66
17+
codeSamplesRevisionDigest: sha256:470a888dfd79bc1442bde84817b53d3747b6c63d6527af44f75a275ad377b8a9
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: 1.666.0

biome.json

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true,
7+
"defaultBranch": "main"
8+
},
9+
"files": {
10+
"ignoreUnknown": false,
11+
"includes": [
12+
"**",
13+
"./.vscode/extensions/**",
14+
"!**/*.json",
15+
"!**/*.test.ts.snap",
16+
"!**/logger.ts"
17+
]
18+
},
19+
"formatter": {
20+
"enabled": true,
21+
"indentStyle": "space",
22+
"indentWidth": 2,
23+
"lineWidth": 100,
24+
"expand": "always",
25+
"attributePosition": "multiline"
26+
},
27+
"assist": {
28+
"actions": {
29+
"source": {
30+
"organizeImports": {
31+
"level": "on",
32+
"options": {
33+
"groups": [
34+
{
35+
"type": true
36+
},
37+
":BLANK_LINE:",
38+
{
39+
"type": false
40+
},
41+
[
42+
":NODE:"
43+
],
44+
":BLANK_LINE:",
45+
[
46+
"!@openrouter-monorepo/**"
47+
],
48+
":BLANK_LINE:",
49+
[
50+
"@openrouter-monorepo/**",
51+
"@/**"
52+
],
53+
":BLANK_LINE:",
54+
":ALIAS:"
55+
]
56+
}
57+
}
58+
}
59+
}
60+
},
61+
"linter": {
62+
"enabled": true,
63+
"rules": {
64+
"recommended": true,
65+
"nursery": {
66+
"noFloatingPromises": "off"
67+
},
68+
"a11y": {
69+
"useSemanticElements": "off"
70+
},
71+
"complexity": {
72+
"useLiteralKeys": "off",
73+
"noExtraBooleanCast": "off",
74+
"noForEach": "off",
75+
"noBannedTypes": "error",
76+
"noUselessSwitchCase": "off"
77+
},
78+
"style": {
79+
"noNonNullAssertion": "off",
80+
"useNodejsImportProtocol": "error",
81+
"useTemplate": "off",
82+
"useBlockStatements": "error",
83+
"noParameterAssign": "error",
84+
"useConst": "error",
85+
"useAsConstAssertion": "error",
86+
"useDefaultParameterLast": "error",
87+
"useEnumInitializers": "error",
88+
"useSelfClosingElements": "error",
89+
"useSingleVarDeclarator": "error",
90+
"noUnusedTemplateLiteral": "error",
91+
"useNumberNamespace": "error",
92+
"noInferrableTypes": "error",
93+
"noUselessElse": "error",
94+
"useImportType": {
95+
"level": "on",
96+
"options": {
97+
"style": "separatedType"
98+
}
99+
},
100+
"noRestrictedImports": {
101+
"level": "error",
102+
"options": {
103+
"paths": {
104+
"node:module": "Don't use `node:module`. Did you mean to import `wrap` from our `@openrouter-monorepo/type-utils/result-monad` package?",
105+
"crypto": "Use `node:crypto` instead of `crypto` to follow the Node.js import protocol."
106+
}
107+
}
108+
}
109+
},
110+
"correctness": {
111+
"noUnusedImports": "error",
112+
"useExhaustiveDependencies": "off",
113+
"noUnknownFunction": "off",
114+
"noChildrenProp": "off",
115+
"noInnerDeclarations": "error",
116+
"useParseIntRadix": "error"
117+
},
118+
"suspicious": {
119+
"noExplicitAny": "error",
120+
"noArrayIndexKey": "off",
121+
"noAssignInExpressions": "error",
122+
"noAsyncPromiseExecutor": "off",
123+
"noFallthroughSwitchClause": "error",
124+
"noConsole": "error",
125+
"noDoubleEquals": {
126+
"level": "error",
127+
"options": {
128+
"ignoreNull": false
129+
}
130+
},
131+
"noExtraNonNullAssertion": "error",
132+
"noUnknownAtRules": "off"
133+
},
134+
"performance": {
135+
"recommended": true,
136+
"noAccumulatingSpread": "error"
137+
},
138+
"security": {
139+
"recommended": true
140+
}
141+
},
142+
"includes": [
143+
"**",
144+
"!**/*.test.ts.snap"
145+
]
146+
},
147+
"javascript": {
148+
"formatter": {
149+
"expand": "always",
150+
"lineWidth": 100,
151+
"arrowParentheses": "always",
152+
"jsxQuoteStyle": "single",
153+
"attributePosition": "multiline",
154+
"quoteProperties": "asNeeded",
155+
"trailingCommas": "all",
156+
"semicolons": "always",
157+
"bracketSpacing": true,
158+
"bracketSameLine": false,
159+
"quoteStyle": "single",
160+
"enabled": true
161+
}
162+
},
163+
"css": {
164+
"parser": {
165+
"tailwindDirectives": true
166+
},
167+
"formatter": {
168+
"quoteStyle": "single"
169+
}
170+
}
171+
}

docs/models/chatgenerationparams.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ let value: ChatGenerationParams = {
4040
| `toolChoice` | *any* | :heavy_minus_sign: | N/A |
4141
| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A |
4242
| `topP` | *number* | :heavy_minus_sign: | N/A |
43-
| `user` | *string* | :heavy_minus_sign: | N/A |
43+
| `user` | *string* | :heavy_minus_sign: | N/A |
44+
| `debug` | [models.Debug](../models/debug.md) | :heavy_minus_sign: | N/A |

docs/models/debug.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Debug
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { Debug } from "@openrouter/sdk/models";
7+
8+
let value: Debug = {};
9+
```
10+
11+
## Fields
12+
13+
| Field | Type | Required | Description |
14+
| ------------------ | ------------------ | ------------------ | ------------------ |
15+
| `echoUpstreamBody` | *boolean* | :heavy_minus_sign: | N/A |

docs/models/listendpointsresponse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ let value: ListEndpointsResponse = {
3030
modelName: "GPT-4",
3131
contextLength: 8192,
3232
pricing: {
33-
prompt: "0.00003",
34-
completion: "0.00006",
33+
prompt: 0.00003,
34+
completion: 0.00006,
3535
},
3636
providerName: "OpenAI",
3737
tag: "openai",

0 commit comments

Comments
 (0)