@redis/search 1.1.5 → 2.0.0-next.2
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/dist/lib/commands/AGGREGATE.d.ts +102 -0
- package/dist/lib/commands/AGGREGATE.js +170 -0
- package/dist/lib/commands/AGGREGATE_WITHCURSOR.d.ts +13 -0
- package/dist/lib/commands/AGGREGATE_WITHCURSOR.js +22 -0
- package/dist/lib/commands/ALIASADD.d.ts +8 -0
- package/dist/lib/commands/ALIASADD.js +10 -0
- package/dist/lib/commands/ALIASDEL.d.ts +8 -0
- package/dist/lib/commands/ALIASDEL.js +10 -0
- package/dist/lib/commands/ALIASUPDATE.d.ts +8 -0
- package/dist/lib/commands/ALIASUPDATE.js +10 -0
- package/dist/lib/commands/ALTER.d.ts +9 -0
- package/dist/lib/commands/ALTER.js +13 -0
- package/dist/lib/commands/CONFIG_GET.d.ts +8 -0
- package/dist/lib/commands/CONFIG_GET.js +17 -0
- package/dist/lib/commands/CONFIG_SET.d.ts +10 -0
- package/dist/lib/commands/CONFIG_SET.js +10 -0
- package/dist/lib/commands/CREATE.d.ts +124 -0
- package/dist/lib/commands/CREATE.js +193 -0
- package/dist/lib/commands/CURSOR_DEL.d.ts +8 -0
- package/dist/lib/commands/CURSOR_DEL.js +10 -0
- package/dist/lib/commands/CURSOR_READ.d.ts +11 -0
- package/dist/lib/commands/CURSOR_READ.js +18 -0
- package/dist/lib/commands/DICTADD.d.ts +9 -0
- package/dist/lib/commands/DICTADD.js +11 -0
- package/dist/lib/commands/DICTDEL.d.ts +9 -0
- package/dist/lib/commands/DICTDEL.js +11 -0
- package/dist/lib/commands/DICTDUMP.d.ts +11 -0
- package/dist/lib/commands/DICTDUMP.js +13 -0
- package/dist/lib/commands/DROPINDEX.d.ts +14 -0
- package/dist/lib/commands/DROPINDEX.js +17 -0
- package/dist/lib/commands/EXPLAIN.d.ts +0 -0
- package/dist/lib/commands/EXPLAIN.js +24 -0
- package/dist/lib/commands/EXPLAINCLI.d.ts +8 -0
- package/dist/lib/commands/EXPLAINCLI.js +10 -0
- package/dist/lib/commands/INFO.d.ts +0 -0
- package/dist/lib/commands/INFO.js +164 -0
- package/dist/lib/commands/PROFILE_AGGREGATE.d.ts +0 -0
- package/dist/lib/commands/PROFILE_AGGREGATE.js +24 -0
- package/dist/lib/commands/PROFILE_SEARCH.d.ts +0 -0
- package/dist/lib/commands/PROFILE_SEARCH.js +24 -0
- package/dist/lib/commands/SEARCH.d.ts +48 -0
- package/dist/lib/commands/SEARCH.js +96 -0
- package/dist/lib/commands/SEARCH_NOCONTENT.d.ts +7 -0
- package/dist/lib/commands/SEARCH_NOCONTENT.js +16 -0
- package/dist/lib/commands/SPELLCHECK.d.ts +17 -0
- package/dist/lib/commands/SPELLCHECK.js +52 -0
- package/dist/lib/commands/SUGADD.d.ts +12 -0
- package/dist/lib/commands/SUGADD.js +17 -0
- package/dist/lib/commands/SUGDEL.d.ts +8 -0
- package/dist/lib/commands/SUGDEL.js +10 -0
- package/dist/lib/commands/SUGGET.d.ts +12 -0
- package/dist/lib/commands/SUGGET.js +17 -0
- package/dist/lib/commands/SUGGET_WITHPAYLOADS.d.ts +11 -0
- package/dist/lib/commands/SUGGET_WITHPAYLOADS.js +29 -0
- package/dist/lib/commands/SUGGET_WITHSCORES.d.ts +17 -0
- package/dist/lib/commands/SUGGET_WITHSCORES.js +44 -0
- package/dist/lib/commands/SUGGET_WITHSCORES_WITHPAYLOADS.d.ts +19 -0
- package/dist/lib/commands/SUGGET_WITHSCORES_WITHPAYLOADS.js +46 -0
- package/dist/lib/commands/SUGLEN.d.ts +8 -0
- package/dist/lib/commands/SUGLEN.js +10 -0
- package/dist/lib/commands/SYNDUMP.d.ts +11 -0
- package/dist/lib/commands/SYNDUMP.js +21 -0
- package/dist/lib/commands/SYNUPDATE.d.ts +12 -0
- package/dist/lib/commands/SYNUPDATE.js +15 -0
- package/dist/lib/commands/TAGVALS.d.ts +11 -0
- package/dist/lib/commands/TAGVALS.js +13 -0
- package/dist/lib/commands/_LIST.d.ts +11 -0
- package/dist/lib/commands/_LIST.js +13 -0
- package/dist/lib/commands/index.d.ts +428 -0
- package/dist/lib/commands/index.js +109 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +13 -0
- package/package.json +8 -17
- package/dist/commands/AGGREGATE.d.ts +0 -117
- package/dist/commands/AGGREGATE.js +0 -167
- package/dist/commands/AGGREGATE_WITHCURSOR.d.ts +0 -14
- package/dist/commands/AGGREGATE_WITHCURSOR.js +0 -23
- package/dist/commands/ALIASADD.d.ts +0 -2
- package/dist/commands/ALIASADD.js +0 -7
- package/dist/commands/ALIASDEL.d.ts +0 -2
- package/dist/commands/ALIASDEL.js +0 -7
- package/dist/commands/ALIASUPDATE.d.ts +0 -2
- package/dist/commands/ALIASUPDATE.js +0 -7
- package/dist/commands/ALTER.d.ts +0 -3
- package/dist/commands/ALTER.js +0 -10
- package/dist/commands/CONFIG_GET.d.ts +0 -6
- package/dist/commands/CONFIG_GET.js +0 -15
- package/dist/commands/CONFIG_SET.d.ts +0 -2
- package/dist/commands/CONFIG_SET.js +0 -7
- package/dist/commands/CREATE.d.ts +0 -21
- package/dist/commands/CREATE.js +0 -56
- package/dist/commands/CURSOR_DEL.d.ts +0 -4
- package/dist/commands/CURSOR_DEL.js +0 -13
- package/dist/commands/CURSOR_READ.d.ts +0 -8
- package/dist/commands/CURSOR_READ.js +0 -20
- package/dist/commands/DICTADD.d.ts +0 -3
- package/dist/commands/DICTADD.js +0 -8
- package/dist/commands/DICTDEL.d.ts +0 -3
- package/dist/commands/DICTDEL.js +0 -8
- package/dist/commands/DICTDUMP.d.ts +0 -2
- package/dist/commands/DICTDUMP.js +0 -7
- package/dist/commands/DROPINDEX.d.ts +0 -6
- package/dist/commands/DROPINDEX.js +0 -11
- package/dist/commands/EXPLAIN.d.ts +0 -9
- package/dist/commands/EXPLAIN.js +0 -14
- package/dist/commands/EXPLAINCLI.d.ts +0 -3
- package/dist/commands/EXPLAINCLI.js +0 -8
- package/dist/commands/INFO.d.ts +0 -120
- package/dist/commands/INFO.js +0 -51
- package/dist/commands/PROFILE_AGGREGATE.d.ts +0 -7
- package/dist/commands/PROFILE_AGGREGATE.js +0 -23
- package/dist/commands/PROFILE_SEARCH.d.ts +0 -8
- package/dist/commands/PROFILE_SEARCH.js +0 -22
- package/dist/commands/SEARCH.d.ts +0 -41
- package/dist/commands/SEARCH.js +0 -43
- package/dist/commands/SEARCH_NOCONTENT.d.ts +0 -10
- package/dist/commands/SEARCH_NOCONTENT.js +0 -18
- package/dist/commands/SPELLCHECK.d.ts +0 -24
- package/dist/commands/SPELLCHECK.js +0 -37
- package/dist/commands/SUGADD.d.ts +0 -7
- package/dist/commands/SUGADD.js +0 -14
- package/dist/commands/SUGDEL.d.ts +0 -2
- package/dist/commands/SUGDEL.js +0 -9
- package/dist/commands/SUGGET.d.ts +0 -7
- package/dist/commands/SUGGET.js +0 -15
- package/dist/commands/SUGGET_WITHPAYLOADS.d.ts +0 -8
- package/dist/commands/SUGGET_WITHPAYLOADS.js +0 -26
- package/dist/commands/SUGGET_WITHSCORES.d.ts +0 -8
- package/dist/commands/SUGGET_WITHSCORES.js +0 -26
- package/dist/commands/SUGGET_WITHSCORES_WITHPAYLOADS.d.ts +0 -7
- package/dist/commands/SUGGET_WITHSCORES_WITHPAYLOADS.js +0 -28
- package/dist/commands/SUGLEN.d.ts +0 -3
- package/dist/commands/SUGLEN.js +0 -8
- package/dist/commands/SYNDUMP.d.ts +0 -2
- package/dist/commands/SYNDUMP.js +0 -7
- package/dist/commands/SYNUPDATE.d.ts +0 -7
- package/dist/commands/SYNUPDATE.js +0 -12
- package/dist/commands/TAGVALS.d.ts +0 -2
- package/dist/commands/TAGVALS.js +0 -7
- package/dist/commands/_LIST.d.ts +0 -2
- package/dist/commands/_LIST.js +0 -7
- package/dist/commands/index.d.ts +0 -254
- package/dist/commands/index.js +0 -433
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -12
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
|
|
2
|
-
import { Params, PropertyName, SortByProperty } from '.';
|
|
3
|
-
export declare enum AggregateSteps {
|
|
4
|
-
GROUPBY = "GROUPBY",
|
|
5
|
-
SORTBY = "SORTBY",
|
|
6
|
-
APPLY = "APPLY",
|
|
7
|
-
LIMIT = "LIMIT",
|
|
8
|
-
FILTER = "FILTER"
|
|
9
|
-
}
|
|
10
|
-
interface AggregateStep<T extends AggregateSteps> {
|
|
11
|
-
type: T;
|
|
12
|
-
}
|
|
13
|
-
export declare enum AggregateGroupByReducers {
|
|
14
|
-
COUNT = "COUNT",
|
|
15
|
-
COUNT_DISTINCT = "COUNT_DISTINCT",
|
|
16
|
-
COUNT_DISTINCTISH = "COUNT_DISTINCTISH",
|
|
17
|
-
SUM = "SUM",
|
|
18
|
-
MIN = "MIN",
|
|
19
|
-
MAX = "MAX",
|
|
20
|
-
AVG = "AVG",
|
|
21
|
-
STDDEV = "STDDEV",
|
|
22
|
-
QUANTILE = "QUANTILE",
|
|
23
|
-
TOLIST = "TOLIST",
|
|
24
|
-
TO_LIST = "TOLIST",
|
|
25
|
-
FIRST_VALUE = "FIRST_VALUE",
|
|
26
|
-
RANDOM_SAMPLE = "RANDOM_SAMPLE"
|
|
27
|
-
}
|
|
28
|
-
interface GroupByReducer<T extends AggregateGroupByReducers> {
|
|
29
|
-
type: T;
|
|
30
|
-
AS?: string;
|
|
31
|
-
}
|
|
32
|
-
type CountReducer = GroupByReducer<AggregateGroupByReducers.COUNT>;
|
|
33
|
-
interface CountDistinctReducer extends GroupByReducer<AggregateGroupByReducers.COUNT_DISTINCT> {
|
|
34
|
-
property: PropertyName;
|
|
35
|
-
}
|
|
36
|
-
interface CountDistinctishReducer extends GroupByReducer<AggregateGroupByReducers.COUNT_DISTINCTISH> {
|
|
37
|
-
property: PropertyName;
|
|
38
|
-
}
|
|
39
|
-
interface SumReducer extends GroupByReducer<AggregateGroupByReducers.SUM> {
|
|
40
|
-
property: PropertyName;
|
|
41
|
-
}
|
|
42
|
-
interface MinReducer extends GroupByReducer<AggregateGroupByReducers.MIN> {
|
|
43
|
-
property: PropertyName;
|
|
44
|
-
}
|
|
45
|
-
interface MaxReducer extends GroupByReducer<AggregateGroupByReducers.MAX> {
|
|
46
|
-
property: PropertyName;
|
|
47
|
-
}
|
|
48
|
-
interface AvgReducer extends GroupByReducer<AggregateGroupByReducers.AVG> {
|
|
49
|
-
property: PropertyName;
|
|
50
|
-
}
|
|
51
|
-
interface StdDevReducer extends GroupByReducer<AggregateGroupByReducers.STDDEV> {
|
|
52
|
-
property: PropertyName;
|
|
53
|
-
}
|
|
54
|
-
interface QuantileReducer extends GroupByReducer<AggregateGroupByReducers.QUANTILE> {
|
|
55
|
-
property: PropertyName;
|
|
56
|
-
quantile: number;
|
|
57
|
-
}
|
|
58
|
-
interface ToListReducer extends GroupByReducer<AggregateGroupByReducers.TOLIST> {
|
|
59
|
-
property: PropertyName;
|
|
60
|
-
}
|
|
61
|
-
interface FirstValueReducer extends GroupByReducer<AggregateGroupByReducers.FIRST_VALUE> {
|
|
62
|
-
property: PropertyName;
|
|
63
|
-
BY?: PropertyName | {
|
|
64
|
-
property: PropertyName;
|
|
65
|
-
direction?: 'ASC' | 'DESC';
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
interface RandomSampleReducer extends GroupByReducer<AggregateGroupByReducers.RANDOM_SAMPLE> {
|
|
69
|
-
property: PropertyName;
|
|
70
|
-
sampleSize: number;
|
|
71
|
-
}
|
|
72
|
-
type GroupByReducers = CountReducer | CountDistinctReducer | CountDistinctishReducer | SumReducer | MinReducer | MaxReducer | AvgReducer | StdDevReducer | QuantileReducer | ToListReducer | FirstValueReducer | RandomSampleReducer;
|
|
73
|
-
interface GroupByStep extends AggregateStep<AggregateSteps.GROUPBY> {
|
|
74
|
-
properties?: PropertyName | Array<PropertyName>;
|
|
75
|
-
REDUCE: GroupByReducers | Array<GroupByReducers>;
|
|
76
|
-
}
|
|
77
|
-
interface SortStep extends AggregateStep<AggregateSteps.SORTBY> {
|
|
78
|
-
BY: SortByProperty | Array<SortByProperty>;
|
|
79
|
-
MAX?: number;
|
|
80
|
-
}
|
|
81
|
-
interface ApplyStep extends AggregateStep<AggregateSteps.APPLY> {
|
|
82
|
-
expression: string;
|
|
83
|
-
AS: string;
|
|
84
|
-
}
|
|
85
|
-
interface LimitStep extends AggregateStep<AggregateSteps.LIMIT> {
|
|
86
|
-
from: number;
|
|
87
|
-
size: number;
|
|
88
|
-
}
|
|
89
|
-
interface FilterStep extends AggregateStep<AggregateSteps.FILTER> {
|
|
90
|
-
expression: string;
|
|
91
|
-
}
|
|
92
|
-
type LoadField = PropertyName | {
|
|
93
|
-
identifier: PropertyName;
|
|
94
|
-
AS?: string;
|
|
95
|
-
};
|
|
96
|
-
export interface AggregateOptions {
|
|
97
|
-
VERBATIM?: true;
|
|
98
|
-
LOAD?: LoadField | Array<LoadField>;
|
|
99
|
-
STEPS?: Array<GroupByStep | SortStep | ApplyStep | LimitStep | FilterStep>;
|
|
100
|
-
PARAMS?: Params;
|
|
101
|
-
DIALECT?: number;
|
|
102
|
-
TIMEOUT?: number;
|
|
103
|
-
}
|
|
104
|
-
export declare const FIRST_KEY_INDEX = 1;
|
|
105
|
-
export declare const IS_READ_ONLY = true;
|
|
106
|
-
export declare function transformArguments(index: string, query: string, options?: AggregateOptions): RedisCommandArguments;
|
|
107
|
-
export declare function pushAggregatehOptions(args: RedisCommandArguments, options?: AggregateOptions): RedisCommandArguments;
|
|
108
|
-
export type AggregateRawReply = [
|
|
109
|
-
total: number,
|
|
110
|
-
...results: Array<Array<RedisCommandArgument>>
|
|
111
|
-
];
|
|
112
|
-
export interface AggregateReply {
|
|
113
|
-
total: number;
|
|
114
|
-
results: Array<Record<string, RedisCommandArgument>>;
|
|
115
|
-
}
|
|
116
|
-
export declare function transformReply(rawReply: AggregateRawReply): AggregateReply;
|
|
117
|
-
export {};
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformReply = exports.pushAggregatehOptions = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = exports.AggregateGroupByReducers = exports.AggregateSteps = void 0;
|
|
4
|
-
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
|
|
5
|
-
const _1 = require(".");
|
|
6
|
-
var AggregateSteps;
|
|
7
|
-
(function (AggregateSteps) {
|
|
8
|
-
AggregateSteps["GROUPBY"] = "GROUPBY";
|
|
9
|
-
AggregateSteps["SORTBY"] = "SORTBY";
|
|
10
|
-
AggregateSteps["APPLY"] = "APPLY";
|
|
11
|
-
AggregateSteps["LIMIT"] = "LIMIT";
|
|
12
|
-
AggregateSteps["FILTER"] = "FILTER";
|
|
13
|
-
})(AggregateSteps || (exports.AggregateSteps = AggregateSteps = {}));
|
|
14
|
-
var AggregateGroupByReducers;
|
|
15
|
-
(function (AggregateGroupByReducers) {
|
|
16
|
-
AggregateGroupByReducers["COUNT"] = "COUNT";
|
|
17
|
-
AggregateGroupByReducers["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
18
|
-
AggregateGroupByReducers["COUNT_DISTINCTISH"] = "COUNT_DISTINCTISH";
|
|
19
|
-
AggregateGroupByReducers["SUM"] = "SUM";
|
|
20
|
-
AggregateGroupByReducers["MIN"] = "MIN";
|
|
21
|
-
AggregateGroupByReducers["MAX"] = "MAX";
|
|
22
|
-
AggregateGroupByReducers["AVG"] = "AVG";
|
|
23
|
-
AggregateGroupByReducers["STDDEV"] = "STDDEV";
|
|
24
|
-
AggregateGroupByReducers["QUANTILE"] = "QUANTILE";
|
|
25
|
-
AggregateGroupByReducers["TOLIST"] = "TOLIST";
|
|
26
|
-
AggregateGroupByReducers["TO_LIST"] = "TOLIST";
|
|
27
|
-
AggregateGroupByReducers["FIRST_VALUE"] = "FIRST_VALUE";
|
|
28
|
-
AggregateGroupByReducers["RANDOM_SAMPLE"] = "RANDOM_SAMPLE";
|
|
29
|
-
})(AggregateGroupByReducers || (exports.AggregateGroupByReducers = AggregateGroupByReducers = {}));
|
|
30
|
-
exports.FIRST_KEY_INDEX = 1;
|
|
31
|
-
exports.IS_READ_ONLY = true;
|
|
32
|
-
function transformArguments(index, query, options) {
|
|
33
|
-
return pushAggregatehOptions(['FT.AGGREGATE', index, query], options);
|
|
34
|
-
}
|
|
35
|
-
exports.transformArguments = transformArguments;
|
|
36
|
-
function pushAggregatehOptions(args, options) {
|
|
37
|
-
if (options?.VERBATIM) {
|
|
38
|
-
args.push('VERBATIM');
|
|
39
|
-
}
|
|
40
|
-
if (options?.LOAD) {
|
|
41
|
-
args.push('LOAD');
|
|
42
|
-
(0, _1.pushArgumentsWithLength)(args, () => {
|
|
43
|
-
if (Array.isArray(options.LOAD)) {
|
|
44
|
-
for (const load of options.LOAD) {
|
|
45
|
-
pushLoadField(args, load);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
pushLoadField(args, options.LOAD);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
if (options?.STEPS) {
|
|
54
|
-
for (const step of options.STEPS) {
|
|
55
|
-
switch (step.type) {
|
|
56
|
-
case AggregateSteps.GROUPBY:
|
|
57
|
-
args.push('GROUPBY');
|
|
58
|
-
if (!step.properties) {
|
|
59
|
-
args.push('0');
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
(0, generic_transformers_1.pushVerdictArgument)(args, step.properties);
|
|
63
|
-
}
|
|
64
|
-
if (Array.isArray(step.REDUCE)) {
|
|
65
|
-
for (const reducer of step.REDUCE) {
|
|
66
|
-
pushGroupByReducer(args, reducer);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
pushGroupByReducer(args, step.REDUCE);
|
|
71
|
-
}
|
|
72
|
-
break;
|
|
73
|
-
case AggregateSteps.SORTBY:
|
|
74
|
-
(0, _1.pushSortByArguments)(args, 'SORTBY', step.BY);
|
|
75
|
-
if (step.MAX) {
|
|
76
|
-
args.push('MAX', step.MAX.toString());
|
|
77
|
-
}
|
|
78
|
-
break;
|
|
79
|
-
case AggregateSteps.APPLY:
|
|
80
|
-
args.push('APPLY', step.expression, 'AS', step.AS);
|
|
81
|
-
break;
|
|
82
|
-
case AggregateSteps.LIMIT:
|
|
83
|
-
args.push('LIMIT', step.from.toString(), step.size.toString());
|
|
84
|
-
break;
|
|
85
|
-
case AggregateSteps.FILTER:
|
|
86
|
-
args.push('FILTER', step.expression);
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
(0, _1.pushParamsArgs)(args, options?.PARAMS);
|
|
92
|
-
if (options?.DIALECT) {
|
|
93
|
-
args.push('DIALECT', options.DIALECT.toString());
|
|
94
|
-
}
|
|
95
|
-
if (options?.TIMEOUT !== undefined) {
|
|
96
|
-
args.push('TIMEOUT', options.TIMEOUT.toString());
|
|
97
|
-
}
|
|
98
|
-
return args;
|
|
99
|
-
}
|
|
100
|
-
exports.pushAggregatehOptions = pushAggregatehOptions;
|
|
101
|
-
function pushLoadField(args, toLoad) {
|
|
102
|
-
if (typeof toLoad === 'string') {
|
|
103
|
-
args.push(toLoad);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
args.push(toLoad.identifier);
|
|
107
|
-
if (toLoad.AS) {
|
|
108
|
-
args.push('AS', toLoad.AS);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function pushGroupByReducer(args, reducer) {
|
|
113
|
-
args.push('REDUCE', reducer.type);
|
|
114
|
-
switch (reducer.type) {
|
|
115
|
-
case AggregateGroupByReducers.COUNT:
|
|
116
|
-
args.push('0');
|
|
117
|
-
break;
|
|
118
|
-
case AggregateGroupByReducers.COUNT_DISTINCT:
|
|
119
|
-
case AggregateGroupByReducers.COUNT_DISTINCTISH:
|
|
120
|
-
case AggregateGroupByReducers.SUM:
|
|
121
|
-
case AggregateGroupByReducers.MIN:
|
|
122
|
-
case AggregateGroupByReducers.MAX:
|
|
123
|
-
case AggregateGroupByReducers.AVG:
|
|
124
|
-
case AggregateGroupByReducers.STDDEV:
|
|
125
|
-
case AggregateGroupByReducers.TOLIST:
|
|
126
|
-
args.push('1', reducer.property);
|
|
127
|
-
break;
|
|
128
|
-
case AggregateGroupByReducers.QUANTILE:
|
|
129
|
-
args.push('2', reducer.property, reducer.quantile.toString());
|
|
130
|
-
break;
|
|
131
|
-
case AggregateGroupByReducers.FIRST_VALUE: {
|
|
132
|
-
(0, _1.pushArgumentsWithLength)(args, () => {
|
|
133
|
-
args.push(reducer.property);
|
|
134
|
-
if (reducer.BY) {
|
|
135
|
-
args.push('BY');
|
|
136
|
-
if (typeof reducer.BY === 'string') {
|
|
137
|
-
args.push(reducer.BY);
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
args.push(reducer.BY.property);
|
|
141
|
-
if (reducer.BY.direction) {
|
|
142
|
-
args.push(reducer.BY.direction);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
case AggregateGroupByReducers.RANDOM_SAMPLE:
|
|
150
|
-
args.push('2', reducer.property, reducer.sampleSize.toString());
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
153
|
-
if (reducer.AS) {
|
|
154
|
-
args.push('AS', reducer.AS);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
function transformReply(rawReply) {
|
|
158
|
-
const results = [];
|
|
159
|
-
for (let i = 1; i < rawReply.length; i++) {
|
|
160
|
-
results.push((0, generic_transformers_1.transformTuplesReply)(rawReply[i]));
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
total: rawReply[0],
|
|
164
|
-
results
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
exports.transformReply = transformReply;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AggregateOptions, AggregateRawReply, AggregateReply } from './AGGREGATE';
|
|
2
|
-
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './AGGREGATE';
|
|
3
|
-
interface AggregateWithCursorOptions extends AggregateOptions {
|
|
4
|
-
COUNT?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function transformArguments(index: string, query: string, options?: AggregateWithCursorOptions): import("@redis/client/dist/lib/commands").RedisCommandArguments;
|
|
7
|
-
type AggregateWithCursorRawReply = [
|
|
8
|
-
result: AggregateRawReply,
|
|
9
|
-
cursor: number
|
|
10
|
-
];
|
|
11
|
-
interface AggregateWithCursorReply extends AggregateReply {
|
|
12
|
-
cursor: number;
|
|
13
|
-
}
|
|
14
|
-
export declare function transformReply(reply: AggregateWithCursorRawReply): AggregateWithCursorReply;
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
const AGGREGATE_1 = require("./AGGREGATE");
|
|
5
|
-
var AGGREGATE_2 = require("./AGGREGATE");
|
|
6
|
-
Object.defineProperty(exports, "FIRST_KEY_INDEX", { enumerable: true, get: function () { return AGGREGATE_2.FIRST_KEY_INDEX; } });
|
|
7
|
-
Object.defineProperty(exports, "IS_READ_ONLY", { enumerable: true, get: function () { return AGGREGATE_2.IS_READ_ONLY; } });
|
|
8
|
-
function transformArguments(index, query, options) {
|
|
9
|
-
const args = (0, AGGREGATE_1.transformArguments)(index, query, options);
|
|
10
|
-
args.push('WITHCURSOR');
|
|
11
|
-
if (options?.COUNT) {
|
|
12
|
-
args.push('COUNT', options.COUNT.toString());
|
|
13
|
-
}
|
|
14
|
-
return args;
|
|
15
|
-
}
|
|
16
|
-
exports.transformArguments = transformArguments;
|
|
17
|
-
function transformReply(reply) {
|
|
18
|
-
return {
|
|
19
|
-
...(0, AGGREGATE_1.transformReply)(reply[0]),
|
|
20
|
-
cursor: reply[1]
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
exports.transformReply = transformReply;
|
package/dist/commands/ALTER.d.ts
DELETED
package/dist/commands/ALTER.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformArguments = void 0;
|
|
4
|
-
const _1 = require(".");
|
|
5
|
-
function transformArguments(index, schema) {
|
|
6
|
-
const args = ['FT.ALTER', index, 'SCHEMA', 'ADD'];
|
|
7
|
-
(0, _1.pushSchema)(args, schema);
|
|
8
|
-
return args;
|
|
9
|
-
}
|
|
10
|
-
exports.transformArguments = transformArguments;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformReply = exports.transformArguments = void 0;
|
|
4
|
-
function transformArguments(option) {
|
|
5
|
-
return ['FT.CONFIG', 'GET', option];
|
|
6
|
-
}
|
|
7
|
-
exports.transformArguments = transformArguments;
|
|
8
|
-
function transformReply(rawReply) {
|
|
9
|
-
const transformedReply = Object.create(null);
|
|
10
|
-
for (const [key, value] of rawReply) {
|
|
11
|
-
transformedReply[key] = value;
|
|
12
|
-
}
|
|
13
|
-
return transformedReply;
|
|
14
|
-
}
|
|
15
|
-
exports.transformReply = transformReply;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { RedisSearchLanguages, PropertyName, RediSearchSchema } from '.';
|
|
2
|
-
interface CreateOptions {
|
|
3
|
-
ON?: 'HASH' | 'JSON';
|
|
4
|
-
PREFIX?: string | Array<string>;
|
|
5
|
-
FILTER?: string;
|
|
6
|
-
LANGUAGE?: RedisSearchLanguages;
|
|
7
|
-
LANGUAGE_FIELD?: PropertyName;
|
|
8
|
-
SCORE?: number;
|
|
9
|
-
SCORE_FIELD?: PropertyName;
|
|
10
|
-
MAXTEXTFIELDS?: true;
|
|
11
|
-
TEMPORARY?: number;
|
|
12
|
-
NOOFFSETS?: true;
|
|
13
|
-
NOHL?: true;
|
|
14
|
-
NOFIELDS?: true;
|
|
15
|
-
NOFREQS?: true;
|
|
16
|
-
SKIPINITIALSCAN?: true;
|
|
17
|
-
STOPWORDS?: string | Array<string>;
|
|
18
|
-
}
|
|
19
|
-
export declare function transformArguments(index: string, schema: RediSearchSchema, options?: CreateOptions): Array<string>;
|
|
20
|
-
export declare function transformReply(): 'OK';
|
|
21
|
-
export {};
|
package/dist/commands/CREATE.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformArguments = void 0;
|
|
4
|
-
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
|
|
5
|
-
const _1 = require(".");
|
|
6
|
-
function transformArguments(index, schema, options) {
|
|
7
|
-
const args = ['FT.CREATE', index];
|
|
8
|
-
if (options?.ON) {
|
|
9
|
-
args.push('ON', options.ON);
|
|
10
|
-
}
|
|
11
|
-
(0, generic_transformers_1.pushOptionalVerdictArgument)(args, 'PREFIX', options?.PREFIX);
|
|
12
|
-
if (options?.FILTER) {
|
|
13
|
-
args.push('FILTER', options.FILTER);
|
|
14
|
-
}
|
|
15
|
-
if (options?.LANGUAGE) {
|
|
16
|
-
args.push('LANGUAGE', options.LANGUAGE);
|
|
17
|
-
}
|
|
18
|
-
if (options?.LANGUAGE_FIELD) {
|
|
19
|
-
args.push('LANGUAGE_FIELD', options.LANGUAGE_FIELD);
|
|
20
|
-
}
|
|
21
|
-
if (options?.SCORE) {
|
|
22
|
-
args.push('SCORE', options.SCORE.toString());
|
|
23
|
-
}
|
|
24
|
-
if (options?.SCORE_FIELD) {
|
|
25
|
-
args.push('SCORE_FIELD', options.SCORE_FIELD);
|
|
26
|
-
}
|
|
27
|
-
// if (options?.PAYLOAD_FIELD) {
|
|
28
|
-
// args.push('PAYLOAD_FIELD', options.PAYLOAD_FIELD);
|
|
29
|
-
// }
|
|
30
|
-
if (options?.MAXTEXTFIELDS) {
|
|
31
|
-
args.push('MAXTEXTFIELDS');
|
|
32
|
-
}
|
|
33
|
-
if (options?.TEMPORARY) {
|
|
34
|
-
args.push('TEMPORARY', options.TEMPORARY.toString());
|
|
35
|
-
}
|
|
36
|
-
if (options?.NOOFFSETS) {
|
|
37
|
-
args.push('NOOFFSETS');
|
|
38
|
-
}
|
|
39
|
-
if (options?.NOHL) {
|
|
40
|
-
args.push('NOHL');
|
|
41
|
-
}
|
|
42
|
-
if (options?.NOFIELDS) {
|
|
43
|
-
args.push('NOFIELDS');
|
|
44
|
-
}
|
|
45
|
-
if (options?.NOFREQS) {
|
|
46
|
-
args.push('NOFREQS');
|
|
47
|
-
}
|
|
48
|
-
if (options?.SKIPINITIALSCAN) {
|
|
49
|
-
args.push('SKIPINITIALSCAN');
|
|
50
|
-
}
|
|
51
|
-
(0, generic_transformers_1.pushOptionalVerdictArgument)(args, 'STOPWORDS', options?.STOPWORDS);
|
|
52
|
-
args.push('SCHEMA');
|
|
53
|
-
(0, _1.pushSchema)(args, schema);
|
|
54
|
-
return args;
|
|
55
|
-
}
|
|
56
|
-
exports.transformArguments = transformArguments;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RedisCommandArgument } from '@redis/client/dist/lib/commands';
|
|
2
|
-
export declare const FIRST_KEY_INDEX = 1;
|
|
3
|
-
export declare function transformArguments(index: RedisCommandArgument, cursorId: number): RedisCommandArgument[];
|
|
4
|
-
export declare function transformReply(): 'OK';
|
|
@@ -1,13 +0,0 @@
|
|
|
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(index, cursorId) {
|
|
6
|
-
return [
|
|
7
|
-
'FT.CURSOR',
|
|
8
|
-
'DEL',
|
|
9
|
-
index,
|
|
10
|
-
cursorId.toString()
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
exports.transformArguments = transformArguments;
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
interface CursorReadOptions {
|
|
5
|
-
COUNT?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function transformArguments(index: RedisCommandArgument, cursor: number, options?: CursorReadOptions): RedisCommandArguments;
|
|
8
|
-
export { transformReply } from './AGGREGATE_WITHCURSOR';
|
|
@@ -1,20 +0,0 @@
|
|
|
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(index, cursor, options) {
|
|
7
|
-
const args = [
|
|
8
|
-
'FT.CURSOR',
|
|
9
|
-
'READ',
|
|
10
|
-
index,
|
|
11
|
-
cursor.toString()
|
|
12
|
-
];
|
|
13
|
-
if (options?.COUNT) {
|
|
14
|
-
args.push('COUNT', options.COUNT.toString());
|
|
15
|
-
}
|
|
16
|
-
return args;
|
|
17
|
-
}
|
|
18
|
-
exports.transformArguments = transformArguments;
|
|
19
|
-
var AGGREGATE_WITHCURSOR_1 = require("./AGGREGATE_WITHCURSOR");
|
|
20
|
-
Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return AGGREGATE_WITHCURSOR_1.transformReply; } });
|
package/dist/commands/DICTADD.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformArguments = void 0;
|
|
4
|
-
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
|
|
5
|
-
function transformArguments(dictionary, term) {
|
|
6
|
-
return (0, generic_transformers_1.pushVerdictArguments)(['FT.DICTADD', dictionary], term);
|
|
7
|
-
}
|
|
8
|
-
exports.transformArguments = transformArguments;
|
package/dist/commands/DICTDEL.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformArguments = void 0;
|
|
4
|
-
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
|
|
5
|
-
function transformArguments(dictionary, term) {
|
|
6
|
-
return (0, generic_transformers_1.pushVerdictArguments)(['FT.DICTDEL', dictionary], term);
|
|
7
|
-
}
|
|
8
|
-
exports.transformArguments = transformArguments;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformArguments = void 0;
|
|
4
|
-
function transformArguments(index, options) {
|
|
5
|
-
const args = ['FT.DROPINDEX', index];
|
|
6
|
-
if (options?.DD) {
|
|
7
|
-
args.push('DD');
|
|
8
|
-
}
|
|
9
|
-
return args;
|
|
10
|
-
}
|
|
11
|
-
exports.transformArguments = transformArguments;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Params } from ".";
|
|
2
|
-
export declare const IS_READ_ONLY = true;
|
|
3
|
-
interface ExplainOptions {
|
|
4
|
-
PARAMS?: Params;
|
|
5
|
-
DIALECT?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function transformArguments(index: string, query: string, options?: ExplainOptions): Array<string>;
|
|
8
|
-
export declare function transformReply(): string;
|
|
9
|
-
export {};
|
package/dist/commands/EXPLAIN.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformArguments = exports.IS_READ_ONLY = void 0;
|
|
4
|
-
const _1 = require(".");
|
|
5
|
-
exports.IS_READ_ONLY = true;
|
|
6
|
-
function transformArguments(index, query, options) {
|
|
7
|
-
const args = ['FT.EXPLAIN', index, query];
|
|
8
|
-
(0, _1.pushParamsArgs)(args, options?.PARAMS);
|
|
9
|
-
if (options?.DIALECT) {
|
|
10
|
-
args.push('DIALECT', options.DIALECT.toString());
|
|
11
|
-
}
|
|
12
|
-
return args;
|
|
13
|
-
}
|
|
14
|
-
exports.transformArguments = transformArguments;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformArguments = exports.IS_READ_ONLY = void 0;
|
|
4
|
-
exports.IS_READ_ONLY = true;
|
|
5
|
-
function transformArguments(index, query) {
|
|
6
|
-
return ['FT.EXPLAINCLI', index, query];
|
|
7
|
-
}
|
|
8
|
-
exports.transformArguments = transformArguments;
|