@redis/time-series 1.0.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/ADD.d.ts +16 -0
- package/dist/lib/commands/ADD.js +24 -0
- package/dist/lib/commands/ALTER.d.ts +10 -0
- package/dist/lib/commands/ALTER.js +16 -0
- package/dist/lib/commands/CREATE.d.ts +16 -0
- package/dist/lib/commands/CREATE.js +17 -0
- package/dist/lib/commands/CREATERULE.d.ts +24 -0
- package/dist/lib/commands/CREATERULE.js +37 -0
- package/dist/lib/commands/DECRBY.d.ts +7 -0
- package/dist/lib/commands/DECRBY.js +32 -0
- package/dist/lib/commands/DEL.d.ts +9 -0
- package/dist/lib/commands/DEL.js +16 -0
- package/dist/lib/commands/DELETERULE.d.ts +8 -0
- package/dist/lib/commands/DELETERULE.js +14 -0
- package/dist/lib/commands/GET.d.ts +21 -0
- package/dist/lib/commands/GET.js +27 -0
- package/dist/lib/commands/INCRBY.d.ts +17 -0
- package/dist/lib/commands/INCRBY.js +28 -0
- package/dist/lib/commands/INFO.d.ts +0 -0
- package/dist/lib/commands/INFO.js +77 -0
- package/dist/lib/commands/INFO_DEBUG.d.ts +0 -0
- package/dist/lib/commands/INFO_DEBUG.js +53 -0
- package/dist/lib/commands/MADD.d.ts +14 -0
- package/dist/lib/commands/MADD.js +15 -0
- package/dist/lib/commands/MGET.d.ts +14 -0
- package/dist/lib/commands/MGET.js +27 -0
- package/dist/lib/commands/MGET_WITHLABELS.d.ts +12 -0
- package/dist/lib/commands/MGET_WITHLABELS.js +15 -0
- package/dist/lib/commands/MRANGE.d.ts +32 -0
- package/dist/lib/commands/MRANGE.js +37 -0
- package/dist/lib/commands/MRANGE_WITHLABELS.d.ts +15 -0
- package/dist/lib/commands/MRANGE_WITHLABELS.js +21 -0
- package/dist/lib/commands/MREVRANGE.d.ts +7 -0
- package/dist/lib/commands/MREVRANGE.js +32 -0
- package/dist/lib/commands/MREVRANGE_WITHLABELS.d.ts +7 -0
- package/dist/lib/commands/MREVRANGE_WITHLABELS.js +32 -0
- package/dist/lib/commands/QUERYINDEX.d.ts +12 -0
- package/dist/lib/commands/QUERYINDEX.js +14 -0
- package/dist/lib/commands/RANGE.d.ts +44 -0
- package/dist/lib/commands/RANGE.js +58 -0
- package/dist/lib/commands/REVRANGE.d.ts +16 -0
- package/dist/lib/commands/REVRANGE.js +32 -0
- package/dist/lib/commands/index.d.ts +333 -0
- package/dist/lib/commands/index.js +153 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +14 -0
- package/package.json +8 -17
- package/dist/commands/ADD.d.ts +0 -12
- package/dist/commands/ADD.js +0 -22
- package/dist/commands/ALTER.d.ts +0 -11
- package/dist/commands/ALTER.js +0 -14
- package/dist/commands/CREATE.d.ts +0 -12
- package/dist/commands/CREATE.js +0 -15
- package/dist/commands/CREATERULE.d.ts +0 -4
- package/dist/commands/CREATERULE.js +0 -19
- package/dist/commands/DECRBY.d.ts +0 -5
- package/dist/commands/DECRBY.js +0 -9
- package/dist/commands/DEL.d.ts +0 -5
- package/dist/commands/DEL.js +0 -14
- package/dist/commands/DELETERULE.d.ts +0 -3
- package/dist/commands/DELETERULE.js +0 -12
- package/dist/commands/GET.d.ts +0 -10
- package/dist/commands/GET.js +0 -16
- package/dist/commands/INCRBY.d.ts +0 -5
- package/dist/commands/INCRBY.js +0 -9
- package/dist/commands/INFO.d.ts +0 -52
- package/dist/commands/INFO.js +0 -33
- package/dist/commands/INFO_DEBUG.d.ts +0 -32
- package/dist/commands/INFO_DEBUG.js +0 -26
- package/dist/commands/MADD.d.ts +0 -10
- package/dist/commands/MADD.js +0 -13
- package/dist/commands/MGET.d.ts +0 -17
- package/dist/commands/MGET.js +0 -17
- package/dist/commands/MGET_WITHLABELS.d.ts +0 -13
- package/dist/commands/MGET_WITHLABELS.js +0 -19
- package/dist/commands/MRANGE.d.ts +0 -5
- package/dist/commands/MRANGE.js +0 -11
- package/dist/commands/MRANGE_WITHLABELS.d.ts +0 -5
- package/dist/commands/MRANGE_WITHLABELS.js +0 -11
- package/dist/commands/MREVRANGE.d.ts +0 -5
- package/dist/commands/MREVRANGE.js +0 -11
- package/dist/commands/MREVRANGE_WITHLABELS.d.ts +0 -5
- package/dist/commands/MREVRANGE_WITHLABELS.js +0 -11
- package/dist/commands/QUERYINDEX.d.ts +0 -5
- package/dist/commands/QUERYINDEX.js +0 -9
- package/dist/commands/RANGE.d.ts +0 -6
- package/dist/commands/RANGE.js +0 -14
- package/dist/commands/REVRANGE.d.ts +0 -6
- package/dist/commands/REVRANGE.js +0 -14
- package/dist/commands/index.d.ts +0 -192
- package/dist/commands/index.js +0 -307
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -11
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { TimeSeriesEncoding, TimeSeriesDuplicatePolicies, Labels, Timestamp } from '.';
|
|
3
|
+
export interface TsAddOptions {
|
|
4
|
+
RETENTION?: number;
|
|
5
|
+
ENCODING?: TimeSeriesEncoding;
|
|
6
|
+
CHUNK_SIZE?: number;
|
|
7
|
+
ON_DUPLICATE?: TimeSeriesDuplicatePolicies;
|
|
8
|
+
LABELS?: Labels;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: {
|
|
11
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
12
|
+
readonly IS_READ_ONLY: false;
|
|
13
|
+
readonly transformArguments: (this: void, key: RedisArgument, timestamp: Timestamp, value: number, options?: TsAddOptions) => RedisArgument[];
|
|
14
|
+
readonly transformReply: () => NumberReply;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _1 = require(".");
|
|
4
|
+
exports.default = {
|
|
5
|
+
FIRST_KEY_INDEX: 1,
|
|
6
|
+
IS_READ_ONLY: false,
|
|
7
|
+
transformArguments(key, timestamp, value, options) {
|
|
8
|
+
const args = [
|
|
9
|
+
'TS.ADD',
|
|
10
|
+
key,
|
|
11
|
+
(0, _1.transformTimestampArgument)(timestamp),
|
|
12
|
+
value.toString()
|
|
13
|
+
];
|
|
14
|
+
(0, _1.pushRetentionArgument)(args, options?.RETENTION);
|
|
15
|
+
(0, _1.pushEncodingArgument)(args, options?.ENCODING);
|
|
16
|
+
(0, _1.pushChunkSizeArgument)(args, options?.CHUNK_SIZE);
|
|
17
|
+
if (options?.ON_DUPLICATE) {
|
|
18
|
+
args.push('ON_DUPLICATE', options.ON_DUPLICATE);
|
|
19
|
+
}
|
|
20
|
+
(0, _1.pushLabelsArgument)(args, options?.LABELS);
|
|
21
|
+
return args;
|
|
22
|
+
},
|
|
23
|
+
transformReply: undefined
|
|
24
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RedisArgument, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { TsCreateOptions } from './CREATE';
|
|
3
|
+
export type TsAlterOptions = Pick<TsCreateOptions, 'RETENTION' | 'CHUNK_SIZE' | 'DUPLICATE_POLICY' | 'LABELS'>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
6
|
+
readonly IS_READ_ONLY: false;
|
|
7
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: TsAlterOptions) => RedisArgument[];
|
|
8
|
+
readonly transformReply: () => SimpleStringReply<'OK'>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _1 = require(".");
|
|
4
|
+
exports.default = {
|
|
5
|
+
FIRST_KEY_INDEX: 1,
|
|
6
|
+
IS_READ_ONLY: false,
|
|
7
|
+
transformArguments(key, options) {
|
|
8
|
+
const args = ['TS.ALTER', key];
|
|
9
|
+
(0, _1.pushRetentionArgument)(args, options?.RETENTION);
|
|
10
|
+
(0, _1.pushChunkSizeArgument)(args, options?.CHUNK_SIZE);
|
|
11
|
+
(0, _1.pushDuplicatePolicy)(args, options?.DUPLICATE_POLICY);
|
|
12
|
+
(0, _1.pushLabelsArgument)(args, options?.LABELS);
|
|
13
|
+
return args;
|
|
14
|
+
},
|
|
15
|
+
transformReply: undefined
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RedisArgument, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { TimeSeriesEncoding, TimeSeriesDuplicatePolicies, Labels } from '.';
|
|
3
|
+
export interface TsCreateOptions {
|
|
4
|
+
RETENTION?: number;
|
|
5
|
+
ENCODING?: TimeSeriesEncoding;
|
|
6
|
+
CHUNK_SIZE?: number;
|
|
7
|
+
DUPLICATE_POLICY?: TimeSeriesDuplicatePolicies;
|
|
8
|
+
LABELS?: Labels;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: {
|
|
11
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
12
|
+
readonly IS_READ_ONLY: false;
|
|
13
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: TsCreateOptions) => RedisArgument[];
|
|
14
|
+
readonly transformReply: () => SimpleStringReply<'OK'>;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _1 = require(".");
|
|
4
|
+
exports.default = {
|
|
5
|
+
FIRST_KEY_INDEX: 1,
|
|
6
|
+
IS_READ_ONLY: false,
|
|
7
|
+
transformArguments(key, options) {
|
|
8
|
+
const args = ['TS.CREATE', key];
|
|
9
|
+
(0, _1.pushRetentionArgument)(args, options?.RETENTION);
|
|
10
|
+
(0, _1.pushEncodingArgument)(args, options?.ENCODING);
|
|
11
|
+
(0, _1.pushChunkSizeArgument)(args, options?.CHUNK_SIZE);
|
|
12
|
+
(0, _1.pushDuplicatePolicy)(args, options?.DUPLICATE_POLICY);
|
|
13
|
+
(0, _1.pushLabelsArgument)(args, options?.LABELS);
|
|
14
|
+
return args;
|
|
15
|
+
},
|
|
16
|
+
transformReply: undefined
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RedisArgument, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export declare const TIME_SERIES_AGGREGATION_TYPE: {
|
|
3
|
+
readonly AVG: "AVG";
|
|
4
|
+
readonly FIRST: "FIRST";
|
|
5
|
+
readonly LAST: "LAST";
|
|
6
|
+
readonly MIN: "MIN";
|
|
7
|
+
readonly MAX: "MAX";
|
|
8
|
+
readonly SUM: "SUM";
|
|
9
|
+
readonly RANGE: "RANGE";
|
|
10
|
+
readonly COUNT: "COUNT";
|
|
11
|
+
readonly STD_P: "STD.P";
|
|
12
|
+
readonly STD_S: "STD.S";
|
|
13
|
+
readonly VAR_P: "VAR.P";
|
|
14
|
+
readonly VAR_S: "VAR.S";
|
|
15
|
+
readonly TWA: "TWA";
|
|
16
|
+
};
|
|
17
|
+
export type TimeSeriesAggregationType = typeof TIME_SERIES_AGGREGATION_TYPE[keyof typeof TIME_SERIES_AGGREGATION_TYPE];
|
|
18
|
+
declare const _default: {
|
|
19
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
20
|
+
readonly IS_READ_ONLY: false;
|
|
21
|
+
readonly transformArguments: (this: void, sourceKey: RedisArgument, destinationKey: RedisArgument, aggregationType: TimeSeriesAggregationType, bucketDuration: number, alignTimestamp?: number) => (string | Buffer)[];
|
|
22
|
+
readonly transformReply: () => SimpleStringReply<'OK'>;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TIME_SERIES_AGGREGATION_TYPE = void 0;
|
|
4
|
+
exports.TIME_SERIES_AGGREGATION_TYPE = {
|
|
5
|
+
AVG: 'AVG',
|
|
6
|
+
FIRST: 'FIRST',
|
|
7
|
+
LAST: 'LAST',
|
|
8
|
+
MIN: 'MIN',
|
|
9
|
+
MAX: 'MAX',
|
|
10
|
+
SUM: 'SUM',
|
|
11
|
+
RANGE: 'RANGE',
|
|
12
|
+
COUNT: 'COUNT',
|
|
13
|
+
STD_P: 'STD.P',
|
|
14
|
+
STD_S: 'STD.S',
|
|
15
|
+
VAR_P: 'VAR.P',
|
|
16
|
+
VAR_S: 'VAR.S',
|
|
17
|
+
TWA: 'TWA'
|
|
18
|
+
};
|
|
19
|
+
exports.default = {
|
|
20
|
+
FIRST_KEY_INDEX: 1,
|
|
21
|
+
IS_READ_ONLY: false,
|
|
22
|
+
transformArguments(sourceKey, destinationKey, aggregationType, bucketDuration, alignTimestamp) {
|
|
23
|
+
const args = [
|
|
24
|
+
'TS.CREATERULE',
|
|
25
|
+
sourceKey,
|
|
26
|
+
destinationKey,
|
|
27
|
+
'AGGREGATION',
|
|
28
|
+
aggregationType,
|
|
29
|
+
bucketDuration.toString()
|
|
30
|
+
];
|
|
31
|
+
if (alignTimestamp !== undefined) {
|
|
32
|
+
args.push(alignTimestamp.toString());
|
|
33
|
+
}
|
|
34
|
+
return args;
|
|
35
|
+
},
|
|
36
|
+
transformReply: undefined
|
|
37
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
3
|
+
readonly IS_READ_ONLY: false;
|
|
4
|
+
readonly transformArguments: (key: import("@redis/client/dist/lib/RESP/types").RedisArgument, value: number, options?: import("./INCRBY").TsIncrByOptions | undefined) => import("@redis/client/dist/lib/RESP/types").RedisArgument[];
|
|
5
|
+
readonly transformReply: () => import("@redis/client/dist/lib/RESP/types").NumberReply<number>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const INCRBY_1 = __importStar(require("./INCRBY"));
|
|
27
|
+
exports.default = {
|
|
28
|
+
FIRST_KEY_INDEX: INCRBY_1.default.FIRST_KEY_INDEX,
|
|
29
|
+
IS_READ_ONLY: INCRBY_1.default.IS_READ_ONLY,
|
|
30
|
+
transformArguments: INCRBY_1.transformIncrByArguments.bind(undefined, 'TS.DECRBY'),
|
|
31
|
+
transformReply: INCRBY_1.default.transformReply
|
|
32
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Timestamp } from '.';
|
|
2
|
+
import { RedisArgument, NumberReply } from '@redis/client/dist/lib/RESP/types';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
5
|
+
readonly IS_READ_ONLY: false;
|
|
6
|
+
readonly transformArguments: (this: void, key: RedisArgument, fromTimestamp: Timestamp, toTimestamp: Timestamp) => RedisArgument[];
|
|
7
|
+
readonly transformReply: () => NumberReply;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _1 = require(".");
|
|
4
|
+
exports.default = {
|
|
5
|
+
FIRST_KEY_INDEX: 1,
|
|
6
|
+
IS_READ_ONLY: false,
|
|
7
|
+
transformArguments(key, fromTimestamp, toTimestamp) {
|
|
8
|
+
return [
|
|
9
|
+
'TS.DEL',
|
|
10
|
+
key,
|
|
11
|
+
(0, _1.transformTimestampArgument)(fromTimestamp),
|
|
12
|
+
(0, _1.transformTimestampArgument)(toTimestamp)
|
|
13
|
+
];
|
|
14
|
+
},
|
|
15
|
+
transformReply: undefined
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RedisArgument, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
4
|
+
readonly IS_READ_ONLY: false;
|
|
5
|
+
readonly transformArguments: (this: void, sourceKey: RedisArgument, destinationKey: RedisArgument) => RedisArgument[];
|
|
6
|
+
readonly transformReply: () => SimpleStringReply<'OK'>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
FIRST_KEY_INDEX: 1,
|
|
5
|
+
IS_READ_ONLY: false,
|
|
6
|
+
transformArguments(sourceKey, destinationKey) {
|
|
7
|
+
return [
|
|
8
|
+
'TS.DELETERULE',
|
|
9
|
+
sourceKey,
|
|
10
|
+
destinationKey
|
|
11
|
+
];
|
|
12
|
+
},
|
|
13
|
+
transformReply: undefined
|
|
14
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RedisArgument, TuplesReply, NumberReply, DoubleReply, UnwrapReply, Resp2Reply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface TsGetOptions {
|
|
3
|
+
LATEST?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export type TsGetReply = TuplesReply<[]> | TuplesReply<[NumberReply, DoubleReply]>;
|
|
6
|
+
declare const _default: {
|
|
7
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
8
|
+
readonly IS_READ_ONLY: true;
|
|
9
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: TsGetOptions) => RedisArgument[];
|
|
10
|
+
readonly transformReply: {
|
|
11
|
+
readonly 2: (this: void, reply: UnwrapReply<Resp2Reply<TsGetReply>>) => {
|
|
12
|
+
timestamp: NumberReply<number>;
|
|
13
|
+
value: number;
|
|
14
|
+
} | null;
|
|
15
|
+
readonly 3: (this: void, reply: UnwrapReply<TsGetReply>) => {
|
|
16
|
+
timestamp: NumberReply<number>;
|
|
17
|
+
value: DoubleReply<number>;
|
|
18
|
+
} | null;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
FIRST_KEY_INDEX: 1,
|
|
5
|
+
IS_READ_ONLY: true,
|
|
6
|
+
transformArguments(key, options) {
|
|
7
|
+
const args = ['TS.GET', key];
|
|
8
|
+
if (options?.LATEST) {
|
|
9
|
+
args.push('LATEST');
|
|
10
|
+
}
|
|
11
|
+
return args;
|
|
12
|
+
},
|
|
13
|
+
transformReply: {
|
|
14
|
+
2(reply) {
|
|
15
|
+
return reply.length === 0 ? null : {
|
|
16
|
+
timestamp: reply[0],
|
|
17
|
+
value: Number(reply[1])
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
3(reply) {
|
|
21
|
+
return reply.length === 0 ? null : {
|
|
22
|
+
timestamp: reply[0],
|
|
23
|
+
value: reply[1]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { Timestamp, Labels } from '.';
|
|
3
|
+
export interface TsIncrByOptions {
|
|
4
|
+
TIMESTAMP?: Timestamp;
|
|
5
|
+
RETENTION?: number;
|
|
6
|
+
UNCOMPRESSED?: boolean;
|
|
7
|
+
CHUNK_SIZE?: number;
|
|
8
|
+
LABELS?: Labels;
|
|
9
|
+
}
|
|
10
|
+
export declare function transformIncrByArguments(command: RedisArgument, key: RedisArgument, value: number, options?: TsIncrByOptions): RedisArgument[];
|
|
11
|
+
declare const _default: {
|
|
12
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
13
|
+
readonly IS_READ_ONLY: false;
|
|
14
|
+
readonly transformArguments: (key: RedisArgument, value: number, options?: TsIncrByOptions | undefined) => RedisArgument[];
|
|
15
|
+
readonly transformReply: () => NumberReply;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformIncrByArguments = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
function transformIncrByArguments(command, key, value, options) {
|
|
6
|
+
const args = [
|
|
7
|
+
command,
|
|
8
|
+
key,
|
|
9
|
+
value.toString()
|
|
10
|
+
];
|
|
11
|
+
if (options?.TIMESTAMP !== undefined && options?.TIMESTAMP !== null) {
|
|
12
|
+
args.push('TIMESTAMP', (0, _1.transformTimestampArgument)(options.TIMESTAMP));
|
|
13
|
+
}
|
|
14
|
+
(0, _1.pushRetentionArgument)(args, options?.RETENTION);
|
|
15
|
+
if (options?.UNCOMPRESSED) {
|
|
16
|
+
args.push('UNCOMPRESSED');
|
|
17
|
+
}
|
|
18
|
+
(0, _1.pushChunkSizeArgument)(args, options?.CHUNK_SIZE);
|
|
19
|
+
(0, _1.pushLabelsArgument)(args, options?.LABELS);
|
|
20
|
+
return args;
|
|
21
|
+
}
|
|
22
|
+
exports.transformIncrByArguments = transformIncrByArguments;
|
|
23
|
+
exports.default = {
|
|
24
|
+
FIRST_KEY_INDEX: 1,
|
|
25
|
+
IS_READ_ONLY: false,
|
|
26
|
+
transformArguments: transformIncrByArguments.bind(undefined, 'TS.INCRBY'),
|
|
27
|
+
transformReply: undefined
|
|
28
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { TimeSeriesAggregationType, TimeSeriesDuplicatePolicies } from '.';
|
|
3
|
+
// export const FIRST_KEY_INDEX = 1;
|
|
4
|
+
// export const IS_READ_ONLY = true;
|
|
5
|
+
// export function transformArguments(key: string): Array<string> {
|
|
6
|
+
// return ['TS.INFO', key];
|
|
7
|
+
// }
|
|
8
|
+
// export type InfoRawReply = [
|
|
9
|
+
// 'totalSamples',
|
|
10
|
+
// number,
|
|
11
|
+
// 'memoryUsage',
|
|
12
|
+
// number,
|
|
13
|
+
// 'firstTimestamp',
|
|
14
|
+
// number,
|
|
15
|
+
// 'lastTimestamp',
|
|
16
|
+
// number,
|
|
17
|
+
// 'retentionTime',
|
|
18
|
+
// number,
|
|
19
|
+
// 'chunkCount',
|
|
20
|
+
// number,
|
|
21
|
+
// 'chunkSize',
|
|
22
|
+
// number,
|
|
23
|
+
// 'chunkType',
|
|
24
|
+
// string,
|
|
25
|
+
// 'duplicatePolicy',
|
|
26
|
+
// TimeSeriesDuplicatePolicies | null,
|
|
27
|
+
// 'labels',
|
|
28
|
+
// Array<[name: string, value: string]>,
|
|
29
|
+
// 'sourceKey',
|
|
30
|
+
// string | null,
|
|
31
|
+
// 'rules',
|
|
32
|
+
// Array<[key: string, timeBucket: number, aggregationType: TimeSeriesAggregationType]>
|
|
33
|
+
// ];
|
|
34
|
+
// export interface InfoReply {
|
|
35
|
+
// totalSamples: number;
|
|
36
|
+
// memoryUsage: number;
|
|
37
|
+
// firstTimestamp: number;
|
|
38
|
+
// lastTimestamp: number;
|
|
39
|
+
// retentionTime: number;
|
|
40
|
+
// chunkCount: number;
|
|
41
|
+
// chunkSize: number;
|
|
42
|
+
// chunkType: string;
|
|
43
|
+
// duplicatePolicy: TimeSeriesDuplicatePolicies | null;
|
|
44
|
+
// labels: Array<{
|
|
45
|
+
// name: string;
|
|
46
|
+
// value: string;
|
|
47
|
+
// }>;
|
|
48
|
+
// sourceKey: string | null;
|
|
49
|
+
// rules: Array<{
|
|
50
|
+
// key: string;
|
|
51
|
+
// timeBucket: number;
|
|
52
|
+
// aggregationType: TimeSeriesAggregationType
|
|
53
|
+
// }>;
|
|
54
|
+
// }
|
|
55
|
+
// export function transformReply(reply: InfoRawReply): InfoReply {
|
|
56
|
+
// return {
|
|
57
|
+
// totalSamples: reply[1],
|
|
58
|
+
// memoryUsage: reply[3],
|
|
59
|
+
// firstTimestamp: reply[5],
|
|
60
|
+
// lastTimestamp: reply[7],
|
|
61
|
+
// retentionTime: reply[9],
|
|
62
|
+
// chunkCount: reply[11],
|
|
63
|
+
// chunkSize: reply[13],
|
|
64
|
+
// chunkType: reply[15],
|
|
65
|
+
// duplicatePolicy: reply[17],
|
|
66
|
+
// labels: reply[19].map(([name, value]) => ({
|
|
67
|
+
// name,
|
|
68
|
+
// value
|
|
69
|
+
// })),
|
|
70
|
+
// sourceKey: reply[21],
|
|
71
|
+
// rules: reply[23].map(([key, timeBucket, aggregationType]) => ({
|
|
72
|
+
// key,
|
|
73
|
+
// timeBucket,
|
|
74
|
+
// aggregationType
|
|
75
|
+
// }))
|
|
76
|
+
// };
|
|
77
|
+
// }
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import {
|
|
3
|
+
// transformArguments as transformInfoArguments,
|
|
4
|
+
// InfoRawReply,
|
|
5
|
+
// InfoReply,
|
|
6
|
+
// transformReply as transformInfoReply
|
|
7
|
+
// } from './INFO';
|
|
8
|
+
// export { IS_READ_ONLY, FIRST_KEY_INDEX } from './INFO';
|
|
9
|
+
// export function transformArguments(key: string): Array<string> {
|
|
10
|
+
// const args = transformInfoArguments(key);
|
|
11
|
+
// args.push('DEBUG');
|
|
12
|
+
// return args;
|
|
13
|
+
// }
|
|
14
|
+
// type InfoDebugRawReply = [
|
|
15
|
+
// ...InfoRawReply,
|
|
16
|
+
// 'keySelfName',
|
|
17
|
+
// string,
|
|
18
|
+
// 'chunks',
|
|
19
|
+
// Array<[
|
|
20
|
+
// 'startTimestamp',
|
|
21
|
+
// number,
|
|
22
|
+
// 'endTimestamp',
|
|
23
|
+
// number,
|
|
24
|
+
// 'samples',
|
|
25
|
+
// number,
|
|
26
|
+
// 'size',
|
|
27
|
+
// number,
|
|
28
|
+
// 'bytesPerSample',
|
|
29
|
+
// string
|
|
30
|
+
// ]>
|
|
31
|
+
// ];
|
|
32
|
+
// interface InfoDebugReply extends InfoReply {
|
|
33
|
+
// keySelfName: string;
|
|
34
|
+
// chunks: Array<{
|
|
35
|
+
// startTimestamp: number;
|
|
36
|
+
// endTimestamp: number;
|
|
37
|
+
// samples: number;
|
|
38
|
+
// size: number;
|
|
39
|
+
// bytesPerSample: string;
|
|
40
|
+
// }>;
|
|
41
|
+
// }
|
|
42
|
+
// export function transformReply(rawReply: InfoDebugRawReply): InfoDebugReply {
|
|
43
|
+
// const reply = transformInfoReply(rawReply as unknown as InfoRawReply);
|
|
44
|
+
// (reply as InfoDebugReply).keySelfName = rawReply[25];
|
|
45
|
+
// (reply as InfoDebugReply).chunks = rawReply[27].map(chunk => ({
|
|
46
|
+
// startTimestamp: chunk[1],
|
|
47
|
+
// endTimestamp: chunk[3],
|
|
48
|
+
// samples: chunk[5],
|
|
49
|
+
// size: chunk[7],
|
|
50
|
+
// bytesPerSample: chunk[9]
|
|
51
|
+
// }));
|
|
52
|
+
// return reply as InfoDebugReply;
|
|
53
|
+
// }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Timestamp } from '.';
|
|
2
|
+
import { ArrayReply, NumberReply, SimpleErrorReply } from '@redis/client/dist/lib/RESP/types';
|
|
3
|
+
export interface TsMAddSample {
|
|
4
|
+
key: string;
|
|
5
|
+
timestamp: Timestamp;
|
|
6
|
+
value: number;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: {
|
|
9
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
10
|
+
readonly IS_READ_ONLY: false;
|
|
11
|
+
readonly transformArguments: (this: void, toAdd: Array<TsMAddSample>) => string[];
|
|
12
|
+
readonly transformReply: () => ArrayReply<NumberReply | SimpleErrorReply>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _1 = require(".");
|
|
4
|
+
exports.default = {
|
|
5
|
+
FIRST_KEY_INDEX: 1,
|
|
6
|
+
IS_READ_ONLY: false,
|
|
7
|
+
transformArguments(toAdd) {
|
|
8
|
+
const args = ['TS.MADD'];
|
|
9
|
+
for (const { key, timestamp, value } of toAdd) {
|
|
10
|
+
args.push(key, (0, _1.transformTimestampArgument)(timestamp), value.toString());
|
|
11
|
+
}
|
|
12
|
+
return args;
|
|
13
|
+
},
|
|
14
|
+
transformReply: undefined
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommandArguments } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
|
3
|
+
export interface TsMGetOptions {
|
|
4
|
+
LATEST?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function pushLatestArgument(args: CommandArguments, latest?: boolean): CommandArguments;
|
|
7
|
+
export declare function pushFilterArgument(args: CommandArguments, filter: RedisVariadicArgument): CommandArguments;
|
|
8
|
+
declare const _default: {
|
|
9
|
+
readonly FIRST_KEY_INDEX: undefined;
|
|
10
|
+
readonly IS_READ_ONLY: true;
|
|
11
|
+
readonly transformArguments: (this: void, filter: RedisVariadicArgument, options?: TsMGetOptions) => CommandArguments;
|
|
12
|
+
readonly transformReply: () => any;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pushFilterArgument = exports.pushLatestArgument = void 0;
|
|
4
|
+
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
|
|
5
|
+
function pushLatestArgument(args, latest) {
|
|
6
|
+
if (latest) {
|
|
7
|
+
args.push('LATEST');
|
|
8
|
+
}
|
|
9
|
+
return args;
|
|
10
|
+
}
|
|
11
|
+
exports.pushLatestArgument = pushLatestArgument;
|
|
12
|
+
function pushFilterArgument(args, filter) {
|
|
13
|
+
args.push('FILTER');
|
|
14
|
+
return (0, generic_transformers_1.pushVariadicArguments)(args, filter);
|
|
15
|
+
}
|
|
16
|
+
exports.pushFilterArgument = pushFilterArgument;
|
|
17
|
+
exports.default = {
|
|
18
|
+
FIRST_KEY_INDEX: undefined,
|
|
19
|
+
IS_READ_ONLY: true,
|
|
20
|
+
transformArguments(filter, options) {
|
|
21
|
+
const args = pushLatestArgument(['TS.MGET'], options?.LATEST);
|
|
22
|
+
return pushFilterArgument(args, filter);
|
|
23
|
+
},
|
|
24
|
+
// TODO
|
|
25
|
+
// transformSampleReply
|
|
26
|
+
transformReply: undefined
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
|
2
|
+
import { TsMGetOptions } from './MGET';
|
|
3
|
+
export interface TsMGetWithLabelsOptions extends TsMGetOptions {
|
|
4
|
+
SELECTED_LABELS?: RedisVariadicArgument;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: {
|
|
7
|
+
readonly FIRST_KEY_INDEX: undefined;
|
|
8
|
+
readonly IS_READ_ONLY: true;
|
|
9
|
+
readonly transformArguments: (this: void, filter: RedisVariadicArgument, options?: TsMGetWithLabelsOptions) => import("@redis/client/dist/lib/RESP/types").CommandArguments;
|
|
10
|
+
readonly transformReply: () => any;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const MGET_1 = require("./MGET");
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
exports.default = {
|
|
6
|
+
FIRST_KEY_INDEX: undefined,
|
|
7
|
+
IS_READ_ONLY: true,
|
|
8
|
+
transformArguments(filter, options) {
|
|
9
|
+
let args = (0, MGET_1.pushLatestArgument)(['TS.MGET'], options?.LATEST);
|
|
10
|
+
args = (0, _1.pushWithLabelsArgument)(args, options?.SELECTED_LABELS);
|
|
11
|
+
return (0, MGET_1.pushFilterArgument)(args, filter);
|
|
12
|
+
},
|
|
13
|
+
// TODO
|
|
14
|
+
transformReply: undefined
|
|
15
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RedisArgument, CommandArguments } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
|
3
|
+
import { Timestamp } from '.';
|
|
4
|
+
import { TsRangeOptions } from './RANGE';
|
|
5
|
+
export declare const TIME_SERIES_REDUCERS: {
|
|
6
|
+
AVG: string;
|
|
7
|
+
SUM: string;
|
|
8
|
+
MIN: string;
|
|
9
|
+
MAX: string;
|
|
10
|
+
RANGE: string;
|
|
11
|
+
COUNT: string;
|
|
12
|
+
STD_P: string;
|
|
13
|
+
STD_S: string;
|
|
14
|
+
VAR_P: string;
|
|
15
|
+
VAR_S: string;
|
|
16
|
+
};
|
|
17
|
+
export type TimeSeriesReducers = typeof TIME_SERIES_REDUCERS[keyof typeof TIME_SERIES_REDUCERS];
|
|
18
|
+
export interface TsMRangeOptions extends TsRangeOptions {
|
|
19
|
+
GROUPBY?: {
|
|
20
|
+
label: RedisArgument;
|
|
21
|
+
reducer: TimeSeriesReducers;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare function pushGroupByArgument(args: CommandArguments, groupBy?: TsMRangeOptions['GROUPBY']): CommandArguments;
|
|
25
|
+
export declare function transformMRangeArguments(command: RedisArgument, fromTimestamp: Timestamp, toTimestamp: Timestamp, filter: RedisVariadicArgument, options?: TsMRangeOptions): CommandArguments;
|
|
26
|
+
declare const _default: {
|
|
27
|
+
readonly FIRST_KEY_INDEX: undefined;
|
|
28
|
+
readonly IS_READ_ONLY: true;
|
|
29
|
+
readonly transformArguments: (fromTimestamp: Timestamp, toTimestamp: Timestamp, filter: RedisVariadicArgument, options?: TsMRangeOptions | undefined) => CommandArguments;
|
|
30
|
+
readonly transformReply: () => any;
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|