@cipherstash/stack 0.14.0 → 0.15.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @cipherstash/stack
2
2
 
3
+ ## 0.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 8513705: Fix mangled `eql_v2_encrypted` type in drizzle-kit migrations.
8
+
9
+ - `@cipherstash/stack/drizzle`'s `encryptedType` now returns the bare `eql_v2_encrypted` identifier from its Drizzle `customType.dataType()` callback. Returning the schema-qualified `"public"."eql_v2_encrypted"` (0.15.0) triggered a drizzle-kit quirk that wraps the return value in double-quotes and prepends `"{typeSchema}".` in ALTER COLUMN output — producing `"undefined".""public"."eql_v2_encrypted""`, which Postgres cannot parse.
10
+ - `stash db install` / `stash wizard`'s migration rewriter now matches all four forms drizzle-kit may emit (`eql_v2_encrypted`, `"public"."eql_v2_encrypted"`, `"undefined"."eql_v2_encrypted"`, `"undefined".""public"."eql_v2_encrypted""`) and rewrites each into the safe `ADD COLUMN … DROP COLUMN … RENAME COLUMN` sequence.
11
+
12
+ Users on 0.15.0 who hit this in generated migrations should upgrade and re-run `npx drizzle-kit generate` + `stash db install` (or re-run the wizard).
13
+
14
+ ## 0.15.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 1929c8f: Mark secrets as a coming soon feature and remove existing SDK integration.
19
+
3
20
  ## 0.14.0
4
21
 
5
22
  ### Minor Changes
@@ -1486,11 +1486,12 @@ function createEncryptionOperators(encryptionClient) {
1486
1486
  }
1487
1487
 
1488
1488
  // src/drizzle/index.ts
1489
+ var EQL_ENCRYPTED_DATA_TYPE = "eql_v2_encrypted";
1489
1490
  var columnConfigMap = /* @__PURE__ */ new Map();
1490
1491
  var encryptedType = (name, config) => {
1491
1492
  const customColumnType = (0, import_pg_core.customType)({
1492
1493
  dataType() {
1493
- return "eql_v2_encrypted";
1494
+ return EQL_ENCRYPTED_DATA_TYPE;
1494
1495
  },
1495
1496
  toDriver(value) {
1496
1497
  const jsonStr = JSON.stringify(value);
@@ -1530,7 +1531,8 @@ var encryptedType = (name, config) => {
1530
1531
  function getEncryptedColumnConfig(columnName, column) {
1531
1532
  if (column && typeof column === "object") {
1532
1533
  const columnAny = column;
1533
- const isEncrypted = columnAny.sqlName === "eql_v2_encrypted" || columnAny.dataType === "eql_v2_encrypted" || columnAny.dataType && typeof columnAny.dataType === "function" && columnAny.dataType() === "eql_v2_encrypted";
1534
+ const isEncryptedTypeString = (value) => value === EQL_ENCRYPTED_DATA_TYPE || value === '"public"."eql_v2_encrypted"';
1535
+ const isEncrypted = isEncryptedTypeString(columnAny.sqlName) || isEncryptedTypeString(columnAny.dataType) || columnAny.dataType && typeof columnAny.dataType === "function" && isEncryptedTypeString(columnAny.dataType());
1534
1536
  if (isEncrypted) {
1535
1537
  if (columnAny._encryptionConfig) {
1536
1538
  return columnAny._encryptionConfig;