@fivenet-app/gen 2025.5.2 → 2025.9.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 (169) hide show
  1. package/buf/validate/validate.ts +11301 -0
  2. package/clients.ts +157 -154
  3. package/codegen/dbscanner/dbscanner.ts +91 -0
  4. package/codegen/perms/perms.ts +208 -0
  5. package/codegen/sanitizer/sanitizer.ts +80 -0
  6. package/google/protobuf/any.ts +4 -3
  7. package/google/protobuf/descriptor.ts +393 -239
  8. package/google/protobuf/duration.ts +4 -3
  9. package/google/protobuf/struct.ts +485 -0
  10. package/google/protobuf/timestamp.ts +4 -3
  11. package/package.json +3 -3
  12. package/perms.ts +85 -159
  13. package/resources/accounts/accounts.ts +26 -25
  14. package/resources/accounts/oauth2.ts +30 -29
  15. package/resources/audit/audit.ts +36 -35
  16. package/resources/calendar/access.ts +49 -48
  17. package/resources/calendar/calendar.ts +122 -126
  18. package/resources/centrum/access.ts +345 -0
  19. package/resources/centrum/attributes.ts +8 -11
  20. package/resources/centrum/dispatchers.ts +149 -0
  21. package/resources/centrum/dispatches.ts +252 -115
  22. package/resources/centrum/settings.ts +384 -34
  23. package/resources/centrum/units.ts +112 -92
  24. package/resources/centrum/units_access.ts +54 -55
  25. package/resources/clientconfig/clientconfig.ts +890 -0
  26. package/resources/collab/collab.ts +817 -0
  27. package/resources/common/content/content.ts +113 -30
  28. package/resources/common/cron/cron.ts +43 -31
  29. package/resources/common/database/database.ts +92 -35
  30. package/resources/common/error.ts +17 -16
  31. package/resources/common/grpcws/grpcws.ts +24 -23
  32. package/resources/common/i18n.ts +20 -24
  33. package/resources/common/id_mapping.ts +69 -0
  34. package/resources/common/tests/objects.ts +4 -3
  35. package/resources/common/uuid.ts +4 -3
  36. package/resources/discord/discord.ts +209 -0
  37. package/resources/documents/access.ts +52 -53
  38. package/resources/documents/activity.ts +235 -58
  39. package/resources/documents/category.ts +20 -27
  40. package/resources/documents/comment.ts +26 -25
  41. package/resources/documents/documents.ts +335 -262
  42. package/resources/documents/pins.ts +127 -0
  43. package/resources/documents/requests.ts +31 -30
  44. package/resources/documents/signoff.ts +55 -0
  45. package/resources/documents/state.ts +69 -0
  46. package/resources/documents/templates.ts +119 -136
  47. package/resources/documents/workflow.ts +35 -24
  48. package/resources/file/file.ts +152 -0
  49. package/{services/settings → resources/file}/filestore.ts +179 -165
  50. package/resources/file/meta.ts +148 -0
  51. package/resources/jobs/activity.ts +39 -42
  52. package/resources/jobs/colleagues.ts +67 -60
  53. package/resources/jobs/conduct.ts +29 -30
  54. package/resources/jobs/job_props.ts +46 -48
  55. package/resources/jobs/job_settings.ts +45 -52
  56. package/resources/jobs/jobs.ts +14 -13
  57. package/resources/jobs/labels.ts +21 -22
  58. package/resources/jobs/timeclock.ts +26 -25
  59. package/resources/laws/laws.ts +40 -49
  60. package/resources/livemap/coords.ts +81 -0
  61. package/resources/livemap/heatmap.ts +93 -0
  62. package/resources/livemap/{livemap.ts → marker_marker.ts} +43 -310
  63. package/resources/livemap/user_marker.ts +298 -0
  64. package/resources/mailer/access.ts +75 -74
  65. package/resources/mailer/email.ts +24 -27
  66. package/resources/mailer/events.ts +25 -24
  67. package/resources/mailer/message.ts +45 -50
  68. package/resources/mailer/settings.ts +12 -15
  69. package/resources/mailer/template.ts +25 -28
  70. package/resources/mailer/thread.ts +70 -71
  71. package/resources/notifications/client_view.ts +239 -0
  72. package/resources/notifications/events.ts +50 -101
  73. package/resources/notifications/notifications.ts +52 -57
  74. package/resources/permissions/attributes.ts +63 -206
  75. package/resources/permissions/events.ts +149 -0
  76. package/resources/permissions/permissions.ts +103 -34
  77. package/resources/qualifications/access.ts +27 -26
  78. package/resources/qualifications/exam.ts +188 -126
  79. package/resources/qualifications/qualifications.ts +370 -303
  80. package/resources/settings/banner.ts +14 -21
  81. package/resources/settings/config.ts +163 -79
  82. package/resources/settings/perms.ts +151 -0
  83. package/resources/settings/status.ts +533 -0
  84. package/resources/stats/stats.ts +3 -2
  85. package/resources/sync/activity.ts +24 -23
  86. package/resources/sync/data.ts +94 -26
  87. package/resources/timestamp/timestamp.ts +3 -2
  88. package/resources/{centrum/user_unit.ts → tracker/mapping.ts} +44 -44
  89. package/resources/userinfo/user_info.ts +464 -0
  90. package/resources/users/activity.ts +80 -85
  91. package/resources/users/labels.ts +18 -21
  92. package/resources/users/licenses.ts +9 -8
  93. package/resources/users/props.ts +61 -51
  94. package/resources/users/users.ts +100 -78
  95. package/resources/vehicles/activity.ts +231 -0
  96. package/resources/vehicles/props.ts +103 -0
  97. package/resources/vehicles/vehicles.ts +28 -15
  98. package/resources/wiki/access.ts +49 -48
  99. package/resources/wiki/activity.ts +133 -51
  100. package/resources/wiki/page.ts +134 -87
  101. package/services/auth/auth.client.ts +24 -27
  102. package/services/auth/auth.ts +222 -195
  103. package/services/calendar/calendar.client.ts +32 -91
  104. package/services/calendar/calendar.ts +110 -109
  105. package/services/centrum/centrum.client.ts +97 -137
  106. package/services/centrum/centrum.ts +701 -298
  107. package/services/citizens/citizens.client.ts +70 -39
  108. package/services/citizens/citizens.ts +183 -93
  109. package/services/completor/completor.client.ts +16 -35
  110. package/services/completor/completor.ts +65 -44
  111. package/services/documents/collab.client.ts +46 -0
  112. package/services/documents/collab.ts +13 -0
  113. package/services/documents/documents.client.ts +88 -217
  114. package/services/documents/documents.ts +490 -508
  115. package/services/filestore/filestore.client.ts +86 -0
  116. package/services/filestore/filestore.ts +262 -0
  117. package/services/jobs/conduct.client.ts +10 -25
  118. package/services/jobs/conduct.ts +36 -35
  119. package/services/jobs/jobs.client.ts +22 -61
  120. package/services/jobs/jobs.ts +108 -91
  121. package/services/jobs/timeclock.client.ts +8 -19
  122. package/services/jobs/timeclock.ts +47 -46
  123. package/services/livemap/livemap.client.ts +8 -19
  124. package/services/livemap/livemap.ts +290 -119
  125. package/services/mailer/mailer.client.ts +44 -127
  126. package/services/mailer/mailer.ts +213 -216
  127. package/services/notifications/notifications.client.ts +65 -0
  128. package/services/{notificator/notificator.ts → notifications/notifications.ts} +117 -74
  129. package/services/qualifications/qualifications.client.ts +46 -91
  130. package/services/qualifications/qualifications.ts +181 -175
  131. package/services/settings/accounts.client.ts +10 -25
  132. package/services/settings/accounts.ts +64 -41
  133. package/services/settings/config.client.ts +6 -13
  134. package/services/settings/config.ts +8 -7
  135. package/services/settings/cron.client.ts +4 -7
  136. package/services/settings/cron.ts +4 -3
  137. package/services/settings/laws.client.ts +10 -25
  138. package/services/settings/laws.ts +29 -28
  139. package/services/settings/settings.client.ts +57 -103
  140. package/services/settings/settings.ts +190 -607
  141. package/services/settings/system.client.ts +90 -0
  142. package/services/settings/system.ts +618 -0
  143. package/services/stats/stats.client.ts +4 -3
  144. package/services/stats/stats.ts +4 -3
  145. package/services/sync/sync.client.ts +16 -15
  146. package/services/sync/sync.ts +82 -52
  147. package/services/vehicles/vehicles.client.ts +17 -7
  148. package/services/vehicles/vehicles.ts +169 -24
  149. package/services/wiki/collab.client.ts +46 -0
  150. package/services/wiki/collab.ts +13 -0
  151. package/services/wiki/wiki.client.ts +28 -37
  152. package/services/wiki/wiki.ts +93 -63
  153. package/svcs.ts +79 -103
  154. package/resources/centrum/disponents.ts +0 -81
  155. package/resources/filestore/file.ts +0 -204
  156. package/resources/internet/access.ts +0 -358
  157. package/resources/internet/ads.ts +0 -257
  158. package/resources/internet/domain.ts +0 -328
  159. package/resources/internet/page.ts +0 -428
  160. package/resources/internet/search.ts +0 -128
  161. package/resources/livemap/tracker.ts +0 -81
  162. package/services/internet/ads.client.ts +0 -41
  163. package/services/internet/ads.ts +0 -145
  164. package/services/internet/domain.client.ts +0 -109
  165. package/services/internet/domain.ts +0 -658
  166. package/services/internet/internet.client.ts +0 -58
  167. package/services/internet/internet.ts +0 -268
  168. package/services/notificator/notificator.client.ts +0 -76
  169. package/services/settings/filestore.client.ts +0 -75
