@senseihq/emaki-posting 0.1.2 → 0.1.3

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.
@@ -100,7 +100,7 @@ export async function putMedia(d, caller, key, request) {
100
100
  const got = await sha256(body);
101
101
  if (!want || got !== want)
102
102
  fail(400, `sha256 mismatch (got ${got})`);
103
- await d.media.put(key, body, { contentType: TYPES[key.split('.').pop() ?? ''] ?? 'application/octet-stream', sha256: got });
103
+ await d.media.put(key, body, { contentType: TYPES[key.split('.').pop()] ?? 'application/octet-stream', sha256: got });
104
104
  await d.store.audit(caller.id, 'upload', key.split('/')[0], null, `${key} ${got.slice(0, 12)}`);
105
105
  return { ok: true, key, sha256: got, bytes: body.byteLength };
106
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senseihq/emaki-posting",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "The motion stories posting desk: stage, approve exactly what was staged, post on schedule. Framework-free core with Cloudflare (D1/R2/Access) and SvelteKit adapters.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -106,7 +106,7 @@ export async function putMedia(d: DeskContext, caller: Caller, key: string, requ
106
106
  if (body.byteLength > MAX) fail(413, 'Too large');
107
107
  const got = await sha256(body);
108
108
  if (!want || got !== want) fail(400, `sha256 mismatch (got ${got})`);
109
- await d.media.put(key, body, { contentType: TYPES[key.split('.').pop() ?? ''] ?? 'application/octet-stream', sha256: got });
109
+ await d.media.put(key, body, { contentType: TYPES[key.split('.').pop()!] ?? 'application/octet-stream', sha256: got });
110
110
  await d.store.audit(caller.id, 'upload', key.split('/')[0], null, `${key} ${got.slice(0, 12)}`);
111
111
  return { ok: true, key, sha256: got, bytes: body.byteLength };
112
112
  }