@cipherstash/stack 0.6.0 → 0.8.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 (57) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +8 -0
  3. package/dist/bin/stash.js +22 -3
  4. package/dist/bin/stash.js.map +1 -1
  5. package/dist/{chunk-YLISU7FD.js → chunk-3BOJHROP.js} +3 -3
  6. package/dist/{chunk-TGUELLJS.js → chunk-4C52Q5R6.js} +10 -2
  7. package/dist/chunk-4C52Q5R6.js.map +1 -0
  8. package/dist/{chunk-Y35W4WFN.js → chunk-Y3KSTOVR.js} +35 -4
  9. package/dist/chunk-Y3KSTOVR.js.map +1 -0
  10. package/dist/{client-CJueivkw.d.cts → client-CV7X5Hrt.d.cts} +7 -1
  11. package/dist/{client-hHEpZIZH.d.ts → client-_63nbmO7.d.ts} +7 -1
  12. package/dist/client.cjs +14 -3
  13. package/dist/client.cjs.map +1 -1
  14. package/dist/client.d.cts +2 -2
  15. package/dist/client.d.ts +2 -2
  16. package/dist/client.js +1 -1
  17. package/dist/drizzle/index.cjs +14 -3
  18. package/dist/drizzle/index.cjs.map +1 -1
  19. package/dist/drizzle/index.d.cts +2 -2
  20. package/dist/drizzle/index.d.ts +2 -2
  21. package/dist/drizzle/index.js +1 -1
  22. package/dist/dynamodb/index.d.cts +2 -2
  23. package/dist/dynamodb/index.d.ts +2 -2
  24. package/dist/encryption/index.cjs +19 -0
  25. package/dist/encryption/index.cjs.map +1 -1
  26. package/dist/encryption/index.d.cts +2 -2
  27. package/dist/encryption/index.d.ts +2 -2
  28. package/dist/encryption/index.js +2 -2
  29. package/dist/index.cjs +22 -3
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +3 -3
  32. package/dist/index.d.ts +3 -3
  33. package/dist/index.js +3 -3
  34. package/dist/schema/index.cjs +38 -5
  35. package/dist/schema/index.cjs.map +1 -1
  36. package/dist/schema/index.d.cts +1 -1
  37. package/dist/schema/index.d.ts +1 -1
  38. package/dist/schema/index.js +7 -3
  39. package/dist/secrets/index.cjs +22 -3
  40. package/dist/secrets/index.cjs.map +1 -1
  41. package/dist/secrets/index.d.cts +1 -1
  42. package/dist/secrets/index.d.ts +1 -1
  43. package/dist/secrets/index.js +3 -3
  44. package/dist/supabase/index.cjs +28 -5
  45. package/dist/supabase/index.cjs.map +1 -1
  46. package/dist/supabase/index.d.cts +2 -2
  47. package/dist/supabase/index.d.ts +2 -2
  48. package/dist/supabase/index.js +17 -5
  49. package/dist/supabase/index.js.map +1 -1
  50. package/dist/{types-public-07ilcGY-.d.ts → types-public-B5YxQhR6.d.cts} +25 -9
  51. package/dist/{types-public-07ilcGY-.d.cts → types-public-B5YxQhR6.d.ts} +25 -9
  52. package/dist/types-public.d.cts +1 -1
  53. package/dist/types-public.d.ts +1 -1
  54. package/package.json +1 -1
  55. package/dist/chunk-TGUELLJS.js.map +0 -1
  56. package/dist/chunk-Y35W4WFN.js.map +0 -1
  57. /package/dist/{chunk-YLISU7FD.js.map → chunk-3BOJHROP.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @cipherstash/stack
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3414761: Fixed Supabase or wrapper to escape EQL payloads correctly.
8
+
9
+ ## 0.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 1be8f81: Exposed a public method on the Encryption client to expose the build Encryption schema.
14
+
3
15
  ## 0.6.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -287,6 +287,14 @@ await supabase.from("users").select().eq("email", term.data)
287
287
 
288
288
  Each term in a batch can have its own `returnType`.
289
289
 
290
+ ### Ordering Encrypted Data
291
+
292
+ **`ORDER BY` on encrypted columns requires operator family support in the database.**
293
+
294
+ On databases without operator families (e.g. Supabase, or when EQL is installed with `--exclude-operator-family`), sorting on encrypted columns is not currently supported — regardless of the client or ORM used. Sort application-side after decrypting the results as a workaround.
295
+
296
+ Operator family support for Supabase is being developed in collaboration with the Supabase and CipherStash teams and will be available in a future release.
297
+
290
298
  ### PostgreSQL / Drizzle Integration Pattern
291
299
 
292
300
  Encrypted data is stored as an [EQL](https://github.com/cipherstash/encrypt-query-language) JSON payload. Install the EQL extension in PostgreSQL to enable searchable queries, then store encrypted data in `eql_v2_encrypted` columns.
package/dist/bin/stash.js CHANGED
@@ -1511,6 +1511,17 @@ function isEncryptedPayload(value) {
1511
1511
 
1512
1512
  // src/schema/index.ts
1513
1513
  import { z as z2 } from "zod";
1514
+ var eqlCastAsEnum = z2.enum([
1515
+ "text",
1516
+ "int",
1517
+ "small_int",
1518
+ "big_int",
1519
+ "real",
1520
+ "double",
1521
+ "boolean",
1522
+ "date",
1523
+ "jsonb"
1524
+ ]).default("text");
1514
1525
  var castAsEnum = z2.enum(["bigint", "boolean", "date", "number", "string", "json", "text"]).default("text");
1515
1526
  var tokenFilterSchema = z2.object({
1516
1527
  kind: z2.literal("downcase")
@@ -1559,7 +1570,7 @@ var EncryptedField = class {
1559
1570
  castAsValue;
1560
1571
  constructor(valueName) {
1561
1572
  this.valueName = valueName;
1562
- this.castAsValue = "text";
1573
+ this.castAsValue = "string";
1563
1574
  }
1564
1575
  /**
1565
1576
  * Set or override the plaintext data type for this field.
@@ -1584,7 +1595,7 @@ var EncryptedField = class {
1584
1595
  }
1585
1596
  build() {
1586
1597
  return {
1587
- cast_as: this.castAsValue === "string" ? "text" : this.castAsValue,
1598
+ cast_as: this.castAsValue,
1588
1599
  indexes: {}
1589
1600
  };
1590
1601
  }
@@ -1738,7 +1749,7 @@ var EncryptedColumn = class {
1738
1749
  }
1739
1750
  build() {
1740
1751
  return {
1741
- cast_as: this.castAsValue === "string" ? "text" : this.castAsValue,
1752
+ cast_as: this.castAsValue,
1742
1753
  indexes: this.indexesValue
1743
1754
  };
1744
1755
  }
@@ -4261,6 +4272,14 @@ var EncryptionClient = class {
4261
4272
  workspaceId: this.workspaceId
4262
4273
  };
4263
4274
  }
4275
+ /**
4276
+ * Get the encrypt config object.
4277
+ *
4278
+ * @returns The encrypt config object.
4279
+ */
4280
+ getEncryptConfig() {
4281
+ return this.encryptConfig;
4282
+ }
4264
4283
  };
4265
4284
  var Encryption = async (config3) => {
4266
4285
  const { schemas, config: clientConfig } = config3;