@@ -1,5 +1,6 @@
1
- // @generated by protobuf-ts 2.10.0 with parameter optimize_speed,long_type_number,force_server_none
1
+ // @generated by protobuf-ts 2.11.1 with parameter force_server_none,long_type_number,optimize_speed,ts_nocheck
2
2
  // @generated from protobuf file "resources/documents/workflow.proto" (package "resources.documents", syntax proto3)
3
+ // tslint:disable
3
4
  // @ts-nocheck
4
5
  import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
5
6
  import type { IBinaryWriter } from "@protobuf-ts/runtime";
@@ -12,25 +13,23 @@ import { reflectionMergePartial } from "@protobuf-ts/runtime";
12
13
  import { MessageType } from "@protobuf-ts/runtime";
13
14
  import { Duration } from "../../google/protobuf/duration";
14
15
  /**
15
- * @dbscanner: json
16
- *
17
16
  * @generated from protobuf message resources.documents.Workflow
18
17
  */
19
18
  export interface Workflow {
20
19
  /**
21
- * @generated from protobuf field: bool reminder = 1;
20
+ * @generated from protobuf field: bool reminder = 1
22
21
  */
23
22
  reminder: boolean;
24
23
  /**
25
- * @generated from protobuf field: resources.documents.ReminderSettings reminder_settings = 2;
24
+ * @generated from protobuf field: resources.documents.ReminderSettings reminder_settings = 2
26
25
  */
27
26
  reminderSettings?: ReminderSettings;
28
27
  /**
29
- * @generated from protobuf field: bool auto_close = 3;
28
+ * @generated from protobuf field: bool auto_close = 3
30
29
  */
31
30
  autoClose: boolean;
32
31
  /**
33
- * @generated from protobuf field: resources.documents.AutoCloseSettings auto_close_settings = 4;
32
+ * @generated from protobuf field: resources.documents.AutoCloseSettings auto_close_settings = 4
34
33
  */
35
34
  autoCloseSettings?: AutoCloseSettings;
36
35
  }
