@fivenet-app/gen 2025.9.1 → 2026.4.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 (134) hide show
  1. package/README.md +1 -1
  2. package/clients.ts +36 -0
  3. package/codegen/perms/perms.ts +186 -15
  4. package/codegen/sanitizer/sanitizer.ts +34 -1
  5. package/package.json +2 -2
  6. package/perms.ts +140 -8
  7. package/resources/accounts/accounts.ts +98 -31
  8. package/resources/accounts/{oauth2.ts → oauth2/oauth2.ts} +20 -20
  9. package/resources/audit/audit.ts +156 -38
  10. package/resources/calendar/{access.ts → access/access.ts} +30 -30
  11. package/resources/calendar/calendar.ts +17 -477
  12. package/resources/calendar/entries/entries.ts +474 -0
  13. package/resources/centrum/{access.ts → access/access.ts} +22 -22
  14. package/resources/centrum/{dispatchers.ts → dispatchers/dispatchers.ts} +14 -14
  15. package/resources/centrum/{dispatches.ts → dispatches/dispatches.ts} +151 -185
  16. package/resources/centrum/joblist.ts +136 -0
  17. package/resources/centrum/{settings.ts → settings/settings.ts} +70 -70
  18. package/resources/centrum/{units_access.ts → units/access/access.ts} +30 -30
  19. package/resources/centrum/{units.ts → units/units.ts} +131 -51
  20. package/resources/citizens/labels/labels.ts +526 -0
  21. package/resources/{users → citizens/licenses}/licenses.ts +17 -17
  22. package/resources/clientconfig/clientconfig.ts +126 -258
  23. package/resources/collab/collab.ts +4 -16
  24. package/resources/common/content/content.ts +108 -85
  25. package/resources/common/content/diff_activity.ts +267 -0
  26. package/resources/common/i18n.ts +2 -2
  27. package/resources/{common/cron → cron}/cron.ts +43 -43
  28. package/resources/documents/{access.ts → access/access.ts} +29 -52
  29. package/resources/documents/{activity.ts → activity/activity.ts} +171 -123
  30. package/resources/documents/approval/approval.ts +945 -0
  31. package/resources/documents/{category.ts → category/category.ts} +7 -7
  32. package/resources/documents/{comment.ts → comment/comment.ts} +10 -10
  33. package/resources/documents/data/data.ts +303 -0
  34. package/resources/documents/documents.ts +282 -667
  35. package/resources/{common/uuid.ts → documents/forms/forms.ts} +20 -20
  36. package/resources/documents/{pins.ts → pins/pins.ts} +5 -5
  37. package/resources/documents/references/references.ts +187 -0
  38. package/resources/documents/relations/relations.ts +184 -0
  39. package/resources/documents/{requests.ts → requests/requests.ts} +18 -18
  40. package/resources/documents/stamps/stamp.ts +355 -0
  41. package/resources/documents/{templates.ts → templates/templates.ts} +426 -84
  42. package/resources/documents/{workflow.ts → workflow/workflow.ts} +264 -26
  43. package/resources/file/filestore.ts +1 -1
  44. package/resources/{common/grpcws → grpcws}/grpcws.ts +52 -52
  45. package/resources/jobs/{activity.ts → colleagues/activity/activity.ts} +54 -54
  46. package/resources/jobs/{colleagues.ts → colleagues/colleagues.ts} +17 -28
  47. package/resources/jobs/{conduct.ts → conduct/conduct.ts} +70 -45
  48. package/resources/jobs/{labels.ts → labels/labels.ts} +34 -23
  49. package/resources/jobs/{job_props.ts → props/props.ts} +26 -38
  50. package/resources/jobs/{job_settings.ts → settings/settings.ts} +53 -53
  51. package/resources/jobs/{timeclock.ts → timeclock/timeclock.ts} +17 -17
  52. package/resources/livemap/{heatmap.ts → heatmap/heatmap.ts} +4 -4
  53. package/resources/livemap/{marker_marker.ts → markers/marker_marker.ts} +35 -35
  54. package/resources/livemap/{user_marker.ts → markers/user_marker.ts} +115 -36
  55. package/resources/mailer/{access.ts → access/access.ts} +67 -67
  56. package/resources/mailer/{email.ts → emails/email.ts} +19 -19
  57. package/resources/mailer/{events.ts → events/events.ts} +24 -24
  58. package/resources/mailer/{message.ts → messages/message.ts} +29 -29
  59. package/resources/mailer/{settings.ts → settings/settings.ts} +14 -13
  60. package/resources/mailer/{template.ts → templates/template.ts} +15 -15
  61. package/resources/mailer/{thread.ts → threads/thread.ts} +29 -29
  62. package/resources/notifications/{client_view.ts → clientview/clientview.ts} +22 -22
  63. package/resources/notifications/{events.ts → events/events.ts} +20 -20
  64. package/resources/notifications/notifications.ts +4 -4
  65. package/resources/permissions/{attributes.ts → attributes/attributes.ts} +42 -42
  66. package/resources/permissions/{events.ts → events/events.ts} +7 -7
  67. package/resources/permissions/{permissions.ts → permissions/permissions.ts} +30 -19
  68. package/resources/qualifications/{access.ts → access/access.ts} +19 -19
  69. package/resources/qualifications/{exam.ts → exam/exam.ts} +269 -141
  70. package/resources/qualifications/qualifications.ts +51 -179
  71. package/resources/settings/banner.ts +3 -3
  72. package/resources/settings/config.ts +527 -25
  73. package/resources/{documents/state.ts → settings/data.ts} +41 -20
  74. package/resources/settings/perms.ts +14 -14
  75. package/resources/stats/stats.ts +379 -0
  76. package/resources/sync/{activity.ts → activity/activity.ts} +104 -25
  77. package/resources/sync/{data.ts → data/data.ts} +405 -59
  78. package/resources/userinfo/{user_info.ts → userinfo.ts} +71 -93
  79. package/resources/users/{activity.ts → activity/activity.ts} +242 -101
  80. package/resources/users/{props.ts → props/props.ts} +91 -69
  81. package/resources/users/short/user.ts +184 -0
  82. package/resources/users/{users.ts → user.ts} +266 -195
  83. package/resources/vehicles/{activity.ts → activity/activity.ts} +20 -20
  84. package/resources/vehicles/{props.ts → props/props.ts} +28 -6
  85. package/resources/vehicles/vehicles.ts +20 -8
  86. package/resources/wiki/{access.ts → access/access.ts} +30 -30
  87. package/resources/wiki/{activity.ts → activity/activity.ts} +104 -70
  88. package/resources/wiki/page.ts +39 -15
  89. package/services/auth/auth.client.ts +23 -10
  90. package/services/auth/auth.ts +445 -262
  91. package/services/calendar/calendar.ts +56 -34
  92. package/services/centrum/centrum.ts +127 -127
  93. package/services/citizens/citizens.client.ts +0 -13
  94. package/services/citizens/citizens.ts +44 -134
  95. package/services/citizens/labels.client.ts +77 -0
  96. package/services/citizens/labels.ts +455 -0
  97. package/services/completor/completor.ts +36 -16
  98. package/services/documents/approval.client.ts +188 -0
  99. package/services/documents/approval.ts +1776 -0
  100. package/services/documents/documents.ts +164 -186
  101. package/services/documents/forms.client.ts +51 -0
  102. package/services/documents/forms.ts +232 -0
  103. package/services/documents/stamps.client.ts +77 -0
  104. package/services/documents/stamps.ts +481 -0
  105. package/services/documents/stats.client.ts +38 -0
  106. package/services/documents/stats.ts +245 -0
  107. package/services/jobs/conduct.client.ts +30 -3
  108. package/services/jobs/conduct.ts +159 -33
  109. package/services/jobs/jobs.ts +43 -43
  110. package/services/jobs/stats.client.ts +38 -0
  111. package/services/jobs/stats.ts +207 -0
  112. package/services/jobs/timeclock.ts +39 -39
  113. package/services/livemap/livemap.ts +18 -18
  114. package/services/mailer/mailer.ts +78 -78
  115. package/services/notifications/notifications.ts +35 -35
  116. package/services/qualifications/qualifications.ts +81 -46
  117. package/services/settings/accounts.client.ts +23 -10
  118. package/services/settings/accounts.ts +191 -30
  119. package/services/settings/cron.client.ts +13 -0
  120. package/services/settings/cron.ts +118 -5
  121. package/services/settings/laws.ts +1 -1
  122. package/services/settings/settings.ts +73 -52
  123. package/services/settings/system.client.ts +13 -0
  124. package/services/settings/system.ts +115 -15
  125. package/services/stats/stats.client.ts +7 -7
  126. package/services/stats/stats.ts +24 -24
  127. package/services/sync/sync.client.ts +271 -37
  128. package/services/sync/sync.ts +1525 -421
  129. package/services/vehicles/vehicles.ts +8 -8
  130. package/services/wiki/wiki.ts +8 -8
  131. package/svcs.ts +100 -6
  132. package/resources/centrum/attributes.ts +0 -183
  133. package/resources/documents/signoff.ts +0 -55
  134. package/resources/users/labels.ts +0 -160
