@redis/time-series 1.0.5 → 1.1.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.
@@ -1,10 +1,15 @@
1
1
  import { TimeSeriesEncoding, TimeSeriesDuplicatePolicies, Labels, Timestamp } from '.';
2
+ export interface TsIgnoreOptions {
3
+ MAX_TIME_DIFF: number;
4
+ MAX_VAL_DIFF: number;
5
+ }
2
6
  interface AddOptions {
3
7
  RETENTION?: number;
4
8
  ENCODING?: TimeSeriesEncoding;
5
9
  CHUNK_SIZE?: number;
6
10
  ON_DUPLICATE?: TimeSeriesDuplicatePolicies;
7
11
  LABELS?: Labels;
12
+ IGNORE?: TsIgnoreOptions;
8
13
  }
9
14
  export declare const FIRST_KEY_INDEX = 1;
10
15
  export declare function transformArguments(key: string, timestamp: Timestamp, value: number, options?: AddOptions): Array<string>;
@@ -17,6 +17,7 @@ function transformArguments(key, timestamp, value, options) {
17
17
  args.push('ON_DUPLICATE', options.ON_DUPLICATE);
18
18
  }
19
19
  (0, _1.pushLabelsArgument)(args, options?.LABELS);
20
+ (0, _1.pushIgnoreArgument)(args, options?.IGNORE);
20
21
  return args;
21
22
  }
22
23
  exports.transformArguments = transformArguments;
@@ -1,10 +1,12 @@
1
1
  import { Labels, TimeSeriesDuplicatePolicies } from '.';
2
+ import { TsIgnoreOptions } from './ADD';
2
3
  export declare const FIRST_KEY_INDEX = 1;
3
4
  interface AlterOptions {
4
5
  RETENTION?: number;
5
6
  CHUNK_SIZE?: number;
6
7
  DUPLICATE_POLICY?: TimeSeriesDuplicatePolicies;
7
8
  LABELS?: Labels;
9
+ IGNORE?: TsIgnoreOptions;
8
10
  }
9
11
  export declare function transformArguments(key: string, options?: AlterOptions): Array<string>;
10
12
  export declare function transformReply(): 'OK';
@@ -9,6 +9,7 @@ function transformArguments(key, options) {
9
9
  (0, _1.pushChunkSizeArgument)(args, options?.CHUNK_SIZE);
10
10
  (0, _1.pushDuplicatePolicy)(args, options?.DUPLICATE_POLICY);
11
11
  (0, _1.pushLabelsArgument)(args, options?.LABELS);
12
+ (0, _1.pushIgnoreArgument)(args, options?.IGNORE);
12
13
  return args;
13
14
  }
14
15
  exports.transformArguments = transformArguments;
@@ -1,4 +1,5 @@
1
1
  import { TimeSeriesEncoding, TimeSeriesDuplicatePolicies, Labels } from '.';
2
+ import { TsIgnoreOptions } from './ADD';
2
3
  export declare const FIRST_KEY_INDEX = 1;
