@fivenet-app/gen 2026.5.0 → 2026.7.0

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 (87) hide show
  1. package/clients.ts +6 -0
  2. package/codegen/perms/perms.ts +74 -40
  3. package/codegen/sanitizer/sanitizer.ts +6 -0
  4. package/google/protobuf/descriptor.ts +11 -3
  5. package/google/protobuf/timestamp.ts +7 -6
  6. package/package.json +1 -1
  7. package/perms.ts +387 -41
  8. package/resources/access/access.ts +481 -0
  9. package/resources/accounts/accounts.ts +41 -30
  10. package/resources/audit/audit.ts +5 -1
  11. package/resources/calendar/access/access.ts +0 -330
  12. package/resources/calendar/calendar.ts +307 -25
  13. package/resources/calendar/entries/entries.ts +204 -11
  14. package/resources/centrum/units/access/access.ts +0 -373
  15. package/resources/centrum/units/units.ts +20 -8
  16. package/resources/citizens/labels/access.ts +0 -191
  17. package/resources/citizens/labels/labels.ts +20 -8
  18. package/resources/common/content/diff_activity.ts +1 -1
  19. package/resources/cron/cron.ts +1 -1
  20. package/resources/documents/access/access.ts +0 -329
  21. package/resources/documents/activity/activity.ts +49 -45
  22. package/resources/documents/documents.ts +1 -1
  23. package/resources/documents/requests/requests.ts +1 -1
  24. package/resources/documents/stamps/stamp.ts +40 -210
  25. package/resources/documents/templates/templates.ts +158 -318
  26. package/resources/jobs/colleagues/activity/activity.ts +2 -2
  27. package/resources/jobs/conduct/conduct.ts +2 -2
  28. package/resources/jobs/jobs.ts +22 -0
  29. package/resources/jobs/labels/labels.ts +9 -9
  30. package/resources/laws/laws.ts +96 -50
  31. package/resources/livemap/markers/marker_marker.ts +311 -4
  32. package/resources/mailer/access/access.ts +0 -457
  33. package/resources/mailer/emails/email.ts +4 -4
  34. package/resources/notifications/events/events.ts +18 -1
  35. package/resources/permissions/attributes/attributes.ts +51 -39
  36. package/resources/permissions/permissions/permissions.ts +46 -34
  37. package/resources/qualifications/access/access.ts +0 -248
  38. package/resources/qualifications/qualifications.ts +9 -9
  39. package/resources/settings/config.ts +53 -5
  40. package/resources/settings/data.ts +1 -1
  41. package/resources/stats/stats.ts +32 -20
  42. package/resources/sync/data/data.ts +22 -10
  43. package/resources/userinfo/userinfo.ts +202 -51
  44. package/resources/users/activity/activity.ts +70 -77
  45. package/resources/wiki/access/access.ts +0 -330
  46. package/resources/wiki/activity/activity.ts +45 -45
  47. package/resources/wiki/page.ts +9 -9
  48. package/services/auth/auth.ts +1 -1
  49. package/services/calendar/calendar.ts +1 -1
  50. package/services/calendar/entries.ts +13 -2
  51. package/services/centrum/dispatches.ts +32 -12
  52. package/services/centrum/units.client.ts +15 -2
  53. package/services/centrum/units.ts +237 -129
  54. package/services/citizens/citizens.ts +1 -1
  55. package/services/citizens/labels.client.ts +13 -0
  56. package/services/citizens/labels.ts +135 -4
  57. package/services/completor/completor.client.ts +0 -13
  58. package/services/completor/completor.ts +2 -116
  59. package/services/documents/approval.ts +20 -9
  60. package/services/documents/categories.ts +1 -1
  61. package/services/documents/collab.ts +1 -1
  62. package/services/documents/comments.ts +4 -4
  63. package/services/documents/documents.ts +38 -38
  64. package/services/documents/stats.ts +14 -2
  65. package/services/documents/templates.ts +1 -1
  66. package/services/filestore/filestore.ts +4 -4
  67. package/services/jobs/colleagues.ts +4 -4
  68. package/services/jobs/conduct.ts +2 -2
  69. package/services/jobs/groups.client.ts +22 -0
  70. package/services/jobs/groups.ts +9 -0
  71. package/services/jobs/timeclock.ts +2 -2
  72. package/services/mailer/settings.ts +1 -1
  73. package/services/mailer/thread.ts +3 -3
  74. package/services/qualifications/exam.ts +5 -5
  75. package/services/qualifications/qualifications.ts +52 -34
  76. package/services/settings/accounts.ts +19 -6
  77. package/services/settings/config.ts +2 -2
  78. package/services/settings/cron.ts +2 -2
  79. package/services/settings/laws.client.ts +44 -5
  80. package/services/settings/laws.ts +357 -4
  81. package/services/settings/system.ts +6 -6
  82. package/services/sync/sync.client.ts +42 -14
  83. package/services/sync/sync.ts +162 -13
  84. package/services/wiki/collab.ts +1 -1
  85. package/services/wiki/wiki.client.ts +15 -2
  86. package/services/wiki/wiki.ts +122 -0
  87. package/svcs.ts +19 -1
