Skip to content

Commit 275aa76

Browse files
committed
update react component to handle multiple operation query schemes
1 parent cad8cc9 commit 275aa76

File tree

19 files changed

+118
-91
lines changed

19 files changed

+118
-91
lines changed

.speakeasy/gen.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ management:
55
docVersion: 0.4.0
66
speakeasyVersion: 1.469.1
77
generationVersion: 2.493.21
8-
releaseVersion: 2.1.1
9-
configChecksum: 4b92b57c7f6bd5b3b6d7532b6b9cb49b
8+
releaseVersion: 2.1.4
9+
configChecksum: 22599104bf7d0e70df30902fae0020b5
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

.speakeasy/gen.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ generation:
1616
oAuth2ClientCredentialsEnabled: false
1717
oAuth2PasswordEnabled: false
1818
typescript:
19-
version: 2.1.1
19+
version: 2.1.4
2020
additionalDependencies:
2121
dependencies: {}
2222
devDependencies: {}
@@ -28,7 +28,7 @@ typescript:
2828
defaultErrorName: APIError
2929
enableCustomCodeRegions: false
3030
enableReactQuery: true
31-
enumFormat: enum
31+
enumFormat: union
3232
flattenGlobalSecurity: true
3333
flatteningOrder: body-first
3434
imports:

.speakeasy/workflow.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@ speakeasyVersion: 1.469.1
22
sources:
33
speakeasy-OAS:
44
sourceNamespace: speakeasy-oas
5-
sourceRevisionDigest: sha256:c69fca1c1936f3efccfca1a87dec5637194adb3aeda5ab642b734e9e9aa52689
5+
sourceRevisionDigest: sha256:6334bc3fe86d1f119e05db75370765ef6e503383b2e99d0de9041da31e61714d
66
sourceBlobDigest: sha256:63701f5ff26c0ac6e0ea6e314b9dc7bf7063bf75b72a16206b62050baf740623
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1737159897
109
- 0.4.0
1110
targets:
1211
code_samples_typescript_sdk:
1312
source: speakeasy-OAS
1413
sourceNamespace: speakeasy-oas
15-
sourceRevisionDigest: sha256:c69fca1c1936f3efccfca1a87dec5637194adb3aeda5ab642b734e9e9aa52689
14+
sourceRevisionDigest: sha256:6334bc3fe86d1f119e05db75370765ef6e503383b2e99d0de9041da31e61714d
1615
sourceBlobDigest: sha256:63701f5ff26c0ac6e0ea6e314b9dc7bf7063bf75b72a16206b62050baf740623
1716
codeSamplesNamespace: speakeasy-oas-typescript-code-samples
18-
codeSamplesRevisionDigest: sha256:d21ba30bee6a57bc8e484768a7f4d9bd55420fe5439cc48ba23034941477356c
17+
codeSamplesRevisionDigest: sha256:edde53e65546b1bb8548635d8e77eef0f83015b94f02882c97b54e3349cabbf5
1918
workflow:
2019
workflowVersion: 1.0.0
2120
speakeasyVersion: latest
@@ -41,4 +40,6 @@ workflow:
4140
codeSamples:
4241
registry:
4342
location: registry.speakeasyapi.dev/speakeasy-self/speakeasy-public/speakeasy-oas-typescript-code-samples
43+
labelOverride:
44+
fixedValue: TypeScript (SDK)
4445
blocking: false

FUNCTIONS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ 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 { HttpMethod } from "@speakeasyapi/code-samples/models/components";
2524
import { SDKValidationError } from "@speakeasyapi/code-samples/models/errors/sdkvalidationerror.js";
2625

2726
// Use `SpeakeasyCodeSamplesCore` for best tree-shaking performance.
@@ -39,7 +38,7 @@ async function run() {
3938
],
4039
methodPaths: [
4140
{
42-
method: HttpMethod.Get,
41+
method: "get",
4342
path: "/pets",
4443
},
4544
],

REACT_QUERY.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function Example() {
6161
],
6262
methodPaths: [
6363
{
64-
method: HttpMethod.Get,
64+
method: "get",
6565
path: "/pets",
6666
},
6767
],
@@ -94,7 +94,7 @@ export function ExampleWithOptions() {
9494
],
9595
methodPaths: [
9696
{
97-
method: HttpMethod.Get,
97+
method: "get",
9898
path: "/pets",
9999
},
100100
],
@@ -228,7 +228,7 @@ function Example() {
228228
],
229229
methodPaths: [
230230
{
231-
method: HttpMethod.Get,
231+
method: "get",
232232
path: "/pets",
233233
},
234234
],
@@ -272,7 +272,7 @@ export default async function Page() {
272272
],
273273
methodPaths: [
274274
{
275-
method: HttpMethod.Get,
275+
method: "get",
276276
path: "/pets",
277277
},
278278
],

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
104104

105105
```typescript
106106
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
107-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
108107

109108
const speakeasyCodeSamples = new SpeakeasyCodeSamples({
110109
apiKey: "<YOUR_API_KEY_HERE>",
@@ -119,7 +118,7 @@ async function run() {
119118
],
120119
methodPaths: [
121120
{
122-
method: HttpMethod.Get,
121+
method: "get",
123122
path: "/pets",
124123
},
125124
],
@@ -195,7 +194,6 @@ This SDK supports the following security scheme globally:
195194
To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
196195
```typescript
197196
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
198-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
199197

