@fivenet-app/gen 0.9.3-1

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 (123) hide show
  1. package/README.md +1 -0
  2. package/google/protobuf/any.ts +322 -0
  3. package/google/protobuf/descriptor.ts +3475 -0
  4. package/google/protobuf/duration.ts +231 -0
  5. package/google/protobuf/timestamp.ts +290 -0
  6. package/package.json +15 -0
  7. package/perms.ts +178 -0
  8. package/resources/accounts/accounts.ts +195 -0
  9. package/resources/accounts/oauth2.ts +230 -0
  10. package/resources/calendar/access.ts +362 -0
  11. package/resources/calendar/calendar.ts +955 -0
  12. package/resources/centrum/access.ts +380 -0
  13. package/resources/centrum/dispatches.ts +854 -0
  14. package/resources/centrum/general.ts +231 -0
  15. package/resources/centrum/settings.ts +303 -0
  16. package/resources/centrum/units.ts +620 -0
  17. package/resources/common/access/dummy.ts +309 -0
  18. package/resources/common/content/content.ts +252 -0
  19. package/resources/common/cron/cron.ts +536 -0
  20. package/resources/common/database/database.ts +306 -0
  21. package/resources/common/error.ts +79 -0
  22. package/resources/common/grpcws/grpcws.ts +615 -0
  23. package/resources/common/i18n.ts +102 -0
  24. package/resources/common/uuid.ts +68 -0
  25. package/resources/documents/access.ts +388 -0
  26. package/resources/documents/activity.ts +803 -0
  27. package/resources/documents/category.ts +132 -0
  28. package/resources/documents/comment.ts +161 -0
  29. package/resources/documents/documents.ts +1124 -0
  30. package/resources/documents/requests.ts +196 -0
  31. package/resources/documents/templates.ts +949 -0
  32. package/resources/documents/workflow.ts +349 -0
  33. package/resources/filestore/file.ts +204 -0
  34. package/resources/internet/ads.ts +257 -0
  35. package/resources/internet/domain.ts +136 -0
  36. package/resources/internet/internet.ts +344 -0
  37. package/resources/internet/page.ts +236 -0
  38. package/resources/internet/search.ts +104 -0
  39. package/resources/jobs/activity.ts +600 -0
  40. package/resources/jobs/colleagues.ts +346 -0
  41. package/resources/jobs/conduct.ts +220 -0
  42. package/resources/jobs/labels.ts +240 -0
  43. package/resources/jobs/timeclock.ts +372 -0
  44. package/resources/laws/laws.ts +293 -0
  45. package/resources/livemap/livemap.ts +728 -0
  46. package/resources/livemap/tracker.ts +81 -0
  47. package/resources/mailer/access.ts +485 -0
  48. package/resources/mailer/email.ts +222 -0
  49. package/resources/mailer/events.ts +196 -0
  50. package/resources/mailer/message.ts +285 -0
  51. package/resources/mailer/settings.ts +95 -0
  52. package/resources/mailer/template.ts +164 -0
  53. package/resources/mailer/thread.ts +422 -0
  54. package/resources/mailer/user.ts +93 -0
  55. package/resources/notifications/events.ts +287 -0
  56. package/resources/notifications/notifications.ts +444 -0
  57. package/resources/permissions/permissions.ts +829 -0
  58. package/resources/qualifications/access.ts +275 -0
  59. package/resources/qualifications/exam.ts +1421 -0
  60. package/resources/qualifications/qualifications.ts +1289 -0
  61. package/resources/rector/audit.ts +226 -0
  62. package/resources/rector/config.ts +922 -0
  63. package/resources/stats/stats.ts +67 -0
  64. package/resources/sync/activity.ts +356 -0
  65. package/resources/sync/data.ts +455 -0
  66. package/resources/timestamp/timestamp.ts +78 -0
  67. package/resources/users/activity.ts +211 -0
  68. package/resources/users/job_props.ts +992 -0
  69. package/resources/users/jobs.ts +171 -0
  70. package/resources/users/labels.ts +161 -0
  71. package/resources/users/props.ts +207 -0
  72. package/resources/users/users.ts +570 -0
  73. package/resources/vehicles/vehicles.ts +114 -0
  74. package/resources/wiki/access.ts +362 -0
  75. package/resources/wiki/activity.ts +591 -0
  76. package/resources/wiki/page.ts +548 -0
  77. package/services/auth/auth.client.ts +171 -0
  78. package/services/auth/auth.ts +1331 -0
  79. package/services/calendar/calendar.client.ts +262 -0
  80. package/services/calendar/calendar.ts +1733 -0
  81. package/services/centrum/centrum.client.ts +365 -0
  82. package/services/centrum/centrum.ts +2619 -0
  83. package/services/citizenstore/citizenstore.client.ts +126 -0
  84. package/services/citizenstore/citizenstore.ts +847 -0
  85. package/services/completor/completor.client.ts +109 -0
  86. package/services/completor/completor.ts +616 -0
  87. package/services/dmv/vehicles.client.ts +41 -0
  88. package/services/dmv/vehicles.ts +191 -0
  89. package/services/docstore/docstore.client.ts +653 -0
  90. package/services/docstore/docstore.ts +4571 -0
  91. package/services/internet/ads.client.ts +41 -0
  92. package/services/internet/ads.ts +145 -0
  93. package/services/internet/internet.client.ts +58 -0
  94. package/services/internet/internet.ts +257 -0
  95. package/services/jobs/conduct.client.ts +92 -0
  96. package/services/jobs/conduct.ts +541 -0
  97. package/services/jobs/jobs.client.ts +194 -0
  98. package/services/jobs/jobs.ts +1301 -0
  99. package/services/jobs/timeclock.client.ts +75 -0
  100. package/services/jobs/timeclock.ts +808 -0
  101. package/services/livemapper/livemap.client.ts +76 -0
  102. package/services/livemapper/livemap.ts +552 -0
  103. package/services/mailer/mailer.client.ts +381 -0
  104. package/services/mailer/mailer.ts +2590 -0
  105. package/services/notificator/notificator.client.ts +76 -0
  106. package/services/notificator/notificator.ts +510 -0
  107. package/services/qualifications/qualifications.client.ts +279 -0
  108. package/services/qualifications/qualifications.ts +2142 -0
  109. package/services/rector/config.client.ts +58 -0
  110. package/services/rector/config.ts +216 -0
  111. package/services/rector/filestore.client.ts +75 -0
  112. package/services/rector/filestore.ts +378 -0
  113. package/services/rector/laws.client.ts +92 -0
  114. package/services/rector/laws.ts +416 -0
  115. package/services/rector/rector.client.ts +211 -0
  116. package/services/rector/rector.ts +1540 -0
  117. package/services/stats/stats.client.ts +37 -0
  118. package/services/stats/stats.ts +128 -0
  119. package/services/sync/sync.client.ts +110 -0
  120. package/services/sync/sync.ts +831 -0
  121. package/services/wiki/wiki.client.ts +126 -0
  122. package/services/wiki/wiki.ts +749 -0
  123. package/svcs.ts +307 -0
