@redis/bloom 1.0.2 → 1.2.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 (47) hide show
  1. package/dist/commands/bloom/CARD.d.ts +4 -0
  2. package/dist/commands/bloom/CARD.js +9 -0
  3. package/dist/commands/bloom/INFO.d.ts +1 -1
  4. package/dist/commands/bloom/INSERT.d.ts +2 -1
  5. package/dist/commands/bloom/INSERT.js +1 -2
  6. package/dist/commands/bloom/SCANDUMP.d.ts +1 -1
  7. package/dist/commands/bloom/index.d.ts +3 -0
  8. package/dist/commands/bloom/index.js +3 -0
  9. package/dist/commands/count-min-sketch/INFO.d.ts +1 -1
  10. package/dist/commands/count-min-sketch/MERGE.d.ts +1 -1
  11. package/dist/commands/cuckoo/INFO.d.ts +1 -1
  12. package/dist/commands/cuckoo/SCANDUMP.d.ts +1 -1
  13. package/dist/commands/index.d.ts +32 -0
  14. package/dist/commands/index.js +2 -0
  15. package/dist/commands/t-digest/ADD.d.ts +4 -0
  16. package/dist/commands/t-digest/ADD.js +12 -0
  17. package/dist/commands/t-digest/BYRANK.d.ts +5 -0
  18. package/dist/commands/t-digest/BYRANK.js +15 -0
  19. package/dist/commands/t-digest/BYREVRANK.d.ts +5 -0
  20. package/dist/commands/t-digest/BYREVRANK.js +15 -0
  21. package/dist/commands/t-digest/CDF.d.ts +5 -0
  22. package/dist/commands/t-digest/CDF.js +15 -0
  23. package/dist/commands/t-digest/CREATE.d.ts +5 -0
  24. package/dist/commands/t-digest/CREATE.js +9 -0
  25. package/dist/commands/t-digest/INFO.d.ts +31 -0
  26. package/dist/commands/t-digest/INFO.js +24 -0
  27. package/dist/commands/t-digest/MAX.d.ts +5 -0
  28. package/dist/commands/t-digest/MAX.js +14 -0
  29. package/dist/commands/t-digest/MERGE.d.ts +9 -0
  30. package/dist/commands/t-digest/MERGE.js +15 -0
  31. package/dist/commands/t-digest/MIN.d.ts +5 -0
  32. package/dist/commands/t-digest/MIN.js +14 -0
  33. package/dist/commands/t-digest/QUANTILE.d.ts +5 -0
  34. package/dist/commands/t-digest/QUANTILE.js +18 -0
  35. package/dist/commands/t-digest/RANK.d.ts +5 -0
  36. package/dist/commands/t-digest/RANK.js +13 -0
  37. package/dist/commands/t-digest/RESET.d.ts +4 -0
  38. package/dist/commands/t-digest/RESET.js +8 -0
  39. package/dist/commands/t-digest/REVRANK.d.ts +5 -0
  40. package/dist/commands/t-digest/REVRANK.js +13 -0
  41. package/dist/commands/t-digest/TRIMMED_MEAN.d.ts +5 -0
  42. package/dist/commands/t-digest/TRIMMED_MEAN.js +16 -0
  43. package/dist/commands/t-digest/index.d.ts +52 -0
  44. package/dist/commands/t-digest/index.js +71 -0
  45. package/dist/commands/top-k/INFO.d.ts +1 -1
  46. package/dist/commands/top-k/LIST_WITHCOUNT.d.ts +2 -2
  47. package/package.json +6 -6
@@ -0,0 +1,4 @@
1
+ export declare const FIRST_KEY_INDEX = 1;
2
+ export declare const IS_READ_ONLY = true;
3
+ export declare function transformArguments(key: string): Array<string>;
4
+ export declare function transformReply(): number;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key) {
7
+ return ['BF.CARD', key];
8
+ }
9
+ exports.transformArguments = transformArguments;
@@ -1,7 +1,7 @@
1
1
  export declare const FIRST_KEY_INDEX = 1;
