Skip to content

Commit df4a8bf

Browse files
authored
Merge da1ee8f into be51abe
2 parents be51abe + da1ee8f commit df4a8bf

File tree

9 files changed

+132
-0
lines changed

9 files changed

+132
-0
lines changed

packages/client/lib/cluster/commands.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ import * as MGET from '../commands/MGET';
7272
import * as MIGRATE from '../commands/MIGRATE';
7373
import * as MSET from '../commands/MSET';
7474
import * as MSETNX from '../commands/MSETNX';
75+
import * as OBJECT_ENCODING from '../commands/OBJECT_ENCODING';
76+
import * as OBJECT_FREQ from '../commands/OBJECT_FREQ';
77+
import * as OBJECT_IDLETIME from '../commands/OBJECT_IDLETIME';
78+
import * as OBJECT_REFCOUNT from '../commands/OBJECT_REFCOUNT';
7579
import * as PERSIST from '../commands/PERSIST';
7680
import * as PEXPIRE from '../commands/PEXPIRE';
7781
import * as PEXPIREAT from '../commands/PEXPIREAT';
@@ -324,6 +328,14 @@ export default {
324328
mSet: MSET,
325329
MSETNX,
326330
mSetNX: MSETNX,
331+
OBJECT_ENCODING,
332+
objectEncoding: OBJECT_ENCODING,
333+
OBJECT_FREQ,
334+
objectFreq: OBJECT_FREQ,
335+
OBJECT_IDLETIME,
336+
objectIdleTime: OBJECT_IDLETIME,
337+
OBJECT_REFCOUNT,
338+
objectRefCount: OBJECT_REFCOUNT,
327339
PERSIST,
328340
persist: PERSIST,
329341
PEXPIRE,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { strict as assert } from 'assert';
2+
import testUtils, { GLOBAL } from '../test-utils';
3+
import { transformArguments } from './OBJECT_ENCODING';
4+
5+
describe('OBJECT ENCODING', () => {
6+
it('transformArguments', () => {
7+
assert.deepEqual(
8+
transformArguments('key'),
9+
['OBJECT', 'ENCODING', 'key']
10+
);
11+
});
12+
13+
testUtils.testWithClient('client.objectEncoding', async client => {
14+
assert.equal(
15+
await client.objectEncoding('key'),
16+
null
17+
);
18+
}, GLOBAL.SERVERS.OPEN);
19+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { RedisCommandArgument, RedisCommandArguments } from '.';
2+
3+
export const FIRST_KEY_INDEX = 2;
4+
5+
export const IS_READ_ONLY = true;
6+
7+
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
8+
return ['OBJECT', 'ENCODING', key];
9+
}
10+
11+
export declare function transformReply(): string | null;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { strict as assert } from 'assert';
2+
import testUtils, { GLOBAL } from '../test-utils';
3+
import { transformArguments } from './OBJECT_FREQ';
4+
5+
describe('OBJECT FREQ', () => {
6+
it('transformArguments', () => {
7+
assert.deepEqual(
8+
transformArguments('key'),
9+
['OBJECT', 'FREQ', 'key']
10+
);
11+
});
12+
13+
testUtils.testWithClient('client.objectFreq', async client => {
14+
assert.equal(
15+
await client.objectFreq('key'),
16+
null
17+
);
18+
}, GLOBAL.SERVERS.OPEN);
19+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { RedisCommandArgument, RedisCommandArguments } from '.';
2+
3+
export const FIRST_KEY_INDEX = 2;
4+
5+
export const IS_READ_ONLY = true;
6+
7+
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
8+
return ['OBJECT', 'FREQ', key];
9+
}
10+
11+
export declare function transformReply(): number | null;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { strict as assert } from 'assert';
2+
import testUtils, { GLOBAL } from '../test-utils';
3+
import { transformArguments } from './OBJECT_IDLETIME';
4+
5+
describe('OBJECT IDLETIME', () => {
6+
it('transformArguments', () => {
7+
assert.deepEqual(
8+
transformArguments('key'),
9+
['OBJECT', 'IDLETIME', 'key']
10+
);
11+
});
12+
13+
testUtils.testWithClient('client.objectIdleTime', async client => {
14+
assert.equal(
15+
await client.objectIdleTime('key'),
16+
null
17+
);
18+
}, GLOBAL.SERVERS.OPEN);
19+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { RedisCommandArgument, RedisCommandArguments } from '.';
2+
3+
export const FIRST_KEY_INDEX = 2;
4+
5+
export const IS_READ_ONLY = true;
6+
7+
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
8+
return ['OBJECT', 'IDLETIME', key];
9+
}
10+
11+
export declare function transformReply(): number | null;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { strict as assert } from 'assert';
2+
import testUtils, { GLOBAL } from '../test-utils';
3+
import { transformArguments } from './OBJECT_REFCOUNT';
4+
5+
describe('OBJECT REFCOUNT', () => {
6+
it('transformArguments', () => {
7+
assert.deepEqual(
8+
transformArguments('key'),
9+
['OBJECT', 'REFCOUNT', 'key']
10+
);
11+
});
12+
13+
testUtils.testWithClient('client.objectRefCount', async client => {
14+
assert.equal(
15+
await client.objectRefCount('key'),
16+
null
17+
);
18+
}, GLOBAL.SERVERS.OPEN);
19+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { RedisCommandArgument, RedisCommandArguments } from '.';
2+
3+
export const FIRST_KEY_INDEX = 2;
4+
5+
export const IS_READ_ONLY = true;
6+
7+
export function transformArguments(key: RedisCommandArgument): RedisCommandArguments {
8+
return ['OBJECT', 'REFCOUNT', key];
9+
}
10+
11+
export declare function transformReply(): number | null;

0 commit comments

Comments
 (0)