@redis/client
Advanced tools
Comparing version 1.1.0 to 1.1.1
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply } from '../commands'; | ||
@@ -3,0 +4,0 @@ export interface QueueCommandOptions { |
@@ -23,3 +23,8 @@ import * as ACL_CAT from '../commands/ACL_CAT'; | ||
import * as CLIENT_KILL from '../commands/CLIENT_KILL'; | ||
import * as CLIENT_NO_EVICT from '../commands/CLIENT_NO-EVICT'; | ||
import * as CLIENT_PAUSE from '../commands/CLIENT_PAUSE'; | ||
import * as CLIENT_SETNAME from '../commands/CLIENT_SETNAME'; | ||
import * as CLIENT_TRACKING from '../commands/CLIENT_TRACKING'; | ||
import * as CLIENT_TRACKINGINFO from '../commands/CLIENT_TRACKINGINFO'; | ||
import * as CLIENT_UNPAUSE from '../commands/CLIENT_UNPAUSE'; | ||
import * as CLIENT_INFO from '../commands/CLIENT_INFO'; | ||
@@ -80,3 +85,3 @@ import * as CLUSTER_ADDSLOTS from '../commands/CLUSTER_ADDSLOTS'; | ||
import * as LOLWUT from '../commands/LOLWUT'; | ||
import * as MEMOERY_DOCTOR from '../commands/MEMORY_DOCTOR'; | ||
import * as MEMORY_DOCTOR from '../commands/MEMORY_DOCTOR'; | ||
import * as MEMORY_MALLOC_STATS from '../commands/MEMORY_MALLOC-STATS'; | ||
@@ -158,4 +163,14 @@ import * as MEMORY_PURGE from '../commands/MEMORY_PURGE'; | ||
clientKill: typeof CLIENT_KILL; | ||
'CLIENT_NO-EVICT': typeof CLIENT_NO_EVICT; | ||
clientNoEvict: typeof CLIENT_NO_EVICT; | ||
CLIENT_PAUSE: typeof CLIENT_PAUSE; | ||
clientPause: typeof CLIENT_PAUSE; | ||
CLIENT_SETNAME: typeof CLIENT_SETNAME; | ||
clientSetName: typeof CLIENT_SETNAME; | ||
CLIENT_TRACKING: typeof CLIENT_TRACKING; | ||
clientTracking: typeof CLIENT_TRACKING; | ||
CLIENT_TRACKINGINFO: typeof CLIENT_TRACKINGINFO; | ||
clientTrackingInfo: typeof CLIENT_TRACKINGINFO; | ||
CLIENT_UNPAUSE: typeof CLIENT_UNPAUSE; | ||
clientUnpause: typeof CLIENT_UNPAUSE; | ||
CLIENT_INFO: typeof CLIENT_INFO; | ||
@@ -273,4 +288,4 @@ clientInfo: typeof CLIENT_INFO; | ||
lolwut: typeof LOLWUT; | ||
MEMOERY_DOCTOR: typeof MEMOERY_DOCTOR; | ||
memoryDoctor: typeof MEMOERY_DOCTOR; | ||
MEMORY_DOCTOR: typeof MEMORY_DOCTOR; | ||
memoryDoctor: typeof MEMORY_DOCTOR; | ||
'MEMORY_MALLOC-STATS': typeof MEMORY_MALLOC_STATS; | ||
@@ -402,2 +417,22 @@ memoryMallocStats: typeof MEMORY_MALLOC_STATS; | ||
geoPos: typeof import("../commands/GEOPOS"); | ||
GEORADIUS_RO_WITH: typeof import("../commands/GEORADIUS_RO_WITH"); | ||
geoRadiusRoWith: typeof import("../commands/GEORADIUS_RO_WITH"); | ||
GEORADIUS_RO: typeof import("../commands/GEORADIUS_RO"); | ||
geoRadiusRo: typeof import("../commands/GEORADIUS_RO"); | ||
GEORADIUS_WITH: typeof import("../commands/GEORADIUS_WITH"); | ||
geoRadiusWith: typeof import("../commands/GEORADIUS_WITH"); | ||
GEORADIUS: typeof import("../commands/GEORADIUS"); | ||
geoRadius: typeof import("../commands/GEORADIUS"); | ||
GEORADIUSBYMEMBER_RO_WITH: typeof import("../commands/GEORADIUSBYMEMBER_RO_WITH"); | ||
geoRadiusByMemberRoWith: typeof import("../commands/GEORADIUSBYMEMBER_RO_WITH"); | ||
GEORADIUSBYMEMBER_RO: typeof import("../commands/GEORADIUSBYMEMBER_RO"); | ||
geoRadiusByMemberRo: typeof import("../commands/GEORADIUSBYMEMBER_RO"); | ||
GEORADIUSBYMEMBER_WITH: typeof import("../commands/GEORADIUSBYMEMBER_WITH"); | ||
geoRadiusByMemberWith: typeof import("../commands/GEORADIUSBYMEMBER_WITH"); | ||
GEORADIUSBYMEMBER: typeof import("../commands/GEORADIUSBYMEMBER"); | ||
geoRadiusByMember: typeof import("../commands/GEORADIUSBYMEMBER"); | ||
GEORADIUSBYMEMBERSTORE: typeof import("../commands/GEORADIUSBYMEMBERSTORE"); | ||
geoRadiusByMemberStore: typeof import("../commands/GEORADIUSBYMEMBERSTORE"); | ||
GEORADIUSSTORE: typeof import("../commands/GEORADIUSSTORE"); | ||
geoRadiusStore: typeof import("../commands/GEORADIUSSTORE"); | ||
GEOSEARCH_WITH: typeof import("../commands/GEOSEARCH_WITH"); | ||
@@ -461,2 +496,10 @@ geoSearchWith: typeof import("../commands/GEOSEARCH_WITH"); | ||
incrByFloat: typeof import("../commands/INCRBYFLOAT"); | ||
LCS_IDX_WITHMATCHLEN: typeof import("../commands/LCS_IDX_WITHMATCHLEN"); | ||
lcsIdxWithMatchLen: typeof import("../commands/LCS_IDX_WITHMATCHLEN"); | ||
LCS_IDX: typeof import("../commands/LCS_IDX"); | ||
lcsIdx: typeof import("../commands/LCS_IDX"); | ||
LCS_LEN: typeof import("../commands/LCS_LEN"); | ||
lcsLen: typeof import("../commands/LCS_LEN"); | ||
LCS: typeof import("../commands/LCS"); | ||
lcs: typeof import("../commands/LCS"); | ||
LINDEX: typeof import("../commands/LINDEX"); | ||
@@ -463,0 +506,0 @@ lIndex: typeof import("../commands/LINDEX"); |
@@ -26,3 +26,8 @@ "use strict"; | ||
const CLIENT_KILL = require("../commands/CLIENT_KILL"); | ||
const CLIENT_NO_EVICT = require("../commands/CLIENT_NO-EVICT"); | ||
const CLIENT_PAUSE = require("../commands/CLIENT_PAUSE"); | ||
const CLIENT_SETNAME = require("../commands/CLIENT_SETNAME"); | ||
const CLIENT_TRACKING = require("../commands/CLIENT_TRACKING"); | ||
const CLIENT_TRACKINGINFO = require("../commands/CLIENT_TRACKINGINFO"); | ||
const CLIENT_UNPAUSE = require("../commands/CLIENT_UNPAUSE"); | ||
const CLIENT_INFO = require("../commands/CLIENT_INFO"); | ||
@@ -83,3 +88,3 @@ const CLUSTER_ADDSLOTS = require("../commands/CLUSTER_ADDSLOTS"); | ||
const LOLWUT = require("../commands/LOLWUT"); | ||
const MEMOERY_DOCTOR = require("../commands/MEMORY_DOCTOR"); | ||
const MEMORY_DOCTOR = require("../commands/MEMORY_DOCTOR"); | ||
const MEMORY_MALLOC_STATS = require("../commands/MEMORY_MALLOC-STATS"); | ||
@@ -162,4 +167,14 @@ const MEMORY_PURGE = require("../commands/MEMORY_PURGE"); | ||
clientKill: CLIENT_KILL, | ||
'CLIENT_NO-EVICT': CLIENT_NO_EVICT, | ||
clientNoEvict: CLIENT_NO_EVICT, | ||
CLIENT_PAUSE, | ||
clientPause: CLIENT_PAUSE, | ||
CLIENT_SETNAME, | ||
clientSetName: CLIENT_SETNAME, | ||
CLIENT_TRACKING, | ||
clientTracking: CLIENT_TRACKING, | ||
CLIENT_TRACKINGINFO, | ||
clientTrackingInfo: CLIENT_TRACKINGINFO, | ||
CLIENT_UNPAUSE, | ||
clientUnpause: CLIENT_UNPAUSE, | ||
CLIENT_INFO, | ||
@@ -277,4 +292,4 @@ clientInfo: CLIENT_INFO, | ||
lolwut: LOLWUT, | ||
MEMOERY_DOCTOR, | ||
memoryDoctor: MEMOERY_DOCTOR, | ||
MEMORY_DOCTOR, | ||
memoryDoctor: MEMORY_DOCTOR, | ||
'MEMORY_MALLOC-STATS': MEMORY_MALLOC_STATS, | ||
@@ -281,0 +296,0 @@ memoryMallocStats: MEMORY_MALLOC_STATS, |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import COMMANDS from './commands'; | ||
@@ -57,2 +58,3 @@ import { RedisCommand, RedisCommandArguments, RedisCommandRawReply, RedisCommandReply, RedisFunctions, RedisModules, RedisExtensions, RedisScript, RedisScripts, RedisCommandSignature, ConvertArgumentType, RedisFunction, ExcludeMappedString } from '../commands'; | ||
get isOpen(): boolean; | ||
get isReady(): boolean; | ||
get v4(): Record<string, any>; | ||
@@ -79,5 +81,5 @@ constructor(options?: RedisClientOptions<M, F, S>); | ||
UNSUBSCRIBE<T extends boolean = false>(channels?: string | Array<string>, listener?: PubSubListener<T>, bufferMode?: T): Promise<void>; | ||
unsubscribe: <T extends boolean = false>(channels?: string | string[] | undefined, listener?: PubSubListener<T, T extends true ? Buffer : string> | undefined, bufferMode?: T | undefined) => Promise<void>; | ||
unsubscribe: <T extends boolean = false>(channels?: string | Array<string>, listener?: PubSubListener<T, T extends true ? Buffer : string> | undefined, bufferMode?: T | undefined) => Promise<void>; | ||
PUNSUBSCRIBE<T extends boolean = false>(patterns?: string | Array<string>, listener?: PubSubListener<T>, bufferMode?: T): Promise<void>; | ||
pUnsubscribe: <T extends boolean = false>(patterns?: string | string[] | undefined, listener?: PubSubListener<T, T extends true ? Buffer : string> | undefined, bufferMode?: T | undefined) => Promise<void>; | ||
pUnsubscribe: <T extends boolean = false>(patterns?: string | Array<string>, listener?: PubSubListener<T, T extends true ? Buffer : string> | undefined, bufferMode?: T | undefined) => Promise<void>; | ||
QUIT(): Promise<void>; | ||
@@ -84,0 +86,0 @@ quit: () => Promise<void>; |
@@ -150,2 +150,5 @@ "use strict"; | ||
} | ||
get isReady() { | ||
return __classPrivateFieldGet(this, _RedisClient_socket, "f").isReady; | ||
} | ||
get v4() { | ||
@@ -152,0 +155,0 @@ if (!__classPrivateFieldGet(this, _RedisClient_options, "f")?.legacyMode) { |
@@ -6,14 +6,11 @@ "use strict"; | ||
const toWrite = []; | ||
let strings = `*${args.length}${CRLF}`; | ||
let strings = '*' + args.length + CRLF; | ||
for (let i = 0; i < args.length; i++) { | ||
const arg = args[i]; | ||
if (typeof arg === 'string') { | ||
const byteLength = Buffer.byteLength(arg); | ||
strings += `$${byteLength}${CRLF}`; | ||
strings += arg; | ||
strings += '$' + Buffer.byteLength(arg) + CRLF + arg + CRLF; | ||
} | ||
else if (arg instanceof Buffer) { | ||
toWrite.push(`${strings}$${arg.length}${CRLF}`); | ||
strings = ''; | ||
toWrite.push(arg); | ||
toWrite.push(strings + '$' + arg.length.toString() + CRLF, arg); | ||
strings = CRLF; | ||
} | ||
@@ -23,3 +20,2 @@ else { | ||
} | ||
strings += CRLF; | ||
} | ||
@@ -26,0 +22,0 @@ toWrite.push(strings); |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
@@ -3,0 +5,0 @@ import * as net from 'net'; |
@@ -34,2 +34,12 @@ import * as APPEND from '../commands/APPEND'; | ||
import * as GEOPOS from '../commands/GEOPOS'; | ||
import * as GEORADIUS_RO_WITH from '../commands/GEORADIUS_RO_WITH'; | ||
import * as GEORADIUS_RO from '../commands/GEORADIUS_RO'; | ||
import * as GEORADIUS_WITH from '../commands/GEORADIUS_WITH'; | ||
import * as GEORADIUS from '../commands/GEORADIUS'; | ||
import * as GEORADIUSBYMEMBER_RO_WITH from '../commands/GEORADIUSBYMEMBER_RO_WITH'; | ||
import * as GEORADIUSBYMEMBER_RO from '../commands/GEORADIUSBYMEMBER_RO'; | ||
import * as GEORADIUSBYMEMBER_WITH from '../commands/GEORADIUSBYMEMBER_WITH'; | ||
import * as GEORADIUSBYMEMBER from '../commands/GEORADIUSBYMEMBER'; | ||
import * as GEORADIUSBYMEMBERSTORE from '../commands/GEORADIUSBYMEMBERSTORE'; | ||
import * as GEORADIUSSTORE from '../commands/GEORADIUSSTORE'; | ||
import * as GEOSEARCH_WITH from '../commands/GEOSEARCH_WITH'; | ||
@@ -64,2 +74,6 @@ import * as GEOSEARCH from '../commands/GEOSEARCH'; | ||
import * as INCRBYFLOAT from '../commands/INCRBYFLOAT'; | ||
import * as LCS_IDX_WITHMATCHLEN from '../commands/LCS_IDX_WITHMATCHLEN'; | ||
import * as LCS_IDX from '../commands/LCS_IDX'; | ||
import * as LCS_LEN from '../commands/LCS_LEN'; | ||
import * as LCS from '../commands/LCS'; | ||
import * as LINDEX from '../commands/LINDEX'; | ||
@@ -266,2 +280,22 @@ import * as LINSERT from '../commands/LINSERT'; | ||
geoPos: typeof GEOPOS; | ||
GEORADIUS_RO_WITH: typeof GEORADIUS_RO_WITH; | ||
geoRadiusRoWith: typeof GEORADIUS_RO_WITH; | ||
GEORADIUS_RO: typeof GEORADIUS_RO; | ||
geoRadiusRo: typeof GEORADIUS_RO; | ||
GEORADIUS_WITH: typeof GEORADIUS_WITH; | ||
geoRadiusWith: typeof GEORADIUS_WITH; | ||
GEORADIUS: typeof GEORADIUS; | ||
geoRadius: typeof GEORADIUS; | ||
GEORADIUSBYMEMBER_RO_WITH: typeof GEORADIUSBYMEMBER_RO_WITH; | ||
geoRadiusByMemberRoWith: typeof GEORADIUSBYMEMBER_RO_WITH; | ||
GEORADIUSBYMEMBER_RO: typeof GEORADIUSBYMEMBER_RO; | ||
geoRadiusByMemberRo: typeof GEORADIUSBYMEMBER_RO; | ||
GEORADIUSBYMEMBER_WITH: typeof GEORADIUSBYMEMBER_WITH; | ||
geoRadiusByMemberWith: typeof GEORADIUSBYMEMBER_WITH; | ||
GEORADIUSBYMEMBER: typeof GEORADIUSBYMEMBER; | ||
geoRadiusByMember: typeof GEORADIUSBYMEMBER; | ||
GEORADIUSBYMEMBERSTORE: typeof GEORADIUSBYMEMBERSTORE; | ||
geoRadiusByMemberStore: typeof GEORADIUSBYMEMBERSTORE; | ||
GEORADIUSSTORE: typeof GEORADIUSSTORE; | ||
geoRadiusStore: typeof GEORADIUSSTORE; | ||
GEOSEARCH_WITH: typeof GEOSEARCH_WITH; | ||
@@ -325,2 +359,10 @@ geoSearchWith: typeof GEOSEARCH_WITH; | ||
incrByFloat: typeof INCRBYFLOAT; | ||
LCS_IDX_WITHMATCHLEN: typeof LCS_IDX_WITHMATCHLEN; | ||
lcsIdxWithMatchLen: typeof LCS_IDX_WITHMATCHLEN; | ||
LCS_IDX: typeof LCS_IDX; | ||
lcsIdx: typeof LCS_IDX; | ||
LCS_LEN: typeof LCS_LEN; | ||
lcsLen: typeof LCS_LEN; | ||
LCS: typeof LCS; | ||
lcs: typeof LCS; | ||
LINDEX: typeof LINDEX; | ||
@@ -327,0 +369,0 @@ lIndex: typeof LINDEX; |
@@ -36,2 +36,12 @@ "use strict"; | ||
const GEOPOS = require("../commands/GEOPOS"); | ||
const GEORADIUS_RO_WITH = require("../commands/GEORADIUS_RO_WITH"); | ||
const GEORADIUS_RO = require("../commands/GEORADIUS_RO"); | ||
const GEORADIUS_WITH = require("../commands/GEORADIUS_WITH"); | ||
const GEORADIUS = require("../commands/GEORADIUS"); | ||
const GEORADIUSBYMEMBER_RO_WITH = require("../commands/GEORADIUSBYMEMBER_RO_WITH"); | ||
const GEORADIUSBYMEMBER_RO = require("../commands/GEORADIUSBYMEMBER_RO"); | ||
const GEORADIUSBYMEMBER_WITH = require("../commands/GEORADIUSBYMEMBER_WITH"); | ||
const GEORADIUSBYMEMBER = require("../commands/GEORADIUSBYMEMBER"); | ||
const GEORADIUSBYMEMBERSTORE = require("../commands/GEORADIUSBYMEMBERSTORE"); | ||
const GEORADIUSSTORE = require("../commands/GEORADIUSSTORE"); | ||
const GEOSEARCH_WITH = require("../commands/GEOSEARCH_WITH"); | ||
@@ -66,2 +76,6 @@ const GEOSEARCH = require("../commands/GEOSEARCH"); | ||
const INCRBYFLOAT = require("../commands/INCRBYFLOAT"); | ||
const LCS_IDX_WITHMATCHLEN = require("../commands/LCS_IDX_WITHMATCHLEN"); | ||
const LCS_IDX = require("../commands/LCS_IDX"); | ||
const LCS_LEN = require("../commands/LCS_LEN"); | ||
const LCS = require("../commands/LCS"); | ||
const LINDEX = require("../commands/LINDEX"); | ||
@@ -268,2 +282,22 @@ const LINSERT = require("../commands/LINSERT"); | ||
geoPos: GEOPOS, | ||
GEORADIUS_RO_WITH, | ||
geoRadiusRoWith: GEORADIUS_RO_WITH, | ||
GEORADIUS_RO, | ||
geoRadiusRo: GEORADIUS_RO, | ||
GEORADIUS_WITH, | ||
geoRadiusWith: GEORADIUS_WITH, | ||
GEORADIUS, | ||
geoRadius: GEORADIUS, | ||
GEORADIUSBYMEMBER_RO_WITH, | ||
geoRadiusByMemberRoWith: GEORADIUSBYMEMBER_RO_WITH, | ||
GEORADIUSBYMEMBER_RO, | ||
geoRadiusByMemberRo: GEORADIUSBYMEMBER_RO, | ||
GEORADIUSBYMEMBER_WITH, | ||
geoRadiusByMemberWith: GEORADIUSBYMEMBER_WITH, | ||
GEORADIUSBYMEMBER, | ||
geoRadiusByMember: GEORADIUSBYMEMBER, | ||
GEORADIUSBYMEMBERSTORE, | ||
geoRadiusByMemberStore: GEORADIUSBYMEMBERSTORE, | ||
GEORADIUSSTORE, | ||
geoRadiusStore: GEORADIUSSTORE, | ||
GEOSEARCH_WITH, | ||
@@ -327,2 +361,10 @@ geoSearchWith: GEOSEARCH_WITH, | ||
incrByFloat: INCRBYFLOAT, | ||
LCS_IDX_WITHMATCHLEN, | ||
lcsIdxWithMatchLen: LCS_IDX_WITHMATCHLEN, | ||
LCS_IDX, | ||
lcsIdx: LCS_IDX, | ||
LCS_LEN, | ||
lcsLen: LCS_LEN, | ||
LCS, | ||
lcs: LCS, | ||
LINDEX, | ||
@@ -329,0 +371,0 @@ lIndex: LINDEX, |
@@ -77,3 +77,7 @@ "use strict"; | ||
function transformLegacyCommandArguments(args) { | ||
return args.flat().map(x => x?.toString?.()); | ||
return args.flat().map(arg => { | ||
return typeof arg === 'number' || arg instanceof Date ? | ||
arg.toString() : | ||
arg; | ||
}); | ||
} | ||
@@ -80,0 +84,0 @@ exports.transformLegacyCommandArguments = transformLegacyCommandArguments; |
@@ -71,2 +71,7 @@ import { RedisCommandArgument, RedisCommandArguments } from '.'; | ||
export declare function pushGeoSearchArguments(args: RedisCommandArguments, key: RedisCommandArgument, from: GeoSearchFrom, by: GeoSearchBy, options?: GeoSearchOptions): RedisCommandArguments; | ||
export declare function pushGeoRadiusArguments(args: RedisCommandArguments, key: RedisCommandArgument, from: GeoSearchFrom, radius: number, unit: GeoUnits, options?: GeoSearchOptions): RedisCommandArguments; | ||
export interface GeoRadiusStoreOptions extends GeoSearchOptions { | ||
STOREDIST?: boolean; | ||
} | ||
export declare function pushGeoRadiusStoreArguments(args: RedisCommandArguments, key: RedisCommandArgument, from: GeoSearchFrom, radius: number, unit: GeoUnits, destination: RedisCommandArgument, options?: GeoRadiusStoreOptions): RedisCommandArguments; | ||
export declare enum GeoReplyWith { | ||
@@ -204,2 +209,11 @@ DISTANCE = "WITHDIST", | ||
export declare function pushSlotRangesArguments(args: RedisCommandArguments, ranges: SlotRange | Array<SlotRange>): RedisCommandArguments; | ||
export declare type RawRangeReply = [ | ||
start: number, | ||
end: number | ||
]; | ||
export interface RangeReply { | ||
start: number; | ||
end: number; | ||
} | ||
export declare function transformRangeReply([start, end]: RawRangeReply): RangeReply; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pushSlotRangesArguments = exports.pushSortArguments = exports.transformFunctionListItemReply = exports.RedisFunctionFlags = exports.transformCommandReply = exports.CommandCategories = exports.CommandFlags = exports.pushOptionalVerdictArgument = exports.pushVerdictArgument = exports.pushVerdictNumberArguments = exports.pushVerdictArguments = exports.pushEvalArguments = exports.evalFirstKeyIndex = exports.transformPXAT = exports.transformEXAT = exports.transformGeoMembersWithReply = exports.GeoReplyWith = exports.pushGeoSearchArguments = exports.pushGeoCountArgument = exports.transformLMPopArguments = exports.transformZMPopArguments = exports.transformSortedSetWithScoresReply = exports.transformSortedSetMemberReply = exports.transformSortedSetMemberNullReply = exports.transformStreamsMessagesReply = exports.transformStreamMessagesReply = exports.transformTuplesReply = exports.transformStringNumberInfinityArgument = exports.transformNumberInfinityArgument = exports.transformNumberInfinityNullArrayReply = exports.transformNumberInfinityNullReply = exports.transformNumberInfinityReply = exports.pushScanArguments = exports.transformBooleanArrayReply = exports.transformBooleanReply = void 0; | ||
exports.transformRangeReply = exports.pushSlotRangesArguments = exports.pushSortArguments = exports.transformFunctionListItemReply = exports.RedisFunctionFlags = exports.transformCommandReply = exports.CommandCategories = exports.CommandFlags = exports.pushOptionalVerdictArgument = exports.pushVerdictArgument = exports.pushVerdictNumberArguments = exports.pushVerdictArguments = exports.pushEvalArguments = exports.evalFirstKeyIndex = exports.transformPXAT = exports.transformEXAT = exports.transformGeoMembersWithReply = exports.GeoReplyWith = exports.pushGeoRadiusStoreArguments = exports.pushGeoRadiusArguments = exports.pushGeoSearchArguments = exports.pushGeoCountArgument = exports.transformLMPopArguments = exports.transformZMPopArguments = exports.transformSortedSetWithScoresReply = exports.transformSortedSetMemberReply = exports.transformSortedSetMemberNullReply = exports.transformStreamsMessagesReply = exports.transformStreamMessagesReply = exports.transformTuplesReply = exports.transformStringNumberInfinityArgument = exports.transformNumberInfinityArgument = exports.transformNumberInfinityNullArrayReply = exports.transformNumberInfinityNullReply = exports.transformNumberInfinityReply = exports.pushScanArguments = exports.transformBooleanArrayReply = exports.transformBooleanReply = void 0; | ||
function transformBooleanReply(reply) { | ||
@@ -166,2 +166,29 @@ return reply === 1; | ||
exports.pushGeoSearchArguments = pushGeoSearchArguments; | ||
function pushGeoRadiusArguments(args, key, from, radius, unit, options) { | ||
args.push(key); | ||
if (typeof from === 'string') { | ||
args.push(from); | ||
} | ||
else { | ||
args.push(from.longitude.toString(), from.latitude.toString()); | ||
} | ||
args.push(radius.toString(), unit); | ||
if (options?.SORT) { | ||
args.push(options.SORT); | ||
} | ||
pushGeoCountArgument(args, options?.COUNT); | ||
return args; | ||
} | ||
exports.pushGeoRadiusArguments = pushGeoRadiusArguments; | ||
function pushGeoRadiusStoreArguments(args, key, from, radius, unit, destination, options) { | ||
pushGeoRadiusArguments(args, key, from, radius, unit, options); | ||
if (options?.STOREDIST) { | ||
args.push('STOREDIST', destination); | ||
} | ||
else { | ||
args.push('STORE', destination); | ||
} | ||
return args; | ||
} | ||
exports.pushGeoRadiusStoreArguments = pushGeoRadiusStoreArguments; | ||
var GeoReplyWith; | ||
@@ -370,1 +397,8 @@ (function (GeoReplyWith) { | ||
exports.pushSlotRangesArguments = pushSlotRangesArguments; | ||
function transformRangeReply([start, end]) { | ||
return { | ||
start, | ||
end | ||
}; | ||
} | ||
exports.transformRangeReply = transformRangeReply; |
import { RedisCommandArgument, RedisCommandArguments } from '.'; | ||
import { GeoSearchFrom, GeoSearchBy, GeoSearchOptions } from './generic-transformers'; | ||
export declare const FIRST_KEY_INDEX = 1; | ||
export declare const IS_READ_ONLY = true; | ||
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './GEOSEARCH'; | ||
interface GeoSearchStoreOptions extends GeoSearchOptions { | ||
@@ -10,2 +9,1 @@ STOREDIST?: true; | ||
export declare function transformReply(reply: number): number; | ||
export {}; |
@@ -5,4 +5,5 @@ "use strict"; | ||
const generic_transformers_1 = require("./generic-transformers"); | ||
exports.FIRST_KEY_INDEX = 1; | ||
exports.IS_READ_ONLY = true; | ||
var GEOSEARCH_1 = require("./GEOSEARCH"); | ||
Object.defineProperty(exports, "FIRST_KEY_INDEX", { enumerable: true, get: function () { return GEOSEARCH_1.FIRST_KEY_INDEX; } }); | ||
Object.defineProperty(exports, "IS_READ_ONLY", { enumerable: true, get: function () { return GEOSEARCH_1.IS_READ_ONLY; } }); | ||
function transformArguments(destination, source, from, by, options) { | ||
@@ -9,0 +10,0 @@ const args = (0, generic_transformers_1.pushGeoSearchArguments)(['GEOSEARCHSTORE', destination], source, from, by, options); |
{ | ||
"name": "@redis/client", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
550014
704
12284