From 40c37966d74b8439da7f94fd0a2c2afecd9908fc Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Wed, 21 Aug 2024 11:55:35 +0200 Subject: [PATCH] refactor: rename target (#3) This commit renames the target to prevent naming conflicts with the regular JS/TS library. --- .speakeasy/gen.lock | 8 ++++---- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 18 ++++++------------ .speakeasy/workflow.yaml | 2 +- codeSamples.yaml | 24 ++++++++++++------------ docs/sdks/livepeerai/README.md | 20 +++++++++----------- jsr.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/lib/config.ts | 6 +++--- 10 files changed, 40 insertions(+), 48 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1ff2c97..9ef0dc3 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 8766970f-4397-4dff-8082-81333329536d management: docChecksum: c222ffbf28e5f62770dc8cbd99010f96 docVersion: v0.1.2 - speakeasyVersion: 1.376.1 - generationVersion: 2.402.5 - releaseVersion: 0.1.2 - configChecksum: b0d2f710722fbf4899c5f3e77fcbd33f + speakeasyVersion: 1.377.0 + generationVersion: 2.404.0 + releaseVersion: 0.1.3 + configChecksum: eefe057d141baa2c05728e0706976ccb repoURL: https://github.com/livepeer/livepeer-ai-js.git installationURL: https://github.com/livepeer/livepeer-ai-js features: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1973332..a5a8d2c 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -15,7 +15,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.1.2 + version: 0.1.3 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 80463a4..d4b422c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,25 +1,19 @@ -speakeasyVersion: 1.376.1 +speakeasyVersion: 1.377.0 sources: livepeer-ai-OAS: sourceNamespace: livepeer-ai-oas - sourceRevisionDigest: sha256:c3a8dccb8a3f822b82931d3d9e3cb7f4eb6d164d3f289a3c0c7b3dd98de913d3 + sourceRevisionDigest: sha256:8e8a89195aea8aa7f8c0c2674946515904ddca346b557a631cf5a4c6c81529d6 sourceBlobDigest: sha256:e2549433c2d09c42e52916d511a18269d4ce6e728cd487f043ab8e82991b4d36 tags: - latest targets: - livepeer-ai: + livepeer-ai-ts: source: livepeer-ai-OAS sourceNamespace: livepeer-ai-oas - sourceRevisionDigest: sha256:d9dab0807effddb874fd488be2aa51ce7ff20cf0e2fc832d8aff9cee8f5eb9a8 - sourceBlobDigest: sha256:81af44ae23c4192a9493c755662ebeafd4293968b1ff919f0acccefbb9a1bd3f - outLocation: /home/ricks/development/livepeer/ai/livepeer-ai-js - livepeer-ts: - source: livepeer-ai-OAS - sourceNamespace: livepeer-ai-oas - sourceRevisionDigest: sha256:c3a8dccb8a3f822b82931d3d9e3cb7f4eb6d164d3f289a3c0c7b3dd98de913d3 + sourceRevisionDigest: sha256:8e8a89195aea8aa7f8c0c2674946515904ddca346b557a631cf5a4c6c81529d6 sourceBlobDigest: sha256:e2549433c2d09c42e52916d511a18269d4ce6e728cd487f043ab8e82991b4d36 codeSamplesNamespace: code-samples-typescript-livepeer-ts - codeSamplesRevisionDigest: sha256:f5f04f8efc644b6e81cd50641403c143e83a31d4136e8a7b99d62473c78ce7fb + codeSamplesRevisionDigest: sha256:182828739e43b7d566a95d4d25cec1db4cfede926d44f4f080defb317f99f553 outLocation: /home/ricks/development/livepeer/ai/livepeer-ai-js workflow: workflowVersion: 1.0.0 @@ -31,7 +25,7 @@ workflow: registry: location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeer-ai-oas targets: - livepeer-ts: + livepeer-ai-ts: target: typescript source: livepeer-ai-OAS codeSamples: diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index dfb5520..0ba6c63 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -7,7 +7,7 @@ sources: registry: location: registry.speakeasyapi.dev/livepeer-8mq/livepeer-ai/livepeer-ai-oas targets: - livepeer-ts: + livepeer-ai-ts: target: typescript source: livepeer-ai-OAS codeSamples: diff --git a/codeSamples.yaml b/codeSamples.yaml index 50fe5a2..1fc9bbc 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,6 +3,18 @@ info: title: CodeSamples overlay for typescript target version: 0.0.0 actions: + - target: $["paths"]["/upscale"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "upscale" + "source": "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.upscale({\n prompt: \"\",\n image: await openAsBlob(\"./sample-file\"),\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/audio-to-text"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "audio_to_text" + "source": "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.audioToText({\n audio: await openAsBlob(\"./sample-file\"),\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/text-to-image"]["post"] update: "x-codeSamples": @@ -21,15 +33,3 @@ actions: - "lang": "typescript" "label": "image_to_video" "source": "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.imageToVideo({\n image: await openAsBlob(\"./sample-file\"),\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" - - target: $["paths"]["/upscale"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "upscale" - "source": "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.upscale({\n prompt: \"\",\n image: await openAsBlob(\"./sample-file\"),\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" - - target: $["paths"]["/audio-to-text"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "audio_to_text" - "source": "import { LivepeerAI } from \"livepeer-ai\";\nimport { openAsBlob } from \"node:fs\";\n\nconst livepeerAI = new LivepeerAI({\n httpBearer: \"\",\n});\n\nasync function run() {\n const result = await livepeerAI.audioToText({\n audio: await openAsBlob(\"./sample-file\"),\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" diff --git a/docs/sdks/livepeerai/README.md b/docs/sdks/livepeerai/README.md index cb5f37e..04eadc2 100644 --- a/docs/sdks/livepeerai/README.md +++ b/docs/sdks/livepeerai/README.md @@ -1,6 +1,5 @@ # LivepeerAI SDK - ## Overview Livepeer AI Runner: An application to run AI pipelines @@ -38,7 +37,6 @@ async function run() { run(); ``` - ### Standalone function The standalone function version of this method: @@ -80,10 +78,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.TextToImageResponse](../../models/operations/texttoimageresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | @@ -92,6 +90,7 @@ run(); | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4xx-5xx | */* | + ## imageToImage Image To Image @@ -119,7 +118,6 @@ async function run() { run(); ``` - ### Standalone function The standalone function version of this method: @@ -163,10 +161,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.ImageToImageResponse](../../models/operations/imagetoimageresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | @@ -175,6 +173,7 @@ run(); | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4xx-5xx | */* | + ## imageToVideo Image To Video @@ -201,7 +200,6 @@ async function run() { run(); ``` - ### Standalone function The standalone function version of this method: @@ -244,10 +242,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.ImageToVideoResponse](../../models/operations/imagetovideoresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | @@ -256,6 +254,7 @@ run(); | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4xx-5xx | */* | + ## upscale Upscale @@ -283,7 +282,6 @@ async function run() { run(); ``` - ### Standalone function The standalone function version of this method: @@ -327,10 +325,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.UpscaleResponse](../../models/operations/upscaleresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | @@ -339,6 +337,7 @@ run(); | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4xx-5xx | */* | + ## audioToText Audio To Text @@ -365,7 +364,6 @@ async function run() { run(); ``` - ### Standalone function The standalone function version of this method: @@ -408,10 +406,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.AudioToTextResponse](../../models/operations/audiototextresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/jsr.json b/jsr.json index 3dd9827..f52a743 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "livepeer-ai", - "version": "0.1.2", + "version": "0.1.3", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 4ff4072..03f563b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "livepeer-ai", - "version": "0.1.2", + "version": "0.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "livepeer-ai", - "version": "0.1.2", + "version": "0.1.3", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index e2f6b3c..64e4bce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "livepeer-ai", - "version": "0.1.2", + "version": "0.1.3", "author": "Livepeer", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index 81a1642..ff3436c 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -57,7 +57,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "v0.1.2", - sdkVersion: "0.1.2", - genVersion: "2.402.5", - userAgent: "speakeasy-sdk/typescript 0.1.2 2.402.5 v0.1.2 livepeer-ai", + sdkVersion: "0.1.3", + genVersion: "2.404.0", + userAgent: "speakeasy-sdk/typescript 0.1.3 2.404.0 v0.1.2 livepeer-ai", } as const;