juzpost-cli 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ - Send `contentLength` with upload presign requests — the JuzPost API now
6
+ requires it and enforces per-content-type size limits before issuing a URL.
7
+
3
8
  ## 0.1.1
4
9
 
5
10
  - Rewrote the README for discoverability: detailed usage, smart-scheduling
package/dist/upload.js CHANGED
@@ -19,8 +19,8 @@ export function contentTypeFor(file) {
19
19
  export async function uploadMedia(filePath, opts = {}) {
20
20
  const contentType = contentTypeFor(filePath);
21
21
  const relativeKey = opts.relativeKey ?? `media/${basename(filePath)}`;
22
- const { signedUrl, resolvedKey } = await api('/api/cli/v1/storage/presign', { method: 'POST', body: { relativeKey, contentType, operation: 'upload' } });
23
22
  const bytes = readFileSync(filePath);
23
+ const { signedUrl, resolvedKey } = await api('/api/cli/v1/storage/presign', { method: 'POST', body: { relativeKey, contentType, operation: 'upload', contentLength: bytes.length } });
24
24
  const res = await fetch(signedUrl, { method: 'PUT', headers: { 'content-type': contentType }, body: bytes });
25
25
  if (!res.ok)
26
26
  throw new ApiError(res.status, `R2 upload failed (HTTP ${res.status})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juzpost-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Social media scheduling from the terminal — schedule & auto-post short-form videos to TikTok, YouTube Shorts & Instagram. A fast, scriptable CLI social media scheduler.",
5
5
  "keywords": [
6
6
  "social-media-scheduling",