diff --git a/src/clients/linkedin.ts b/src/clients/linkedin.ts index d2d8d1e..ca3cc17 100644 --- a/src/clients/linkedin.ts +++ b/src/clients/linkedin.ts @@ -133,7 +133,7 @@ async function linkedinRestRequest( headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json', - 'LinkedIn-Version': '202501', + 'LinkedIn-Version': '202603', 'X-Restli-Protocol-Version': '2.0.0', }, body: body ? JSON.stringify(body) : undefined, @@ -224,7 +224,7 @@ export async function createVideoPost( headers: { 'Authorization': `Bearer ${accessToken}`, 'Content-Type': 'application/json', - 'LinkedIn-Version': '202501', + 'LinkedIn-Version': '202603', 'X-Restli-Protocol-Version': '2.0.0', }, body: JSON.stringify({ diff --git a/src/index.ts b/src/index.ts index c8da27e..d528124 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,9 @@ app.use(cors({ app.use(express.json()); app.use(express.urlencoded({ extended: true })); +// ── Static files (videos, assets) ────────────────────────────────────────── +app.use('/public', express.static('/vaults/public')); + // ── Config ───────────────────────────────────────────────────────────────── const PORT = process.env.PORT ?? 3456; const SERVER_URL = process.env.SERVER_URL ?? `http://localhost:${PORT}`; diff --git a/src/manifest.ts b/src/manifest.ts index 58258be..1b702eb 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -342,6 +342,30 @@ export function getOpenApiSpec(serverUrl: string) { responses: { '200': { description: 'Post created' } }, }, }, + '/api/linkedin/video': { + post: { + operationId: 'linkedin_upload_video', + summary: 'Upload video and create LinkedIn post', + requestBody: { + required: true, + content: { + 'application/json': { + schema: { + type: 'object', + required: ['video_url', 'text'], + properties: { + video_url: { type: 'string', description: 'Publicly accessible URL of the MP4 video' }, + text: { type: 'string' }, + visibility: { type: 'string', enum: ['PUBLIC', 'CONNECTIONS'] }, + account: { type: 'string' }, + }, + }, + }, + }, + }, + responses: { '200': { description: 'Video uploaded and posted' } }, + }, + }, // ── Telegram ──────────────────────────────────────────────── '/api/telegram/message': {