@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.
Files changed (100) hide show
  1. package/dist/lib/commands/ARRAPPEND.d.ts +9 -0
  2. package/dist/lib/commands/ARRAPPEND.js +18 -0
  3. package/dist/lib/commands/ARRINDEX.d.ts +15 -0
  4. package/dist/lib/commands/ARRINDEX.js +16 -0
  5. package/dist/lib/commands/ARRINSERT.d.ts +9 -0
  6. package/dist/lib/commands/ARRINSERT.js +19 -0
  7. package/dist/lib/commands/ARRLEN.d.ts +11 -0
  8. package/dist/lib/commands/ARRLEN.js +12 -0
  9. package/dist/lib/commands/ARRPOP.d.ts +15 -0
  10. package/dist/lib/commands/ARRPOP.js +21 -0
  11. package/dist/lib/commands/ARRTRIM.d.ts +8 -0
  12. package/dist/lib/commands/ARRTRIM.js +8 -0
  13. package/dist/lib/commands/CLEAR.d.ts +11 -0
  14. package/dist/lib/commands/CLEAR.js +12 -0
  15. package/dist/lib/commands/DEBUG_MEMORY.d.ts +11 -0
  16. package/dist/lib/commands/DEBUG_MEMORY.js +12 -0
  17. package/dist/lib/commands/DEL.d.ts +11 -0
  18. package/dist/lib/commands/DEL.js +12 -0
  19. package/dist/lib/commands/FORGET.d.ts +11 -0
  20. package/dist/lib/commands/FORGET.js +12 -0
  21. package/dist/lib/commands/GET.d.ts +13 -0
  22. package/dist/lib/commands/GET.js +14 -0
  23. package/dist/lib/commands/MERGE.d.ts +9 -0
  24. package/dist/lib/commands/MERGE.js +14 -0
  25. package/dist/lib/commands/MGET.d.ts +8 -0
  26. package/dist/lib/commands/MGET.js +15 -0
  27. package/dist/lib/commands/MSET.d.ts +14 -0
  28. package/dist/lib/commands/MSET.js +18 -0
  29. package/dist/lib/commands/NUMINCRBY.d.ts +11 -0
  30. package/dist/lib/commands/NUMINCRBY.js +13 -0
  31. package/dist/lib/commands/NUMMULTBY.d.ts +11 -0
  32. package/dist/lib/commands/NUMMULTBY.js +9 -0
  33. package/dist/lib/commands/OBJKEYS.d.ts +11 -0
  34. package/dist/lib/commands/OBJKEYS.js +12 -0
  35. package/dist/lib/commands/OBJLEN.d.ts +11 -0
  36. package/dist/lib/commands/OBJLEN.js +12 -0
  37. package/dist/lib/commands/RESP.js +8 -0
  38. package/dist/lib/commands/SET.d.ts +20 -0
  39. package/dist/lib/commands/SET.js +19 -0
  40. package/dist/lib/commands/STRAPPEND.d.ts +11 -0
  41. package/dist/lib/commands/STRAPPEND.js +14 -0
  42. package/dist/lib/commands/STRLEN.d.ts +11 -0
  43. package/dist/lib/commands/STRLEN.js +12 -0
  44. package/dist/lib/commands/TOGGLE.d.ts +8 -0
  45. package/dist/lib/commands/TOGGLE.js +8 -0
  46. package/dist/lib/commands/TYPE.d.ts +14 -0
  47. package/dist/lib/commands/TYPE.js +16 -0
  48. package/dist/lib/commands/index.d.ts +317 -0
  49. package/dist/lib/commands/index.js +90 -0
  50. package/dist/lib/index.js +1 -0
  51. package/dist/tsconfig.tsbuildinfo +1 -0
  52. package/package.json +6 -16
  53. package/dist/commands/ARRAPPEND.d.ts +0 -4
  54. package/dist/commands/ARRAPPEND.js +0 -13
  55. package/dist/commands/ARRINDEX.d.ts +0 -5
  56. package/dist/commands/ARRINDEX.js +0 -17
  57. package/dist/commands/ARRINSERT.d.ts +0 -4
  58. package/dist/commands/ARRINSERT.js +0 -13
  59. package/dist/commands/ARRLEN.d.ts +0 -4
  60. package/dist/commands/ARRLEN.js +0 -13
  61. package/dist/commands/ARRPOP.d.ts +0 -4
  62. package/dist/commands/ARRPOP.js +0 -25
  63. package/dist/commands/ARRTRIM.d.ts +0 -3
  64. package/dist/commands/ARRTRIM.js +0 -8
  65. package/dist/commands/DEBUG_MEMORY.d.ts +0 -3
  66. package/dist/commands/DEBUG_MEMORY.js +0 -12
  67. package/dist/commands/DEL.d.ts +0 -3
  68. package/dist/commands/DEL.js +0 -12
  69. package/dist/commands/FORGET.d.ts +0 -3
  70. package/dist/commands/FORGET.js +0 -12
  71. package/dist/commands/GET.d.ts +0 -12
  72. package/dist/commands/GET.js +0 -28
  73. package/dist/commands/MERGE.d.ts +0 -4
  74. package/dist/commands/MERGE.js +0 -9
  75. package/dist/commands/MGET.d.ts +0 -4
  76. package/dist/commands/MGET.js +0 -17
  77. package/dist/commands/MSET.d.ts +0 -11
  78. package/dist/commands/MSET.js +0 -18
  79. package/dist/commands/NUMINCRBY.d.ts +0 -3
  80. package/dist/commands/NUMINCRBY.js +0 -10
  81. package/dist/commands/NUMMULTBY.d.ts +0 -3
  82. package/dist/commands/NUMMULTBY.js +0 -10
  83. package/dist/commands/OBJKEYS.d.ts +0 -3
  84. package/dist/commands/OBJKEYS.js +0 -12
  85. package/dist/commands/OBJLEN.d.ts +0 -3
  86. package/dist/commands/OBJLEN.js +0 -12
  87. package/dist/commands/RESP.js +0 -12
  88. package/dist/commands/SET.d.ts +0 -11
  89. package/dist/commands/SET.js +0 -16
  90. package/dist/commands/STRAPPEND.d.ts +0 -6
  91. package/dist/commands/STRAPPEND.js +0 -16
  92. package/dist/commands/STRLEN.d.ts +0 -4
  93. package/dist/commands/STRLEN.js +0 -13
  94. package/dist/commands/TYPE.d.ts +0 -3
  95. package/dist/commands/TYPE.js +0 -12
  96. package/dist/commands/index.d.ts +0 -80
  97. package/dist/commands/index.js +0 -89
  98. package/dist/index.js +0 -5
  99. /package/dist/{commands → lib/commands}/RESP.d.ts +0 -0
  100. /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,8 @@
