Skip to content

Commit 15c40d0

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.576.1
1 parent 161d384 commit 15c40d0

Some content is hidden

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

49 files changed

+1662
-411
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/examples/node_modules
2+
.DS_Store
3+
**/.speakeasy/temp/
4+
**/.speakeasy/logs/
5+
.DS_Store
6+
.env
7+
.env.local
8+
.env.*.local
19
/mcp-server
210
/bin
311
/.eslintcache

.speakeasy/gen.lock

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
lockVersion: 2.0.0
22
id: 521af75f-d011-41f9-a5ff-9f8033773118
33
management:
4-
docChecksum: 80bdf0b395520d76da9a1e1e2896dae0
4+
docChecksum: 2bf97fa8e6ca517b859cc9784a1260b5
55
docVersion: 0.4.0
6-
speakeasyVersion: 1.514.0
7-
generationVersion: 2.546.0
8-
releaseVersion: 2.4.0-beta
9-
configChecksum: ef5d56dcfd4f4ba9e07e1a535f410421
6+
speakeasyVersion: 1.576.1
7+
generationVersion: 2.651.2
8+
releaseVersion: 2.4.0-beta.1
9+
configChecksum: 40ea56fc4802cdc2a9d623111efc2329
1010
repoURL: https://github.com/speakeasy-api/speakeasy-code-samples-ts.git
1111
installationURL: https://github.com/speakeasy-api/speakeasy-code-samples-ts
1212
published: true
1313
features:
1414
typescript:
1515
additionalDependencies: 0.1.0
16-
core: 3.21.3
16+
core: 3.21.13
1717
deepObjectParams: 0.1.0
1818
defaultEnabledRetries: 0.1.0
1919
devContainers: 2.90.0
@@ -22,15 +22,15 @@ features:
2222
globalSecurity: 2.82.13
2323
globalSecurityCallbacks: 0.1.0
2424
globalSecurityFlattening: 0.1.0
25-
globalServerURLs: 2.82.4
25+
globalServerURLs: 2.82.5
2626
globals: 2.82.2
2727
groups: 2.81.2
28-
mcpServer: 0.6.0
28+
mcpServer: 0.9.3
2929
nameOverrides: 2.81.2
30-
reactQueryHooks: 0.2.2
30+
reactQueryHooks: 0.2.3
3131
responseFormat: 0.2.3
3232
retries: 2.83.0
33-
sdkHooks: 0.2.0
33+
sdkHooks: 0.3.0
3434
serverIDs: 2.81.2
3535
generatedFiles:
3636
- .devcontainer/README.md
@@ -54,6 +54,10 @@ generatedFiles:
5454
- docs/sdks/codesamples/README.md
5555
- docs/sdks/speakeasycodesamples/README.md
5656
- eslint.config.mjs
57+
- examples/.env.template
58+
- examples/README.md
59+
- examples/codeSamplesGet.example.ts
60+
- examples/package.json
5761
- jsr.json
5862
- package.json
5963
- src/core.ts
@@ -84,6 +88,7 @@ generatedFiles:
8488
- src/mcp-server/console-logger.ts
8589
- src/mcp-server/extensions.ts
8690
- src/mcp-server/mcp-server.ts
91+
- src/mcp-server/prompts.ts
8792
- src/mcp-server/resources.ts
8893
- src/mcp-server/scopes.ts
8994
- src/mcp-server/server.ts
@@ -99,7 +104,9 @@ generatedFiles:
99104
- src/models/errors/error.ts
100105
- src/models/errors/httpclienterrors.ts
101106
- src/models/errors/index.ts
107+
- src/models/errors/responsevalidationerror.ts
102108
- src/models/errors/sdkvalidationerror.ts
109+
- src/models/errors/speakeasycodesampleserror.ts
103110
- src/models/operations/getcodesamples.ts
104111
- src/models/operations/index.ts
105112
- src/react-query/_context.tsx
@@ -121,18 +128,18 @@ generatedFiles:
121128
- tsconfig.json
122129
examples:
123130
getCodeSamples:
124-
"":
131+
speakeasy-default-get-code-samples:
125132
parameters:
126133
query:
127-
registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source"
134+
registry_url: "https://spec.speakeasy.com/org/ws/my-source"
128135
operation_ids: ["getPets"]
129136
method_paths: [{"method": "get", "path": "/pets"}]
130137
languages: ["python", "javascript"]
131138
responses:
132139
2XX:
133-
application/json: {"snippets": [{"path": "/sbin", "method": "<value>", "operationId": "<id>", "language": "php,", "code": "<value>"}, {"path": "/root", "method": "<value>", "operationId": "<id>", "language": "unity,", "code": "<value>"}]}
140+
application/json: {"snippets": []}
134141
4XX:
135-
application/json: {"message": "<value>", "status_code": 521235}
142+
application/json: {"message": "<value>", "status_code": 887801}
136143
default:
137144
parameters:
138145
query:
@@ -143,5 +150,5 @@ examples:
143150
responses:
144151
2XX:
145152
application/json: {"snippets": [{"path": "/pet/{id}", "method": "get", "operationId": "getPetById", "language": "typescript", "code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"<YOUR_API_KEY_HERE>\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"}]}
146-
examplesVersion: 1.0.0
153+
examplesVersion: 1.0.2
147154
generatedTests: {}

.speakeasy/gen.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,23 @@ generation:
77
maintainOpenAPIOrder: true
88
usageSnippets:
99
optionalPropertyRendering: withExample
10+
sdkInitStyle: constructor
1011
useClassNamesForArrayFields: true
1112
fixes:
1213
nameResolutionFeb2025: false
1314
parameterOrderingFeb2024: false
1415
requestResponseComponentNamesFeb2024: false
1516
securityFeb2025: false
17+
sharedErrorComponentsApr2025: false
1618
auth:
1719
oAuth2ClientCredentialsEnabled: false
1820
oAuth2PasswordEnabled: false
21+
tests:
22+
generateTests: true
23+
generateNewTests: false
24+
skipResponseBodyAssertions: false
1925
typescript:
20-
version: 2.4.0-beta
26+
version: 2.4.0-beta.1
2127
additionalDependencies:
2228
dependencies:
2329
'@emotion/css': ^11.13.5
@@ -28,14 +34,17 @@ typescript:
2834
peerDependencies: {}
2935
additionalPackageJSON: {}
3036
author: Speakeasy
37+
baseErrorName: SpeakeasyCodeSamplesError
3138
clientServerStatusCodesAsErrors: true
39+
constFieldsAlwaysOptional: true
3240
defaultErrorName: APIError
3341
enableCustomCodeRegions: false
3442
enableMCPServer: true
3543
enableReactQuery: true
3644
enumFormat: union
3745
flattenGlobalSecurity: true
3846
flatteningOrder: body-first
47+
generateExamples: true
3948
imports:
4049
option: openapi
4150
paths:

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.514.0
1+
speakeasyVersion: 1.576.1
22
sources:
33
speakeasy-OAS:
44
sourceNamespace: speakeasy-oas
5-
sourceRevisionDigest: sha256:c95b7bde7a889f8d6461e405347f2dac28defaaf6a36cc19709b4ce29f4eaefb
6-
sourceBlobDigest: sha256:706c912b2e5755fdaff8d2a95ca3ce6fb1fff777a7aa49a8afcb0b909cc22892
5+
sourceRevisionDigest: sha256:6b8652973fd0a9bf346a3af06472bc616830e9e3c881a0f583f3bfd12979591a
6+
sourceBlobDigest: sha256:63f67500135f962b2c56c1d0664fef7f7d040d733c89169633eae8ec2f9d1b85
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1741642416
9+
- speakeasy-sdk-regen-1746489958
1010
- 0.4.0
1111
targets:
1212
code_samples_typescript_sdk:
1313
source: speakeasy-OAS
1414
sourceNamespace: speakeasy-oas
15-
sourceRevisionDigest: sha256:c95b7bde7a889f8d6461e405347f2dac28defaaf6a36cc19709b4ce29f4eaefb
16-
sourceBlobDigest: sha256:706c912b2e5755fdaff8d2a95ca3ce6fb1fff777a7aa49a8afcb0b909cc22892
15+
sourceRevisionDigest: sha256:6b8652973fd0a9bf346a3af06472bc616830e9e3c881a0f583f3bfd12979591a
16+
sourceBlobDigest: sha256:63f67500135f962b2c56c1d0664fef7f7d040d733c89169633eae8ec2f9d1b85
1717
codeSamplesNamespace: speakeasy-oas-typescript-code-samples
18-
codeSamplesRevisionDigest: sha256:73a780b60ccc00d5344b505208070173d62dfcb9013e97f8f123e322230d6afe
18+
codeSamplesRevisionDigest: sha256:b1dd14a70682337921089bf92025cbdb2a0175f13250e07d113bb9aa979db52a
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

FUNCTIONS.md

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,24 @@ specific category of applications.
2121
```typescript
2222
import { SpeakeasyCodeSamplesCore } from "@speakeasyapi/code-samples/core.js";
2323
import { codeSamplesGet } from "@speakeasyapi/code-samples/funcs/codeSamplesGet.js";
24-
import { SDKValidationError } from "@speakeasyapi/code-samples/models/errors/sdkvalidationerror.js";
2524

2625
// Use `SpeakeasyCodeSamplesCore` for best tree-shaking performance.
2726
// You can create one instance of it to use across an application.
2827
const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({
28+
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
2929
apiKey: "<YOUR_API_KEY_HERE>",
30-
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
3130
});
3231

3332
async function run() {
3433
const res = await codeSamplesGet(speakeasyCodeSamples, {
35-
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
3634
operationIds: [
37-
"getPets",
35+
"g",
36+
"e",
37+
"t",
38+
"P",
39+
"e",
40+
"t",
41+
"s",
3842
],
3943
methodPaths: [
4044
{
@@ -47,28 +51,12 @@ async function run() {
4751
"javascript",
4852
],
4953
});
50-
51-
switch (true) {
52-
case res.ok:
53-
// The success case will be handled outside of the switch block
54-
break;
55-
case res.error instanceof SDKValidationError:
56-
// Pretty-print validation errors.
57-
return console.log(res.error.pretty());
58-
case res.error instanceof Error:
59-
return console.log(res.error);
60-
default:
61-
// TypeScript's type checking will fail on the following line if the above
62-
// cases were not exhaustive.
63-
res.error satisfies never;
64-
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
54+
if (res.ok) {
55+
const { value: result } = res;
56+
console.log(result);
57+
} else {
58+
console.log("codeSamplesGet failed:", res.error);
6559
}
66-
67-
68-
const { value: result } = res;
69-
70-
// Handle the result
71-
console.log(result);
7260
}
7361

7462
run();

REACT_QUERY.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import { SpeakeasyCodeSamplesProvider } from "@speakeasyapi/code-samples/react-q
2323

2424
const queryClient = new QueryClient();
2525
const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({
26+
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
2627
apiKey: "<YOUR_API_KEY_HERE>",
27-
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
2828
});
2929

3030
// Retries are handled by the underlying SDK.
@@ -55,9 +55,14 @@ import { useCodeSamples } from "@speakeasyapi/code-samples/react-query/codeSampl
5555

5656
export function Example() {
5757
const { data, error, status } = useCodeSamples({
58-
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
5958
operationIds: [
60-
"getPets",
59+
"g",
60+
"e",
61+
"t",
62+
"P",
63+
"e",
64+
"t",
65+
"s",
6166
],
6267
methodPaths: [
6368
{
@@ -88,9 +93,14 @@ export function ExampleWithOptions() {
8893
const [enabled, setEnabled] = useState(true);
8994
const { data, error, status } = useCodeSamples(
9095
{
91-
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
9296
operationIds: [
93-
"getPets",
97+
"g",
98+
"e",
99+
"t",
100+
"P",
101+
"e",
102+
"t",
103+
"s",
94104
],
95105
methodPaths: [
96106
{
@@ -189,8 +199,8 @@ import { useCodeSamplesSuspense } from "@speakeasyapi/code-samples/react-query/c
189199

190200
const queryClient = new QueryClient();
191201
const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({
202+
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
192203
apiKey: "<YOUR_API_KEY_HERE>",
193-
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
194204
});
195205

196206
export function App() {
@@ -222,9 +232,14 @@ export function App() {
222232

223233
function Example() {
224234
const { data } = useCodeSamplesSuspense({
225-
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
226235
operationIds: [
227-
"getPets",
236+
"g",
237+
"e",
238+
"t",
239+
"P",
240+
"e",
241+
"t",
242+
"s",
228243
],
229244
methodPaths: [
230245
{
@@ -261,14 +276,19 @@ import { prefetchCodeSamples } from "@speakeasyapi/code-samples/react-query/code
261276
export default async function Page() {
262277
const queryClient = new QueryClient();
263278
const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({
279+
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
264280
apiKey: "<YOUR_API_KEY_HERE>",
265-
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
266281
});
267282

268283
await prefetchCodeSamples(queryClient, speakeasyCodeSamples, {
269-
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
270284
operationIds: [
271-
"getPets",
285+
"g",
286+
"e",
287+
"t",
288+
"P",
289+
"e",
290+
"t",
291+
"s",
272292
],
273293
methodPaths: [
274294
{

0 commit comments

Comments
 (0)