@redis/json 1.0.5 → 2.0.0-next.1
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/ARRAPPEND.d.ts +9 -0
- package/dist/lib/commands/ARRAPPEND.js +18 -0
- package/dist/lib/commands/ARRINDEX.d.ts +15 -0
- package/dist/lib/commands/ARRINDEX.js +16 -0
- package/dist/lib/commands/ARRINSERT.d.ts +9 -0
- package/dist/lib/commands/ARRINSERT.js +19 -0
- package/dist/lib/commands/ARRLEN.d.ts +11 -0
- package/dist/lib/commands/ARRLEN.js +12 -0
- package/dist/lib/commands/ARRPOP.d.ts +15 -0
- package/dist/lib/commands/ARRPOP.js +21 -0
- package/dist/lib/commands/ARRTRIM.d.ts +8 -0
- package/dist/lib/commands/ARRTRIM.js +8 -0
- package/dist/lib/commands/CLEAR.d.ts +11 -0
- package/dist/lib/commands/CLEAR.js +12 -0
- package/dist/lib/commands/DEBUG_MEMORY.d.ts +11 -0
- package/dist/lib/commands/DEBUG_MEMORY.js +12 -0
- package/dist/lib/commands/DEL.d.ts +11 -0
- package/dist/lib/commands/DEL.js +12 -0
- package/dist/lib/commands/FORGET.d.ts +11 -0
- package/dist/lib/commands/FORGET.js +12 -0
- package/dist/lib/commands/GET.d.ts +13 -0
- package/dist/lib/commands/GET.js +14 -0
- package/dist/lib/commands/MERGE.d.ts +9 -0
- package/dist/lib/commands/MERGE.js +14 -0
- package/dist/lib/commands/MGET.d.ts +8 -0
- package/dist/lib/commands/MGET.js +15 -0
- package/dist/lib/commands/MSET.d.ts +14 -0
- package/dist/lib/commands/MSET.js +18 -0
- package/dist/lib/commands/NUMINCRBY.d.ts +11 -0
- package/dist/lib/commands/NUMINCRBY.js +13 -0
- package/dist/lib/commands/NUMMULTBY.d.ts +11 -0
- package/dist/lib/commands/NUMMULTBY.js +9 -0
- package/dist/lib/commands/OBJKEYS.d.ts +11 -0
- package/dist/lib/commands/OBJKEYS.js +12 -0
- package/dist/lib/commands/OBJLEN.d.ts +11 -0
- package/dist/lib/commands/OBJLEN.js +12 -0
- package/dist/lib/commands/RESP.js +8 -0
- package/dist/lib/commands/SET.d.ts +20 -0
- package/dist/lib/commands/SET.js +19 -0
- package/dist/lib/commands/STRAPPEND.d.ts +11 -0
- package/dist/lib/commands/STRAPPEND.js +14 -0
- package/dist/lib/commands/STRLEN.d.ts +11 -0
- package/dist/lib/commands/STRLEN.js +12 -0
- package/dist/lib/commands/TOGGLE.d.ts +8 -0
- package/dist/lib/commands/TOGGLE.js +8 -0
- package/dist/lib/commands/TYPE.d.ts +14 -0
- package/dist/lib/commands/TYPE.js +16 -0
- package/dist/lib/commands/index.d.ts +317 -0
- package/dist/lib/commands/index.js +90 -0
- package/dist/lib/index.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +6 -16
- package/dist/commands/ARRAPPEND.d.ts +0 -4
- package/dist/commands/ARRAPPEND.js +0 -13
- package/dist/commands/ARRINDEX.d.ts +0 -5
- package/dist/commands/ARRINDEX.js +0 -17
- package/dist/commands/ARRINSERT.d.ts +0 -4
- package/dist/commands/ARRINSERT.js +0 -13
- package/dist/commands/ARRLEN.d.ts +0 -4
- package/dist/commands/ARRLEN.js +0 -13
- package/dist/commands/ARRPOP.d.ts +0 -4
- package/dist/commands/ARRPOP.js +0 -25
- package/dist/commands/ARRTRIM.d.ts +0 -3
- package/dist/commands/ARRTRIM.js +0 -8
- package/dist/commands/DEBUG_MEMORY.d.ts +0 -3
- package/dist/commands/DEBUG_MEMORY.js +0 -12
- package/dist/commands/DEL.d.ts +0 -3
- package/dist/commands/DEL.js +0 -12
- package/dist/commands/FORGET.d.ts +0 -3
- package/dist/commands/FORGET.js +0 -12
- package/dist/commands/GET.d.ts +0 -12
- package/dist/commands/GET.js +0 -28
- package/dist/commands/MERGE.d.ts +0 -4
- package/dist/commands/MERGE.js +0 -9
- package/dist/commands/MGET.d.ts +0 -4
- package/dist/commands/MGET.js +0 -17
- package/dist/commands/MSET.d.ts +0 -11
- package/dist/commands/MSET.js +0 -18
- package/dist/commands/NUMINCRBY.d.ts +0 -3
- package/dist/commands/NUMINCRBY.js +0 -10
- package/dist/commands/NUMMULTBY.d.ts +0 -3
- package/dist/commands/NUMMULTBY.js +0 -10
- package/dist/commands/OBJKEYS.d.ts +0 -3
- package/dist/commands/OBJKEYS.js +0 -12
- package/dist/commands/OBJLEN.d.ts +0 -3
- package/dist/commands/OBJLEN.js +0 -12
- package/dist/commands/RESP.js +0 -12
- package/dist/commands/SET.d.ts +0 -11
- package/dist/commands/SET.js +0 -16
- package/dist/commands/STRAPPEND.d.ts +0 -6
- package/dist/commands/STRAPPEND.js +0 -16
- package/dist/commands/STRLEN.d.ts +0 -4
- package/dist/commands/STRLEN.js +0 -13
- package/dist/commands/TYPE.d.ts +0 -3
- package/dist/commands/TYPE.js +0 -12
- package/dist/commands/index.d.ts +0 -80
- package/dist/commands/index.js +0 -89
- package/dist/index.js +0 -5
- /package/dist/{commands → lib/commands}/RESP.d.ts +0 -0
- /package/dist/{index.d.ts → lib/index.d.ts} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RedisJSON } from '.';
|
|
2
|
+
import { RedisArgument, NumberReply, ArrayReply, NullReply } 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, path: RedisArgument, json: RedisJSON, ...jsons: Array<RedisJSON>) => RedisArgument[];
|
|
7
|
+
readonly transformReply: () => NumberReply | ArrayReply<NumberReply | NullReply>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { transformRedisJsonArgument } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
FIRST_KEY_INDEX: 1,
|
|
4
|
+
IS_READ_ONLY: false,
|
|
5
|
+
transformArguments(key, path, json, ...jsons) {
|
|
6
|
+
const args = new Array(4 + jsons.length);
|
|
7
|
+
args[0] = 'JSON.ARRAPPEND';
|
|
8
|
+
args[1] = key;
|
|
9
|
+
args[2] = path;
|
|
10
|
+
args[3] = transformRedisJsonArgument(json);
|
|
11
|
+
let argsIndex = 4;
|
|
12
|
+
for (let i = 0; i < jsons.length; i++) {
|
|
13
|
+
args[argsIndex++] = transformRedisJsonArgument(jsons[i]);
|
|
14
|
+
}
|
|
15
|
+
return args;
|
|
16
|
+
},
|
|
17
|
+
transformReply: undefined
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply, ArrayReply, NullReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { RedisJSON } from '.';
|
|
3
|
+
export interface JsonArrIndexOptions {
|
|
4
|
+
range?: {
|
|
5
|
+
start: number;
|
|
6
|
+
stop?: number;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
declare const _default: {
|
|
10
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
11
|
+
readonly IS_READ_ONLY: true;
|
|
12
|
+
readonly transformArguments: (this: void, key: RedisArgument, path: RedisArgument, json: RedisJSON, options?: JsonArrIndexOptions) => RedisArgument[];
|
|
13
|
+
readonly transformReply: () => NumberReply | ArrayReply<NumberReply | NullReply>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { transformRedisJsonArgument } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
FIRST_KEY_INDEX: 1,
|
|
4
|
+
IS_READ_ONLY: true,
|
|
5
|
+
transformArguments(key, path, json, options) {
|
|
6
|
+
const args = ['JSON.ARRINDEX', key, path, transformRedisJsonArgument(json)];
|
|
7
|
+
if (options?.range) {
|
|
8
|
+
args.push(options.range.start.toString());
|
|
9
|
+
if (options.range.stop !== undefined) {
|
|
10
|
+
args.push(options.range.stop.toString());
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return args;
|
|
14
|
+
},
|
|
15
|
+
transformReply: undefined
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply, ArrayReply, NullReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { RedisJSON } from '.';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
5
|
+
readonly IS_READ_ONLY: false;
|
|
6
|
+
readonly transformArguments: (this: void, key: RedisArgument, path: RedisArgument, index: number, json: RedisJSON, ...jsons: Array<RedisJSON>) => RedisArgument[];
|
|
7
|
+
readonly transformReply: () => NumberReply | ArrayReply<NumberReply | NullReply>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { transformRedisJsonArgument } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
FIRST_KEY_INDEX: 1,
|
|
4
|
+
IS_READ_ONLY: false,
|
|
5
|
+
transformArguments(key, path, index, json, ...jsons) {
|
|
6
|
+
const args = new Array(4 + jsons.length);
|
|
7
|
+
args[0] = 'JSON.ARRINSERT';
|
|
8
|
+
args[1] = key;
|
|
9
|
+
args[2] = path;
|
|
10
|
+
args[3] = index.toString();
|
|
11
|
+
args[4] = transformRedisJsonArgument(json);
|
|
12
|
+
let argsIndex = 5;
|
|
13
|
+
for (let i = 0; i < jsons.length; i++) {
|
|
14
|
+
args[argsIndex++] = transformRedisJsonArgument(jsons[i]);
|
|
15
|
+
}
|
|
16
|
+
return args;
|
|
17
|
+
},
|
|
18
|
+
transformReply: undefined
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, ArrayReply, NumberReply, NullReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonArrLenOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
7
|
+
readonly IS_READ_ONLY: true;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonArrLenOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => NumberReply | ArrayReply<NumberReply | NullReply>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
FIRST_KEY_INDEX: 1,
|
|
3
|
+
IS_READ_ONLY: true,
|
|
4
|
+
transformArguments(key, options) {
|
|
5
|
+
const args = ['JSON.ARRLEN', key];
|
|
6
|
+
if (options?.path !== undefined) {
|
|
7
|
+
args.push(options.path);
|
|
8
|
+
}
|
|
9
|
+
return args;
|
|
10
|
+
},
|
|
11
|
+
transformReply: undefined
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RedisArgument, ArrayReply, NullReply, BlobStringReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface RedisArrPopOptions {
|
|
3
|
+
path: RedisArgument;
|
|
4
|
+
index?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: {
|
|
7
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
8
|
+
readonly IS_READ_ONLY: false;
|
|
9
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: RedisArrPopOptions) => RedisArgument[];
|
|
10
|
+
readonly transformReply: (this: void, reply: NullReply | BlobStringReply | ArrayReply<NullReply | BlobStringReply>) => string | number | boolean | Date | {
|
|
11
|
+
[key: string]: import(".").RedisJSON;
|
|
12
|
+
[key: number]: import(".").RedisJSON;
|
|
13
|
+
} | NullReply | (import(".").RedisJSON | NullReply)[] | null;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isArrayReply } from '@redis/client/dist/lib/commands/generic-transformers';
|
|
2
|
+
import { transformRedisJsonNullReply } from '.';
|
|
3
|
+
export default {
|
|
4
|
+
FIRST_KEY_INDEX: 1,
|
|
5
|
+
IS_READ_ONLY: false,
|
|
6
|
+
transformArguments(key, options) {
|
|
7
|
+
const args = ['JSON.ARRPOP', key];
|
|
8
|
+
if (options) {
|
|
9
|
+
args.push(options.path);
|
|
10
|
+
if (options.index !== undefined) {
|
|
11
|
+
args.push(options.index.toString());
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return args;
|
|
15
|
+
},
|
|
16
|
+
transformReply(reply) {
|
|
17
|
+
return isArrayReply(reply) ?
|
|
18
|
+
reply.map(item => transformRedisJsonNullReply(item)) :
|
|
19
|
+
transformRedisJsonNullReply(reply);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RedisArgument, ArrayReply, NumberReply, NullReply } 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, key: RedisArgument, path: RedisArgument, start: number, stop: number) => RedisArgument[];
|
|
6
|
+
readonly transformReply: () => NumberReply | ArrayReply<NumberReply | NullReply>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonClearOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
7
|
+
readonly IS_READ_ONLY: false;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonClearOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => NumberReply;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
FIRST_KEY_INDEX: 1,
|
|
3
|
+
IS_READ_ONLY: false,
|
|
4
|
+
transformArguments(key, options) {
|
|
5
|
+
const args = ['JSON.CLEAR', key];
|
|
6
|
+
if (options?.path !== undefined) {
|
|
7
|
+
args.push(options.path);
|
|
8
|
+
}
|
|
9
|
+
return args;
|
|
10
|
+
},
|
|
11
|
+
transformReply: undefined
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonDebugMemoryOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 2;
|
|
7
|
+
readonly IS_READ_ONLY: false;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonDebugMemoryOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => NumberReply;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
FIRST_KEY_INDEX: 2,
|
|
3
|
+
IS_READ_ONLY: false,
|
|
4
|
+
transformArguments(key, options) {
|
|
5
|
+
const args = ['JSON.DEBUG', 'MEMORY', key];
|
|
6
|
+
if (options?.path !== undefined) {
|
|
7
|
+
args.push(options.path);
|
|
8
|
+
}
|
|
9
|
+
return args;
|
|
10
|
+
},
|
|
11
|
+
transformReply: undefined
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonDelOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
7
|
+
readonly IS_READ_ONLY: false;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonDelOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => NumberReply;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonForgetOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
7
|
+
readonly IS_READ_ONLY: false;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonForgetOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => NumberReply;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
FIRST_KEY_INDEX: 1,
|
|
3
|
+
IS_READ_ONLY: false,
|
|
4
|
+
transformArguments(key, options) {
|
|
5
|
+
const args = ['JSON.FORGET', key];
|
|
6
|
+
if (options?.path !== undefined) {
|
|
7
|
+
args.push(options.path);
|
|
8
|
+
}
|
|
9
|
+
return args;
|
|
10
|
+
},
|
|
11
|
+
transformReply: undefined
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RedisArgument } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { RedisVariadicArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
|
3
|
+
import { transformRedisJsonNullReply } from '.';
|
|
4
|
+
export interface JsonGetOptions {
|
|
5
|
+
path?: RedisVariadicArgument;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: {
|
|
8
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
9
|
+
readonly IS_READ_ONLY: false;
|
|
10
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonGetOptions) => RedisArgument[];
|
|
11
|
+
readonly transformReply: typeof transformRedisJsonNullReply;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { pushVariadicArguments } from '@redis/client/dist/lib/commands/generic-transformers';
|
|
2
|
+
import { transformRedisJsonNullReply } from '.';
|
|
3
|
+
export default {
|
|
4
|
+
FIRST_KEY_INDEX: 1,
|
|
5
|
+
IS_READ_ONLY: false,
|
|
6
|
+
transformArguments(key, options) {
|
|
7
|
+
let args = ['JSON.GET', key];
|
|
8
|
+
if (options?.path !== undefined) {
|
|
9
|
+
args = pushVariadicArguments(args, options.path);
|
|
10
|
+
}
|
|
11
|
+
return args;
|
|
12
|
+
},
|
|
13
|
+
transformReply: transformRedisJsonNullReply
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SimpleStringReply, RedisArgument } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { RedisJSON } from '.';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
5
|
+
readonly IS_READ_ONLY: false;
|
|
6
|
+
readonly transformArguments: (this: void, key: RedisArgument, path: RedisArgument, value: RedisJSON) => RedisArgument[];
|
|
7
|
+
readonly transformReply: () => SimpleStringReply<'OK'>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { transformRedisJsonArgument } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
FIRST_KEY_INDEX: 1,
|
|
4
|
+
IS_READ_ONLY: false,
|
|
5
|
+
transformArguments(key, path, value) {
|
|
6
|
+
return [
|
|
7
|
+
'JSON.MERGE',
|
|
8
|
+
key,
|
|
9
|
+
path,
|
|
10
|
+
transformRedisJsonArgument(value)
|
|
11
|
+
];
|
|
12
|
+
},
|
|
13
|
+
transformReply: undefined
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RedisArgument, UnwrapReply, ArrayReply, NullReply, BlobStringReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
4
|
+
readonly IS_READ_ONLY: true;
|
|
5
|
+
readonly transformArguments: (this: void, keys: Array<RedisArgument>, path: RedisArgument) => RedisArgument[];
|
|
6
|
+
readonly transformReply: (this: void, reply: UnwrapReply<ArrayReply<NullReply | BlobStringReply>>) => (import(".").RedisJSON | NullReply)[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { transformRedisJsonNullReply } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
FIRST_KEY_INDEX: 1,
|
|
4
|
+
IS_READ_ONLY: true,
|
|
5
|
+
transformArguments(keys, path) {
|
|
6
|
+
return [
|
|
7
|
+
'JSON.MGET',
|
|
8
|
+
...keys,
|
|
9
|
+
path
|
|
10
|
+
];
|
|
11
|
+
},
|
|
12
|
+
transformReply(reply) {
|
|
13
|
+
return reply.map(json => transformRedisJsonNullReply(json));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RedisArgument, SimpleStringReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { RedisJSON } from '.';
|
|
3
|
+
export interface JsonMSetItem {
|
|
4
|
+
key: RedisArgument;
|
|
5
|
+
path: RedisArgument;
|
|
6
|
+
value: RedisJSON;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: {
|
|
9
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
10
|
+
readonly IS_READ_ONLY: false;
|
|
11
|
+
readonly transformArguments: (this: void, items: Array<JsonMSetItem>) => RedisArgument[];
|
|
12
|
+
readonly transformReply: () => SimpleStringReply<'OK'>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { transformRedisJsonArgument } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
FIRST_KEY_INDEX: 1,
|
|
4
|
+
IS_READ_ONLY: false,
|
|
5
|
+
transformArguments(items) {
|
|
6
|
+
const args = new Array(1 + items.length * 3);
|
|
7
|
+
args[0] = 'JSON.MSET';
|
|
8
|
+
let argsIndex = 1;
|
|
9
|
+
for (let i = 0; i < items.length; i++) {
|
|
10
|
+
const item = items[i];
|
|
11
|
+
args[argsIndex++] = item.key;
|
|
12
|
+
args[argsIndex++] = item.path;
|
|
13
|
+
args[argsIndex++] = transformRedisJsonArgument(item.value);
|
|
14
|
+
}
|
|
15
|
+
return args;
|
|
16
|
+
},
|
|
17
|
+
transformReply: undefined
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, ArrayReply, NumberReply, DoubleReply, NullReply, BlobStringReply, UnwrapReply } 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, key: RedisArgument, path: RedisArgument, by: number) => RedisArgument[];
|
|
6
|
+
readonly transformReply: {
|
|
7
|
+
readonly 2: (reply: UnwrapReply<BlobStringReply>) => number | (number | null)[];
|
|
8
|
+
readonly 3: () => ArrayReply<NumberReply | DoubleReply | NullReply>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
FIRST_KEY_INDEX: 1,
|
|
3
|
+
IS_READ_ONLY: false,
|
|
4
|
+
transformArguments(key, path, by) {
|
|
5
|
+
return ['JSON.NUMINCRBY', key, path, by.toString()];
|
|
6
|
+
},
|
|
7
|
+
transformReply: {
|
|
8
|
+
2: (reply) => {
|
|
9
|
+
return JSON.parse(reply.toString());
|
|
10
|
+
},
|
|
11
|
+
3: undefined
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument } 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, key: RedisArgument, path: RedisArgument, by: number) => RedisArgument[];
|
|
6
|
+
readonly transformReply: {
|
|
7
|
+
readonly 2: (reply: import("@redis/client/dist/lib/RESP/types").UnwrapReply<import("@redis/client/dist/lib/RESP/types").BlobStringReply<string>>) => number | (number | null)[];
|
|
8
|
+
readonly 3: () => import("@redis/client/dist/lib/RESP/types").ArrayReply<import("@redis/client/dist/lib/RESP/types").NumberReply<number> | import("@redis/client/dist/lib/RESP/types").NullReply | import("@redis/client/dist/lib/RESP/types").DoubleReply<number>>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, ArrayReply, BlobStringReply, NullReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonObjKeysOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
7
|
+
readonly IS_READ_ONLY: false;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonObjKeysOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => ArrayReply<BlobStringReply> | ArrayReply<ArrayReply<BlobStringReply> | NullReply>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
FIRST_KEY_INDEX: 1,
|
|
3
|
+
IS_READ_ONLY: false,
|
|
4
|
+
transformArguments(key, options) {
|
|
5
|
+
const args = ['JSON.OBJKEYS', key];
|
|
6
|
+
if (options?.path !== undefined) {
|
|
7
|
+
args.push(options.path);
|
|
8
|
+
}
|
|
9
|
+
return args;
|
|
10
|
+
},
|
|
11
|
+
transformReply: undefined
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, NumberReply, ArrayReply, NullReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonObjLenOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
7
|
+
readonly IS_READ_ONLY: true;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonObjLenOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => NumberReply | ArrayReply<NumberReply | NullReply>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
FIRST_KEY_INDEX: 1,
|
|
3
|
+
IS_READ_ONLY: true,
|
|
4
|
+
transformArguments(key, options) {
|
|
5
|
+
const args = ['JSON.OBJLEN', key];
|
|
6
|
+
if (options?.path !== undefined) {
|
|
7
|
+
args.push(options.path);
|
|
8
|
+
}
|
|
9
|
+
return args;
|
|
10
|
+
},
|
|
11
|
+
transformReply: undefined
|
|
12
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RedisArgument, SimpleStringReply, NullReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
import { RedisJSON } from '.';
|
|
3
|
+
export interface JsonSetOptions {
|
|
4
|
+
condition?: 'NX' | 'XX';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `{ condition: 'NX' }` instead.
|
|
7
|
+
*/
|
|
8
|
+
NX?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `{ condition: 'XX' }` instead.
|
|
11
|
+
*/
|
|
12
|
+
XX?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: {
|
|
15
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
16
|
+
readonly IS_READ_ONLY: false;
|
|
17
|
+
readonly transformArguments: (this: void, key: RedisArgument, path: RedisArgument, json: RedisJSON, options?: JsonSetOptions) => RedisArgument[];
|
|
18
|
+
readonly transformReply: () => SimpleStringReply<'OK'> | NullReply;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { transformRedisJsonArgument } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
FIRST_KEY_INDEX: 1,
|
|
4
|
+
IS_READ_ONLY: false,
|
|
5
|
+
transformArguments(key, path, json, options) {
|
|
6
|
+
const args = ['JSON.SET', key, path, transformRedisJsonArgument(json)];
|
|
7
|
+
if (options?.condition) {
|
|
8
|
+
args.push(options?.condition);
|
|
9
|
+
}
|
|
10
|
+
else if (options?.NX) {
|
|
11
|
+
args.push('NX');
|
|
12
|
+
}
|
|
13
|
+
else if (options?.XX) {
|
|
14
|
+
args.push('XX');
|
|
15
|
+
}
|
|
16
|
+
return args;
|
|
17
|
+
},
|
|
18
|
+
transformReply: undefined
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, NullReply, NumberReply, ArrayReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonStrAppendOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
7
|
+
readonly IS_READ_ONLY: false;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, append: string, options?: JsonStrAppendOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => NumberReply | ArrayReply<NullReply | NumberReply>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { transformRedisJsonArgument } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
FIRST_KEY_INDEX: 1,
|
|
4
|
+
IS_READ_ONLY: false,
|
|
5
|
+
transformArguments(key, append, options) {
|
|
6
|
+
const args = ['JSON.STRAPPEND', key];
|
|
7
|
+
if (options?.path !== undefined) {
|
|
8
|
+
args.push(options.path);
|
|
9
|
+
}
|
|
10
|
+
args.push(transformRedisJsonArgument(append));
|
|
11
|
+
return args;
|
|
12
|
+
},
|
|
13
|
+
transformReply: undefined
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedisArgument, ArrayReply, NumberReply, NullReply } from '@redis/client/dist/lib/RESP/types';
|
|
2
|
+
export interface JsonStrLenOptions {
|
|
3
|
+
path?: RedisArgument;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: {
|
|
6
|
+
readonly FIRST_KEY_INDEX: 1;
|
|
7
|
+
readonly IS_READ_ONLY: true;
|
|
8
|
+
readonly transformArguments: (this: void, key: RedisArgument, options?: JsonStrLenOptions) => RedisArgument[];
|
|
9
|
+
readonly transformReply: () => NumberReply | ArrayReply<NumberReply | NullReply>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RedisArgument, ArrayReply, NumberReply, NullReply } 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, key: RedisArgument, path: RedisArgument) => RedisArgument[];
|
|
6
|
+
readonly transformReply: () => NumberReply | NullReply | ArrayReply<NumberReply | NullReply>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|