@coffre/db 0.8.1 → 0.9.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.
Files changed (38) hide show
  1. package/dist/connect.d.ts +1 -1
  2. package/dist/{database-BEnexh-3.d.ts → database-hd1hAll-.d.ts} +1 -1
  3. package/dist/dialect.d.ts +1 -1
  4. package/dist/grants.d.ts +1 -1
  5. package/dist/hyperdrive.d.ts +1 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/log.d.ts +1 -1
  8. package/dist/migrations/postgres/0010_handle_places.sql +2 -0
  9. package/dist/migrations/postgres/0011_plain_values.sql +19 -0
  10. package/dist/migrations/postgres/meta/0010_snapshot.json +2991 -0
  11. package/dist/migrations/postgres/meta/0011_snapshot.json +2997 -0
  12. package/dist/migrations/postgres/meta/_journal.json +14 -0
  13. package/dist/migrations/sqlite/0010_handle_places.sql +2 -0
  14. package/dist/migrations/sqlite/0011_plain_values.sql +14 -0
  15. package/dist/migrations/sqlite/meta/0010_snapshot.json +2711 -0
  16. package/dist/migrations/sqlite/meta/0011_snapshot.json +2718 -0
  17. package/dist/migrations/sqlite/meta/_journal.json +14 -0
  18. package/dist/portable.d.ts +2 -2
  19. package/dist/{schema-BZRkBJQZ.d.ts → schema-CCYKTG-E.d.ts} +34 -0
  20. package/dist/schema-sqlite.d.ts +38 -0
  21. package/dist/schema-sqlite.js +3 -1
  22. package/dist/schema-version.d.ts +1 -1
  23. package/dist/schema-version.js +28 -0
  24. package/dist/schema.d.ts +1 -1
  25. package/dist/schema.js +3 -1
  26. package/package.json +2 -2
  27. package/src/migrations/postgres/0010_handle_places.sql +2 -0
  28. package/src/migrations/postgres/0011_plain_values.sql +19 -0
  29. package/src/migrations/postgres/meta/0010_snapshot.json +2991 -0
  30. package/src/migrations/postgres/meta/0011_snapshot.json +2997 -0
  31. package/src/migrations/postgres/meta/_journal.json +14 -0
  32. package/src/migrations/sqlite/0010_handle_places.sql +2 -0
  33. package/src/migrations/sqlite/0011_plain_values.sql +14 -0
  34. package/src/migrations/sqlite/meta/0010_snapshot.json +2711 -0
  35. package/src/migrations/sqlite/meta/0011_snapshot.json +2718 -0
  36. package/src/migrations/sqlite/meta/_journal.json +14 -0
  37. package/src/schema.sqlite.ts +7 -0
  38. package/src/schema.ts +7 -0
@@ -71,6 +71,20 @@
71
71
  "when": 1792281879553,
72
72
  "tag": "0009_handles",
73
73
  "breakpoints": true
74
+ },
75
+ {
76
+ "idx": 10,
77
+ "version": "7",
78
+ "when": 1792314999425,
79
+ "tag": "0010_handle_places",
80
+ "breakpoints": true
81
+ },
82
+ {
83
+ "idx": 11,
84
+ "version": "7",
85
+ "when": 1792317460399,
86
+ "tag": "0011_plain_values",
87
+ "breakpoints": true
74
88
  }
75
89
  ]
76
90
  }
@@ -0,0 +1,2 @@
1
+ -- A handle's places (0.9): the environments it was made for, by id and whether as @me, which the proxy's stable URL resolves to. A nullable column the release before neither reads nor writes; the app sets it when it makes a handle, and never after (no UPDATE grant).
2
+ ALTER TABLE `credentials` ADD `places` text;
@@ -0,0 +1,14 @@
1
+ -- Plain values (0.9): a version of a key marked not secret holds its value in the clear too. Nullable, so the release before writes on as it did.
2
+ ALTER TABLE `secret_versions` ADD `plaintext` text;--> statement-breakpoint
3
+ -- A version is still only ever erased, and an erased one holds no value, in the clear or not.
4
+ DROP TRIGGER `secret_versions_erase_only`;--> statement-breakpoint
5
+ CREATE TRIGGER `secret_versions_erase_only` BEFORE UPDATE ON `secret_versions`
6
+ WHEN length(NEW.`ciphertext`) <> 0 OR length(NEW.`wrapped_dek`) <> 0 OR NEW.`plaintext` IS NOT NULL
7
+ OR NEW.`id` IS NOT OLD.`id` OR NEW.`secret_id` IS NOT OLD.`secret_id` OR NEW.`version` IS NOT OLD.`version`
8
+ OR NEW.`envelope_version` IS NOT OLD.`envelope_version` OR NEW.`iv` IS NOT OLD.`iv` OR NEW.`auth_tag` IS NOT OLD.`auth_tag`
9
+ OR NEW.`kek_provider` IS NOT OLD.`kek_provider` OR NEW.`kek_id` IS NOT OLD.`kek_id` OR NEW.`kek_version` IS NOT OLD.`kek_version`
10
+ OR NEW.`created_at` IS NOT OLD.`created_at` OR NEW.`created_by` IS NOT OLD.`created_by`
11
+ OR NEW.`recipe` IS NOT OLD.`recipe` OR NEW.`pair_id` IS NOT OLD.`pair_id` OR NEW.`pair_half` IS NOT OLD.`pair_half`
12
+ BEGIN
13
+ SELECT RAISE(ABORT, 'a secret version is only ever erased');
14
+ END;