3
4
  interface CreateOptions {
4
5
  RETENTION?: number;
@@ -6,6 +7,7 @@ interface CreateOptions {
6
7
  CHUNK_SIZE?: number;
7
8
  DUPLICATE_POLICY?: TimeSeriesDuplicatePolicies;
8
9
  LABELS?: Labels;
10
+ IGNORE?: TsIgnoreOptions;
9
11
  }
10
12
  export declare function transformArguments(key: string, options?: CreateOptions): Array<string>;
11
13
  export declare function transformReply(): 'OK';
@@ -10,6 +10,7 @@ function transformArguments(key, options) {
10
10
  (0, _1.pushChunkSizeArgument)(args, options?.CHUNK_SIZE);
11
11
  (0, _1.pushDuplicatePolicy)(args, options?.DUPLICATE_POLICY);
12
12
  (0, _1.pushLabelsArgument)(args, options?.LABELS);
13
+ (0, _1.pushIgnoreArgument)(args, options?.IGNORE);
13
14
  return args;
14
15
  }
15
16
  exports.transformArguments = transformArguments;
@@ -107,6 +107,7 @@ export declare enum TimeSeriesReducers {
107
107
  }
108
108
  export type Timestamp = number | Date | string;
109
109
  export declare function transformTimestampArgument(timestamp: Timestamp): string;
110
+ export declare function pushIgnoreArgument(args: RedisCommandArguments, ignore?: ADD.TsIgnoreOptions): void;
110
111
  export declare function pushRetentionArgument(args: RedisCommandArguments, retention?: number): RedisCommandArguments;
111
112
  export declare enum TimeSeriesEncoding {
112
113
  COMPRESSED = "COMPRESSED",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pushLatestArgument = exports.transformMRangeWithLabelsReply = exports.transformMRangeReply = exports.transformRangeReply = exports.pushMRangeWithLabelsArguments = exports.pushWithLabelsArgument = exports.pushMRangeArguments = exports.pushFilterArgument = exports.pushMRangeGroupByArguments = exports.pushRangeArguments = exports.TimeSeriesBucketTimestamp = exports.transformSampleReply = exports.transformIncrDecrArguments = exports.pushLabelsArgument = exports.transformLablesReply = exports.pushDuplicatePolicy = exports.pushChunkSizeArgument = exports.pushEncodingArgument = exports.TimeSeriesEncoding = exports.pushRetentionArgument = exports.transformTimestampArgument = exports.TimeSeriesReducers = exports.TimeSeriesDuplicatePolicies = exports.TimeSeriesAggregationType = void 0;
3
+ exports.pushLatestArgument = exports.transformMRangeWithLabelsReply = exports.transformMRangeReply = exports.transformRangeReply = exports.pushMRangeWithLabelsArguments = exports.pushWithLabelsArgument = exports.pushMRangeArguments = exports.pushFilterArgument = exports.pushMRangeGroupByArguments = exports.pushRangeArguments = exports.TimeSeriesBucketTimestamp = exports.transformSampleReply = exports.transformIncrDecrArguments = exports.pushLabelsArgument = exports.transformLablesReply = exports.pushDuplicatePolicy = exports.pushChunkSizeArgument = exports.pushEncodingArgument = exports.TimeSeriesEncoding = exports.pushRetentionArgument = exports.pushIgnoreArgument = exports.transformTimestampArgument = exports.TimeSeriesReducers = exports.TimeSeriesDuplicatePolicies = exports.TimeSeriesAggregationType = void 0;
4
4
  const ADD = require("./ADD");
5
5
  const ALTER = require("./ALTER");
6
6
  const CREATE = require("./CREATE");
@@ -123,6 +123,12 @@ function transformTimestampArgument(timestamp) {
123
123
  timestamp.getTime()).toString();
124
124
  }
125
125
  exports.transformTimestampArgument = transformTimestampArgument;
126
+ function pushIgnoreArgument(args, ignore) {
127
+ if (ignore !== undefined) {
128
+ args.push('IGNORE', ignore.MAX_TIME_DIFF.toString(), ignore.MAX_VAL_DIFF.toString());
129
+ }
130
+ }
131
+ exports.pushIgnoreArgument = pushIgnoreArgument;
126
132
  function pushRetentionArgument(args, retention) {
127
133
  if (retention !== undefined) {
128
134
  args.push('RETENTION', retention.toString());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redis/time-series",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,13 +18,13 @@
18
18
  "devDependencies": {
19
19
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
20
20
  "@redis/test-utils": "*",
21
- "@types/node": "^20.5.3",
21
+ "@types/node": "^20.6.2",
22
22
  "nyc": "^15.1.0",
23
23
  "release-it": "^16.1.5",
24
24
  "source-map-support": "^0.5.21",
25
25
  "ts-node": "^10.9.1",
26
- "typedoc": "^0.24.8",
27
- "typescript": "^5.1.6"
26
+ "typedoc": "^0.25.1",
27
+ "typescript": "^5.2.2"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",