200198
const speakeasyCodeSamples = new SpeakeasyCodeSamples({
201199
apiKey: "<YOUR_API_KEY_HERE>",
@@ -210,7 +208,7 @@ async function run() {
210208
],
211209
methodPaths: [
212210
{
213-
method: HttpMethod.Get,
211+
method: "get",
214212
path: "/pets",
215213
},
216214
],
@@ -310,7 +308,6 @@ The following global parameter is available.
310308

311309
```typescript
312310
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
313-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
314311

315312
const speakeasyCodeSamples = new SpeakeasyCodeSamples({
316313
apiKey: "<YOUR_API_KEY_HERE>",
@@ -325,7 +322,7 @@ async function run() {
325322
],
326323
methodPaths: [
327324
{
328-
method: HttpMethod.Get,
325+
method: "get",
329326
path: "/pets",
330327
},
331328
],
@@ -352,7 +349,6 @@ Some of the endpoints in this SDK support retries. If you use the SDK without a
352349
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
353350
```typescript
354351
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
355-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
356352

357353
const speakeasyCodeSamples = new SpeakeasyCodeSamples({
358354
apiKey: "<YOUR_API_KEY_HERE>",
@@ -367,7 +363,7 @@ async function run() {
367363
],
368364
methodPaths: [
369365
{
370-
method: HttpMethod.Get,
366+
method: "get",
371367
path: "/pets",
372368
},
373369
],
@@ -399,7 +395,6 @@ run();
399395
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
400396
```typescript
401397
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
402-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
403398

404399
const speakeasyCodeSamples = new SpeakeasyCodeSamples({
405400
retryConfig: {
@@ -424,7 +419,7 @@ async function run() {
424419
],
425420
methodPaths: [
426421
{
427-
method: HttpMethod.Get,
422+
method: "get",
428423
path: "/pets",
429424
},
430425
],
@@ -457,7 +452,6 @@ If the method throws an error and it is not captured by the known errors, it wil
457452

458453
```typescript
459454
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
460-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
461455
import {
462456
ErrorT,
463457
SDKValidationError,
@@ -478,7 +472,7 @@ async function run() {
478472
],
479473
methodPaths: [
480474
{
481-
method: HttpMethod.Get,
475+
method: "get",
482476
path: "/pets",
483477
},
484478
],
@@ -545,7 +539,6 @@ You can override the default server globally by passing a server name to the `se
545539

546540
```typescript
547541
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
548-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
549542

550543
const speakeasyCodeSamples = new SpeakeasyCodeSamples({
551544
server: "prod",
@@ -561,7 +554,7 @@ async function run() {
561554
],
562555
methodPaths: [
563556
{
564-
method: HttpMethod.Get,
557+
method: "get",
565558
path: "/pets",
566559
},
567560
],
@@ -584,7 +577,6 @@ run();
584577
The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
585578
```typescript
586579
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
587-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
588580

589581
const speakeasyCodeSamples = new SpeakeasyCodeSamples({
590582
serverURL: "https://api.prod.speakeasyapi.dev",
@@ -600,7 +592,7 @@ async function run() {
600592
],
601593
methodPaths: [
602594
{
603-
method: HttpMethod.Get,
595+
method: "get",
604596
path: "/pets",
605597
},
606598
],

USAGE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!-- Start SDK Example Usage [usage] -->
22
```typescript
33
import { SpeakeasyCodeSamples } from "@speakeasyapi/code-samples";
4-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
54

65
const speakeasyCodeSamples = new SpeakeasyCodeSamples({
76
apiKey: "<YOUR_API_KEY_HERE>",
@@ -16,7 +15,7 @@ async function run() {
1615
],
1716
methodPaths: [
1817
{
19-
method: HttpMethod.Get,
18+
method: "get",
2019
path: "/pets",
2120
},
2221
],

docs/models/components/httpmethod.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,11 @@
55
```typescript
66
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
77

8-
let value: HttpMethod = HttpMethod.Delete;
8+
let value: HttpMethod = "delete";
99
```
1010

1111
## Values
1212

13-
| Name | Value |
14-
| --------- | --------- |
15-
| `Get` | get |
16-
| `Post` | post |
17-
| `Put` | put |
18-
| `Patch` | patch |
19-
| `Delete` | delete |
20-
| `Head` | head |
21-
| `Options` | options |
22-
| `Trace` | trace |
13+
```typescript
14+
"get" | "post" | "put" | "patch" | "delete" | "head" | "options" | "trace"
15+
```

docs/models/operations/getcodesamplesrequest.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
## Example Usage
44

55
```typescript
6-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
76
import { GetCodeSamplesRequest } from "@speakeasyapi/code-samples/models/operations";
87

98
let value: GetCodeSamplesRequest = {
@@ -13,7 +12,7 @@ let value: GetCodeSamplesRequest = {
1312
],
1413
methodPaths: [
1514
{
16-
method: HttpMethod.Get,
15+
method: "get",
1716
path: "/pets",
1817
},
1918
],

docs/models/operations/methodpaths.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
## Example Usage
44

55
```typescript
6-
import { HttpMethod } from "@speakeasyapi/code-samples/models/components";
76
import { MethodPaths } from "@speakeasyapi/code-samples/models/operations";
87

98
let value: MethodPaths = {
10-
method: HttpMethod.Delete,
9+
method: "delete",
1110
path: "/opt/sbin",
1211
};
1312
```

0 commit comments

Comments
 (0)