Skip to content

Commit 5979274

Browse files
committed
Deprecated messages
1 parent 56b9b7f commit 5979274

File tree

10 files changed

+58
-0
lines changed

10 files changed

+58
-0
lines changed

Sources/Valkey/Commands/ClusterCommands.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ public enum CLUSTER {
479479
}
480480

481481
/// Lists the replica nodes of a master node.
482+
@available(*, deprecated, message: "Since 5.0.0. Replaced by `CLUSTER REPLICAS`.")
482483
public struct SLAVES: RESPCommand {
483484
public typealias Response = [RESPToken]
484485

@@ -494,6 +495,7 @@ public enum CLUSTER {
494495
}
495496

496497
/// Returns the mapping of cluster slots to nodes.
498+
@available(*, deprecated, message: "Since 7.0.0. Replaced by `CLUSTER SHARDS`.")
497499
public struct SLOTS: RESPCommand {
498500
public typealias Response = [RESPToken]
499501

@@ -883,6 +885,7 @@ extension ValkeyConnection {
883885
/// - Categories: @admin, @slow, @dangerous
884886
/// - Returns: [Array](https:/valkey.io/topics/protocol/#arrays): a list of replica nodes replicating from the specified primary node provided in the same format used by `CLUSTER NODES`.
885887
@inlinable
888+
@available(*, deprecated, message: "Since 5.0.0. Replaced by `CLUSTER REPLICAS`.")
886889
public func clusterSlaves(nodeId: String) async throws -> [RESPToken] {
887890
try await send(command: CLUSTER.SLAVES(nodeId: nodeId))
888891
}
@@ -895,6 +898,7 @@ extension ValkeyConnection {
895898
/// - Categories: @slow
896899
/// - Returns: [Array](https:/valkey.io/topics/protocol/#arrays): nested list of slot ranges with networking information.
897900
@inlinable
901+
@available(*, deprecated, message: "Since 7.0.0. Replaced by `CLUSTER SHARDS`.")
898902
public func clusterSlots() async throws -> [RESPToken] {
899903
try await send(command: CLUSTER.SLOTS())
900904
}

Sources/Valkey/Commands/ConnectionCommands.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ public struct PING: RESPCommand {
578578
}
579579

580580
/// Closes the connection.
581+
@available(*, deprecated, message: "Since 7.2.0. Replaced by just closing the connection.")
581582
public struct QUIT: RESPCommand {
582583
public typealias Response = RESPToken
583584

@@ -904,6 +905,7 @@ extension ValkeyConnection {
904905
/// - Categories: @fast, @connection
905906
/// - Returns: [Simple string](https:/valkey.io/topics/protocol/#simple-strings): `OK`.
906907
@inlinable
908+
@available(*, deprecated, message: "Since 7.2.0. Replaced by just closing the connection.")
907909
public func quit() async throws -> RESPToken {
908910
try await send(command: QUIT())
909911
}

Sources/Valkey/Commands/GeoCommands.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public struct GEOPOS: RESPCommand {
148148
}
149149

150150
/// Queries a geospatial index for members within a distance from a coordinate, optionally stores the result.
151+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `GEOSEARCH` and `GEOSEARCHSTORE` with the `BYRADIUS` argument.")
151152
public struct GEORADIUS: RESPCommand {
152153
public enum Unit: RESPRenderable, Sendable {
153154
case m
@@ -241,6 +242,7 @@ public struct GEORADIUS: RESPCommand {
241242
}
242243

243244
/// Queries a geospatial index for members within a distance from a member, optionally stores the result.
245+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `GEOSEARCH` and `GEOSEARCHSTORE` with the `BYRADIUS` and `FROMMEMBER` arguments.")
244246
public struct GEORADIUSBYMEMBER: RESPCommand {
245247
public enum Unit: RESPRenderable, Sendable {
246248
case m
@@ -332,6 +334,7 @@ public struct GEORADIUSBYMEMBER: RESPCommand {
332334
}
333335

334336
/// Returns members from a geospatial index that are within a distance from a member.
337+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `GEOSEARCH` with the `BYRADIUS` and `FROMMEMBER` arguments.")
335338
public struct GEORADIUSBYMEMBERRO: RESPCommand {
336339
public enum Unit: RESPRenderable, Sendable {
337340
case m
@@ -409,6 +412,7 @@ public struct GEORADIUSBYMEMBERRO: RESPCommand {
409412
}
410413

411414
/// Returns members from a geospatial index that are within a distance from a coordinate.
415+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `GEOSEARCH` with the `BYRADIUS` argument.")
412416
public struct GEORADIUSRO: RESPCommand {
413417
public enum Unit: RESPRenderable, Sendable {
414418
case m
@@ -898,6 +902,7 @@ extension ValkeyConnection {
898902
///
899903
/// `["Palermo","190.4424",["13.361389338970184","38.115556395496299"]]`
900904
@inlinable
905+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `GEOSEARCH` and `GEOSEARCHSTORE` with the `BYRADIUS` argument.")
901906
public func georadius(key: RESPKey, longitude: Double, latitude: Double, radius: Double, unit: GEORADIUS.Unit, withcoord: Bool = false, withdist: Bool = false, withhash: Bool = false, countBlock: GEORADIUS.CountBlock? = nil, order: GEORADIUS.Order? = nil, store: GEORADIUS.Store? = nil) async throws -> RESPToken {
902907
try await send(command: GEORADIUS(key: key, longitude: longitude, latitude: latitude, radius: radius, unit: unit, withcoord: withcoord, withdist: withdist, withhash: withhash, countBlock: countBlock, order: order, store: store))
903908
}
@@ -915,6 +920,7 @@ extension ValkeyConnection {
915920
/// * The Geohash integer.
916921
/// * The coordinates as a two items x,y array (longitude,latitude).
917922
@inlinable
923+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `GEOSEARCH` and `GEOSEARCHSTORE` with the `BYRADIUS` and `FROMMEMBER` arguments.")
918924
public func georadiusbymember(key: RESPKey, member: String, radius: Double, unit: GEORADIUSBYMEMBER.Unit, withcoord: Bool = false, withdist: Bool = false, withhash: Bool = false, countBlock: GEORADIUSBYMEMBER.CountBlock? = nil, order: GEORADIUSBYMEMBER.Order? = nil, store: GEORADIUSBYMEMBER.Store? = nil) async throws -> RESPToken {
919925
try await send(command: GEORADIUSBYMEMBER(key: key, member: member, radius: radius, unit: unit, withcoord: withcoord, withdist: withdist, withhash: withhash, countBlock: countBlock, order: order, store: store))
920926
}
@@ -932,6 +938,7 @@ extension ValkeyConnection {
932938
/// * The Geohash integer.
933939
/// * The coordinates as a two items x,y array (longitude,latitude).
934940
@inlinable
941+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `GEOSEARCH` with the `BYRADIUS` and `FROMMEMBER` arguments.")
935942
public func georadiusbymemberRo(key: RESPKey, member: String, radius: Double, unit: GEORADIUSBYMEMBERRO.Unit, withcoord: Bool = false, withdist: Bool = false, withhash: Bool = false, countBlock: GEORADIUSBYMEMBERRO.CountBlock? = nil, order: GEORADIUSBYMEMBERRO.Order? = nil) async throws -> RESPToken {
936943
try await send(command: GEORADIUSBYMEMBERRO(key: key, member: member, radius: radius, unit: unit, withcoord: withcoord, withdist: withdist, withhash: withhash, countBlock: countBlock, order: order))
937944
}
@@ -949,6 +956,7 @@ extension ValkeyConnection {
949956
/// * The Geohash integer.
950957
/// * The coordinates as a two items x,y array (longitude,latitude).
951958
@inlinable
959+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `GEOSEARCH` with the `BYRADIUS` argument.")
952960
public func georadiusRo(key: RESPKey, longitude: Double, latitude: Double, radius: Double, unit: GEORADIUSRO.Unit, withcoord: Bool = false, withdist: Bool = false, withhash: Bool = false, countBlock: GEORADIUSRO.CountBlock? = nil, order: GEORADIUSRO.Order? = nil) async throws -> RESPToken {
953961
try await send(command: GEORADIUSRO(key: key, longitude: longitude, latitude: latitude, radius: radius, unit: unit, withcoord: withcoord, withdist: withdist, withhash: withhash, countBlock: countBlock, order: order))
954962
}

Sources/Valkey/Commands/HashCommands.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public struct HMGET: RESPCommand {
174174
}
175175

176176
/// Sets the values of multiple fields.
177+
@available(*, deprecated, message: "Since 4.0.0. Replaced by `HSET` with multiple field-value pairs.")
177178
public struct HMSET: RESPCommand {
178179
public struct Data: RESPRenderable, Sendable {
179180
@usableFromInline let field: String
@@ -472,6 +473,7 @@ extension ValkeyConnection {
472473
/// - Categories: @write, @hash, @fast
473474
/// - Returns: [Simple string](https:/valkey.io/topics/protocol/#simple-strings): `OK`.
474475
@inlinable
476+
@available(*, deprecated, message: "Since 4.0.0. Replaced by `HSET` with multiple field-value pairs.")
475477
public func hmset(key: RESPKey, data: [HMSET.Data]) async throws -> RESPToken {
476478
try await send(command: HMSET(key: key, data: data))
477479
}

Sources/Valkey/Commands/ListCommands.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public struct BRPOP: RESPCommand {
137137
}
138138

139139
/// Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped.
140+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `BLMOVE` with the `RIGHT` and `LEFT` arguments.")
140141
public struct BRPOPLPUSH: RESPCommand {
141142
public typealias Response = String?
142143

@@ -464,6 +465,7 @@ public struct RPOP: RESPCommand {
464465
}
465466

466467
/// Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped.
468+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `LMOVE` with the `RIGHT` and `LEFT` arguments.")
467469
public struct RPOPLPUSH: RESPCommand {
468470
public typealias Response = String?
469471

@@ -582,6 +584,7 @@ extension ValkeyConnection {
582584
/// * [Bulk string](https:/valkey.io/topics/protocol/#bulk-strings): the element being popped from _source_ and pushed to _destination_.
583585
/// * [Null](https:/valkey.io/topics/protocol/#nulls): the timeout is reached.
584586
@inlinable
587+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `BLMOVE` with the `RIGHT` and `LEFT` arguments.")
585588
public func brpoplpush(source: RESPKey, destination: RESPKey, timeout: Double) async throws -> String? {
586589
try await send(command: BRPOPLPUSH(source: source, destination: destination, timeout: timeout))
587590
}
@@ -780,6 +783,7 @@ extension ValkeyConnection {
780783
/// * [Bulk string](https:/valkey.io/topics/protocol/#bulk-strings): the element being popped and pushed.
781784
/// * [Null](https:/valkey.io/topics/protocol/#nulls): if the source list is empty.
782785
@inlinable
786+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `LMOVE` with the `RIGHT` and `LEFT` arguments.")
783787
public func rpoplpush(source: RESPKey, destination: RESPKey) async throws -> String? {
784788
try await send(command: RPOPLPUSH(source: source, destination: destination))
785789
}

Sources/Valkey/Commands/ServerCommands.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,7 @@ public struct SHUTDOWN: RESPCommand {
11701170
}
11711171

11721172
/// Sets a Valkey server as a replica of another, or promotes it to being a master.
1173+
@available(*, deprecated, message: "Since 5.0.0. Replaced by `REPLICAOF`.")
11731174
public struct SLAVEOF: RESPCommand {
11741175
public struct ArgsHostPort: RESPRenderable, Sendable {
11751176
@usableFromInline let host: String
@@ -2038,6 +2039,7 @@ extension ValkeyConnection {
20382039
/// - Categories: @admin, @slow, @dangerous
20392040
/// - Returns: [Simple string](https:/valkey.io/topics/protocol/#simple-strings): `OK`.
20402041
@inlinable
2042+
@available(*, deprecated, message: "Since 5.0.0. Replaced by `REPLICAOF`.")
20412043
public func slaveof(args: SLAVEOF.Args) async throws -> RESPToken {
20422044
try await send(command: SLAVEOF(args: args))
20432045
}

Sources/Valkey/Commands/SortedSetCommands.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ public struct ZRANGE: RESPCommand {
524524
}
525525

526526
/// Returns members in a sorted set within a lexicographical range.
527+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `BYLEX` argument.")
527528
public struct ZRANGEBYLEX: RESPCommand {
528529
public struct Limit: RESPRenderable, Sendable {
529530
@usableFromInline let offset: Int
@@ -563,6 +564,7 @@ public struct ZRANGEBYLEX: RESPCommand {
563564
}
564565

565566
/// Returns members in a sorted set within a range of scores.
567+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `BYSCORE` argument.")
566568
public struct ZRANGEBYSCORE: RESPCommand {
567569
public struct Limit: RESPRenderable, Sendable {
568570
@usableFromInline let offset: Int
@@ -754,6 +756,7 @@ public struct ZREMRANGEBYSCORE: RESPCommand {
754756
}
755757

756758
/// Returns members in a sorted set within a range of indexes in reverse order.
759+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `REV` argument.")
757760
public struct ZREVRANGE: RESPCommand {
758761
public typealias Response = [RESPToken]
759762

@@ -775,6 +778,7 @@ public struct ZREVRANGE: RESPCommand {
775778
}
776779

777780
/// Returns members in a sorted set within a lexicographical range in reverse order.
781+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `REV` and `BYLEX` arguments.")
778782
public struct ZREVRANGEBYLEX: RESPCommand {
779783
public struct Limit: RESPRenderable, Sendable {
780784
@usableFromInline let offset: Int
@@ -814,6 +818,7 @@ public struct ZREVRANGEBYLEX: RESPCommand {
814818
}
815819

816820
/// Returns members in a sorted set within a range of scores in reverse order.
821+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `REV` and `BYSCORE` arguments.")
817822
public struct ZREVRANGEBYSCORE: RESPCommand {
818823
public struct Limit: RESPRenderable, Sendable {
819824
@usableFromInline let offset: Int
@@ -1234,6 +1239,7 @@ extension ValkeyConnection {
12341239
/// - Categories: @read, @sortedset, @slow
12351240
/// - Returns: [Array](https:/valkey.io/topics/protocol/#arrays): a list of elements in the specified score range.
12361241
@inlinable
1242+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `BYLEX` argument.")
12371243
public func zrangebylex(key: RESPKey, min: String, max: String, limit: ZRANGEBYLEX.Limit? = nil) async throws -> [RESPToken] {
12381244
try await send(command: ZRANGEBYLEX(key: key, min: min, max: max, limit: limit))
12391245
}
@@ -1246,6 +1252,7 @@ extension ValkeyConnection {
12461252
/// - Categories: @read, @sortedset, @slow
12471253
/// - Returns: * [Array](https:/valkey.io/topics/protocol/#arrays): a list of the members with, optionally, their scores in the specified score range.
12481254
@inlinable
1255+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `BYSCORE` argument.")
12491256
public func zrangebyscore(key: RESPKey, min: Double, max: Double, withscores: Bool = false, limit: ZRANGEBYSCORE.Limit? = nil) async throws -> [RESPToken] {
12501257
try await send(command: ZRANGEBYSCORE(key: key, min: min, max: max, withscores: withscores, limit: limit))
12511258
}
@@ -1333,6 +1340,7 @@ extension ValkeyConnection {
13331340
/// - Categories: @read, @sortedset, @slow
13341341
/// - Returns: * [Array](https:/valkey.io/topics/protocol/#arrays): a list of the members in the specified range, optionally with their scores if _WITHSCORE_ was used.
13351342
@inlinable
1343+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `REV` argument.")
13361344
public func zrevrange(key: RESPKey, start: Int, stop: Int, withscores: Bool = false) async throws -> [RESPToken] {
13371345
try await send(command: ZREVRANGE(key: key, start: start, stop: stop, withscores: withscores))
13381346
}
@@ -1345,6 +1353,7 @@ extension ValkeyConnection {
13451353
/// - Categories: @read, @sortedset, @slow
13461354
/// - Returns: [Array](https:/valkey.io/topics/protocol/#arrays): a list of the members in the specified score range.
13471355
@inlinable
1356+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `REV` and `BYLEX` arguments.")
13481357
public func zrevrangebylex(key: RESPKey, max: String, min: String, limit: ZREVRANGEBYLEX.Limit? = nil) async throws -> [RESPToken] {
13491358
try await send(command: ZREVRANGEBYLEX(key: key, max: max, min: min, limit: limit))
13501359
}
@@ -1357,6 +1366,7 @@ extension ValkeyConnection {
13571366
/// - Categories: @read, @sortedset, @slow
13581367
/// - Returns: * [Array](https:/valkey.io/topics/protocol/#arrays): a list of the members and, optionally, their scores in the specified score range.
13591368
@inlinable
1369+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `ZRANGE` with the `REV` and `BYSCORE` arguments.")
13601370
public func zrevrangebyscore(key: RESPKey, max: Double, min: Double, withscores: Bool = false, limit: ZREVRANGEBYSCORE.Limit? = nil) async throws -> [RESPToken] {
13611371
try await send(command: ZREVRANGEBYSCORE(key: key, max: max, min: min, withscores: withscores, limit: limit))
13621372
}

Sources/Valkey/Commands/StringCommands.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public struct GETRANGE: RESPCommand {
156156
}
157157

158158
/// Returns the previous string value of a key after setting it to a new value.
159+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `SET` with the `!GET` argument.")
159160
public struct GETSET: RESPCommand {
160161
public typealias Response = String?
161162

@@ -328,6 +329,7 @@ public struct MSETNX: RESPCommand {
328329
}
329330

330331
/// Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn't exist.
332+
@available(*, deprecated, message: "Since 2.6.12. Replaced by `SET` with the `PX` argument.")
331333
public struct PSETEX: RESPCommand {
332334
public typealias Response = RESPToken
333335

@@ -400,6 +402,7 @@ public struct SET: RESPCommand {
400402
}
401403

402404
/// Sets the string value and expiration time of a key. Creates the key if it doesn't exist.
405+
@available(*, deprecated, message: "Since 2.6.12. Replaced by `SET` with the `EX` argument.")
403406
public struct SETEX: RESPCommand {
404407
public typealias Response = RESPToken
405408

@@ -419,6 +422,7 @@ public struct SETEX: RESPCommand {
419422
}
420423

421424
/// Set the string value of a key only when the key doesn't exist.
425+
@available(*, deprecated, message: "Since 2.6.12. Replaced by `SET` with the `NX` argument.")
422426
public struct SETNX: RESPCommand {
423427
public typealias Response = Int
424428

@@ -470,6 +474,7 @@ public struct STRLEN: RESPCommand {
470474
}
471475

472476
/// Returns a substring from a string value.
477+
@available(*, deprecated, message: "Since 2.0.0. Replaced by `GETRANGE`.")
473478
public struct SUBSTR: RESPCommand {
474479
public typealias Response = String
475480

@@ -589,6 +594,7 @@ extension ValkeyConnection {
589594
/// * [Bulk string](https:/valkey.io/topics/protocol/#bulk-strings): the old value stored at the key.
590595
/// * [Null](https:/valkey.io/topics/protocol/#nulls): if the key does not exist.
591596
@inlinable
597+
@available(*, deprecated, message: "Since 6.2.0. Replaced by `SET` with the `!GET` argument.")
592598
public func getset(key: RESPKey, value: String) async throws -> String? {
593599
try await send(command: GETSET(key: key, value: value))
594600
}
@@ -690,6 +696,7 @@ extension ValkeyConnection {
690696
/// - Categories: @write, @string, @slow
691697
/// - Returns: [Simple string](https:/valkey.io/topics/protocol/#simple-strings): `OK`.
692698
@inlinable
699+
@available(*, deprecated, message: "Since 2.6.12. Replaced by `SET` with the `PX` argument.")
693700
public func psetex(key: RESPKey, milliseconds: Int, value: String) async throws -> RESPToken {
694701
try await send(command: PSETEX(key: key, milliseconds: milliseconds, value: value))
695702
}
@@ -723,6 +730,7 @@ extension ValkeyConnection {
723730
/// - Categories: @write, @string, @slow
724731
/// - Returns: [Simple string](https:/valkey.io/topics/protocol/#simple-strings): `OK`.
725732
@inlinable
733+
@available(*, deprecated, message: "Since 2.6.12. Replaced by `SET` with the `EX` argument.")
726734
public func setex(key: RESPKey, seconds: Int, value: String) async throws -> RESPToken {
727735
try await send(command: SETEX(key: key, seconds: seconds, value: value))
728736
}
@@ -737,6 +745,7 @@ extension ValkeyConnection {
737745
/// * [Integer](https:/valkey.io/topics/protocol/#integers): `0` if the key was not set.
738746
/// * [Integer](https:/valkey.io/topics/protocol/#integers): `1` if the key was set.
739747
@inlinable
748+
@available(*, deprecated, message: "Since 2.6.12. Replaced by `SET` with the `NX` argument.")
740749
public func setnx(key: RESPKey, value: String) async throws -> Int {
741750
try await send(command: SETNX(key: key, value: value))
742751
}
@@ -773,6 +782,7 @@ extension ValkeyConnection {
773782
/// - Categories: @read, @string, @slow
774783
/// - Returns: [Bulk string](https:/valkey.io/topics/protocol/#bulk-strings): the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).
775784
@inlinable
785+
@available(*, deprecated, message: "Since 2.0.0. Replaced by `GETRANGE`.")
776786
public func substr(key: RESPKey, start: Int, end: Int) async throws -> String {
777787
try await send(command: SUBSTR(key: key, start: start, end: end))
778788
}

0 commit comments

Comments
 (0)