@@ -11,13 +11,15 @@ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
11
  import type { PartialMessage } from "@protobuf-ts/runtime";
12
12
  import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
13
  import { MessageType } from "@protobuf-ts/runtime";
14
- import { Workflow } from "./workflow";
15
14
  import { File } from "../file/file";
16
- import { DocumentPin } from "./pins";
17
- import { UserShort } from "../users/users";
15
+ import { WorkflowUserState } from "./workflow/workflow";
16
+ import { WorkflowState } from "./workflow/workflow";
17
+ import { DocumentPin } from "./pins/pins";
18
+ import { UserShort } from "../users/short/user";
19
+ import { DocumentData } from "./data/data";
18
20
  import { Content } from "../common/content/content";
19
21
  import { ContentType } from "../common/content/content";
20
- import { Category } from "./category";
22
+ import { Category } from "./category/category";
21
23
  import { Timestamp } from "../timestamp/timestamp";
22
24
  /**
23
25
  * @generated from protobuf message resources.documents.Document
@@ -44,13 +46,25 @@ export interface Document {
44
46
  */
45
47
  categoryId?: number;
46
48
  /**
47
- * @generated from protobuf field: optional resources.documents.Category category = 6
49
+ * @generated from protobuf field: optional resources.documents.category.Category category = 6
48
50
  */
49
51
  category?: Category;
50
52
  /**
51
53
  * @generated from protobuf field: string title = 7
52
54
  */
53
55
  title: string;
56
+ /**
57
+ * Derived field (server authored)
58
+ *
59
+ * @generated from protobuf field: optional uint32 word_count = 21
60
+ */
61
+ wordCount?: number;
62
+ /**
63
+ * Derived field (server authored)
64
+ *
65
+ * @generated from protobuf field: optional string first_heading = 22
66
+ */
67
+ firstHeading?: string;
54
68
  /**
55
69
  * @generated from protobuf field: resources.common.content.ContentType content_type = 8
56
70
  */
@@ -60,15 +74,15 @@ export interface Document {
60
74
  */
61
75
  content?: Content;
62
76
  /**
63
- * @generated from protobuf field: optional string data = 10
77
+ * @generated from protobuf field: optional resources.documents.data.DocumentData data = 10
64
78
  */
65
- data?: string;
79
+ data?: DocumentData;
66
80
  /**
67
81
  * @generated from protobuf field: optional int32 creator_id = 11
68
82
  */
69
83
  creatorId?: number;
70
84
  /**
71
- * @generated from protobuf field: optional resources.users.UserShort creator = 12
85
+ * @generated from protobuf field: optional resources.users.short.UserShort creator = 12
72
86
  */
73
87
  creator?: UserShort;
74
88
  /**
@@ -80,39 +94,27 @@ export interface Document {
80
94
  */
81
95
  creatorJobLabel?: string;
82
96
  /**
83
- * @generated from protobuf field: string state = 15
84
- */
85
- state: string;
86
- /**
87
- * @generated from protobuf field: bool closed = 16
97
+ * @generated from protobuf field: resources.documents.DocumentMeta meta = 15
88
98
  */
89
- closed: boolean;
99
+ meta?: DocumentMeta;
90
100
  /**
91
- * @generated from protobuf field: bool draft = 17
92
- */
93
- draft: boolean;
94
- /**
95
- * @generated from protobuf field: bool public = 18
96
- */
97
- public: boolean;
98
- /**
99
- * @generated from protobuf field: optional int64 template_id = 19
101
+ * @generated from protobuf field: optional int64 template_id = 16
100
102
  */
101
103
  templateId?: number;
102
104
  /**
103
- * @generated from protobuf field: optional resources.documents.DocumentPin pin = 20
105
+ * @generated from protobuf field: optional resources.documents.pins.DocumentPin pin = 17
104
106
  */
105
107
  pin?: DocumentPin;
106
108
  /**
107
- * @generated from protobuf field: optional resources.documents.WorkflowState workflow_state = 21
109
+ * @generated from protobuf field: optional resources.documents.workflow.WorkflowState workflow_state = 18
108
110
  */
109
111
  workflowState?: WorkflowState;
110
112
  /**
111
- * @generated from protobuf field: optional resources.documents.WorkflowUserState workflow_user = 22
113
+ * @generated from protobuf field: optional resources.documents.workflow.WorkflowUserState workflow_user = 19
112
114
  */
113
115
  workflowUser?: WorkflowUserState;
114
116
  /**
115
- * @generated from protobuf field: repeated resources.file.File files = 23
117
+ * @generated from protobuf field: repeated resources.file.File files = 20
116
118
  */
117
119
  files: File[];
118
120
  }