@@ -39,20 +38,24 @@ export interface Workflow {
39
38
  */
40
39
  export interface ReminderSettings {
41
40
  /**
42
- * @generated from protobuf field: repeated resources.documents.Reminder reminders = 1;
41
+ * @generated from protobuf field: repeated resources.documents.Reminder reminders = 1
43
42
  */
44
43
  reminders: Reminder[];
44
+ /**
45
+ * @generated from protobuf field: int32 max_reminder_count = 2
46
+ */
47
+ maxReminderCount: number;
45
48
  }
46
49
  /**
47
50
  * @generated from protobuf message resources.documents.Reminder
48
51
  */
49
52
  export interface Reminder {
50
53
  /**
51
- * @generated from protobuf field: google.protobuf.Duration duration = 1;
54
+ * @generated from protobuf field: google.protobuf.Duration duration = 1
52
55
  */
53
56
  duration?: Duration;
54
57
  /**
55
- * @generated from protobuf field: string message = 2;
58
+ * @generated from protobuf field: string message = 2
56
59
  */
57
60
  message: string;
58
61
  }
@@ -61,11 +64,11 @@ export interface Reminder {
61
64
  */
62
65
  export interface AutoCloseSettings {
63
66
  /**
64
- * @generated from protobuf field: google.protobuf.Duration duration = 1;
67
+ * @generated from protobuf field: google.protobuf.Duration duration = 1
65
68
  */
66
69
  duration?: Duration;
67
70
  /**
68
- * @generated from protobuf field: string message = 2;
71
+ * @generated from protobuf field: string message = 2
69
72
  */
70
73
  message: string;
71
74
  }
@@ -74,7 +77,7 @@ export interface AutoCloseSettings {
74
77
  */
75
78
  export interface WorkflowCronData {
76
79
  /**
77
- * @generated from protobuf field: uint64 last_doc_id = 1;
80
+ * @generated from protobuf field: int64 last_doc_id = 1
78
81
  */
79
82
  lastDocId: number;
80
83
  }
@@ -86,7 +89,7 @@ class Workflow$Type extends MessageType<Workflow> {
86
89
  { no: 2, name: "reminder_settings", kind: "message", T: () => ReminderSettings },
87
90
  { no: 3, name: "auto_close", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
88
91
  { no: 4, name: "auto_close_settings", kind: "message", T: () => AutoCloseSettings }
89
- ]);
92
+ ], { "codegen.dbscanner.dbscanner": { enabled: true } });
90
93
  }
