@redis/time-series 1.0.4 → 1.0.5

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.
@@ -2,7 +2,7 @@ import { TimeSeriesAggregationType, TimeSeriesDuplicatePolicies } from '.';
2
2
  export declare const FIRST_KEY_INDEX = 1;
3
3
  export declare const IS_READ_ONLY = true;
4
4
  export declare function transformArguments(key: string): Array<string>;
5
- export declare type InfoRawReply = [
5
+ export type InfoRawReply = [
6
6
  'totalSamples',
7
7
  number,
8
8
  'memoryUsage',
@@ -1,7 +1,7 @@
1
1
  import { InfoRawReply, InfoReply } from './INFO';
2
2
  export { IS_READ_ONLY, FIRST_KEY_INDEX } from './INFO';
3
3
  export declare function transformArguments(key: string): Array<string>;
4
- declare type InfoDebugRawReply = [
4
+ type InfoDebugRawReply = [
5
5
  ...InfoRawReply,
6
6
  'keySelfName',
7
7
  string,
@@ -5,7 +5,7 @@ export interface MGetOptions {
5
5
  LATEST?: boolean;
6
6
  }
7
7
  export declare function transformArguments(filter: Filter, options?: MGetOptions): RedisCommandArguments;
8
- export declare type MGetRawReply = Array<[
8
+ export type MGetRawReply = Array<[
9
9
  key: string,
10
10
  labels: RawLabels,
11
11
  sample: SampleRawReply
@@ -105,7 +105,7 @@ export declare enum TimeSeriesReducers {
105
105
  VAR_P = "VAR.P",
106
106
  VAR_S = "VAR.S"
107
107
  }
108
- export declare type Timestamp = number | Date | string;
108
+ export type Timestamp = number | Date | string;
109
109
  export declare function transformTimestampArgument(timestamp: Timestamp): string;
110
110
  export declare function pushRetentionArgument(args: RedisCommandArguments, retention?: number): RedisCommandArguments;
111
111
  export declare enum TimeSeriesEncoding {
@@ -115,8 +115,8 @@ export declare enum TimeSeriesEncoding {
115
115
  export declare function pushEncodingArgument(args: RedisCommandArguments, encoding?: TimeSeriesEncoding): RedisCommandArguments;
116
116
  export declare function pushChunkSizeArgument(args: RedisCommandArguments, chunkSize?: number): RedisCommandArguments;
117
117
  export declare function pushDuplicatePolicy(args: RedisCommandArguments, duplicatePolicy?: TimeSeriesDuplicatePolicies): RedisCommandArguments;
118
- export declare type RawLabels = Array<[label: string, value: string]>;
119
- export declare type Labels = {
118
+ export type RawLabels = Array<[label: string, value: string]>;
119
+ export type Labels = {
120
120
  [label: string]: string;
121
121
  };
122
122
  export declare function transformLablesReply(reply: RawLabels): Labels;
@@ -129,7 +129,7 @@ export interface IncrDecrOptions {
129
129
  LABELS?: Labels;
130
130
  }
131
131
  export declare function transformIncrDecrArguments(command: 'TS.INCRBY' | 'TS.DECRBY', key: string, value: number, options?: IncrDecrOptions): RedisCommandArguments;
132
- export declare type SampleRawReply = [timestamp: number, value: string];
132
+ export type SampleRawReply = [timestamp: number, value: string];
133
133
  export interface SampleReply {
134
134
  timestamp: number;
135
135
  value: number;
@@ -162,20 +162,20 @@ interface MRangeGroupBy {
162
162
  reducer: TimeSeriesReducers;
163
163
  }
164
164
  export declare function pushMRangeGroupByArguments(args: RedisCommandArguments, groupBy?: MRangeGroupBy): RedisCommandArguments;
165
- export declare type Filter = string | Array<string>;
165
+ export type Filter = string | Array<string>;
166
166
  export declare function pushFilterArgument(args: RedisCommandArguments, filter: string | Array<string>): RedisCommandArguments;
167
167
  export interface MRangeOptions extends RangeOptions {
168
168
  GROUPBY?: MRangeGroupBy;
169
169
  }
170
170
  export declare function pushMRangeArguments(args: RedisCommandArguments, fromTimestamp: Timestamp, toTimestamp: Timestamp, filter: Filter, options?: MRangeOptions): RedisCommandArguments;
171
- export declare type SelectedLabels = string | Array<string>;
171
+ export type SelectedLabels = string | Array<string>;
172
172
  export declare function pushWithLabelsArgument(args: RedisCommandArguments, selectedLabels?: SelectedLabels): RedisCommandArguments;
173
173
  export interface MRangeWithLabelsOptions extends MRangeOptions {
174
174
  SELECTED_LABELS?: SelectedLabels;
175
175
  }
176
176
  export declare function pushMRangeWithLabelsArguments(args: RedisCommandArguments, fromTimestamp: Timestamp, toTimestamp: Timestamp, filter: Filter, options?: MRangeWithLabelsOptions): RedisCommandArguments;
177
177
  export declare function transformRangeReply(reply: Array<SampleRawReply>): Array<SampleReply>;
178
- declare type MRangeRawReply = Array<[
178
+ type MRangeRawReply = Array<[
179
179
  key: string,
180
180
  labels: RawLabels,
181
181
  samples: Array<SampleRawReply>
@@ -88,7 +88,7 @@ var TimeSeriesAggregationType;
88
88
  TimeSeriesAggregationType["VAR_P"] = "VAR.P";
89
89
  TimeSeriesAggregationType["VAR_S"] = "VAR.S";
90
90
  TimeSeriesAggregationType["TWA"] = "TWA";
91
- })(TimeSeriesAggregationType = exports.TimeSeriesAggregationType || (exports.TimeSeriesAggregationType = {}));
91
+ })(TimeSeriesAggregationType || (exports.TimeSeriesAggregationType = TimeSeriesAggregationType = {}));
92
92
  var TimeSeriesDuplicatePolicies;
93
93
  (function (TimeSeriesDuplicatePolicies) {
94
94
  TimeSeriesDuplicatePolicies["BLOCK"] = "BLOCK";
@@ -97,7 +97,7 @@ var TimeSeriesDuplicatePolicies;
97
97
  TimeSeriesDuplicatePolicies["MIN"] = "MIN";
98
98
  TimeSeriesDuplicatePolicies["MAX"] = "MAX";
99
99
  TimeSeriesDuplicatePolicies["SUM"] = "SUM";
100
- })(TimeSeriesDuplicatePolicies = exports.TimeSeriesDuplicatePolicies || (exports.TimeSeriesDuplicatePolicies = {}));
100
+ })(TimeSeriesDuplicatePolicies || (exports.TimeSeriesDuplicatePolicies = TimeSeriesDuplicatePolicies = {}));
101
101
  var TimeSeriesReducers;
102
102
  (function (TimeSeriesReducers) {
103
103
  TimeSeriesReducers["AVG"] = "AVG";
@@ -114,7 +114,7 @@ var TimeSeriesReducers;
114
114
  TimeSeriesReducers["STD_S"] = "STD.S";
115
115
  TimeSeriesReducers["VAR_P"] = "VAR.P";
116
116
  TimeSeriesReducers["VAR_S"] = "VAR.S";
117
- })(TimeSeriesReducers = exports.TimeSeriesReducers || (exports.TimeSeriesReducers = {}));
117
+ })(TimeSeriesReducers || (exports.TimeSeriesReducers = TimeSeriesReducers = {}));
118
118
  function transformTimestampArgument(timestamp) {
119
119
  if (typeof timestamp === 'string')
120
120
  return timestamp;
@@ -124,7 +124,7 @@ function transformTimestampArgument(timestamp) {
124
124
  }
125
125
  exports.transformTimestampArgument = transformTimestampArgument;
126
126
  function pushRetentionArgument(args, retention) {
127
- if (retention) {
127
+ if (retention !== undefined) {
128
128
  args.push('RETENTION', retention.toString());
129
129
  }
130
130
  return args;
@@ -134,23 +134,23 @@ var TimeSeriesEncoding;
134
134
  (function (TimeSeriesEncoding) {
135
135
  TimeSeriesEncoding["COMPRESSED"] = "COMPRESSED";
136
136
  TimeSeriesEncoding["UNCOMPRESSED"] = "UNCOMPRESSED";
137
- })(TimeSeriesEncoding = exports.TimeSeriesEncoding || (exports.TimeSeriesEncoding = {}));
137
+ })(TimeSeriesEncoding || (exports.TimeSeriesEncoding = TimeSeriesEncoding = {}));
138
138
  function pushEncodingArgument(args, encoding) {
139
- if (encoding) {
139
+ if (encoding !== undefined) {
140
140
  args.push('ENCODING', encoding);
141
141
  }
142
142
  return args;
143
143
  }
144
144
  exports.pushEncodingArgument = pushEncodingArgument;
145
145
  function pushChunkSizeArgument(args, chunkSize) {
146
- if (chunkSize) {
146
+ if (chunkSize !== undefined) {
147
147
  args.push('CHUNK_SIZE', chunkSize.toString());
148
148
  }
149
149
  return args;
150
150
  }
151
151
  exports.pushChunkSizeArgument = pushChunkSizeArgument;
152
152
  function pushDuplicatePolicy(args, duplicatePolicy) {
153
- if (duplicatePolicy) {
153
+ if (duplicatePolicy !== undefined) {
154
154
  args.push('DUPLICATE_POLICY', duplicatePolicy);
155
155
  }
156
156
  return args;
@@ -204,7 +204,7 @@ var TimeSeriesBucketTimestamp;
204
204
  TimeSeriesBucketTimestamp["LOW"] = "-";
205
205
  TimeSeriesBucketTimestamp["HIGH"] = "+";
206
206
  TimeSeriesBucketTimestamp["MID"] = "~";
207
- })(TimeSeriesBucketTimestamp = exports.TimeSeriesBucketTimestamp || (exports.TimeSeriesBucketTimestamp = {}));
207
+ })(TimeSeriesBucketTimestamp || (exports.TimeSeriesBucketTimestamp = TimeSeriesBucketTimestamp = {}));
208
208
  function pushRangeArguments(args, fromTimestamp, toTimestamp, options) {
209
209
  args.push(transformTimestampArgument(fromTimestamp), transformTimestampArgument(toTimestamp));
210
210
  pushLatestArgument(args, options?.LATEST);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redis/time-series",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,12 +18,24 @@
18
18
  "devDependencies": {
19
19
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
20
20
  "@redis/test-utils": "*",
21
- "@types/node": "^18.11.6",
21
+ "@types/node": "^20.5.3",
22
22
  "nyc": "^15.1.0",
23
- "release-it": "^15.5.0",
23
+ "release-it": "^16.1.5",
24
24
  "source-map-support": "^0.5.21",
25
25
  "ts-node": "^10.9.1",
26
- "typedoc": "^0.23.18",
27
- "typescript": "^4.8.4"
28
- }
26
+ "typedoc": "^0.24.8",
27
+ "typescript": "^5.1.6"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git://github.com/redis/node-redis.git"
32
+ },
33
+ "bugs": {
34
+ "url": "https://github.com/redis/node-redis/issues"
35
+ },
36
+ "homepage": "https://github.com/redis/node-redis/tree/master/packages/time-series",
37
+ "keywords": [
38
+ "redis",
39
+ "RedisTimeSeries"
40
+ ]
29
41
  }