2
2
  export declare const IS_READ_ONLY = true;
3
3
  export declare function transformArguments(key: string): Array<string>;
4
- export declare type InfoRawReply = [
4
+ export type InfoRawReply = [
5
5
  _: string,
6
6
  capacity: number,
7
7
  _: string,
@@ -1,3 +1,4 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
1
2
  export declare const FIRST_KEY_INDEX = 1;
2
3
  interface InsertOptions {
3
4
  CAPACITY?: number;
@@ -6,5 +7,5 @@ interface InsertOptions {
6
7
  NOCREATE?: true;
7
8
  NONSCALING?: true;
8
9
  }
9
- export declare function transformArguments(key: string, items: string | Array<string>, options?: InsertOptions): Array<string>;
10
+ export declare function transformArguments(key: string, items: RedisCommandArgument | Array<RedisCommandArgument>, options?: InsertOptions): RedisCommandArguments;
10
11
  export { transformBooleanArrayReply as transformReply } from '@redis/client/dist/lib/commands/generic-transformers';
@@ -21,8 +21,7 @@ function transformArguments(key, items, options) {
21
21
  args.push('NONSCALING');
22
22
  }
23
23
  args.push('ITEMS');
24
- (0, generic_transformers_1.pushVerdictArguments)(args, items);
25
- return args;
24
+ return (0, generic_transformers_1.pushVerdictArguments)(args, items);
26
25
  }
27
26
  exports.transformArguments = transformArguments;
28
27
  var generic_transformers_2 = require("@redis/client/dist/lib/commands/generic-transformers");
@@ -1,7 +1,7 @@
1
1
  export declare const FIRST_KEY_INDEX = 1;
2
2
  export declare const IS_READ_ONLY = true;
3
3
  export declare function transformArguments(key: string, iterator: number): Array<string>;
4
- declare type ScanDumpRawReply = [
4
+ type ScanDumpRawReply = [
5
5
  iterator: number,
6
6
  chunk: string
7
7
  ];
@@ -1,4 +1,5 @@
1
1
  import * as ADD from './ADD';
2
+ import * as CARD from './CARD';
2
3
  import * as EXISTS from './EXISTS';
3
4
  import * as INFO from './INFO';
4
5
  import * as INSERT from './INSERT';
@@ -10,6 +11,8 @@ import * as SCANDUMP from './SCANDUMP';
10
11
  declare const _default: {
11
12
  ADD: typeof ADD;
12
13
  add: typeof ADD;
14
+ CARD: typeof CARD;
15
+ card: typeof CARD;
13
16
  EXISTS: typeof EXISTS;
14
17
  exists: typeof EXISTS;
15
18
  INFO: typeof INFO;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ADD = require("./ADD");
4
+ const CARD = require("./CARD");
4
5
  const EXISTS = require("./EXISTS");
5
6
  const INFO = require("./INFO");
6
7
  const INSERT = require("./INSERT");
@@ -12,6 +13,8 @@ const SCANDUMP = require("./SCANDUMP");
12
13
  exports.default = {
13
14
  ADD,
14
15
  add: ADD,
16
+ CARD,
17
+ card: CARD,
15
18
  EXISTS,
16
19
  exists: EXISTS,
17
20
  INFO,
@@ -1,7 +1,7 @@
1
1
  export declare const FIRST_KEY_INDEX = 1;
2
2
  export declare const IS_READ_ONLY = true;
3
3
  export declare function transformArguments(key: string): Array<string>;
4
- export declare type InfoRawReply = [
4
+ export type InfoRawReply = [
5
5
  _: string,
6
6
  width: number,
7
7
  _: string,
@@ -3,7 +3,7 @@ interface Sketch {
3
3
  name: string;
4
4
  weight: number;
5
5
  }
6
- declare type Sketches = Array<string> | Array<Sketch>;
6
+ type Sketches = Array<string> | Array<Sketch>;
7
7
  export declare function transformArguments(dest: string, src: Sketches): Array<string>;
8
8
  export declare function transformReply(): 'OK';
9
9
  export {};
@@ -1,7 +1,7 @@
1
1
  export declare const FIRST_KEY_INDEX = 1;
2
2
  export declare const IS_READ_ONLY = true;
3
3
  export declare function transformArguments(key: string): Array<string>;
4
- export declare type InfoRawReply = [
4
+ export type InfoRawReply = [
5
5
  _: string,
6
6
  size: number,
7
7
  _: string,
@@ -1,6 +1,6 @@
1
1
  export declare const FIRST_KEY_INDEX = 1;
2
2
  export declare function transformArguments(key: string, iterator: number): Array<string>;
3
- declare type ScanDumpRawReply = [
3
+ type ScanDumpRawReply = [
4
4
  iterator: number,
5
5
  chunk: string | null
6
6
  ];
@@ -2,6 +2,8 @@ declare const _default: {
2
2
  bf: {
3
3
  ADD: typeof import("./bloom/ADD");
4
4
  add: typeof import("./bloom/ADD");
5
+ CARD: typeof import("./bloom/CARD");
6
+ card: typeof import("./bloom/CARD");
5
7
  EXISTS: typeof import("./bloom/EXISTS");
6
8
  exists: typeof import("./bloom/EXISTS");
7
9
  INFO: typeof import("./bloom/INFO");
@@ -57,6 +59,36 @@ declare const _default: {
57
59
  SCANDUMP: typeof import("./cuckoo/SCANDUMP");
58
60
  scanDump: typeof import("./cuckoo/SCANDUMP");
59
61
  };
62
+ tDigest: {
63
+ ADD: typeof import("./t-digest/ADD");
64
+ add: typeof import("./t-digest/ADD");
65
+ BYRANK: typeof import("./t-digest/BYRANK");
66
+ byRank: typeof import("./t-digest/BYRANK");
67
+ BYREVRANK: typeof import("./t-digest/BYREVRANK");
68
+ byRevRank: typeof import("./t-digest/BYREVRANK");
69
+ CDF: typeof import("./t-digest/CDF");
70
+ cdf: typeof import("./t-digest/CDF");
71
+ CREATE: typeof import("./t-digest/CREATE");
72
+ create: typeof import("./t-digest/CREATE");
73
+ INFO: typeof import("./t-digest/INFO");
74
+ info: typeof import("./t-digest/INFO");
75
+ MAX: typeof import("./t-digest/MAX");
76
+ max: typeof import("./t-digest/MAX");
77
+ MERGE: typeof import("./t-digest/MERGE");
78
+ merge: typeof import("./t-digest/MERGE");
79
+ MIN: typeof import("./t-digest/MIN");
80
+ min: typeof import("./t-digest/MIN");
81
+ QUANTILE: typeof import("./t-digest/QUANTILE");
82
+ quantile: typeof import("./t-digest/QUANTILE");
83
+ RANK: typeof import("./t-digest/RANK");
84
+ rank: typeof import("./t-digest/RANK");
85
+ RESET: typeof import("./t-digest/RESET");
86
+ reset: typeof import("./t-digest/RESET");
87
+ REVRANK: typeof import("./t-digest/REVRANK");
88
+ revRank: typeof import("./t-digest/REVRANK");
89
+ TRIMMED_MEAN: typeof import("./t-digest/TRIMMED_MEAN");
90
+ trimmedMean: typeof import("./t-digest/TRIMMED_MEAN");
91
+ };
60
92
  topK: {
61
93
  ADD: typeof import("./top-k/ADD");
62
94
  add: typeof import("./top-k/ADD");
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const bloom_1 = require("./bloom");
4
4
  const count_min_sketch_1 = require("./count-min-sketch");
5
5
  const cuckoo_1 = require("./cuckoo");
6
+ const t_digest_1 = require("./t-digest");
6
7
  const top_k_1 = require("./top-k");
7
8
  exports.default = {
8
9
  bf: bloom_1.default,
9
10
  cms: count_min_sketch_1.default,
10
11
  cf: cuckoo_1.default,
12
+ tDigest: t_digest_1.default,
11
13
  topK: top_k_1.default
12
14
  };
@@ -0,0 +1,4 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare function transformArguments(key: RedisCommandArgument, values: Array<number>): RedisCommandArguments;
4
+ export declare function transformReply(): 'OK';
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformArguments = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ function transformArguments(key, values) {
6
+ const args = ['TDIGEST.ADD', key];
7
+ for (const item of values) {
8
+ args.push(item.toString());
9
+ }
10
+ return args;
11
+ }
12
+ exports.transformArguments = transformArguments;
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument, ranks: Array<number>): RedisCommandArguments;
5
+ export { transformDoublesReply as transformReply } from '.';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key, ranks) {
7
+ const args = ['TDIGEST.BYRANK', key];
8
+ for (const rank of ranks) {
9
+ args.push(rank.toString());
10
+ }
11
+ return args;
12
+ }
13
+ exports.transformArguments = transformArguments;
14
+ var _1 = require(".");
15
+ Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return _1.transformDoublesReply; } });
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument, ranks: Array<number>): RedisCommandArguments;
5
+ export { transformDoublesReply as transformReply } from '.';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key, ranks) {
7
+ const args = ['TDIGEST.BYREVRANK', key];
8
+ for (const rank of ranks) {
9
+ args.push(rank.toString());
10
+ }
11
+ return args;
12
+ }
13
+ exports.transformArguments = transformArguments;
14
+ var _1 = require(".");
15
+ Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return _1.transformDoublesReply; } });
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument, values: Array<number>): RedisCommandArguments;
5
+ export { transformDoublesReply as transformReply } from '.';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key, values) {
7
+ const args = ['TDIGEST.CDF', key];
8
+ for (const item of values) {
9
+ args.push(item.toString());
10
+ }
11
+ return args;
12
+ }
13
+ exports.transformArguments = transformArguments;
14
+ var _1 = require(".");
15
+ Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return _1.transformDoublesReply; } });
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ import { CompressionOption } from '.';
3
+ export declare const FIRST_KEY_INDEX = 1;
4
+ export declare function transformArguments(key: RedisCommandArgument, options?: CompressionOption): RedisCommandArguments;
5
+ export declare function transformReply(): 'OK';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformArguments = exports.FIRST_KEY_INDEX = void 0;
4
+ const _1 = require(".");
5
+ exports.FIRST_KEY_INDEX = 1;
6
+ function transformArguments(key, options) {
7
+ return (0, _1.pushCompressionArgument)(['TDIGEST.CREATE', key], options);
8
+ }
9
+ exports.transformArguments = transformArguments;
@@ -0,0 +1,31 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument): RedisCommandArguments;
5
+ type InfoRawReply = [
6
+ 'Compression',
7
+ number,
8
+ 'Capacity',
9
+ number,
10
+ 'Merged nodes',
11
+ number,
12
+ 'Unmerged nodes',
13
+ number,
14
+ 'Merged weight',
15
+ string,
16
+ 'Unmerged weight',
17
+ string,
18
+ 'Total compressions',
19
+ number
20
+ ];
21
+ interface InfoReply {
22
+ comperssion: number;
23
+ capacity: number;
24
+ mergedNodes: number;
25
+ unmergedNodes: number;
26
+ mergedWeight: number;
27
+ unmergedWeight: number;
28
+ totalCompression: number;
29
+ }
30
+ export declare function transformReply(reply: InfoRawReply): InfoReply;
31
+ export {};
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key) {
7
+ return [
8
+ 'TDIGEST.INFO',
9
+ key
10
+ ];
11
+ }
12
+ exports.transformArguments = transformArguments;
13
+ function transformReply(reply) {
14
+ return {
15
+ comperssion: reply[1],
16
+ capacity: reply[3],
17
+ mergedNodes: reply[5],
18
+ unmergedNodes: reply[7],
19
+ mergedWeight: Number(reply[9]),
20
+ unmergedWeight: Number(reply[11]),
21
+ totalCompression: reply[13]
22
+ };
23
+ }
24
+ exports.transformReply = transformReply;
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument): RedisCommandArguments;
5
+ export { transformDoubleReply as transformReply } from '.';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key) {
7
+ return [
8
+ 'TDIGEST.MAX',
9
+ key
10
+ ];
11
+ }
12
+ exports.transformArguments = transformArguments;
13
+ var _1 = require(".");
14
+ Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return _1.transformDoubleReply; } });
@@ -0,0 +1,9 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ import { CompressionOption } from '.';
3
+ export declare const FIRST_KEY_INDEX = 1;
4
+ interface MergeOptions extends CompressionOption {
5
+ OVERRIDE?: boolean;
6
+ }
7
+ export declare function transformArguments(destKey: RedisCommandArgument, srcKeys: RedisCommandArgument | Array<RedisCommandArgument>, options?: MergeOptions): RedisCommandArguments;
8
+ export declare function transformReply(): 'OK';
9
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformArguments = exports.FIRST_KEY_INDEX = void 0;
4
+ const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
5
+ const _1 = require(".");
6
+ exports.FIRST_KEY_INDEX = 1;
7
+ function transformArguments(destKey, srcKeys, options) {
8
+ const args = (0, generic_transformers_1.pushVerdictArgument)(['TDIGEST.MERGE', destKey], srcKeys);
9
+ (0, _1.pushCompressionArgument)(args, options);
10
+ if (options?.OVERRIDE) {
11
+ args.push('OVERRIDE');
12
+ }
13
+ return args;
14
+ }
15
+ exports.transformArguments = transformArguments;
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument): RedisCommandArguments;
5
+ export { transformDoubleReply as transformReply } from '.';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key) {
7
+ return [
8
+ 'TDIGEST.MIN',
9
+ key
10
+ ];
11
+ }
12
+ exports.transformArguments = transformArguments;
13
+ var _1 = require(".");
14
+ Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return _1.transformDoubleReply; } });
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument, quantiles: Array<number>): RedisCommandArguments;
5
+ export { transformDoublesReply as transformReply } from '.';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key, quantiles) {
7
+ const args = [
8
+ 'TDIGEST.QUANTILE',
9
+ key
10
+ ];
11
+ for (const quantile of quantiles) {
12
+ args.push(quantile.toString());
13
+ }
14
+ return args;
15
+ }
16
+ exports.transformArguments = transformArguments;
17
+ var _1 = require(".");
18
+ Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return _1.transformDoublesReply; } });
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument, values: Array<number>): RedisCommandArguments;
5
+ export declare function transformReply(): Array<number>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key, values) {
7
+ const args = ['TDIGEST.RANK', key];
8
+ for (const item of values) {
9
+ args.push(item.toString());
10
+ }
11
+ return args;
12
+ }
13
+ exports.transformArguments = transformArguments;
@@ -0,0 +1,4 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare function transformArguments(key: RedisCommandArgument): RedisCommandArguments;
4
+ export declare function transformReply(): 'OK';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformArguments = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ function transformArguments(key) {
6
+ return ['TDIGEST.RESET', key];
7
+ }
8
+ exports.transformArguments = transformArguments;
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument, values: Array<number>): RedisCommandArguments;
5
+ export declare function transformReply(): Array<number>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key, values) {
7
+ const args = ['TDIGEST.REVRANK', key];
8
+ for (const item of values) {
9
+ args.push(item.toString());
10
+ }
11
+ return args;
12
+ }
13
+ exports.transformArguments = transformArguments;
@@ -0,0 +1,5 @@
1
+ import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ export declare const FIRST_KEY_INDEX = 1;
3
+ export declare const IS_READ_ONLY = true;
4
+ export declare function transformArguments(key: RedisCommandArgument, lowCutPercentile: number, highCutPercentile: number): RedisCommandArguments;
5
+ export { transformDoubleReply as transformReply } from '.';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
4
+ exports.FIRST_KEY_INDEX = 1;
5
+ exports.IS_READ_ONLY = true;
6
+ function transformArguments(key, lowCutPercentile, highCutPercentile) {
7
+ return [
8
+ 'TDIGEST.TRIMMED_MEAN',
9
+ key,
10
+ lowCutPercentile.toString(),
11
+ highCutPercentile.toString()
12
+ ];
13
+ }
14
+ exports.transformArguments = transformArguments;
15
+ var _1 = require(".");
16
+ Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return _1.transformDoubleReply; } });
@@ -0,0 +1,52 @@
1
+ import { RedisCommandArguments } from '@redis/client/dist/lib/commands';
2
+ import * as ADD from './ADD';
3
+ import * as BYRANK from './BYRANK';
4
+ import * as BYREVRANK from './BYREVRANK';
5
+ import * as CDF from './CDF';
6
+ import * as CREATE from './CREATE';
7
+ import * as INFO from './INFO';
8
+ import * as MAX from './MAX';
9
+ import * as MERGE from './MERGE';
10
+ import * as MIN from './MIN';
11
+ import * as QUANTILE from './QUANTILE';
12
+ import * as RANK from './RANK';
13
+ import * as RESET from './RESET';
14
+ import * as REVRANK from './REVRANK';
15
+ import * as TRIMMED_MEAN from './TRIMMED_MEAN';
16
+ declare const _default: {
17
+ ADD: typeof ADD;
18
+ add: typeof ADD;
19
+ BYRANK: typeof BYRANK;
20
+ byRank: typeof BYRANK;
21
+ BYREVRANK: typeof BYREVRANK;
22
+ byRevRank: typeof BYREVRANK;
23
+ CDF: typeof CDF;
24
+ cdf: typeof CDF;
25
+ CREATE: typeof CREATE;
26
+ create: typeof CREATE;
27
+ INFO: typeof INFO;
28
+ info: typeof INFO;
29
+ MAX: typeof MAX;
30
+ max: typeof MAX;
31
+ MERGE: typeof MERGE;
32
+ merge: typeof MERGE;
33
+ MIN: typeof MIN;
34
+ min: typeof MIN;
35
+ QUANTILE: typeof QUANTILE;
36
+ quantile: typeof QUANTILE;
37
+ RANK: typeof RANK;
38
+ rank: typeof RANK;
39
+ RESET: typeof RESET;
40
+ reset: typeof RESET;
41
+ REVRANK: typeof REVRANK;
42
+ revRank: typeof REVRANK;
43
+ TRIMMED_MEAN: typeof TRIMMED_MEAN;
44
+ trimmedMean: typeof TRIMMED_MEAN;
45
+ };
46
+ export default _default;
47
+ export interface CompressionOption {
48
+ COMPRESSION?: number;
49
+ }
50
+ export declare function pushCompressionArgument(args: RedisCommandArguments, options?: CompressionOption): RedisCommandArguments;
51
+ export declare function transformDoubleReply(reply: string): number;
52
+ export declare function transformDoublesReply(reply: Array<string>): Array<number>;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformDoublesReply = exports.transformDoubleReply = exports.pushCompressionArgument = void 0;
4
+ const ADD = require("./ADD");
5
+ const BYRANK = require("./BYRANK");
6
+ const BYREVRANK = require("./BYREVRANK");
7
+ const CDF = require("./CDF");
8
+ const CREATE = require("./CREATE");
9
+ const INFO = require("./INFO");
10
+ const MAX = require("./MAX");
11
+ const MERGE = require("./MERGE");
12
+ const MIN = require("./MIN");
13
+ const QUANTILE = require("./QUANTILE");
14
+ const RANK = require("./RANK");
15
+ const RESET = require("./RESET");
16
+ const REVRANK = require("./REVRANK");
17
+ const TRIMMED_MEAN = require("./TRIMMED_MEAN");
18
+ exports.default = {
19
+ ADD,
20
+ add: ADD,
21
+ BYRANK,
22
+ byRank: BYRANK,
23
+ BYREVRANK,
24
+ byRevRank: BYREVRANK,
25
+ CDF,
26
+ cdf: CDF,
27
+ CREATE,
28
+ create: CREATE,
29
+ INFO,
30
+ info: INFO,
31
+ MAX,
32
+ max: MAX,
33
+ MERGE,
34
+ merge: MERGE,
35
+ MIN,
36
+ min: MIN,
37
+ QUANTILE,
38
+ quantile: QUANTILE,
39
+ RANK,
40
+ rank: RANK,
41
+ RESET,
42
+ reset: RESET,
43
+ REVRANK,
44
+ revRank: REVRANK,
45
+ TRIMMED_MEAN,
46
+ trimmedMean: TRIMMED_MEAN
47
+ };
48
+ function pushCompressionArgument(args, options) {
49
+ if (options?.COMPRESSION) {
50
+ args.push('COMPRESSION', options.COMPRESSION.toString());
51
+ }
52
+ return args;
53
+ }
54
+ exports.pushCompressionArgument = pushCompressionArgument;
55
+ function transformDoubleReply(reply) {
56
+ switch (reply) {
57
+ case 'inf':
58
+ return Infinity;
59
+ case '-inf':
60
+ return -Infinity;
61
+ case 'nan':
62
+ return NaN;
63
+ default:
64
+ return parseFloat(reply);
65
+ }
66
+ }
67
+ exports.transformDoubleReply = transformDoubleReply;
68
+ function transformDoublesReply(reply) {
69
+ return reply.map(transformDoubleReply);
70
+ }
71
+ exports.transformDoublesReply = transformDoublesReply;
@@ -1,7 +1,7 @@
1
1
  export declare const FIRST_KEY_INDEX = 1;
