e3ds-automation-kit
v0.2.1
Published
Eagle 3D Streaming Automation Kit
Readme
Eagle 3D Streaming Automation Kit
A Node.js library for doing specific tasks related to Eagle 3D Streaming in an automated procedure, thus being beneficial for usage in different scenarios like CI-CD pipeline or Unit Testing etc.
Environment Setup
npm install e3ds-automation-kitFeatures
Streaming App Uploader
- Auto-detects storage provider (Cloudflare R2 vs legacy) and uploads accordingly.
- R2 accounts: chunked multipart upload directly to R2, with per-part retry and concurrency.
- Legacy accounts: request signed URL for file upload, upload with progress bar.
- Register uploaded exe info.
- Poll stream test result until the app is renamed or timed out.
- Retry on failures.
Pseudo Code / Process Flow
- Start uploadStreamingApp(fileLocation, apiKey, appName)
- Check if file exists locally
- Check storage provider (GET /api/storage-provider) -> If 'r2': a. Initiate R2 multipart upload (r2-initiate-upload) -> get uploadId, key, chunkSize, totalParts b. For each batch of parts (6 concurrent at a time): - Request presigned part URLs (r2-batch-part-urls) - PUT each part directly to R2, capturing its ETag -> Retry per-part on failure c. Complete the multipart upload (r2-complete-upload) -> Otherwise (legacy storage): a. Request a signed URL for the file -> Retry on failure up to N times b. Upload the file using the signed URL via PUT -> Show progress bar -> Retry on failure -> If the storage provider check itself fails, falls back to the legacy flow
- Call exe-info-upload API with:
- appName
- version
- username
- exePaths
- appSize
- Poll stream test API (get-streamtest-result)
- Wait until 'isRenamed' is true or 10 minutes pass
- Retry every 30 seconds
- Finish process and log completion
Usage Example
const { uploadStreamingApp } = require("e3ds-automation-kit");
(async () => {
try {
await uploadStreamingApp(
"./myAppBuild.zip", // Path to the local file
"YOUR_EAGLE3D_API_KEY", // API key
"MyStreamingApp" // App name
);
console.log("Upload completed successfully!");
} catch (err) {
console.error("Upload failed:", err.message);
}
})();
Notes
appNamemust contain only letters (A–Z, a–z), numbers (0–9), or underscores (_) — no spaces or other special characters. An invalidappNamethrows immediately, before any upload starts.- Ensure the apiKey is valid and has permission to upload apps.
- File upload will automatically retry if network issues occur (per-part retry for R2, whole-file retry for legacy).
- The storage provider is auto-detected per account; no configuration is needed to opt into R2 uploads.
- Stream test polling lasts up to 10 minutes; if not renamed, a warning will be logged.
- Progress bars are displayed in the console using cli-progress.
Example Output (legacy storage)
[Uploader] Preparing upload for MyStreamingApp (50 MB / 0.05 GB)
[Uploader] Checking storage provider...
[Uploader] Storage provider: coreweave
[Uploader] Using legacy signed-URL upload flow.
[Uploader] Got signed URL. Version: uv-1-1759415059018
[#######...........] 50% | myAppBuild.zip | 25/50 MB
[Uploader] File upload complete.
[Uploader] stream-test invoke response: {"status":"success"}
[Uploader] Polling stream test result for MyStreamingApp_uv-1-1759415059018...
[Uploader] Stream test successful ✅
[Uploader] Upload process completed for app: MyStreamingApp (version: uv-1-1759415059018)
Upload completed successfully!Example Output (R2 storage)
[Uploader] Preparing upload for MyStreamingApp (600 MB / 0.59 GB)
[Uploader] Checking storage provider...
[Uploader] Storage provider: r2
[Uploader] Using R2 multipart upload flow.
[Uploader] R2 multipart upload initiated. Key: MyStreamingApp/uv-1-1759415059018.zip, Parts: 12, Part size: 50.00 MB
[Uploader] Requesting URLs for parts 1-6 of 12...
[Uploader] Requesting URLs for parts 7-12 of 12...
[#######...........] 50% | myAppBuild.zip | 300.00/600.00 MB
[Uploader] R2 multipart upload completed.
[Uploader] File upload complete.
[Uploader] stream-test invoke response: {"status":"success"}
[Uploader] Polling stream test result for MyStreamingApp_uv-1-1759415059018...
[Uploader] Stream test successful ✅
[Uploader] Upload process completed for app: MyStreamingApp (version: uv-1-1759415059018)
Upload completed successfully!