diff --git a/.github/workflows/sdk-frozen-check.yml b/.github/workflows/sdk-frozen-check.yml new file mode 100644 index 0000000..088cd5f --- /dev/null +++ b/.github/workflows/sdk-frozen-check.yml @@ -0,0 +1,24 @@ +name: SDK frozen workspace install +on: + pull_request: +permissions: + contents: read +jobs: + sdk: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 + with: + node-version: '24' + - name: Frozen install of all workspace importers + run: | + pnpm install --frozen-lockfile + git diff --exit-code -- pnpm-lock.yaml + - name: Build, test and pack the published SDK + run: | + pnpm --filter '@tangle-network/tcloud...' run build + pnpm --filter @tangle-network/tcloud test + pnpm --dir packages/tcloud pack --pack-destination "$RUNNER_TEMP" diff --git a/packages/tcloud/package.json b/packages/tcloud/package.json index 22bcdf8..13c8c17 100644 --- a/packages/tcloud/package.json +++ b/packages/tcloud/package.json @@ -1,6 +1,6 @@ { "name": "@tangle-network/tcloud", - "version": "0.5.2", + "version": "0.5.3", "description": "TypeScript SDK and CLI for Tangle Router, Sandbox, model routing, and agent service calls", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/tcloud/src/client.ts b/packages/tcloud/src/client.ts index 484c9bc..29cda28 100644 --- a/packages/tcloud/src/client.ts +++ b/packages/tcloud/src/client.ts @@ -1097,7 +1097,7 @@ export class TCloudClient { /** Generate video */ async videoGenerate(options: VideoGenerateOptions): Promise { - return this._request(`${this.baseURL}/video/generate`, { + return this._request(`${this.baseURL}/videos`, { method: 'POST', body: JSON.stringify(options), }) @@ -1105,7 +1105,7 @@ export class TCloudClient { /** Get video generation status */ async videoStatus(id: string): Promise { - return this._fetch(`${this.baseURL}/video/${encodeURIComponent(id)}`) + return this._fetch(`${this.baseURL}/videos/${encodeURIComponent(id)}`) } /** Generate an avatar video (lip-synced talking head from audio + face image). diff --git a/packages/tcloud/tests/api-methods.test.ts b/packages/tcloud/tests/api-methods.test.ts index 95506f9..c13257a 100644 --- a/packages/tcloud/tests/api-methods.test.ts +++ b/packages/tcloud/tests/api-methods.test.ts @@ -371,7 +371,7 @@ describe('video generation', () => { generate_audio: true, }) - expect(fn.mock.calls[0][0]).toBe('https://router.tangle.tools/v1/video/generate') + expect(fn.mock.calls[0][0]).toBe('https://router.tangle.tools/v1/videos') const body = JSON.parse(fn.mock.calls[0][1].body) expect(body).toMatchObject({ provider: 'kling', @@ -390,7 +390,7 @@ describe('video generation', () => { globalThis.fetch = fn const client = new TCloudClient({ apiKey: 'sk-tan-test' }) await client.videoStatus('orv_job') - expect(fn.mock.calls[0][0]).toBe('https://router.tangle.tools/v1/video/orv_job') + expect(fn.mock.calls[0][0]).toBe('https://router.tangle.tools/v1/videos/orv_job') }) })