2
2
  export declare const IS_READ_ONLY = true;
3
3
  export declare function transformArguments(key: string): Array<string>;
4
- export declare type InfoRawReply = [
4
+ export type InfoRawReply = [
5
5
  _: string,
6
6
  k: number,
7
7
  _: string,
@@ -1,8 +1,8 @@
1
1
  export declare const FIRST_KEY_INDEX = 1;
2
2
  export declare const IS_READ_ONLY = true;
3
3
  export declare function transformArguments(key: string): Array<string>;
4
- declare type ListWithCountRawReply = Array<string | number>;
5
- declare type ListWithCountReply = Array<{
4
+ type ListWithCountRawReply = Array<string | number>;
5
+ type ListWithCountReply = Array<{
6
6
  item: string;
7
7
  count: number;
8
8
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redis/bloom",
3
- "version": "1.0.2",
3
+ "version": "1.2.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,12 +18,12 @@
18
18
  "devDependencies": {
19
19
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
20
20
  "@redis/test-utils": "*",
21
- "@types/node": "^17.0.31",
21
+ "@types/node": "^18.11.18",
22
22
  "nyc": "^15.1.0",
23
- "release-it": "^15.0.0",
23
+ "release-it": "^15.6.0",
24
24
  "source-map-support": "^0.5.21",
25
- "ts-node": "^10.7.0",
26
- "typedoc": "^0.22.15",
27
- "typescript": "^4.6.4"
25
+ "ts-node": "^10.9.1",
26
+ "typedoc": "^0.23.24",
27
+ "typescript": "^4.9.4"
28
28
  }
29
29
  }