Micka33 / Micka33/x-api-sdk-ts

Provide helper methods for custom handling of the `Media.upload` steps

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Context

Currently, the `Media.upload` method handles all the upload steps synchronously and one chunk after another. If a chunk fails to be uploaded, the whole process fails.

There are cases where the developer might want to proceed differently, especially when the media is large, eg:
- To parallelize chunk uploads.
- To set custom retry logic when chunk upload fails.
- To use a queue to asynchronously upload each chunk of a media.

We need to expose the methods to allow these use cases.

## Todo

- [ ] Figure out which methods need to be exposed and created
- [ ] Implement / Expose required methods in `Media` class
- [ ] Update `IMedia` accordingly
- [ ] Use available Query and Response types
- [ ] Update unit tests
- [ ] Update integration tests
- [ ] Update Readme
- [ ] Add example of parallelized uploads
- [ ] Update Table of contents

Contributor guide

Open the contributing guide

Research direction

Start by reading the Media class, IMedia, and the existing Query and Response types to map the current Media.upload flow. Then inspect the unit and integration tests to identify the upload contract, and update the README with the supported custom-handling usage and parallel-upload example. Done means the required methods and interface changes are implemented and all tests and documentation are updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.