@@ -0,0 +1,422 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter optimize_speed,long_type_number,force_server_none
2
+ // @generated from protobuf file "resources/mailer/thread.proto" (package "resources.mailer", syntax proto3)
3
+ // @ts-nocheck
4
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
5
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
6
+ import { WireType } from "@protobuf-ts/runtime";
7
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
8
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
9
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
10
+ import type { PartialMessage } from "@protobuf-ts/runtime";
11
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
12
+ import { MessageType } from "@protobuf-ts/runtime";
13
+ import { UserShort } from "../users/users";
14
+ import { Email } from "./email";
15
+ import { Timestamp } from "../timestamp/timestamp";
16
+ /**
17
+ * @generated from protobuf message resources.mailer.Thread
18
+ */
19
+ export interface Thread {
20
+ /**
21
+ * @generated from protobuf field: uint64 id = 1 [jstype = JS_STRING];
22
+ */
23
+ id: string;
24
+ /**
25
+ * @generated from protobuf field: resources.timestamp.Timestamp created_at = 2;
26
+ */
27
+ createdAt?: Timestamp;
28
+ /**
29
+ * @generated from protobuf field: optional resources.timestamp.Timestamp updated_at = 3;
30
+ */
31
+ updatedAt?: Timestamp;
32
+ /**
33
+ * @generated from protobuf field: optional resources.timestamp.Timestamp deleted_at = 4;
34
+ */
35
+ deletedAt?: Timestamp;
36
+ /**
37
+ * @generated from protobuf field: uint64 creator_email_id = 5 [jstype = JS_STRING];
38
+ */
39
+ creatorEmailId: string;
40
+ /**
41
+ * @generated from protobuf field: optional resources.mailer.Email creator_email = 6;
42
+ */
43
+ creatorEmail?: Email;
44
+ /**
45
+ * @generated from protobuf field: optional int32 creator_id = 7;
46
+ */
47
+ creatorId?: number;
48
+ /**
49
+ * @generated from protobuf field: optional resources.users.UserShort creator = 8;
50
+ */
51
+ creator?: UserShort; // @gotags: alias:"creator"
52
+ /**
53
+ * @sanitize: method=StripTags
54
+ *
55
+ * @generated from protobuf field: string title = 9;
56
+ */
57
+ title: string;
58
+ /**
59
+ * @generated from protobuf field: repeated resources.mailer.ThreadRecipientEmail recipients = 10;
60
+ */
61
+ recipients: ThreadRecipientEmail[];
62
+ /**
63
+ * @generated from protobuf field: optional resources.mailer.ThreadState state = 11;
64
+ */
65
+ state?: ThreadState; // @gotags: alias:"thread_state"
66
+ }
67
+ /**
68
+ * @generated from protobuf message resources.mailer.ThreadRecipientEmail
69
+ */
70
+ export interface ThreadRecipientEmail {
71
+ /**
72
+ * @generated from protobuf field: uint64 id = 1 [jstype = JS_STRING];
73
+ */
74
+ id: string; // @gotags: sql:"primary_key" alias:"id"
75
+ /**
76
+ * @generated from protobuf field: optional resources.timestamp.Timestamp created_at = 2;
77
+ */
78
+ createdAt?: Timestamp;
79
+ /**
80
+ * @generated from protobuf field: uint64 target_id = 4 [jstype = JS_STRING];
81
+ */
82
+ targetId: string; // @gotags: alias:"thread_id"
83
+ /**
84
+ * @generated from protobuf field: uint64 email_id = 5 [jstype = JS_STRING];
85
+ */
86
+ emailId: string;
87
+ /**
88
+ * @generated from protobuf field: optional resources.mailer.Email email = 6;
89
+ */
90
+ email?: Email;
91
+ }
92
+ /**
93
+ * @generated from protobuf message resources.mailer.ThreadState
94
+ */
95
+ export interface ThreadState {
96
+ /**
97
+ * @generated from protobuf field: uint64 thread_id = 1 [jstype = JS_STRING];
98
+ */
99
+ threadId: string;
100
+ /**
101
+ * @generated from protobuf field: uint64 email_id = 2 [jstype = JS_STRING];
102
+ */
103
+ emailId: string;
104
+ /**
105
+ * @generated from protobuf field: optional resources.timestamp.Timestamp last_read = 3;
106
+ */
107
+ lastRead?: Timestamp;
108
+ /**
109
+ * @generated from protobuf field: optional bool unread = 4;
110
+ */
111
+ unread?: boolean;
112
+ /**
113
+ * @generated from protobuf field: optional bool important = 5;
114
+ */
115
+ important?: boolean;
116
+ /**
117
+ * @generated from protobuf field: optional bool favorite = 6;
118
+ */
119
+ favorite?: boolean;
120
+ /**
121
+ * @generated from protobuf field: optional bool muted = 7;
122
+ */
123
+ muted?: boolean;
124
+ /**
125
+ * @generated from protobuf field: optional bool archived = 8;
126
+ */
127
+ archived?: boolean;
128
+ }
129
+ // @generated message type with reflection information, may provide speed optimized methods
130
+ class Thread$Type extends MessageType<Thread> {
131
+ constructor() {
132
+ super("resources.mailer.Thread", [
133
+ { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
134
+ { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
135
+ { no: 3, name: "updated_at", kind: "message", T: () => Timestamp },
136
+ { no: 4, name: "deleted_at", kind: "message", T: () => Timestamp },
137
+ { no: 5, name: "creator_email_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
138
+ { no: 6, name: "creator_email", kind: "message", T: () => Email },
139
+ { no: 7, name: "creator_id", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gt: 0 } } } },
140
+ { no: 8, name: "creator", kind: "message", T: () => UserShort },
141
+ { no: 9, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "3", maxLen: "255" } } } },
142
+ { no: 10, name: "recipients", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ThreadRecipientEmail, options: { "validate.rules": { repeated: { maxItems: "20" } } } },
143
+ { no: 11, name: "state", kind: "message", T: () => ThreadState }
144
+ ]);
145
+ }
146
+ create(value?: PartialMessage<Thread>): Thread {
147
+ const message = globalThis.Object.create((this.messagePrototype!));
148
+ message.id = "0";
149
+ message.creatorEmailId = "0";
150
+ message.title = "";
151
+ message.recipients = [];
152
+ if (value !== undefined)
153
+ reflectionMergePartial<Thread>(this, message, value);
154
+ return message;
155
+ }
156
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Thread): Thread {
157
+ let message = target ?? this.create(), end = reader.pos + length;
158
+ while (reader.pos < end) {
159
+ let [fieldNo, wireType] = reader.tag();
160
+ switch (fieldNo) {
161
+ case /* uint64 id = 1 [jstype = JS_STRING];*/ 1:
162
+ message.id = reader.uint64().toString();
163
+ break;
164
+ case /* resources.timestamp.Timestamp created_at */ 2:
165
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
166
+ break;
167
+ case /* optional resources.timestamp.Timestamp updated_at */ 3:
168
+ message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
169
+ break;
170
+ case /* optional resources.timestamp.Timestamp deleted_at */ 4:
171
+ message.deletedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.deletedAt);
172
+ break;
173
+ case /* uint64 creator_email_id = 5 [jstype = JS_STRING];*/ 5:
174
+ message.creatorEmailId = reader.uint64().toString();
175
+ break;
176
+ case /* optional resources.mailer.Email creator_email */ 6:
177
+ message.creatorEmail = Email.internalBinaryRead(reader, reader.uint32(), options, message.creatorEmail);
178
+ break;
179
+ case /* optional int32 creator_id */ 7:
180
+ message.creatorId = reader.int32();
181
+ break;
182
+ case /* optional resources.users.UserShort creator */ 8:
183
+ message.creator = UserShort.internalBinaryRead(reader, reader.uint32(), options, message.creator);
184
+ break;
185
+ case /* string title */ 9:
186
+ message.title = reader.string();
187
+ break;
188
+ case /* repeated resources.mailer.ThreadRecipientEmail recipients */ 10:
189
+ message.recipients.push(ThreadRecipientEmail.internalBinaryRead(reader, reader.uint32(), options));
190
+ break;
191
+ case /* optional resources.mailer.ThreadState state */ 11:
192
+ message.state = ThreadState.internalBinaryRead(reader, reader.uint32(), options, message.state);
193
+ break;
194
+ default:
195
+ let u = options.readUnknownField;
196
+ if (u === "throw")
197
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
198
+ let d = reader.skip(wireType);
199
+ if (u !== false)
200
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
201
+ }
202
+ }
203
+ return message;
204
+ }
205
+ internalBinaryWrite(message: Thread, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
206
+ /* uint64 id = 1 [jstype = JS_STRING]; */
207
+ if (message.id !== "0")
208
+ writer.tag(1, WireType.Varint).uint64(message.id);
209
+ /* resources.timestamp.Timestamp created_at = 2; */
210
+ if (message.createdAt)
211
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
212
+ /* optional resources.timestamp.Timestamp updated_at = 3; */
213
+ if (message.updatedAt)
214
+ Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
215
+ /* optional resources.timestamp.Timestamp deleted_at = 4; */
216
+ if (message.deletedAt)
217
+ Timestamp.internalBinaryWrite(message.deletedAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
218
+ /* uint64 creator_email_id = 5 [jstype = JS_STRING]; */
219
+ if (message.creatorEmailId !== "0")
220
+ writer.tag(5, WireType.Varint).uint64(message.creatorEmailId);
221
+ /* optional resources.mailer.Email creator_email = 6; */
222
+ if (message.creatorEmail)
223
+ Email.internalBinaryWrite(message.creatorEmail, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
224
+ /* optional int32 creator_id = 7; */
225
+ if (message.creatorId !== undefined)
226
+ writer.tag(7, WireType.Varint).int32(message.creatorId);
227
+ /* optional resources.users.UserShort creator = 8; */
228
+ if (message.creator)
229
+ UserShort.internalBinaryWrite(message.creator, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
230
+ /* string title = 9; */
231
+ if (message.title !== "")
232
+ writer.tag(9, WireType.LengthDelimited).string(message.title);
233
+ /* repeated resources.mailer.ThreadRecipientEmail recipients = 10; */
234
+ for (let i = 0; i < message.recipients.length; i++)
235
+ ThreadRecipientEmail.internalBinaryWrite(message.recipients[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join();
236
+ /* optional resources.mailer.ThreadState state = 11; */
237
+ if (message.state)
238
+ ThreadState.internalBinaryWrite(message.state, writer.tag(11, WireType.LengthDelimited).fork(), options).join();
239
+ let u = options.writeUnknownFields;
240
+ if (u !== false)
241
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
242
+ return writer;
243
+ }
244
+ }
245
+ /**
246
+ * @generated MessageType for protobuf message resources.mailer.Thread
247
+ */
248
+ export const Thread = new Thread$Type();
249
+ // @generated message type with reflection information, may provide speed optimized methods
250
+ class ThreadRecipientEmail$Type extends MessageType<ThreadRecipientEmail> {
251
+ constructor() {
252
+ super("resources.mailer.ThreadRecipientEmail", [
253
+ { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
254
+ { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
255
+ { no: 4, name: "target_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
256
+ { no: 5, name: "email_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
257
+ { no: 6, name: "email", kind: "message", T: () => Email }
258
+ ]);
259
+ }
260
+ create(value?: PartialMessage<ThreadRecipientEmail>): ThreadRecipientEmail {
261
+ const message = globalThis.Object.create((this.messagePrototype!));
262
+ message.id = "0";
263
+ message.targetId = "0";
264
+ message.emailId = "0";
265
+ if (value !== undefined)
266
+ reflectionMergePartial<ThreadRecipientEmail>(this, message, value);
267
+ return message;
268
+ }
269
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ThreadRecipientEmail): ThreadRecipientEmail {
270
+ let message = target ?? this.create(), end = reader.pos + length;
271
+ while (reader.pos < end) {
272
+ let [fieldNo, wireType] = reader.tag();
273
+ switch (fieldNo) {
274
+ case /* uint64 id = 1 [jstype = JS_STRING];*/ 1:
275
+ message.id = reader.uint64().toString();
276
+ break;
277
+ case /* optional resources.timestamp.Timestamp created_at */ 2:
278
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
279
+ break;
280
+ case /* uint64 target_id = 4 [jstype = JS_STRING];*/ 4:
281
+ message.targetId = reader.uint64().toString();
282
+ break;
283
+ case /* uint64 email_id = 5 [jstype = JS_STRING];*/ 5:
284
+ message.emailId = reader.uint64().toString();
285
+ break;
286
+ case /* optional resources.mailer.Email email */ 6:
287
+ message.email = Email.internalBinaryRead(reader, reader.uint32(), options, message.email);
288
+ break;
289
+ default:
290
+ let u = options.readUnknownField;
291
+ if (u === "throw")
292
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
293
+ let d = reader.skip(wireType);
294
+ if (u !== false)
295
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
296
+ }
297
+ }
298
+ return message;
299
+ }
300
+ internalBinaryWrite(message: ThreadRecipientEmail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
301
+ /* uint64 id = 1 [jstype = JS_STRING]; */
302
+ if (message.id !== "0")
303
+ writer.tag(1, WireType.Varint).uint64(message.id);
304
+ /* optional resources.timestamp.Timestamp created_at = 2; */
305
+ if (message.createdAt)
306
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
307
+ /* uint64 target_id = 4 [jstype = JS_STRING]; */
308
+ if (message.targetId !== "0")
309
+ writer.tag(4, WireType.Varint).uint64(message.targetId);
310
+ /* uint64 email_id = 5 [jstype = JS_STRING]; */
311
+ if (message.emailId !== "0")
312
+ writer.tag(5, WireType.Varint).uint64(message.emailId);
313
+ /* optional resources.mailer.Email email = 6; */
314
+ if (message.email)
315
+ Email.internalBinaryWrite(message.email, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
316
+ let u = options.writeUnknownFields;
317
+ if (u !== false)
318
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
319
+ return writer;
320
+ }
321
+ }
322
+ /**
323
+ * @generated MessageType for protobuf message resources.mailer.ThreadRecipientEmail
324
+ */
325
+ export const ThreadRecipientEmail = new ThreadRecipientEmail$Type();
326
+ // @generated message type with reflection information, may provide speed optimized methods
327
+ class ThreadState$Type extends MessageType<ThreadState> {
328
+ constructor() {
329
+ super("resources.mailer.ThreadState", [
330
+ { no: 1, name: "thread_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
331
+ { no: 2, name: "email_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
332
+ { no: 3, name: "last_read", kind: "message", T: () => Timestamp },
333
+ { no: 4, name: "unread", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
334
+ { no: 5, name: "important", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
335
+ { no: 6, name: "favorite", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
336
+ { no: 7, name: "muted", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
337
+ { no: 8, name: "archived", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
338
+ ]);
339
+ }
340
+ create(value?: PartialMessage<ThreadState>): ThreadState {
341
+ const message = globalThis.Object.create((this.messagePrototype!));
342
+ message.threadId = "0";
343
+ message.emailId = "0";
344
+ if (value !== undefined)
345
+ reflectionMergePartial<ThreadState>(this, message, value);
346
+ return message;
347
+ }
348
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ThreadState): ThreadState {
349
+ let message = target ?? this.create(), end = reader.pos + length;
350
+ while (reader.pos < end) {
351
+ let [fieldNo, wireType] = reader.tag();
352
+ switch (fieldNo) {
353
+ case /* uint64 thread_id = 1 [jstype = JS_STRING];*/ 1:
354
+ message.threadId = reader.uint64().toString();
355
+ break;
356
+ case /* uint64 email_id = 2 [jstype = JS_STRING];*/ 2:
357
+ message.emailId = reader.uint64().toString();
358
+ break;
359
+ case /* optional resources.timestamp.Timestamp last_read */ 3:
360
+ message.lastRead = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastRead);
361
+ break;
362
+ case /* optional bool unread */ 4:
363
+ message.unread = reader.bool();
364
+ break;
365
+ case /* optional bool important */ 5:
366
+ message.important = reader.bool();
367
+ break;
368
+ case /* optional bool favorite */ 6:
369
+ message.favorite = reader.bool();
370
+ break;
371
+ case /* optional bool muted */ 7:
372
+ message.muted = reader.bool();
373
+ break;
374
+ case /* optional bool archived */ 8:
375
+ message.archived = reader.bool();
376
+ break;
377
+ default:
378
+ let u = options.readUnknownField;
379
+ if (u === "throw")
380
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
381
+ let d = reader.skip(wireType);
382
+ if (u !== false)
383
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
384
+ }
385
+ }
386
+ return message;
387
+ }
388
+ internalBinaryWrite(message: ThreadState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
389
+ /* uint64 thread_id = 1 [jstype = JS_STRING]; */
390
+ if (message.threadId !== "0")
391
+ writer.tag(1, WireType.Varint).uint64(message.threadId);
392
+ /* uint64 email_id = 2 [jstype = JS_STRING]; */
393
+ if (message.emailId !== "0")
394
+ writer.tag(2, WireType.Varint).uint64(message.emailId);
395
+ /* optional resources.timestamp.Timestamp last_read = 3; */
396
+ if (message.lastRead)
397
+ Timestamp.internalBinaryWrite(message.lastRead, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
398
+ /* optional bool unread = 4; */
399
+ if (message.unread !== undefined)
400
+ writer.tag(4, WireType.Varint).bool(message.unread);
401
+ /* optional bool important = 5; */
402
+ if (message.important !== undefined)
403
+ writer.tag(5, WireType.Varint).bool(message.important);
404
+ /* optional bool favorite = 6; */
405
+ if (message.favorite !== undefined)
406
+ writer.tag(6, WireType.Varint).bool(message.favorite);
407
+ /* optional bool muted = 7; */
408
+ if (message.muted !== undefined)
409
+ writer.tag(7, WireType.Varint).bool(message.muted);
410
+ /* optional bool archived = 8; */
411
+ if (message.archived !== undefined)
412
+ writer.tag(8, WireType.Varint).bool(message.archived);
413
+ let u = options.writeUnknownFields;
414
+ if (u !== false)
415
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
416
+ return writer;
417
+ }
418
+ }
419
+ /**
420
+ * @generated MessageType for protobuf message resources.mailer.ThreadState
421
+ */
422
+ export const ThreadState = new ThreadState$Type();
@@ -0,0 +1,93 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter optimize_speed,long_type_number,force_server_none
2
+ // @generated from protobuf file "resources/mailer/user.proto" (package "resources.mailer", syntax proto3)
3
+ // @ts-nocheck
4
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
5
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
6
+ import { WireType } from "@protobuf-ts/runtime";
7
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
8
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
9
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
10
+ import type { PartialMessage } from "@protobuf-ts/runtime";
11
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
12
+ import { MessageType } from "@protobuf-ts/runtime";
13
+ import { Timestamp } from "../timestamp/timestamp";
14
+ /**
15
+ * @generated from protobuf message resources.mailer.UserStatus
16
+ */
17
+ export interface UserStatus {
18
+ /**
19
+ * @generated from protobuf field: int32 user_id = 1;
20
+ */
21
+ userId: number;
22
+ /**
23
+ * @generated from protobuf field: resources.timestamp.Timestamp last_seen = 2;
24
+ */
25
+ lastSeen?: Timestamp;
26
+ /**
27
+ * @sanitize: method=StripTags
28
+ *
29
+ * @generated from protobuf field: optional string status = 3;
30
+ */
31
+ status?: string;
32
+ }
33
+ // @generated message type with reflection information, may provide speed optimized methods
34
+ class UserStatus$Type extends MessageType<UserStatus> {
35
+ constructor() {
36
+ super("resources.mailer.UserStatus", [
37
+ { no: 1, name: "user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gte: 0 } } } },
38
+ { no: 2, name: "last_seen", kind: "message", T: () => Timestamp },
39
+ { no: 3, name: "status", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "40" } } } }
40
+ ]);
41
+ }
42
+ create(value?: PartialMessage<UserStatus>): UserStatus {
43
+ const message = globalThis.Object.create((this.messagePrototype!));
44
+ message.userId = 0;
45
+ if (value !== undefined)
46
+ reflectionMergePartial<UserStatus>(this, message, value);
47
+ return message;
48
+ }
49
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UserStatus): UserStatus {
50
+ let message = target ?? this.create(), end = reader.pos + length;
51
+ while (reader.pos < end) {
52
+ let [fieldNo, wireType] = reader.tag();
53
+ switch (fieldNo) {
54
+ case /* int32 user_id */ 1:
55
+ message.userId = reader.int32();
56
+ break;
57
+ case /* resources.timestamp.Timestamp last_seen */ 2:
58
+ message.lastSeen = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastSeen);
59
+ break;
60
+ case /* optional string status */ 3:
61
+ message.status = reader.string();
62
+ break;
63
+ default:
64
+ let u = options.readUnknownField;
65
+ if (u === "throw")
66
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
67
+ let d = reader.skip(wireType);
68
+ if (u !== false)
69
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
70
+ }
71
+ }
72
+ return message;
73
+ }
74
+ internalBinaryWrite(message: UserStatus, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
75
+ /* int32 user_id = 1; */
76
+ if (message.userId !== 0)
77
+ writer.tag(1, WireType.Varint).int32(message.userId);
78
+ /* resources.timestamp.Timestamp last_seen = 2; */
79
+ if (message.lastSeen)
80
+ Timestamp.internalBinaryWrite(message.lastSeen, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
81
+ /* optional string status = 3; */
82
+ if (message.status !== undefined)
83
+ writer.tag(3, WireType.LengthDelimited).string(message.status);
84
+ let u = options.writeUnknownFields;
85
+ if (u !== false)
86
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
87
+ return writer;
88
+ }
89
+ }
90
+ /**
91
+ * @generated MessageType for protobuf message resources.mailer.UserStatus
92
+ */
93
+ export const UserStatus = new UserStatus$Type();