91
94
  create(value?: PartialMessage<Workflow>): Workflow {
92
95
  const message = globalThis.Object.create((this.messagePrototype!));
@@ -151,12 +154,14 @@ export const Workflow = new Workflow$Type();
151
154
  class ReminderSettings$Type extends MessageType<ReminderSettings> {
152
155
  constructor() {
153
156
  super("resources.documents.ReminderSettings", [
154
- { no: 1, name: "reminders", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Reminder, options: { "validate.rules": { repeated: { maxItems: "3" } } } }
157
+ { no: 1, name: "reminders", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Reminder, options: { "buf.validate.field": { repeated: { maxItems: "3" } } } },
158
+ { no: 2, name: "max_reminder_count", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { lte: 10, gte: 1 } } } }
155
159
  ]);
156
160
  }
157
161
  create(value?: PartialMessage<ReminderSettings>): ReminderSettings {
158
162
  const message = globalThis.Object.create((this.messagePrototype!));
159
163
  message.reminders = [];
164
+ message.maxReminderCount = 0;
160
165
  if (value !== undefined)
161
166
  reflectionMergePartial<ReminderSettings>(this, message, value);
162
167
  return message;
@@ -169,6 +174,9 @@ class ReminderSettings$Type extends MessageType<ReminderSettings> {
169
174
  case /* repeated resources.documents.Reminder reminders */ 1:
170
175
  message.reminders.push(Reminder.internalBinaryRead(reader, reader.uint32(), options));
171
176
  break;
177
+ case /* int32 max_reminder_count */ 2:
178
+ message.maxReminderCount = reader.int32();
179
+ break;
172
180
  default:
173
181
  let u = options.readUnknownField;
174
182
  if (u === "throw")
@@ -184,6 +192,9 @@ class ReminderSettings$Type extends MessageType<ReminderSettings> {
184
192
  /* repeated resources.documents.Reminder reminders = 1; */
185
193
  for (let i = 0; i < message.reminders.length; i++)
186
194
  Reminder.internalBinaryWrite(message.reminders[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
195
+ /* int32 max_reminder_count = 2; */
196
+ if (message.maxReminderCount !== 0)
197
+ writer.tag(2, WireType.Varint).int32(message.maxReminderCount);
187
198
  let u = options.writeUnknownFields;
188
199
  if (u !== false)
189
200
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -198,8 +209,8 @@ export const ReminderSettings = new ReminderSettings$Type();
198
209
  class Reminder$Type extends MessageType<Reminder> {
199
210
  constructor() {
200
211
  super("resources.documents.Reminder", [
201
- { no: 1, name: "duration", kind: "message", T: () => Duration, options: { "validate.rules": { duration: { required: true, lt: { seconds: "7776000" }, gte: { seconds: "86400" } } } } },
202
- { no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "255" } } } }
212
+ { no: 1, name: "duration", kind: "message", T: () => Duration, options: { "buf.validate.field": { required: true, duration: { lt: { seconds: "7776000" }, gte: { seconds: "3600" } } } } },
213
+ { no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } } } }
203
214
  ]);
204
215
  }
