@redis/json 1.0.6 → 2.0.0-next.2

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.
Files changed (97) hide show
  1. package/dist/lib/commands/ARRAPPEND.d.ts +9 -0
  2. package/dist/lib/commands/ARRAPPEND.js +20 -0
  3. package/dist/lib/commands/ARRINDEX.d.ts +15 -0
  4. package/dist/lib/commands/ARRINDEX.js +18 -0
  5. package/dist/lib/commands/ARRINSERT.d.ts +9 -0
  6. package/dist/lib/commands/ARRINSERT.js +21 -0
  7. package/dist/lib/commands/ARRLEN.d.ts +11 -0
  8. package/dist/lib/commands/ARRLEN.js +14 -0
  9. package/dist/lib/commands/ARRPOP.d.ts +15 -0
  10. package/dist/lib/commands/ARRPOP.js +23 -0
  11. package/dist/lib/commands/ARRTRIM.d.ts +8 -0
  12. package/dist/lib/commands/ARRTRIM.js +10 -0
  13. package/dist/lib/commands/CLEAR.d.ts +11 -0
  14. package/dist/lib/commands/CLEAR.js +14 -0
  15. package/dist/lib/commands/DEBUG_MEMORY.d.ts +11 -0
  16. package/dist/lib/commands/DEBUG_MEMORY.js +14 -0
  17. package/dist/lib/commands/DEL.d.ts +11 -0
  18. package/dist/lib/commands/DEL.js +14 -0
  19. package/dist/lib/commands/FORGET.d.ts +11 -0
  20. package/dist/lib/commands/FORGET.js +14 -0
  21. package/dist/lib/commands/GET.d.ts +13 -0
  22. package/dist/lib/commands/GET.js +16 -0
  23. package/dist/lib/commands/MERGE.d.ts +9 -0
  24. package/dist/lib/commands/MERGE.js +16 -0
  25. package/dist/lib/commands/MGET.d.ts +8 -0
  26. package/dist/lib/commands/MGET.js +17 -0
  27. package/dist/lib/commands/MSET.d.ts +14 -0
  28. package/dist/lib/commands/MSET.js +20 -0
  29. package/dist/lib/commands/NUMINCRBY.d.ts +11 -0
  30. package/dist/lib/commands/NUMINCRBY.js +15 -0
  31. package/dist/lib/commands/NUMMULTBY.d.ts +11 -0
  32. package/dist/lib/commands/NUMMULTBY.js +14 -0
  33. package/dist/lib/commands/OBJKEYS.d.ts +11 -0
  34. package/dist/lib/commands/OBJKEYS.js +14 -0
  35. package/dist/lib/commands/OBJLEN.d.ts +11 -0
  36. package/dist/lib/commands/OBJLEN.js +14 -0
  37. package/dist/lib/commands/SET.d.ts +20 -0
  38. package/dist/lib/commands/SET.js +21 -0
  39. package/dist/lib/commands/STRAPPEND.d.ts +11 -0
  40. package/dist/lib/commands/STRAPPEND.js +16 -0
  41. package/dist/lib/commands/STRLEN.d.ts +11 -0
  42. package/dist/lib/commands/STRLEN.js +14 -0
  43. package/dist/lib/commands/TOGGLE.d.ts +8 -0
  44. package/dist/lib/commands/TOGGLE.js +10 -0
  45. package/dist/lib/commands/TYPE.d.ts +14 -0
  46. package/dist/lib/commands/TYPE.js +18 -0
  47. package/dist/lib/commands/index.d.ts +317 -0
  48. package/dist/lib/commands/index.js +99 -0
  49. package/dist/{index.js → lib/index.js} +4 -1
  50. package/package.json +8 -17
  51. package/dist/commands/ARRAPPEND.d.ts +0 -4
  52. package/dist/commands/ARRAPPEND.js +0 -13
  53. package/dist/commands/ARRINDEX.d.ts +0 -5
  54. package/dist/commands/ARRINDEX.js +0 -17
  55. package/dist/commands/ARRINSERT.d.ts +0 -4
  56. package/dist/commands/ARRINSERT.js +0 -13
  57. package/dist/commands/ARRLEN.d.ts +0 -4
  58. package/dist/commands/ARRLEN.js +0 -13
  59. package/dist/commands/ARRPOP.d.ts +0 -4
  60. package/dist/commands/ARRPOP.js +0 -25
  61. package/dist/commands/ARRTRIM.d.ts +0 -3
  62. package/dist/commands/ARRTRIM.js +0 -8
  63. package/dist/commands/DEBUG_MEMORY.d.ts +0 -3
  64. package/dist/commands/DEBUG_MEMORY.js +0 -12
  65. package/dist/commands/DEL.d.ts +0 -3
  66. package/dist/commands/DEL.js +0 -12
  67. package/dist/commands/FORGET.d.ts +0 -3
  68. package/dist/commands/FORGET.js +0 -12
  69. package/dist/commands/GET.d.ts +0 -12
  70. package/dist/commands/GET.js +0 -28
  71. package/dist/commands/MERGE.d.ts +0 -4
  72. package/dist/commands/MERGE.js +0 -9
  73. package/dist/commands/MGET.d.ts +0 -4
  74. package/dist/commands/MGET.js +0 -17
  75. package/dist/commands/MSET.d.ts +0 -11
  76. package/dist/commands/MSET.js +0 -18
  77. package/dist/commands/NUMINCRBY.d.ts +0 -3
  78. package/dist/commands/NUMINCRBY.js +0 -10
  79. package/dist/commands/NUMMULTBY.d.ts +0 -3
  80. package/dist/commands/NUMMULTBY.js +0 -10
  81. package/dist/commands/OBJKEYS.d.ts +0 -3
  82. package/dist/commands/OBJKEYS.js +0 -12
  83. package/dist/commands/OBJLEN.d.ts +0 -3
  84. package/dist/commands/OBJLEN.js +0 -12
  85. package/dist/commands/SET.d.ts +0 -11
  86. package/dist/commands/SET.js +0 -16
  87. package/dist/commands/STRAPPEND.d.ts +0 -6
  88. package/dist/commands/STRAPPEND.js +0 -16
  89. package/dist/commands/STRLEN.d.ts +0 -4
  90. package/dist/commands/STRLEN.js +0 -13
  91. package/dist/commands/TYPE.d.ts +0 -3
  92. package/dist/commands/TYPE.js +0 -12
  93. package/dist/commands/index.d.ts +0 -80
  94. package/dist/commands/index.js +0 -89
  95. /package/dist/{commands → lib/commands}/RESP.d.ts +0 -0
  96. /package/dist/{commands → lib/commands}/RESP.js +0 -0
  97. /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,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ exports.default = {
5
+ FIRST_KEY_INDEX: 1,
6
+ IS_READ_ONLY: false,
7
+ transformArguments(key, path, json, ...jsons) {
8
+ const args = new Array(4 + jsons.length);
9
+ args[0] = 'JSON.ARRAPPEND';
10
+ args[1] = key;
11
+ args[2] = path;
12
+ args[3] = (0, _1.transformRedisJsonArgument)(json);
13
+ let argsIndex = 4;
14
+ for (let i = 0; i < jsons.length; i++) {
15
+ args[argsIndex++] = (0, _1.transformRedisJsonArgument)(jsons[i]);
16
+ }
17
+ return args;
18
+ },
19
+ transformReply: undefined
20
+ };
@@ -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,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ exports.default = {
5
+ FIRST_KEY_INDEX: 1,
6
+ IS_READ_ONLY: true,
7
+ transformArguments(key, path, json, options) {
8
+ const args = ['JSON.ARRINDEX', key, path, (0, _1.transformRedisJsonArgument)(json)];
9
+ if (options?.range) {
10
+ args.push(options.range.start.toString());
11
+ if (options.range.stop !== undefined) {
12
+ args.push(options.range.stop.toString());
13
+ }
14
+ }
15
+ return args;
16
+ },
17
+ transformReply: undefined
18
+ };
@@ -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,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ exports.default = {
5
+ FIRST_KEY_INDEX: 1,
6
+ IS_READ_ONLY: false,
7
+ transformArguments(key, path, index, json, ...jsons) {
8
+ const args = new Array(4 + jsons.length);
9
+ args[0] = 'JSON.ARRINSERT';
10
+ args[1] = key;
11
+ args[2] = path;
12
+ args[3] = index.toString();
13
+ args[4] = (0, _1.transformRedisJsonArgument)(json);
14
+ let argsIndex = 5;
15
+ for (let i = 0; i < jsons.length; i++) {
16
+ args[argsIndex++] = (0, _1.transformRedisJsonArgument)(jsons[i]);
17
+ }
18
+ return args;
19
+ },
20
+ transformReply: undefined
21
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: true,
6
+ transformArguments(key, options) {
7
+ const args = ['JSON.ARRLEN', key];
8
+ if (options?.path !== undefined) {
9
+ args.push(options.path);
10
+ }
11
+ return args;
12
+ },
13
+ transformReply: undefined
14
+ };
@@ -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,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
4
+ const _1 = require(".");
5
+ exports.default = {
6
+ FIRST_KEY_INDEX: 1,
7
+ IS_READ_ONLY: false,
8
+ transformArguments(key, options) {
9
+ const args = ['JSON.ARRPOP', key];
10
+ if (options) {
11
+ args.push(options.path);
12
+ if (options.index !== undefined) {
13
+ args.push(options.index.toString());
14
+ }
15
+ }
16
+ return args;
17
+ },
18
+ transformReply(reply) {
19
+ return (0, generic_transformers_1.isArrayReply)(reply) ?
20
+ reply.map(item => (0, _1.transformRedisJsonNullReply)(item)) :
21
+ (0, _1.transformRedisJsonNullReply)(reply);
22
+ }
23
+ };
@@ -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,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: false,
6
+ transformArguments(key, path, start, stop) {
7
+ return ['JSON.ARRTRIM', key, path, start.toString(), stop.toString()];
8
+ },
9
+ transformReply: undefined
10
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: false,
6
+ transformArguments(key, options) {
7
+ const args = ['JSON.CLEAR', key];
8
+ if (options?.path !== undefined) {
9
+ args.push(options.path);
10
+ }
11
+ return args;
12
+ },
13
+ transformReply: undefined
14
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 2,
5
+ IS_READ_ONLY: false,
6
+ transformArguments(key, options) {
7
+ const args = ['JSON.DEBUG', 'MEMORY', key];
8
+ if (options?.path !== undefined) {
9
+ args.push(options.path);
10
+ }
11
+ return args;
12
+ },
13
+ transformReply: undefined
14
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: false,
6
+ transformArguments(key, options) {
7
+ const args = ['JSON.DEL', key];
8
+ if (options?.path !== undefined) {
9
+ args.push(options.path);
10
+ }
11
+ return args;
12
+ },
13
+ transformReply: undefined
14
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: false,
6
+ transformArguments(key, options) {
7
+ const args = ['JSON.FORGET', key];
8
+ if (options?.path !== undefined) {
9
+ args.push(options.path);
10
+ }
11
+ return args;
12
+ },
13
+ transformReply: undefined
14
+ };
@@ -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,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
4
+ const _1 = require(".");
5
+ exports.default = {
6
+ FIRST_KEY_INDEX: 1,
7
+ IS_READ_ONLY: false,
8
+ transformArguments(key, options) {
9
+ let args = ['JSON.GET', key];
10
+ if (options?.path !== undefined) {
11
+ args = (0, generic_transformers_1.pushVariadicArguments)(args, options.path);
12
+ }
13
+ return args;
14
+ },
15
+ transformReply: _1.transformRedisJsonNullReply
16
+ };
@@ -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,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ exports.default = {
5
+ FIRST_KEY_INDEX: 1,
6
+ IS_READ_ONLY: false,
7
+ transformArguments(key, path, value) {
8
+ return [
9
+ 'JSON.MERGE',
10
+ key,
11
+ path,
12
+ (0, _1.transformRedisJsonArgument)(value)
13
+ ];
14
+ },
15
+ transformReply: undefined
16
+ };
@@ -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,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ exports.default = {
5
+ FIRST_KEY_INDEX: 1,
6
+ IS_READ_ONLY: true,
7
+ transformArguments(keys, path) {
8
+ return [
9
+ 'JSON.MGET',
10
+ ...keys,
11
+ path
12
+ ];
13
+ },
14
+ transformReply(reply) {
15
+ return reply.map(json => (0, _1.transformRedisJsonNullReply)(json));
16
+ }
17
+ };
@@ -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,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ exports.default = {
5
+ FIRST_KEY_INDEX: 1,
6
+ IS_READ_ONLY: false,
7
+ transformArguments(items) {
8
+ const args = new Array(1 + items.length * 3);
9
+ args[0] = 'JSON.MSET';
10
+ let argsIndex = 1;
11
+ for (let i = 0; i < items.length; i++) {
12
+ const item = items[i];
13
+ args[argsIndex++] = item.key;
14
+ args[argsIndex++] = item.path;
15
+ args[argsIndex++] = (0, _1.transformRedisJsonArgument)(item.value);
16
+ }
17
+ return args;
18
+ },
19
+ transformReply: undefined
20
+ };
@@ -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,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: false,
6
+ transformArguments(key, path, by) {
7
+ return ['JSON.NUMINCRBY', key, path, by.toString()];
8
+ },
9
+ transformReply: {
10
+ 2: (reply) => {
11
+ return JSON.parse(reply.toString());
12
+ },
13
+ 3: undefined
14
+ }
15
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const NUMINCRBY_1 = __importDefault(require("./NUMINCRBY"));
7
+ exports.default = {
8
+ FIRST_KEY_INDEX: 1,
9
+ IS_READ_ONLY: false,
10
+ transformArguments(key, path, by) {
11
+ return ['JSON.NUMMULTBY', key, path, by.toString()];
12
+ },
13
+ transformReply: NUMINCRBY_1.default.transformReply
14
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: false,
6
+ transformArguments(key, options) {
7
+ const args = ['JSON.OBJKEYS', key];
8
+ if (options?.path !== undefined) {
9
+ args.push(options.path);
10
+ }
11
+ return args;
12
+ },
13
+ transformReply: undefined
14
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: true,
6
+ transformArguments(key, options) {
7
+ const args = ['JSON.OBJLEN', key];
8
+ if (options?.path !== undefined) {
9
+ args.push(options.path);
10
+ }
11
+ return args;
12
+ },
13
+ transformReply: undefined
14
+ };
@@ -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,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ exports.default = {
5
+ FIRST_KEY_INDEX: 1,
6
+ IS_READ_ONLY: false,
7
+ transformArguments(key, path, json, options) {
8
+ const args = ['JSON.SET', key, path, (0, _1.transformRedisJsonArgument)(json)];
9
+ if (options?.condition) {
10
+ args.push(options?.condition);
11
+ }
12
+ else if (options?.NX) {
13
+ args.push('NX');
14
+ }
15
+ else if (options?.XX) {
16
+ args.push('XX');
17
+ }
18
+ return args;
19
+ },
20
+ transformReply: undefined
21
+ };
@@ -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,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ exports.default = {
5
+ FIRST_KEY_INDEX: 1,
6
+ IS_READ_ONLY: false,
7
+ transformArguments(key, append, options) {
8
+ const args = ['JSON.STRAPPEND', key];
9
+ if (options?.path !== undefined) {
10
+ args.push(options.path);
11
+ }
12
+ args.push((0, _1.transformRedisJsonArgument)(append));
13
+ return args;
14
+ },
15
+ transformReply: undefined
16
+ };
@@ -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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ FIRST_KEY_INDEX: 1,
5
+ IS_READ_ONLY: true,
6
+ transformArguments(key, options) {
7
+ const args = ['JSON.STRLEN', key];
8
+ if (options?.path) {
9
+ args.push(options.path);
10
+ }
11
+ return args;
12
+ },
13
+ transformReply: undefined
14
+ };