@@ -131,7 +131,7 @@ export interface LabelsChange {
131
131
  /**
132
132
  * @generated from protobuf field: repeated resources.jobs.labels.Label removed = 2
133
133
  */
134
- removed: Label[];
134
+ removed: Label[]; // TODO switch to storing label ids instead of the whole label (resolve labels on client-side)
135
135
  }
136
136
  /**
137
137
  * @generated from protobuf message resources.jobs.colleagues.activity.NameChange
@@ -198,7 +198,7 @@ class ColleagueActivity$Type extends MessageType<ColleagueActivity> {
198
198
  { no: 6, name: "source_user", kind: "message", T: () => Colleague, options: { "tagger.tags": "alias:\"source_user\"" } },
199
199
  { no: 7, name: "target_user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: 0 } } } },
200
200
  { no: 8, name: "target_user", kind: "message", T: () => Colleague, options: { "tagger.tags": "alias:\"target_user\"" } },
201
- { no: 9, name: "activity_type", kind: "enum", T: () => ["resources.jobs.colleagues.activity.ColleagueActivityType", ColleagueActivityType, "COLLEAGUE_ACTIVITY_TYPE_"] },
201
+ { no: 9, name: "activity_type", kind: "enum", T: () => ["resources.jobs.colleagues.activity.ColleagueActivityType", ColleagueActivityType, "COLLEAGUE_ACTIVITY_TYPE_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } },
202
202
  { no: 10, name: "reason", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
203
203
  { no: 11, name: "data", kind: "message", T: () => ColleagueActivityData }
204
204
  ]);
@@ -121,9 +121,9 @@ class ConductEntry$Type extends MessageType<ConductEntry> {
121
121
  { no: 6, name: "type", kind: "enum", T: () => ["resources.jobs.conduct.ConductType", ConductType, "CONDUCT_TYPE_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } },
122
122
  { no: 7, name: "draft", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
123
123
  { no: 8, name: "message", kind: "message", T: () => Content },
124
- { no: 9, name: "files", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => File, options: { "tagger.tags": "alias:\"files\"" } },
124
+ { no: 9, name: "files", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => File, options: { "buf.validate.field": { repeated: { maxItems: "5" } }, "tagger.tags": "alias:\"files\"" } },
125
125
  { no: 10, name: "expires_at", kind: "message", T: () => Timestamp },
126
- { no: 11, name: "target_user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gt: 0 } } } },
126
+ { no: 11, name: "target_user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: 0 } } } },
127
127
  { no: 12, name: "target_user", kind: "message", T: () => Colleague, options: { "tagger.tags": "alias:\"target_user\"" } },
128
128
  { no: 13, name: "creator_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gt: 0 } } } },
129
129
  { no: 14, name: "creator", kind: "message", T: () => Colleague, options: { "tagger.tags": "alias:\"creator\"" } }
@@ -15,6 +15,10 @@ import { MessageType } from "@protobuf-ts/runtime";
15
15
  * @generated from protobuf message resources.jobs.Job
16
16
  */
