Skip to content

Commit d0216fd

Browse files
committed
including some more of the gen changes
1 parent a112d69 commit d0216fd

File tree

15 files changed

+218
-14
lines changed

15 files changed

+218
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
/.tshy
1818
/.tshy-*
1919
/__tests__
20+
.env

.speakeasy/gen.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 74386feb-f8da-4ec0-8b02-29dfddf22161
33
management:
44
docChecksum: a0841885f1d2df6bf65c33550d1be776
55
docVersion: 0.4.0
6-
speakeasyVersion: 1.463.1
7-
generationVersion: 2.486.6
8-
releaseVersion: 2.0.0
9-
configChecksum: 88c5e327e8ad8129a9654dc84dd0c36d
6+
speakeasyVersion: 1.467.0
7+
generationVersion: 2.492.3
8+
releaseVersion: 2.0.4
9+
configChecksum: 5956da297bd706125921a8685c2d332c
1010
published: true
1111
features:
1212
typescript:

.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.0.0
19+
version: 2.0.4
2020
additionalDependencies:
2121
dependencies: {}
2222
devDependencies: {}
@@ -42,7 +42,7 @@ typescript:
4242
methodArguments: require-security-and-request
4343
moduleFormat: commonjs
4444
outputModelSuffix: output
45-
packageName: "@speakeasyapi/code-samples"
45+
packageName: '@speakeasyapi/code-samples'
4646
responseFormat: flat
4747
templateVersion: v2
4848
useIndexModules: true

.speakeasy/workflow.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.463.1
1+
speakeasyVersion: 1.467.0
22
sources:
33
speakeasy-OAS:
44
sourceNamespace: speakeasy-oas

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "@speakeasyapi/code-samples",
5-
"version": "2.0.0",
5+
"version": "2.0.4",
66
"exports": {
77
".": "./src/index.ts",
88
"./models/errors": "./src/models/errors/index.ts",

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": "@speakeasyapi/code-samples",
3-
"version": "2.0.0",
3+
"version": "2.0.4",
44
"author": "Speakeasy",
55
"main": "./index.js",
66
"sideEffects": false,

react.d.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from "react";
2+
type SpeakeasyCodeSampleProps = {
3+
/**
4+
* The URL of the registry that you would like to fetch a code sample from.
5+
*
6+
* @example "https://spec.speakeasy.com/my-org/my-workspace/my-source"
7+
*/
8+
registryUrl: string;
9+
/**
10+
* The `operationId` of the operation that you would like to fetch a code
11+
* sample for.
12+
*
13+
* @example "getPetById"
14+
* */
15+
operationId: string;
16+
/**
17+
* The language of the code sample that you would like to fetch.
18+
*
19+
* @example "typescript"
20+
* */
21+
language: string;
22+
renderError?: (err: Error) => React.ReactNode;
23+
renderPending?: () => React.ReactNode;
24+
renderSuccess?: (codeSample: string) => React.ReactNode;
25+
};
26+
/**
27+
* SpeakeasyCodeSample is a React component that fetches and displays a code
28+
* sample snippet from the Speakeasy Code Samples API. It uses the
29+
* `useCodeSamplesGet` hook to retrieve the code sample based on the provided
30+
* props.
31+
*
32+
* @param {SpeakeasyCodeSampleProps} props - The properties passed to the component.
33+
* @param {string} props.registryUrl - The URL of the code sample registry.
34+
* @param {string} props.operationId - The operation ID for which the code sample is requested.
35+
* @param {string} props.language - The programming language of the code sample.
36+
*
37+
* @returns {JSX.Element} A JSX element that displays the code sample snippet, a loading message, or an error message.
38+
*
39+
* @example
40+
* Usage within a component that provides code highlighting:
41+
*
42+
* ```tsx
43+
* import { SpeakeasyCodeSample } from "@speakeasyapi/react";
44+
* import { Code } from './components/code-highlighting';
45+
*
46+
* const ExampleComponent: React.FC = () => (
47+
* <Code language="typescript">
48+
* <SpeakeasyCodeSample
49+
* registryUrl="https://spec.speakeasy.com/my-org/my-workspace/my-source"
50+
* operationId="getPetById"
51+
* language="typescript"
52+
* />
53+
* </Code>
54+
* );
55+
* ```
56+
*/
57+
export declare const SpeakeasyCodeSample: React.FC<SpeakeasyCodeSampleProps>;
58+
export {};
59+
//# sourceMappingURL=react.d.ts.map

react.d.ts.map

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

react.js

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

0 commit comments

Comments
 (0)