@miniaxolotl/grove-server 1.11.24 → 1.11.28

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/dist/bootstrap.js CHANGED
@@ -2254,6 +2254,32 @@ var aiPreferences = {
2254
2254
  }
2255
2255
  };
2256
2256
 
2257
+ // lib/database/src/proofing-migration.ts
2258
+ var proofingConsents = {
2259
+ name: "20261118_044_proofing_consent",
2260
+ async up(db2) {
2261
+ await db2.raw(`CREATE TABLE proofing_consents (
2262
+ account_id uuid NOT NULL REFERENCES accounts(id) ON DELETE CASCADE,
2263
+ scope text NOT NULL CHECK(scope='grove-note-editor'),
2264
+ version integer NOT NULL CHECK(version>0),
2265
+ generation uuid NOT NULL,
2266
+ automatic boolean NOT NULL,
2267
+ updated_at timestamptz NOT NULL DEFAULT now(),
2268
+ revoked_at timestamptz,
2269
+ CHECK(revoked_at IS NULL OR NOT automatic),
2270
+ PRIMARY KEY(account_id,scope)
2271
+ );
2272
+ ALTER TABLE proofing_consents ENABLE ROW LEVEL SECURITY;
2273
+ ALTER TABLE proofing_consents FORCE ROW LEVEL SECURITY;
2274
+ CREATE POLICY tenant ON proofing_consents USING(account_id=nullif(current_setting('grove.account_id',true),'')::uuid);
2275
+ GRANT SELECT, INSERT, UPDATE ON proofing_consents TO grove_runtime;
2276
+ GRANT SELECT, DELETE ON proofing_consents TO grove_worker;`);
2277
+ },
2278
+ async down() {
2279
+ throw new Error("Use a forward migration");
2280
+ }
2281
+ };
2282
+
2257
2283
  // lib/database/src/soft-deletion.ts
2258
2284
  async function softDeletion(db2) {
2259
2285
  for (const table of [
@@ -3753,7 +3779,8 @@ var migrations = [
3753
3779
  billingTrial,
3754
3780
  writingAllowance,
3755
3781
  dailyNotes,
3756
- cacheRetention
3782
+ cacheRetention,
3783
+ proofingConsents
3757
3784
  ];
3758
3785
  var migrationSource = {
3759
3786
  getMigrations: async () => migrations,