@cipherstash/protect-ffi 0.28.0 → 0.29.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.
- package/README.md +34 -18
- package/dist/wasm/protect_ffi.d.ts +10 -3
- package/dist/wasm/protect_ffi_bg.js +21 -14
- package/dist/wasm/protect_ffi_bg.wasm +0 -0
- package/dist/wasm/protect_ffi_bg.wasm.d.ts +9 -9
- package/dist/wasm/protect_ffi_inline.js +1 -1
- package/lib/eql-v3-types/Bigint.d.ts +1 -1
- package/lib/eql-v3-types/BigintEq.d.ts +1 -1
- package/lib/eql-v3-types/BigintEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/BigintEqQuery.js +2 -0
- package/lib/eql-v3-types/BigintOrd.d.ts +4 -4
- package/lib/eql-v3-types/BigintOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/BigintOrdOpeQuery.d.ts +13 -0
- package/lib/eql-v3-types/BigintOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/BigintOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/BigintOrdOreQuery.d.ts +13 -0
- package/lib/eql-v3-types/BigintOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/BigintOrdQuery.d.ts +13 -0
- package/lib/eql-v3-types/BigintOrdQuery.js +2 -0
- package/lib/eql-v3-types/Boolean.d.ts +1 -1
- package/lib/eql-v3-types/Date.d.ts +1 -1
- package/lib/eql-v3-types/DateEq.d.ts +1 -1
- package/lib/eql-v3-types/DateEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/DateEqQuery.js +2 -0
- package/lib/eql-v3-types/DateOrd.d.ts +4 -4
- package/lib/eql-v3-types/DateOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/DateOrdOpeQuery.d.ts +13 -0
- package/lib/eql-v3-types/DateOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/DateOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/DateOrdOreQuery.d.ts +13 -0
- package/lib/eql-v3-types/DateOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/DateOrdQuery.d.ts +13 -0
- package/lib/eql-v3-types/DateOrdQuery.js +2 -0
- package/lib/eql-v3-types/Double.d.ts +1 -1
- package/lib/eql-v3-types/DoubleEq.d.ts +1 -1
- package/lib/eql-v3-types/DoubleEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/DoubleEqQuery.js +2 -0
- package/lib/eql-v3-types/DoubleOrd.d.ts +4 -4
- package/lib/eql-v3-types/DoubleOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/DoubleOrdOpeQuery.d.ts +13 -0
- package/lib/eql-v3-types/DoubleOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/DoubleOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/DoubleOrdOreQuery.d.ts +13 -0
- package/lib/eql-v3-types/DoubleOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/DoubleOrdQuery.d.ts +13 -0
- package/lib/eql-v3-types/DoubleOrdQuery.js +2 -0
- package/lib/eql-v3-types/Integer.d.ts +1 -1
- package/lib/eql-v3-types/IntegerEq.d.ts +1 -1
- package/lib/eql-v3-types/IntegerEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/IntegerEqQuery.js +2 -0
- package/lib/eql-v3-types/IntegerOrd.d.ts +4 -4
- package/lib/eql-v3-types/IntegerOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/IntegerOrdOpeQuery.d.ts +13 -0
- package/lib/eql-v3-types/IntegerOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/IntegerOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/IntegerOrdOreQuery.d.ts +13 -0
- package/lib/eql-v3-types/IntegerOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/IntegerOrdQuery.d.ts +13 -0
- package/lib/eql-v3-types/IntegerOrdQuery.js +2 -0
- package/lib/eql-v3-types/Numeric.d.ts +1 -1
- package/lib/eql-v3-types/NumericEq.d.ts +1 -1
- package/lib/eql-v3-types/NumericEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/NumericEqQuery.js +2 -0
- package/lib/eql-v3-types/NumericOrd.d.ts +4 -4
- package/lib/eql-v3-types/NumericOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/NumericOrdOpeQuery.d.ts +13 -0
- package/lib/eql-v3-types/NumericOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/NumericOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/NumericOrdOreQuery.d.ts +13 -0
- package/lib/eql-v3-types/NumericOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/NumericOrdQuery.d.ts +13 -0
- package/lib/eql-v3-types/NumericOrdQuery.js +2 -0
- package/lib/eql-v3-types/OpeCllw.d.ts +9 -6
- package/lib/eql-v3-types/OreBlock256.d.ts +4 -4
- package/lib/eql-v3-types/Real.d.ts +1 -1
- package/lib/eql-v3-types/RealEq.d.ts +1 -1
- package/lib/eql-v3-types/RealEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/RealEqQuery.js +2 -0
- package/lib/eql-v3-types/RealOrd.d.ts +4 -4
- package/lib/eql-v3-types/RealOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/RealOrdOpeQuery.d.ts +13 -0
- package/lib/eql-v3-types/RealOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/RealOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/RealOrdOreQuery.d.ts +13 -0
- package/lib/eql-v3-types/RealOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/RealOrdQuery.d.ts +13 -0
- package/lib/eql-v3-types/RealOrdQuery.js +2 -0
- package/lib/eql-v3-types/Selector.d.ts +1 -1
- package/lib/eql-v3-types/Smallint.d.ts +1 -1
- package/lib/eql-v3-types/SmallintEq.d.ts +1 -1
- package/lib/eql-v3-types/SmallintEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/SmallintEqQuery.js +2 -0
- package/lib/eql-v3-types/SmallintOrd.d.ts +4 -4
- package/lib/eql-v3-types/SmallintOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/SmallintOrdOpeQuery.d.ts +13 -0
- package/lib/eql-v3-types/SmallintOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/SmallintOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/SmallintOrdOreQuery.d.ts +13 -0
- package/lib/eql-v3-types/SmallintOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/SmallintOrdQuery.d.ts +13 -0
- package/lib/eql-v3-types/SmallintOrdQuery.js +2 -0
- package/lib/eql-v3-types/SteVecDocument.d.ts +1 -1
- package/lib/eql-v3-types/SteVecEntry.d.ts +4 -4
- package/lib/eql-v3-types/SteVecQuery.d.ts +1 -1
- package/lib/eql-v3-types/SteVecQueryEntry.d.ts +2 -2
- package/lib/eql-v3-types/SteVecTerm.d.ts +4 -4
- package/lib/eql-v3-types/Text.d.ts +1 -1
- package/lib/eql-v3-types/TextEq.d.ts +1 -1
- package/lib/eql-v3-types/TextEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/TextEqQuery.js +2 -0
- package/lib/eql-v3-types/TextMatch.d.ts +1 -1
- package/lib/eql-v3-types/TextMatchQuery.d.ts +13 -0
- package/lib/eql-v3-types/TextMatchQuery.js +2 -0
- package/lib/eql-v3-types/TextOrd.d.ts +4 -4
- package/lib/eql-v3-types/TextOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/TextOrdOpeQuery.d.ts +15 -0
- package/lib/eql-v3-types/TextOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/TextOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/TextOrdOreQuery.d.ts +15 -0
- package/lib/eql-v3-types/TextOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/TextOrdQuery.d.ts +15 -0
- package/lib/eql-v3-types/TextOrdQuery.js +2 -0
- package/lib/eql-v3-types/TextSearch.d.ts +4 -4
- package/lib/eql-v3-types/TextSearchOre.d.ts +19 -0
- package/lib/eql-v3-types/TextSearchOre.js +2 -0
- package/lib/eql-v3-types/TextSearchOreQuery.d.ts +17 -0
- package/lib/eql-v3-types/TextSearchOreQuery.js +2 -0
- package/lib/eql-v3-types/TextSearchQuery.d.ts +17 -0
- package/lib/eql-v3-types/TextSearchQuery.js +2 -0
- package/lib/eql-v3-types/Timestamp.d.ts +1 -1
- package/lib/eql-v3-types/TimestampEq.d.ts +1 -1
- package/lib/eql-v3-types/TimestampEqQuery.d.ts +13 -0
- package/lib/eql-v3-types/TimestampEqQuery.js +2 -0
- package/lib/eql-v3-types/TimestampOrd.d.ts +4 -4
- package/lib/eql-v3-types/TimestampOrdOpe.d.ts +1 -1
- package/lib/eql-v3-types/TimestampOrdOpeQuery.d.ts +13 -0
- package/lib/eql-v3-types/TimestampOrdOpeQuery.js +2 -0
- package/lib/eql-v3-types/TimestampOrdOre.d.ts +1 -1
- package/lib/eql-v3-types/TimestampOrdOreQuery.d.ts +13 -0
- package/lib/eql-v3-types/TimestampOrdOreQuery.js +2 -0
- package/lib/eql-v3-types/TimestampOrdQuery.d.ts +13 -0
- package/lib/eql-v3-types/TimestampOrdQuery.js +2 -0
- package/lib/eql-v3.d.ts +63 -7
- package/lib/errors.d.ts +1 -1
- package/lib/errors.js +0 -4
- package/lib/index.cjs +12 -7
- package/lib/index.d.cts +68 -24
- package/lib/normalizeEncryptConfig.d.ts +2 -1
- package/lib/normalizeEncryptConfig.js +2 -1
- package/package.json +7 -7
- package/lib/eql-v3-types/OreCllw.d.ts +0 -7
- package/lib/eql-v3-types/OreCllw.js +0 -5
|
@@ -2,18 +2,18 @@ import type { BloomFilter } from "./BloomFilter";
|
|
|
2
2
|
import type { Ciphertext } from "./Ciphertext";
|
|
3
3
|
import type { Hmac256 } from "./Hmac256";
|
|
4
4
|
import type { Identifier } from "./Identifier";
|
|
5
|
-
import type {
|
|
5
|
+
import type { OpeCllw } from "./OpeCllw";
|
|
6
6
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
7
7
|
/**
|
|
8
|
-
* `
|
|
8
|
+
* `public.eql_v3_text_search` — search domain.
|
|
9
9
|
*
|
|
10
|
-
* Operators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `c` `hm` `
|
|
10
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `c` `hm` `op` `bf`.
|
|
11
11
|
*/
|
|
12
12
|
export type TextSearch = {
|
|
13
13
|
v: SchemaVersion;
|
|
14
14
|
i: Identifier;
|
|
15
15
|
c: Ciphertext;
|
|
16
16
|
hm: Hmac256;
|
|
17
|
-
|
|
17
|
+
op: OpeCllw;
|
|
18
18
|
bf: BloomFilter;
|
|
19
19
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BloomFilter } from "./BloomFilter";
|
|
2
|
+
import type { Ciphertext } from "./Ciphertext";
|
|
3
|
+
import type { Hmac256 } from "./Hmac256";
|
|
4
|
+
import type { Identifier } from "./Identifier";
|
|
5
|
+
import type { OreBlock256 } from "./OreBlock256";
|
|
6
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
7
|
+
/**
|
|
8
|
+
* `public.eql_v3_text_search_ore` — search domain.
|
|
9
|
+
*
|
|
10
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `c` `hm` `ob` `bf`.
|
|
11
|
+
*/
|
|
12
|
+
export type TextSearchOre = {
|
|
13
|
+
v: SchemaVersion;
|
|
14
|
+
i: Identifier;
|
|
15
|
+
c: Ciphertext;
|
|
16
|
+
hm: Hmac256;
|
|
17
|
+
ob: OreBlock256;
|
|
18
|
+
bf: BloomFilter;
|
|
19
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BloomFilter } from "./BloomFilter";
|
|
2
|
+
import type { Hmac256 } from "./Hmac256";
|
|
3
|
+
import type { Identifier } from "./Identifier";
|
|
4
|
+
import type { OreBlock256 } from "./OreBlock256";
|
|
5
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
6
|
+
/**
|
|
7
|
+
* `eql_v3.query_text_search_ore` — search domain query operand.
|
|
8
|
+
*
|
|
9
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `hm` `ob` `bf`.
|
|
10
|
+
*/
|
|
11
|
+
export type TextSearchOreQuery = {
|
|
12
|
+
v: SchemaVersion;
|
|
13
|
+
i: Identifier;
|
|
14
|
+
hm: Hmac256;
|
|
15
|
+
ob: OreBlock256;
|
|
16
|
+
bf: BloomFilter;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BloomFilter } from "./BloomFilter";
|
|
2
|
+
import type { Hmac256 } from "./Hmac256";
|
|
3
|
+
import type { Identifier } from "./Identifier";
|
|
4
|
+
import type { OpeCllw } from "./OpeCllw";
|
|
5
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
6
|
+
/**
|
|
7
|
+
* `eql_v3.query_text_search` — search domain query operand.
|
|
8
|
+
*
|
|
9
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=` `@>` `<@`. Required keys: `v` `i` `hm` `op` `bf`.
|
|
10
|
+
*/
|
|
11
|
+
export type TextSearchQuery = {
|
|
12
|
+
v: SchemaVersion;
|
|
13
|
+
i: Identifier;
|
|
14
|
+
hm: Hmac256;
|
|
15
|
+
op: OpeCllw;
|
|
16
|
+
bf: BloomFilter;
|
|
17
|
+
};
|
|
@@ -2,7 +2,7 @@ import type { Ciphertext } from "./Ciphertext";
|
|
|
2
2
|
import type { Identifier } from "./Identifier";
|
|
3
3
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
4
4
|
/**
|
|
5
|
-
* `
|
|
5
|
+
* `public.eql_v3_timestamp` — storage-only domain.
|
|
6
6
|
*
|
|
7
7
|
* Operators: none. Required keys: `v` `i` `c`.
|
|
8
8
|
*/
|
|
@@ -3,7 +3,7 @@ import type { Hmac256 } from "./Hmac256";
|
|
|
3
3
|
import type { Identifier } from "./Identifier";
|
|
4
4
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
5
5
|
/**
|
|
6
|
-
* `
|
|
6
|
+
* `public.eql_v3_timestamp_eq` — equality domain.
|
|
7
7
|
*
|
|
8
8
|
* Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`.
|
|
9
9
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Hmac256 } from "./Hmac256";
|
|
2
|
+
import type { Identifier } from "./Identifier";
|
|
3
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
4
|
+
/**
|
|
5
|
+
* `eql_v3.query_timestamp_eq` — equality domain query operand.
|
|
6
|
+
*
|
|
7
|
+
* Operators: `=` `<>`. Required keys: `v` `i` `hm`.
|
|
8
|
+
*/
|
|
9
|
+
export type TimestampEqQuery = {
|
|
10
|
+
v: SchemaVersion;
|
|
11
|
+
i: Identifier;
|
|
12
|
+
hm: Hmac256;
|
|
13
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Ciphertext } from "./Ciphertext";
|
|
2
2
|
import type { Identifier } from "./Identifier";
|
|
3
|
-
import type {
|
|
3
|
+
import type { OpeCllw } from "./OpeCllw";
|
|
4
4
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
5
5
|
/**
|
|
6
|
-
* `
|
|
6
|
+
* `public.eql_v3_timestamp_ord` — ordering domain.
|
|
7
7
|
*
|
|
8
|
-
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `
|
|
8
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`.
|
|
9
9
|
*/
|
|
10
10
|
export type TimestampOrd = {
|
|
11
11
|
v: SchemaVersion;
|
|
12
12
|
i: Identifier;
|
|
13
13
|
c: Ciphertext;
|
|
14
|
-
|
|
14
|
+
op: OpeCllw;
|
|
15
15
|
};
|
|
@@ -3,7 +3,7 @@ import type { Identifier } from "./Identifier";
|
|
|
3
3
|
import type { OpeCllw } from "./OpeCllw";
|
|
4
4
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
5
5
|
/**
|
|
6
|
-
* `
|
|
6
|
+
* `public.eql_v3_timestamp_ord_ope` — ordering domain.
|
|
7
7
|
*
|
|
8
8
|
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`.
|
|
9
9
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Identifier } from "./Identifier";
|
|
2
|
+
import type { OpeCllw } from "./OpeCllw";
|
|
3
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
4
|
+
/**
|
|
5
|
+
* `eql_v3.query_timestamp_ord_ope` — ordering domain query operand.
|
|
6
|
+
*
|
|
7
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`.
|
|
8
|
+
*/
|
|
9
|
+
export type TimestampOrdOpeQuery = {
|
|
10
|
+
v: SchemaVersion;
|
|
11
|
+
i: Identifier;
|
|
12
|
+
op: OpeCllw;
|
|
13
|
+
};
|
|
@@ -3,7 +3,7 @@ import type { Identifier } from "./Identifier";
|
|
|
3
3
|
import type { OreBlock256 } from "./OreBlock256";
|
|
4
4
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
5
5
|
/**
|
|
6
|
-
* `
|
|
6
|
+
* `public.eql_v3_timestamp_ord_ore` — ordering domain.
|
|
7
7
|
*
|
|
8
8
|
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`.
|
|
9
9
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Identifier } from "./Identifier";
|
|
2
|
+
import type { OreBlock256 } from "./OreBlock256";
|
|
3
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
4
|
+
/**
|
|
5
|
+
* `eql_v3.query_timestamp_ord_ore` — ordering domain query operand.
|
|
6
|
+
*
|
|
7
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`.
|
|
8
|
+
*/
|
|
9
|
+
export type TimestampOrdOreQuery = {
|
|
10
|
+
v: SchemaVersion;
|
|
11
|
+
i: Identifier;
|
|
12
|
+
ob: OreBlock256;
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Identifier } from "./Identifier";
|
|
2
|
+
import type { OpeCllw } from "./OpeCllw";
|
|
3
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
4
|
+
/**
|
|
5
|
+
* `eql_v3.query_timestamp_ord` — ordering domain query operand.
|
|
6
|
+
*
|
|
7
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`.
|
|
8
|
+
*/
|
|
9
|
+
export type TimestampOrdQuery = {
|
|
10
|
+
v: SchemaVersion;
|
|
11
|
+
i: Identifier;
|
|
12
|
+
op: OpeCllw;
|
|
13
|
+
};
|
package/lib/eql-v3.d.ts
CHANGED
|
@@ -1,60 +1,100 @@
|
|
|
1
1
|
import type { Bigint } from './eql-v3-types/Bigint.js';
|
|
2
2
|
import type { BigintEq } from './eql-v3-types/BigintEq.js';
|
|
3
|
+
import type { BigintEqQuery } from './eql-v3-types/BigintEqQuery.js';
|
|
3
4
|
import type { BigintOrd } from './eql-v3-types/BigintOrd.js';
|
|
4
5
|
import type { BigintOrdOpe } from './eql-v3-types/BigintOrdOpe.js';
|
|
6
|
+
import type { BigintOrdOpeQuery } from './eql-v3-types/BigintOrdOpeQuery.js';
|
|
5
7
|
import type { BigintOrdOre } from './eql-v3-types/BigintOrdOre.js';
|
|
8
|
+
import type { BigintOrdOreQuery } from './eql-v3-types/BigintOrdOreQuery.js';
|
|
9
|
+
import type { BigintOrdQuery } from './eql-v3-types/BigintOrdQuery.js';
|
|
6
10
|
import type { Boolean as EqlV3Boolean } from './eql-v3-types/Boolean.js';
|
|
7
11
|
import type { Date as EqlV3Date } from './eql-v3-types/Date.js';
|
|
8
12
|
import type { DateEq } from './eql-v3-types/DateEq.js';
|
|
13
|
+
import type { DateEqQuery } from './eql-v3-types/DateEqQuery.js';
|
|
9
14
|
import type { DateOrd } from './eql-v3-types/DateOrd.js';
|
|
10
15
|
import type { DateOrdOpe } from './eql-v3-types/DateOrdOpe.js';
|
|
16
|
+
import type { DateOrdOpeQuery } from './eql-v3-types/DateOrdOpeQuery.js';
|
|
11
17
|
import type { DateOrdOre } from './eql-v3-types/DateOrdOre.js';
|
|
18
|
+
import type { DateOrdOreQuery } from './eql-v3-types/DateOrdOreQuery.js';
|
|
19
|
+
import type { DateOrdQuery } from './eql-v3-types/DateOrdQuery.js';
|
|
12
20
|
import type { Double } from './eql-v3-types/Double.js';
|
|
13
21
|
import type { DoubleEq } from './eql-v3-types/DoubleEq.js';
|
|
22
|
+
import type { DoubleEqQuery } from './eql-v3-types/DoubleEqQuery.js';
|
|
14
23
|
import type { DoubleOrd } from './eql-v3-types/DoubleOrd.js';
|
|
15
24
|
import type { DoubleOrdOpe } from './eql-v3-types/DoubleOrdOpe.js';
|
|
25
|
+
import type { DoubleOrdOpeQuery } from './eql-v3-types/DoubleOrdOpeQuery.js';
|
|
16
26
|
import type { DoubleOrdOre } from './eql-v3-types/DoubleOrdOre.js';
|
|
27
|
+
import type { DoubleOrdOreQuery } from './eql-v3-types/DoubleOrdOreQuery.js';
|
|
28
|
+
import type { DoubleOrdQuery } from './eql-v3-types/DoubleOrdQuery.js';
|
|
17
29
|
import type { Integer } from './eql-v3-types/Integer.js';
|
|
18
30
|
import type { IntegerEq } from './eql-v3-types/IntegerEq.js';
|
|
31
|
+
import type { IntegerEqQuery } from './eql-v3-types/IntegerEqQuery.js';
|
|
19
32
|
import type { IntegerOrd } from './eql-v3-types/IntegerOrd.js';
|
|
20
33
|
import type { IntegerOrdOpe } from './eql-v3-types/IntegerOrdOpe.js';
|
|
34
|
+
import type { IntegerOrdOpeQuery } from './eql-v3-types/IntegerOrdOpeQuery.js';
|
|
21
35
|
import type { IntegerOrdOre } from './eql-v3-types/IntegerOrdOre.js';
|
|
36
|
+
import type { IntegerOrdOreQuery } from './eql-v3-types/IntegerOrdOreQuery.js';
|
|
37
|
+
import type { IntegerOrdQuery } from './eql-v3-types/IntegerOrdQuery.js';
|
|
22
38
|
import type { Numeric } from './eql-v3-types/Numeric.js';
|
|
23
39
|
import type { NumericEq } from './eql-v3-types/NumericEq.js';
|
|
40
|
+
import type { NumericEqQuery } from './eql-v3-types/NumericEqQuery.js';
|
|
24
41
|
import type { NumericOrd } from './eql-v3-types/NumericOrd.js';
|
|
25
42
|
import type { NumericOrdOpe } from './eql-v3-types/NumericOrdOpe.js';
|
|
43
|
+
import type { NumericOrdOpeQuery } from './eql-v3-types/NumericOrdOpeQuery.js';
|
|
26
44
|
import type { NumericOrdOre } from './eql-v3-types/NumericOrdOre.js';
|
|
45
|
+
import type { NumericOrdOreQuery } from './eql-v3-types/NumericOrdOreQuery.js';
|
|
46
|
+
import type { NumericOrdQuery } from './eql-v3-types/NumericOrdQuery.js';
|
|
27
47
|
import type { Real } from './eql-v3-types/Real.js';
|
|
28
48
|
import type { RealEq } from './eql-v3-types/RealEq.js';
|
|
49
|
+
import type { RealEqQuery } from './eql-v3-types/RealEqQuery.js';
|
|
29
50
|
import type { RealOrd } from './eql-v3-types/RealOrd.js';
|
|
30
51
|
import type { RealOrdOpe } from './eql-v3-types/RealOrdOpe.js';
|
|
52
|
+
import type { RealOrdOpeQuery } from './eql-v3-types/RealOrdOpeQuery.js';
|
|
31
53
|
import type { RealOrdOre } from './eql-v3-types/RealOrdOre.js';
|
|
54
|
+
import type { RealOrdOreQuery } from './eql-v3-types/RealOrdOreQuery.js';
|
|
55
|
+
import type { RealOrdQuery } from './eql-v3-types/RealOrdQuery.js';
|
|
56
|
+
import type { Selector } from './eql-v3-types/Selector.js';
|
|
32
57
|
import type { Smallint } from './eql-v3-types/Smallint.js';
|
|
33
58
|
import type { SmallintEq } from './eql-v3-types/SmallintEq.js';
|
|
59
|
+
import type { SmallintEqQuery } from './eql-v3-types/SmallintEqQuery.js';
|
|
34
60
|
import type { SmallintOrd } from './eql-v3-types/SmallintOrd.js';
|
|
35
61
|
import type { SmallintOrdOpe } from './eql-v3-types/SmallintOrdOpe.js';
|
|
62
|
+
import type { SmallintOrdOpeQuery } from './eql-v3-types/SmallintOrdOpeQuery.js';
|
|
36
63
|
import type { SmallintOrdOre } from './eql-v3-types/SmallintOrdOre.js';
|
|
64
|
+
import type { SmallintOrdOreQuery } from './eql-v3-types/SmallintOrdOreQuery.js';
|
|
65
|
+
import type { SmallintOrdQuery } from './eql-v3-types/SmallintOrdQuery.js';
|
|
37
66
|
import type { SteVecDocument } from './eql-v3-types/SteVecDocument.js';
|
|
38
67
|
import type { SteVecQuery } from './eql-v3-types/SteVecQuery.js';
|
|
39
68
|
import type { Text } from './eql-v3-types/Text.js';
|
|
40
69
|
import type { TextEq } from './eql-v3-types/TextEq.js';
|
|
70
|
+
import type { TextEqQuery } from './eql-v3-types/TextEqQuery.js';
|
|
41
71
|
import type { TextMatch } from './eql-v3-types/TextMatch.js';
|
|
72
|
+
import type { TextMatchQuery } from './eql-v3-types/TextMatchQuery.js';
|
|
42
73
|
import type { TextOrd } from './eql-v3-types/TextOrd.js';
|
|
43
74
|
import type { TextOrdOpe } from './eql-v3-types/TextOrdOpe.js';
|
|
75
|
+
import type { TextOrdOpeQuery } from './eql-v3-types/TextOrdOpeQuery.js';
|
|
44
76
|
import type { TextOrdOre } from './eql-v3-types/TextOrdOre.js';
|
|
77
|
+
import type { TextOrdOreQuery } from './eql-v3-types/TextOrdOreQuery.js';
|
|
78
|
+
import type { TextOrdQuery } from './eql-v3-types/TextOrdQuery.js';
|
|
45
79
|
import type { TextSearch } from './eql-v3-types/TextSearch.js';
|
|
80
|
+
import type { TextSearchOre } from './eql-v3-types/TextSearchOre.js';
|
|
81
|
+
import type { TextSearchOreQuery } from './eql-v3-types/TextSearchOreQuery.js';
|
|
82
|
+
import type { TextSearchQuery } from './eql-v3-types/TextSearchQuery.js';
|
|
46
83
|
import type { Timestamp } from './eql-v3-types/Timestamp.js';
|
|
47
84
|
import type { TimestampEq } from './eql-v3-types/TimestampEq.js';
|
|
85
|
+
import type { TimestampEqQuery } from './eql-v3-types/TimestampEqQuery.js';
|
|
48
86
|
import type { TimestampOrd } from './eql-v3-types/TimestampOrd.js';
|
|
49
87
|
import type { TimestampOrdOpe } from './eql-v3-types/TimestampOrdOpe.js';
|
|
88
|
+
import type { TimestampOrdOpeQuery } from './eql-v3-types/TimestampOrdOpeQuery.js';
|
|
50
89
|
import type { TimestampOrdOre } from './eql-v3-types/TimestampOrdOre.js';
|
|
90
|
+
import type { TimestampOrdOreQuery } from './eql-v3-types/TimestampOrdOreQuery.js';
|
|
91
|
+
import type { TimestampOrdQuery } from './eql-v3-types/TimestampOrdQuery.js';
|
|
51
92
|
export type { BloomFilter } from './eql-v3-types/BloomFilter.js';
|
|
52
93
|
export type { Ciphertext } from './eql-v3-types/Ciphertext.js';
|
|
53
94
|
export type { Hmac256 } from './eql-v3-types/Hmac256.js';
|
|
54
95
|
export type { Identifier as EqlV3Identifier } from './eql-v3-types/Identifier.js';
|
|
55
96
|
export type { OpeCllw } from './eql-v3-types/OpeCllw.js';
|
|
56
97
|
export type { OreBlock256 } from './eql-v3-types/OreBlock256.js';
|
|
57
|
-
export type { OreCllw } from './eql-v3-types/OreCllw.js';
|
|
58
98
|
export type { SchemaVersion } from './eql-v3-types/SchemaVersion.js';
|
|
59
99
|
export type { Selector } from './eql-v3-types/Selector.js';
|
|
60
100
|
export type { SteVecDocument } from './eql-v3-types/SteVecDocument.js';
|
|
@@ -63,12 +103,13 @@ export type { SteVecForm } from './eql-v3-types/SteVecForm.js';
|
|
|
63
103
|
export type { SteVecQuery } from './eql-v3-types/SteVecQuery.js';
|
|
64
104
|
export type { SteVecQueryEntry } from './eql-v3-types/SteVecQueryEntry.js';
|
|
65
105
|
export type { SteVecTerm } from './eql-v3-types/SteVecTerm.js';
|
|
66
|
-
export type { Bigint, BigintEq, BigintOrd, BigintOrdOpe, BigintOrdOre, EqlV3Boolean, EqlV3Date, DateEq, DateOrd, DateOrdOpe, DateOrdOre, Double, DoubleEq, DoubleOrd, DoubleOrdOpe, DoubleOrdOre, Integer, IntegerEq, IntegerOrd, IntegerOrdOpe, IntegerOrdOre, Numeric, NumericEq, NumericOrd, NumericOrdOpe, NumericOrdOre, Real, RealEq, RealOrd, RealOrdOpe, RealOrdOre, Smallint, SmallintEq, SmallintOrd, SmallintOrdOpe, SmallintOrdOre, Text, TextEq, TextMatch, TextOrd, TextOrdOpe, TextOrdOre, TextSearch, Timestamp, TimestampEq, TimestampOrd, TimestampOrdOpe, TimestampOrdOre, };
|
|
106
|
+
export type { Bigint, BigintEq, BigintOrd, BigintOrdOpe, BigintOrdOre, EqlV3Boolean, EqlV3Date, DateEq, DateOrd, DateOrdOpe, DateOrdOre, Double, DoubleEq, DoubleOrd, DoubleOrdOpe, DoubleOrdOre, Integer, IntegerEq, IntegerOrd, IntegerOrdOpe, IntegerOrdOre, Numeric, NumericEq, NumericOrd, NumericOrdOpe, NumericOrdOre, Real, RealEq, RealOrd, RealOrdOpe, RealOrdOre, Smallint, SmallintEq, SmallintOrd, SmallintOrdOpe, SmallintOrdOre, Text, TextEq, TextMatch, TextOrd, TextOrdOpe, TextOrdOre, TextSearch, TextSearchOre, Timestamp, TimestampEq, TimestampOrd, TimestampOrdOpe, TimestampOrdOre, };
|
|
107
|
+
export type { BigintEqQuery, BigintOrdOpeQuery, BigintOrdOreQuery, BigintOrdQuery, DateEqQuery, DateOrdOpeQuery, DateOrdOreQuery, DateOrdQuery, DoubleEqQuery, DoubleOrdOpeQuery, DoubleOrdOreQuery, DoubleOrdQuery, IntegerEqQuery, IntegerOrdOpeQuery, IntegerOrdOreQuery, IntegerOrdQuery, NumericEqQuery, NumericOrdOpeQuery, NumericOrdOreQuery, NumericOrdQuery, RealEqQuery, RealOrdOpeQuery, RealOrdOreQuery, RealOrdQuery, SmallintEqQuery, SmallintOrdOpeQuery, SmallintOrdOreQuery, SmallintOrdQuery, TextEqQuery, TextMatchQuery, TextOrdOpeQuery, TextOrdOreQuery, TextOrdQuery, TextSearchOreQuery, TextSearchQuery, TimestampEqQuery, TimestampOrdOpeQuery, TimestampOrdOreQuery, TimestampOrdQuery, };
|
|
67
108
|
/**
|
|
68
109
|
* Every flat scalar EQL v3 storage payload (`{v: 3, i, c, <terms>}`, one
|
|
69
110
|
* struct per `eql_v3` scalar domain).
|
|
70
111
|
*/
|
|
71
|
-
export type EncryptedV3Scalar = Bigint | BigintEq | BigintOrd | BigintOrdOpe | BigintOrdOre | EqlV3Boolean | EqlV3Date | DateEq | DateOrd | DateOrdOpe | DateOrdOre | Double | DoubleEq | DoubleOrd | DoubleOrdOpe | DoubleOrdOre | Integer | IntegerEq | IntegerOrd | IntegerOrdOpe | IntegerOrdOre | Numeric | NumericEq | NumericOrd | NumericOrdOpe | NumericOrdOre | Real | RealEq | RealOrd | RealOrdOpe | RealOrdOre | Smallint | SmallintEq | SmallintOrd | SmallintOrdOpe | SmallintOrdOre | Text | TextEq | TextMatch | TextOrd | TextOrdOpe | TextOrdOre | TextSearch | Timestamp | TimestampEq | TimestampOrd | TimestampOrdOpe | TimestampOrdOre;
|
|
112
|
+
export type EncryptedV3Scalar = Bigint | BigintEq | BigintOrd | BigintOrdOpe | BigintOrdOre | EqlV3Boolean | EqlV3Date | DateEq | DateOrd | DateOrdOpe | DateOrdOre | Double | DoubleEq | DoubleOrd | DoubleOrdOpe | DoubleOrdOre | Integer | IntegerEq | IntegerOrd | IntegerOrdOpe | IntegerOrdOre | Numeric | NumericEq | NumericOrd | NumericOrdOpe | NumericOrdOre | Real | RealEq | RealOrd | RealOrdOpe | RealOrdOre | Smallint | SmallintEq | SmallintOrd | SmallintOrdOpe | SmallintOrdOre | Text | TextEq | TextMatch | TextOrd | TextOrdOpe | TextOrdOre | TextSearch | TextSearchOre | Timestamp | TimestampEq | TimestampOrd | TimestampOrdOpe | TimestampOrdOre;
|
|
72
113
|
/**
|
|
73
114
|
* EQL v3 **storage** payload — returned by `encrypt` / `encryptBulk` when the
|
|
74
115
|
* client was created with `eqlVersion: 3`.
|
|
@@ -81,10 +122,25 @@ export type EncryptedV3Scalar = Bigint | BigintEq | BigintOrd | BigintOrdOpe | B
|
|
|
81
122
|
* documents (`sv[0]` is always the decryption root).
|
|
82
123
|
*/
|
|
83
124
|
export type EncryptedV3 = EncryptedV3Scalar | SteVecDocument;
|
|
125
|
+
/**
|
|
126
|
+
* Every scalar EQL v3 query operand — the term-only twin
|
|
127
|
+
* (`{v: 3, i, <terms>}`, no `c`) of the column's storage domain, cast in SQL
|
|
128
|
+
* to `eql_v3.query_<name>`. The operand always carries ALL the column
|
|
129
|
+
* domain's terms regardless of the queried `indexType` (the SQL operators
|
|
130
|
+
* pair each column domain only with its same-name query twin).
|
|
131
|
+
*/
|
|
132
|
+
export type EncryptedV3ScalarQuery = BigintEqQuery | BigintOrdOpeQuery | BigintOrdOreQuery | BigintOrdQuery | DateEqQuery | DateOrdOpeQuery | DateOrdOreQuery | DateOrdQuery | DoubleEqQuery | DoubleOrdOpeQuery | DoubleOrdOreQuery | DoubleOrdQuery | IntegerEqQuery | IntegerOrdOpeQuery | IntegerOrdOreQuery | IntegerOrdQuery | NumericEqQuery | NumericOrdOpeQuery | NumericOrdOreQuery | NumericOrdQuery | RealEqQuery | RealOrdOpeQuery | RealOrdOreQuery | RealOrdQuery | SmallintEqQuery | SmallintOrdOpeQuery | SmallintOrdOreQuery | SmallintOrdQuery | TextEqQuery | TextMatchQuery | TextOrdOpeQuery | TextOrdOreQuery | TextOrdQuery | TextSearchOreQuery | TextSearchQuery | TimestampEqQuery | TimestampOrdOpeQuery | TimestampOrdOreQuery | TimestampOrdQuery;
|
|
84
133
|
/**
|
|
85
134
|
* EQL v3 **query** payload — returned by `encryptQuery` / `encryptQueryBulk`
|
|
86
|
-
* under `eqlVersion: 3
|
|
87
|
-
*
|
|
88
|
-
*
|
|
135
|
+
* under `eqlVersion: 3`:
|
|
136
|
+
*
|
|
137
|
+
* - Scalar queries: an {@link EncryptedV3ScalarQuery} term-only operand —
|
|
138
|
+
* bind it with `WHERE col = $1::jsonb::eql_v3.query_<name>` (or the
|
|
139
|
+
* ordering / containment operator the domain supports).
|
|
140
|
+
* - JSONB containment queries: a {@link SteVecQuery} needle — bind it with
|
|
141
|
+
* `WHERE doc @> $1::jsonb::eql_v3.query_jsonb`.
|
|
142
|
+
* - JSONB selector (path) queries: the bare {@link Selector} hash (a
|
|
143
|
+
* string) — there is no encrypted-selector envelope in v3; bind it as the
|
|
144
|
+
* `text` argument of `->` / `->>` (`SELECT doc -> $1`).
|
|
89
145
|
*/
|
|
90
|
-
export type EncryptedV3Query = SteVecQuery;
|
|
146
|
+
export type EncryptedV3Query = EncryptedV3ScalarQuery | SteVecQuery | Selector;
|
package/lib/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ProtectErrorCode = 'INVARIANT_VIOLATION' | 'UNKNOWN_QUERY_OP' | 'UNKNOWN_COLUMN' | 'MISSING_INDEX' | 'INVALID_QUERY_INPUT' | 'INVALID_JSON_PATH' | 'STE_VEC_REQUIRES_JSON_CAST_AS' | 'MATCH_REQUIRES_TEXT' | 'UNSUPPORTED_CONFIG_VERSION' | 'INVALID_EQL_VERSION' | '
|
|
1
|
+
export type ProtectErrorCode = 'INVARIANT_VIOLATION' | 'UNKNOWN_QUERY_OP' | 'UNKNOWN_COLUMN' | 'MISSING_INDEX' | 'INVALID_QUERY_INPUT' | 'INVALID_JSON_PATH' | 'STE_VEC_REQUIRES_JSON_CAST_AS' | 'MATCH_REQUIRES_TEXT' | 'UNSUPPORTED_CONFIG_VERSION' | 'INVALID_EQL_VERSION' | 'EQL_V3_UNSUPPORTED_COLUMN' | 'EQL_V3_CONVERSION_FAILED' | 'INVALID_CIPHERTEXT' | 'UNKNOWN';
|
|
2
2
|
export declare class ProtectError extends Error {
|
|
3
3
|
code: ProtectErrorCode;
|
|
4
4
|
details?: unknown;
|
package/lib/errors.js
CHANGED
|
@@ -47,10 +47,6 @@ function inferErrorCode(message) {
|
|
|
47
47
|
if (message.startsWith('Invalid eqlVersion')) {
|
|
48
48
|
return 'INVALID_EQL_VERSION';
|
|
49
49
|
}
|
|
50
|
-
if (message.startsWith('EQL v3 scalar query') ||
|
|
51
|
-
message.startsWith('EQL v3 selector query')) {
|
|
52
|
-
return 'EQL_V3_QUERY_UNSUPPORTED';
|
|
53
|
-
}
|
|
54
50
|
if (message.includes('cannot be represented in EQL v3')) {
|
|
55
51
|
return 'EQL_V3_UNSUPPORTED_COLUMN';
|
|
56
52
|
}
|
package/lib/index.cjs
CHANGED
|
@@ -121,17 +121,22 @@ async function decryptBulkFallible(client, opts) {
|
|
|
121
121
|
* Under `eqlVersion: 2` (default) this returns the v2 shapes ({@link
|
|
122
122
|
* Encrypted} for JSON containment, {@link EncryptedQuery} otherwise).
|
|
123
123
|
*
|
|
124
|
-
* Under `eqlVersion: 3`
|
|
125
|
-
*
|
|
126
|
-
* index queries (`unique` / `ore` / `ope` / `match`)
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
124
|
+
* Under `eqlVersion: 3` this returns an {@link EncryptedV3Query}:
|
|
125
|
+
*
|
|
126
|
+
* - Scalar index queries (`unique` / `ore` / `ope` / `match`) produce the
|
|
127
|
+
* term-only operand for the column domain's query twin (`{v, i, <terms>}`,
|
|
128
|
+
* no `c` ciphertext) — bind with `col = $1::jsonb::eql_v3.query_<name>`.
|
|
129
|
+
* The operand always carries ALL the column domain's terms, whichever
|
|
130
|
+
* `indexType` was queried.
|
|
131
|
+
* - JSON containment queries produce the `eql_v3.query_jsonb` needle — bind
|
|
132
|
+
* with `doc @> $1::jsonb::eql_v3.query_jsonb`.
|
|
133
|
+
* - `ste_vec_selector` queries produce the bare selector hash (a string) —
|
|
134
|
+
* bind as the `text` argument of `->` / `->>`.
|
|
130
135
|
*/
|
|
131
136
|
function encryptQuery(client, opts) {
|
|
132
137
|
return wrapAsync(() => native.encryptQuery(client, (0, bigintWire_js_1.withEncodedPlaintext)(opts)));
|
|
133
138
|
}
|
|
134
|
-
/** Bulk variant of {@link encryptQuery} — same EQL v3
|
|
139
|
+
/** Bulk variant of {@link encryptQuery} — same EQL v3 shapes apply. */
|
|
135
140
|
function encryptQueryBulk(client, opts) {
|
|
136
141
|
return wrapAsync(() => {
|
|
137
142
|
const queries = (0, bigintWire_js_1.withEncodedPlaintexts)(opts.queries);
|
package/lib/index.d.cts
CHANGED
|
@@ -47,15 +47,20 @@ export declare function decryptBulkFallible(client: Client, opts: DecryptBulkOpt
|
|
|
47
47
|
* Under `eqlVersion: 2` (default) this returns the v2 shapes ({@link
|
|
48
48
|
* Encrypted} for JSON containment, {@link EncryptedQuery} otherwise).
|
|
49
49
|
*
|
|
50
|
-
* Under `eqlVersion: 3`
|
|
51
|
-
*
|
|
52
|
-
* index queries (`unique` / `ore` / `ope` / `match`)
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
50
|
+
* Under `eqlVersion: 3` this returns an {@link EncryptedV3Query}:
|
|
51
|
+
*
|
|
52
|
+
* - Scalar index queries (`unique` / `ore` / `ope` / `match`) produce the
|
|
53
|
+
* term-only operand for the column domain's query twin (`{v, i, <terms>}`,
|
|
54
|
+
* no `c` ciphertext) — bind with `col = $1::jsonb::eql_v3.query_<name>`.
|
|
55
|
+
* The operand always carries ALL the column domain's terms, whichever
|
|
56
|
+
* `indexType` was queried.
|
|
57
|
+
* - JSON containment queries produce the `eql_v3.query_jsonb` needle — bind
|
|
58
|
+
* with `doc @> $1::jsonb::eql_v3.query_jsonb`.
|
|
59
|
+
* - `ste_vec_selector` queries produce the bare selector hash (a string) —
|
|
60
|
+
* bind as the `text` argument of `->` / `->>`.
|
|
56
61
|
*/
|
|
57
62
|
export declare function encryptQuery(client: Client, opts: EncryptQueryOptions): Promise<Encrypted | EncryptedQuery | EncryptedV3Query>;
|
|
58
|
-
/** Bulk variant of {@link encryptQuery} — same EQL v3
|
|
63
|
+
/** Bulk variant of {@link encryptQuery} — same EQL v3 shapes apply. */
|
|
59
64
|
export declare function encryptQueryBulk(client: Client, opts: EncryptQueryBulkOptions): Promise<(Encrypted | EncryptedQuery | EncryptedV3Query)[]>;
|
|
60
65
|
/**
|
|
61
66
|
* Test-only helper: ensures a keyset with the given name exists, creating it if necessary,
|
|
@@ -188,7 +193,9 @@ export type EncryptedSteVecSelector = {
|
|
|
188
193
|
* One entry inside a SteVec payload (`k: "sv"`).
|
|
189
194
|
*
|
|
190
195
|
* Every element carries `s` (selector), `c` (entry ciphertext), and exactly one
|
|
191
|
-
* per-element equality / ordering term
|
|
196
|
+
* per-element equality / ordering term: `hm` for non-orderable leaves, and for
|
|
197
|
+
* orderable leaves either `op` (Compat mode, the default) or `oc` (Standard
|
|
198
|
+
* mode). EQL v3 accepts `hm` XOR `op` and rejects `oc`.
|
|
192
199
|
*/
|
|
193
200
|
export type SteVecEntry = {
|
|
194
201
|
/** Hex-encoded tokenized selector — deterministic per (path, key) */
|
|
@@ -199,7 +206,9 @@ export type SteVecEntry = {
|
|
|
199
206
|
a?: boolean;
|
|
200
207
|
/** Per-entry HMAC term for non-orderable leaves (objects, arrays, booleans, null) */
|
|
201
208
|
hm?: string;
|
|
202
|
-
/** Per-entry CLLW
|
|
209
|
+
/** Per-entry CLLW OPE term for orderable leaves (strings, numbers) — Compat mode, the default */
|
|
210
|
+
op?: string;
|
|
211
|
+
/** Per-entry CLLW ORE term for orderable leaves (strings, numbers) — Standard mode, EQL v2 only */
|
|
203
212
|
oc?: string;
|
|
204
213
|
};
|
|
205
214
|
/** @deprecated Use SteVecEntry instead */
|
|
@@ -249,9 +258,14 @@ export type ArrayIndexMode = 'all' | 'none' | {
|
|
|
249
258
|
/**
|
|
250
259
|
* Encoding mode for SteVec indexes.
|
|
251
260
|
*
|
|
252
|
-
* - `
|
|
253
|
-
*
|
|
254
|
-
*
|
|
261
|
+
* - `compat`: CLLW-OPE ordering, emits `op` per entry. The default since
|
|
262
|
+
* cipherstash-config 0.40.0, and the only mode EQL v3 accepts.
|
|
263
|
+
* - `standard`: CLLW-ORE ordering, emits `oc` per entry. The pre-0.40.0
|
|
264
|
+
* default; EQL v2 only.
|
|
265
|
+
*
|
|
266
|
+
* The two orderings are not cross-comparable, so a column cannot change mode
|
|
267
|
+
* without re-encrypting. Pin `standard` on v2 JSON columns that already hold
|
|
268
|
+
* rows.
|
|
255
269
|
*/
|
|
256
270
|
export type SteVecMode = 'compat' | 'standard';
|
|
257
271
|
export type SteVecIndexOpts = {
|
|
@@ -284,25 +298,55 @@ export type NewClientOptions = {
|
|
|
284
298
|
* `eql_v2_encrypted` payload format).
|
|
285
299
|
*
|
|
286
300
|
* With `3`, {@link encrypt} / {@link encryptBulk} return {@link
|
|
287
|
-
* EncryptedV3} payloads for the `eql_v3` per-capability domains
|
|
288
|
-
* (`
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
301
|
+
* EncryptedV3} payloads for the `eql_v3` per-capability column domains
|
|
302
|
+
* (`public.eql_v3_text_eq`, `public.eql_v3_integer_ord_ore`,
|
|
303
|
+
* `public.eql_v3_json`, …), derived
|
|
304
|
+
* from each column's `cast_as` + indexes, and {@link encryptQuery} /
|
|
305
|
+
* {@link encryptQueryBulk} return {@link EncryptedV3Query} operands:
|
|
306
|
+
* term-only scalar operands for the `eql_v3.query_<name>` twins, the
|
|
307
|
+
* `eql_v3.query_jsonb` containment needle, and bare selector-hash strings
|
|
308
|
+
* for path queries. {@link decrypt} accepts BOTH formats regardless of
|
|
309
|
+
* this setting.
|
|
295
310
|
*/
|
|
296
311
|
eqlVersion?: 2 | 3;
|
|
297
312
|
};
|
|
313
|
+
/** The token payload the native side ultimately reads. */
|
|
314
|
+
export type TokenResult = {
|
|
315
|
+
token: string;
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* A `@byteslice/result` `Result` envelope, as returned by
|
|
319
|
+
* `@cipherstash/auth` >= 0.41's `getToken()`.
|
|
320
|
+
*/
|
|
321
|
+
export type TokenResultEnvelope = {
|
|
322
|
+
data: TokenResult;
|
|
323
|
+
failure?: undefined;
|
|
324
|
+
} | {
|
|
325
|
+
failure: {
|
|
326
|
+
type?: string;
|
|
327
|
+
error?: Error;
|
|
328
|
+
};
|
|
329
|
+
data?: undefined;
|
|
330
|
+
};
|
|
298
331
|
/**
|
|
299
332
|
* Auth strategy shape compatible with `@cipherstash/auth` strategies (e.g.
|
|
300
|
-
* `AccessKeyStrategy`). Only `getToken` is required.
|
|
333
|
+
* `AccessKeyStrategy`, `OidcFederationStrategy`). Only `getToken` is required.
|
|
334
|
+
*
|
|
335
|
+
* `getToken` may resolve either shape — the native and WASM clients accept both
|
|
336
|
+
* (see `crates/protect-ffi/src/lib.rs` and `crates/protect-ffi/src/wasm.rs`):
|
|
337
|
+
*
|
|
338
|
+
* - `{ token }` — the bare payload, used by `@cipherstash/auth` <= 0.40 and by
|
|
339
|
+
* custom strategies.
|
|
340
|
+
* - `{ data: { token } }` / `{ failure }` — the `Result` envelope, used by
|
|
341
|
+
* `@cipherstash/auth` >= 0.41. A `failure` is reconstructed into the
|
|
342
|
+
* corresponding `AuthError`.
|
|
343
|
+
*
|
|
344
|
+
* Both have been accepted at runtime since 0.28.0; this type previously
|
|
345
|
+
* declared only the bare payload, so a real `@cipherstash/auth` >= 0.41
|
|
346
|
+
* strategy could not be assigned to it.
|
|
301
347
|
*/
|
|
302
348
|
export type AuthStrategy = {
|
|
303
|
-
getToken: () => Promise<
|
|
304
|
-
token: string;
|
|
305
|
-
}>;
|
|
349
|
+
getToken: () => Promise<TokenResult | TokenResultEnvelope>;
|
|
306
350
|
};
|
|
307
351
|
/** Options passed to the native `newClient` after vocabulary normalization. */
|
|
308
352
|
type NativeNewClientOptions = {
|
|
@@ -24,6 +24,7 @@ export type NativeEncryptConfig = Omit<EncryptConfig, 'tables'> & {
|
|
|
24
24
|
* `'none'` — the library would otherwise default to `'all'`.
|
|
25
25
|
*
|
|
26
26
|
* `mode` is intentionally left untouched: an omitted `mode` follows the
|
|
27
|
-
* library default (`
|
|
27
|
+
* library default (`compat` since cipherstash-config 0.40.0). The input
|
|
28
|
+
* config is never mutated.
|
|
28
29
|
*/
|
|
29
30
|
export declare function normalizeEncryptConfig(config: EncryptConfig): NativeEncryptConfig;
|
|
@@ -20,7 +20,8 @@ const CAST_AS_REMAP = {
|
|
|
20
20
|
* `'none'` — the library would otherwise default to `'all'`.
|
|
21
21
|
*
|
|
22
22
|
* `mode` is intentionally left untouched: an omitted `mode` follows the
|
|
23
|
-
* library default (`
|
|
23
|
+
* library default (`compat` since cipherstash-config 0.40.0). The input
|
|
24
|
+
* config is never mutated.
|
|
24
25
|
*/
|
|
25
26
|
function normalizeEncryptConfig(config) {
|
|
26
27
|
const tables = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cipherstash/protect-ffi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cipherstash/protectjs-ffi.git"
|
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
"vite": "^8.0.5"
|
|
104
104
|
},
|
|
105
105
|
"optionalDependencies": {
|
|
106
|
-
"@cipherstash/protect-ffi-darwin-x64": "0.
|
|
107
|
-
"@cipherstash/protect-ffi-darwin-arm64": "0.
|
|
108
|
-
"@cipherstash/protect-ffi-win32-x64-msvc": "0.
|
|
109
|
-
"@cipherstash/protect-ffi-linux-x64-gnu": "0.
|
|
110
|
-
"@cipherstash/protect-ffi-linux-arm64-gnu": "0.
|
|
111
|
-
"@cipherstash/protect-ffi-linux-x64-musl": "0.
|
|
106
|
+
"@cipherstash/protect-ffi-darwin-x64": "0.29.0",
|
|
107
|
+
"@cipherstash/protect-ffi-darwin-arm64": "0.29.0",
|
|
108
|
+
"@cipherstash/protect-ffi-win32-x64-msvc": "0.29.0",
|
|
109
|
+
"@cipherstash/protect-ffi-linux-x64-gnu": "0.29.0",
|
|
110
|
+
"@cipherstash/protect-ffi-linux-arm64-gnu": "0.29.0",
|
|
111
|
+
"@cipherstash/protect-ffi-linux-x64-musl": "0.29.0"
|
|
112
112
|
}
|
|
113
113
|
}
|