Debian Codegraph @

packages/time-series/lib/commands/CREATE.ts

raw
1 import {
2 pushRetentionArgument,
3 TimeSeriesEncoding,
4 pushEncodingArgument,
5 pushChunkSizeArgument,
6 TimeSeriesDuplicatePolicies,
7 Labels,
8 pushLabelsArgument,
9 pushDuplicatePolicy
10 } from '.';
11
12 export const FIRST_KEY_INDEX = 1;
13
14 interface CreateOptions {
15 RETENTION?: number;
16 ENCODING?: TimeSeriesEncoding;
17 CHUNK_SIZE?: number;
18 DUPLICATE_POLICY?: TimeSeriesDuplicatePolicies;
19 LABELS?: Labels;
20 }
21
22 export function transformArguments(key: string, options?: CreateOptions): Array<string> {
23 const args = ['TS.CREATE', key];
24
25 pushRetentionArgument(args, options?.RETENTION);
26
27 pushEncodingArgument(args, options?.ENCODING);
28
29 pushChunkSizeArgument(args, options?.CHUNK_SIZE);
30
31 pushDuplicatePolicy(args, options?.DUPLICATE_POLICY);
32
33 pushLabelsArgument(args, options?.LABELS);
34
35 return args;
36 }
37
38 export declare function transformReply(): 'OK';