squidcloudctl 3.0.3 → 3.0.4

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.
@@ -138,10 +138,18 @@ async function fetchVaultKey(fileId) {
138
138
  },
139
139
  body: JSON.stringify({ fileId }),
140
140
  });
141
+ if (r.status === 500) {
142
+ const t = await r.text().catch(() => '');
143
+ if (/decrypt file key/i.test(t)) {
144
+ throw new Error('VAULT_KEY_DRIFT: the SQUIDVEIL_MASTER_KEY secret has drifted since this file was uploaded - restore it in Supabase > Edge Functions > Secrets to decrypt managed files.');
145
+ }
146
+ }
141
147
  const d = (await r.json());
142
148
  return d?.success && d.key ? d.key : null;
143
149
  }
144
- catch {
150
+ catch (err) {
151
+ if (err instanceof Error && err.message.startsWith('VAULT_KEY_DRIFT'))
152
+ throw err;
145
153
  return null;
146
154
  }
147
155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squidcloudctl",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "SquidCloud CLI (squidcloudctl) — encrypted storage, shares and secrets from your terminal",
5
5
  "main": "dist/bin/squidcloud.js",
6
6
  "bin": {