@cipherstash/protect-ffi 0.18.1 → 0.19.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 (2) hide show
  1. package/lib/index.d.cts +58 -20
  2. package/package.json +7 -7
package/lib/index.d.cts CHANGED
@@ -34,32 +34,70 @@ export type CtsToken = {
34
34
  export type Context = {
35
35
  identityClaim: string[];
36
36
  };
37
+ /**
38
+ * Represents encrypted data in the EQL format.
39
+ *
40
+ * This TypeScript type mirrors the Rust `EqlCiphertext` structure from `cipherstash-client`.
41
+ * The Rust type hierarchy is:
42
+ * - `EqlCiphertext` (identifier + version + body)
43
+ * - `EqlCiphertextBody` (ciphertext + SEM fields + array flag)
44
+ * - `EqlSEM` (all searchable encrypted metadata fields)
45
+ *
46
+ * In the serialized JSON format, `#[serde(flatten)]` is used in Rust to produce a flat
47
+ * structure where all fields appear at the top level rather than nested.
48
+ *
49
+ * Note: The ciphertext field (c) is serialized in MessagePack Base85 format.
50
+ */
37
51
  export type Encrypted = {
38
- k: 'ct';
39
- c: string;
40
- ob: string[] | null;
41
- bf: number[] | null;
42
- hm: string | null;
52
+ /** The table and column identifier */
43
53
  i: {
44
- c: string;
45
54
  t: string;
46
- };
47
- v: number;
48
- } | {
49
- k: 'sv';
50
- sv: SteVecEncryptedEntry[];
51
- i: {
52
55
  c: string;
53
- t: string;
54
56
  };
57
+ /** The encryption version */
55
58
  v: number;
56
- };
57
- export type SteVecEncryptedEntry = {
58
- tokenized_selector: string;
59
- term: string;
60
- record: string;
61
- parent_is_array: boolean;
62
- };
59
+ /** The encrypted ciphertext (mp_base85 encoded, optional for query-mode payloads) */
60
+ c?: string;
61
+ /** Whether this encrypted value is part of an array */
62
+ a?: boolean;
63
+ /** ORE block index for 64-bit integers */
64
+ ob?: string[];
65
+ /** Bloom filter for approximate match queries */
66
+ bf?: number[];
67
+ /** HMAC-SHA256 hash for exact matches */
68
+ hm?: string;
69
+ /** Selector value for field selection (SteVec) */
70
+ s?: string;
71
+ /** Blake3 hash for exact matches (SteVec) */
72
+ b3?: string;
73
+ /** ORE CLLW fixed-width index for 64-bit values (SteVec) */
74
+ ocf?: string;
75
+ /** ORE CLLW variable-width index for strings (SteVec) */
76
+ ocv?: string;
77
+ /** Structured encryption vector entries (recursive) */
78
+ sv?: EqlCiphertextBody[];
79
+ };
80
+ /**
81
+ * Body of an EQL ciphertext, used recursively in SteVec entries.
82
+ */
83
+ export type EqlCiphertextBody = {
84
+ /** The encrypted ciphertext (mp_base85 encoded) */
85
+ c?: string;
86
+ /** Whether this entry is part of an array */
87
+ a?: boolean;
88
+ /** Selector value for field selection */
89
+ s?: string;
90
+ /** Blake3 hash for exact matches */
91
+ b3?: string;
92
+ /** ORE CLLW fixed-width index */
93
+ ocf?: string;
94
+ /** ORE CLLW variable-width index */
95
+ ocv?: string;
96
+ /** Nested SteVec entries (for deeply nested JSON) */
97
+ sv?: EqlCiphertextBody[];
98
+ };
99
+ /** @deprecated Use EqlCiphertextBody instead */
100
+ export type SteVecEntry = EqlCiphertextBody;
63
101
  export type EncryptConfig = {
64
102
  v: number;
65
103
  tables: Record<string, Record<string, Column>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cipherstash/protect-ffi",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.cjs",
6
6
  "scripts": {
@@ -67,11 +67,11 @@
67
67
  "@neon-rs/load": "^0.1.82"
68
68
  },
69
69
  "optionalDependencies": {
70
- "@cipherstash/protect-ffi-darwin-x64": "0.18.1",
71
- "@cipherstash/protect-ffi-darwin-arm64": "0.18.1",
72
- "@cipherstash/protect-ffi-win32-x64-msvc": "0.18.1",
73
- "@cipherstash/protect-ffi-linux-x64-gnu": "0.18.1",
74
- "@cipherstash/protect-ffi-linux-arm64-gnu": "0.18.1",
75
- "@cipherstash/protect-ffi-linux-x64-musl": "0.18.1"
70
+ "@cipherstash/protect-ffi-darwin-x64": "0.19.0",
71
+ "@cipherstash/protect-ffi-darwin-arm64": "0.19.0",
72
+ "@cipherstash/protect-ffi-win32-x64-msvc": "0.19.0",
73
+ "@cipherstash/protect-ffi-linux-x64-gnu": "0.19.0",
74
+ "@cipherstash/protect-ffi-linux-arm64-gnu": "0.19.0",
75
+ "@cipherstash/protect-ffi-linux-x64-musl": "0.19.0"
76
76
  }
77
77
  }