@casual-simulation/aux-common 3.2.6 → 3.2.7-alpha.6227012901

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 (212) hide show
  1. package/Errors.d.ts +29 -0
  2. package/Errors.js +2 -0
  3. package/Errors.js.map +1 -0
  4. package/{aux-format-2 → bots}/AuxStateHelpers.d.ts +2 -33
  5. package/{aux-format-2 → bots}/AuxStateHelpers.js +1 -116
  6. package/bots/AuxStateHelpers.js.map +1 -0
  7. package/bots/Bot.d.ts +1 -1
  8. package/bots/BotCalculations.d.ts +4 -1
  9. package/bots/BotCalculations.js +62 -0
  10. package/bots/BotCalculations.js.map +1 -1
  11. package/bots/BotEvents.d.ts +859 -3401
  12. package/bots/BotEvents.js +133 -1529
  13. package/bots/BotEvents.js.map +1 -1
  14. package/bots/StateUpdatedEvent.d.ts +1 -1
  15. package/bots/StateUpdatedEvent.js +1 -1
  16. package/bots/StateUpdatedEvent.js.map +1 -1
  17. package/bots/index.d.ts +1 -0
  18. package/bots/index.js +1 -0
  19. package/bots/index.js.map +1 -1
  20. package/common/Action.d.ts +17 -0
  21. package/common/Action.js +2 -0
  22. package/common/Action.js.map +1 -0
  23. package/common/ConnectionIndicator.d.ts +29 -0
  24. package/common/ConnectionIndicator.js +23 -0
  25. package/common/ConnectionIndicator.js.map +1 -0
  26. package/common/ConnectionInfo.d.ts +30 -0
  27. package/common/ConnectionInfo.js +14 -0
  28. package/common/ConnectionInfo.js.map +1 -0
  29. package/common/ConnectionToken.d.ts +37 -0
  30. package/common/ConnectionToken.js +93 -0
  31. package/common/ConnectionToken.js.map +1 -0
  32. package/common/CurrentVersion.d.ts +26 -0
  33. package/common/CurrentVersion.js +2 -0
  34. package/common/CurrentVersion.js.map +1 -0
  35. package/common/Iterators.d.ts +19 -0
  36. package/common/Iterators.js +39 -0
  37. package/common/Iterators.js.map +1 -0
  38. package/common/LoadingProgress.d.ts +26 -0
  39. package/common/LoadingProgress.js +2 -0
  40. package/common/LoadingProgress.js.map +1 -0
  41. package/common/RemoteActions.d.ts +558 -0
  42. package/common/RemoteActions.js +128 -0
  43. package/common/RemoteActions.js.map +1 -0
  44. package/common/StatusUpdate.d.ts +108 -0
  45. package/common/StatusUpdate.js +2 -0
  46. package/common/StatusUpdate.js.map +1 -0
  47. package/common/StatusUpdateUtils.d.ts +3 -0
  48. package/common/StatusUpdateUtils.js +11 -0
  49. package/common/StatusUpdateUtils.js.map +1 -0
  50. package/common/index.d.ts +11 -0
  51. package/common/index.js +11 -0
  52. package/common/index.js.map +1 -0
  53. package/index.d.ts +4 -1
  54. package/index.js +4 -1
  55. package/index.js.map +1 -1
  56. package/package.json +3 -4
  57. package/partitions/AuxPartition.d.ts +1 -11
  58. package/partitions/AuxPartition.js.map +1 -1
  59. package/partitions/AuxPartitionConfig.d.ts +39 -123
  60. package/partitions/MemoryPartition.d.ts +2 -2
  61. package/partitions/MemoryPartition.js +2 -2
  62. package/partitions/MemoryPartition.js.map +1 -1
  63. package/partitions/OtherPlayersPartition.d.ts +6 -7
  64. package/partitions/OtherPlayersPartition.js +40 -54
  65. package/partitions/OtherPlayersPartition.js.map +1 -1
  66. package/partitions/PartitionUtils.d.ts +28 -1
  67. package/partitions/PartitionUtils.js +174 -1
  68. package/partitions/PartitionUtils.js.map +1 -1
  69. package/partitions/ProxyBridgePartition.d.ts +1 -3
  70. package/partitions/ProxyBridgePartition.js +0 -14
  71. package/partitions/ProxyBridgePartition.js.map +1 -1
  72. package/partitions/RemoteYjsPartition.d.ts +7 -6
  73. package/partitions/RemoteYjsPartition.js +55 -75
  74. package/partitions/RemoteYjsPartition.js.map +1 -1
  75. package/partitions/YjsPartition.d.ts +1 -2
  76. package/partitions/YjsPartition.js +3 -6
  77. package/partitions/YjsPartition.js.map +1 -1
  78. package/partitions/index.d.ts +1 -7
  79. package/partitions/index.js +1 -7
  80. package/partitions/index.js.map +1 -1
  81. package/test/FuzzingHelpers.d.ts +1 -1
  82. package/test/FuzzingHelpers.js +1 -1
  83. package/test/FuzzingHelpers.js.map +1 -1
  84. package/test/TestHelpers.d.ts +8 -0
  85. package/test/TestHelpers.js +23 -0
  86. package/test/TestHelpers.js.map +1 -1
  87. package/utils.d.ts +10 -5
  88. package/utils.js +19 -7
  89. package/utils.js.map +1 -1
  90. package/websockets/AuthenticatedConnectionClient.d.ts +26 -0
  91. package/websockets/AuthenticatedConnectionClient.js +61 -0
  92. package/websockets/AuthenticatedConnectionClient.js.map +1 -0
  93. package/websockets/ConnectionClient.d.ts +59 -0
  94. package/websockets/ConnectionClient.js +2 -0
  95. package/websockets/ConnectionClient.js.map +1 -0
  96. package/websockets/InstRecordsClient.d.ts +118 -0
  97. package/websockets/InstRecordsClient.js +387 -0
  98. package/websockets/InstRecordsClient.js.map +1 -0
  99. package/websockets/InstRecordsClientTimeSyncConnection.d.ts +13 -0
  100. package/websockets/InstRecordsClientTimeSyncConnection.js +16 -0
  101. package/websockets/InstRecordsClientTimeSyncConnection.js.map +1 -0
  102. package/websockets/MemoryConnectionClient.d.ts +19 -0
  103. package/websockets/MemoryConnectionClient.js +41 -0
  104. package/websockets/MemoryConnectionClient.js.map +1 -0
  105. package/websockets/WebsocketEvents.d.ts +2670 -0
  106. package/websockets/WebsocketEvents.js +189 -0
  107. package/websockets/WebsocketEvents.js.map +1 -0
  108. package/websockets/index.d.ts +7 -0
  109. package/websockets/index.js +7 -0
  110. package/websockets/index.js.map +1 -0
  111. package/yjs/YjsHelpers.d.ts +1 -1
  112. package/LoadingProgress.d.ts +0 -54
  113. package/LoadingProgress.js +0 -105
  114. package/LoadingProgress.js.map +0 -1
  115. package/aux-format-2/AuxCausalTree2.d.ts +0 -98
  116. package/aux-format-2/AuxCausalTree2.js +0 -616
  117. package/aux-format-2/AuxCausalTree2.js.map +0 -1
  118. package/aux-format-2/AuxOpTypes.d.ts +0 -268
  119. package/aux-format-2/AuxOpTypes.js +0 -240
  120. package/aux-format-2/AuxOpTypes.js.map +0 -1
  121. package/aux-format-2/AuxStateHelpers.js.map +0 -1
  122. package/aux-format-2/AuxWeaveHelpers.d.ts +0 -132
  123. package/aux-format-2/AuxWeaveHelpers.js +0 -335
  124. package/aux-format-2/AuxWeaveHelpers.js.map +0 -1
  125. package/aux-format-2/AuxWeaveReducer.d.ts +0 -37
  126. package/aux-format-2/AuxWeaveReducer.js +0 -980
  127. package/aux-format-2/AuxWeaveReducer.js.map +0 -1
  128. package/aux-format-2/index.d.ts +0 -7
  129. package/aux-format-2/index.js +0 -7
  130. package/aux-format-2/index.js.map +0 -1
  131. package/partitions/AuxPartitionRealtimeEditModeProvider.d.ts +0 -9
  132. package/partitions/AuxPartitionRealtimeEditModeProvider.js +0 -21
  133. package/partitions/AuxPartitionRealtimeEditModeProvider.js.map +0 -1
  134. package/partitions/BotClient.d.ts +0 -24
  135. package/partitions/BotClient.js +0 -2
  136. package/partitions/BotClient.js.map +0 -1
  137. package/partitions/BotPartition.d.ts +0 -45
  138. package/partitions/BotPartition.js +0 -186
  139. package/partitions/BotPartition.js.map +0 -1
  140. package/partitions/CausalRepoPartition.d.ts +0 -45
  141. package/partitions/CausalRepoPartition.js +0 -157
  142. package/partitions/CausalRepoPartition.js.map +0 -1
  143. package/partitions/MemoryBotClient.d.ts +0 -11
  144. package/partitions/MemoryBotClient.js +0 -41
  145. package/partitions/MemoryBotClient.js.map +0 -1
  146. package/partitions/RemoteCausalRepoHistoryPartition.d.ts +0 -53
  147. package/partitions/RemoteCausalRepoHistoryPartition.js +0 -206
  148. package/partitions/RemoteCausalRepoHistoryPartition.js.map +0 -1
  149. package/partitions/RemoteCausalRepoPartition.d.ts +0 -72
  150. package/partitions/RemoteCausalRepoPartition.js +0 -468
  151. package/partitions/RemoteCausalRepoPartition.js.map +0 -1
  152. package/runtime/AuxCompiler.d.ts +0 -258
  153. package/runtime/AuxCompiler.js +0 -722
  154. package/runtime/AuxCompiler.js.map +0 -1
  155. package/runtime/AuxDevice.d.ts +0 -28
  156. package/runtime/AuxDevice.js +0 -2
  157. package/runtime/AuxDevice.js.map +0 -1
  158. package/runtime/AuxGlobalContext.d.ts +0 -571
  159. package/runtime/AuxGlobalContext.js +0 -606
  160. package/runtime/AuxGlobalContext.js.map +0 -1
  161. package/runtime/AuxLibrary.d.ts +0 -2702
  162. package/runtime/AuxLibrary.js +0 -11046
  163. package/runtime/AuxLibrary.js.map +0 -1
  164. package/runtime/AuxLibraryDefinitions.def +0 -13139
  165. package/runtime/AuxRealtimeEditModeProvider.d.ts +0 -35
  166. package/runtime/AuxRealtimeEditModeProvider.js +0 -34
  167. package/runtime/AuxRealtimeEditModeProvider.js.map +0 -1
  168. package/runtime/AuxResults.d.ts +0 -77
  169. package/runtime/AuxResults.js +0 -6
  170. package/runtime/AuxResults.js.map +0 -1
  171. package/runtime/AuxRuntime.d.ts +0 -253
  172. package/runtime/AuxRuntime.js +0 -2700
  173. package/runtime/AuxRuntime.js.map +0 -1
  174. package/runtime/AuxRuntimeDynamicImports.d.ts +0 -14
  175. package/runtime/AuxRuntimeDynamicImports.js +0 -24
  176. package/runtime/AuxRuntimeDynamicImports.js.map +0 -1
  177. package/runtime/AuxVersion.d.ts +0 -39
  178. package/runtime/AuxVersion.js +0 -2
  179. package/runtime/AuxVersion.js.map +0 -1
  180. package/runtime/CasualOSError.d.ts +0 -37
  181. package/runtime/CasualOSError.js +0 -25
  182. package/runtime/CasualOSError.js.map +0 -1
  183. package/runtime/CompiledBot.d.ts +0 -106
  184. package/runtime/CompiledBot.js +0 -44
  185. package/runtime/CompiledBot.js.map +0 -1
  186. package/runtime/PerformanceNowPolyfill.d.ts +0 -1
  187. package/runtime/PerformanceNowPolyfill.js +0 -8
  188. package/runtime/PerformanceNowPolyfill.js.map +0 -1
  189. package/runtime/RuntimeBot.d.ts +0 -176
  190. package/runtime/RuntimeBot.js +0 -732
  191. package/runtime/RuntimeBot.js.map +0 -1
  192. package/runtime/RuntimeStateVersion.d.ts +0 -23
  193. package/runtime/RuntimeStateVersion.js +0 -22
  194. package/runtime/RuntimeStateVersion.js.map +0 -1
  195. package/runtime/Transpiler.d.ts +0 -174
  196. package/runtime/Transpiler.js +0 -611
  197. package/runtime/Transpiler.js.map +0 -1
  198. package/runtime/Utils.d.ts +0 -74
  199. package/runtime/Utils.js +0 -488
  200. package/runtime/Utils.js.map +0 -1
  201. package/runtime/index.d.ts +0 -9
  202. package/runtime/index.js +0 -9
  203. package/runtime/index.js.map +0 -1
  204. package/runtime/test/RuntimeTestHelpers.d.ts +0 -11
  205. package/runtime/test/RuntimeTestHelpers.js +0 -26
  206. package/runtime/test/RuntimeTestHelpers.js.map +0 -1
  207. package/runtime/test/TestScriptBotFactory.d.ts +0 -16
  208. package/runtime/test/TestScriptBotFactory.js +0 -107
  209. package/runtime/test/TestScriptBotFactory.js.map +0 -1
  210. /package/{runtime/BlobPolyfill.d.ts → BlobPolyfill.d.ts} +0 -0
  211. /package/{runtime/BlobPolyfill.js → BlobPolyfill.js} +0 -0
  212. /package/{runtime/BlobPolyfill.js.map → BlobPolyfill.js.map} +0 -0
