|
8 | 8 | import Foundation |
9 | 9 | import Helpers |
10 | 10 |
|
11 | | -@available(*, deprecated, renamed: "RealtimeMessage") |
12 | | -public typealias Message = RealtimeMessage |
13 | | - |
14 | | -extension RealtimeClientV2 { |
15 | | - @available(*, deprecated, renamed: "channels") |
16 | | - public var subscriptions: [String: RealtimeChannelV2] { |
17 | | - channels |
18 | | - } |
19 | | - |
20 | | - @available(*, deprecated, renamed: "RealtimeClientOptions") |
21 | | - public struct Configuration: Sendable { |
22 | | - var url: URL |
23 | | - var apiKey: String |
24 | | - var headers: [String: String] |
25 | | - var heartbeatInterval: TimeInterval |
26 | | - var reconnectDelay: TimeInterval |
27 | | - var timeoutInterval: TimeInterval |
28 | | - var disconnectOnSessionLoss: Bool |
29 | | - var connectOnSubscribe: Bool |
30 | | - var logger: (any SupabaseLogger)? |
| 11 | +@available(*, deprecated, renamed: "RealtimeClient") |
| 12 | +public typealias RealtimeClientV2 = RealtimeClient |
31 | 13 |
|
32 | | - public init( |
33 | | - url: URL, |
34 | | - apiKey: String, |
35 | | - headers: [String: String] = [:], |
36 | | - heartbeatInterval: TimeInterval = 15, |
37 | | - reconnectDelay: TimeInterval = 7, |
38 | | - timeoutInterval: TimeInterval = 10, |
39 | | - disconnectOnSessionLoss: Bool = true, |
40 | | - connectOnSubscribe: Bool = true, |
41 | | - logger: (any SupabaseLogger)? = nil |
42 | | - ) { |
43 | | - self.url = url |
44 | | - self.apiKey = apiKey |
45 | | - self.headers = headers |
46 | | - self.heartbeatInterval = heartbeatInterval |
47 | | - self.reconnectDelay = reconnectDelay |
48 | | - self.timeoutInterval = timeoutInterval |
49 | | - self.disconnectOnSessionLoss = disconnectOnSessionLoss |
50 | | - self.connectOnSubscribe = connectOnSubscribe |
51 | | - self.logger = logger |
52 | | - } |
53 | | - } |
| 14 | +@available(*, deprecated, renamed: "RealtimeChannel") |
| 15 | +public typealias RealtimeChannelV2 = RealtimeChannel |
54 | 16 |
|
55 | | - @available(*, deprecated, renamed: "RealtimeClientStatus") |
56 | | - public typealias Status = RealtimeClientStatus |
57 | | - |
58 | | - @available(*, deprecated, renamed: "RealtimeClientV2.init(url:options:)") |
59 | | - public convenience init(config: Configuration) { |
60 | | - self.init( |
61 | | - url: config.url, |
62 | | - options: RealtimeClientOptions( |
63 | | - headers: config.headers, |
64 | | - heartbeatInterval: config.heartbeatInterval, |
65 | | - reconnectDelay: config.reconnectDelay, |
66 | | - timeoutInterval: config.timeoutInterval, |
67 | | - disconnectOnSessionLoss: config.disconnectOnSessionLoss, |
68 | | - connectOnSubscribe: config.connectOnSubscribe, |
69 | | - logger: config.logger |
70 | | - ) |
71 | | - ) |
72 | | - } |
73 | | -} |
74 | | - |
75 | | -extension RealtimeChannelV2 { |
76 | | - @available(*, deprecated, renamed: "RealtimeSubscription") |
77 | | - public typealias Subscription = ObservationToken |
| 17 | +@available(*, deprecated, renamed: "RealtimeMessage") |
| 18 | +public typealias RealtimeMessageV2 = RealtimeMessage |
78 | 19 |
|
79 | | - @available(*, deprecated, renamed: "RealtimeChannelStatus") |
80 | | - public typealias Status = RealtimeChannelStatus |
81 | | -} |
| 20 | +@available(*, deprecated, renamed: "Presence") |
| 21 | +public typealias PresenceV2 = Presence |
0 commit comments