@@ -141,13 +143,25 @@ export interface DocumentShort {
141
143
  */
142
144
  categoryId?: number;
143
145
  /**
144
- * @generated from protobuf field: optional resources.documents.Category category = 6
146
+ * @generated from protobuf field: optional resources.documents.category.Category category = 6
145
147
  */
146
148
  category?: Category;
147
149
  /**
148
150
  * @generated from protobuf field: string title = 7
149
151
  */
150
152
  title: string;
153
+ /**
154
+ * Derived field (server authored)
155
+ *
156
+ * @generated from protobuf field: optional uint32 word_count = 21
157
+ */
158
+ wordCount?: number;
159
+ /**
160
+ * Derived field (server authored)
161
+ *
162
+ * @generated from protobuf field: optional string first_heading = 22
163
+ */
164
+ firstHeading?: string;
151
165
  /**
152
166
  * @generated from protobuf field: resources.common.content.ContentType content_type = 8
153
167
  */
@@ -161,7 +175,7 @@ export interface DocumentShort {
161
175
  */
162
176
  creatorId?: number;
163
177
  /**
164
- * @generated from protobuf field: optional resources.users.UserShort creator = 12
178
+ * @generated from protobuf field: optional resources.users.short.UserShort creator = 12
165
179
  */
166
180
  creator?: UserShort;
167
181
  /**
@@ -173,231 +187,105 @@ export interface DocumentShort {
173
187
  */
174
188
  creatorJobLabel?: string;
175
189
  /**
176
- * @generated from protobuf field: string state = 15
190
+ * @generated from protobuf field: resources.documents.DocumentMeta meta = 15
177
191
  */
178
- state: string;
192
+ meta?: DocumentMeta;
179
193
  /**
180
- * @generated from protobuf field: bool closed = 16
181
- */
182
- closed: boolean;
183
- /**
184
- * @generated from protobuf field: bool draft = 17
185
- */
186
- draft: boolean;
187
- /**
188
- * @generated from protobuf field: bool public = 18
189
- */
190
- public: boolean;
191
- /**
192
- * @generated from protobuf field: optional resources.documents.DocumentPin pin = 20
194
+ * @generated from protobuf field: optional resources.documents.pins.DocumentPin pin = 17
193
195
  */
194
196
  pin?: DocumentPin;
195
197
  /**
196
- * @generated from protobuf field: optional resources.documents.WorkflowState workflow_state = 21
198
+ * @generated from protobuf field: optional resources.documents.workflow.WorkflowState workflow_state = 18
197
199
  */
198
200
  workflowState?: WorkflowState;
199
201
  /**
200
- * @generated from protobuf field: optional resources.documents.WorkflowUserState workflow_user = 22
202
+ * @generated from protobuf field: optional resources.documents.workflow.WorkflowUserState workflow_user = 19
201
203
  */
202
204
  workflowUser?: WorkflowUserState;
203
205
  }
204
206
  /**
205
- * @generated from protobuf message resources.documents.DocumentReference
206
- */
207
- export interface DocumentReference {
208
- /**
209
- * @generated from protobuf field: optional int64 id = 1
210
- */
211
- id?: number;
212
- /**
213
- * @generated from protobuf field: optional resources.timestamp.Timestamp created_at = 2
214
- */
215
- createdAt?: Timestamp;
216
- /**
217
- * @generated from protobuf field: int64 source_document_id = 3
218
- */
219
- sourceDocumentId: number;
220
- /**
221
- * @generated from protobuf field: optional resources.documents.DocumentShort source_document = 4
222
- */
223
- sourceDocument?: DocumentShort;
224
- /**
225
- * @generated from protobuf field: resources.documents.DocReference reference = 5
226
- */
227
- reference: DocReference;
228
- /**
229
- * @generated from protobuf field: int64 target_document_id = 6
230
- */
231
- targetDocumentId: number;
232
- /**
233
- * @generated from protobuf field: optional resources.documents.DocumentShort target_document = 7
234
- */
235
- targetDocument?: DocumentShort;
236
- /**
237
- * @generated from protobuf field: optional int32 creator_id = 8
238
- */
239
- creatorId?: number;
240
- /**
241
- * @generated from protobuf field: optional resources.users.UserShort creator = 9
242
- */
243
- creator?: UserShort;
244
- }
245
- /**
246
- * @generated from protobuf message resources.documents.DocumentRelation
247
- */
248
- export interface DocumentRelation {
249
- /**
250
- * @generated from protobuf field: optional int64 id = 1
251
- */
252
- id?: number;
253
- /**
254
- * @generated from protobuf field: optional resources.timestamp.Timestamp created_at = 2
255
- */
256
- createdAt?: Timestamp;
257
- /**
258
- * @generated from protobuf field: int64 document_id = 3
259
- */
260
- documentId: number;
261
- /**
262
- * @generated from protobuf field: optional resources.documents.DocumentShort document = 4
263
- */
264
- document?: DocumentShort;
265
- /**
266
- * @generated from protobuf field: int32 source_user_id = 5
267
- */
268
- sourceUserId: number;
269
- /**
270
- * @generated from protobuf field: optional resources.users.UserShort source_user = 6
271
- */
272
- sourceUser?: UserShort;
273
- /**
274
- * @generated from protobuf field: resources.documents.DocRelation relation = 7
275
- */
276
- relation: DocRelation;
277
- /**
278
- * @generated from protobuf field: int32 target_user_id = 8
279
- */
280
- targetUserId: number;
281
- /**
282
- * @generated from protobuf field: optional resources.users.UserShort target_user = 9
283
- */
284
- targetUser?: UserShort;
285
- }
286
- /**
287
- * @generated from protobuf message resources.documents.WorkflowState
207
+ * @generated from protobuf message resources.documents.DocumentMeta
288
208
  */
289
- export interface WorkflowState {
209
+ export interface DocumentMeta {
290
210
  /**
291
211
  * @generated from protobuf field: int64 document_id = 1
292
212
  */
293
213
  documentId: number;
294
214
  /**
295
- * @generated from protobuf field: optional resources.timestamp.Timestamp next_reminder_time = 2
296
- */
297
- nextReminderTime?: Timestamp;
298
- /**
299
- * @generated from protobuf field: optional int32 next_reminder_count = 3
300
- */
301
- nextReminderCount?: number;
302
- /**
303
- * @generated from protobuf field: int32 reminder_count = 5
304
- */
305
- reminderCount: number;
306
- /**
307
- * @generated from protobuf field: optional resources.timestamp.Timestamp auto_close_time = 4
308
- */
309
- autoCloseTime?: Timestamp;
310
- /**
311
- * @generated from protobuf field: optional resources.documents.Workflow workflow = 6
215
+ * @generated from protobuf field: optional resources.timestamp.Timestamp recomputed_at = 2
312
216
  */
313
- workflow?: Workflow;
314
- /**
315
- * @generated from protobuf field: optional resources.documents.DocumentShort document = 7
316
- */
317
- document?: DocumentShort;
318
- }
319
- /**
320
- * @generated from protobuf message resources.documents.WorkflowUserState
321
- */
322
- export interface WorkflowUserState {
323
- /**
324
- * @generated from protobuf field: int64 document_id = 1
325
- */
326
- documentId: number;
217
+ recomputedAt?: Timestamp;
327
218
  /**
328
- * @generated from protobuf field: int32 user_id = 2
219
+ * @generated from protobuf field: bool closed = 3
329
220
  */
330
- userId: number;
331
- /**
332
- * @generated from protobuf field: optional resources.timestamp.Timestamp manual_reminder_time = 3
333
- */
334
- manualReminderTime?: Timestamp;
335
- /**
336
- * @generated from protobuf field: optional string manual_reminder_message = 4
337
- */
338
- manualReminderMessage?: string;
339
- /**
340
- * @generated from protobuf field: int32 reminder_count = 5
341
- */
342
- reminderCount: number;
221
+ closed: boolean;
343
222
  /**
344
- * @generated from protobuf field: int32 max_reminder_count = 6
223
+ * @generated from protobuf field: bool draft = 4
345
224
  */
346
- maxReminderCount: number;
225
+ draft: boolean;
347
226
  /**
348
- * @generated from protobuf field: optional resources.documents.Workflow workflow = 7
227
+ * @generated from protobuf field: bool public = 5
349
228
  */
350
- workflow?: Workflow;
229
+ public: boolean;
351
230
  /**
352
- * @generated from protobuf field: optional resources.documents.DocumentShort document = 8
231
+ * @generated from protobuf field: string state = 6
353
232
  */
354
- document?: DocumentShort;
355
- }
356
- /**
357
- * @generated from protobuf enum resources.documents.DocReference
358
- */
359
- export enum DocReference {
233
+ state: string;
360
234
  /**
361
- * @generated from protobuf enum value: DOC_REFERENCE_UNSPECIFIED = 0;
235
+ * Overall aggregates - At least one approval policy fully satisfied
236
+ *
237
+ * @generated from protobuf field: optional bool approved = 7
362
238
  */
363
- UNSPECIFIED = 0,
239
+ approved?: boolean;
364
240
  /**
365
- * @generated from protobuf enum value: DOC_REFERENCE_LINKED = 1;
241
+ * Approval rollups
242
+ * Total approvals needed across policies
243
+ *
244
+ * @generated from protobuf field: optional int32 ap_required_total = 16
366
245
  */
367
- LINKED = 1,
246
+ apRequiredTotal?: number;
368
247
  /**
369
- * @generated from protobuf enum value: DOC_REFERENCE_SOLVES = 2;
248
+ * Approvals collected
249
+ *
250
+ * @generated from protobuf field: optional int32 ap_collected_approved = 17
370
251
  */
371
- SOLVES = 2,
252
+ apCollectedApproved?: number;
372
253
  /**
373
- * @generated from protobuf enum value: DOC_REFERENCE_CLOSES = 3;
254
+ * How many left to satisfy
255
+ *
256
+ * @generated from protobuf field: optional int32 ap_required_remaining = 18
374
257
  */
375
- CLOSES = 3,
258
+ apRequiredRemaining?: number;
376
259
  /**
377
- * @generated from protobuf enum value: DOC_REFERENCE_DEPRECATES = 4;
260
+ * Number of declines
261
+ *
262
+ * @generated from protobuf field: optional int32 ap_declined_count = 19
378
263
  */
379
- DEPRECATES = 4
380
- }
381
- /**
382
- * @generated from protobuf enum resources.documents.DocRelation
383
- */
384
- export enum DocRelation {
264
+ apDeclinedCount?: number;
385
265
  /**
386
- * @generated from protobuf enum value: DOC_RELATION_UNSPECIFIED = 0;
266
+ * Tasks still pending (optional)
267
+ *
268
+ * @generated from protobuf field: optional int32 ap_pending_count = 20
387
269
  */
388
- UNSPECIFIED = 0,
270
+ apPendingCount?: number;
389
271
  /**
390
- * @generated from protobuf enum value: DOC_RELATION_MENTIONED = 1;
272
+ * Quick flag if any declines
273
+ *
274
+ * @generated from protobuf field: optional bool ap_any_declined = 21
391
275
  */
392
- MENTIONED = 1,
276
+ apAnyDeclined?: boolean;
393
277
  /**
394
- * @generated from protobuf enum value: DOC_RELATION_TARGETS = 2;
278
+ * Number of active approval policies
279
+ *
280
+ * @generated from protobuf field: optional int32 ap_policies_active = 22
395
281
  */
396
- TARGETS = 2,
282
+ apPoliciesActive?: number;
397
283
  /**
398
- * @generated from protobuf enum value: DOC_RELATION_CAUSED = 3;
284
+ * Number of comments on the document
285
+ *
286
+ * @generated from protobuf field: optional int32 comment_count = 23
399
287
  */
400
- CAUSED = 3
288
+ commentCount?: number;
401
289
  }
402
290
  // @generated message type with reflection information, may provide speed optimized methods
403
291
  class Document$Type extends MessageType<Document> {
@@ -409,23 +297,22 @@ class Document$Type extends MessageType<Document> {
409
297
  { no: 4, name: "deleted_at", kind: "message", T: () => Timestamp },
410
298
  { no: 5, name: "category_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
411
299
  { no: 6, name: "category", kind: "message", T: () => Category, options: { "tagger.tags": "alias:\"category\"" } },
412
- { no: 7, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "512" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
300
+ { no: 7, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "512" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
301
+ { no: 21, name: "word_count", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
302
+ { no: 22, name: "first_heading", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
413
303
  { no: 8, name: "content_type", kind: "enum", T: () => ["resources.common.content.ContentType", ContentType, "CONTENT_TYPE_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } },
414
- { no: 9, name: "content", kind: "message", T: () => Content },
415
- { no: 10, name: "data", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxBytes: "1000000" } }, "codegen.sanitizer.sanitizer": { enabled: true }, "tagger.tags": "alias:\"data\"" } },
304
+ { no: 9, name: "content", kind: "message", T: () => Content, options: { "tagger.tags": "alias:\"content_json\"" } },
305
+ { no: 10, name: "data", kind: "message", T: () => DocumentData, options: { "tagger.tags": "alias:\"data\"" } },
416
306
  { no: 11, name: "creator_id", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gt: 0 } } } },
417
307
  { no: 12, name: "creator", kind: "message", T: () => UserShort, options: { "tagger.tags": "alias:\"creator\"" } },
418
308
  { no: 13, name: "creator_job", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "20" } } } },
419
309
  { no: 14, name: "creator_job_label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } },
420
- { no: 15, name: "state", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "32" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
421
- { no: 16, name: "closed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
422
- { no: 17, name: "draft", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
423
- { no: 18, name: "public", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
424
- { no: 19, name: "template_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
425
- { no: 20, name: "pin", kind: "message", T: () => DocumentPin, options: { "tagger.tags": "alias:\"pin\"" } },
426
- { no: 21, name: "workflow_state", kind: "message", T: () => WorkflowState },
427
- { no: 22, name: "workflow_user", kind: "message", T: () => WorkflowUserState },
428
- { no: 23, name: "files", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => File, options: { "tagger.tags": "alias:\"files\"" } }
310
+ { no: 15, name: "meta", kind: "message", T: () => DocumentMeta, options: { "tagger.tags": "alias:\"meta\"" } },
311
+ { no: 16, name: "template_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
312
+ { no: 17, name: "pin", kind: "message", T: () => DocumentPin, options: { "tagger.tags": "alias:\"pin\"" } },
313
+ { no: 18, name: "workflow_state", kind: "message", T: () => WorkflowState },
314
+ { no: 19, name: "workflow_user", kind: "message", T: () => WorkflowUserState },
315
+ { no: 20, name: "files", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => File, options: { "tagger.tags": "alias:\"files\"" } }
429
316
  ]);
430
317
  }
431
318
  create(value?: PartialMessage<Document>): Document {
@@ -434,10 +321,6 @@ class Document$Type extends MessageType<Document> {
434
321
  message.title = "";
435
322
  message.contentType = 0;
436
323
  message.creatorJob = "";
437
- message.state = "";
438
- message.closed = false;
439
- message.draft = false;
440
- message.public = false;
441
324
  message.files = [];
442
325
  if (value !== undefined)
443
326
  reflectionMergePartial<Document>(this, message, value);
@@ -463,25 +346,31 @@ class Document$Type extends MessageType<Document> {
463
346
  case /* optional int64 category_id */ 5:
464
347
  message.categoryId = reader.int64().toNumber();
465
348
  break;
466
- case /* optional resources.documents.Category category */ 6:
349
+ case /* optional resources.documents.category.Category category */ 6:
467
350
  message.category = Category.internalBinaryRead(reader, reader.uint32(), options, message.category);
468
351
  break;
469
352
  case /* string title */ 7:
470
353
  message.title = reader.string();
471
354
  break;
355
+ case /* optional uint32 word_count */ 21:
356
+ message.wordCount = reader.uint32();
357
+ break;
358
+ case /* optional string first_heading */ 22:
359
+ message.firstHeading = reader.string();
360
+ break;
472
361
  case /* resources.common.content.ContentType content_type */ 8:
473
362
  message.contentType = reader.int32();
474
363
  break;
475
364
  case /* resources.common.content.Content content */ 9:
476
365
  message.content = Content.internalBinaryRead(reader, reader.uint32(), options, message.content);
477
366
  break;
478
- case /* optional string data */ 10:
479
- message.data = reader.string();
367
+ case /* optional resources.documents.data.DocumentData data */ 10:
368
+ message.data = DocumentData.internalBinaryRead(reader, reader.uint32(), options, message.data);
480
369
  break;
481
370
  case /* optional int32 creator_id */ 11:
482
371
  message.creatorId = reader.int32();
483
372
  break;
484
- case /* optional resources.users.UserShort creator */ 12:
373
+ case /* optional resources.users.short.UserShort creator */ 12:
485
374
  message.creator = UserShort.internalBinaryRead(reader, reader.uint32(), options, message.creator);
486
375
  break;
487
376
  case /* string creator_job */ 13:
@@ -490,31 +379,22 @@ class Document$Type extends MessageType<Document> {
490
379
  case /* optional string creator_job_label */ 14:
491
380
  message.creatorJobLabel = reader.string();
492
381
  break;
493
- case /* string state */ 15:
494
- message.state = reader.string();
495
- break;
496
- case /* bool closed */ 16:
497
- message.closed = reader.bool();
498
- break;
499
- case /* bool draft */ 17:
500
- message.draft = reader.bool();
501
- break;
502
- case /* bool public */ 18:
503
- message.public = reader.bool();
382
+ case /* resources.documents.DocumentMeta meta */ 15:
383
+ message.meta = DocumentMeta.internalBinaryRead(reader, reader.uint32(), options, message.meta);
504
384
  break;
505
- case /* optional int64 template_id */ 19:
385
+ case /* optional int64 template_id */ 16:
506
386
  message.templateId = reader.int64().toNumber();
507
387
  break;
508
- case /* optional resources.documents.DocumentPin pin */ 20:
388
+ case /* optional resources.documents.pins.DocumentPin pin */ 17:
509
389
  message.pin = DocumentPin.internalBinaryRead(reader, reader.uint32(), options, message.pin);
510
390
  break;
511
- case /* optional resources.documents.WorkflowState workflow_state */ 21:
391
+ case /* optional resources.documents.workflow.WorkflowState workflow_state */ 18:
512
392
  message.workflowState = WorkflowState.internalBinaryRead(reader, reader.uint32(), options, message.workflowState);
513
393
  break;
514
- case /* optional resources.documents.WorkflowUserState workflow_user */ 22:
394
+ case /* optional resources.documents.workflow.WorkflowUserState workflow_user */ 19:
515
395
  message.workflowUser = WorkflowUserState.internalBinaryRead(reader, reader.uint32(), options, message.workflowUser);
516
396
  break;
517
- case /* repeated resources.file.File files */ 23:
397
+ case /* repeated resources.file.File files */ 20:
518
398
  message.files.push(File.internalBinaryRead(reader, reader.uint32(), options));
519
399
  break;
520
400
  default:
@@ -544,7 +424,7 @@ class Document$Type extends MessageType<Document> {
544
424
  /* optional int64 category_id = 5; */
545
425
  if (message.categoryId !== undefined)
546
426
  writer.tag(5, WireType.Varint).int64(message.categoryId);
547
- /* optional resources.documents.Category category = 6; */
427
+ /* optional resources.documents.category.Category category = 6; */
548
428
  if (message.category)
549
429
  Category.internalBinaryWrite(message.category, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
550
430
  /* string title = 7; */
@@ -556,13 +436,13 @@ class Document$Type extends MessageType<Document> {
556
436
  /* resources.common.content.Content content = 9; */
557
437
  if (message.content)
558
438
  Content.internalBinaryWrite(message.content, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
559
- /* optional string data = 10; */
560
- if (message.data !== undefined)
561
- writer.tag(10, WireType.LengthDelimited).string(message.data);
439
+ /* optional resources.documents.data.DocumentData data = 10; */
440
+ if (message.data)
441
+ DocumentData.internalBinaryWrite(message.data, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
562
442
  /* optional int32 creator_id = 11; */
563
443
  if (message.creatorId !== undefined)
564
444
  writer.tag(11, WireType.Varint).int32(message.creatorId);
565
- /* optional resources.users.UserShort creator = 12; */
445
+ /* optional resources.users.short.UserShort creator = 12; */
566
446
  if (message.creator)
567
447
  UserShort.internalBinaryWrite(message.creator, writer.tag(12, WireType.LengthDelimited).fork(), options).join();
568
448
  /* string creator_job = 13; */
@@ -571,33 +451,30 @@ class Document$Type extends MessageType<Document> {
571
451
  /* optional string creator_job_label = 14; */
572
452
  if (message.creatorJobLabel !== undefined)
573
453
  writer.tag(14, WireType.LengthDelimited).string(message.creatorJobLabel);
574
- /* string state = 15; */
575
- if (message.state !== "")
576
- writer.tag(15, WireType.LengthDelimited).string(message.state);
577
- /* bool closed = 16; */
578
- if (message.closed !== false)
579
- writer.tag(16, WireType.Varint).bool(message.closed);
580
- /* bool draft = 17; */
581
- if (message.draft !== false)
582
- writer.tag(17, WireType.Varint).bool(message.draft);
583
- /* bool public = 18; */
584
- if (message.public !== false)
585
- writer.tag(18, WireType.Varint).bool(message.public);
586
- /* optional int64 template_id = 19; */
454
+ /* resources.documents.DocumentMeta meta = 15; */
455
+ if (message.meta)
456
+ DocumentMeta.internalBinaryWrite(message.meta, writer.tag(15, WireType.LengthDelimited).fork(), options).join();
457
+ /* optional int64 template_id = 16; */
587
458
  if (message.templateId !== undefined)
588
- writer.tag(19, WireType.Varint).int64(message.templateId);
589
- /* optional resources.documents.DocumentPin pin = 20; */
459
+ writer.tag(16, WireType.Varint).int64(message.templateId);
460
+ /* optional resources.documents.pins.DocumentPin pin = 17; */
590
461
  if (message.pin)
591
- DocumentPin.internalBinaryWrite(message.pin, writer.tag(20, WireType.LengthDelimited).fork(), options).join();
592
- /* optional resources.documents.WorkflowState workflow_state = 21; */
462
+ DocumentPin.internalBinaryWrite(message.pin, writer.tag(17, WireType.LengthDelimited).fork(), options).join();
463
+ /* optional resources.documents.workflow.WorkflowState workflow_state = 18; */
593
464
  if (message.workflowState)
594
- WorkflowState.internalBinaryWrite(message.workflowState, writer.tag(21, WireType.LengthDelimited).fork(), options).join();
595
- /* optional resources.documents.WorkflowUserState workflow_user = 22; */
465
+ WorkflowState.internalBinaryWrite(message.workflowState, writer.tag(18, WireType.LengthDelimited).fork(), options).join();
466
+ /* optional resources.documents.workflow.WorkflowUserState workflow_user = 19; */
596
467
  if (message.workflowUser)
597
- WorkflowUserState.internalBinaryWrite(message.workflowUser, writer.tag(22, WireType.LengthDelimited).fork(), options).join();
598
- /* repeated resources.file.File files = 23; */
468
+ WorkflowUserState.internalBinaryWrite(message.workflowUser, writer.tag(19, WireType.LengthDelimited).fork(), options).join();
469
+ /* repeated resources.file.File files = 20; */
599
470
  for (let i = 0; i < message.files.length; i++)
600
- File.internalBinaryWrite(message.files[i], writer.tag(23, WireType.LengthDelimited).fork(), options).join();
471
+ File.internalBinaryWrite(message.files[i], writer.tag(20, WireType.LengthDelimited).fork(), options).join();
472
+ /* optional uint32 word_count = 21; */
473
+ if (message.wordCount !== undefined)
474
+ writer.tag(21, WireType.Varint).uint32(message.wordCount);
475
+ /* optional string first_heading = 22; */
476
+ if (message.firstHeading !== undefined)
477
+ writer.tag(22, WireType.LengthDelimited).string(message.firstHeading);
601
478
  let u = options.writeUnknownFields;
602
479
  if (u !== false)
603
480
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -618,20 +495,19 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
618
495
  { no: 4, name: "deleted_at", kind: "message", T: () => Timestamp },
619
496
  { no: 5, name: "category_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
620
497
  { no: 6, name: "category", kind: "message", T: () => Category, options: { "tagger.tags": "alias:\"category\"" } },
621
- { no: 7, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "512" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
498
+ { no: 7, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "512" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
499
+ { no: 21, name: "word_count", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
500
+ { no: 22, name: "first_heading", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
622
501
  { no: 8, name: "content_type", kind: "enum", T: () => ["resources.common.content.ContentType", ContentType, "CONTENT_TYPE_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } },
623
502
  { no: 9, name: "content", kind: "message", T: () => Content },
624
503
  { no: 11, name: "creator_id", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gt: 0 } } } },
625
504
  { no: 12, name: "creator", kind: "message", T: () => UserShort, options: { "tagger.tags": "alias:\"creator\"" } },
626
505
  { no: 13, name: "creator_job", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "20" } } } },
627
506
  { no: 14, name: "creator_job_label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } },
628
- { no: 15, name: "state", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "32" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
629
- { no: 16, name: "closed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
630
- { no: 17, name: "draft", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
631
- { no: 18, name: "public", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
632
- { no: 20, name: "pin", kind: "message", T: () => DocumentPin, options: { "tagger.tags": "alias:\"pin\"" } },
633
- { no: 21, name: "workflow_state", kind: "message", T: () => WorkflowState },
634
- { no: 22, name: "workflow_user", kind: "message", T: () => WorkflowUserState }
507
+ { no: 15, name: "meta", kind: "message", T: () => DocumentMeta, options: { "tagger.tags": "alias:\"meta\"" } },
508
+ { no: 17, name: "pin", kind: "message", T: () => DocumentPin, options: { "tagger.tags": "alias:\"pin\"" } },
509
+ { no: 18, name: "workflow_state", kind: "message", T: () => WorkflowState },
510
+ { no: 19, name: "workflow_user", kind: "message", T: () => WorkflowUserState }
635
511
  ]);
636
512
  }
637
513
  create(value?: PartialMessage<DocumentShort>): DocumentShort {
@@ -640,10 +516,6 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
640
516
  message.title = "";
641
517
  message.contentType = 0;
642
518
  message.creatorJob = "";
643
- message.state = "";
644
- message.closed = false;
645
- message.draft = false;
646
- message.public = false;
647
519
  if (value !== undefined)
648
520
  reflectionMergePartial<DocumentShort>(this, message, value);
649
521
  return message;
@@ -668,12 +540,18 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
668
540
  case /* optional int64 category_id */ 5:
669
541
  message.categoryId = reader.int64().toNumber();
670
542
  break;
671
- case /* optional resources.documents.Category category */ 6:
543
+ case /* optional resources.documents.category.Category category */ 6:
672
544
  message.category = Category.internalBinaryRead(reader, reader.uint32(), options, message.category);
673
545
  break;
674
546
  case /* string title */ 7:
675
547
  message.title = reader.string();
676
548
  break;
549
+ case /* optional uint32 word_count */ 21:
550
+ message.wordCount = reader.uint32();
551
+ break;
552
+ case /* optional string first_heading */ 22:
553
+ message.firstHeading = reader.string();
554
+ break;
677
555
  case /* resources.common.content.ContentType content_type */ 8:
678
556
  message.contentType = reader.int32();
679
557
  break;
@@ -683,7 +561,7 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
683
561
  case /* optional int32 creator_id */ 11:
684
562
  message.creatorId = reader.int32();
685
563
  break;
686
- case /* optional resources.users.UserShort creator */ 12:
564
+ case /* optional resources.users.short.UserShort creator */ 12:
687
565
  message.creator = UserShort.internalBinaryRead(reader, reader.uint32(), options, message.creator);
688
566
  break;
689
567
  case /* string creator_job */ 13:
@@ -692,25 +570,16 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
692
570
  case /* optional string creator_job_label */ 14:
693
571
  message.creatorJobLabel = reader.string();
694
572
  break;
695
- case /* string state */ 15:
696
- message.state = reader.string();
697
- break;
698
- case /* bool closed */ 16:
699
- message.closed = reader.bool();
700
- break;
701
- case /* bool draft */ 17:
702
- message.draft = reader.bool();
703
- break;
704
- case /* bool public */ 18:
705
- message.public = reader.bool();
573
+ case /* resources.documents.DocumentMeta meta */ 15:
574
+ message.meta = DocumentMeta.internalBinaryRead(reader, reader.uint32(), options, message.meta);
706
575
  break;
707
- case /* optional resources.documents.DocumentPin pin */ 20:
576
+ case /* optional resources.documents.pins.DocumentPin pin */ 17:
708
577
  message.pin = DocumentPin.internalBinaryRead(reader, reader.uint32(), options, message.pin);
709
578
  break;
710
- case /* optional resources.documents.WorkflowState workflow_state */ 21:
579
+ case /* optional resources.documents.workflow.WorkflowState workflow_state */ 18:
711
580
  message.workflowState = WorkflowState.internalBinaryRead(reader, reader.uint32(), options, message.workflowState);
712
581
  break;
713
- case /* optional resources.documents.WorkflowUserState workflow_user */ 22:
582
+ case /* optional resources.documents.workflow.WorkflowUserState workflow_user */ 19:
714
583
  message.workflowUser = WorkflowUserState.internalBinaryRead(reader, reader.uint32(), options, message.workflowUser);
715
584
  break;
716
585
  default:
@@ -740,7 +609,7 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
740
609
  /* optional int64 category_id = 5; */
741
610
  if (message.categoryId !== undefined)
742
611
  writer.tag(5, WireType.Varint).int64(message.categoryId);
743
- /* optional resources.documents.Category category = 6; */
612
+ /* optional resources.documents.category.Category category = 6; */
744
613
  if (message.category)
745
614
  Category.internalBinaryWrite(message.category, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
746
615
  /* string title = 7; */
@@ -755,7 +624,7 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
755
624
  /* optional int32 creator_id = 11; */
756
625
  if (message.creatorId !== undefined)
757
626
  writer.tag(11, WireType.Varint).int32(message.creatorId);
758
- /* optional resources.users.UserShort creator = 12; */
627
+ /* optional resources.users.short.UserShort creator = 12; */
759
628
  if (message.creator)
760
629
  UserShort.internalBinaryWrite(message.creator, writer.tag(12, WireType.LengthDelimited).fork(), options).join();
761
630
  /* string creator_job = 13; */
@@ -764,27 +633,24 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
764
633
  /* optional string creator_job_label = 14; */
765
634
  if (message.creatorJobLabel !== undefined)
766
635
  writer.tag(14, WireType.LengthDelimited).string(message.creatorJobLabel);
767
- /* string state = 15; */
768
- if (message.state !== "")
769
- writer.tag(15, WireType.LengthDelimited).string(message.state);
770
- /* bool closed = 16; */
771
- if (message.closed !== false)
772
- writer.tag(16, WireType.Varint).bool(message.closed);
773
- /* bool draft = 17; */
774
- if (message.draft !== false)
775
- writer.tag(17, WireType.Varint).bool(message.draft);
776
- /* bool public = 18; */
777
- if (message.public !== false)
778
- writer.tag(18, WireType.Varint).bool(message.public);
779
- /* optional resources.documents.DocumentPin pin = 20; */
636
+ /* resources.documents.DocumentMeta meta = 15; */
637
+ if (message.meta)
638
+ DocumentMeta.internalBinaryWrite(message.meta, writer.tag(15, WireType.LengthDelimited).fork(), options).join();
639
+ /* optional resources.documents.pins.DocumentPin pin = 17; */
780
640
  if (message.pin)
781
- DocumentPin.internalBinaryWrite(message.pin, writer.tag(20, WireType.LengthDelimited).fork(), options).join();
782
- /* optional resources.documents.WorkflowState workflow_state = 21; */
641
+ DocumentPin.internalBinaryWrite(message.pin, writer.tag(17, WireType.LengthDelimited).fork(), options).join();
642
+ /* optional resources.documents.workflow.WorkflowState workflow_state = 18; */
783
643
  if (message.workflowState)
784
- WorkflowState.internalBinaryWrite(message.workflowState, writer.tag(21, WireType.LengthDelimited).fork(), options).join();
785
- /* optional resources.documents.WorkflowUserState workflow_user = 22; */
644
+ WorkflowState.internalBinaryWrite(message.workflowState, writer.tag(18, WireType.LengthDelimited).fork(), options).join();
645
+ /* optional resources.documents.workflow.WorkflowUserState workflow_user = 19; */
786
646
  if (message.workflowUser)
787
- WorkflowUserState.internalBinaryWrite(message.workflowUser, writer.tag(22, WireType.LengthDelimited).fork(), options).join();
647
+ WorkflowUserState.internalBinaryWrite(message.workflowUser, writer.tag(19, WireType.LengthDelimited).fork(), options).join();
648
+ /* optional uint32 word_count = 21; */
649
+ if (message.wordCount !== undefined)
650
+ writer.tag(21, WireType.Varint).uint32(message.wordCount);
651
+ /* optional string first_heading = 22; */
652
+ if (message.firstHeading !== undefined)
653
+ writer.tag(22, WireType.LengthDelimited).string(message.firstHeading);
788
654
  let u = options.writeUnknownFields;
789
655
  if (u !== false)
790
656
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -796,238 +662,38 @@ class DocumentShort$Type extends MessageType<DocumentShort> {
796
662
  */
797
663
  export const DocumentShort = new DocumentShort$Type();
798
664
  // @generated message type with reflection information, may provide speed optimized methods
799
- class DocumentReference$Type extends MessageType<DocumentReference> {
800
- constructor() {
801
- super("resources.documents.DocumentReference", [
802
- { no: 1, name: "id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
803
- { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
804
- { no: 3, name: "source_document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "tagger.tags": "alias:\"source_document_id\"" } },
805
- { no: 4, name: "source_document", kind: "message", T: () => DocumentShort, options: { "tagger.tags": "alias:\"source_document\"" } },
806
- { no: 5, name: "reference", kind: "enum", T: () => ["resources.documents.DocReference", DocReference, "DOC_REFERENCE_"], options: { "buf.validate.field": { enum: { definedOnly: true } }, "tagger.tags": "alias:\"reference\"" } },
807
- { no: 6, name: "target_document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "tagger.tags": "alias:\"target_document_id\"" } },
808
- { no: 7, name: "target_document", kind: "message", T: () => DocumentShort, options: { "tagger.tags": "alias:\"target_document\"" } },
809
- { no: 8, name: "creator_id", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gt: 0 } } } },
810
- { no: 9, name: "creator", kind: "message", T: () => UserShort, options: { "tagger.tags": "alias:\"ref_creator\"" } }
811
- ]);
812
- }
813
- create(value?: PartialMessage<DocumentReference>): DocumentReference {
814
- const message = globalThis.Object.create((this.messagePrototype!));
815
- message.sourceDocumentId = 0;
816
- message.reference = 0;
817
- message.targetDocumentId = 0;
818
- if (value !== undefined)
819
- reflectionMergePartial<DocumentReference>(this, message, value);
820
- return message;
821
- }
822
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentReference): DocumentReference {
823
- let message = target ?? this.create(), end = reader.pos + length;
824
- while (reader.pos < end) {
825
- let [fieldNo, wireType] = reader.tag();
826
- switch (fieldNo) {
827
- case /* optional int64 id */ 1:
828
- message.id = reader.int64().toNumber();
829
- break;
830
- case /* optional resources.timestamp.Timestamp created_at */ 2:
831
- message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
832
- break;
833
- case /* int64 source_document_id */ 3:
834
- message.sourceDocumentId = reader.int64().toNumber();
835
- break;
836
- case /* optional resources.documents.DocumentShort source_document */ 4:
837
- message.sourceDocument = DocumentShort.internalBinaryRead(reader, reader.uint32(), options, message.sourceDocument);
838
- break;
839
- case /* resources.documents.DocReference reference */ 5:
840
- message.reference = reader.int32();
841
- break;
842
- case /* int64 target_document_id */ 6:
843
- message.targetDocumentId = reader.int64().toNumber();
844
- break;
845
- case /* optional resources.documents.DocumentShort target_document */ 7:
846
- message.targetDocument = DocumentShort.internalBinaryRead(reader, reader.uint32(), options, message.targetDocument);
847
- break;
848
- case /* optional int32 creator_id */ 8:
849
- message.creatorId = reader.int32();
850
- break;
851
- case /* optional resources.users.UserShort creator */ 9:
852
- message.creator = UserShort.internalBinaryRead(reader, reader.uint32(), options, message.creator);
853
- break;
854
- default:
855
- let u = options.readUnknownField;
856
- if (u === "throw")
857
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
858
- let d = reader.skip(wireType);
859
- if (u !== false)
860
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
861
- }
862
- }
863
- return message;
864
- }
865
- internalBinaryWrite(message: DocumentReference, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
866
- /* optional int64 id = 1; */
867
- if (message.id !== undefined)
868
- writer.tag(1, WireType.Varint).int64(message.id);
869
- /* optional resources.timestamp.Timestamp created_at = 2; */
870
- if (message.createdAt)
871
- Timestamp.internalBinaryWrite(message.createdAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
872
- /* int64 source_document_id = 3; */
873
- if (message.sourceDocumentId !== 0)
874
- writer.tag(3, WireType.Varint).int64(message.sourceDocumentId);
875
- /* optional resources.documents.DocumentShort source_document = 4; */
876
- if (message.sourceDocument)
877
- DocumentShort.internalBinaryWrite(message.sourceDocument, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
878
- /* resources.documents.DocReference reference = 5; */
879
- if (message.reference !== 0)
880
- writer.tag(5, WireType.Varint).int32(message.reference);
881
- /* int64 target_document_id = 6; */
882
- if (message.targetDocumentId !== 0)
883
- writer.tag(6, WireType.Varint).int64(message.targetDocumentId);
884
- /* optional resources.documents.DocumentShort target_document = 7; */
885
- if (message.targetDocument)
886
- DocumentShort.internalBinaryWrite(message.targetDocument, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
887
- /* optional int32 creator_id = 8; */
888
- if (message.creatorId !== undefined)
889
- writer.tag(8, WireType.Varint).int32(message.creatorId);
890
- /* optional resources.users.UserShort creator = 9; */
891
- if (message.creator)
892
- UserShort.internalBinaryWrite(message.creator, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
893
- let u = options.writeUnknownFields;
894
- if (u !== false)
895
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
896
- return writer;
897
- }
898
- }
899
- /**
900
- * @generated MessageType for protobuf message resources.documents.DocumentReference
901
- */
902
- export const DocumentReference = new DocumentReference$Type();
903
- // @generated message type with reflection information, may provide speed optimized methods
904
- class DocumentRelation$Type extends MessageType<DocumentRelation> {
905
- constructor() {
906
- super("resources.documents.DocumentRelation", [
907
- { no: 1, name: "id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
908
- { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
909
- { no: 3, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
910
- { no: 4, name: "document", kind: "message", T: () => DocumentShort, options: { "tagger.tags": "alias:\"document\"" } },
911
- { no: 5, name: "source_user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gt: 0 } }, "tagger.tags": "alias:\"source_user_id\"" } },
912
- { no: 6, name: "source_user", kind: "message", T: () => UserShort, options: { "tagger.tags": "alias:\"source_user\"" } },
913
- { no: 7, name: "relation", kind: "enum", T: () => ["resources.documents.DocRelation", DocRelation, "DOC_RELATION_"], options: { "buf.validate.field": { enum: { definedOnly: true } }, "tagger.tags": "alias:\"relation\"" } },
914
- { no: 8, name: "target_user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gt: 0 } }, "tagger.tags": "alias:\"target_user_id\"" } },
915
- { no: 9, name: "target_user", kind: "message", T: () => UserShort, options: { "tagger.tags": "alias:\"target_user\"" } }
916
- ]);
917
- }
918
- create(value?: PartialMessage<DocumentRelation>): DocumentRelation {
919
- const message = globalThis.Object.create((this.messagePrototype!));
920
- message.documentId = 0;
921
- message.sourceUserId = 0;
922
- message.relation = 0;
923
- message.targetUserId = 0;
924
- if (value !== undefined)
925
- reflectionMergePartial<DocumentRelation>(this, message, value);
926
- return message;
927
- }
928
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentRelation): DocumentRelation {
929
- let message = target ?? this.create(), end = reader.pos + length;
930
- while (reader.pos < end) {
931
- let [fieldNo, wireType] = reader.tag();
932
- switch (fieldNo) {
933
- case /* optional int64 id */ 1:
934
- message.id = reader.int64().toNumber();
935
- break;
936
- case /* optional resources.timestamp.Timestamp created_at */ 2:
937
- message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
938
- break;
939
- case /* int64 document_id */ 3:
940
- message.documentId = reader.int64().toNumber();
941
- break;
942
- case /* optional resources.documents.DocumentShort document */ 4:
943
- message.document = DocumentShort.internalBinaryRead(reader, reader.uint32(), options, message.document);
944
- break;
945
- case /* int32 source_user_id */ 5:
946
- message.sourceUserId = reader.int32();
947
- break;
948
- case /* optional resources.users.UserShort source_user */ 6:
949
- message.sourceUser = UserShort.internalBinaryRead(reader, reader.uint32(), options, message.sourceUser);
950
- break;
951
- case /* resources.documents.DocRelation relation */ 7:
952
- message.relation = reader.int32();
953
- break;
954
- case /* int32 target_user_id */ 8:
955
- message.targetUserId = reader.int32();
956
- break;
957
- case /* optional resources.users.UserShort target_user */ 9:
958
- message.targetUser = UserShort.internalBinaryRead(reader, reader.uint32(), options, message.targetUser);
959
- break;
960
- default:
961
- let u = options.readUnknownField;
962
- if (u === "throw")
963
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
964
- let d = reader.skip(wireType);
965
- if (u !== false)
966
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
967
- }
968
- }
969
- return message;
970
- }
971
- internalBinaryWrite(message: DocumentRelation, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
972
- /* optional int64 id = 1; */
973
- if (message.id !== undefined)
974
- writer.tag(1, WireType.Varint).int64(message.id);
975
- /* optional resources.timestamp.Timestamp created_at = 2; */
976
- if (message.createdAt)
977
- Timestamp.internalBinaryWrite(message.createdAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
978
- /* int64 document_id = 3; */
979
- if (message.documentId !== 0)
980
- writer.tag(3, WireType.Varint).int64(message.documentId);
981
- /* optional resources.documents.DocumentShort document = 4; */
982
- if (message.document)
983
- DocumentShort.internalBinaryWrite(message.document, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
984
- /* int32 source_user_id = 5; */
985
- if (message.sourceUserId !== 0)
986
- writer.tag(5, WireType.Varint).int32(message.sourceUserId);
987
- /* optional resources.users.UserShort source_user = 6; */
988
- if (message.sourceUser)
989
- UserShort.internalBinaryWrite(message.sourceUser, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
990
- /* resources.documents.DocRelation relation = 7; */
991
- if (message.relation !== 0)
992
- writer.tag(7, WireType.Varint).int32(message.relation);
993
- /* int32 target_user_id = 8; */
994
- if (message.targetUserId !== 0)
995
- writer.tag(8, WireType.Varint).int32(message.targetUserId);
996
- /* optional resources.users.UserShort target_user = 9; */
997
- if (message.targetUser)
998
- UserShort.internalBinaryWrite(message.targetUser, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
999
- let u = options.writeUnknownFields;
1000
- if (u !== false)
1001
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1002
- return writer;
1003
- }
1004
- }
1005
- /**
1006
- * @generated MessageType for protobuf message resources.documents.DocumentRelation
1007
- */
1008
- export const DocumentRelation = new DocumentRelation$Type();
1009
- // @generated message type with reflection information, may provide speed optimized methods
1010
- class WorkflowState$Type extends MessageType<WorkflowState> {
665
+ class DocumentMeta$Type extends MessageType<DocumentMeta> {
1011
666
  constructor() {
1012
- super("resources.documents.WorkflowState", [
667
+ super("resources.documents.DocumentMeta", [
1013
668
  { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
1014
- { no: 2, name: "next_reminder_time", kind: "message", T: () => Timestamp },
1015
- { no: 3, name: "next_reminder_count", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
1016
- { no: 5, name: "reminder_count", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { lte: 10, gte: 1 } } } },
1017
- { no: 4, name: "auto_close_time", kind: "message", T: () => Timestamp },
1018
- { no: 6, name: "workflow", kind: "message", T: () => Workflow, options: { "tagger.tags": "alias:\"workflow\"" } },
1019
- { no: 7, name: "document", kind: "message", T: () => DocumentShort }
669
+ { no: 2, name: "recomputed_at", kind: "message", T: () => Timestamp },
670
+ { no: 3, name: "closed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
671
+ { no: 4, name: "draft", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
672
+ { no: 5, name: "public", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
673
+ { no: 6, name: "state", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "32" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
674
+ { no: 7, name: "approved", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
675
+ { no: 16, name: "ap_required_total", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
676
+ { no: 17, name: "ap_collected_approved", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
677
+ { no: 18, name: "ap_required_remaining", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
678
+ { no: 19, name: "ap_declined_count", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
679
+ { no: 20, name: "ap_pending_count", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
680
+ { no: 21, name: "ap_any_declined", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
681
+ { no: 22, name: "ap_policies_active", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
682
+ { no: 23, name: "comment_count", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }
1020
683
  ]);
1021
684
  }
1022
- create(value?: PartialMessage<WorkflowState>): WorkflowState {
685
+ create(value?: PartialMessage<DocumentMeta>): DocumentMeta {
1023
686
  const message = globalThis.Object.create((this.messagePrototype!));
1024
687
  message.documentId = 0;
1025
- message.reminderCount = 0;
688
+ message.closed = false;
689
+ message.draft = false;
690
+ message.public = false;
691
+ message.state = "";
1026
692
  if (value !== undefined)
1027
- reflectionMergePartial<WorkflowState>(this, message, value);
693
+ reflectionMergePartial<DocumentMeta>(this, message, value);
1028
694
  return message;
1029
695
  }
1030
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WorkflowState): WorkflowState {
696
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DocumentMeta): DocumentMeta {
1031
697
  let message = target ?? this.create(), end = reader.pos + length;
1032
698
  while (reader.pos < end) {
1033
699
  let [fieldNo, wireType] = reader.tag();
@@ -1035,119 +701,47 @@ class WorkflowState$Type extends MessageType<WorkflowState> {
1035
701
  case /* int64 document_id */ 1:
1036
702
  message.documentId = reader.int64().toNumber();
1037
703
  break;
1038
- case /* optional resources.timestamp.Timestamp next_reminder_time */ 2:
1039
- message.nextReminderTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.nextReminderTime);
704
+ case /* optional resources.timestamp.Timestamp recomputed_at */ 2:
705
+ message.recomputedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.recomputedAt);
1040
706
  break;
1041
- case /* optional int32 next_reminder_count */ 3:
1042
- message.nextReminderCount = reader.int32();
707
+ case /* bool closed */ 3:
708
+ message.closed = reader.bool();
1043
709
  break;
1044
- case /* int32 reminder_count */ 5:
1045
- message.reminderCount = reader.int32();
710
+ case /* bool draft */ 4:
711
+ message.draft = reader.bool();
1046
712
  break;
1047
- case /* optional resources.timestamp.Timestamp auto_close_time */ 4:
1048
- message.autoCloseTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.autoCloseTime);
713
+ case /* bool public */ 5:
714
+ message.public = reader.bool();
1049
715
  break;
1050
- case /* optional resources.documents.Workflow workflow */ 6:
1051
- message.workflow = Workflow.internalBinaryRead(reader, reader.uint32(), options, message.workflow);
716
+ case /* string state */ 6:
717
+ message.state = reader.string();
1052
718
  break;
1053
- case /* optional resources.documents.DocumentShort document */ 7:
1054
- message.document = DocumentShort.internalBinaryRead(reader, reader.uint32(), options, message.document);
719
+ case /* optional bool approved */ 7:
720
+ message.approved = reader.bool();
1055
721
  break;
1056
- default:
1057
- let u = options.readUnknownField;
1058
- if (u === "throw")
1059
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1060
- let d = reader.skip(wireType);
1061
- if (u !== false)
1062
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1063
- }
1064
- }
1065
- return message;
1066
- }
1067
- internalBinaryWrite(message: WorkflowState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1068
- /* int64 document_id = 1; */
1069
- if (message.documentId !== 0)
1070
- writer.tag(1, WireType.Varint).int64(message.documentId);
1071
- /* optional resources.timestamp.Timestamp next_reminder_time = 2; */
1072
- if (message.nextReminderTime)
1073
- Timestamp.internalBinaryWrite(message.nextReminderTime, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1074
- /* optional int32 next_reminder_count = 3; */
1075
- if (message.nextReminderCount !== undefined)
1076
- writer.tag(3, WireType.Varint).int32(message.nextReminderCount);
1077
- /* optional resources.timestamp.Timestamp auto_close_time = 4; */
1078
- if (message.autoCloseTime)
1079
- Timestamp.internalBinaryWrite(message.autoCloseTime, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
1080
- /* int32 reminder_count = 5; */
1081
- if (message.reminderCount !== 0)
1082
- writer.tag(5, WireType.Varint).int32(message.reminderCount);
1083
- /* optional resources.documents.Workflow workflow = 6; */
1084
- if (message.workflow)
1085
- Workflow.internalBinaryWrite(message.workflow, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
1086
- /* optional resources.documents.DocumentShort document = 7; */
1087
- if (message.document)
1088
- DocumentShort.internalBinaryWrite(message.document, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
1089
- let u = options.writeUnknownFields;
1090
- if (u !== false)
1091
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1092
- return writer;
1093
- }
1094
- }
1095
- /**
1096
- * @generated MessageType for protobuf message resources.documents.WorkflowState
1097
- */
1098
- export const WorkflowState = new WorkflowState$Type();
1099
- // @generated message type with reflection information, may provide speed optimized methods
1100
- class WorkflowUserState$Type extends MessageType<WorkflowUserState> {
1101
- constructor() {
1102
- super("resources.documents.WorkflowUserState", [
1103
- { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
1104
- { no: 2, name: "user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gt: 0 } } } },
1105
- { no: 3, name: "manual_reminder_time", kind: "message", T: () => Timestamp },
1106
- { no: 4, name: "manual_reminder_message", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } } } },
1107
- { no: 5, name: "reminder_count", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { lte: 10, gte: 1 } } } },
1108
- { no: 6, name: "max_reminder_count", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { lte: 10, gte: 1 } } } },
1109
- { no: 7, name: "workflow", kind: "message", T: () => Workflow, options: { "tagger.tags": "alias:\"workflow\"" } },
1110
- { no: 8, name: "document", kind: "message", T: () => DocumentShort }
1111
- ]);
1112
- }
1113
- create(value?: PartialMessage<WorkflowUserState>): WorkflowUserState {
1114
- const message = globalThis.Object.create((this.messagePrototype!));
1115
- message.documentId = 0;
1116
- message.userId = 0;
1117
- message.reminderCount = 0;
1118
- message.maxReminderCount = 0;
1119
- if (value !== undefined)
1120
- reflectionMergePartial<WorkflowUserState>(this, message, value);
1121
- return message;
1122
- }
1123
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WorkflowUserState): WorkflowUserState {
1124
- let message = target ?? this.create(), end = reader.pos + length;
1125
- while (reader.pos < end) {
1126
- let [fieldNo, wireType] = reader.tag();
1127
- switch (fieldNo) {
1128
- case /* int64 document_id */ 1:
1129
- message.documentId = reader.int64().toNumber();
722
+ case /* optional int32 ap_required_total */ 16:
723
+ message.apRequiredTotal = reader.int32();
1130
724
  break;
1131
- case /* int32 user_id */ 2:
1132
- message.userId = reader.int32();
725
+ case /* optional int32 ap_collected_approved */ 17:
726
+ message.apCollectedApproved = reader.int32();
1133
727
  break;
1134
- case /* optional resources.timestamp.Timestamp manual_reminder_time */ 3:
1135
- message.manualReminderTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.manualReminderTime);
728
+ case /* optional int32 ap_required_remaining */ 18:
729
+ message.apRequiredRemaining = reader.int32();
1136
730
  break;
1137
- case /* optional string manual_reminder_message */ 4:
1138
- message.manualReminderMessage = reader.string();
731
+ case /* optional int32 ap_declined_count */ 19:
732
+ message.apDeclinedCount = reader.int32();
1139
733
  break;
1140
- case /* int32 reminder_count */ 5:
1141
- message.reminderCount = reader.int32();
734
+ case /* optional int32 ap_pending_count */ 20:
735
+ message.apPendingCount = reader.int32();
1142
736
  break;
1143
- case /* int32 max_reminder_count */ 6:
1144
- message.maxReminderCount = reader.int32();
737
+ case /* optional bool ap_any_declined */ 21:
738
+ message.apAnyDeclined = reader.bool();
1145
739
  break;
1146
- case /* optional resources.documents.Workflow workflow */ 7:
1147
- message.workflow = Workflow.internalBinaryRead(reader, reader.uint32(), options, message.workflow);
740
+ case /* optional int32 ap_policies_active */ 22:
741
+ message.apPoliciesActive = reader.int32();
1148
742
  break;
1149
- case /* optional resources.documents.DocumentShort document */ 8:
1150
- message.document = DocumentShort.internalBinaryRead(reader, reader.uint32(), options, message.document);
743
+ case /* optional int32 comment_count */ 23:
744
+ message.commentCount = reader.int32();
1151
745
  break;
1152
746
  default:
1153
747
  let u = options.readUnknownField;
@@ -1160,31 +754,52 @@ class WorkflowUserState$Type extends MessageType<WorkflowUserState> {
1160
754
  }
1161
755
  return message;
1162
756
  }
1163
- internalBinaryWrite(message: WorkflowUserState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
757
+ internalBinaryWrite(message: DocumentMeta, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1164
758
  /* int64 document_id = 1; */
1165
759
  if (message.documentId !== 0)
1166
760
  writer.tag(1, WireType.Varint).int64(message.documentId);
1167
- /* int32 user_id = 2; */
1168
- if (message.userId !== 0)
1169
- writer.tag(2, WireType.Varint).int32(message.userId);
1170
- /* optional resources.timestamp.Timestamp manual_reminder_time = 3; */
1171
- if (message.manualReminderTime)
1172
- Timestamp.internalBinaryWrite(message.manualReminderTime, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1173
- /* optional string manual_reminder_message = 4; */
1174
- if (message.manualReminderMessage !== undefined)
1175
- writer.tag(4, WireType.LengthDelimited).string(message.manualReminderMessage);
1176
- /* int32 reminder_count = 5; */
1177
- if (message.reminderCount !== 0)
1178
- writer.tag(5, WireType.Varint).int32(message.reminderCount);
1179
- /* int32 max_reminder_count = 6; */
1180
- if (message.maxReminderCount !== 0)
1181
- writer.tag(6, WireType.Varint).int32(message.maxReminderCount);
1182
- /* optional resources.documents.Workflow workflow = 7; */
1183
- if (message.workflow)
1184
- Workflow.internalBinaryWrite(message.workflow, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
1185
- /* optional resources.documents.DocumentShort document = 8; */
1186
- if (message.document)
1187
- DocumentShort.internalBinaryWrite(message.document, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
761
+ /* optional resources.timestamp.Timestamp recomputed_at = 2; */
762
+ if (message.recomputedAt)
763
+ Timestamp.internalBinaryWrite(message.recomputedAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
764
+ /* bool closed = 3; */
765
+ if (message.closed !== false)
766
+ writer.tag(3, WireType.Varint).bool(message.closed);
767
+ /* bool draft = 4; */
768
+ if (message.draft !== false)
769
+ writer.tag(4, WireType.Varint).bool(message.draft);
770
+ /* bool public = 5; */
771
+ if (message.public !== false)
772
+ writer.tag(5, WireType.Varint).bool(message.public);
773
+ /* string state = 6; */
774
+ if (message.state !== "")
775
+ writer.tag(6, WireType.LengthDelimited).string(message.state);
776
+ /* optional bool approved = 7; */
777
+ if (message.approved !== undefined)
778
+ writer.tag(7, WireType.Varint).bool(message.approved);
779
+ /* optional int32 ap_required_total = 16; */
780
+ if (message.apRequiredTotal !== undefined)
781
+ writer.tag(16, WireType.Varint).int32(message.apRequiredTotal);
782
+ /* optional int32 ap_collected_approved = 17; */
783
+ if (message.apCollectedApproved !== undefined)
784
+ writer.tag(17, WireType.Varint).int32(message.apCollectedApproved);
785
+ /* optional int32 ap_required_remaining = 18; */
786
+ if (message.apRequiredRemaining !== undefined)
787
+ writer.tag(18, WireType.Varint).int32(message.apRequiredRemaining);
788
+ /* optional int32 ap_declined_count = 19; */
789
+ if (message.apDeclinedCount !== undefined)
790
+ writer.tag(19, WireType.Varint).int32(message.apDeclinedCount);
791
+ /* optional int32 ap_pending_count = 20; */
792
+ if (message.apPendingCount !== undefined)
793
+ writer.tag(20, WireType.Varint).int32(message.apPendingCount);
794
+ /* optional bool ap_any_declined = 21; */
795
+ if (message.apAnyDeclined !== undefined)
796
+ writer.tag(21, WireType.Varint).bool(message.apAnyDeclined);
797
+ /* optional int32 ap_policies_active = 22; */
798
+ if (message.apPoliciesActive !== undefined)
799
+ writer.tag(22, WireType.Varint).int32(message.apPoliciesActive);
800
+ /* optional int32 comment_count = 23; */
801
+ if (message.commentCount !== undefined)
802
+ writer.tag(23, WireType.Varint).int32(message.commentCount);
1188
803
  let u = options.writeUnknownFields;
1189
804
  if (u !== false)
1190
805
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -1192,6 +807,6 @@ class WorkflowUserState$Type extends MessageType<WorkflowUserState> {
1192
807
  }
1193
808
  }
1194
809
  /**
1195
- * @generated MessageType for protobuf message resources.documents.WorkflowUserState
810
+ * @generated MessageType for protobuf message resources.documents.DocumentMeta
1196
811
  */
1197
- export const WorkflowUserState = new WorkflowUserState$Type();
812
+ export const DocumentMeta = new DocumentMeta$Type();