Skip to content

refactor(transcode): replace any types in Encore methods with generated EncoreJobRequest/Response - #140

Merged
birme merged 1 commit into
mainfrom
fix/133-encore-types
Jun 4, 2026
Merged

birme merged 1 commit into
mainfrom
fix/133-encore-types

Conversation

@birme

@birme birme commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Replaces implicit any types in the transcode package with generated Encore types from @osaas/client-services.

Changes:

  • encore.ts: createFetch<any> -> createFetch<EncoreJobResponse> with explicit import
  • transcode.ts: encoreJobs: any[] in JobList -> encoreJobs: EncoreJobResponse[]; job body typed as Partial<EncoreJobRequest> with field intersections for fields not yet in the generated schema
  • vodpipeline.ts: job body typed as Partial<EncoreJobRequest> with field intersections; response cast as EncoreJobResponse
  • index.ts: re-exports EncoreJobRequest and EncoreJobResponse for package consumers

Closes #133
Part of Eyevinn/osaas-app#4345

Lessons

EncoreJobRequest aliases the POST request body from the OpenAPI spec, which does not include some fields used at the call sites (baseName, seekTo, inputs, progressCallbackUri, profileParams). These are real fields accepted by Encore but not yet reflected in the generated spec. The approach used is Partial<EncoreJobRequest> & { fieldA?: type; ... } which keeps the typed fields type-safe without erroring on the extra fields. Attempting to use EncoreJobRequest directly would fail TypeScript with missing required fields. EncoreJobResponse resolves to EntityModelEncoreJob which has id as a direct optional field — no HAL nesting issue.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

…ed EncoreJobRequest/Response

Replaces implicit any with proper generated types from @osaas/client-services:
- encore.ts: import EncoreJobResponse and use in createFetch<EncoreJobResponse>
- transcode.ts: use EncoreJobRequest for job body, EncoreJobResponse[] in JobList
- vodpipeline.ts: use EncoreJobRequest for job body, cast response as EncoreJobResponse
- index.ts: re-export EncoreJobRequest and EncoreJobResponse for consumers

Closes #133. Part of Eyevinn/osaas-app#4345.

Co-Authored-By: Claude <noreply@anthropic.com>
@birme birme self-assigned this Jun 3, 2026
@birme
birme merged commit e9c726b into main Jun 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(transcode): replace any types in Encore methods with generated EncoreJobRequest/Response

1 participant