@@ -0,0 +1,2670 @@
1
+ import { NotSupportedError, ServerError } from '../Errors';
2
+ import { ConnectionInfo } from '../common/ConnectionInfo';
3
+ import { RemoteAction, DeviceAction, DeviceActionResult, RemoteActionResult, RemoteActionError, DeviceActionError } from '../common/RemoteActions';
4
+ import { ZodIssue, z } from 'zod';
5
+ /**
6
+ * Defines a websocket event.
7
+ *
8
+ * That is, an event that is used to manage and communicate over a websocket connection.
9
+ *
10
+ * There are currently three types of events:
11
+ * - message: A message that was recieved.
12
+ * - upload_request: A request to upload a large message to a large object store. (This event type only exists to get around message size limits)
13
+ * - upload_response: A response to an upload_request event. (This event type only exists to get around message size limits)
14
+ * - download_request: A request to tell the client to download a message from from a URL. (This event type only exists to get around message size limits)
15
+ */
16
+ export type WebsocketEvent = WebsocketMessageEvent | WebsocketUploadRequestEvent | WebsocketUploadResponseEvent | WebsocketDownloadRequestEvent | WebsocketErrorEvent;
17
+ export declare enum WebsocketEventTypes {
18
+ Message = 1,
19
+ UploadRequest = 2,
20
+ UploadResponse = 3,
21
+ DownloadRequest = 4,
22
+ Error = 5
23
+ }
24
+ export declare const websocketEventSchema: z.ZodTuple<[z.ZodNativeEnum<typeof WebsocketEventTypes>, z.ZodNumber], z.ZodAny>;
25
+ /**
26
+ * Defines a websocket event that contains a message.
27
+ */
28
+ export type WebsocketMessageEvent = [
29
+ type: WebsocketEventTypes.Message,
30
+ id: number,
31
+ data: WebsocketMessage
32
+ ];
33
+ /**
34
+ * Defines a websocket event that contains a request to upload a large message.
35
+ */
36
+ export type WebsocketUploadRequestEvent = [
37
+ type: WebsocketEventTypes.UploadRequest,
38
+ id: number
39
+ ];
40
+ export declare const websocketUploadRequestEventSchema: z.ZodTuple<[z.ZodLiteral<WebsocketEventTypes.UploadRequest>, z.ZodNumber], null>;
41
+ export interface UploadHttpHeaders {
42
+ [key: string]: string;
43
+ }
44
+ /**
45
+ * Defines a websocket event that contains a response to an upload request.
46
+ */
47
+ export type WebsocketUploadResponseEvent = [
48
+ type: WebsocketEventTypes.UploadResponse,
49
+ id: number,
50
+ uploadUrl: string,
51
+ uploadMethod: string,
52
+ uploadHeaders: UploadHttpHeaders
53
+ ];
54
+ export declare const websocketUploadResponseEventSchema: z.ZodTuple<[z.ZodLiteral<WebsocketEventTypes.UploadResponse>, z.ZodNumber, z.ZodString, z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>], null>;
55
+ export type WebsocketErrorCode = ServerError | NotSupportedError | 'unacceptable_connection_token' | 'invalid_token' | 'session_expired' | 'user_is_banned' | 'unacceptable_connection_id' | 'message_not_found' | 'unnaceptable_request';
56
+ /**
57
+ * Defines a websocket event that contains a response to an upload request.
58
+ */
59
+ export type WebsocketErrorEvent = [
60
+ type: WebsocketEventTypes.Error,
61
+ id: number,
62
+ errorCode: WebsocketErrorCode,
63
+ errorMessage: string,
64
+ issues: ZodIssue[]
65
+ ];
66
+ export declare const websocketErrorEventSchema: z.ZodTuple<[z.ZodLiteral<WebsocketEventTypes.Error>, z.ZodNumber, z.ZodString, z.ZodString, z.ZodArray<z.ZodAny, "many">], null>;
67
+ /**
68
+ * Defines a websocket event that contains a request to download a large message.
69
+ */
70
+ export type WebsocketDownloadRequestEvent = [
71
+ type: WebsocketEventTypes.DownloadRequest,
72
+ id: number,
73
+ downloadUrl: string,
74
+ downloadMethod: string,
75
+ downloadHeaders: UploadHttpHeaders
76
+ ];
77
+ export declare const websocketDownloadRequestEventSchema: z.ZodTuple<[z.ZodLiteral<WebsocketEventTypes.DownloadRequest>, z.ZodNumber, z.ZodString, z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>], null>;
78
+ export type WebsocketResponseMessage = LoginResultMessage | TimeSyncResponseMessage | UpdatesReceivedMessage | ReceiveDeviceActionMessage | ConnectedToBranchMessage | DisconnectedFromBranchMessage | RateLimitExceededMessage;
79
+ export type WebsocketRequestMessage = LoginMessage | WatchBranchMessage | UnwatchBranchMessage | AddUpdatesMessage | SendActionMessage | WatchBranchDevicesMessage | UnwatchBranchDevicesMessage | ConnectionCountMessage | TimeSyncRequestMessage | GetUpdatesMessage;
80
+ export type WebsocketMessage = WebsocketRequestMessage | WebsocketResponseMessage;
81
+ /**
82
+ * Defines a login message.
83
+ */
84
+ export interface LoginMessage {
85
+ type: 'login';
86
+ /**
87
+ * The token that should be used to authenticate the connection.
88
+ */
89
+ connectionToken?: string;
90
+ /**
91
+ * The ID that the client wants to use for the connection.
92
+ * Must be unique.
93
+ */
94
+ connectionId?: string;
95
+ }
96
+ export declare const loginMessageSchema: z.ZodObject<{
97
+ type: z.ZodLiteral<"login">;
98
+ connectionToken: z.ZodOptional<z.ZodString>;
99
+ connectionId: z.ZodOptional<z.ZodString>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ type?: "login";
102
+ connectionToken?: string;
103
+ connectionId?: string;
104
+ }, {
105
+ type?: "login";
106
+ connectionToken?: string;
107
+ connectionId?: string;
108
+ }>;
109
+ /**
110
+ * Defines a login result message.
111
+ */
112
+ export interface LoginResultMessage {
113
+ type: 'login_result';
114
+ /**
115
+ * The info for the connection.
116
+ */
117
+ info: ConnectionInfo;
118
+ }
119
+ export declare const loginResultMessageSchema: z.ZodObject<{
120
+ type: z.ZodLiteral<"login_result">;
121
+ }, "strip", z.ZodTypeAny, {
122
+ type?: "login_result";
123
+ }, {
124
+ type?: "login_result";
125
+ }>;
126
+ /**
127
+ * Defines an event which indicates that a branch should be watched.
128
+ */
129
+ export interface WatchBranchMessage {
130
+ type: 'repo/watch_branch';
131
+ /**
132
+ * The name of the record that the branch is for.
133
+ * Null if the branch should be public and non-permanent.
134
+ */
135
+ recordName: string | null;
136
+ /**
137
+ * The name of the inst.
138
+ */
139
+ inst: string;
140
+ /**
141
+ * The name of the branch to watch.
142
+ */
143
+ branch: string;
144
+ /**
145
+ * Whether the branch should be temporary.
146
+ * That is, if the branch data should not be loaded from the database
147
+ * and everything should be deleted once all the watchers have left.
148
+ * Defaults to false.
149
+ */
150
+ temporary?: boolean;
151
+ /**
152
+ * The protocol that should be used.
153
+ * Currently, "updates" is the only supported protocol.
154
+ */
155
+ protocol?: 'updates';
156
+ }
157
+ export declare const watchBranchMessageSchema: z.ZodObject<{
158
+ type: z.ZodLiteral<"repo/watch_branch">;
159
+ recordName: z.ZodNullable<z.ZodString>;
160
+ inst: z.ZodString;
161
+ branch: z.ZodString;
162
+ temporary: z.ZodOptional<z.ZodBoolean>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ type?: "repo/watch_branch";
165
+ recordName?: string;
166
+ inst?: string;
167
+ branch?: string;
168
+ temporary?: boolean;
169
+ }, {
170
+ type?: "repo/watch_branch";
171
+ recordName?: string;
172
+ inst?: string;
173
+ branch?: string;
174
+ temporary?: boolean;
175
+ }>;
176
+ /**
177
+ * Defines an event which indicates that a branch should be unwatched.
178
+ */
179
+ export interface UnwatchBranchMessage {
180
+ type: 'repo/unwatch_branch';
181
+ /**
182
+ * The name of the record that the branch is for.
183
+ * Null if the branch should be public and non-permanent.
184
+ */
185
+ recordName: string | null;
186
+ /**
187
+ * The name of the inst.
188
+ */
189
+ inst: string;
190
+ /**
191
+ * The name of the branch to unwatch.
192
+ */
193
+ branch: string;
194
+ }
195
+ export declare const unwatchBranchMessageSchema: z.ZodObject<{
196
+ type: z.ZodLiteral<"repo/unwatch_branch">;
197
+ recordName: z.ZodNullable<z.ZodString>;
198
+ inst: z.ZodString;
199
+ branch: z.ZodString;
200
+ }, "strip", z.ZodTypeAny, {
201
+ type?: "repo/unwatch_branch";
202
+ recordName?: string;
203
+ inst?: string;
204
+ branch?: string;
205
+ }, {
206
+ type?: "repo/unwatch_branch";
207
+ recordName?: string;
208
+ inst?: string;
209
+ branch?: string;
210
+ }>;
211
+ /**
212
+ * Defines an event which indicates that devices connected to a branch should be watched.
213
+ */
214
+ export interface WatchBranchDevicesMessage {
215
+ type: 'repo/watch_branch_devices';
216
+ /**
217
+ * The name of the record that the branch is for.
218
+ * Null if the branch should be public and non-permanent.
219
+ */
220
+ recordName: string | null;
221
+ /**
222
+ * The name of the inst.
223
+ */
224
+ inst: string;
225
+ /**
226
+ * The name of the branch to unwatch.
227
+ */
228
+ branch: string;
229
+ }
230
+ export declare const watchBranchDevicesMessageSchema: z.ZodObject<{
231
+ type: z.ZodLiteral<"repo/watch_branch_devices">;
232
+ recordName: z.ZodNullable<z.ZodString>;
233
+ inst: z.ZodString;
234
+ branch: z.ZodString;
235
+ }, "strip", z.ZodTypeAny, {
236
+ type?: "repo/watch_branch_devices";
237
+ recordName?: string;
238
+ inst?: string;
239
+ branch?: string;
240
+ }, {
241
+ type?: "repo/watch_branch_devices";
242
+ recordName?: string;
243
+ inst?: string;
244
+ branch?: string;
245
+ }>;
246
+ /**
247
+ * Defines an event which indicates that devices connected to a branch should be no longer be watched.
248
+ */
249
+ export interface UnwatchBranchDevicesMessage {
250
+ type: 'repo/unwatch_branch_devices';
251
+ /**
252
+ * The name of the record that the branch is for.
253
+ * Null if the branch should be public and non-permanent.
254
+ */
255
+ recordName: string | null;
256
+ /**
257
+ * The name of the inst.
258
+ */
259
+ inst: string;
260
+ /**
261
+ * The name of the branch to unwatch.
262
+ */
263
+ branch: string;
264
+ }
265
+ export declare const unwatchBranchDevicesMessageSchema: z.ZodObject<{
266
+ type: z.ZodLiteral<"repo/unwatch_branch_devices">;
267
+ recordName: z.ZodNullable<z.ZodString>;
268
+ inst: z.ZodString;
269
+ branch: z.ZodString;
270
+ }, "strip", z.ZodTypeAny, {
271
+ type?: "repo/unwatch_branch_devices";
272
+ recordName?: string;
273
+ inst?: string;
274
+ branch?: string;
275
+ }, {
276
+ type?: "repo/unwatch_branch_devices";
277
+ recordName?: string;
278
+ inst?: string;
279
+ branch?: string;
280
+ }>;
281
+ /**
282
+ * Defines an event which indicates that some arbitrary updates should be added for the given branch.
283
+ * Note that while all branches support both atoms and updates, they do not support mixed usage.
284
+ * This means that clients which use updates should ignore atoms and vice versa.
285
+ */
286
+ export interface AddUpdatesMessage {
287
+ type: 'repo/add_updates';
288
+ /**
289
+ * The name of the record that the branch is for.
290
+ * Null if the branch should be public and non-permanent.
291
+ */
292
+ recordName: string | null;
293
+ /**
294
+ * The name of the inst.
295
+ */
296
+ inst: string;
297
+ /**
298
+ * The branch that the updates are for.
299
+ */
300
+ branch: string;
301
+ /**
302
+ * The updates that should be added.
303
+ */
304
+ updates: string[];
305
+ /**
306
+ * The ID for this "add update" event.
307
+ * Used in the subsequent "update received" event to indicate
308
+ * that this update was received and processed.
309
+ *
310
+ * This property is optional because update IDs are only needed for updates which are sent to the
311
+ * server to be saved. (i.e. the client needs confirmation that it was saved) The server needs no such
312
+ * confirmation, so it does not need to include an update ID.
313
+ */
314
+ updateId?: number;
315
+ /**
316
+ * Whether this message should be treated as the first message
317
+ * after a watch_branch event.
318
+ * This flag MUST be included on the first message as large apiary messages may appear out of order.
319
+ */
320
+ initial?: boolean;
321
+ /**
322
+ * The list of timestamps that the updates occurred at.
323
+ */
324
+ timestamps?: number[];
325
+ }
326
+ export declare const addUpdatesMessageSchema: z.ZodObject<{
327
+ type: z.ZodLiteral<"repo/add_updates">;
328
+ recordName: z.ZodNullable<z.ZodString>;
329
+ inst: z.ZodString;
330
+ branch: z.ZodString;
331
+ updates: z.ZodArray<z.ZodString, "many">;
332
+ updateId: z.ZodOptional<z.ZodNumber>;
333
+ initial: z.ZodOptional<z.ZodBoolean>;
334
+ timestamps: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
335
+ }, "strip", z.ZodTypeAny, {
336
+ type?: "repo/add_updates";
337
+ recordName?: string;
338
+ inst?: string;
339
+ branch?: string;
340
+ updates?: string[];
341
+ updateId?: number;
342
+ initial?: boolean;
343
+ timestamps?: number[];
344
+ }, {
345
+ type?: "repo/add_updates";
346
+ recordName?: string;
347
+ inst?: string;
348
+ branch?: string;
349
+ updates?: string[];
350
+ updateId?: number;
351
+ initial?: boolean;
352
+ timestamps?: number[];
353
+ }>;
354
+ /**
355
+ * Defines an event which indicates that the updates for the given branch should be retrieved.
356
+ */
357
+ export interface GetUpdatesMessage {
358
+ type: 'repo/get_updates';
359
+ /**
360
+ * The name of the record that the branch is for.
361
+ * Null if the branch should be public and non-permanent.
362
+ */
363
+ recordName: string | null;
364
+ /**
365
+ * The name of the inst.
366
+ */
367
+ inst: string;
368
+ /**
369
+ * The branch that the updates are for.
370
+ */
371
+ branch: string;
372
+ }
373
+ export declare const getUpdatesMessageSchema: z.ZodObject<{
374
+ type: z.ZodLiteral<"repo/get_updates">;
375
+ recordName: z.ZodNullable<z.ZodString>;
376
+ inst: z.ZodString;
377
+ branch: z.ZodString;
378
+ }, "strip", z.ZodTypeAny, {
379
+ type?: "repo/get_updates";
380
+ recordName?: string;
381
+ inst?: string;
382
+ branch?: string;
383
+ }, {
384
+ type?: "repo/get_updates";
385
+ recordName?: string;
386
+ inst?: string;
387
+ branch?: string;
388
+ }>;
389
+ /**
390
+ * Defines an event which indicates that some arbitrary updates where added for the given branch.
391
+ */
392
+ export interface UpdatesReceivedMessage {
393
+ type: 'repo/updates_received';
394
+ /**
395
+ * The name of the record that the branch is for.
396
+ * Null if the branch should be public and non-permanent.
397
+ */
398
+ recordName: string | null;
399
+ /**
400
+ * The name of the inst.
401
+ */
402
+ inst: string;
403
+ /**
404
+ * The branch that the updates were received for.
405
+ */
406
+ branch: string;
407
+ /**
408
+ * The ID that was included in the original "add update" event.
409
+ */
410
+ updateId: number;
411
+ /**
412
+ * The error code that occurred.
413
+ * If omitted, then no error occurred.
414
+ */
415
+ errorCode?: 'max_size_reached' | 'record_not_found' | 'inst_not_found';
416
+ /**
417
+ * The maximum allowed size for the inst.
418
+ * Only included when the errorCode is set to "max_size_reached".
419
+ */
420
+ maxBranchSizeInBytes?: number;
421
+ /**
422
+ * The size that the inst would be at if the updates were added.
423
+ * Only included when the errorCode is set to "max_size_reached".
424
+ */
425
+ neededBranchSizeInBytes?: number;
426
+ }
427
+ export declare const updatesReceivedMessageSchema: z.ZodObject<{
428
+ type: z.ZodLiteral<"repo/updates_received">;
429
+ recordName: z.ZodNullable<z.ZodString>;
430
+ inst: z.ZodString;
431
+ branch: z.ZodString;
432
+ updateId: z.ZodNumber;
433
+ errorCode: z.ZodOptional<z.ZodEnum<["max_size_reached", "record_not_found", "inst_not_found"]>>;
434
+ maxBranchSizeInBytes: z.ZodOptional<z.ZodNumber>;
435
+ neededBranchSizeInBytes: z.ZodOptional<z.ZodNumber>;
436
+ }, "strip", z.ZodTypeAny, {
437
+ type?: "repo/updates_received";
438
+ recordName?: string;
439
+ inst?: string;
440
+ branch?: string;
441
+ updateId?: number;
442
+ errorCode?: "max_size_reached" | "record_not_found" | "inst_not_found";
443
+ maxBranchSizeInBytes?: number;
444
+ neededBranchSizeInBytes?: number;
445
+ }, {
446
+ type?: "repo/updates_received";
447
+ recordName?: string;
448
+ inst?: string;
449
+ branch?: string;
450
+ updateId?: number;
451
+ errorCode?: "max_size_reached" | "record_not_found" | "inst_not_found";
452
+ maxBranchSizeInBytes?: number;
453
+ neededBranchSizeInBytes?: number;
454
+ }>;
455
+ /**
456
+ * Sends the given remote action to devices connected to the given branch.
457
+ */
458
+ export interface SendActionMessage {
459
+ type: 'repo/send_action';
460
+ /**
461
+ * The name of the record that the branch is for.
462
+ * Null if the branch should be public and non-permanent.
463
+ */
464
+ recordName: string | null;
465
+ /**
466
+ * The name of the inst.
467
+ */
468
+ inst: string;
469
+ /**
470
+ * The branch.
471
+ */
472
+ branch: string;
473
+ /**
474
+ * The action to send.
475
+ */
476
+ action: RemoteAction | RemoteActionResult | RemoteActionError;
477
+ }
478
+ export declare const sendActionMessageSchema: z.ZodObject<{
479
+ type: z.ZodLiteral<"repo/send_action">;
480
+ recordName: z.ZodNullable<z.ZodString>;
481
+ inst: z.ZodString;
482
+ branch: z.ZodString;
483
+ action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
484
+ connectionId: z.ZodOptional<z.ZodString>;
485
+ sessionId: z.ZodOptional<z.ZodString>;
486
+ userId: z.ZodOptional<z.ZodString>;
487
+ broadcast: z.ZodOptional<z.ZodBoolean>;
488
+ type: z.ZodLiteral<"remote">;
489
+ event: z.ZodAny;
490
+ allowBatching: z.ZodOptional<z.ZodBoolean>;
491
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
492
+ }, "strip", z.ZodTypeAny, {
493
+ connectionId?: string;
494
+ sessionId?: string;
495
+ userId?: string;
496
+ broadcast?: boolean;
497
+ type?: "remote";
498
+ event?: any;
499
+ allowBatching?: boolean;
500
+ taskId?: string | number;
501
+ }, {
502
+ connectionId?: string;
503
+ sessionId?: string;
504
+ userId?: string;
505
+ broadcast?: boolean;
506
+ type?: "remote";
507
+ event?: any;
508
+ allowBatching?: boolean;
509
+ taskId?: string | number;
510
+ }>, z.ZodObject<{
511
+ connectionId: z.ZodOptional<z.ZodString>;
512
+ sessionId: z.ZodOptional<z.ZodString>;
513
+ userId: z.ZodOptional<z.ZodString>;
514
+ broadcast: z.ZodOptional<z.ZodBoolean>;
515
+ type: z.ZodLiteral<"remote_result">;
516
+ result: z.ZodOptional<z.ZodAny>;
517
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
518
+ }, "strip", z.ZodTypeAny, {
519
+ connectionId?: string;
520
+ sessionId?: string;
521
+ userId?: string;
522
+ broadcast?: boolean;
523
+ type?: "remote_result";
524
+ result?: any;
525
+ taskId?: string | number;
526
+ }, {
527
+ connectionId?: string;
528
+ sessionId?: string;
529
+ userId?: string;
530
+ broadcast?: boolean;
531
+ type?: "remote_result";
532
+ result?: any;
533
+ taskId?: string | number;
534
+ }>, z.ZodObject<{
535
+ connectionId: z.ZodOptional<z.ZodString>;
536
+ sessionId: z.ZodOptional<z.ZodString>;
537
+ userId: z.ZodOptional<z.ZodString>;
538
+ broadcast: z.ZodOptional<z.ZodBoolean>;
539
+ type: z.ZodLiteral<"remote_error">;
540
+ error: z.ZodAny;
541
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
542
+ }, "strip", z.ZodTypeAny, {
543
+ connectionId?: string;
544
+ sessionId?: string;
545
+ userId?: string;
546
+ broadcast?: boolean;
547
+ type?: "remote_error";
548
+ error?: any;
549
+ taskId?: string | number;
550
+ }, {
551
+ connectionId?: string;
552
+ sessionId?: string;
553
+ userId?: string;
554
+ broadcast?: boolean;
555
+ type?: "remote_error";
556
+ error?: any;
557
+ taskId?: string | number;
558
+ }>]>;
559
+ }, "strip", z.ZodTypeAny, {
560
+ type?: "repo/send_action";
561
+ recordName?: string;
562
+ inst?: string;
563
+ branch?: string;
564
+ action?: {
565
+ connectionId?: string;
566
+ sessionId?: string;
567
+ userId?: string;
568
+ broadcast?: boolean;
569
+ type?: "remote";
570
+ event?: any;
571
+ allowBatching?: boolean;
572
+ taskId?: string | number;
573
+ } | {
574
+ connectionId?: string;
575
+ sessionId?: string;
576
+ userId?: string;
577
+ broadcast?: boolean;
578
+ type?: "remote_result";
579
+ result?: any;
580
+ taskId?: string | number;
581
+ } | {
582
+ connectionId?: string;
583
+ sessionId?: string;
584
+ userId?: string;
585
+ broadcast?: boolean;
586
+ type?: "remote_error";
587
+ error?: any;
588
+ taskId?: string | number;
589
+ };
590
+ }, {
591
+ type?: "repo/send_action";
592
+ recordName?: string;
593
+ inst?: string;
594
+ branch?: string;
595
+ action?: {
596
+ connectionId?: string;
597
+ sessionId?: string;
598
+ userId?: string;
599
+ broadcast?: boolean;
600
+ type?: "remote";
601
+ event?: any;
602
+ allowBatching?: boolean;
603
+ taskId?: string | number;
604
+ } | {
605
+ connectionId?: string;
606
+ sessionId?: string;
607
+ userId?: string;
608
+ broadcast?: boolean;
609
+ type?: "remote_result";
610
+ result?: any;
611
+ taskId?: string | number;
612
+ } | {
613
+ connectionId?: string;
614
+ sessionId?: string;
615
+ userId?: string;
616
+ broadcast?: boolean;
617
+ type?: "remote_error";
618
+ error?: any;
619
+ taskId?: string | number;
620
+ };
621
+ }>;
622
+ /**
623
+ * Sends the given device action to devices connected to the given branch.
624
+ */
625
+ export interface ReceiveDeviceActionMessage {
626
+ type: 'repo/receive_action';
627
+ /**
628
+ * The name of the record that the branch is for.
629
+ * Null if the branch should be public and non-permanent.
630
+ */
631
+ recordName: string | null;
632
+ /**
633
+ * The name of the inst.
634
+ */
635
+ inst: string;
636
+ /**
637
+ * The branch that the action is for.
638
+ */
639
+ branch: string;
640
+ /**
641
+ * The action that should be sent.
642
+ */
643
+ action: DeviceAction | DeviceActionResult | DeviceActionError;
644
+ }
645
+ export declare const receiveDeviceActionMessageSchema: z.ZodObject<{
646
+ type: z.ZodLiteral<"repo/receive_action">;
647
+ recordName: z.ZodNullable<z.ZodString>;
648
+ inst: z.ZodString;
649
+ branch: z.ZodString;
650
+ action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
651
+ type: z.ZodLiteral<"device">;
652
+ connection: z.ZodObject<{
653
+ connectionId: z.ZodString;
654
+ sessionId: z.ZodString;
655
+ userId: z.ZodString;
656
+ }, "strip", z.ZodTypeAny, {
657
+ connectionId?: string;
658
+ sessionId?: string;
659
+ userId?: string;
660
+ }, {
661
+ connectionId?: string;
662
+ sessionId?: string;
663
+ userId?: string;
664
+ }>;
665
+ event: z.ZodAny;
666
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
667
+ }, "strip", z.ZodTypeAny, {
668
+ type?: "device";
669
+ connection?: {
670
+ connectionId?: string;
671
+ sessionId?: string;
672
+ userId?: string;
673
+ };
674
+ event?: any;
675
+ taskId?: string | number;
676
+ }, {
677
+ type?: "device";
678
+ connection?: {
679
+ connectionId?: string;
680
+ sessionId?: string;
681
+ userId?: string;
682
+ };
683
+ event?: any;
684
+ taskId?: string | number;
685
+ }>, z.ZodObject<{
686
+ type: z.ZodLiteral<"device_result">;
687
+ result: z.ZodAny;
688
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
689
+ connection: z.ZodObject<{
690
+ connectionId: z.ZodString;
691
+ sessionId: z.ZodString;
692
+ userId: z.ZodString;
693
+ }, "strip", z.ZodTypeAny, {
694
+ connectionId?: string;
695
+ sessionId?: string;
696
+ userId?: string;
697
+ }, {
698
+ connectionId?: string;
699
+ sessionId?: string;
700
+ userId?: string;
701
+ }>;
702
+ }, "strip", z.ZodTypeAny, {
703
+ type?: "device_result";
704
+ result?: any;
705
+ taskId?: string | number;
706
+ connection?: {
707
+ connectionId?: string;
708
+ sessionId?: string;
709
+ userId?: string;
710
+ };
711
+ }, {
712
+ type?: "device_result";
713
+ result?: any;
714
+ taskId?: string | number;
715
+ connection?: {
716
+ connectionId?: string;
717
+ sessionId?: string;
718
+ userId?: string;
719
+ };
720
+ }>, z.ZodObject<{
721
+ type: z.ZodLiteral<"device_error">;
722
+ error: z.ZodAny;
723
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
724
+ connection: z.ZodObject<{
725
+ connectionId: z.ZodString;
726
+ sessionId: z.ZodString;
727
+ userId: z.ZodString;
728
+ }, "strip", z.ZodTypeAny, {
729
+ connectionId?: string;
730
+ sessionId?: string;
731
+ userId?: string;
732
+ }, {
733
+ connectionId?: string;
734
+ sessionId?: string;
735
+ userId?: string;
736
+ }>;
737
+ }, "strip", z.ZodTypeAny, {
738
+ type?: "device_error";
739
+ error?: any;
740
+ taskId?: string | number;
741
+ connection?: {
742
+ connectionId?: string;
743
+ sessionId?: string;
744
+ userId?: string;
745
+ };
746
+ }, {
747
+ type?: "device_error";
748
+ error?: any;
749
+ taskId?: string | number;
750
+ connection?: {
751
+ connectionId?: string;
752
+ sessionId?: string;
753
+ userId?: string;
754
+ };
755
+ }>]>;
756
+ }, "strip", z.ZodTypeAny, {
757
+ type?: "repo/receive_action";
758
+ recordName?: string;
759
+ inst?: string;
760
+ branch?: string;
761
+ action?: {
762
+ type?: "device";
763
+ connection?: {
764
+ connectionId?: string;
765
+ sessionId?: string;
766
+ userId?: string;
767
+ };
768
+ event?: any;
769
+ taskId?: string | number;
770
+ } | {
771
+ type?: "device_result";
772
+ result?: any;
773
+ taskId?: string | number;
774
+ connection?: {
775
+ connectionId?: string;
776
+ sessionId?: string;
777
+ userId?: string;
778
+ };
779
+ } | {
780
+ type?: "device_error";
781
+ error?: any;
782
+ taskId?: string | number;
783
+ connection?: {
784
+ connectionId?: string;
785
+ sessionId?: string;
786
+ userId?: string;
787
+ };
788
+ };
789
+ }, {
790
+ type?: "repo/receive_action";
791
+ recordName?: string;
792
+ inst?: string;
793
+ branch?: string;
794
+ action?: {
795
+ type?: "device";
796
+ connection?: {
797
+ connectionId?: string;
798
+ sessionId?: string;
799
+ userId?: string;
800
+ };
801
+ event?: any;
802
+ taskId?: string | number;
803
+ } | {
804
+ type?: "device_result";
805
+ result?: any;
806
+ taskId?: string | number;
807
+ connection?: {
808
+ connectionId?: string;
809
+ sessionId?: string;
810
+ userId?: string;
811
+ };
812
+ } | {
813
+ type?: "device_error";
814
+ error?: any;
815
+ taskId?: string | number;
816
+ connection?: {
817
+ connectionId?: string;
818
+ sessionId?: string;
819
+ userId?: string;
820
+ };
821
+ };
822
+ }>;
823
+ /**
824
+ * Defines an event which indicates that a connection has been made to a branch.
825
+ */
826
+ export interface ConnectedToBranchMessage {
827
+ type: 'repo/connected_to_branch';
828
+ /**
829
+ * Whether this event is for WATCH_DEVICES listeners or WATCH_BRANCH_DEVICES listeners.
830
+ * If true, then listeners for a specific branch should ignore the event.
831
+ */
832
+ broadcast: boolean;
833
+ /**
834
+ * The name of the branch that was connected.
835
+ */
836
+ branch: WatchBranchMessage;
837
+ /**
838
+ * The info of session that connected.
839
+ */
840
+ connection: ConnectionInfo;
841
+ }
842
+ export declare const connectedToBranchMessageSchema: z.ZodObject<{
843
+ type: z.ZodLiteral<"repo/connected_to_branch">;
844
+ broadcast: z.ZodBoolean;
845
+ branch: z.ZodObject<{
846
+ type: z.ZodLiteral<"repo/watch_branch">;
847
+ recordName: z.ZodNullable<z.ZodString>;
848
+ inst: z.ZodString;
849
+ branch: z.ZodString;
850
+ temporary: z.ZodOptional<z.ZodBoolean>;
851
+ }, "strip", z.ZodTypeAny, {
852
+ type?: "repo/watch_branch";
853
+ recordName?: string;
854
+ inst?: string;
855
+ branch?: string;
856
+ temporary?: boolean;
857
+ }, {
858
+ type?: "repo/watch_branch";
859
+ recordName?: string;
860
+ inst?: string;
861
+ branch?: string;
862
+ temporary?: boolean;
863
+ }>;
864
+ connection: z.ZodObject<{
865
+ connectionId: z.ZodString;
866
+ sessionId: z.ZodString;
867
+ userId: z.ZodString;
868
+ }, "strip", z.ZodTypeAny, {
869
+ connectionId?: string;
870
+ sessionId?: string;
871
+ userId?: string;
872
+ }, {
873
+ connectionId?: string;
874
+ sessionId?: string;
875
+ userId?: string;
876
+ }>;
877
+ }, "strip", z.ZodTypeAny, {
878
+ type?: "repo/connected_to_branch";
879
+ broadcast?: boolean;
880
+ branch?: {
881
+ type?: "repo/watch_branch";
882
+ recordName?: string;
883
+ inst?: string;
884
+ branch?: string;
885
+ temporary?: boolean;
886
+ };
887
+ connection?: {
888
+ connectionId?: string;
889
+ sessionId?: string;
890
+ userId?: string;
891
+ };
892
+ }, {
893
+ type?: "repo/connected_to_branch";
894
+ broadcast?: boolean;
895
+ branch?: {
896
+ type?: "repo/watch_branch";
897
+ recordName?: string;
898
+ inst?: string;
899
+ branch?: string;
900
+ temporary?: boolean;
901
+ };
902
+ connection?: {
903
+ connectionId?: string;
904
+ sessionId?: string;
905
+ userId?: string;
906
+ };
907
+ }>;
908
+ /**
909
+ * Defines an event which indicates that a connection has been removed from a branch.
910
+ */
911
+ export interface DisconnectedFromBranchMessage {
912
+ type: 'repo/disconnected_from_branch';
913
+ /**
914
+ * Whether this event is for WATCH_DEVICES listeners or WATCH_BRANCH_DEVICES listeners.
915
+ * If true, then listeners for a specific branch should ignore the event.
916
+ */
917
+ broadcast: boolean;
918
+ /**
919
+ * The name of the record that the branch is for.
920
+ * Null if the branch should be public and non-permanent.
921
+ */
922
+ recordName: string | null;
923
+ /**
924
+ * The name of the inst.
925
+ */
926
+ inst: string;
927
+ /**
928
+ * The name of the branch that was disconnected.
929
+ */
930
+ branch: string;
931
+ /**
932
+ * The info of session that disconnected.
933
+ */
934
+ connection: ConnectionInfo;
935
+ }
936
+ export declare const disconnectedFromBranchMessageSchema: z.ZodObject<{
937
+ type: z.ZodLiteral<"repo/disconnected_from_branch">;
938
+ broadcast: z.ZodBoolean;
939
+ recordName: z.ZodNullable<z.ZodString>;
940
+ inst: z.ZodString;
941
+ branch: z.ZodString;
942
+ connection: z.ZodObject<{
943
+ connectionId: z.ZodString;
944
+ sessionId: z.ZodString;
945
+ userId: z.ZodString;
946
+ }, "strip", z.ZodTypeAny, {
947
+ connectionId?: string;
948
+ sessionId?: string;
949
+ userId?: string;
950
+ }, {
951
+ connectionId?: string;
952
+ sessionId?: string;
953
+ userId?: string;
954
+ }>;
955
+ }, "strip", z.ZodTypeAny, {
956
+ type?: "repo/disconnected_from_branch";
957
+ broadcast?: boolean;
958
+ recordName?: string;
959
+ inst?: string;
960
+ branch?: string;
961
+ connection?: {
962
+ connectionId?: string;
963
+ sessionId?: string;
964
+ userId?: string;
965
+ };
966
+ }, {
967
+ type?: "repo/disconnected_from_branch";
968
+ broadcast?: boolean;
969
+ recordName?: string;
970
+ inst?: string;
971
+ branch?: string;
972
+ connection?: {
973
+ connectionId?: string;
974
+ sessionId?: string;
975
+ userId?: string;
976
+ };
977
+ }>;
978
+ export interface ConnectionCountMessage {
979
+ type: 'repo/connection_count';
980
+ /**
981
+ * The name of the record that the branch is for.
982
+ * Null if the branch should be public and non-permanent.
983
+ */
984
+ recordName: string | null;
985
+ /**
986
+ * The name of the inst.
987
+ * Null if all connections should be counted.
988
+ */
989
+ inst: string | null;
990
+ /**
991
+ * The name of the branch.
992
+ * Null if all connections should be counted.
993
+ */
994
+ branch: string | null;
995
+ /**
996
+ * The number of connections.
997
+ */
998
+ count?: number;
999
+ }
1000
+ export declare const connectionCountMessageSchema: z.ZodObject<{
1001
+ type: z.ZodLiteral<"repo/connection_count">;
1002
+ recordName: z.ZodNullable<z.ZodString>;
1003
+ inst: z.ZodNullable<z.ZodString>;
1004
+ branch: z.ZodNullable<z.ZodString>;
1005
+ count: z.ZodOptional<z.ZodNumber>;
1006
+ }, "strip", z.ZodTypeAny, {
1007
+ type?: "repo/connection_count";
1008
+ recordName?: string;
1009
+ inst?: string;
1010
+ branch?: string;
1011
+ count?: number;
1012
+ }, {
1013
+ type?: "repo/connection_count";
1014
+ recordName?: string;
1015
+ inst?: string;
1016
+ branch?: string;
1017
+ count?: number;
1018
+ }>;
1019
+ /**
1020
+ * Defines an event which attempts to perform a time sync.
1021
+ */
1022
+ export interface TimeSyncRequestMessage {
1023
+ type: 'sync/time';
1024
+ /**
1025
+ * The ID of the sync request.
1026
+ */
1027
+ id: number;
1028
+ /**
1029
+ * The client time in miliseconds since Jan 1 1970 UTC-0 that the request was made at.
1030
+ */
1031
+ clientRequestTime: number;
1032
+ }
1033
+ export declare const timeSyncRequestMessageSchema: z.ZodObject<{
1034
+ type: z.ZodLiteral<"sync/time">;
1035
+ id: z.ZodNumber;
1036
+ clientRequestTime: z.ZodNumber;
1037
+ }, "strip", z.ZodTypeAny, {
1038
+ type?: "sync/time";
1039
+ id?: number;
1040
+ clientRequestTime?: number;
1041
+ }, {
1042
+ type?: "sync/time";
1043
+ id?: number;
1044
+ clientRequestTime?: number;
1045
+ }>;
1046
+ /**
1047
+ * Defines an event which is the response for a time sync.
1048
+ */
1049
+ export interface TimeSyncResponseMessage {
1050
+ type: 'sync/time/response';
1051
+ /**
1052
+ * The ID of the sync request.
1053
+ */
1054
+ id: number;
1055
+ /**
1056
+ * The client time in miliseconds since Jan 1 1970 UTC-0 that the request was made at.
1057
+ */
1058
+ clientRequestTime: number;
1059
+ /**
1060
+ * The time that the server received the request at in miliseconds since Jan 1 1970 UTC-0.
1061
+ */
1062
+ serverReceiveTime: number;
1063
+ /**
1064
+ * The time that the server sent this response at in miliseconds since Jan 1 1970 UTC-0.
1065
+ */
1066
+ serverTransmitTime: number;
1067
+ }
1068
+ export declare const timeSyncResponseMessageSchema: z.ZodObject<{
1069
+ type: z.ZodLiteral<"sync/time/response">;
1070
+ id: z.ZodNumber;
1071
+ clientRequestTime: z.ZodNumber;
1072
+ serverReceiveTime: z.ZodNumber;
1073
+ serverTransmitTime: z.ZodNumber;
1074
+ }, "strip", z.ZodTypeAny, {
1075
+ type?: "sync/time/response";
1076
+ id?: number;
1077
+ clientRequestTime?: number;
1078
+ serverReceiveTime?: number;
1079
+ serverTransmitTime?: number;
1080
+ }, {
1081
+ type?: "sync/time/response";
1082
+ id?: number;
1083
+ clientRequestTime?: number;
1084
+ serverReceiveTime?: number;
1085
+ serverTransmitTime?: number;
1086
+ }>;
1087
+ export interface RateLimitExceededMessage {
1088
+ type: 'rate_limit_exceeded';
1089
+ retryAfter: number;
1090
+ totalHits: number;
1091
+ }
1092
+ export declare const rateLimitExceededMessageSchema: z.ZodObject<{
1093
+ type: z.ZodLiteral<"rate_limit_exceeded">;
1094
+ retryAfter: z.ZodNumber;
1095
+ totalHits: z.ZodNumber;
1096
+ }, "strip", z.ZodTypeAny, {
1097
+ type?: "rate_limit_exceeded";
1098
+ retryAfter?: number;
1099
+ totalHits?: number;
1100
+ }, {
1101
+ type?: "rate_limit_exceeded";
1102
+ retryAfter?: number;
1103
+ totalHits?: number;
1104
+ }>;
1105
+ export declare const websocketRequestMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1106
+ type: z.ZodLiteral<"login">;
1107
+ connectionToken: z.ZodOptional<z.ZodString>;
1108
+ connectionId: z.ZodOptional<z.ZodString>;
1109
+ }, "strip", z.ZodTypeAny, {
1110
+ type?: "login";
1111
+ connectionToken?: string;
1112
+ connectionId?: string;
1113
+ }, {
1114
+ type?: "login";
1115
+ connectionToken?: string;
1116
+ connectionId?: string;
1117
+ }>, z.ZodObject<{
1118
+ type: z.ZodLiteral<"repo/watch_branch">;
1119
+ recordName: z.ZodNullable<z.ZodString>;
1120
+ inst: z.ZodString;
1121
+ branch: z.ZodString;
1122
+ temporary: z.ZodOptional<z.ZodBoolean>;
1123
+ }, "strip", z.ZodTypeAny, {
1124
+ type?: "repo/watch_branch";
1125
+ recordName?: string;
1126
+ inst?: string;
1127
+ branch?: string;
1128
+ temporary?: boolean;
1129
+ }, {
1130
+ type?: "repo/watch_branch";
1131
+ recordName?: string;
1132
+ inst?: string;
1133
+ branch?: string;
1134
+ temporary?: boolean;
1135
+ }>, z.ZodObject<{
1136
+ type: z.ZodLiteral<"repo/unwatch_branch">;
1137
+ recordName: z.ZodNullable<z.ZodString>;
1138
+ inst: z.ZodString;
1139
+ branch: z.ZodString;
1140
+ }, "strip", z.ZodTypeAny, {
1141
+ type?: "repo/unwatch_branch";
1142
+ recordName?: string;
1143
+ inst?: string;
1144
+ branch?: string;
1145
+ }, {
1146
+ type?: "repo/unwatch_branch";
1147
+ recordName?: string;
1148
+ inst?: string;
1149
+ branch?: string;
1150
+ }>, z.ZodObject<{
1151
+ type: z.ZodLiteral<"repo/add_updates">;
1152
+ recordName: z.ZodNullable<z.ZodString>;
1153
+ inst: z.ZodString;
1154
+ branch: z.ZodString;
1155
+ updates: z.ZodArray<z.ZodString, "many">;
1156
+ updateId: z.ZodOptional<z.ZodNumber>;
1157
+ initial: z.ZodOptional<z.ZodBoolean>;
1158
+ timestamps: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1159
+ }, "strip", z.ZodTypeAny, {
1160
+ type?: "repo/add_updates";
1161
+ recordName?: string;
1162
+ inst?: string;
1163
+ branch?: string;
1164
+ updates?: string[];
1165
+ updateId?: number;
1166
+ initial?: boolean;
1167
+ timestamps?: number[];
1168
+ }, {
1169
+ type?: "repo/add_updates";
1170
+ recordName?: string;
1171
+ inst?: string;
1172
+ branch?: string;
1173
+ updates?: string[];
1174
+ updateId?: number;
1175
+ initial?: boolean;
1176
+ timestamps?: number[];
1177
+ }>, z.ZodObject<{
1178
+ type: z.ZodLiteral<"repo/send_action">;
1179
+ recordName: z.ZodNullable<z.ZodString>;
1180
+ inst: z.ZodString;
1181
+ branch: z.ZodString;
1182
+ action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1183
+ connectionId: z.ZodOptional<z.ZodString>;
1184
+ sessionId: z.ZodOptional<z.ZodString>;
1185
+ userId: z.ZodOptional<z.ZodString>;
1186
+ broadcast: z.ZodOptional<z.ZodBoolean>;
1187
+ type: z.ZodLiteral<"remote">;
1188
+ event: z.ZodAny;
1189
+ allowBatching: z.ZodOptional<z.ZodBoolean>;
1190
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1191
+ }, "strip", z.ZodTypeAny, {
1192
+ connectionId?: string;
1193
+ sessionId?: string;
1194
+ userId?: string;
1195
+ broadcast?: boolean;
1196
+ type?: "remote";
1197
+ event?: any;
1198
+ allowBatching?: boolean;
1199
+ taskId?: string | number;
1200
+ }, {
1201
+ connectionId?: string;
1202
+ sessionId?: string;
1203
+ userId?: string;
1204
+ broadcast?: boolean;
1205
+ type?: "remote";
1206
+ event?: any;
1207
+ allowBatching?: boolean;
1208
+ taskId?: string | number;
1209
+ }>, z.ZodObject<{
1210
+ connectionId: z.ZodOptional<z.ZodString>;
1211
+ sessionId: z.ZodOptional<z.ZodString>;
1212
+ userId: z.ZodOptional<z.ZodString>;
1213
+ broadcast: z.ZodOptional<z.ZodBoolean>;
1214
+ type: z.ZodLiteral<"remote_result">;
1215
+ result: z.ZodOptional<z.ZodAny>;
1216
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1217
+ }, "strip", z.ZodTypeAny, {
1218
+ connectionId?: string;
1219
+ sessionId?: string;
1220
+ userId?: string;
1221
+ broadcast?: boolean;
1222
+ type?: "remote_result";
1223
+ result?: any;
1224
+ taskId?: string | number;
1225
+ }, {
1226
+ connectionId?: string;
1227
+ sessionId?: string;
1228
+ userId?: string;
1229
+ broadcast?: boolean;
1230
+ type?: "remote_result";
1231
+ result?: any;
1232
+ taskId?: string | number;
1233
+ }>, z.ZodObject<{
1234
+ connectionId: z.ZodOptional<z.ZodString>;
1235
+ sessionId: z.ZodOptional<z.ZodString>;
1236
+ userId: z.ZodOptional<z.ZodString>;
1237
+ broadcast: z.ZodOptional<z.ZodBoolean>;
1238
+ type: z.ZodLiteral<"remote_error">;
1239
+ error: z.ZodAny;
1240
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1241
+ }, "strip", z.ZodTypeAny, {
1242
+ connectionId?: string;
1243
+ sessionId?: string;
1244
+ userId?: string;
1245
+ broadcast?: boolean;
1246
+ type?: "remote_error";
1247
+ error?: any;
1248
+ taskId?: string | number;
1249
+ }, {
1250
+ connectionId?: string;
1251
+ sessionId?: string;
1252
+ userId?: string;
1253
+ broadcast?: boolean;
1254
+ type?: "remote_error";
1255
+ error?: any;
1256
+ taskId?: string | number;
1257
+ }>]>;
1258
+ }, "strip", z.ZodTypeAny, {
1259
+ type?: "repo/send_action";
1260
+ recordName?: string;
1261
+ inst?: string;
1262
+ branch?: string;
1263
+ action?: {
1264
+ connectionId?: string;
1265
+ sessionId?: string;
1266
+ userId?: string;
1267
+ broadcast?: boolean;
1268
+ type?: "remote";
1269
+ event?: any;
1270
+ allowBatching?: boolean;
1271
+ taskId?: string | number;
1272
+ } | {
1273
+ connectionId?: string;
1274
+ sessionId?: string;
1275
+ userId?: string;
1276
+ broadcast?: boolean;
1277
+ type?: "remote_result";
1278
+ result?: any;
1279
+ taskId?: string | number;
1280
+ } | {
1281
+ connectionId?: string;
1282
+ sessionId?: string;
1283
+ userId?: string;
1284
+ broadcast?: boolean;
1285
+ type?: "remote_error";
1286
+ error?: any;
1287
+ taskId?: string | number;
1288
+ };
1289
+ }, {
1290
+ type?: "repo/send_action";
1291
+ recordName?: string;
1292
+ inst?: string;
1293
+ branch?: string;
1294
+ action?: {
1295
+ connectionId?: string;
1296
+ sessionId?: string;
1297
+ userId?: string;
1298
+ broadcast?: boolean;
1299
+ type?: "remote";
1300
+ event?: any;
1301
+ allowBatching?: boolean;
1302
+ taskId?: string | number;
1303
+ } | {
1304
+ connectionId?: string;
1305
+ sessionId?: string;
1306
+ userId?: string;
1307
+ broadcast?: boolean;
1308
+ type?: "remote_result";
1309
+ result?: any;
1310
+ taskId?: string | number;
1311
+ } | {
1312
+ connectionId?: string;
1313
+ sessionId?: string;
1314
+ userId?: string;
1315
+ broadcast?: boolean;
1316
+ type?: "remote_error";
1317
+ error?: any;
1318
+ taskId?: string | number;
1319
+ };
1320
+ }>, z.ZodObject<{
1321
+ type: z.ZodLiteral<"repo/watch_branch_devices">;
1322
+ recordName: z.ZodNullable<z.ZodString>;
1323
+ inst: z.ZodString;
1324
+ branch: z.ZodString;
1325
+ }, "strip", z.ZodTypeAny, {
1326
+ type?: "repo/watch_branch_devices";
1327
+ recordName?: string;
1328
+ inst?: string;
1329
+ branch?: string;
1330
+ }, {
1331
+ type?: "repo/watch_branch_devices";
1332
+ recordName?: string;
1333
+ inst?: string;
1334
+ branch?: string;
1335
+ }>, z.ZodObject<{
1336
+ type: z.ZodLiteral<"repo/unwatch_branch_devices">;
1337
+ recordName: z.ZodNullable<z.ZodString>;
1338
+ inst: z.ZodString;
1339
+ branch: z.ZodString;
1340
+ }, "strip", z.ZodTypeAny, {
1341
+ type?: "repo/unwatch_branch_devices";
1342
+ recordName?: string;
1343
+ inst?: string;
1344
+ branch?: string;
1345
+ }, {
1346
+ type?: "repo/unwatch_branch_devices";
1347
+ recordName?: string;
1348
+ inst?: string;
1349
+ branch?: string;
1350
+ }>, z.ZodObject<{
1351
+ type: z.ZodLiteral<"repo/connection_count">;
1352
+ recordName: z.ZodNullable<z.ZodString>;
1353
+ inst: z.ZodNullable<z.ZodString>;
1354
+ branch: z.ZodNullable<z.ZodString>;
1355
+ count: z.ZodOptional<z.ZodNumber>;
1356
+ }, "strip", z.ZodTypeAny, {
1357
+ type?: "repo/connection_count";
1358
+ recordName?: string;
1359
+ inst?: string;
1360
+ branch?: string;
1361
+ count?: number;
1362
+ }, {
1363
+ type?: "repo/connection_count";
1364
+ recordName?: string;
1365
+ inst?: string;
1366
+ branch?: string;
1367
+ count?: number;
1368
+ }>, z.ZodObject<{
1369
+ type: z.ZodLiteral<"sync/time">;
1370
+ id: z.ZodNumber;
1371
+ clientRequestTime: z.ZodNumber;
1372
+ }, "strip", z.ZodTypeAny, {
1373
+ type?: "sync/time";
1374
+ id?: number;
1375
+ clientRequestTime?: number;
1376
+ }, {
1377
+ type?: "sync/time";
1378
+ id?: number;
1379
+ clientRequestTime?: number;
1380
+ }>, z.ZodObject<{
1381
+ type: z.ZodLiteral<"repo/get_updates">;
1382
+ recordName: z.ZodNullable<z.ZodString>;
1383
+ inst: z.ZodString;
1384
+ branch: z.ZodString;
1385
+ }, "strip", z.ZodTypeAny, {
1386
+ type?: "repo/get_updates";
1387
+ recordName?: string;
1388
+ inst?: string;
1389
+ branch?: string;
1390
+ }, {
1391
+ type?: "repo/get_updates";
1392
+ recordName?: string;
1393
+ inst?: string;
1394
+ branch?: string;
1395
+ }>]>;
1396
+ export declare const websocketMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1397
+ type: z.ZodLiteral<"login">;
1398
+ connectionToken: z.ZodOptional<z.ZodString>;
1399
+ connectionId: z.ZodOptional<z.ZodString>;
1400
+ }, "strip", z.ZodTypeAny, {
1401
+ type?: "login";
1402
+ connectionToken?: string;
1403
+ connectionId?: string;
1404
+ }, {
1405
+ type?: "login";
1406
+ connectionToken?: string;
1407
+ connectionId?: string;
1408
+ }>, z.ZodObject<{
1409
+ type: z.ZodLiteral<"login_result">;
1410
+ }, "strip", z.ZodTypeAny, {
1411
+ type?: "login_result";
1412
+ }, {
1413
+ type?: "login_result";
1414
+ }>, z.ZodObject<{
1415
+ type: z.ZodLiteral<"repo/watch_branch">;
1416
+ recordName: z.ZodNullable<z.ZodString>;
1417
+ inst: z.ZodString;
1418
+ branch: z.ZodString;
1419
+ temporary: z.ZodOptional<z.ZodBoolean>;
1420
+ }, "strip", z.ZodTypeAny, {
1421
+ type?: "repo/watch_branch";
1422
+ recordName?: string;
1423
+ inst?: string;
1424
+ branch?: string;
1425
+ temporary?: boolean;
1426
+ }, {
1427
+ type?: "repo/watch_branch";
1428
+ recordName?: string;
1429
+ inst?: string;
1430
+ branch?: string;
1431
+ temporary?: boolean;
1432
+ }>, z.ZodObject<{
1433
+ type: z.ZodLiteral<"repo/unwatch_branch">;
1434
+ recordName: z.ZodNullable<z.ZodString>;
1435
+ inst: z.ZodString;
1436
+ branch: z.ZodString;
1437
+ }, "strip", z.ZodTypeAny, {
1438
+ type?: "repo/unwatch_branch";
1439
+ recordName?: string;
1440
+ inst?: string;
1441
+ branch?: string;
1442
+ }, {
1443
+ type?: "repo/unwatch_branch";
1444
+ recordName?: string;
1445
+ inst?: string;
1446
+ branch?: string;
1447
+ }>, z.ZodObject<{
1448
+ type: z.ZodLiteral<"repo/add_updates">;
1449
+ recordName: z.ZodNullable<z.ZodString>;
1450
+ inst: z.ZodString;
1451
+ branch: z.ZodString;
1452
+ updates: z.ZodArray<z.ZodString, "many">;
1453
+ updateId: z.ZodOptional<z.ZodNumber>;
1454
+ initial: z.ZodOptional<z.ZodBoolean>;
1455
+ timestamps: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
1456
+ }, "strip", z.ZodTypeAny, {
1457
+ type?: "repo/add_updates";
1458
+ recordName?: string;
1459
+ inst?: string;
1460
+ branch?: string;
1461
+ updates?: string[];
1462
+ updateId?: number;
1463
+ initial?: boolean;
1464
+ timestamps?: number[];
1465
+ }, {
1466
+ type?: "repo/add_updates";
1467
+ recordName?: string;
1468
+ inst?: string;
1469
+ branch?: string;
1470
+ updates?: string[];
1471
+ updateId?: number;
1472
+ initial?: boolean;
1473
+ timestamps?: number[];
1474
+ }>, z.ZodObject<{
1475
+ type: z.ZodLiteral<"repo/updates_received">;
1476
+ recordName: z.ZodNullable<z.ZodString>;
1477
+ inst: z.ZodString;
1478
+ branch: z.ZodString;
1479
+ updateId: z.ZodNumber;
1480
+ errorCode: z.ZodOptional<z.ZodEnum<["max_size_reached", "record_not_found", "inst_not_found"]>>;
1481
+ maxBranchSizeInBytes: z.ZodOptional<z.ZodNumber>;
1482
+ neededBranchSizeInBytes: z.ZodOptional<z.ZodNumber>;
1483
+ }, "strip", z.ZodTypeAny, {
1484
+ type?: "repo/updates_received";
1485
+ recordName?: string;
1486
+ inst?: string;
1487
+ branch?: string;
1488
+ updateId?: number;
1489
+ errorCode?: "max_size_reached" | "record_not_found" | "inst_not_found";
1490
+ maxBranchSizeInBytes?: number;
1491
+ neededBranchSizeInBytes?: number;
1492
+ }, {
1493
+ type?: "repo/updates_received";
1494
+ recordName?: string;
1495
+ inst?: string;
1496
+ branch?: string;
1497
+ updateId?: number;
1498
+ errorCode?: "max_size_reached" | "record_not_found" | "inst_not_found";
1499
+ maxBranchSizeInBytes?: number;
1500
+ neededBranchSizeInBytes?: number;
1501
+ }>, z.ZodObject<{
1502
+ type: z.ZodLiteral<"repo/send_action">;
1503
+ recordName: z.ZodNullable<z.ZodString>;
1504
+ inst: z.ZodString;
1505
+ branch: z.ZodString;
1506
+ action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1507
+ connectionId: z.ZodOptional<z.ZodString>;
1508
+ sessionId: z.ZodOptional<z.ZodString>;
1509
+ userId: z.ZodOptional<z.ZodString>;
1510
+ broadcast: z.ZodOptional<z.ZodBoolean>;
1511
+ type: z.ZodLiteral<"remote">;
1512
+ event: z.ZodAny;
1513
+ allowBatching: z.ZodOptional<z.ZodBoolean>;
1514
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1515
+ }, "strip", z.ZodTypeAny, {
1516
+ connectionId?: string;
1517
+ sessionId?: string;
1518
+ userId?: string;
1519
+ broadcast?: boolean;
1520
+ type?: "remote";
1521
+ event?: any;
1522
+ allowBatching?: boolean;
1523
+ taskId?: string | number;
1524
+ }, {
1525
+ connectionId?: string;
1526
+ sessionId?: string;
1527
+ userId?: string;
1528
+ broadcast?: boolean;
1529
+ type?: "remote";
1530
+ event?: any;
1531
+ allowBatching?: boolean;
1532
+ taskId?: string | number;
1533
+ }>, z.ZodObject<{
1534
+ connectionId: z.ZodOptional<z.ZodString>;
1535
+ sessionId: z.ZodOptional<z.ZodString>;
1536
+ userId: z.ZodOptional<z.ZodString>;
1537
+ broadcast: z.ZodOptional<z.ZodBoolean>;
1538
+ type: z.ZodLiteral<"remote_result">;
1539
+ result: z.ZodOptional<z.ZodAny>;
1540
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1541
+ }, "strip", z.ZodTypeAny, {
1542
+ connectionId?: string;
1543
+ sessionId?: string;
1544
+ userId?: string;
1545
+ broadcast?: boolean;
1546
+ type?: "remote_result";
1547
+ result?: any;
1548
+ taskId?: string | number;
1549
+ }, {
1550
+ connectionId?: string;
1551
+ sessionId?: string;
1552
+ userId?: string;
1553
+ broadcast?: boolean;
1554
+ type?: "remote_result";
1555
+ result?: any;
1556
+ taskId?: string | number;
1557
+ }>, z.ZodObject<{
1558
+ connectionId: z.ZodOptional<z.ZodString>;
1559
+ sessionId: z.ZodOptional<z.ZodString>;
1560
+ userId: z.ZodOptional<z.ZodString>;
1561
+ broadcast: z.ZodOptional<z.ZodBoolean>;
1562
+ type: z.ZodLiteral<"remote_error">;
1563
+ error: z.ZodAny;
1564
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1565
+ }, "strip", z.ZodTypeAny, {
1566
+ connectionId?: string;
1567
+ sessionId?: string;
1568
+ userId?: string;
1569
+ broadcast?: boolean;
1570
+ type?: "remote_error";
1571
+ error?: any;
1572
+ taskId?: string | number;
1573
+ }, {
1574
+ connectionId?: string;
1575
+ sessionId?: string;
1576
+ userId?: string;
1577
+ broadcast?: boolean;
1578
+ type?: "remote_error";
1579
+ error?: any;
1580
+ taskId?: string | number;
1581
+ }>]>;
1582
+ }, "strip", z.ZodTypeAny, {
1583
+ type?: "repo/send_action";
1584
+ recordName?: string;
1585
+ inst?: string;
1586
+ branch?: string;
1587
+ action?: {
1588
+ connectionId?: string;
1589
+ sessionId?: string;
1590
+ userId?: string;
1591
+ broadcast?: boolean;
1592
+ type?: "remote";
1593
+ event?: any;
1594
+ allowBatching?: boolean;
1595
+ taskId?: string | number;
1596
+ } | {
1597
+ connectionId?: string;
1598
+ sessionId?: string;
1599
+ userId?: string;
1600
+ broadcast?: boolean;
1601
+ type?: "remote_result";
1602
+ result?: any;
1603
+ taskId?: string | number;
1604
+ } | {
1605
+ connectionId?: string;
1606
+ sessionId?: string;
1607
+ userId?: string;
1608
+ broadcast?: boolean;
1609
+ type?: "remote_error";
1610
+ error?: any;
1611
+ taskId?: string | number;
1612
+ };
1613
+ }, {
1614
+ type?: "repo/send_action";
1615
+ recordName?: string;
1616
+ inst?: string;
1617
+ branch?: string;
1618
+ action?: {
1619
+ connectionId?: string;
1620
+ sessionId?: string;
1621
+ userId?: string;
1622
+ broadcast?: boolean;
1623
+ type?: "remote";
1624
+ event?: any;
1625
+ allowBatching?: boolean;
1626
+ taskId?: string | number;
1627
+ } | {
1628
+ connectionId?: string;
1629
+ sessionId?: string;
1630
+ userId?: string;
1631
+ broadcast?: boolean;
1632
+ type?: "remote_result";
1633
+ result?: any;
1634
+ taskId?: string | number;
1635
+ } | {
1636
+ connectionId?: string;
1637
+ sessionId?: string;
1638
+ userId?: string;
1639
+ broadcast?: boolean;
1640
+ type?: "remote_error";
1641
+ error?: any;
1642
+ taskId?: string | number;
1643
+ };
1644
+ }>, z.ZodObject<{
1645
+ type: z.ZodLiteral<"repo/receive_action">;
1646
+ recordName: z.ZodNullable<z.ZodString>;
1647
+ inst: z.ZodString;
1648
+ branch: z.ZodString;
1649
+ action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1650
+ type: z.ZodLiteral<"device">;
1651
+ connection: z.ZodObject<{
1652
+ connectionId: z.ZodString;
1653
+ sessionId: z.ZodString;
1654
+ userId: z.ZodString;
1655
+ }, "strip", z.ZodTypeAny, {
1656
+ connectionId?: string;
1657
+ sessionId?: string;
1658
+ userId?: string;
1659
+ }, {
1660
+ connectionId?: string;
1661
+ sessionId?: string;
1662
+ userId?: string;
1663
+ }>;
1664
+ event: z.ZodAny;
1665
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1666
+ }, "strip", z.ZodTypeAny, {
1667
+ type?: "device";
1668
+ connection?: {
1669
+ connectionId?: string;
1670
+ sessionId?: string;
1671
+ userId?: string;
1672
+ };
1673
+ event?: any;
1674
+ taskId?: string | number;
1675
+ }, {
1676
+ type?: "device";
1677
+ connection?: {
1678
+ connectionId?: string;
1679
+ sessionId?: string;
1680
+ userId?: string;
1681
+ };
1682
+ event?: any;
1683
+ taskId?: string | number;
1684
+ }>, z.ZodObject<{
1685
+ type: z.ZodLiteral<"device_result">;
1686
+ result: z.ZodAny;
1687
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1688
+ connection: z.ZodObject<{
1689
+ connectionId: z.ZodString;
1690
+ sessionId: z.ZodString;
1691
+ userId: z.ZodString;
1692
+ }, "strip", z.ZodTypeAny, {
1693
+ connectionId?: string;
1694
+ sessionId?: string;
1695
+ userId?: string;
1696
+ }, {
1697
+ connectionId?: string;
1698
+ sessionId?: string;
1699
+ userId?: string;
1700
+ }>;
1701
+ }, "strip", z.ZodTypeAny, {
1702
+ type?: "device_result";
1703
+ result?: any;
1704
+ taskId?: string | number;
1705
+ connection?: {
1706
+ connectionId?: string;
1707
+ sessionId?: string;
1708
+ userId?: string;
1709
+ };
1710
+ }, {
1711
+ type?: "device_result";
1712
+ result?: any;
1713
+ taskId?: string | number;
1714
+ connection?: {
1715
+ connectionId?: string;
1716
+ sessionId?: string;
1717
+ userId?: string;
1718
+ };
1719
+ }>, z.ZodObject<{
1720
+ type: z.ZodLiteral<"device_error">;
1721
+ error: z.ZodAny;
1722
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1723
+ connection: z.ZodObject<{
1724
+ connectionId: z.ZodString;
1725
+ sessionId: z.ZodString;
1726
+ userId: z.ZodString;
1727
+ }, "strip", z.ZodTypeAny, {
1728
+ connectionId?: string;
1729
+ sessionId?: string;
1730
+ userId?: string;
1731
+ }, {
1732
+ connectionId?: string;
1733
+ sessionId?: string;
1734
+ userId?: string;
1735
+ }>;
1736
+ }, "strip", z.ZodTypeAny, {
1737
+ type?: "device_error";
1738
+ error?: any;
1739
+ taskId?: string | number;
1740
+ connection?: {
1741
+ connectionId?: string;
1742
+ sessionId?: string;
1743
+ userId?: string;
1744
+ };
1745
+ }, {
1746
+ type?: "device_error";
1747
+ error?: any;
1748
+ taskId?: string | number;
1749
+ connection?: {
1750
+ connectionId?: string;
1751
+ sessionId?: string;
1752
+ userId?: string;
1753
+ };
1754
+ }>]>;
1755
+ }, "strip", z.ZodTypeAny, {
1756
+ type?: "repo/receive_action";
1757
+ recordName?: string;
1758
+ inst?: string;
1759
+ branch?: string;
1760
+ action?: {
1761
+ type?: "device";
1762
+ connection?: {
1763
+ connectionId?: string;
1764
+ sessionId?: string;
1765
+ userId?: string;
1766
+ };
1767
+ event?: any;
1768
+ taskId?: string | number;
1769
+ } | {
1770
+ type?: "device_result";
1771
+ result?: any;
1772
+ taskId?: string | number;
1773
+ connection?: {
1774
+ connectionId?: string;
1775
+ sessionId?: string;
1776
+ userId?: string;
1777
+ };
1778
+ } | {
1779
+ type?: "device_error";
1780
+ error?: any;
1781
+ taskId?: string | number;
1782
+ connection?: {
1783
+ connectionId?: string;
1784
+ sessionId?: string;
1785
+ userId?: string;
1786
+ };
1787
+ };
1788
+ }, {
1789
+ type?: "repo/receive_action";
1790
+ recordName?: string;
1791
+ inst?: string;
1792
+ branch?: string;
1793
+ action?: {
1794
+ type?: "device";
1795
+ connection?: {
1796
+ connectionId?: string;
1797
+ sessionId?: string;
1798
+ userId?: string;
1799
+ };
1800
+ event?: any;
1801
+ taskId?: string | number;
1802
+ } | {
1803
+ type?: "device_result";
1804
+ result?: any;
1805
+ taskId?: string | number;
1806
+ connection?: {
1807
+ connectionId?: string;
1808
+ sessionId?: string;
1809
+ userId?: string;
1810
+ };
1811
+ } | {
1812
+ type?: "device_error";
1813
+ error?: any;
1814
+ taskId?: string | number;
1815
+ connection?: {
1816
+ connectionId?: string;
1817
+ sessionId?: string;
1818
+ userId?: string;
1819
+ };
1820
+ };
1821
+ }>, z.ZodObject<{
1822
+ type: z.ZodLiteral<"repo/watch_branch_devices">;
1823
+ recordName: z.ZodNullable<z.ZodString>;
1824
+ inst: z.ZodString;
1825
+ branch: z.ZodString;
1826
+ }, "strip", z.ZodTypeAny, {
1827
+ type?: "repo/watch_branch_devices";
1828
+ recordName?: string;
1829
+ inst?: string;
1830
+ branch?: string;
1831
+ }, {
1832
+ type?: "repo/watch_branch_devices";
1833
+ recordName?: string;
1834
+ inst?: string;
1835
+ branch?: string;
1836
+ }>, z.ZodObject<{
1837
+ type: z.ZodLiteral<"repo/unwatch_branch_devices">;
1838
+ recordName: z.ZodNullable<z.ZodString>;
1839
+ inst: z.ZodString;
1840
+ branch: z.ZodString;
1841
+ }, "strip", z.ZodTypeAny, {
1842
+ type?: "repo/unwatch_branch_devices";
1843
+ recordName?: string;
1844
+ inst?: string;
1845
+ branch?: string;
1846
+ }, {
1847
+ type?: "repo/unwatch_branch_devices";
1848
+ recordName?: string;
1849
+ inst?: string;
1850
+ branch?: string;
1851
+ }>, z.ZodObject<{
1852
+ type: z.ZodLiteral<"repo/connected_to_branch">;
1853
+ broadcast: z.ZodBoolean;
1854
+ branch: z.ZodObject<{
1855
+ type: z.ZodLiteral<"repo/watch_branch">;
1856
+ recordName: z.ZodNullable<z.ZodString>;
1857
+ inst: z.ZodString;
1858
+ branch: z.ZodString;
1859
+ temporary: z.ZodOptional<z.ZodBoolean>;
1860
+ }, "strip", z.ZodTypeAny, {
1861
+ type?: "repo/watch_branch";
1862
+ recordName?: string;
1863
+ inst?: string;
1864
+ branch?: string;
1865
+ temporary?: boolean;
1866
+ }, {
1867
+ type?: "repo/watch_branch";
1868
+ recordName?: string;
1869
+ inst?: string;
1870
+ branch?: string;
1871
+ temporary?: boolean;
1872
+ }>;
1873
+ connection: z.ZodObject<{
1874
+ connectionId: z.ZodString;
1875
+ sessionId: z.ZodString;
1876
+ userId: z.ZodString;
1877
+ }, "strip", z.ZodTypeAny, {
1878
+ connectionId?: string;
1879
+ sessionId?: string;
1880
+ userId?: string;
1881
+ }, {
1882
+ connectionId?: string;
1883
+ sessionId?: string;
1884
+ userId?: string;
1885
+ }>;
1886
+ }, "strip", z.ZodTypeAny, {
1887
+ type?: "repo/connected_to_branch";
1888
+ broadcast?: boolean;
1889
+ branch?: {
1890
+ type?: "repo/watch_branch";
1891
+ recordName?: string;
1892
+ inst?: string;
1893
+ branch?: string;
1894
+ temporary?: boolean;
1895
+ };
1896
+ connection?: {
1897
+ connectionId?: string;
1898
+ sessionId?: string;
1899
+ userId?: string;
1900
+ };
1901
+ }, {
1902
+ type?: "repo/connected_to_branch";
1903
+ broadcast?: boolean;
1904
+ branch?: {
1905
+ type?: "repo/watch_branch";
1906
+ recordName?: string;
1907
+ inst?: string;
1908
+ branch?: string;
1909
+ temporary?: boolean;
1910
+ };
1911
+ connection?: {
1912
+ connectionId?: string;
1913
+ sessionId?: string;
1914
+ userId?: string;
1915
+ };
1916
+ }>, z.ZodObject<{
1917
+ type: z.ZodLiteral<"repo/disconnected_from_branch">;
1918
+ broadcast: z.ZodBoolean;
1919
+ recordName: z.ZodNullable<z.ZodString>;
1920
+ inst: z.ZodString;
1921
+ branch: z.ZodString;
1922
+ connection: z.ZodObject<{
1923
+ connectionId: z.ZodString;
1924
+ sessionId: z.ZodString;
1925
+ userId: z.ZodString;
1926
+ }, "strip", z.ZodTypeAny, {
1927
+ connectionId?: string;
1928
+ sessionId?: string;
1929
+ userId?: string;
1930
+ }, {
1931
+ connectionId?: string;
1932
+ sessionId?: string;
1933
+ userId?: string;
1934
+ }>;
1935
+ }, "strip", z.ZodTypeAny, {
1936
+ type?: "repo/disconnected_from_branch";
1937
+ broadcast?: boolean;
1938
+ recordName?: string;
1939
+ inst?: string;
1940
+ branch?: string;
1941
+ connection?: {
1942
+ connectionId?: string;
1943
+ sessionId?: string;
1944
+ userId?: string;
1945
+ };
1946
+ }, {
1947
+ type?: "repo/disconnected_from_branch";
1948
+ broadcast?: boolean;
1949
+ recordName?: string;
1950
+ inst?: string;
1951
+ branch?: string;
1952
+ connection?: {
1953
+ connectionId?: string;
1954
+ sessionId?: string;
1955
+ userId?: string;
1956
+ };
1957
+ }>, z.ZodObject<{
1958
+ type: z.ZodLiteral<"repo/connection_count">;
1959
+ recordName: z.ZodNullable<z.ZodString>;
1960
+ inst: z.ZodNullable<z.ZodString>;
1961
+ branch: z.ZodNullable<z.ZodString>;
1962
+ count: z.ZodOptional<z.ZodNumber>;
1963
+ }, "strip", z.ZodTypeAny, {
1964
+ type?: "repo/connection_count";
1965
+ recordName?: string;
1966
+ inst?: string;
1967
+ branch?: string;
1968
+ count?: number;
1969
+ }, {
1970
+ type?: "repo/connection_count";
1971
+ recordName?: string;
1972
+ inst?: string;
1973
+ branch?: string;
1974
+ count?: number;
1975
+ }>, z.ZodObject<{
1976
+ type: z.ZodLiteral<"sync/time">;
1977
+ id: z.ZodNumber;
1978
+ clientRequestTime: z.ZodNumber;
1979
+ }, "strip", z.ZodTypeAny, {
1980
+ type?: "sync/time";
1981
+ id?: number;
1982
+ clientRequestTime?: number;
1983
+ }, {
1984
+ type?: "sync/time";
1985
+ id?: number;
1986
+ clientRequestTime?: number;
1987
+ }>, z.ZodObject<{
1988
+ type: z.ZodLiteral<"sync/time/response">;
1989
+ id: z.ZodNumber;
1990
+ clientRequestTime: z.ZodNumber;
1991
+ serverReceiveTime: z.ZodNumber;
1992
+ serverTransmitTime: z.ZodNumber;
1993
+ }, "strip", z.ZodTypeAny, {
1994
+ type?: "sync/time/response";
1995
+ id?: number;
1996
+ clientRequestTime?: number;
1997
+ serverReceiveTime?: number;
1998
+ serverTransmitTime?: number;
1999
+ }, {
2000
+ type?: "sync/time/response";
2001
+ id?: number;
2002
+ clientRequestTime?: number;
2003
+ serverReceiveTime?: number;
2004
+ serverTransmitTime?: number;
2005
+ }>, z.ZodObject<{
2006
+ type: z.ZodLiteral<"rate_limit_exceeded">;
2007
+ retryAfter: z.ZodNumber;
2008
+ totalHits: z.ZodNumber;
2009
+ }, "strip", z.ZodTypeAny, {
2010
+ type?: "rate_limit_exceeded";
2011
+ retryAfter?: number;
2012
+ totalHits?: number;
2013
+ }, {
2014
+ type?: "rate_limit_exceeded";
2015
+ retryAfter?: number;
2016
+ totalHits?: number;
2017
+ }>, z.ZodObject<{
2018
+ type: z.ZodLiteral<"repo/get_updates">;
2019
+ recordName: z.ZodNullable<z.ZodString>;
2020
+ inst: z.ZodString;
2021
+ branch: z.ZodString;
2022
+ }, "strip", z.ZodTypeAny, {
2023
+ type?: "repo/get_updates";
2024
+ recordName?: string;
2025
+ inst?: string;
2026
+ branch?: string;
2027
+ }, {
2028
+ type?: "repo/get_updates";
2029
+ recordName?: string;
2030
+ inst?: string;
2031
+ branch?: string;
2032
+ }>]>;
2033
+ export declare const websocketMessageEventSchema: z.ZodTuple<[z.ZodLiteral<WebsocketEventTypes.Message>, z.ZodNumber, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2034
+ type: z.ZodLiteral<"login">;
2035
+ connectionToken: z.ZodOptional<z.ZodString>;
2036
+ connectionId: z.ZodOptional<z.ZodString>;
2037
+ }, "strip", z.ZodTypeAny, {
2038
+ type?: "login";
2039
+ connectionToken?: string;
2040
+ connectionId?: string;
2041
+ }, {
2042
+ type?: "login";
2043
+ connectionToken?: string;
2044
+ connectionId?: string;
2045
+ }>, z.ZodObject<{
2046
+ type: z.ZodLiteral<"login_result">;
2047
+ }, "strip", z.ZodTypeAny, {
2048
+ type?: "login_result";
2049
+ }, {
2050
+ type?: "login_result";
2051
+ }>, z.ZodObject<{
2052
+ type: z.ZodLiteral<"repo/watch_branch">;
2053
+ recordName: z.ZodNullable<z.ZodString>;
2054
+ inst: z.ZodString;
2055
+ branch: z.ZodString;
2056
+ temporary: z.ZodOptional<z.ZodBoolean>;
2057
+ }, "strip", z.ZodTypeAny, {
2058
+ type?: "repo/watch_branch";
2059
+ recordName?: string;
2060
+ inst?: string;
2061
+ branch?: string;
2062
+ temporary?: boolean;
2063
+ }, {
2064
+ type?: "repo/watch_branch";
2065
+ recordName?: string;
2066
+ inst?: string;
2067
+ branch?: string;
2068
+ temporary?: boolean;
2069
+ }>, z.ZodObject<{
2070
+ type: z.ZodLiteral<"repo/unwatch_branch">;
2071
+ recordName: z.ZodNullable<z.ZodString>;
2072
+ inst: z.ZodString;
2073
+ branch: z.ZodString;
2074
+ }, "strip", z.ZodTypeAny, {
2075
+ type?: "repo/unwatch_branch";
2076
+ recordName?: string;
2077
+ inst?: string;
2078
+ branch?: string;
2079
+ }, {
2080
+ type?: "repo/unwatch_branch";
2081
+ recordName?: string;
2082
+ inst?: string;
2083
+ branch?: string;
2084
+ }>, z.ZodObject<{
2085
+ type: z.ZodLiteral<"repo/add_updates">;
2086
+ recordName: z.ZodNullable<z.ZodString>;
2087
+ inst: z.ZodString;
2088
+ branch: z.ZodString;
2089
+ updates: z.ZodArray<z.ZodString, "many">;
2090
+ updateId: z.ZodOptional<z.ZodNumber>;
2091
+ initial: z.ZodOptional<z.ZodBoolean>;
2092
+ timestamps: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
2093
+ }, "strip", z.ZodTypeAny, {
2094
+ type?: "repo/add_updates";
2095
+ recordName?: string;
2096
+ inst?: string;
2097
+ branch?: string;
2098
+ updates?: string[];
2099
+ updateId?: number;
2100
+ initial?: boolean;
2101
+ timestamps?: number[];
2102
+ }, {
2103
+ type?: "repo/add_updates";
2104
+ recordName?: string;
2105
+ inst?: string;
2106
+ branch?: string;
2107
+ updates?: string[];
2108
+ updateId?: number;
2109
+ initial?: boolean;
2110
+ timestamps?: number[];
2111
+ }>, z.ZodObject<{
2112
+ type: z.ZodLiteral<"repo/updates_received">;
2113
+ recordName: z.ZodNullable<z.ZodString>;
2114
+ inst: z.ZodString;
2115
+ branch: z.ZodString;
2116
+ updateId: z.ZodNumber;
2117
+ errorCode: z.ZodOptional<z.ZodEnum<["max_size_reached", "record_not_found", "inst_not_found"]>>;
2118
+ maxBranchSizeInBytes: z.ZodOptional<z.ZodNumber>;
2119
+ neededBranchSizeInBytes: z.ZodOptional<z.ZodNumber>;
2120
+ }, "strip", z.ZodTypeAny, {
2121
+ type?: "repo/updates_received";
2122
+ recordName?: string;
2123
+ inst?: string;
2124
+ branch?: string;
2125
+ updateId?: number;
2126
+ errorCode?: "max_size_reached" | "record_not_found" | "inst_not_found";
2127
+ maxBranchSizeInBytes?: number;
2128
+ neededBranchSizeInBytes?: number;
2129
+ }, {
2130
+ type?: "repo/updates_received";
2131
+ recordName?: string;
2132
+ inst?: string;
2133
+ branch?: string;
2134
+ updateId?: number;
2135
+ errorCode?: "max_size_reached" | "record_not_found" | "inst_not_found";
2136
+ maxBranchSizeInBytes?: number;
2137
+ neededBranchSizeInBytes?: number;
2138
+ }>, z.ZodObject<{
2139
+ type: z.ZodLiteral<"repo/send_action">;
2140
+ recordName: z.ZodNullable<z.ZodString>;
2141
+ inst: z.ZodString;
2142
+ branch: z.ZodString;
2143
+ action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2144
+ connectionId: z.ZodOptional<z.ZodString>;
2145
+ sessionId: z.ZodOptional<z.ZodString>;
2146
+ userId: z.ZodOptional<z.ZodString>;
2147
+ broadcast: z.ZodOptional<z.ZodBoolean>;
2148
+ type: z.ZodLiteral<"remote">;
2149
+ event: z.ZodAny;
2150
+ allowBatching: z.ZodOptional<z.ZodBoolean>;
2151
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2152
+ }, "strip", z.ZodTypeAny, {
2153
+ connectionId?: string;
2154
+ sessionId?: string;
2155
+ userId?: string;
2156
+ broadcast?: boolean;
2157
+ type?: "remote";
2158
+ event?: any;
2159
+ allowBatching?: boolean;
2160
+ taskId?: string | number;
2161
+ }, {
2162
+ connectionId?: string;
2163
+ sessionId?: string;
2164
+ userId?: string;
2165
+ broadcast?: boolean;
2166
+ type?: "remote";
2167
+ event?: any;
2168
+ allowBatching?: boolean;
2169
+ taskId?: string | number;
2170
+ }>, z.ZodObject<{
2171
+ connectionId: z.ZodOptional<z.ZodString>;
2172
+ sessionId: z.ZodOptional<z.ZodString>;
2173
+ userId: z.ZodOptional<z.ZodString>;
2174
+ broadcast: z.ZodOptional<z.ZodBoolean>;
2175
+ type: z.ZodLiteral<"remote_result">;
2176
+ result: z.ZodOptional<z.ZodAny>;
2177
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2178
+ }, "strip", z.ZodTypeAny, {
2179
+ connectionId?: string;
2180
+ sessionId?: string;
2181
+ userId?: string;
2182
+ broadcast?: boolean;
2183
+ type?: "remote_result";
2184
+ result?: any;
2185
+ taskId?: string | number;
2186
+ }, {
2187
+ connectionId?: string;
2188
+ sessionId?: string;
2189
+ userId?: string;
2190
+ broadcast?: boolean;
2191
+ type?: "remote_result";
2192
+ result?: any;
2193
+ taskId?: string | number;
2194
+ }>, z.ZodObject<{
2195
+ connectionId: z.ZodOptional<z.ZodString>;
2196
+ sessionId: z.ZodOptional<z.ZodString>;
2197
+ userId: z.ZodOptional<z.ZodString>;
2198
+ broadcast: z.ZodOptional<z.ZodBoolean>;
2199
+ type: z.ZodLiteral<"remote_error">;
2200
+ error: z.ZodAny;
2201
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2202
+ }, "strip", z.ZodTypeAny, {
2203
+ connectionId?: string;
2204
+ sessionId?: string;
2205
+ userId?: string;
2206
+ broadcast?: boolean;
2207
+ type?: "remote_error";
2208
+ error?: any;
2209
+ taskId?: string | number;
2210
+ }, {
2211
+ connectionId?: string;
2212
+ sessionId?: string;
2213
+ userId?: string;
2214
+ broadcast?: boolean;
2215
+ type?: "remote_error";
2216
+ error?: any;
2217
+ taskId?: string | number;
2218
+ }>]>;
2219
+ }, "strip", z.ZodTypeAny, {
2220
+ type?: "repo/send_action";
2221
+ recordName?: string;
2222
+ inst?: string;
2223
+ branch?: string;
2224
+ action?: {
2225
+ connectionId?: string;
2226
+ sessionId?: string;
2227
+ userId?: string;
2228
+ broadcast?: boolean;
2229
+ type?: "remote";
2230
+ event?: any;
2231
+ allowBatching?: boolean;
2232
+ taskId?: string | number;
2233
+ } | {
2234
+ connectionId?: string;
2235
+ sessionId?: string;
2236
+ userId?: string;
2237
+ broadcast?: boolean;
2238
+ type?: "remote_result";
2239
+ result?: any;
2240
+ taskId?: string | number;
2241
+ } | {
2242
+ connectionId?: string;
2243
+ sessionId?: string;
2244
+ userId?: string;
2245
+ broadcast?: boolean;
2246
+ type?: "remote_error";
2247
+ error?: any;
2248
+ taskId?: string | number;
2249
+ };
2250
+ }, {
2251
+ type?: "repo/send_action";
2252
+ recordName?: string;
2253
+ inst?: string;
2254
+ branch?: string;
2255
+ action?: {
2256
+ connectionId?: string;
2257
+ sessionId?: string;
2258
+ userId?: string;
2259
+ broadcast?: boolean;
2260
+ type?: "remote";
2261
+ event?: any;
2262
+ allowBatching?: boolean;
2263
+ taskId?: string | number;
2264
+ } | {
2265
+ connectionId?: string;
2266
+ sessionId?: string;
2267
+ userId?: string;
2268
+ broadcast?: boolean;
2269
+ type?: "remote_result";
2270
+ result?: any;
2271
+ taskId?: string | number;
2272
+ } | {
2273
+ connectionId?: string;
2274
+ sessionId?: string;
2275
+ userId?: string;
2276
+ broadcast?: boolean;
2277
+ type?: "remote_error";
2278
+ error?: any;
2279
+ taskId?: string | number;
2280
+ };
2281
+ }>, z.ZodObject<{
2282
+ type: z.ZodLiteral<"repo/receive_action">;
2283
+ recordName: z.ZodNullable<z.ZodString>;
2284
+ inst: z.ZodString;
2285
+ branch: z.ZodString;
2286
+ action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2287
+ type: z.ZodLiteral<"device">;
2288
+ connection: z.ZodObject<{
2289
+ connectionId: z.ZodString;
2290
+ sessionId: z.ZodString;
2291
+ userId: z.ZodString;
2292
+ }, "strip", z.ZodTypeAny, {
2293
+ connectionId?: string;
2294
+ sessionId?: string;
2295
+ userId?: string;
2296
+ }, {
2297
+ connectionId?: string;
2298
+ sessionId?: string;
2299
+ userId?: string;
2300
+ }>;
2301
+ event: z.ZodAny;
2302
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2303
+ }, "strip", z.ZodTypeAny, {
2304
+ type?: "device";
2305
+ connection?: {
2306
+ connectionId?: string;
2307
+ sessionId?: string;
2308
+ userId?: string;
2309
+ };
2310
+ event?: any;
2311
+ taskId?: string | number;
2312
+ }, {
2313
+ type?: "device";
2314
+ connection?: {
2315
+ connectionId?: string;
2316
+ sessionId?: string;
2317
+ userId?: string;
2318
+ };
2319
+ event?: any;
2320
+ taskId?: string | number;
2321
+ }>, z.ZodObject<{
2322
+ type: z.ZodLiteral<"device_result">;
2323
+ result: z.ZodAny;
2324
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2325
+ connection: z.ZodObject<{
2326
+ connectionId: z.ZodString;
2327
+ sessionId: z.ZodString;
2328
+ userId: z.ZodString;
2329
+ }, "strip", z.ZodTypeAny, {
2330
+ connectionId?: string;
2331
+ sessionId?: string;
2332
+ userId?: string;
2333
+ }, {
2334
+ connectionId?: string;
2335
+ sessionId?: string;
2336
+ userId?: string;
2337
+ }>;
2338
+ }, "strip", z.ZodTypeAny, {
2339
+ type?: "device_result";
2340
+ result?: any;
2341
+ taskId?: string | number;
2342
+ connection?: {
2343
+ connectionId?: string;
2344
+ sessionId?: string;
2345
+ userId?: string;
2346
+ };
2347
+ }, {
2348
+ type?: "device_result";
2349
+ result?: any;
2350
+ taskId?: string | number;
2351
+ connection?: {
2352
+ connectionId?: string;
2353
+ sessionId?: string;
2354
+ userId?: string;
2355
+ };
2356
+ }>, z.ZodObject<{
2357
+ type: z.ZodLiteral<"device_error">;
2358
+ error: z.ZodAny;
2359
+ taskId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2360
+ connection: z.ZodObject<{
2361
+ connectionId: z.ZodString;
2362
+ sessionId: z.ZodString;
2363
+ userId: z.ZodString;
2364
+ }, "strip", z.ZodTypeAny, {
2365
+ connectionId?: string;
2366
+ sessionId?: string;
2367
+ userId?: string;
2368
+ }, {
2369
+ connectionId?: string;
2370
+ sessionId?: string;
2371
+ userId?: string;
2372
+ }>;
2373
+ }, "strip", z.ZodTypeAny, {
2374
+ type?: "device_error";
2375
+ error?: any;
2376
+ taskId?: string | number;
2377
+ connection?: {
2378
+ connectionId?: string;
2379
+ sessionId?: string;
2380
+ userId?: string;
2381
+ };
2382
+ }, {
2383
+ type?: "device_error";
2384
+ error?: any;
2385
+ taskId?: string | number;
2386
+ connection?: {
2387
+ connectionId?: string;
2388
+ sessionId?: string;
2389
+ userId?: string;
2390
+ };
2391
+ }>]>;
2392
+ }, "strip", z.ZodTypeAny, {
2393
+ type?: "repo/receive_action";
2394
+ recordName?: string;
2395
+ inst?: string;
2396
+ branch?: string;
2397
+ action?: {
2398
+ type?: "device";
2399
+ connection?: {
2400
+ connectionId?: string;
2401
+ sessionId?: string;
2402
+ userId?: string;
2403
+ };
2404
+ event?: any;
2405
+ taskId?: string | number;
2406
+ } | {
2407
+ type?: "device_result";
2408
+ result?: any;
2409
+ taskId?: string | number;
2410
+ connection?: {
2411
+ connectionId?: string;
2412
+ sessionId?: string;
2413
+ userId?: string;
2414
+ };
2415
+ } | {
2416
+ type?: "device_error";
2417
+ error?: any;
2418
+ taskId?: string | number;
2419
+ connection?: {
2420
+ connectionId?: string;
2421
+ sessionId?: string;
2422
+ userId?: string;
2423
+ };
2424
+ };
2425
+ }, {
2426
+ type?: "repo/receive_action";
2427
+ recordName?: string;
2428
+ inst?: string;
2429
+ branch?: string;
2430
+ action?: {
2431
+ type?: "device";
2432
+ connection?: {
2433
+ connectionId?: string;
2434
+ sessionId?: string;
2435
+ userId?: string;
2436
+ };
2437
+ event?: any;
2438
+ taskId?: string | number;
2439
+ } | {
2440
+ type?: "device_result";
2441
+ result?: any;
2442
+ taskId?: string | number;
2443
+ connection?: {
2444
+ connectionId?: string;
2445
+ sessionId?: string;
2446
+ userId?: string;
2447
+ };
2448
+ } | {
2449
+ type?: "device_error";
2450
+ error?: any;
2451
+ taskId?: string | number;
2452
+ connection?: {
2453
+ connectionId?: string;
2454
+ sessionId?: string;
2455
+ userId?: string;
2456
+ };
2457
+ };
2458
+ }>, z.ZodObject<{
2459
+ type: z.ZodLiteral<"repo/watch_branch_devices">;
2460
+ recordName: z.ZodNullable<z.ZodString>;
2461
+ inst: z.ZodString;
2462
+ branch: z.ZodString;
2463
+ }, "strip", z.ZodTypeAny, {
2464
+ type?: "repo/watch_branch_devices";
2465
+ recordName?: string;
2466
+ inst?: string;
2467
+ branch?: string;
2468
+ }, {
2469
+ type?: "repo/watch_branch_devices";
2470
+ recordName?: string;
2471
+ inst?: string;
2472
+ branch?: string;
2473
+ }>, z.ZodObject<{
2474
+ type: z.ZodLiteral<"repo/unwatch_branch_devices">;
2475
+ recordName: z.ZodNullable<z.ZodString>;
2476
+ inst: z.ZodString;
2477
+ branch: z.ZodString;
2478
+ }, "strip", z.ZodTypeAny, {
2479
+ type?: "repo/unwatch_branch_devices";
2480
+ recordName?: string;
2481
+ inst?: string;
2482
+ branch?: string;
2483
+ }, {
2484
+ type?: "repo/unwatch_branch_devices";
2485
+ recordName?: string;
2486
+ inst?: string;
2487
+ branch?: string;
2488
+ }>, z.ZodObject<{
2489
+ type: z.ZodLiteral<"repo/connected_to_branch">;
2490
+ broadcast: z.ZodBoolean;
2491
+ branch: z.ZodObject<{
2492
+ type: z.ZodLiteral<"repo/watch_branch">;
2493
+ recordName: z.ZodNullable<z.ZodString>;
2494
+ inst: z.ZodString;
2495
+ branch: z.ZodString;
2496
+ temporary: z.ZodOptional<z.ZodBoolean>;
2497
+ }, "strip", z.ZodTypeAny, {
2498
+ type?: "repo/watch_branch";
2499
+ recordName?: string;
2500
+ inst?: string;
2501
+ branch?: string;
2502
+ temporary?: boolean;
2503
+ }, {
2504
+ type?: "repo/watch_branch";
2505
+ recordName?: string;
2506
+ inst?: string;
2507
+ branch?: string;
2508
+ temporary?: boolean;
2509
+ }>;
2510
+ connection: z.ZodObject<{
2511
+ connectionId: z.ZodString;
2512
+ sessionId: z.ZodString;
2513
+ userId: z.ZodString;
2514
+ }, "strip", z.ZodTypeAny, {
2515
+ connectionId?: string;
2516
+ sessionId?: string;
2517
+ userId?: string;
2518
+ }, {
2519
+ connectionId?: string;
2520
+ sessionId?: string;
2521
+ userId?: string;
2522
+ }>;
2523
+ }, "strip", z.ZodTypeAny, {
2524
+ type?: "repo/connected_to_branch";
2525
+ broadcast?: boolean;
2526
+ branch?: {
2527
+ type?: "repo/watch_branch";
2528
+ recordName?: string;
2529
+ inst?: string;
2530
+ branch?: string;
2531
+ temporary?: boolean;
2532
+ };
2533
+ connection?: {
2534
+ connectionId?: string;
2535
+ sessionId?: string;
2536
+ userId?: string;
2537
+ };
2538
+ }, {
2539
+ type?: "repo/connected_to_branch";
2540
+ broadcast?: boolean;
2541
+ branch?: {
2542
+ type?: "repo/watch_branch";
2543
+ recordName?: string;
2544
+ inst?: string;
2545
+ branch?: string;
2546
+ temporary?: boolean;
2547
+ };
2548
+ connection?: {
2549
+ connectionId?: string;
2550
+ sessionId?: string;
2551
+ userId?: string;
2552
+ };
2553
+ }>, z.ZodObject<{
2554
+ type: z.ZodLiteral<"repo/disconnected_from_branch">;
2555
+ broadcast: z.ZodBoolean;
2556
+ recordName: z.ZodNullable<z.ZodString>;
2557
+ inst: z.ZodString;
2558
+ branch: z.ZodString;
2559
+ connection: z.ZodObject<{
2560
+ connectionId: z.ZodString;
2561
+ sessionId: z.ZodString;
2562
+ userId: z.ZodString;
2563
+ }, "strip", z.ZodTypeAny, {
2564
+ connectionId?: string;
2565
+ sessionId?: string;
2566
+ userId?: string;
2567
+ }, {
2568
+ connectionId?: string;
2569
+ sessionId?: string;
2570
+ userId?: string;
2571
+ }>;
2572
+ }, "strip", z.ZodTypeAny, {
2573
+ type?: "repo/disconnected_from_branch";
2574
+ broadcast?: boolean;
2575
+ recordName?: string;
2576
+ inst?: string;
2577
+ branch?: string;
2578
+ connection?: {
2579
+ connectionId?: string;
2580
+ sessionId?: string;
2581
+ userId?: string;
2582
+ };
2583
+ }, {
2584
+ type?: "repo/disconnected_from_branch";
2585
+ broadcast?: boolean;
2586
+ recordName?: string;
2587
+ inst?: string;
2588
+ branch?: string;
2589
+ connection?: {
2590
+ connectionId?: string;
2591
+ sessionId?: string;
2592
+ userId?: string;
2593
+ };
2594
+ }>, z.ZodObject<{
2595
+ type: z.ZodLiteral<"repo/connection_count">;
2596
+ recordName: z.ZodNullable<z.ZodString>;
2597
+ inst: z.ZodNullable<z.ZodString>;
2598
+ branch: z.ZodNullable<z.ZodString>;
2599
+ count: z.ZodOptional<z.ZodNumber>;
2600
+ }, "strip", z.ZodTypeAny, {
2601
+ type?: "repo/connection_count";
2602
+ recordName?: string;
2603
+ inst?: string;
2604
+ branch?: string;
2605
+ count?: number;
2606
+ }, {
2607
+ type?: "repo/connection_count";
2608
+ recordName?: string;
2609
+ inst?: string;
2610
+ branch?: string;
2611
+ count?: number;
2612
+ }>, z.ZodObject<{
2613
+ type: z.ZodLiteral<"sync/time">;
2614
+ id: z.ZodNumber;
2615
+ clientRequestTime: z.ZodNumber;
2616
+ }, "strip", z.ZodTypeAny, {
2617
+ type?: "sync/time";
2618
+ id?: number;
2619
+ clientRequestTime?: number;
2620
+ }, {
2621
+ type?: "sync/time";
2622
+ id?: number;
2623
+ clientRequestTime?: number;
2624
+ }>, z.ZodObject<{
2625
+ type: z.ZodLiteral<"sync/time/response">;
2626
+ id: z.ZodNumber;
2627
+ clientRequestTime: z.ZodNumber;
2628
+ serverReceiveTime: z.ZodNumber;
2629
+ serverTransmitTime: z.ZodNumber;
2630
+ }, "strip", z.ZodTypeAny, {
2631
+ type?: "sync/time/response";
2632
+ id?: number;
2633
+ clientRequestTime?: number;
2634
+ serverReceiveTime?: number;
2635
+ serverTransmitTime?: number;
2636
+ }, {
2637
+ type?: "sync/time/response";
2638
+ id?: number;
2639
+ clientRequestTime?: number;
2640
+ serverReceiveTime?: number;
2641
+ serverTransmitTime?: number;
2642
+ }>, z.ZodObject<{
2643
+ type: z.ZodLiteral<"rate_limit_exceeded">;
2644
+ retryAfter: z.ZodNumber;
2645
+ totalHits: z.ZodNumber;
2646
+ }, "strip", z.ZodTypeAny, {
2647
+ type?: "rate_limit_exceeded";
2648
+ retryAfter?: number;
2649
+ totalHits?: number;
2650
+ }, {
2651
+ type?: "rate_limit_exceeded";
2652
+ retryAfter?: number;
2653
+ totalHits?: number;
2654
+ }>, z.ZodObject<{
2655
+ type: z.ZodLiteral<"repo/get_updates">;
2656
+ recordName: z.ZodNullable<z.ZodString>;
2657
+ inst: z.ZodString;
2658
+ branch: z.ZodString;
2659
+ }, "strip", z.ZodTypeAny, {
2660
+ type?: "repo/get_updates";
2661
+ recordName?: string;
2662
+ inst?: string;
2663
+ branch?: string;
2664
+ }, {
2665
+ type?: "repo/get_updates";
2666
+ recordName?: string;
2667
+ inst?: string;
2668
+ branch?: string;
2669
+ }>]>], null>;
2670
+ //# sourceMappingURL=WebsocketEvents.d.ts.map