@mevdragon/vidfarm-devcli 0.12.0 → 0.13.0

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.
@@ -151,6 +151,14 @@ class ServerlessRecordsServiceImpl {
151
151
  });
152
152
  }
153
153
  async getLatestApiKeyForCustomer(customerId) {
154
+ const keys = await this.listActiveApiKeysForCustomer(customerId, 1);
155
+ return keys[0] ?? null;
156
+ }
157
+ // Newest-first active API key records. Callers that hand a key to a client
158
+ // (boot configs, Settings) should pick one the CURRENT server can validate —
159
+ // after an API_KEY_SALT rotation the shared table holds keys hashed under
160
+ // different salts (deployed stage vs local dev boxes).
161
+ async listActiveApiKeysForCustomer(customerId, limit = 25) {
154
162
  const response = await dynamodb.send(new QueryCommand({
155
163
  TableName: requireMainTableName(),
156
164
  IndexName: "gsi1",
@@ -164,9 +172,9 @@ class ServerlessRecordsServiceImpl {
164
172
  ":status": "active"
165
173
  },
166
174
  ScanIndexForward: false,
167
- Limit: 1
175
+ Limit: limit
168
176
  }));
169
- return response.Items?.[0] ?? null;
177
+ return response.Items ?? [];
170
178
  }
171
179
  async hasCustomerCreditGrant(customerId, grantType) {
172
180
  return Boolean(await this.getById("credit_grant", `${customerId}:${grantType}`));
@@ -390,6 +398,7 @@ class ServerlessRecordsServiceImpl {
390
398
  templateId: null,
391
399
  trendTagline: input.trendTagline ?? null,
392
400
  visibility: input.visibility ?? "public",
401
+ origin: input.origin ?? "inspiration",
393
402
  notes: input.notes ?? null,
394
403
  errorMessage: null,
395
404
  createdAt: timestamp,
@@ -446,6 +455,7 @@ class ServerlessRecordsServiceImpl {
446
455
  viralDna: input.viralDna ?? null,
447
456
  defaultForkId: input.defaultForkId ?? null,
448
457
  visibility: input.visibility ?? "public",
458
+ origin: input.origin ?? "inspiration",
449
459
  notes: input.notes ?? null,
450
460
  createdAt: timestamp,
451
461
  updatedAt: timestamp
@@ -162,6 +162,18 @@ export class StorageService {
162
162
  async getReadUrl(key) {
163
163
  return this.createReadUrl(key);
164
164
  }
165
+ // Absolute on-disk path for a key — local driver only (null on S3), for
166
+ // callers that hand the file to a local process (ffmpeg) without copying.
167
+ getLocalPath(key) {
168
+ if (this.s3 && config.AWS_S3_BUCKET)
169
+ return null;
170
+ try {
171
+ return this.resolveLocalPath(key);
172
+ }
173
+ catch {
174
+ return null;
175
+ }
176
+ }
165
177
  async createWriteUrl(key, input) {
166
178
  if (!this.s3 || !config.AWS_S3_BUCKET) {
167
179
  throw new Error("Presigned uploads require S3 storage.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mevdragon/vidfarm-devcli",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Local bridge for the Vidfarm Trackpad Editor. `vidfarm serve <template_id>` boots the FULL editor on localhost (disk-backed records/storage, free in-process render); edit composition.html on disk (Claude Code, Codex, etc.) and the browser live-morphs it.",
5
5
  "type": "module",
6
6
  "bin": {