Skip to content

Commit

Permalink
Merge pull request #14 from speakeasy-api/speakeasy-sdk-regen-1736994552
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate 2.0.14
  • Loading branch information
walker-tx authored Jan 16, 2025
2 parents f38ae8e + 1f3797c commit 8255831
Show file tree
Hide file tree
Showing 19 changed files with 229 additions and 57 deletions.
63 changes: 57 additions & 6 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
lockVersion: 2.0.0
id: 521af75f-d011-41f9-a5ff-9f8033773118
management:
docChecksum: a0841885f1d2df6bf65c33550d1be776
docChecksum: ef41927baaf8adac37d125d0ae44097c
docVersion: 0.4.0
speakeasyVersion: 1.468.5
generationVersion: 2.493.11
releaseVersion: 2.0.13
configChecksum: bb0274b648f58e16f339f488f406677b
speakeasyVersion: 1.468.8
generationVersion: 2.493.19
releaseVersion: 2.0.14
configChecksum: d413f3ea951f34adef2528339fa6640a
repoURL: https://github.com/speakeasy-api/speakeasy-code-samples-ts.git
installationURL: https://github.com/speakeasy-api/speakeasy-code-samples-ts
published: true
features:
typescript:
additionalDependencies: 0.1.0
core: 3.18.14
core: 3.18.15
defaultEnabledRetries: 0.1.0
devContainers: 2.90.0
envVarSecurityUsage: 0.1.2
Expand Down Expand Up @@ -110,4 +110,55 @@ examples:
application/json: {"snippets": [{"operationId": "<id>", "language": "<value>", "code": "<value>"}, {"operationId": "<id>", "language": "<value>", "code": "<value>"}]}
4XX:
application/json: {"message": "<value>", "status_code": 558834}
"":
parameters:
query:
registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source"
operation_ids: ["getPetById"]
responses:
2XX:
application/json: {"snippets": [{"operationId": "<id>", "language": "<value>", "code": "<value>"}, {"operationId": "<id>", "language": "<value>", "code": "<value>"}]}
4XX:
application/json: {"message": "<value>", "status_code": 558834}
python:
parameters:
query:
registry_url: "https://spec.speakeasy.com/org/ws/my-source"
operation_ids: ["getPetById"]
languages: ["python"]
responses:
2XX:
application/json: {"snippets": [{"operationId": "<id>", "language": "<value>", "code": "<value>"}, {"operationId": "<id>", "language": "<value>", "code": "<value>"}]}
4XX:
application/json: {"message": "<value>", "status_code": 521235}
typescript:
parameters:
query:
registry_url: "https://spec.speakeasy.com/org/ws/my-source"
operation_ids: ["getPetById"]
languages: ["typescript"]
responses:
2XX:
application/json: {"snippets": [{"operationId": "<id>", "language": "<value>", "code": "<value>"}, {"operationId": "<id>", "language": "<value>", "code": "<value>"}, {"operationId": "<id>", "language": "<value>", "code": "<value>"}]}
4XX:
application/json: {"message": "<value>", "status_code": 458049}
java:
parameters:
query:
registry_url: "https://spec.speakeasy.com/org/ws/my-source"
operation_ids: ["getPetById"]
languages: ["java"]
responses:
2XX:
application/json: {"snippets": [{"operationId": "<id>", "language": "<value>", "code": "<value>"}]}
4XX:
application/json: {"message": "<value>", "status_code": 262795}
default:
parameters:
query:
registry_url: "https://spec.speakeasy.com/org/ws/my-source"
operation_ids: ["getPetById"]
responses:
2XX:
application/json: {"snippets": [{"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();"}]}
generatedTests: {}
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 2.0.13
version: 2.0.14
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
13 changes: 8 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
speakeasyVersion: 1.468.5
speakeasyVersion: 1.468.8
sources:
speakeasy-OAS:
sourceNamespace: speakeasy-oas
sourceRevisionDigest: sha256:eccb5c0b494c102a3985fedd96b152ad956b8be90681e6f5f21b5756463f66ab
sourceBlobDigest: sha256:6d9de4a70686f4366747b9dbf16917300a43dea8857ad6583f35ef3531bffbdb
sourceRevisionDigest: sha256:3f07a3b9272ae4fbeb71c9533bafeba3dc62eca59431c354f4890bf6dfe9514d
sourceBlobDigest: sha256:8d43792e5ba3b16a95d37ec0eb7a9a1e4e2cd81d1c9585e91edfea10f3dc24f3
tags:
- latest
- speakeasy-sdk-regen-1736994552
- 0.4.0
targets:
code_samples_typescript_sdk:
source: speakeasy-OAS
sourceNamespace: speakeasy-oas
sourceRevisionDigest: sha256:eccb5c0b494c102a3985fedd96b152ad956b8be90681e6f5f21b5756463f66ab
sourceBlobDigest: sha256:6d9de4a70686f4366747b9dbf16917300a43dea8857ad6583f35ef3531bffbdb
sourceRevisionDigest: sha256:3f07a3b9272ae4fbeb71c9533bafeba3dc62eca59431c354f4890bf6dfe9514d
sourceBlobDigest: sha256:8d43792e5ba3b16a95d37ec0eb7a9a1e4e2cd81d1c9585e91edfea10f3dc24f3
codeSamplesNamespace: speakeasy-oas-typescript-code-samples
codeSamplesRevisionDigest: sha256:c74c236d2c1a72c1120f1056d2d78219eed15bf1d981b6946a691fb93c53d084
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
8 changes: 7 additions & 1 deletion FUNCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamplesCore({

async function run() {
const res = await codeSamplesGet(speakeasyCodeSamples, {
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

switch (true) {
Expand Down
32 changes: 28 additions & 4 deletions REACT_QUERY.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ import { useCodeSamplesGet } from "@speakeasyapi/code-samples/react-query/codeSa

export function Example() {
const { data, error, status } = useCodeSamplesGet({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Render the UI here...
Expand All @@ -75,7 +81,13 @@ export function ExampleWithOptions() {
const [enabled, setEnabled] = useState(true);
const { data, error, status } = useCodeSamplesGet(
{
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
},
{
// TanStack Query options:
Expand Down Expand Up @@ -196,7 +208,13 @@ export function App() {

function Example() {
const { data } = useCodeSamplesGetSuspense({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Render the UI here...
Expand Down Expand Up @@ -227,7 +245,13 @@ export default async function Page() {
});

await prefetchCodeSamplesGet(queryClient, speakeasyCodeSamples, {
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

return (
Expand Down
73 changes: 61 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Developer-friendly & type-safe Typescript SDK specifically catered to leverage _
<!-- Start Summary [summary] -->
## Summary

Speakeasy API: The Subscriptions API manages subscriptions for CLI and registry events
Speakeasy Code Samples API: REST APIs for retrieving SDK usage snippets from the Speakeasy Code Samples API.


For more information about the API: [The Speakeasy Platform Documentation](/docs)
<!-- End Summary [summary] -->
Expand Down Expand Up @@ -111,7 +112,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({

async function run() {
const result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Handle the result
Expand Down Expand Up @@ -188,7 +195,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({

async function run() {
const result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Handle the result
Expand All @@ -208,7 +221,7 @@ run();

### [codeSamples](docs/sdks/codesamples/README.md)

* [get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets from document stored in the registry
* [get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets


</details>
Expand All @@ -229,7 +242,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).

<summary>Available standalone functions</summary>

- [`codeSamplesGet`](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets from document stored in the registry
- [`codeSamplesGet`](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets

</details>
<!-- End Standalone functions [standalone-funcs] -->
Expand All @@ -256,7 +269,7 @@ To learn about this feature and how to get started, check

<summary>Available React hooks</summary>

- [`useCodeSamplesGet`](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets from document stored in the registry
- [`useCodeSamplesGet`](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets

</details>
<!-- End React hooks with TanStack Query [react-query] -->
Expand Down Expand Up @@ -289,7 +302,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({

async function run() {
const result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Handle the result
Expand Down Expand Up @@ -317,7 +336,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({

async function run() {
const result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
}, {
retries: {
strategy: "backoff",
Expand Down Expand Up @@ -360,7 +385,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({

async function run() {
const result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Handle the result
Expand Down Expand Up @@ -400,7 +431,13 @@ async function run() {
let result;
try {
result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Handle the result
Expand Down Expand Up @@ -469,7 +506,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({

async function run() {
const result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Handle the result
Expand All @@ -494,7 +537,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({

async function run() {
const result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Handle the result
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,14 @@ Based on:
### Generated
- [typescript v2.0.9] .
### Releases
- [NPM v2.0.9] https://www.npmjs.com/package/@speakeasyapi/code-samples/v/2.0.9 - .
- [NPM v2.0.9] https://www.npmjs.com/package/@speakeasyapi/code-samples/v/2.0.9 - .

## 2025-01-16 02:28:57
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.468.8 (2.493.19) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v2.0.14] .
### Releases
- [NPM v2.0.14] https://www.npmjs.com/package/@speakeasyapi/code-samples/v/2.0.14 - .
8 changes: 7 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ const speakeasyCodeSamples = new SpeakeasyCodeSamples({

async function run() {
const result = await speakeasyCodeSamples.codeSamples.get({
registryUrl: "https://spec.speakeasy.com/org/ws/my-source",
registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source",
operationIds: [
"getPetById",
],
languages: [
"python",
],
});

// Handle the result
Expand Down
Loading

0 comments on commit 8255831

Please sign in to comment.