@cipherstash/protect-ffi 0.27.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/LICENSE.md +1 -1
- package/README.md +106 -34
- package/dist/wasm/protect_ffi.d.ts +10 -3
- package/dist/wasm/protect_ffi_bg.js +63 -14
- package/dist/wasm/protect_ffi_bg.wasm +0 -0
- package/dist/wasm/protect_ffi_bg.wasm.d.ts +11 -11
- package/dist/wasm/protect_ffi_inline.js +1 -1
- package/lib/bigintWire.d.ts +56 -0
- package/lib/bigintWire.js +83 -0
- 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 +23 -11
- package/lib/index.d.cts +91 -25
- package/lib/normalizeEncryptConfig.d.ts +2 -1
- package/lib/normalizeEncryptConfig.js +2 -1
- package/package.json +11 -11
- package/lib/eql-v3-types/OreCllw.d.ts +0 -7
- package/lib/eql-v3-types/OreCllw.js +0 -5
|
@@ -3,7 +3,7 @@ import type { Ciphertext } from "./Ciphertext";
|
|
|
3
3
|
import type { Identifier } from "./Identifier";
|
|
4
4
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
5
5
|
/**
|
|
6
|
-
* `
|
|
6
|
+
* `public.eql_v3_text_match` — match domain.
|
|
7
7
|
*
|
|
8
8
|
* Operators: `@>` `<@`. Required keys: `v` `i` `c` `bf`.
|
|
9
9
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BloomFilter } from "./BloomFilter";
|
|
2
|
+
import type { Identifier } from "./Identifier";
|
|
3
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
4
|
+
/**
|
|
5
|
+
* `eql_v3.query_text_match` — match domain query operand.
|
|
6
|
+
*
|
|
7
|
+
* Operators: `@>` `<@`. Required keys: `v` `i` `bf`.
|
|
8
|
+
*/
|
|
9
|
+
export type TextMatchQuery = {
|
|
10
|
+
v: SchemaVersion;
|
|
11
|
+
i: Identifier;
|
|
12
|
+
bf: BloomFilter;
|
|
13
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { Ciphertext } from "./Ciphertext";
|
|
2
2
|
import type { Hmac256 } from "./Hmac256";
|
|
3
3
|
import type { Identifier } from "./Identifier";
|
|
4
|
-
import type {
|
|
4
|
+
import type { OpeCllw } from "./OpeCllw";
|
|
5
5
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
6
6
|
/**
|
|
7
|
-
* `
|
|
7
|
+
* `public.eql_v3_text_ord` — ordering domain.
|
|
8
8
|
*
|
|
9
|
-
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `
|
|
9
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `op`.
|
|
10
10
|
*/
|
|
11
11
|
export type TextOrd = {
|
|
12
12
|
v: SchemaVersion;
|
|
13
13
|
i: Identifier;
|
|
14
14
|
c: Ciphertext;
|
|
15
15
|
hm: Hmac256;
|
|
16
|
-
|
|
16
|
+
op: OpeCllw;
|
|
17
17
|
};
|
|
@@ -4,7 +4,7 @@ import type { Identifier } from "./Identifier";
|
|
|
4
4
|
import type { OpeCllw } from "./OpeCllw";
|
|
5
5
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
6
6
|
/**
|
|
7
|
-
* `
|
|
7
|
+
* `public.eql_v3_text_ord_ope` — ordering domain.
|
|
8
8
|
*
|
|
9
9
|
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `op`.
|
|
10
10
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Hmac256 } from "./Hmac256";
|
|
2
|
+
import type { Identifier } from "./Identifier";
|
|
3
|
+
import type { OpeCllw } from "./OpeCllw";
|
|
4
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
5
|
+
/**
|
|
6
|
+
* `eql_v3.query_text_ord_ope` — ordering domain query operand.
|
|
7
|
+
*
|
|
8
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `hm` `op`.
|
|
9
|
+
*/
|
|
10
|
+
export type TextOrdOpeQuery = {
|
|
11
|
+
v: SchemaVersion;
|
|
12
|
+
i: Identifier;
|
|
13
|
+
hm: Hmac256;
|
|
14
|
+
op: OpeCllw;
|
|
15
|
+
};
|
|
@@ -4,7 +4,7 @@ import type { Identifier } from "./Identifier";
|
|
|
4
4
|
import type { OreBlock256 } from "./OreBlock256";
|
|
5
5
|
import type { SchemaVersion } from "./SchemaVersion";
|
|
6
6
|
/**
|
|
7
|
-
* `
|
|
7
|
+
* `public.eql_v3_text_ord_ore` — ordering domain.
|
|
8
8
|
*
|
|
9
9
|
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`.
|
|
10
10
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Hmac256 } from "./Hmac256";
|
|
2
|
+
import type { Identifier } from "./Identifier";
|
|
3
|
+
import type { OreBlock256 } from "./OreBlock256";
|
|
4
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
5
|
+
/**
|
|
6
|
+
* `eql_v3.query_text_ord_ore` — ordering domain query operand.
|
|
7
|
+
*
|
|
8
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `hm` `ob`.
|
|
9
|
+
*/
|
|
10
|
+
export type TextOrdOreQuery = {
|
|
11
|
+
v: SchemaVersion;
|
|
12
|
+
i: Identifier;
|
|
13
|
+
hm: Hmac256;
|
|
14
|
+
ob: OreBlock256;
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Hmac256 } from "./Hmac256";
|
|
2
|
+
import type { Identifier } from "./Identifier";
|
|
3
|
+
import type { OpeCllw } from "./OpeCllw";
|
|
4
|
+
import type { SchemaVersion } from "./SchemaVersion";
|
|
5
|
+
/**
|
|
6
|
+
* `eql_v3.query_text_ord` — ordering domain query operand.
|
|
7
|
+
*
|
|
8
|
+
* Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `hm` `op`.
|
|
9
|
+
*/
|
|
10
|
+
export type TextOrdQuery = {
|
|
11
|
+
v: SchemaVersion;
|
|
12
|
+
i: Identifier;
|
|
13
|
+
hm: Hmac256;
|
|
14
|
+
op: OpeCllw;
|
|
15
|
+
};
|
|
@@ -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
|
@@ -48,6 +48,7 @@ exports.decryptBulkFallible = decryptBulkFallible;
|
|
|
48
48
|
exports.encryptQuery = encryptQuery;
|
|
49
49
|
exports.encryptQueryBulk = encryptQueryBulk;
|
|
50
50
|
exports.ensureKeyset = ensureKeyset;
|
|
51
|
+
const bigintWire_js_1 = require("./bigintWire.js");
|
|
51
52
|
const credentials_js_1 = require("./credentials.js");
|
|
52
53
|
const native = __importStar(require("./load.cjs"));
|
|
53
54
|
const normalizeEncryptConfig_js_1 = require("./normalizeEncryptConfig.js");
|
|
@@ -81,7 +82,7 @@ function newClient(opts) {
|
|
|
81
82
|
}, opts.strategy));
|
|
82
83
|
}
|
|
83
84
|
function encrypt(client, opts) {
|
|
84
|
-
return wrapAsync(() => native.encrypt(client, opts));
|
|
85
|
+
return wrapAsync(() => native.encrypt(client, (0, bigintWire_js_1.withEncodedPlaintext)(opts)));
|
|
85
86
|
}
|
|
86
87
|
function decrypt(client, opts) {
|
|
87
88
|
return wrapAsync(() => native.decrypt(client, opts));
|
|
@@ -97,7 +98,10 @@ function isEncrypted(encrypted) {
|
|
|
97
98
|
return wrapSync(() => native.isEncrypted(encrypted));
|
|
98
99
|
}
|
|
99
100
|
function encryptBulk(client, opts) {
|
|
100
|
-
return wrapAsync(() =>
|
|
101
|
+
return wrapAsync(() => {
|
|
102
|
+
const plaintexts = (0, bigintWire_js_1.withEncodedPlaintexts)(opts.plaintexts);
|
|
103
|
+
return native.encryptBulk(client, plaintexts === opts.plaintexts ? opts : { ...opts, plaintexts });
|
|
104
|
+
});
|
|
101
105
|
}
|
|
102
106
|
function decryptBulk(client, opts) {
|
|
103
107
|
return wrapAsync(() => native.decryptBulk(client, opts));
|
|
@@ -117,19 +121,27 @@ async function decryptBulkFallible(client, opts) {
|
|
|
117
121
|
* Under `eqlVersion: 2` (default) this returns the v2 shapes ({@link
|
|
118
122
|
* Encrypted} for JSON containment, {@link EncryptedQuery} otherwise).
|
|
119
123
|
*
|
|
120
|
-
* Under `eqlVersion: 3`
|
|
121
|
-
*
|
|
122
|
-
* index queries (`unique` / `ore` / `ope` / `match`)
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
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 `->` / `->>`.
|
|
126
135
|
*/
|
|
127
136
|
function encryptQuery(client, opts) {
|
|
128
|
-
return wrapAsync(() => native.encryptQuery(client, opts));
|
|
137
|
+
return wrapAsync(() => native.encryptQuery(client, (0, bigintWire_js_1.withEncodedPlaintext)(opts)));
|
|
129
138
|
}
|
|
130
|
-
/** Bulk variant of {@link encryptQuery} — same EQL v3
|
|
139
|
+
/** Bulk variant of {@link encryptQuery} — same EQL v3 shapes apply. */
|
|
131
140
|
function encryptQueryBulk(client, opts) {
|
|
132
|
-
return wrapAsync(() =>
|
|
141
|
+
return wrapAsync(() => {
|
|
142
|
+
const queries = (0, bigintWire_js_1.withEncodedPlaintexts)(opts.queries);
|
|
143
|
+
return native.encryptQueryBulk(client, queries === opts.queries ? opts : { ...opts, queries });
|
|
144
|
+
});
|
|
133
145
|
}
|
|
134
146
|
/**
|
|
135
147
|
* Test-only helper: ensures a keyset with the given name exists, creating it if necessary,
|