205
216
  create(value?: PartialMessage<Reminder>): Reminder {
@@ -252,8 +263,8 @@ export const Reminder = new Reminder$Type();
252
263
  class AutoCloseSettings$Type extends MessageType<AutoCloseSettings> {
253
264
  constructor() {
254
265
  super("resources.documents.AutoCloseSettings", [
255
- { no: 1, name: "duration", kind: "message", T: () => Duration, options: { "validate.rules": { duration: { required: true, lt: { seconds: "7776000" }, gte: { seconds: "86400" } } } } },
256
- { no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "255" } } } }
266
+ { no: 1, name: "duration", kind: "message", T: () => Duration, options: { "buf.validate.field": { required: true, duration: { lt: { seconds: "7776000" }, gte: { seconds: "86400" } } } } },
267
+ { no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } } } }
257
268
  ]);
258
269
  }
259
270
  create(value?: PartialMessage<AutoCloseSettings>): AutoCloseSettings {
@@ -306,7 +317,7 @@ export const AutoCloseSettings = new AutoCloseSettings$Type();
306
317
  class WorkflowCronData$Type extends MessageType<WorkflowCronData> {
307
318
  constructor() {
308
319
  super("resources.documents.WorkflowCronData", [
309
- { no: 1, name: "last_doc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }
320
+ { no: 1, name: "last_doc_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }
310
321
  ]);
311
322
  }
312
323
  create(value?: PartialMessage<WorkflowCronData>): WorkflowCronData {
@@ -321,8 +332,8 @@ class WorkflowCronData$Type extends MessageType<WorkflowCronData> {
321
332
  while (reader.pos < end) {
322
333
  let [fieldNo, wireType] = reader.tag();
323
334
  switch (fieldNo) {
324
- case /* uint64 last_doc_id */ 1:
325
- message.lastDocId = reader.uint64().toNumber();
335
+ case /* int64 last_doc_id */ 1:
336
+ message.lastDocId = reader.int64().toNumber();
326
337
  break;
327
338
  default:
328
339
  let u = options.readUnknownField;
@@ -336,9 +347,9 @@ class WorkflowCronData$Type extends MessageType<WorkflowCronData> {
336
347
  return message;
337
348
  }
338
349
  internalBinaryWrite(message: WorkflowCronData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
339
- /* uint64 last_doc_id = 1; */
350
+ /* int64 last_doc_id = 1; */
340
351
  if (message.lastDocId !== 0)
341
- writer.tag(1, WireType.Varint).uint64(message.lastDocId);
352
+ writer.tag(1, WireType.Varint).int64(message.lastDocId);
342
353
  let u = options.writeUnknownFields;
343
354
  if (u !== false)
344
355
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -0,0 +1,152 @@
1
+ // @generated by protobuf-ts 2.11.1 with parameter force_server_none,long_type_number,optimize_speed,ts_nocheck
2
+ // @generated from protobuf file "resources/file/file.proto" (package "resources.file", syntax proto3)
3
+ // tslint:disable
4
+ // @ts-nocheck
5
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
6
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
7
+ import { WireType } from "@protobuf-ts/runtime";
8
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
9
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
10
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
+ import type { PartialMessage } from "@protobuf-ts/runtime";
12
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
+ import { MessageType } from "@protobuf-ts/runtime";
14
+ import { FileMeta } from "./meta";
15
+ import { Timestamp } from "../timestamp/timestamp";
16
+ /**
17
+ * @generated from protobuf message resources.file.File
18
+ */
19
+ export interface File {
20
+ /**
21
+ * @generated from protobuf field: optional int64 parent_id = 1
22
+ */
23
+ parentId?: number;
24
+ /**
25
+ * @generated from protobuf field: int64 id = 2
26
+ */
27
+ id: number;
28
+ /**
29
+ * @generated from protobuf field: string file_path = 3
30
+ */
31
+ filePath: string;
32
+ /**
33
+ * @generated from protobuf field: optional resources.timestamp.Timestamp created_at = 4
34
+ */
35
+ createdAt?: Timestamp;
36
+ /**
37
+ * @generated from protobuf field: int64 byte_size = 5
38
+ */
39
+ byteSize: number; // Bytes stored
40
+ /**
41
+ * @generated from protobuf field: string content_type = 6
42
+ */
43
+ contentType: string;
44
+ /**
45
+ * @generated from protobuf field: optional resources.file.FileMeta meta = 7
46
+ */
47
+ meta?: FileMeta;
48
+ /**
49
+ * @generated from protobuf field: bool is_dir = 8
50
+ */
51
+ isDir: boolean;
52
+ }
53
+ // @generated message type with reflection information, may provide speed optimized methods
54
+ class File$Type extends MessageType<File> {
55
+ constructor() {
56
+ super("resources.file.File", [
57
+ { no: 1, name: "parent_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
58
+ { no: 2, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
59
+ { no: 3, name: "file_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
60
+ { no: 4, name: "created_at", kind: "message", T: () => Timestamp },
61
+ { no: 5, name: "byte_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
62
+ { no: 6, name: "content_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
63
+ { no: 7, name: "meta", kind: "message", T: () => FileMeta },
64
+ { no: 8, name: "is_dir", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
65
+ ]);
66
+ }
67
+ create(value?: PartialMessage<File>): File {
68
+ const message = globalThis.Object.create((this.messagePrototype!));
69
+ message.id = 0;
70
+ message.filePath = "";
71
+ message.byteSize = 0;
72
+ message.contentType = "";
73
+ message.isDir = false;
74
+ if (value !== undefined)
75
+ reflectionMergePartial<File>(this, message, value);
76
+ return message;
77
+ }
78
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: File): File {
79
+ let message = target ?? this.create(), end = reader.pos + length;
80
+ while (reader.pos < end) {
81
+ let [fieldNo, wireType] = reader.tag();
82
+ switch (fieldNo) {
83
+ case /* optional int64 parent_id */ 1:
84
+ message.parentId = reader.int64().toNumber();
85
+ break;
86
+ case /* int64 id */ 2:
87
+ message.id = reader.int64().toNumber();
88
+ break;
89
+ case /* string file_path */ 3:
90
+ message.filePath = reader.string();
91
+ break;
92
+ case /* optional resources.timestamp.Timestamp created_at */ 4:
93
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
94
+ break;
95
+ case /* int64 byte_size */ 5:
96
+ message.byteSize = reader.int64().toNumber();
97
+ break;
98
+ case /* string content_type */ 6:
99
+ message.contentType = reader.string();
100
+ break;
101
+ case /* optional resources.file.FileMeta meta */ 7:
102
+ message.meta = FileMeta.internalBinaryRead(reader, reader.uint32(), options, message.meta);
103
+ break;
104
+ case /* bool is_dir */ 8:
105
+ message.isDir = reader.bool();
106
+ break;
107
+ default:
108
+ let u = options.readUnknownField;
109
+ if (u === "throw")
110
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
111
+ let d = reader.skip(wireType);
112
+ if (u !== false)
113
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
114
+ }
115
+ }
116
+ return message;
117
+ }
118
+ internalBinaryWrite(message: File, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
119
+ /* optional int64 parent_id = 1; */
120
+ if (message.parentId !== undefined)
121
+ writer.tag(1, WireType.Varint).int64(message.parentId);
122
+ /* int64 id = 2; */
123
+ if (message.id !== 0)
124
+ writer.tag(2, WireType.Varint).int64(message.id);
125
+ /* string file_path = 3; */
126
+ if (message.filePath !== "")
127
+ writer.tag(3, WireType.LengthDelimited).string(message.filePath);
128
+ /* optional resources.timestamp.Timestamp created_at = 4; */
129
+ if (message.createdAt)
130
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
131
+ /* int64 byte_size = 5; */
132
+ if (message.byteSize !== 0)
133
+ writer.tag(5, WireType.Varint).int64(message.byteSize);
134
+ /* string content_type = 6; */
135
+ if (message.contentType !== "")
136
+ writer.tag(6, WireType.LengthDelimited).string(message.contentType);
137
+ /* optional resources.file.FileMeta meta = 7; */
138
+ if (message.meta)
139
+ FileMeta.internalBinaryWrite(message.meta, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
140
+ /* bool is_dir = 8; */
141
+ if (message.isDir !== false)
142
+ writer.tag(8, WireType.Varint).bool(message.isDir);
143
+ let u = options.writeUnknownFields;
144
+ if (u !== false)
145
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
146
+ return writer;
147
+ }
148
+ }
149
+ /**
150
+ * @generated MessageType for protobuf message resources.file.File
151
+ */
152
+ export const File = new File$Type();