17
17
  export interface Job {
18
+ /**
19
+ * @generated from protobuf field: optional int64 id = 4
20
+ */
21
+ id?: number;
18
22
  /**
19
23
  * @generated from protobuf field: string name = 1
20
24
  */
@@ -32,6 +36,10 @@ export interface Job {
32
36
  * @generated from protobuf message resources.jobs.JobGrade
33
37
  */
34
38
  export interface JobGrade {
39
+ /**
40
+ * @generated from protobuf field: optional int64 job_id = 4
41
+ */
42
+ jobId?: number;
35
43
  /**
36
44
  * @generated from protobuf field: optional string job_name = 1
37
45
  */
@@ -49,6 +57,7 @@ export interface JobGrade {
49
57
  class Job$Type extends MessageType<Job> {
50
58
  constructor() {
51
59
  super("resources.jobs.Job", [
60
+ { no: 4, name: "id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
52
61
  { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } }, "tagger.tags": "sql:\"primary_key\" alias:\"name\"" } },
53
62
  { no: 2, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } },
54
63
  { no: 3, name: "grades", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => JobGrade }
@@ -68,6 +77,9 @@ class Job$Type extends MessageType<Job> {
68
77
  while (reader.pos < end) {
69
78
  let [fieldNo, wireType] = reader.tag();
70
79
  switch (fieldNo) {
80
+ case /* optional int64 id */ 4:
81
+ message.id = reader.int64().toNumber();
82
+ break;
71
83
  case /* string name */ 1:
72
84
  message.name = reader.string();
73
85
  break;
@@ -98,6 +110,9 @@ class Job$Type extends MessageType<Job> {
98
110
  /* repeated resources.jobs.JobGrade grades = 3; */
99
111
  for (let i = 0; i < message.grades.length; i++)
100
112
  JobGrade.internalBinaryWrite(message.grades[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
113
+ /* optional int64 id = 4; */
114
+ if (message.id !== undefined)
115
+ writer.tag(4, WireType.Varint).int64(message.id);
101
116
  let u = options.writeUnknownFields;
102
117
  if (u !== false)
103
118
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -112,6 +127,7 @@ export const Job = new Job$Type();
112
127
  class JobGrade$Type extends MessageType<JobGrade> {
113
128
  constructor() {
114
129
  super("resources.jobs.JobGrade", [
130
+ { no: 4, name: "job_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
115
131
  { no: 1, name: "job_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } },
116
132
  { no: 2, name: "grade", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: 0 } } } },
117
133
  { no: 3, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } }
@@ -130,6 +146,9 @@ class JobGrade$Type extends MessageType<JobGrade> {
130
146
  while (reader.pos < end) {
131
147
  let [fieldNo, wireType] = reader.tag();
132
148
  switch (fieldNo) {
149
+ case /* optional int64 job_id */ 4:
150
+ message.jobId = reader.int64().toNumber();
151
+ break;
133
152
  case /* optional string job_name */ 1:
134
153
  message.jobName = reader.string();
135
154
  break;
@@ -160,6 +179,9 @@ class JobGrade$Type extends MessageType<JobGrade> {
160
179
  /* string label = 3; */
161
180
  if (message.label !== "")
162
181
  writer.tag(3, WireType.LengthDelimited).string(message.label);
182
+ /* optional int64 job_id = 4; */
183
+ if (message.jobId !== undefined)
184
+ writer.tag(4, WireType.Varint).int64(message.jobId);
163
185
  let u = options.writeUnknownFields;
164
186
  if (u !== false)
165
187
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -50,9 +50,9 @@ export interface Label {
50
50
  */
51
51
  icon?: string;
52
52
  /**
53
- * @generated from protobuf field: int32 order = 7
53
+ * @generated from protobuf field: int32 sort_order = 7
54
54
  */
55
- order: number;
55
+ sortOrder: number;
56
56
  }
57
57
  /**
58
58
  * @generated from protobuf message resources.jobs.labels.LabelCount
@@ -124,7 +124,7 @@ class Label$Type extends MessageType<Label> {
124
124
  { no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "48" } } } },
125
125
  { no: 5, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { len: "7", pattern: "^#[A-Fa-f0-9]{6}$" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
126
126
  { no: 6, name: "icon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "128" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
127
- { no: 7, name: "order", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
127
+ { no: 7, name: "sort_order", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: 0 } } } }
128
128
  ]);
129
129
  }
130
130
  create(value?: PartialMessage<Label>): Label {
@@ -132,7 +132,7 @@ class Label$Type extends MessageType<Label> {
132
132
  message.id = 0;
133
133
  message.name = "";
134
134
  message.color = "";
135
- message.order = 0;
135
+ message.sortOrder = 0;
136
136
  if (value !== undefined)
137
137
  reflectionMergePartial<Label>(this, message, value);
138
138
  return message;
@@ -160,8 +160,8 @@ class Label$Type extends MessageType<Label> {
160
160
  case /* optional string icon */ 6:
161
161
  message.icon = reader.string();
162
162
  break;
163
- case /* int32 order */ 7:
164
- message.order = reader.int32();
163
+ case /* int32 sort_order */ 7:
164
+ message.sortOrder = reader.int32();
165
165
  break;
166
166
  default:
167
167
  let u = options.readUnknownField;
@@ -193,9 +193,9 @@ class Label$Type extends MessageType<Label> {
193
193
  /* optional string icon = 6; */
194
194
  if (message.icon !== undefined)
195
195
  writer.tag(6, WireType.LengthDelimited).string(message.icon);
196
- /* int32 order = 7; */
197
- if (message.order !== 0)
198
- writer.tag(7, WireType.Varint).int32(message.order);
196
+ /* int32 sort_order = 7; */
197
+ if (message.sortOrder !== 0)
198
+ writer.tag(7, WireType.Varint).int32(message.sortOrder);
199
199
  let u = options.writeUnknownFields;
200
200
  if (u !== false)
201
201
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -29,15 +29,23 @@ export interface LawBook {
29
29
  */
30
30
  updatedAt?: Timestamp;
31
31
  /**
32
- * @generated from protobuf field: string name = 4
32
+ * @generated from protobuf field: optional resources.timestamp.Timestamp deleted_at = 4
33
+ */
34
+ deletedAt?: Timestamp;
35
+ /**
36
+ * @generated from protobuf field: int32 sort_order = 8
37
+ */
38
+ sortOrder: number;
39
+ /**
40
+ * @generated from protobuf field: string name = 5
33
41
  */
34
42
  name: string;
35
43
  /**
36
- * @generated from protobuf field: optional string description = 5
44
+ * @generated from protobuf field: optional string description = 6
37
45
  */
38
46
  description?: string;
39
47
  /**
40
- * @generated from protobuf field: repeated resources.laws.Law laws = 6
48
+ * @generated from protobuf field: repeated resources.laws.Law laws = 7
41
49
  */
42
50
  laws: Law[];
43
51
  }
@@ -58,31 +66,39 @@ export interface Law {
58
66
  */
59
67
  updatedAt?: Timestamp;
60
68
  /**
61
- * @generated from protobuf field: int64 lawbook_id = 4
69
+ * @generated from protobuf field: optional resources.timestamp.Timestamp deleted_at = 4
70
+ */
71
+ deletedAt?: Timestamp;
72
+ /**
73
+ * @generated from protobuf field: int64 lawbook_id = 5
62
74
  */
63
75
  lawbookId: number;
64
76
  /**
65
- * @generated from protobuf field: string name = 5
77
+ * @generated from protobuf field: int32 sort_order = 12
78
+ */
79
+ sortOrder: number;
80
+ /**
81
+ * @generated from protobuf field: string name = 6
66
82
  */
67
83
  name: string;
68
84
  /**
69
- * @generated from protobuf field: optional string description = 6
85
+ * @generated from protobuf field: optional string description = 7
70
86
  */
71
87
  description?: string;
72
88
  /**
73
- * @generated from protobuf field: optional string hint = 7
89
+ * @generated from protobuf field: optional string hint = 8
74
90
  */
75
91
  hint?: string;
76
92
  /**
77
- * @generated from protobuf field: optional uint32 fine = 8
93
+ * @generated from protobuf field: optional uint32 fine = 9
78
94
  */
79
95
  fine?: number;
80
96
  /**
81
- * @generated from protobuf field: optional uint32 detention_time = 9
97
+ * @generated from protobuf field: optional uint32 detention_time = 10
82
98
  */
83
99
  detentionTime?: number;
84
100
  /**
85
- * @generated from protobuf field: optional uint32 stvo_points = 10
101
+ * @generated from protobuf field: optional uint32 stvo_points = 11
86
102
  */
87
103
  stvoPoints?: number;
88
104
  }
@@ -93,14 +109,17 @@ class LawBook$Type extends MessageType<LawBook> {
93
109
  { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "tagger.tags": "sql:\"primary_key\" alias:\"id\"" } },
94
110
  { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
95
111
  { no: 3, name: "updated_at", kind: "message", T: () => Timestamp },
96
- { no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "128" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
97
- { no: 5, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
98
- { no: 6, name: "laws", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Law }
112
+ { no: 4, name: "deleted_at", kind: "message", T: () => Timestamp },
113
+ { no: 8, name: "sort_order", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: 0 } } } },
114
+ { no: 5, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "128" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
115
+ { no: 6, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
116
+ { no: 7, name: "laws", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Law }
99
117
  ]);
100
118
  }
101
119
  create(value?: PartialMessage<LawBook>): LawBook {
102
120
  const message = globalThis.Object.create((this.messagePrototype!));
103
121
  message.id = 0;
122
+ message.sortOrder = 0;
104
123
  message.name = "";
105
124
  message.laws = [];
106
125
  if (value !== undefined)
@@ -121,13 +140,19 @@ class LawBook$Type extends MessageType<LawBook> {
121
140
  case /* optional resources.timestamp.Timestamp updated_at */ 3:
122
141
  message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
123
142
  break;
124
- case /* string name */ 4:
143
+ case /* optional resources.timestamp.Timestamp deleted_at */ 4:
144
+ message.deletedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.deletedAt);
145
+ break;
146
+ case /* int32 sort_order */ 8:
147
+ message.sortOrder = reader.int32();
148
+ break;
149
+ case /* string name */ 5:
125
150
  message.name = reader.string();
126
151
  break;
127
- case /* optional string description */ 5:
152
+ case /* optional string description */ 6:
128
153
  message.description = reader.string();
129
154
  break;
130
- case /* repeated resources.laws.Law laws */ 6:
155
+ case /* repeated resources.laws.Law laws */ 7:
131
156
  message.laws.push(Law.internalBinaryRead(reader, reader.uint32(), options));
132
157
  break;
133
158
  default:
@@ -151,15 +176,21 @@ class LawBook$Type extends MessageType<LawBook> {
151
176
  /* optional resources.timestamp.Timestamp updated_at = 3; */
152
177
  if (message.updatedAt)
153
178
  Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
154
- /* string name = 4; */
179
+ /* optional resources.timestamp.Timestamp deleted_at = 4; */
180
+ if (message.deletedAt)
181
+ Timestamp.internalBinaryWrite(message.deletedAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
182
+ /* string name = 5; */
155
183
  if (message.name !== "")
156
- writer.tag(4, WireType.LengthDelimited).string(message.name);
157
- /* optional string description = 5; */
184
+ writer.tag(5, WireType.LengthDelimited).string(message.name);
185
+ /* optional string description = 6; */
158
186
  if (message.description !== undefined)
159
- writer.tag(5, WireType.LengthDelimited).string(message.description);
160
- /* repeated resources.laws.Law laws = 6; */
187
+ writer.tag(6, WireType.LengthDelimited).string(message.description);
188
+ /* repeated resources.laws.Law laws = 7; */
161
189
  for (let i = 0; i < message.laws.length; i++)
162
- Law.internalBinaryWrite(message.laws[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
190
+ Law.internalBinaryWrite(message.laws[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
191
+ /* int32 sort_order = 8; */
192
+ if (message.sortOrder !== 0)
193
+ writer.tag(8, WireType.Varint).int32(message.sortOrder);
163
194
  let u = options.writeUnknownFields;
164
195
  if (u !== false)
165
196
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -177,19 +208,22 @@ class Law$Type extends MessageType<Law> {
177
208
  { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "tagger.tags": "sql:\"primary_key\" alias:\"law.id\"" } },
178
209
  { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
179
210
  { no: 3, name: "updated_at", kind: "message", T: () => Timestamp },
180
- { no: 4, name: "lawbook_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
181
- { no: 5, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "128" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
182
- { no: 6, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "1024" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
183
- { no: 7, name: "hint", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "512" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
184
- { no: 8, name: "fine", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
185
- { no: 9, name: "detention_time", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
186
- { no: 10, name: "stvo_points", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }
211
+ { no: 4, name: "deleted_at", kind: "message", T: () => Timestamp },
212
+ { no: 5, name: "lawbook_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
213
+ { no: 12, name: "sort_order", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: 0 } } } },
214
+ { no: 6, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "128" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
215
+ { no: 7, name: "description", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "1024" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
216
+ { no: 8, name: "hint", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "512" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
217
+ { no: 9, name: "fine", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
218
+ { no: 10, name: "detention_time", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
219
+ { no: 11, name: "stvo_points", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }
187
220
  ]);
188
221
  }
189
222
  create(value?: PartialMessage<Law>): Law {
190
223
  const message = globalThis.Object.create((this.messagePrototype!));
191
224
  message.id = 0;
192
225
  message.lawbookId = 0;
226
+ message.sortOrder = 0;
193
227
  message.name = "";
194
228
  if (value !== undefined)
195
229
  reflectionMergePartial<Law>(this, message, value);
@@ -209,25 +243,31 @@ class Law$Type extends MessageType<Law> {
209
243
  case /* optional resources.timestamp.Timestamp updated_at */ 3:
210
244
  message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
211
245
  break;
212
- case /* int64 lawbook_id */ 4:
246
+ case /* optional resources.timestamp.Timestamp deleted_at */ 4:
247
+ message.deletedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.deletedAt);
248
+ break;
249
+ case /* int64 lawbook_id */ 5:
213
250
  message.lawbookId = reader.int64().toNumber();
214
251
  break;
215
- case /* string name */ 5:
252
+ case /* int32 sort_order */ 12:
253
+ message.sortOrder = reader.int32();
254
+ break;
255
+ case /* string name */ 6:
216
256
  message.name = reader.string();
217
257
  break;
218
- case /* optional string description */ 6:
258
+ case /* optional string description */ 7:
219
259
  message.description = reader.string();
220
260
  break;
221
- case /* optional string hint */ 7:
261
+ case /* optional string hint */ 8:
222
262
  message.hint = reader.string();
223
263
  break;
224
- case /* optional uint32 fine */ 8:
264
+ case /* optional uint32 fine */ 9:
225
265
  message.fine = reader.uint32();
226
266
  break;
227
- case /* optional uint32 detention_time */ 9:
267
+ case /* optional uint32 detention_time */ 10:
228
268
  message.detentionTime = reader.uint32();
229
269
  break;
230
- case /* optional uint32 stvo_points */ 10:
270
+ case /* optional uint32 stvo_points */ 11:
231
271
  message.stvoPoints = reader.uint32();
232
272
  break;
233
273
  default:
@@ -251,27 +291,33 @@ class Law$Type extends MessageType<Law> {
251
291
  /* optional resources.timestamp.Timestamp updated_at = 3; */
252
292
  if (message.updatedAt)
253
293
  Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
254
- /* int64 lawbook_id = 4; */
294
+ /* optional resources.timestamp.Timestamp deleted_at = 4; */
295
+ if (message.deletedAt)
296
+ Timestamp.internalBinaryWrite(message.deletedAt, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
297
+ /* int64 lawbook_id = 5; */
255
298
  if (message.lawbookId !== 0)
256
- writer.tag(4, WireType.Varint).int64(message.lawbookId);
257
- /* string name = 5; */
299
+ writer.tag(5, WireType.Varint).int64(message.lawbookId);
300
+ /* string name = 6; */
258
301
  if (message.name !== "")
259
- writer.tag(5, WireType.LengthDelimited).string(message.name);
260
- /* optional string description = 6; */
302
+ writer.tag(6, WireType.LengthDelimited).string(message.name);
303
+ /* optional string description = 7; */
261
304
  if (message.description !== undefined)
262
- writer.tag(6, WireType.LengthDelimited).string(message.description);
263
- /* optional string hint = 7; */
305
+ writer.tag(7, WireType.LengthDelimited).string(message.description);
306
+ /* optional string hint = 8; */
264
307
  if (message.hint !== undefined)
265
- writer.tag(7, WireType.LengthDelimited).string(message.hint);
266
- /* optional uint32 fine = 8; */
308
+ writer.tag(8, WireType.LengthDelimited).string(message.hint);
309
+ /* optional uint32 fine = 9; */
267
310
  if (message.fine !== undefined)
268
- writer.tag(8, WireType.Varint).uint32(message.fine);
269
- /* optional uint32 detention_time = 9; */
311
+ writer.tag(9, WireType.Varint).uint32(message.fine);
312
+ /* optional uint32 detention_time = 10; */
270
313
  if (message.detentionTime !== undefined)
271
- writer.tag(9, WireType.Varint).uint32(message.detentionTime);
272
- /* optional uint32 stvo_points = 10; */
314
+ writer.tag(10, WireType.Varint).uint32(message.detentionTime);
315
+ /* optional uint32 stvo_points = 11; */
273
316
  if (message.stvoPoints !== undefined)
274
- writer.tag(10, WireType.Varint).uint32(message.stvoPoints);
317
+ writer.tag(11, WireType.Varint).uint32(message.stvoPoints);
318
+ /* int32 sort_order = 12; */
319
+ if (message.sortOrder !== 0)
320
+ writer.tag(12, WireType.Varint).int32(message.sortOrder);
275
321
  let u = options.writeUnknownFields;
276
322
  if (u !== false)
277
323
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);