@defensestation/ysync-go 0.1.0-dev.3.3d87b03
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.
- package/README.md +101 -0
- package/dist/client/connect-yjs-provider.d.ts +107 -0
- package/dist/client/connect-yjs-provider.d.ts.map +1 -0
- package/dist/client/connect-yjs-provider.js +333 -0
- package/dist/client/connect-yjs-provider.js.map +1 -0
- package/dist/client/id.d.ts +2 -0
- package/dist/client/id.d.ts.map +1 -0
- package/dist/client/id.js +21 -0
- package/dist/client/id.js.map +1 -0
- package/dist/client/provider-status.d.ts +8 -0
- package/dist/client/provider-status.d.ts.map +1 -0
- package/dist/client/provider-status.js +2 -0
- package/dist/client/provider-status.js.map +1 -0
- package/dist/client/websocket-yjs-provider.d.ts +51 -0
- package/dist/client/websocket-yjs-provider.d.ts.map +1 -0
- package/dist/client/websocket-yjs-provider.js +270 -0
- package/dist/client/websocket-yjs-provider.js.map +1 -0
- package/dist/gen/ysync/v1/sync_pb.d.ts +630 -0
- package/dist/gen/ysync/v1/sync_pb.d.ts.map +1 -0
- package/dist/gen/ysync/v1/sync_pb.js +133 -0
- package/dist/gen/ysync/v1/sync_pb.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
- package/src/client/connect-yjs-provider.ts +358 -0
- package/src/client/id.ts +22 -0
- package/src/client/provider-status.ts +9 -0
- package/src/client/websocket-yjs-provider.ts +335 -0
- package/src/gen/ysync/v1/sync_pb.ts +732 -0
- package/src/index.ts +7 -0
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.12.1 with parameter "target=ts"
|
|
2
|
+
// @generated from file ysync/v1/sync.proto (package ysync.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
6
|
+
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
|
7
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Describes the file ysync/v1/sync.proto.
|
|
11
|
+
*/
|
|
12
|
+
export const file_ysync_v1_sync: GenFile = /*@__PURE__*/
|
|
13
|
+
fileDesc("ChN5c3luYy92MS9zeW5jLnByb3RvEgh5c3luYy52MSLXAQoLU3luY1JlcXVlc3QSDgoGZG9jX2lkGAEgASgJEhEKCWNsaWVudF9pZBgCIAEoCRIiCgRqb2luGAogASgLMhIueXN5bmMudjEuU3luY0pvaW5IABIUCgp5anNfdXBkYXRlGAsgASgMSAASGgoQYXdhcmVuZXNzX3VwZGF0ZRgMIAEoDEgAEh4KBHBpbmcYDSABKAsyDi55c3luYy52MS5QaW5nSAASJAoFbGVhdmUYDiABKAsyEy55c3luYy52MS5TeW5jTGVhdmVIAEIJCgdwYXlsb2FkIjQKDFN5bmNSZXNwb25zZRIkCgVmcmFtZRgBIAEoCzIVLnlzeW5jLnYxLlNlcnZlckZyYW1lIiAKCFN5bmNKb2luEhQKDHN0YXRlX3ZlY3RvchgBIAEoDCILCglTeW5jTGVhdmUi5QEKC1NlcnZlckZyYW1lEg4KBmRvY19pZBgBIAEoCRIYChBzZW5kZXJfY2xpZW50X2lkGAIgASgJEhAKCHNlcXVlbmNlGAMgASgEEhUKC3N5bmNfdXBkYXRlGAogASgMSAASFAoKeWpzX3VwZGF0ZRgLIAEoDEgAEhoKEGF3YXJlbmVzc191cGRhdGUYDCABKAxIABIeCgRwb25nGA0gASgLMg4ueXN5bmMudjEuUG9uZ0gAEiYKBWVycm9yGA4gASgLMhUueXN5bmMudjEuU2VydmVyRXJyb3JIAEIJCgdwYXlsb2FkIk4KE0pvaW5Eb2N1bWVudFJlcXVlc3QSDgoGZG9jX2lkGAEgASgJEhEKCWNsaWVudF9pZBgCIAEoCRIUCgxzdGF0ZV92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WVudEZyYW1lcxIlLnlzeW5jLnYxLlN0cmVhbURvY3VtZW50RnJhbWVzUmVxdWVzdBomLnlzeW5jLnYxLlN0cmVhbURvY3VtZW50RnJhbWVzUmVzcG9uc2UwARJQCg1MZWF2ZURvY3VtZW50Eh4ueXN5bmMudjEuTGVhdmVEb2N1bWVudFJlcXVlc3QaHy55c3luYy52MS5MZWF2ZURvY3VtZW50UmVzcG9uc2USYgoTTGlzdERvY3VtZW50VXBkYXRlcxIkLnlzeW5jLnYxLkxpc3REb2N1bWVudFVwZGF0ZXNSZXF1ZXN0GiUueXN5bmMudjEuTGlzdERvY3VtZW50VXBkYXRlc1Jlc3BvbnNlElYKD0NvbXBhY3REb2N1bWVudBIgLnlzeW5jLnYxLkNvbXBhY3REb2N1bWVudFJlcXVlc3QaIS55c3luYy52MS5Db21wYWN0RG9jdW1lbnRSZXNwb25zZUI8WjpnaXRodWIuY29tL2RlZmVuc2VzdGF0aW9uL3lzeW5jLWdvL2dlbi9nby95c3luYy92MTt5c3luY3YxYgZwcm90bzM");
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @generated from message ysync.v1.SyncRequest
|
|
17
|
+
*/
|
|
18
|
+
export type SyncRequest = Message<"ysync.v1.SyncRequest"> & {
|
|
19
|
+
/**
|
|
20
|
+
* @generated from field: string doc_id = 1;
|
|
21
|
+
*/
|
|
22
|
+
docId: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @generated from field: string client_id = 2;
|
|
26
|
+
*/
|
|
27
|
+
clientId: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @generated from oneof ysync.v1.SyncRequest.payload
|
|
31
|
+
*/
|
|
32
|
+
payload: {
|
|
33
|
+
/**
|
|
34
|
+
* @generated from field: ysync.v1.SyncJoin join = 10;
|
|
35
|
+
*/
|
|
36
|
+
value: SyncJoin;
|
|
37
|
+
case: "join";
|
|
38
|
+
} | {
|
|
39
|
+
/**
|
|
40
|
+
* @generated from field: bytes yjs_update = 11;
|
|
41
|
+
*/
|
|
42
|
+
value: Uint8Array;
|
|
43
|
+
case: "yjsUpdate";
|
|
44
|
+
} | {
|
|
45
|
+
/**
|
|
46
|
+
* @generated from field: bytes awareness_update = 12;
|
|
47
|
+
*/
|
|
48
|
+
value: Uint8Array;
|
|
49
|
+
case: "awarenessUpdate";
|
|
50
|
+
} | {
|
|
51
|
+
/**
|
|
52
|
+
* @generated from field: ysync.v1.Ping ping = 13;
|
|
53
|
+
*/
|
|
54
|
+
value: Ping;
|
|
55
|
+
case: "ping";
|
|
56
|
+
} | {
|
|
57
|
+
/**
|
|
58
|
+
* @generated from field: ysync.v1.SyncLeave leave = 14;
|
|
59
|
+
*/
|
|
60
|
+
value: SyncLeave;
|
|
61
|
+
case: "leave";
|
|
62
|
+
} | { case: undefined; value?: undefined };
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Describes the message ysync.v1.SyncRequest.
|
|
67
|
+
* Use `create(SyncRequestSchema)` to create a new message.
|
|
68
|
+
*/
|
|
69
|
+
export const SyncRequestSchema: GenMessage<SyncRequest> = /*@__PURE__*/
|
|
70
|
+
messageDesc(file_ysync_v1_sync, 0);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @generated from message ysync.v1.SyncResponse
|
|
74
|
+
*/
|
|
75
|
+
export type SyncResponse = Message<"ysync.v1.SyncResponse"> & {
|
|
76
|
+
/**
|
|
77
|
+
* @generated from field: ysync.v1.ServerFrame frame = 1;
|
|
78
|
+
*/
|
|
79
|
+
frame?: ServerFrame | undefined;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Describes the message ysync.v1.SyncResponse.
|
|
84
|
+
* Use `create(SyncResponseSchema)` to create a new message.
|
|
85
|
+
*/
|
|
86
|
+
export const SyncResponseSchema: GenMessage<SyncResponse> = /*@__PURE__*/
|
|
87
|
+
messageDesc(file_ysync_v1_sync, 1);
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @generated from message ysync.v1.SyncJoin
|
|
91
|
+
*/
|
|
92
|
+
export type SyncJoin = Message<"ysync.v1.SyncJoin"> & {
|
|
93
|
+
/**
|
|
94
|
+
* @generated from field: bytes state_vector = 1;
|
|
95
|
+
*/
|
|
96
|
+
stateVector: Uint8Array;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Describes the message ysync.v1.SyncJoin.
|
|
101
|
+
* Use `create(SyncJoinSchema)` to create a new message.
|
|
102
|
+
*/
|
|
103
|
+
export const SyncJoinSchema: GenMessage<SyncJoin> = /*@__PURE__*/
|
|
104
|
+
messageDesc(file_ysync_v1_sync, 2);
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @generated from message ysync.v1.SyncLeave
|
|
108
|
+
*/
|
|
109
|
+
export type SyncLeave = Message<"ysync.v1.SyncLeave"> & {
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Describes the message ysync.v1.SyncLeave.
|
|
114
|
+
* Use `create(SyncLeaveSchema)` to create a new message.
|
|
115
|
+
*/
|
|
116
|
+
export const SyncLeaveSchema: GenMessage<SyncLeave> = /*@__PURE__*/
|
|
117
|
+
messageDesc(file_ysync_v1_sync, 3);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @generated from message ysync.v1.ServerFrame
|
|
121
|
+
*/
|
|
122
|
+
export type ServerFrame = Message<"ysync.v1.ServerFrame"> & {
|
|
123
|
+
/**
|
|
124
|
+
* @generated from field: string doc_id = 1;
|
|
125
|
+
*/
|
|
126
|
+
docId: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @generated from field: string sender_client_id = 2;
|
|
130
|
+
*/
|
|
131
|
+
senderClientId: string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @generated from field: uint64 sequence = 3;
|
|
135
|
+
*/
|
|
136
|
+
sequence: bigint;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @generated from oneof ysync.v1.ServerFrame.payload
|
|
140
|
+
*/
|
|
141
|
+
payload: {
|
|
142
|
+
/**
|
|
143
|
+
* @generated from field: bytes sync_update = 10;
|
|
144
|
+
*/
|
|
145
|
+
value: Uint8Array;
|
|
146
|
+
case: "syncUpdate";
|
|
147
|
+
} | {
|
|
148
|
+
/**
|
|
149
|
+
* @generated from field: bytes yjs_update = 11;
|
|
150
|
+
*/
|
|
151
|
+
value: Uint8Array;
|
|
152
|
+
case: "yjsUpdate";
|
|
153
|
+
} | {
|
|
154
|
+
/**
|
|
155
|
+
* @generated from field: bytes awareness_update = 12;
|
|
156
|
+
*/
|
|
157
|
+
value: Uint8Array;
|
|
158
|
+
case: "awarenessUpdate";
|
|
159
|
+
} | {
|
|
160
|
+
/**
|
|
161
|
+
* @generated from field: ysync.v1.Pong pong = 13;
|
|
162
|
+
*/
|
|
163
|
+
value: Pong;
|
|
164
|
+
case: "pong";
|
|
165
|
+
} | {
|
|
166
|
+
/**
|
|
167
|
+
* @generated from field: ysync.v1.ServerError error = 14;
|
|
168
|
+
*/
|
|
169
|
+
value: ServerError;
|
|
170
|
+
case: "error";
|
|
171
|
+
} | { case: undefined; value?: undefined };
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Describes the message ysync.v1.ServerFrame.
|
|
176
|
+
* Use `create(ServerFrameSchema)` to create a new message.
|
|
177
|
+
*/
|
|
178
|
+
export const ServerFrameSchema: GenMessage<ServerFrame> = /*@__PURE__*/
|
|
179
|
+
messageDesc(file_ysync_v1_sync, 4);
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @generated from message ysync.v1.JoinDocumentRequest
|
|
183
|
+
*/
|
|
184
|
+
export type JoinDocumentRequest = Message<"ysync.v1.JoinDocumentRequest"> & {
|
|
185
|
+
/**
|
|
186
|
+
* @generated from field: string doc_id = 1;
|
|
187
|
+
*/
|
|
188
|
+
docId: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @generated from field: string client_id = 2;
|
|
192
|
+
*/
|
|
193
|
+
clientId: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @generated from field: bytes state_vector = 3;
|
|
197
|
+
*/
|
|
198
|
+
stateVector: Uint8Array;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Describes the message ysync.v1.JoinDocumentRequest.
|
|
203
|
+
* Use `create(JoinDocumentRequestSchema)` to create a new message.
|
|
204
|
+
*/
|
|
205
|
+
export const JoinDocumentRequestSchema: GenMessage<JoinDocumentRequest> = /*@__PURE__*/
|
|
206
|
+
messageDesc(file_ysync_v1_sync, 5);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @generated from message ysync.v1.JoinDocumentResponse
|
|
210
|
+
*/
|
|
211
|
+
export type JoinDocumentResponse = Message<"ysync.v1.JoinDocumentResponse"> & {
|
|
212
|
+
/**
|
|
213
|
+
* @generated from field: uint64 sequence = 1;
|
|
214
|
+
*/
|
|
215
|
+
sequence: bigint;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @generated from field: repeated bytes sync_updates = 2;
|
|
219
|
+
*/
|
|
220
|
+
syncUpdates: Uint8Array[];
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Server-assigned presence identity: the display name is the server's
|
|
224
|
+
* sanitized view of the caller, and the color is assigned from a palette so
|
|
225
|
+
* concurrent participants get distinct colors. Clients should use these for
|
|
226
|
+
* awareness/cursor rendering instead of picking their own.
|
|
227
|
+
*
|
|
228
|
+
* @generated from field: string assigned_display_name = 3;
|
|
229
|
+
*/
|
|
230
|
+
assignedDisplayName: string;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @generated from field: string assigned_color = 4;
|
|
234
|
+
*/
|
|
235
|
+
assignedColor: string;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Describes the message ysync.v1.JoinDocumentResponse.
|
|
240
|
+
* Use `create(JoinDocumentResponseSchema)` to create a new message.
|
|
241
|
+
*/
|
|
242
|
+
export const JoinDocumentResponseSchema: GenMessage<JoinDocumentResponse> = /*@__PURE__*/
|
|
243
|
+
messageDesc(file_ysync_v1_sync, 6);
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* @generated from message ysync.v1.PushYjsUpdateRequest
|
|
247
|
+
*/
|
|
248
|
+
export type PushYjsUpdateRequest = Message<"ysync.v1.PushYjsUpdateRequest"> & {
|
|
249
|
+
/**
|
|
250
|
+
* @generated from field: string doc_id = 1;
|
|
251
|
+
*/
|
|
252
|
+
docId: string;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @generated from field: string client_id = 2;
|
|
256
|
+
*/
|
|
257
|
+
clientId: string;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @generated from field: bytes yjs_update = 3;
|
|
261
|
+
*/
|
|
262
|
+
yjsUpdate: Uint8Array;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @generated from field: string idempotency_key = 4;
|
|
266
|
+
*/
|
|
267
|
+
idempotencyKey: string;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Describes the message ysync.v1.PushYjsUpdateRequest.
|
|
272
|
+
* Use `create(PushYjsUpdateRequestSchema)` to create a new message.
|
|
273
|
+
*/
|
|
274
|
+
export const PushYjsUpdateRequestSchema: GenMessage<PushYjsUpdateRequest> = /*@__PURE__*/
|
|
275
|
+
messageDesc(file_ysync_v1_sync, 7);
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* @generated from message ysync.v1.PushYjsUpdateResponse
|
|
279
|
+
*/
|
|
280
|
+
export type PushYjsUpdateResponse = Message<"ysync.v1.PushYjsUpdateResponse"> & {
|
|
281
|
+
/**
|
|
282
|
+
* @generated from field: uint64 sequence = 1;
|
|
283
|
+
*/
|
|
284
|
+
sequence: bigint;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Describes the message ysync.v1.PushYjsUpdateResponse.
|
|
289
|
+
* Use `create(PushYjsUpdateResponseSchema)` to create a new message.
|
|
290
|
+
*/
|
|
291
|
+
export const PushYjsUpdateResponseSchema: GenMessage<PushYjsUpdateResponse> = /*@__PURE__*/
|
|
292
|
+
messageDesc(file_ysync_v1_sync, 8);
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @generated from message ysync.v1.PushAwarenessUpdateRequest
|
|
296
|
+
*/
|
|
297
|
+
export type PushAwarenessUpdateRequest = Message<"ysync.v1.PushAwarenessUpdateRequest"> & {
|
|
298
|
+
/**
|
|
299
|
+
* @generated from field: string doc_id = 1;
|
|
300
|
+
*/
|
|
301
|
+
docId: string;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* @generated from field: string client_id = 2;
|
|
305
|
+
*/
|
|
306
|
+
clientId: string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @generated from field: bytes awareness_update = 3;
|
|
310
|
+
*/
|
|
311
|
+
awarenessUpdate: Uint8Array;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Describes the message ysync.v1.PushAwarenessUpdateRequest.
|
|
316
|
+
* Use `create(PushAwarenessUpdateRequestSchema)` to create a new message.
|
|
317
|
+
*/
|
|
318
|
+
export const PushAwarenessUpdateRequestSchema: GenMessage<PushAwarenessUpdateRequest> = /*@__PURE__*/
|
|
319
|
+
messageDesc(file_ysync_v1_sync, 9);
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @generated from message ysync.v1.PushAwarenessUpdateResponse
|
|
323
|
+
*/
|
|
324
|
+
export type PushAwarenessUpdateResponse = Message<"ysync.v1.PushAwarenessUpdateResponse"> & {
|
|
325
|
+
/**
|
|
326
|
+
* @generated from field: uint64 sequence = 1;
|
|
327
|
+
*/
|
|
328
|
+
sequence: bigint;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Describes the message ysync.v1.PushAwarenessUpdateResponse.
|
|
333
|
+
* Use `create(PushAwarenessUpdateResponseSchema)` to create a new message.
|
|
334
|
+
*/
|
|
335
|
+
export const PushAwarenessUpdateResponseSchema: GenMessage<PushAwarenessUpdateResponse> = /*@__PURE__*/
|
|
336
|
+
messageDesc(file_ysync_v1_sync, 10);
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* @generated from message ysync.v1.StreamDocumentFramesRequest
|
|
340
|
+
*/
|
|
341
|
+
export type StreamDocumentFramesRequest = Message<"ysync.v1.StreamDocumentFramesRequest"> & {
|
|
342
|
+
/**
|
|
343
|
+
* @generated from field: string doc_id = 1;
|
|
344
|
+
*/
|
|
345
|
+
docId: string;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @generated from field: string client_id = 2;
|
|
349
|
+
*/
|
|
350
|
+
clientId: string;
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Replay committed document frames after this server-assigned sequence.
|
|
354
|
+
*
|
|
355
|
+
* @generated from field: uint64 after_sequence = 3;
|
|
356
|
+
*/
|
|
357
|
+
afterSequence: bigint;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Describes the message ysync.v1.StreamDocumentFramesRequest.
|
|
362
|
+
* Use `create(StreamDocumentFramesRequestSchema)` to create a new message.
|
|
363
|
+
*/
|
|
364
|
+
export const StreamDocumentFramesRequestSchema: GenMessage<StreamDocumentFramesRequest> = /*@__PURE__*/
|
|
365
|
+
messageDesc(file_ysync_v1_sync, 11);
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* @generated from message ysync.v1.StreamDocumentFramesResponse
|
|
369
|
+
*/
|
|
370
|
+
export type StreamDocumentFramesResponse = Message<"ysync.v1.StreamDocumentFramesResponse"> & {
|
|
371
|
+
/**
|
|
372
|
+
* @generated from field: ysync.v1.ServerFrame frame = 1;
|
|
373
|
+
*/
|
|
374
|
+
frame?: ServerFrame | undefined;
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Describes the message ysync.v1.StreamDocumentFramesResponse.
|
|
379
|
+
* Use `create(StreamDocumentFramesResponseSchema)` to create a new message.
|
|
380
|
+
*/
|
|
381
|
+
export const StreamDocumentFramesResponseSchema: GenMessage<StreamDocumentFramesResponse> = /*@__PURE__*/
|
|
382
|
+
messageDesc(file_ysync_v1_sync, 12);
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* @generated from message ysync.v1.LeaveDocumentRequest
|
|
386
|
+
*/
|
|
387
|
+
export type LeaveDocumentRequest = Message<"ysync.v1.LeaveDocumentRequest"> & {
|
|
388
|
+
/**
|
|
389
|
+
* @generated from field: string doc_id = 1;
|
|
390
|
+
*/
|
|
391
|
+
docId: string;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* @generated from field: string client_id = 2;
|
|
395
|
+
*/
|
|
396
|
+
clientId: string;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Describes the message ysync.v1.LeaveDocumentRequest.
|
|
401
|
+
* Use `create(LeaveDocumentRequestSchema)` to create a new message.
|
|
402
|
+
*/
|
|
403
|
+
export const LeaveDocumentRequestSchema: GenMessage<LeaveDocumentRequest> = /*@__PURE__*/
|
|
404
|
+
messageDesc(file_ysync_v1_sync, 13);
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* @generated from message ysync.v1.LeaveDocumentResponse
|
|
408
|
+
*/
|
|
409
|
+
export type LeaveDocumentResponse = Message<"ysync.v1.LeaveDocumentResponse"> & {
|
|
410
|
+
/**
|
|
411
|
+
* @generated from field: uint64 sequence = 1;
|
|
412
|
+
*/
|
|
413
|
+
sequence: bigint;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Describes the message ysync.v1.LeaveDocumentResponse.
|
|
418
|
+
* Use `create(LeaveDocumentResponseSchema)` to create a new message.
|
|
419
|
+
*/
|
|
420
|
+
export const LeaveDocumentResponseSchema: GenMessage<LeaveDocumentResponse> = /*@__PURE__*/
|
|
421
|
+
messageDesc(file_ysync_v1_sync, 14);
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* @generated from message ysync.v1.ListDocumentUpdatesRequest
|
|
425
|
+
*/
|
|
426
|
+
export type ListDocumentUpdatesRequest = Message<"ysync.v1.ListDocumentUpdatesRequest"> & {
|
|
427
|
+
/**
|
|
428
|
+
* @generated from field: string doc_id = 1;
|
|
429
|
+
*/
|
|
430
|
+
docId: string;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Return updates with sequence strictly greater than this.
|
|
434
|
+
*
|
|
435
|
+
* @generated from field: uint64 after_sequence = 2;
|
|
436
|
+
*/
|
|
437
|
+
afterSequence: bigint;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Maximum entries to return; 0 means no limit.
|
|
441
|
+
*
|
|
442
|
+
* @generated from field: uint32 limit = 3;
|
|
443
|
+
*/
|
|
444
|
+
limit: number;
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Describes the message ysync.v1.ListDocumentUpdatesRequest.
|
|
449
|
+
* Use `create(ListDocumentUpdatesRequestSchema)` to create a new message.
|
|
450
|
+
*/
|
|
451
|
+
export const ListDocumentUpdatesRequestSchema: GenMessage<ListDocumentUpdatesRequest> = /*@__PURE__*/
|
|
452
|
+
messageDesc(file_ysync_v1_sync, 15);
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* @generated from message ysync.v1.ListDocumentUpdatesResponse
|
|
456
|
+
*/
|
|
457
|
+
export type ListDocumentUpdatesResponse = Message<"ysync.v1.ListDocumentUpdatesResponse"> & {
|
|
458
|
+
/**
|
|
459
|
+
* @generated from field: repeated ysync.v1.DocumentUpdateRecord updates = 1;
|
|
460
|
+
*/
|
|
461
|
+
updates: DocumentUpdateRecord[];
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Describes the message ysync.v1.ListDocumentUpdatesResponse.
|
|
466
|
+
* Use `create(ListDocumentUpdatesResponseSchema)` to create a new message.
|
|
467
|
+
*/
|
|
468
|
+
export const ListDocumentUpdatesResponseSchema: GenMessage<ListDocumentUpdatesResponse> = /*@__PURE__*/
|
|
469
|
+
messageDesc(file_ysync_v1_sync, 16);
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* @generated from message ysync.v1.DocumentUpdateRecord
|
|
473
|
+
*/
|
|
474
|
+
export type DocumentUpdateRecord = Message<"ysync.v1.DocumentUpdateRecord"> & {
|
|
475
|
+
/**
|
|
476
|
+
* @generated from field: uint64 sequence = 1;
|
|
477
|
+
*/
|
|
478
|
+
sequence: bigint;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @generated from field: string client_id = 2;
|
|
482
|
+
*/
|
|
483
|
+
clientId: string;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @generated from field: string actor_user_id = 3;
|
|
487
|
+
*/
|
|
488
|
+
actorUserId: string;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* @generated from field: string actor_display_name = 4;
|
|
492
|
+
*/
|
|
493
|
+
actorDisplayName: string;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Milliseconds since the Unix epoch. Zero for a snapshot record whose
|
|
497
|
+
* compaction time is unknown (e.g. after a server restart).
|
|
498
|
+
*
|
|
499
|
+
* @generated from field: int64 created_at_ms = 5;
|
|
500
|
+
*/
|
|
501
|
+
createdAtMs: bigint;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* @generated from field: bytes yjs_update = 6;
|
|
505
|
+
*/
|
|
506
|
+
yjsUpdate: Uint8Array;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* True for the compacted baseline: a merged snapshot of all history
|
|
510
|
+
* through `sequence`, with no single actor.
|
|
511
|
+
*
|
|
512
|
+
* @generated from field: bool is_snapshot = 7;
|
|
513
|
+
*/
|
|
514
|
+
isSnapshot: boolean;
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Describes the message ysync.v1.DocumentUpdateRecord.
|
|
519
|
+
* Use `create(DocumentUpdateRecordSchema)` to create a new message.
|
|
520
|
+
*/
|
|
521
|
+
export const DocumentUpdateRecordSchema: GenMessage<DocumentUpdateRecord> = /*@__PURE__*/
|
|
522
|
+
messageDesc(file_ysync_v1_sync, 17);
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* @generated from message ysync.v1.CompactDocumentRequest
|
|
526
|
+
*/
|
|
527
|
+
export type CompactDocumentRequest = Message<"ysync.v1.CompactDocumentRequest"> & {
|
|
528
|
+
/**
|
|
529
|
+
* @generated from field: string doc_id = 1;
|
|
530
|
+
*/
|
|
531
|
+
docId: string;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Merged Yjs update encoding the full document state at
|
|
535
|
+
* compact_through_sequence.
|
|
536
|
+
*
|
|
537
|
+
* @generated from field: bytes compact_update = 2;
|
|
538
|
+
*/
|
|
539
|
+
compactUpdate: Uint8Array;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* @generated from field: uint64 compact_through_sequence = 3;
|
|
543
|
+
*/
|
|
544
|
+
compactThroughSequence: bigint;
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Describes the message ysync.v1.CompactDocumentRequest.
|
|
549
|
+
* Use `create(CompactDocumentRequestSchema)` to create a new message.
|
|
550
|
+
*/
|
|
551
|
+
export const CompactDocumentRequestSchema: GenMessage<CompactDocumentRequest> = /*@__PURE__*/
|
|
552
|
+
messageDesc(file_ysync_v1_sync, 18);
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* @generated from message ysync.v1.CompactDocumentResponse
|
|
556
|
+
*/
|
|
557
|
+
export type CompactDocumentResponse = Message<"ysync.v1.CompactDocumentResponse"> & {
|
|
558
|
+
/**
|
|
559
|
+
* Head sequence of the document after compaction.
|
|
560
|
+
*
|
|
561
|
+
* @generated from field: uint64 sequence = 1;
|
|
562
|
+
*/
|
|
563
|
+
sequence: bigint;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Describes the message ysync.v1.CompactDocumentResponse.
|
|
568
|
+
* Use `create(CompactDocumentResponseSchema)` to create a new message.
|
|
569
|
+
*/
|
|
570
|
+
export const CompactDocumentResponseSchema: GenMessage<CompactDocumentResponse> = /*@__PURE__*/
|
|
571
|
+
messageDesc(file_ysync_v1_sync, 19);
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* @generated from message ysync.v1.Ping
|
|
575
|
+
*/
|
|
576
|
+
export type Ping = Message<"ysync.v1.Ping"> & {
|
|
577
|
+
/**
|
|
578
|
+
* @generated from field: string nonce = 1;
|
|
579
|
+
*/
|
|
580
|
+
nonce: string;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Describes the message ysync.v1.Ping.
|
|
585
|
+
* Use `create(PingSchema)` to create a new message.
|
|
586
|
+
*/
|
|
587
|
+
export const PingSchema: GenMessage<Ping> = /*@__PURE__*/
|
|
588
|
+
messageDesc(file_ysync_v1_sync, 20);
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* @generated from message ysync.v1.Pong
|
|
592
|
+
*/
|
|
593
|
+
export type Pong = Message<"ysync.v1.Pong"> & {
|
|
594
|
+
/**
|
|
595
|
+
* @generated from field: string nonce = 1;
|
|
596
|
+
*/
|
|
597
|
+
nonce: string;
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Describes the message ysync.v1.Pong.
|
|
602
|
+
* Use `create(PongSchema)` to create a new message.
|
|
603
|
+
*/
|
|
604
|
+
export const PongSchema: GenMessage<Pong> = /*@__PURE__*/
|
|
605
|
+
messageDesc(file_ysync_v1_sync, 21);
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* @generated from message ysync.v1.ServerError
|
|
609
|
+
*/
|
|
610
|
+
export type ServerError = Message<"ysync.v1.ServerError"> & {
|
|
611
|
+
/**
|
|
612
|
+
* @generated from field: string code = 1;
|
|
613
|
+
*/
|
|
614
|
+
code: string;
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* @generated from field: string message = 2;
|
|
618
|
+
*/
|
|
619
|
+
message: string;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Describes the message ysync.v1.ServerError.
|
|
624
|
+
* Use `create(ServerErrorSchema)` to create a new message.
|
|
625
|
+
*/
|
|
626
|
+
export const ServerErrorSchema: GenMessage<ServerError> = /*@__PURE__*/
|
|
627
|
+
messageDesc(file_ysync_v1_sync, 22);
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* YjsSyncService is the public Connect RPC contract for synchronizing
|
|
631
|
+
* Yjs documents. Yjs updates remain the canonical document state; projections,
|
|
632
|
+
* imports, exports, AI, search, and editor-specific formats belong outside this
|
|
633
|
+
* wire API.
|
|
634
|
+
*
|
|
635
|
+
* @generated from service ysync.v1.YjsSyncService
|
|
636
|
+
*/
|
|
637
|
+
export const YjsSyncService: GenService<{
|
|
638
|
+
/**
|
|
639
|
+
* Sync is for clients that can keep a bidirectional stream open.
|
|
640
|
+
*
|
|
641
|
+
* @generated from rpc ysync.v1.YjsSyncService.Sync
|
|
642
|
+
*/
|
|
643
|
+
sync: {
|
|
644
|
+
methodKind: "bidi_streaming";
|
|
645
|
+
input: typeof SyncRequestSchema;
|
|
646
|
+
output: typeof SyncResponseSchema;
|
|
647
|
+
},
|
|
648
|
+
/**
|
|
649
|
+
* JoinDocument returns the Yjs updates a client needs after sending its local
|
|
650
|
+
* state vector.
|
|
651
|
+
*
|
|
652
|
+
* @generated from rpc ysync.v1.YjsSyncService.JoinDocument
|
|
653
|
+
*/
|
|
654
|
+
joinDocument: {
|
|
655
|
+
methodKind: "unary";
|
|
656
|
+
input: typeof JoinDocumentRequestSchema;
|
|
657
|
+
output: typeof JoinDocumentResponseSchema;
|
|
658
|
+
},
|
|
659
|
+
/**
|
|
660
|
+
* PushYjsUpdate appends one canonical Yjs document update.
|
|
661
|
+
*
|
|
662
|
+
* @generated from rpc ysync.v1.YjsSyncService.PushYjsUpdate
|
|
663
|
+
*/
|
|
664
|
+
pushYjsUpdate: {
|
|
665
|
+
methodKind: "unary";
|
|
666
|
+
input: typeof PushYjsUpdateRequestSchema;
|
|
667
|
+
output: typeof PushYjsUpdateResponseSchema;
|
|
668
|
+
},
|
|
669
|
+
/**
|
|
670
|
+
* PushAwarenessUpdate broadcasts transient Yjs awareness data. Awareness is
|
|
671
|
+
* not persisted as document state.
|
|
672
|
+
*
|
|
673
|
+
* @generated from rpc ysync.v1.YjsSyncService.PushAwarenessUpdate
|
|
674
|
+
*/
|
|
675
|
+
pushAwarenessUpdate: {
|
|
676
|
+
methodKind: "unary";
|
|
677
|
+
input: typeof PushAwarenessUpdateRequestSchema;
|
|
678
|
+
output: typeof PushAwarenessUpdateResponseSchema;
|
|
679
|
+
},
|
|
680
|
+
/**
|
|
681
|
+
* StreamDocumentFrames is the server-streaming half of the unary/browser
|
|
682
|
+
* workflow for clients that cannot use Sync.
|
|
683
|
+
*
|
|
684
|
+
* @generated from rpc ysync.v1.YjsSyncService.StreamDocumentFrames
|
|
685
|
+
*/
|
|
686
|
+
streamDocumentFrames: {
|
|
687
|
+
methodKind: "server_streaming";
|
|
688
|
+
input: typeof StreamDocumentFramesRequestSchema;
|
|
689
|
+
output: typeof StreamDocumentFramesResponseSchema;
|
|
690
|
+
},
|
|
691
|
+
/**
|
|
692
|
+
* LeaveDocument removes a client from transient room presence.
|
|
693
|
+
*
|
|
694
|
+
* @generated from rpc ysync.v1.YjsSyncService.LeaveDocument
|
|
695
|
+
*/
|
|
696
|
+
leaveDocument: {
|
|
697
|
+
methodKind: "unary";
|
|
698
|
+
input: typeof LeaveDocumentRequestSchema;
|
|
699
|
+
output: typeof LeaveDocumentResponseSchema;
|
|
700
|
+
},
|
|
701
|
+
/**
|
|
702
|
+
* ListDocumentUpdates returns the stored update log with actor metadata for
|
|
703
|
+
* audit and change-history features. Update payloads are included so
|
|
704
|
+
* clients can rebuild the document state at any sequence.
|
|
705
|
+
*
|
|
706
|
+
* @generated from rpc ysync.v1.YjsSyncService.ListDocumentUpdates
|
|
707
|
+
*/
|
|
708
|
+
listDocumentUpdates: {
|
|
709
|
+
methodKind: "unary";
|
|
710
|
+
input: typeof ListDocumentUpdatesRequestSchema;
|
|
711
|
+
output: typeof ListDocumentUpdatesResponseSchema;
|
|
712
|
+
},
|
|
713
|
+
/**
|
|
714
|
+
* CompactDocument folds the stored update log through
|
|
715
|
+
* compact_through_sequence into the provided merged snapshot update, which
|
|
716
|
+
* must be a valid Yjs update encoding the full document state at that
|
|
717
|
+
* sequence (build it with a real Yjs implementation, e.g.
|
|
718
|
+
* Y.encodeStateAsUpdate). Updates after that sequence keep their per-edit
|
|
719
|
+
* attribution; earlier history collapses into one snapshot record. This is
|
|
720
|
+
* an admin/sidecar operation gated by Authz.CanCompact, not something
|
|
721
|
+
* regular editing clients should call.
|
|
722
|
+
*
|
|
723
|
+
* @generated from rpc ysync.v1.YjsSyncService.CompactDocument
|
|
724
|
+
*/
|
|
725
|
+
compactDocument: {
|
|
726
|
+
methodKind: "unary";
|
|
727
|
+
input: typeof CompactDocumentRequestSchema;
|
|
728
|
+
output: typeof CompactDocumentResponseSchema;
|
|
729
|
+
},
|
|
730
|
+
}> = /*@__PURE__*/
|
|
731
|
+
serviceDesc(file_ysync_v1_sync, 0);
|
|
732
|
+
|