1
+ export default {
2
+ FIRST_KEY_INDEX: 1,
3
+ IS_READ_ONLY: false,
4
+ transformArguments(key, path, start, stop) {
5
+ return ['JSON.ARRTRIM', key, path, start.toString(), stop.toString()];
6
+ },
7
+ transformReply: undefined
8
+ };
@@ -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,12 @@
1
+ export default {
2
+ FIRST_KEY_INDEX: 1,
3
+ IS_READ_ONLY: false,
4
+ transformArguments(key, options) {
5
+ const args = ['JSON.DEL', 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 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,9 @@
1
+ import NUMINCRBY from './NUMINCRBY';
2
+ export default {
3
+ FIRST_KEY_INDEX: 1,
4
+ IS_READ_ONLY: false,
5
+ transformArguments(key, path, by) {
6
+ return ['JSON.NUMMULTBY', key, path, by.toString()];
7
+ },
8
+ transformReply: NUMINCRBY.transformReply
9
+ };
@@ -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,8 @@
1
+ export const FIRST_KEY_INDEX = 1;
2
+ export function transformArguments(key, path) {
3
+ const args = ['JSON.RESP', key];
4
+ if (path) {
5
+ args.push(path);
6
+ }
7
+ return args;
8
+ }
@@ -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,12 @@
1
+ export default {
2
+ FIRST_KEY_INDEX: 1,
3
+ IS_READ_ONLY: true,
4
+ transformArguments(key, options) {
5
+ const args = ['JSON.STRLEN', key];
6
+ if (options?.path) {
7
+ args.push(options.path);
8
+ }
9
+ return args;
10
+ },
11
+ transformReply: undefined
12
+ };
@@ -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;
@@ -0,0 +1,8 @@
1
+ export default {
2
+ FIRST_KEY_INDEX: 1,
3
+ IS_READ_ONLY: false,
4
+ transformArguments(key, path) {
5
+ return ['JSON.TOGGLE', key, path];
6
+ },
7
+ transformReply: undefined
8
+ };