Implements full 4-step LinkedIn Videos API flow: download from public URL, initialize upload, 4MB chunk PUT with ETag collection, finalize, poll until AVAILABLE, then publish via POST /rest/posts reading post ID from x-restli-id. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
Phase 01 Plan 01: LinkedIn Video Upload Client Summary
Added linkedinRestRequest, uploadVideo, and createVideoPost to src/clients/linkedin.ts.
Accomplishments
linkedinRestRequesthelper: mirrorslinkedinRequestbut targetshttps://api.linkedin.com/restwithLinkedIn-Version: 202501headeruploadVideo(videoUrl, ownerUrn, accessToken): 5-step flow — download (ArrayBuffer, 120s timeout), initialize upload, chunk PUT at 4MB each with ETag collection, finalize, poll every 3s up to 90s untilAVAILABLEcreateVideoPost(args, customer): resolves token + profile, callsuploadVideo, posts viaPOST /rest/posts(not/v2/ugcPosts), reads post ID fromx-restli-idheader, wraps in audit log
Files Created/Modified
src/clients/linkedin.ts— added ~120 lines after existingcreatePost
Decisions Made
- Used inline
fetchforPOST /rest/poststo readx-restli-idheader before body is consumed void CHUNK_SIZEline keeps the constant referenced to avoid unused-var lint; actual slice ranges come fromuploadInstructions[].firstByte/lastByte- ETags stripped of surrounding quotes before passing to
finalizeUpload
Issues Encountered
redisandmysql2packages were not installed (node_moduleswas missing). Rannpm install— build became clean
Next Step
Ready for 01-02-PLAN.md