task: add domain entities for application runs and items#60
Open
task: add domain entities for application runs and items#60
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #60 +/- ##
==========================================
+ Coverage 96.16% 96.38% +0.22%
==========================================
Files 9 13 +4
Lines 1225 1301 +76
Branches 174 190 +16
==========================================
+ Hits 1178 1254 +76
Misses 47 47
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces domain “entity” wrappers in the SDK that enrich raw OpenAPI responses for application runs and run items with computed fields (progress, simplified status, and download eligibility), and updates PlatformSDKHttp to return these enriched entities.
Changes:
- Added
ApplicationRun+ApplicationRunItementity types, processors, and utility functions (with unit tests). - Updated
PlatformSDKHttp.listApplicationRuns(),getRun(), andlistRunResults()to return enriched entities. - Re-exported new entity APIs from the SDK entrypoint.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/src/platform-sdk.ts | Maps API responses through new processors and updates method return types. |
| packages/sdk/src/platform-sdk.test.ts | Adds assertions that enriched fields exist on SDK responses. |
| packages/sdk/src/index.ts | Exports new entity types/utilities/processors. |
| packages/sdk/src/entities/run-item/utils.ts | Adds derived item status + download eligibility helpers. |
| packages/sdk/src/entities/run-item/utils.spec.ts | Unit tests for run-item utility functions. |
| packages/sdk/src/entities/run-item/types.ts | Defines ApplicationRunItem and ItemStatus. |
| packages/sdk/src/entities/run-item/process-run-item.ts | Processor to enrich a raw run-item response. |
| packages/sdk/src/entities/run-item/process-run-item.spec.ts | Unit tests for run-item processor. |
| packages/sdk/src/entities/application-run/utils.ts | Adds derived run status/progress + download eligibility helpers. |
| packages/sdk/src/entities/application-run/utils.spec.ts | Unit tests for application-run utility functions. |
| packages/sdk/src/entities/application-run/types.ts | Defines ApplicationRun and RunStatus. |
| packages/sdk/src/entities/application-run/process-application-run.ts | Processor to enrich a raw run response. |
| packages/sdk/src/entities/application-run/process-application-run.spec.ts | Unit tests for application-run processor. |
| ATTRIBUTIONS.md | Updates recorded lodash-es version. |
packages/sdk/src/entities/application-run/process-application-run.spec.ts
Show resolved
Hide resolved
6de0a22 to
bf346d6
Compare
bf346d6 to
76dd43e
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Introduce domain entities for Application Runs and Run Items
Summary
Enrich raw API responses (
RunReadResponse,ItemResultReadResponse) with computed properties so SDK consumers no longer need to derive progress, status, or download eligibility themselves.listApplicationRuns(),getRun(), andlistRunResults()now returnApplicationRun/ApplicationRunItementities with:progress(runs only) — percentage (0–100) of items in a terminal statestatus— simplified human-readable status (PENDING,PROCESSING,COMPLETED,COMPLETED_WITH_ERRORS,CANCELED,FAILED/SKIPPED)can_download— whether results are available for downloadChanges
packages/sdk/src/entities/application-run/— types, utility functions, processor, and testspackages/sdk/src/entities/run-item/— types, utility functions, processor, and testsPlatformSDKHttpmethods to return enriched entitiespackages/sdk/src/index.ts