@fivenet-app/gen 2025.9.1 → 2026.3.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 (131) hide show
  1. package/README.md +1 -1
  2. package/clients.ts +36 -0
  3. package/codegen/perms/perms.ts +94 -15
  4. package/codegen/sanitizer/sanitizer.ts +34 -1
  5. package/package.json +2 -2
  6. package/perms.ts +137 -6
  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} +69 -69
  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/clientconfig/clientconfig.ts +159 -34
  21. package/resources/collab/collab.ts +4 -16
  22. package/resources/common/content/content.ts +108 -85
  23. package/resources/common/content/diff_activity.ts +267 -0
  24. package/resources/common/i18n.ts +2 -2
  25. package/resources/{common/cron → cron}/cron.ts +41 -41
  26. package/resources/documents/{access.ts → access/access.ts} +30 -30
  27. package/resources/documents/{activity.ts → activity/activity.ts} +171 -123
  28. package/resources/documents/approval/approval.ts +945 -0
  29. package/resources/documents/{category.ts → category/category.ts} +7 -7
  30. package/resources/documents/{comment.ts → comment/comment.ts} +10 -10
  31. package/resources/documents/data/data.ts +303 -0
  32. package/resources/documents/documents.ts +282 -667
  33. package/resources/{common/uuid.ts → documents/forms/forms.ts} +20 -20
  34. package/resources/documents/{pins.ts → pins/pins.ts} +5 -5
  35. package/resources/documents/references/references.ts +187 -0
  36. package/resources/documents/relations/relations.ts +184 -0
  37. package/resources/documents/{requests.ts → requests/requests.ts} +18 -18
  38. package/resources/documents/stamps/stamp.ts +355 -0
  39. package/resources/documents/{templates.ts → templates/templates.ts} +426 -84
  40. package/resources/documents/{workflow.ts → workflow/workflow.ts} +264 -26
  41. package/resources/file/filestore.ts +1 -1
  42. package/resources/{common/grpcws → grpcws}/grpcws.ts +52 -52
  43. package/resources/jobs/{activity.ts → colleagues/activity/activity.ts} +54 -54
  44. package/resources/jobs/{colleagues.ts → colleagues/colleagues.ts} +17 -28
  45. package/resources/jobs/{conduct.ts → conduct/conduct.ts} +70 -45
  46. package/resources/jobs/{labels.ts → labels/labels.ts} +18 -18
  47. package/resources/jobs/{job_props.ts → props/props.ts} +26 -38
  48. package/resources/jobs/{job_settings.ts → settings/settings.ts} +53 -53
  49. package/resources/jobs/{timeclock.ts → timeclock/timeclock.ts} +17 -17
  50. package/resources/livemap/{heatmap.ts → heatmap/heatmap.ts} +4 -4
  51. package/resources/livemap/{marker_marker.ts → markers/marker_marker.ts} +35 -35
  52. package/resources/livemap/{user_marker.ts → markers/user_marker.ts} +115 -36
  53. package/resources/mailer/{access.ts → access/access.ts} +67 -67
  54. package/resources/mailer/{email.ts → emails/email.ts} +19 -19
  55. package/resources/mailer/{events.ts → events/events.ts} +24 -24
  56. package/resources/mailer/{message.ts → messages/message.ts} +29 -29
  57. package/resources/mailer/{settings.ts → settings/settings.ts} +14 -13
  58. package/resources/mailer/{template.ts → templates/template.ts} +15 -15
  59. package/resources/mailer/{thread.ts → threads/thread.ts} +29 -29
  60. package/resources/notifications/{client_view.ts → clientview/clientview.ts} +22 -22
  61. package/resources/notifications/{events.ts → events/events.ts} +20 -20
  62. package/resources/notifications/notifications.ts +4 -4
  63. package/resources/permissions/{attributes.ts → attributes/attributes.ts} +42 -42
  64. package/resources/permissions/{events.ts → events/events.ts} +7 -7
  65. package/resources/permissions/{permissions.ts → permissions/permissions.ts} +30 -19
  66. package/resources/qualifications/{access.ts → access/access.ts} +19 -19
  67. package/resources/qualifications/{exam.ts → exam/exam.ts} +269 -141
  68. package/resources/qualifications/qualifications.ts +51 -179
  69. package/resources/settings/banner.ts +3 -3
  70. package/resources/settings/config.ts +514 -14
  71. package/resources/{documents/state.ts → settings/data.ts} +41 -20
  72. package/resources/settings/perms.ts +14 -14
  73. package/resources/stats/stats.ts +379 -0
  74. package/resources/sync/{activity.ts → activity/activity.ts} +104 -25
  75. package/resources/sync/{data.ts → data/data.ts} +404 -58
  76. package/resources/sync/data/v2/data.ts +220 -0
  77. package/resources/userinfo/{user_info.ts → userinfo.ts} +71 -93
  78. package/resources/users/{activity.ts → activity/activity.ts} +121 -100
  79. package/resources/users/{labels.ts → labels/labels.ts} +12 -12
  80. package/resources/users/{licenses.ts → licenses/licenses.ts} +10 -10
  81. package/resources/users/{props.ts → props/props.ts} +91 -69
  82. package/resources/users/short/user.ts +184 -0
  83. package/resources/users/{users.ts → user.ts} +266 -195
  84. package/resources/vehicles/{activity.ts → activity/activity.ts} +20 -20
  85. package/resources/vehicles/{props.ts → props/props.ts} +28 -6
  86. package/resources/vehicles/vehicles.ts +20 -8
  87. package/resources/wiki/{access.ts → access/access.ts} +30 -30
  88. package/resources/wiki/{activity.ts → activity/activity.ts} +104 -70
  89. package/resources/wiki/page.ts +39 -15
  90. package/services/auth/auth.client.ts +23 -10
  91. package/services/auth/auth.ts +445 -262
  92. package/services/calendar/calendar.ts +56 -34
  93. package/services/centrum/centrum.ts +127 -127
  94. package/services/citizens/citizens.ts +51 -27
  95. package/services/completor/completor.ts +35 -15
  96. package/services/documents/approval.client.ts +188 -0
  97. package/services/documents/approval.ts +1776 -0
  98. package/services/documents/documents.ts +163 -185
  99. package/services/documents/forms.client.ts +51 -0
  100. package/services/documents/forms.ts +232 -0
  101. package/services/documents/stamps.client.ts +77 -0
  102. package/services/documents/stamps.ts +481 -0
  103. package/services/documents/stats.client.ts +38 -0
  104. package/services/documents/stats.ts +245 -0
  105. package/services/jobs/conduct.client.ts +30 -3
  106. package/services/jobs/conduct.ts +159 -33
  107. package/services/jobs/jobs.ts +43 -43
  108. package/services/jobs/stats.client.ts +38 -0
  109. package/services/jobs/stats.ts +207 -0
  110. package/services/jobs/timeclock.ts +39 -39
  111. package/services/livemap/livemap.ts +18 -18
  112. package/services/mailer/mailer.ts +78 -78
  113. package/services/notifications/notifications.ts +35 -35
  114. package/services/qualifications/qualifications.ts +80 -45
  115. package/services/settings/accounts.client.ts +23 -10
  116. package/services/settings/accounts.ts +191 -30
  117. package/services/settings/cron.ts +4 -4
  118. package/services/settings/laws.ts +1 -1
  119. package/services/settings/settings.ts +73 -52
  120. package/services/settings/system.client.ts +13 -0
  121. package/services/settings/system.ts +115 -15
  122. package/services/stats/stats.client.ts +7 -7
  123. package/services/stats/stats.ts +24 -24
  124. package/services/sync/sync.ts +124 -77
  125. package/services/sync/v2/sync.client.ts +331 -0
  126. package/services/sync/v2/sync.ts +1766 -0
  127. package/services/vehicles/vehicles.ts +8 -8
  128. package/services/wiki/wiki.ts +8 -8
  129. package/svcs.ts +95 -3
  130. package/resources/centrum/attributes.ts +0 -183
  131. package/resources/documents/signoff.ts +0 -55
@@ -0,0 +1,1776 @@
1
+ // @generated by protobuf-ts 2.11.1 with parameter force_server_none,long_type_number,optimize_speed,ts_nocheck
2
+ // @generated from protobuf file "services/documents/approval.proto" (package "services.documents", syntax proto3)
3
+ // tslint:disable
4
+ // @ts-nocheck
5
+ import { ServiceType } from "@protobuf-ts/runtime-rpc";
6
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
7
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
8
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
9
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
10
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
+ import { WireType } from "@protobuf-ts/runtime";
12
+ import type { PartialMessage } from "@protobuf-ts/runtime";
13
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
14
+ import { MessageType } from "@protobuf-ts/runtime";
15
+ import { Approval } from "../../resources/documents/approval/approval";
16
+ import { ApprovalStatus } from "../../resources/documents/approval/approval";
17
+ import { Timestamp } from "../../resources/timestamp/timestamp";
18
+ import { DocumentMeta } from "../../resources/documents/documents";
19
+ import { ApprovalPolicy } from "../../resources/documents/approval/approval";
20
+ import { ApprovalTask } from "../../resources/documents/approval/approval";
21
+ import { PaginationResponse } from "../../resources/common/database/database";
22
+ import { ApprovalTaskStatus } from "../../resources/documents/approval/approval";
23
+ import { PaginationRequest } from "../../resources/common/database/database";
24
+ /**
25
+ * @generated from protobuf message services.documents.ListApprovalTasksInboxRequest
26
+ */
27
+ export interface ListApprovalTasksInboxRequest {
28
+ /**
29
+ * @generated from protobuf field: resources.common.database.PaginationRequest pagination = 1
30
+ */
31
+ pagination?: PaginationRequest;
32
+ /**
33
+ * @generated from protobuf field: repeated resources.documents.approval.ApprovalTaskStatus statuses = 2
34
+ */
35
+ statuses: ApprovalTaskStatus[];
36
+ /**
37
+ * Controls inclusion of drafts in the result:
38
+ * - unset/null: include all documents (drafts and non-drafts)
39
+ * - false: only non-draft documents
40
+ * - true: only draft documents
41
+ *
42
+ * @generated from protobuf field: optional bool only_drafts = 3
43
+ */
44
+ onlyDrafts?: boolean;
45
+ /**
46
+ * @generated from protobuf field: optional bool not_already_acted = 4
47
+ */
48
+ notAlreadyActed?: boolean;
49
+ }
50
+ /**
51
+ * @generated from protobuf message services.documents.ListApprovalTasksInboxResponse
52
+ */
53
+ export interface ListApprovalTasksInboxResponse {
54
+ /**
55
+ * @generated from protobuf field: resources.common.database.PaginationResponse pagination = 1
56
+ */
57
+ pagination?: PaginationResponse;
58
+ /**
59
+ * @generated from protobuf field: repeated resources.documents.approval.ApprovalTask tasks = 2
60
+ */
61
+ tasks: ApprovalTask[];
62
+ }
63
+ /**
64
+ * @generated from protobuf message services.documents.ListApprovalPoliciesRequest
65
+ */
66
+ export interface ListApprovalPoliciesRequest {
67
+ /**
68
+ * @generated from protobuf field: int64 document_id = 1
69
+ */
70
+ documentId: number;
71
+ }
72
+ /**
73
+ * Only one policy per document is supported currently.
74
+ *
75
+ * @generated from protobuf message services.documents.ListApprovalPoliciesResponse
76
+ */
77
+ export interface ListApprovalPoliciesResponse {
78
+ /**
79
+ * @generated from protobuf field: resources.documents.approval.ApprovalPolicy policy = 1
80
+ */
81
+ policy?: ApprovalPolicy;
82
+ /**
83
+ * @generated from protobuf field: resources.documents.DocumentMeta doc_meta = 2
84
+ */
85
+ docMeta?: DocumentMeta;
86
+ }
87
+ /**
88
+ * @generated from protobuf message services.documents.UpsertApprovalPolicyRequest
89
+ */
90
+ export interface UpsertApprovalPolicyRequest {
91
+ /**
92
+ * @generated from protobuf field: resources.documents.approval.ApprovalPolicy policy = 1
93
+ */
94
+ policy?: ApprovalPolicy;
95
+ }
96
+ /**
97
+ * @generated from protobuf message services.documents.UpsertApprovalPolicyResponse
98
+ */
99
+ export interface UpsertApprovalPolicyResponse {
100
+ /**
101
+ * @generated from protobuf field: resources.documents.approval.ApprovalPolicy policy = 1
102
+ */
103
+ policy?: ApprovalPolicy;
104
+ /**
105
+ * @generated from protobuf field: resources.documents.DocumentMeta doc_meta = 2
106
+ */
107
+ docMeta?: DocumentMeta;
108
+ }
109
+ /**
110
+ * @generated from protobuf message services.documents.ListApprovalTasksRequest
111
+ */
112
+ export interface ListApprovalTasksRequest {
113
+ /**
114
+ * @generated from protobuf field: int64 document_id = 1
115
+ */
116
+ documentId: number;
117
+ /**
118
+ * @generated from protobuf field: repeated resources.documents.approval.ApprovalTaskStatus statuses = 2
119
+ */
120
+ statuses: ApprovalTaskStatus[];
121
+ }
122
+ /**
123
+ * @generated from protobuf message services.documents.ListApprovalTasksResponse
124
+ */
125
+ export interface ListApprovalTasksResponse {
126
+ /**
127
+ * @generated from protobuf field: repeated resources.documents.approval.ApprovalTask tasks = 1
128
+ */
129
+ tasks: ApprovalTask[];
130
+ }
131
+ /**
132
+ * A declarative "ensure" for tasks under one policy/snapshot.
133
+ * Exactly one target must be set: user_id OR (job + minimum_grade).
134
+ *
135
+ * @generated from protobuf message services.documents.ApprovalTaskSeed
136
+ */
137
+ export interface ApprovalTaskSeed {
138
+ /**
139
+ * If set -> USER task; slots is forced to 1
140
+ *
141
+ * @generated from protobuf field: int32 user_id = 1
142
+ */
143
+ userId: number;
144
+ /**
145
+ * If user_id == 0 -> JOB task
146
+ *
147
+ * @generated from protobuf field: string job = 2
148
+ */
149
+ job: string;
150
+ /**
151
+ * @generated from protobuf field: int32 minimum_grade = 3
152
+ */
153
+ minimumGrade: number;
154
+ /**
155
+ * Label of task
156
+ *
157
+ * @generated from protobuf field: optional string label = 4
158
+ */
159
+ label?: string;
160
+ /**
161
+ * @generated from protobuf field: bool signature_required = 5
162
+ */
163
+ signatureRequired: boolean;
164
+ /**
165
+ * Only for JOB tasks; number of PENDING slots to ensure (>=1)
166
+ *
167
+ * @generated from protobuf field: int32 slots = 6
168
+ */
169
+ slots: number;
170
+ /**
171
+ * Optional default due date for created slots
172
+ *
173
+ * @generated from protobuf field: optional resources.timestamp.Timestamp due_at = 7
174
+ */
175
+ dueAt?: Timestamp;
176
+ /**
177
+ * Optional note set on created tasks
178
+ *
179
+ * @generated from protobuf field: optional string comment = 8
180
+ */
181
+ comment?: string;
182
+ }
183
+ /**
184
+ * Upsert = insert missing PENDING tasks/slots; will NOT delete existing tasks.
185
+ * Identity rules (server-side):
186
+ * - USER task: unique by (document_id, snapshot_date, assignee_kind=USER, user_id)
187
+ * - JOB task: unique by (document_id, snapshot_date, assignee_kind=JOB, job, minimum_grade, slot_no)
188
+ * For JOB seeds with slots=N, the server ensures there are at least N PENDING slots (slot_no 1..N).
189
+ *
190
+ * @generated from protobuf message services.documents.UpsertApprovalTasksRequest
191
+ */
192
+ export interface UpsertApprovalTasksRequest {
193
+ /**
194
+ * @generated from protobuf field: int64 document_id = 1
195
+ */
196
+ documentId: number;
197
+ /**
198
+ * If empty, use policy.snapshot_date
199
+ *
200
+ * @generated from protobuf field: optional resources.timestamp.Timestamp snapshot_date = 2
201
+ */
202
+ snapshotDate?: Timestamp;
203
+ /**
204
+ * @generated from protobuf field: repeated services.documents.ApprovalTaskSeed seeds = 3
205
+ */
206
+ seeds: ApprovalTaskSeed[];
207
+ }
208
+ /**
209
+ * @generated from protobuf message services.documents.UpsertApprovalTasksResponse
210
+ */
211
+ export interface UpsertApprovalTasksResponse {
212
+ /**
213
+ * Number of new task rows inserted
214
+ *
215
+ * @generated from protobuf field: int32 tasks_created = 1
216
+ */
217
+ tasksCreated: number;
218
+ /**
219
+ * Number of requested targets already satisfied (no-op)
220
+ *
221
+ * @generated from protobuf field: int32 tasks_ensured = 2
222
+ */
223
+ tasksEnsured: number;
224
+ /**
225
+ * Echo (optional convenience)
226
+ *
227
+ * @generated from protobuf field: resources.documents.approval.ApprovalPolicy policy = 3
228
+ */
229
+ policy?: ApprovalPolicy;
230
+ }
231
+ /**
232
+ * @generated from protobuf message services.documents.DeleteApprovalTasksRequest
233
+ */
234
+ export interface DeleteApprovalTasksRequest {
235
+ /**
236
+ * @generated from protobuf field: int64 document_id = 1
237
+ */
238
+ documentId: number;
239
+ /**
240
+ * @generated from protobuf field: repeated int64 task_ids = 2
241
+ */
242
+ taskIds: number[];
243
+ /**
244
+ * If true, ignore task_ids and delete all PENDING tasks under this policy
245
+ *
246
+ * @generated from protobuf field: bool delete_all_pending = 3
247
+ */
248
+ deleteAllPending: boolean;
249
+ }
250
+ /**
251
+ * @generated from protobuf message services.documents.DeleteApprovalTasksResponse
252
+ */
253
+ export interface DeleteApprovalTasksResponse {
254
+ }
255
+ /**
256
+ * List approvals (artifacts) for a policy/snapshot.
257
+ * If snapshot_date is unset, server defaults to policy.snapshot_date.
258
+ *
259
+ * @generated from protobuf message services.documents.ListApprovalsRequest
260
+ */
261
+ export interface ListApprovalsRequest {
262
+ /**
263
+ * @generated from protobuf field: int64 document_id = 1
264
+ */
265
+ documentId: number;
266
+ /**
267
+ * @generated from protobuf field: optional int64 task_id = 2
268
+ */
269
+ taskId?: number;
270
+ /**
271
+ * @generated from protobuf field: optional resources.timestamp.Timestamp snapshot_date = 3
272
+ */
273
+ snapshotDate?: Timestamp;
274
+ /**
275
+ * Optional filters
276
+ *
277
+ * @generated from protobuf field: optional resources.documents.approval.ApprovalStatus status = 4
278
+ */
279
+ status?: ApprovalStatus;
280
+ /**
281
+ * Filter by signer
282
+ *
283
+ * @generated from protobuf field: optional int32 user_id = 5
284
+ */
285
+ userId?: number;
286
+ }
287
+ /**
288
+ * @generated from protobuf message services.documents.ListApprovalsResponse
289
+ */
290
+ export interface ListApprovalsResponse {
291
+ /**
292
+ * @generated from protobuf field: repeated resources.documents.approval.Approval approvals = 3
293
+ */
294
+ approvals: Approval[];
295
+ }
296
+ /**
297
+ * @generated from protobuf message services.documents.RevokeApprovalRequest
298
+ */
299
+ export interface RevokeApprovalRequest {
300
+ /**
301
+ * @generated from protobuf field: int64 approval_id = 1
302
+ */
303
+ approvalId: number;
304
+ /**
305
+ * @generated from protobuf field: string comment = 2
306
+ */
307
+ comment: string;
308
+ }
309
+ /**
310
+ * @generated from protobuf message services.documents.RevokeApprovalResponse
311
+ */
312
+ export interface RevokeApprovalResponse {
313
+ /**
314
+ * @generated from protobuf field: resources.documents.approval.Approval approval = 1
315
+ */
316
+ approval?: Approval;
317
+ }
318
+ /**
319
+ * @generated from protobuf message services.documents.DecideApprovalRequest
320
+ */
321
+ export interface DecideApprovalRequest {
322
+ /**
323
+ * @generated from protobuf field: int64 document_id = 1
324
+ */
325
+ documentId: number;
326
+ /**
327
+ * @generated from protobuf field: optional int64 task_id = 2
328
+ */
329
+ taskId?: number;
330
+ /**
331
+ * @generated from protobuf field: resources.documents.approval.ApprovalTaskStatus new_status = 3
332
+ */
333
+ newStatus: ApprovalTaskStatus; // APPROVED or DECLINED
334
+ /**
335
+ * @generated from protobuf field: string comment = 4
336
+ */
337
+ comment: string;
338
+ /**
339
+ * @generated from protobuf field: optional string payload_svg = 5
340
+ */
341
+ payloadSvg?: string;
342
+ /**
343
+ * When type=STAMP
344
+ *
345
+ * @generated from protobuf field: optional int64 stamp_id = 6
346
+ */
347
+ stampId?: number;
348
+ }
349
+ /**
350
+ * @generated from protobuf message services.documents.DecideApprovalResponse
351
+ */
352
+ export interface DecideApprovalResponse {
353
+ /**
354
+ * @generated from protobuf field: resources.documents.approval.Approval approval = 1
355
+ */
356
+ approval?: Approval;
357
+ /**
358
+ * @generated from protobuf field: resources.documents.approval.ApprovalTask task = 2
359
+ */
360
+ task?: ApprovalTask;
361
+ /**
362
+ * @generated from protobuf field: resources.documents.approval.ApprovalPolicy policy = 3
363
+ */
364
+ policy?: ApprovalPolicy;
365
+ /**
366
+ * @generated from protobuf field: resources.documents.DocumentMeta doc_meta = 4
367
+ */
368
+ docMeta?: DocumentMeta;
369
+ }
370
+ /**
371
+ * @generated from protobuf message services.documents.ReopenApprovalTaskRequest
372
+ */
373
+ export interface ReopenApprovalTaskRequest {
374
+ /**
375
+ * @generated from protobuf field: int64 task_id = 1
376
+ */
377
+ taskId: number;
378
+ /**
379
+ * @generated from protobuf field: string comment = 2
380
+ */
381
+ comment: string;
382
+ }
383
+ /**
384
+ * @generated from protobuf message services.documents.ReopenApprovalTaskResponse
385
+ */
386
+ export interface ReopenApprovalTaskResponse {
387
+ /**
388
+ * @generated from protobuf field: resources.documents.approval.ApprovalTask task = 1
389
+ */
390
+ task?: ApprovalTask;
391
+ /**
392
+ * @generated from protobuf field: resources.documents.approval.ApprovalPolicy policy = 2
393
+ */
394
+ policy?: ApprovalPolicy;
395
+ }
396
+ /**
397
+ * @generated from protobuf message services.documents.RecomputeApprovalPolicyCountersRequest
398
+ */
399
+ export interface RecomputeApprovalPolicyCountersRequest {
400
+ /**
401
+ * @generated from protobuf field: int64 document_id = 1
402
+ */
403
+ documentId: number;
404
+ }
405
+ /**
406
+ * @generated from protobuf message services.documents.RecomputeApprovalPolicyCountersResponse
407
+ */
408
+ export interface RecomputeApprovalPolicyCountersResponse {
409
+ /**
410
+ * @generated from protobuf field: resources.documents.approval.ApprovalPolicy policy = 1
411
+ */
412
+ policy?: ApprovalPolicy;
413
+ }
414
+ // @generated message type with reflection information, may provide speed optimized methods
415
+ class ListApprovalTasksInboxRequest$Type extends MessageType<ListApprovalTasksInboxRequest> {
416
+ constructor() {
417
+ super("services.documents.ListApprovalTasksInboxRequest", [
418
+ { no: 1, name: "pagination", kind: "message", T: () => PaginationRequest, options: { "buf.validate.field": { required: true } } },
419
+ { no: 2, name: "statuses", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["resources.documents.approval.ApprovalTaskStatus", ApprovalTaskStatus, "APPROVAL_TASK_STATUS_"], options: { "buf.validate.field": { repeated: { maxItems: "4" } } } },
420
+ { no: 3, name: "only_drafts", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
421
+ { no: 4, name: "not_already_acted", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
422
+ ]);
423
+ }
424
+ create(value?: PartialMessage<ListApprovalTasksInboxRequest>): ListApprovalTasksInboxRequest {
425
+ const message = globalThis.Object.create((this.messagePrototype!));
426
+ message.statuses = [];
427
+ if (value !== undefined)
428
+ reflectionMergePartial<ListApprovalTasksInboxRequest>(this, message, value);
429
+ return message;
430
+ }
431
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListApprovalTasksInboxRequest): ListApprovalTasksInboxRequest {
432
+ let message = target ?? this.create(), end = reader.pos + length;
433
+ while (reader.pos < end) {
434
+ let [fieldNo, wireType] = reader.tag();
435
+ switch (fieldNo) {
436
+ case /* resources.common.database.PaginationRequest pagination */ 1:
437
+ message.pagination = PaginationRequest.internalBinaryRead(reader, reader.uint32(), options, message.pagination);
438
+ break;
439
+ case /* repeated resources.documents.approval.ApprovalTaskStatus statuses */ 2:
440
+ if (wireType === WireType.LengthDelimited)
441
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
442
+ message.statuses.push(reader.int32());
443
+ else
444
+ message.statuses.push(reader.int32());
445
+ break;
446
+ case /* optional bool only_drafts */ 3:
447
+ message.onlyDrafts = reader.bool();
448
+ break;
449
+ case /* optional bool not_already_acted */ 4:
450
+ message.notAlreadyActed = reader.bool();
451
+ break;
452
+ default:
453
+ let u = options.readUnknownField;
454
+ if (u === "throw")
455
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
456
+ let d = reader.skip(wireType);
457
+ if (u !== false)
458
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
459
+ }
460
+ }
461
+ return message;
462
+ }
463
+ internalBinaryWrite(message: ListApprovalTasksInboxRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
464
+ /* resources.common.database.PaginationRequest pagination = 1; */
465
+ if (message.pagination)
466
+ PaginationRequest.internalBinaryWrite(message.pagination, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
467
+ /* repeated resources.documents.approval.ApprovalTaskStatus statuses = 2; */
468
+ if (message.statuses.length) {
469
+ writer.tag(2, WireType.LengthDelimited).fork();
470
+ for (let i = 0; i < message.statuses.length; i++)
471
+ writer.int32(message.statuses[i]);
472
+ writer.join();
473
+ }
474
+ /* optional bool only_drafts = 3; */
475
+ if (message.onlyDrafts !== undefined)
476
+ writer.tag(3, WireType.Varint).bool(message.onlyDrafts);
477
+ /* optional bool not_already_acted = 4; */
478
+ if (message.notAlreadyActed !== undefined)
479
+ writer.tag(4, WireType.Varint).bool(message.notAlreadyActed);
480
+ let u = options.writeUnknownFields;
481
+ if (u !== false)
482
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
483
+ return writer;
484
+ }
485
+ }
486
+ /**
487
+ * @generated MessageType for protobuf message services.documents.ListApprovalTasksInboxRequest
488
+ */
489
+ export const ListApprovalTasksInboxRequest = new ListApprovalTasksInboxRequest$Type();
490
+ // @generated message type with reflection information, may provide speed optimized methods
491
+ class ListApprovalTasksInboxResponse$Type extends MessageType<ListApprovalTasksInboxResponse> {
492
+ constructor() {
493
+ super("services.documents.ListApprovalTasksInboxResponse", [
494
+ { no: 1, name: "pagination", kind: "message", T: () => PaginationResponse, options: { "buf.validate.field": { required: true } } },
495
+ { no: 2, name: "tasks", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ApprovalTask, options: { "codegen.itemslen.enabled": true } }
496
+ ]);
497
+ }
498
+ create(value?: PartialMessage<ListApprovalTasksInboxResponse>): ListApprovalTasksInboxResponse {
499
+ const message = globalThis.Object.create((this.messagePrototype!));
500
+ message.tasks = [];
501
+ if (value !== undefined)
502
+ reflectionMergePartial<ListApprovalTasksInboxResponse>(this, message, value);
503
+ return message;
504
+ }
505
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListApprovalTasksInboxResponse): ListApprovalTasksInboxResponse {
506
+ let message = target ?? this.create(), end = reader.pos + length;
507
+ while (reader.pos < end) {
508
+ let [fieldNo, wireType] = reader.tag();
509
+ switch (fieldNo) {
510
+ case /* resources.common.database.PaginationResponse pagination */ 1:
511
+ message.pagination = PaginationResponse.internalBinaryRead(reader, reader.uint32(), options, message.pagination);
512
+ break;
513
+ case /* repeated resources.documents.approval.ApprovalTask tasks */ 2:
514
+ message.tasks.push(ApprovalTask.internalBinaryRead(reader, reader.uint32(), options));
515
+ break;
516
+ default:
517
+ let u = options.readUnknownField;
518
+ if (u === "throw")
519
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
520
+ let d = reader.skip(wireType);
521
+ if (u !== false)
522
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
523
+ }
524
+ }
525
+ return message;
526
+ }
527
+ internalBinaryWrite(message: ListApprovalTasksInboxResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
528
+ /* resources.common.database.PaginationResponse pagination = 1; */
529
+ if (message.pagination)
530
+ PaginationResponse.internalBinaryWrite(message.pagination, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
531
+ /* repeated resources.documents.approval.ApprovalTask tasks = 2; */
532
+ for (let i = 0; i < message.tasks.length; i++)
533
+ ApprovalTask.internalBinaryWrite(message.tasks[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
534
+ let u = options.writeUnknownFields;
535
+ if (u !== false)
536
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
537
+ return writer;
538
+ }
539
+ }
540
+ /**
541
+ * @generated MessageType for protobuf message services.documents.ListApprovalTasksInboxResponse
542
+ */
543
+ export const ListApprovalTasksInboxResponse = new ListApprovalTasksInboxResponse$Type();
544
+ // @generated message type with reflection information, may provide speed optimized methods
545
+ class ListApprovalPoliciesRequest$Type extends MessageType<ListApprovalPoliciesRequest> {
546
+ constructor() {
547
+ super("services.documents.ListApprovalPoliciesRequest", [
548
+ { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } }
549
+ ]);
550
+ }
551
+ create(value?: PartialMessage<ListApprovalPoliciesRequest>): ListApprovalPoliciesRequest {
552
+ const message = globalThis.Object.create((this.messagePrototype!));
553
+ message.documentId = 0;
554
+ if (value !== undefined)
555
+ reflectionMergePartial<ListApprovalPoliciesRequest>(this, message, value);
556
+ return message;
557
+ }
558
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListApprovalPoliciesRequest): ListApprovalPoliciesRequest {
559
+ let message = target ?? this.create(), end = reader.pos + length;
560
+ while (reader.pos < end) {
561
+ let [fieldNo, wireType] = reader.tag();
562
+ switch (fieldNo) {
563
+ case /* int64 document_id */ 1:
564
+ message.documentId = reader.int64().toNumber();
565
+ break;
566
+ default:
567
+ let u = options.readUnknownField;
568
+ if (u === "throw")
569
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
570
+ let d = reader.skip(wireType);
571
+ if (u !== false)
572
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
573
+ }
574
+ }
575
+ return message;
576
+ }
577
+ internalBinaryWrite(message: ListApprovalPoliciesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
578
+ /* int64 document_id = 1; */
579
+ if (message.documentId !== 0)
580
+ writer.tag(1, WireType.Varint).int64(message.documentId);
581
+ let u = options.writeUnknownFields;
582
+ if (u !== false)
583
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
584
+ return writer;
585
+ }
586
+ }
587
+ /**
588
+ * @generated MessageType for protobuf message services.documents.ListApprovalPoliciesRequest
589
+ */
590
+ export const ListApprovalPoliciesRequest = new ListApprovalPoliciesRequest$Type();
591
+ // @generated message type with reflection information, may provide speed optimized methods
592
+ class ListApprovalPoliciesResponse$Type extends MessageType<ListApprovalPoliciesResponse> {
593
+ constructor() {
594
+ super("services.documents.ListApprovalPoliciesResponse", [
595
+ { no: 1, name: "policy", kind: "message", T: () => ApprovalPolicy },
596
+ { no: 2, name: "doc_meta", kind: "message", T: () => DocumentMeta }
597
+ ]);
598
+ }
599
+ create(value?: PartialMessage<ListApprovalPoliciesResponse>): ListApprovalPoliciesResponse {
600
+ const message = globalThis.Object.create((this.messagePrototype!));
601
+ if (value !== undefined)
602
+ reflectionMergePartial<ListApprovalPoliciesResponse>(this, message, value);
603
+ return message;
604
+ }
605
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListApprovalPoliciesResponse): ListApprovalPoliciesResponse {
606
+ let message = target ?? this.create(), end = reader.pos + length;
607
+ while (reader.pos < end) {
608
+ let [fieldNo, wireType] = reader.tag();
609
+ switch (fieldNo) {
610
+ case /* resources.documents.approval.ApprovalPolicy policy */ 1:
611
+ message.policy = ApprovalPolicy.internalBinaryRead(reader, reader.uint32(), options, message.policy);
612
+ break;
613
+ case /* resources.documents.DocumentMeta doc_meta */ 2:
614
+ message.docMeta = DocumentMeta.internalBinaryRead(reader, reader.uint32(), options, message.docMeta);
615
+ break;
616
+ default:
617
+ let u = options.readUnknownField;
618
+ if (u === "throw")
619
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
620
+ let d = reader.skip(wireType);
621
+ if (u !== false)
622
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
623
+ }
624
+ }
625
+ return message;
626
+ }
627
+ internalBinaryWrite(message: ListApprovalPoliciesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
628
+ /* resources.documents.approval.ApprovalPolicy policy = 1; */
629
+ if (message.policy)
630
+ ApprovalPolicy.internalBinaryWrite(message.policy, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
631
+ /* resources.documents.DocumentMeta doc_meta = 2; */
632
+ if (message.docMeta)
633
+ DocumentMeta.internalBinaryWrite(message.docMeta, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
634
+ let u = options.writeUnknownFields;
635
+ if (u !== false)
636
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
637
+ return writer;
638
+ }
639
+ }
640
+ /**
641
+ * @generated MessageType for protobuf message services.documents.ListApprovalPoliciesResponse
642
+ */
643
+ export const ListApprovalPoliciesResponse = new ListApprovalPoliciesResponse$Type();
644
+ // @generated message type with reflection information, may provide speed optimized methods
645
+ class UpsertApprovalPolicyRequest$Type extends MessageType<UpsertApprovalPolicyRequest> {
646
+ constructor() {
647
+ super("services.documents.UpsertApprovalPolicyRequest", [
648
+ { no: 1, name: "policy", kind: "message", T: () => ApprovalPolicy, options: { "buf.validate.field": { required: true } } }
649
+ ]);
650
+ }
651
+ create(value?: PartialMessage<UpsertApprovalPolicyRequest>): UpsertApprovalPolicyRequest {
652
+ const message = globalThis.Object.create((this.messagePrototype!));
653
+ if (value !== undefined)
654
+ reflectionMergePartial<UpsertApprovalPolicyRequest>(this, message, value);
655
+ return message;
656
+ }
657
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpsertApprovalPolicyRequest): UpsertApprovalPolicyRequest {
658
+ let message = target ?? this.create(), end = reader.pos + length;
659
+ while (reader.pos < end) {
660
+ let [fieldNo, wireType] = reader.tag();
661
+ switch (fieldNo) {
662
+ case /* resources.documents.approval.ApprovalPolicy policy */ 1:
663
+ message.policy = ApprovalPolicy.internalBinaryRead(reader, reader.uint32(), options, message.policy);
664
+ break;
665
+ default:
666
+ let u = options.readUnknownField;
667
+ if (u === "throw")
668
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
669
+ let d = reader.skip(wireType);
670
+ if (u !== false)
671
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
672
+ }
673
+ }
674
+ return message;
675
+ }
676
+ internalBinaryWrite(message: UpsertApprovalPolicyRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
677
+ /* resources.documents.approval.ApprovalPolicy policy = 1; */
678
+ if (message.policy)
679
+ ApprovalPolicy.internalBinaryWrite(message.policy, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
680
+ let u = options.writeUnknownFields;
681
+ if (u !== false)
682
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
683
+ return writer;
684
+ }
685
+ }
686
+ /**
687
+ * @generated MessageType for protobuf message services.documents.UpsertApprovalPolicyRequest
688
+ */
689
+ export const UpsertApprovalPolicyRequest = new UpsertApprovalPolicyRequest$Type();
690
+ // @generated message type with reflection information, may provide speed optimized methods
691
+ class UpsertApprovalPolicyResponse$Type extends MessageType<UpsertApprovalPolicyResponse> {
692
+ constructor() {
693
+ super("services.documents.UpsertApprovalPolicyResponse", [
694
+ { no: 1, name: "policy", kind: "message", T: () => ApprovalPolicy },
695
+ { no: 2, name: "doc_meta", kind: "message", T: () => DocumentMeta }
696
+ ]);
697
+ }
698
+ create(value?: PartialMessage<UpsertApprovalPolicyResponse>): UpsertApprovalPolicyResponse {
699
+ const message = globalThis.Object.create((this.messagePrototype!));
700
+ if (value !== undefined)
701
+ reflectionMergePartial<UpsertApprovalPolicyResponse>(this, message, value);
702
+ return message;
703
+ }
704
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpsertApprovalPolicyResponse): UpsertApprovalPolicyResponse {
705
+ let message = target ?? this.create(), end = reader.pos + length;
706
+ while (reader.pos < end) {
707
+ let [fieldNo, wireType] = reader.tag();
708
+ switch (fieldNo) {
709
+ case /* resources.documents.approval.ApprovalPolicy policy */ 1:
710
+ message.policy = ApprovalPolicy.internalBinaryRead(reader, reader.uint32(), options, message.policy);
711
+ break;
712
+ case /* resources.documents.DocumentMeta doc_meta */ 2:
713
+ message.docMeta = DocumentMeta.internalBinaryRead(reader, reader.uint32(), options, message.docMeta);
714
+ break;
715
+ default:
716
+ let u = options.readUnknownField;
717
+ if (u === "throw")
718
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
719
+ let d = reader.skip(wireType);
720
+ if (u !== false)
721
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
722
+ }
723
+ }
724
+ return message;
725
+ }
726
+ internalBinaryWrite(message: UpsertApprovalPolicyResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
727
+ /* resources.documents.approval.ApprovalPolicy policy = 1; */
728
+ if (message.policy)
729
+ ApprovalPolicy.internalBinaryWrite(message.policy, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
730
+ /* resources.documents.DocumentMeta doc_meta = 2; */
731
+ if (message.docMeta)
732
+ DocumentMeta.internalBinaryWrite(message.docMeta, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
733
+ let u = options.writeUnknownFields;
734
+ if (u !== false)
735
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
736
+ return writer;
737
+ }
738
+ }
739
+ /**
740
+ * @generated MessageType for protobuf message services.documents.UpsertApprovalPolicyResponse
741
+ */
742
+ export const UpsertApprovalPolicyResponse = new UpsertApprovalPolicyResponse$Type();
743
+ // @generated message type with reflection information, may provide speed optimized methods
744
+ class ListApprovalTasksRequest$Type extends MessageType<ListApprovalTasksRequest> {
745
+ constructor() {
746
+ super("services.documents.ListApprovalTasksRequest", [
747
+ { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
748
+ { no: 2, name: "statuses", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["resources.documents.approval.ApprovalTaskStatus", ApprovalTaskStatus, "APPROVAL_TASK_STATUS_"], options: { "buf.validate.field": { repeated: { maxItems: "4" } } } }
749
+ ]);
750
+ }
751
+ create(value?: PartialMessage<ListApprovalTasksRequest>): ListApprovalTasksRequest {
752
+ const message = globalThis.Object.create((this.messagePrototype!));
753
+ message.documentId = 0;
754
+ message.statuses = [];
755
+ if (value !== undefined)
756
+ reflectionMergePartial<ListApprovalTasksRequest>(this, message, value);
757
+ return message;
758
+ }
759
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListApprovalTasksRequest): ListApprovalTasksRequest {
760
+ let message = target ?? this.create(), end = reader.pos + length;
761
+ while (reader.pos < end) {
762
+ let [fieldNo, wireType] = reader.tag();
763
+ switch (fieldNo) {
764
+ case /* int64 document_id */ 1:
765
+ message.documentId = reader.int64().toNumber();
766
+ break;
767
+ case /* repeated resources.documents.approval.ApprovalTaskStatus statuses */ 2:
768
+ if (wireType === WireType.LengthDelimited)
769
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
770
+ message.statuses.push(reader.int32());
771
+ else
772
+ message.statuses.push(reader.int32());
773
+ break;
774
+ default:
775
+ let u = options.readUnknownField;
776
+ if (u === "throw")
777
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
778
+ let d = reader.skip(wireType);
779
+ if (u !== false)
780
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
781
+ }
782
+ }
783
+ return message;
784
+ }
785
+ internalBinaryWrite(message: ListApprovalTasksRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
786
+ /* int64 document_id = 1; */
787
+ if (message.documentId !== 0)
788
+ writer.tag(1, WireType.Varint).int64(message.documentId);
789
+ /* repeated resources.documents.approval.ApprovalTaskStatus statuses = 2; */
790
+ if (message.statuses.length) {
791
+ writer.tag(2, WireType.LengthDelimited).fork();
792
+ for (let i = 0; i < message.statuses.length; i++)
793
+ writer.int32(message.statuses[i]);
794
+ writer.join();
795
+ }
796
+ let u = options.writeUnknownFields;
797
+ if (u !== false)
798
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
799
+ return writer;
800
+ }
801
+ }
802
+ /**
803
+ * @generated MessageType for protobuf message services.documents.ListApprovalTasksRequest
804
+ */
805
+ export const ListApprovalTasksRequest = new ListApprovalTasksRequest$Type();
806
+ // @generated message type with reflection information, may provide speed optimized methods
807
+ class ListApprovalTasksResponse$Type extends MessageType<ListApprovalTasksResponse> {
808
+ constructor() {
809
+ super("services.documents.ListApprovalTasksResponse", [
810
+ { no: 1, name: "tasks", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ApprovalTask, options: { "codegen.itemslen.enabled": true } }
811
+ ]);
812
+ }
813
+ create(value?: PartialMessage<ListApprovalTasksResponse>): ListApprovalTasksResponse {
814
+ const message = globalThis.Object.create((this.messagePrototype!));
815
+ message.tasks = [];
816
+ if (value !== undefined)
817
+ reflectionMergePartial<ListApprovalTasksResponse>(this, message, value);
818
+ return message;
819
+ }
820
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListApprovalTasksResponse): ListApprovalTasksResponse {
821
+ let message = target ?? this.create(), end = reader.pos + length;
822
+ while (reader.pos < end) {
823
+ let [fieldNo, wireType] = reader.tag();
824
+ switch (fieldNo) {
825
+ case /* repeated resources.documents.approval.ApprovalTask tasks */ 1:
826
+ message.tasks.push(ApprovalTask.internalBinaryRead(reader, reader.uint32(), options));
827
+ break;
828
+ default:
829
+ let u = options.readUnknownField;
830
+ if (u === "throw")
831
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
832
+ let d = reader.skip(wireType);
833
+ if (u !== false)
834
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
835
+ }
836
+ }
837
+ return message;
838
+ }
839
+ internalBinaryWrite(message: ListApprovalTasksResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
840
+ /* repeated resources.documents.approval.ApprovalTask tasks = 1; */
841
+ for (let i = 0; i < message.tasks.length; i++)
842
+ ApprovalTask.internalBinaryWrite(message.tasks[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
843
+ let u = options.writeUnknownFields;
844
+ if (u !== false)
845
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
846
+ return writer;
847
+ }
848
+ }
849
+ /**
850
+ * @generated MessageType for protobuf message services.documents.ListApprovalTasksResponse
851
+ */
852
+ export const ListApprovalTasksResponse = new ListApprovalTasksResponse$Type();
853
+ // @generated message type with reflection information, may provide speed optimized methods
854
+ class ApprovalTaskSeed$Type extends MessageType<ApprovalTaskSeed> {
855
+ constructor() {
856
+ super("services.documents.ApprovalTaskSeed", [
857
+ { no: 1, name: "user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
858
+ { no: 2, name: "job", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
859
+ { no: 3, name: "minimum_grade", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
860
+ { no: 4, name: "label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "120" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
861
+ { no: 5, name: "signature_required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
862
+ { no: 6, name: "slots", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { lte: 5, gte: 1 } } } },
863
+ { no: 7, name: "due_at", kind: "message", T: () => Timestamp },
864
+ { no: 8, name: "comment", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
865
+ ]);
866
+ }
867
+ create(value?: PartialMessage<ApprovalTaskSeed>): ApprovalTaskSeed {
868
+ const message = globalThis.Object.create((this.messagePrototype!));
869
+ message.userId = 0;
870
+ message.job = "";
871
+ message.minimumGrade = 0;
872
+ message.signatureRequired = false;
873
+ message.slots = 0;
874
+ if (value !== undefined)
875
+ reflectionMergePartial<ApprovalTaskSeed>(this, message, value);
876
+ return message;
877
+ }
878
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ApprovalTaskSeed): ApprovalTaskSeed {
879
+ let message = target ?? this.create(), end = reader.pos + length;
880
+ while (reader.pos < end) {
881
+ let [fieldNo, wireType] = reader.tag();
882
+ switch (fieldNo) {
883
+ case /* int32 user_id */ 1:
884
+ message.userId = reader.int32();
885
+ break;
886
+ case /* string job */ 2:
887
+ message.job = reader.string();
888
+ break;
889
+ case /* int32 minimum_grade */ 3:
890
+ message.minimumGrade = reader.int32();
891
+ break;
892
+ case /* optional string label */ 4:
893
+ message.label = reader.string();
894
+ break;
895
+ case /* bool signature_required */ 5:
896
+ message.signatureRequired = reader.bool();
897
+ break;
898
+ case /* int32 slots */ 6:
899
+ message.slots = reader.int32();
900
+ break;
901
+ case /* optional resources.timestamp.Timestamp due_at */ 7:
902
+ message.dueAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.dueAt);
903
+ break;
904
+ case /* optional string comment */ 8:
905
+ message.comment = reader.string();
906
+ break;
907
+ default:
908
+ let u = options.readUnknownField;
909
+ if (u === "throw")
910
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
911
+ let d = reader.skip(wireType);
912
+ if (u !== false)
913
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
914
+ }
915
+ }
916
+ return message;
917
+ }
918
+ internalBinaryWrite(message: ApprovalTaskSeed, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
919
+ /* int32 user_id = 1; */
920
+ if (message.userId !== 0)
921
+ writer.tag(1, WireType.Varint).int32(message.userId);
922
+ /* string job = 2; */
923
+ if (message.job !== "")
924
+ writer.tag(2, WireType.LengthDelimited).string(message.job);
925
+ /* int32 minimum_grade = 3; */
926
+ if (message.minimumGrade !== 0)
927
+ writer.tag(3, WireType.Varint).int32(message.minimumGrade);
928
+ /* optional string label = 4; */
929
+ if (message.label !== undefined)
930
+ writer.tag(4, WireType.LengthDelimited).string(message.label);
931
+ /* bool signature_required = 5; */
932
+ if (message.signatureRequired !== false)
933
+ writer.tag(5, WireType.Varint).bool(message.signatureRequired);
934
+ /* int32 slots = 6; */
935
+ if (message.slots !== 0)
936
+ writer.tag(6, WireType.Varint).int32(message.slots);
937
+ /* optional resources.timestamp.Timestamp due_at = 7; */
938
+ if (message.dueAt)
939
+ Timestamp.internalBinaryWrite(message.dueAt, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
940
+ /* optional string comment = 8; */
941
+ if (message.comment !== undefined)
942
+ writer.tag(8, WireType.LengthDelimited).string(message.comment);
943
+ let u = options.writeUnknownFields;
944
+ if (u !== false)
945
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
946
+ return writer;
947
+ }
948
+ }
949
+ /**
950
+ * @generated MessageType for protobuf message services.documents.ApprovalTaskSeed
951
+ */
952
+ export const ApprovalTaskSeed = new ApprovalTaskSeed$Type();
953
+ // @generated message type with reflection information, may provide speed optimized methods
954
+ class UpsertApprovalTasksRequest$Type extends MessageType<UpsertApprovalTasksRequest> {
955
+ constructor() {
956
+ super("services.documents.UpsertApprovalTasksRequest", [
957
+ { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
958
+ { no: 2, name: "snapshot_date", kind: "message", T: () => Timestamp },
959
+ { no: 3, name: "seeds", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ApprovalTaskSeed }
960
+ ]);
961
+ }
962
+ create(value?: PartialMessage<UpsertApprovalTasksRequest>): UpsertApprovalTasksRequest {
963
+ const message = globalThis.Object.create((this.messagePrototype!));
964
+ message.documentId = 0;
965
+ message.seeds = [];
966
+ if (value !== undefined)
967
+ reflectionMergePartial<UpsertApprovalTasksRequest>(this, message, value);
968
+ return message;
969
+ }
970
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpsertApprovalTasksRequest): UpsertApprovalTasksRequest {
971
+ let message = target ?? this.create(), end = reader.pos + length;
972
+ while (reader.pos < end) {
973
+ let [fieldNo, wireType] = reader.tag();
974
+ switch (fieldNo) {
975
+ case /* int64 document_id */ 1:
976
+ message.documentId = reader.int64().toNumber();
977
+ break;
978
+ case /* optional resources.timestamp.Timestamp snapshot_date */ 2:
979
+ message.snapshotDate = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.snapshotDate);
980
+ break;
981
+ case /* repeated services.documents.ApprovalTaskSeed seeds */ 3:
982
+ message.seeds.push(ApprovalTaskSeed.internalBinaryRead(reader, reader.uint32(), options));
983
+ break;
984
+ default:
985
+ let u = options.readUnknownField;
986
+ if (u === "throw")
987
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
988
+ let d = reader.skip(wireType);
989
+ if (u !== false)
990
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
991
+ }
992
+ }
993
+ return message;
994
+ }
995
+ internalBinaryWrite(message: UpsertApprovalTasksRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
996
+ /* int64 document_id = 1; */
997
+ if (message.documentId !== 0)
998
+ writer.tag(1, WireType.Varint).int64(message.documentId);
999
+ /* optional resources.timestamp.Timestamp snapshot_date = 2; */
1000
+ if (message.snapshotDate)
1001
+ Timestamp.internalBinaryWrite(message.snapshotDate, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1002
+ /* repeated services.documents.ApprovalTaskSeed seeds = 3; */
1003
+ for (let i = 0; i < message.seeds.length; i++)
1004
+ ApprovalTaskSeed.internalBinaryWrite(message.seeds[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1005
+ let u = options.writeUnknownFields;
1006
+ if (u !== false)
1007
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1008
+ return writer;
1009
+ }
1010
+ }
1011
+ /**
1012
+ * @generated MessageType for protobuf message services.documents.UpsertApprovalTasksRequest
1013
+ */
1014
+ export const UpsertApprovalTasksRequest = new UpsertApprovalTasksRequest$Type();
1015
+ // @generated message type with reflection information, may provide speed optimized methods
1016
+ class UpsertApprovalTasksResponse$Type extends MessageType<UpsertApprovalTasksResponse> {
1017
+ constructor() {
1018
+ super("services.documents.UpsertApprovalTasksResponse", [
1019
+ { no: 1, name: "tasks_created", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
1020
+ { no: 2, name: "tasks_ensured", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
1021
+ { no: 3, name: "policy", kind: "message", T: () => ApprovalPolicy }
1022
+ ]);
1023
+ }
1024
+ create(value?: PartialMessage<UpsertApprovalTasksResponse>): UpsertApprovalTasksResponse {
1025
+ const message = globalThis.Object.create((this.messagePrototype!));
1026
+ message.tasksCreated = 0;
1027
+ message.tasksEnsured = 0;
1028
+ if (value !== undefined)
1029
+ reflectionMergePartial<UpsertApprovalTasksResponse>(this, message, value);
1030
+ return message;
1031
+ }
1032
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpsertApprovalTasksResponse): UpsertApprovalTasksResponse {
1033
+ let message = target ?? this.create(), end = reader.pos + length;
1034
+ while (reader.pos < end) {
1035
+ let [fieldNo, wireType] = reader.tag();
1036
+ switch (fieldNo) {
1037
+ case /* int32 tasks_created */ 1:
1038
+ message.tasksCreated = reader.int32();
1039
+ break;
1040
+ case /* int32 tasks_ensured */ 2:
1041
+ message.tasksEnsured = reader.int32();
1042
+ break;
1043
+ case /* resources.documents.approval.ApprovalPolicy policy */ 3:
1044
+ message.policy = ApprovalPolicy.internalBinaryRead(reader, reader.uint32(), options, message.policy);
1045
+ break;
1046
+ default:
1047
+ let u = options.readUnknownField;
1048
+ if (u === "throw")
1049
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1050
+ let d = reader.skip(wireType);
1051
+ if (u !== false)
1052
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1053
+ }
1054
+ }
1055
+ return message;
1056
+ }
1057
+ internalBinaryWrite(message: UpsertApprovalTasksResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1058
+ /* int32 tasks_created = 1; */
1059
+ if (message.tasksCreated !== 0)
1060
+ writer.tag(1, WireType.Varint).int32(message.tasksCreated);
1061
+ /* int32 tasks_ensured = 2; */
1062
+ if (message.tasksEnsured !== 0)
1063
+ writer.tag(2, WireType.Varint).int32(message.tasksEnsured);
1064
+ /* resources.documents.approval.ApprovalPolicy policy = 3; */
1065
+ if (message.policy)
1066
+ ApprovalPolicy.internalBinaryWrite(message.policy, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1067
+ let u = options.writeUnknownFields;
1068
+ if (u !== false)
1069
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1070
+ return writer;
1071
+ }
1072
+ }
1073
+ /**
1074
+ * @generated MessageType for protobuf message services.documents.UpsertApprovalTasksResponse
1075
+ */
1076
+ export const UpsertApprovalTasksResponse = new UpsertApprovalTasksResponse$Type();
1077
+ // @generated message type with reflection information, may provide speed optimized methods
1078
+ class DeleteApprovalTasksRequest$Type extends MessageType<DeleteApprovalTasksRequest> {
1079
+ constructor() {
1080
+ super("services.documents.DeleteApprovalTasksRequest", [
1081
+ { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
1082
+ { no: 2, name: "task_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { repeated: { minItems: "1" } } } },
1083
+ { no: 3, name: "delete_all_pending", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
1084
+ ]);
1085
+ }
1086
+ create(value?: PartialMessage<DeleteApprovalTasksRequest>): DeleteApprovalTasksRequest {
1087
+ const message = globalThis.Object.create((this.messagePrototype!));
1088
+ message.documentId = 0;
1089
+ message.taskIds = [];
1090
+ message.deleteAllPending = false;
1091
+ if (value !== undefined)
1092
+ reflectionMergePartial<DeleteApprovalTasksRequest>(this, message, value);
1093
+ return message;
1094
+ }
1095
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteApprovalTasksRequest): DeleteApprovalTasksRequest {
1096
+ let message = target ?? this.create(), end = reader.pos + length;
1097
+ while (reader.pos < end) {
1098
+ let [fieldNo, wireType] = reader.tag();
1099
+ switch (fieldNo) {
1100
+ case /* int64 document_id */ 1:
1101
+ message.documentId = reader.int64().toNumber();
1102
+ break;
1103
+ case /* repeated int64 task_ids */ 2:
1104
+ if (wireType === WireType.LengthDelimited)
1105
+ for (let e = reader.int32() + reader.pos; reader.pos < e;)
1106
+ message.taskIds.push(reader.int64().toNumber());
1107
+ else
1108
+ message.taskIds.push(reader.int64().toNumber());
1109
+ break;
1110
+ case /* bool delete_all_pending */ 3:
1111
+ message.deleteAllPending = reader.bool();
1112
+ break;
1113
+ default:
1114
+ let u = options.readUnknownField;
1115
+ if (u === "throw")
1116
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1117
+ let d = reader.skip(wireType);
1118
+ if (u !== false)
1119
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1120
+ }
1121
+ }
1122
+ return message;
1123
+ }
1124
+ internalBinaryWrite(message: DeleteApprovalTasksRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1125
+ /* int64 document_id = 1; */
1126
+ if (message.documentId !== 0)
1127
+ writer.tag(1, WireType.Varint).int64(message.documentId);
1128
+ /* repeated int64 task_ids = 2; */
1129
+ if (message.taskIds.length) {
1130
+ writer.tag(2, WireType.LengthDelimited).fork();
1131
+ for (let i = 0; i < message.taskIds.length; i++)
1132
+ writer.int64(message.taskIds[i]);
1133
+ writer.join();
1134
+ }
1135
+ /* bool delete_all_pending = 3; */
1136
+ if (message.deleteAllPending !== false)
1137
+ writer.tag(3, WireType.Varint).bool(message.deleteAllPending);
1138
+ let u = options.writeUnknownFields;
1139
+ if (u !== false)
1140
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1141
+ return writer;
1142
+ }
1143
+ }
1144
+ /**
1145
+ * @generated MessageType for protobuf message services.documents.DeleteApprovalTasksRequest
1146
+ */
1147
+ export const DeleteApprovalTasksRequest = new DeleteApprovalTasksRequest$Type();
1148
+ // @generated message type with reflection information, may provide speed optimized methods
1149
+ class DeleteApprovalTasksResponse$Type extends MessageType<DeleteApprovalTasksResponse> {
1150
+ constructor() {
1151
+ super("services.documents.DeleteApprovalTasksResponse", []);
1152
+ }
1153
+ create(value?: PartialMessage<DeleteApprovalTasksResponse>): DeleteApprovalTasksResponse {
1154
+ const message = globalThis.Object.create((this.messagePrototype!));
1155
+ if (value !== undefined)
1156
+ reflectionMergePartial<DeleteApprovalTasksResponse>(this, message, value);
1157
+ return message;
1158
+ }
1159
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteApprovalTasksResponse): DeleteApprovalTasksResponse {
1160
+ let message = target ?? this.create(), end = reader.pos + length;
1161
+ while (reader.pos < end) {
1162
+ let [fieldNo, wireType] = reader.tag();
1163
+ switch (fieldNo) {
1164
+ default:
1165
+ let u = options.readUnknownField;
1166
+ if (u === "throw")
1167
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1168
+ let d = reader.skip(wireType);
1169
+ if (u !== false)
1170
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1171
+ }
1172
+ }
1173
+ return message;
1174
+ }
1175
+ internalBinaryWrite(message: DeleteApprovalTasksResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1176
+ let u = options.writeUnknownFields;
1177
+ if (u !== false)
1178
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1179
+ return writer;
1180
+ }
1181
+ }
1182
+ /**
1183
+ * @generated MessageType for protobuf message services.documents.DeleteApprovalTasksResponse
1184
+ */
1185
+ export const DeleteApprovalTasksResponse = new DeleteApprovalTasksResponse$Type();
1186
+ // @generated message type with reflection information, may provide speed optimized methods
1187
+ class ListApprovalsRequest$Type extends MessageType<ListApprovalsRequest> {
1188
+ constructor() {
1189
+ super("services.documents.ListApprovalsRequest", [
1190
+ { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
1191
+ { no: 2, name: "task_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
1192
+ { no: 3, name: "snapshot_date", kind: "message", T: () => Timestamp },
1193
+ { no: 4, name: "status", kind: "enum", opt: true, T: () => ["resources.documents.approval.ApprovalStatus", ApprovalStatus, "APPROVAL_STATUS_"] },
1194
+ { no: 5, name: "user_id", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }
1195
+ ]);
1196
+ }
1197
+ create(value?: PartialMessage<ListApprovalsRequest>): ListApprovalsRequest {
1198
+ const message = globalThis.Object.create((this.messagePrototype!));
1199
+ message.documentId = 0;
1200
+ if (value !== undefined)
1201
+ reflectionMergePartial<ListApprovalsRequest>(this, message, value);
1202
+ return message;
1203
+ }
1204
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListApprovalsRequest): ListApprovalsRequest {
1205
+ let message = target ?? this.create(), end = reader.pos + length;
1206
+ while (reader.pos < end) {
1207
+ let [fieldNo, wireType] = reader.tag();
1208
+ switch (fieldNo) {
1209
+ case /* int64 document_id */ 1:
1210
+ message.documentId = reader.int64().toNumber();
1211
+ break;
1212
+ case /* optional int64 task_id */ 2:
1213
+ message.taskId = reader.int64().toNumber();
1214
+ break;
1215
+ case /* optional resources.timestamp.Timestamp snapshot_date */ 3:
1216
+ message.snapshotDate = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.snapshotDate);
1217
+ break;
1218
+ case /* optional resources.documents.approval.ApprovalStatus status */ 4:
1219
+ message.status = reader.int32();
1220
+ break;
1221
+ case /* optional int32 user_id */ 5:
1222
+ message.userId = reader.int32();
1223
+ break;
1224
+ default:
1225
+ let u = options.readUnknownField;
1226
+ if (u === "throw")
1227
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1228
+ let d = reader.skip(wireType);
1229
+ if (u !== false)
1230
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1231
+ }
1232
+ }
1233
+ return message;
1234
+ }
1235
+ internalBinaryWrite(message: ListApprovalsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1236
+ /* int64 document_id = 1; */
1237
+ if (message.documentId !== 0)
1238
+ writer.tag(1, WireType.Varint).int64(message.documentId);
1239
+ /* optional int64 task_id = 2; */
1240
+ if (message.taskId !== undefined)
1241
+ writer.tag(2, WireType.Varint).int64(message.taskId);
1242
+ /* optional resources.timestamp.Timestamp snapshot_date = 3; */
1243
+ if (message.snapshotDate)
1244
+ Timestamp.internalBinaryWrite(message.snapshotDate, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1245
+ /* optional resources.documents.approval.ApprovalStatus status = 4; */
1246
+ if (message.status !== undefined)
1247
+ writer.tag(4, WireType.Varint).int32(message.status);
1248
+ /* optional int32 user_id = 5; */
1249
+ if (message.userId !== undefined)
1250
+ writer.tag(5, WireType.Varint).int32(message.userId);
1251
+ let u = options.writeUnknownFields;
1252
+ if (u !== false)
1253
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1254
+ return writer;
1255
+ }
1256
+ }
1257
+ /**
1258
+ * @generated MessageType for protobuf message services.documents.ListApprovalsRequest
1259
+ */
1260
+ export const ListApprovalsRequest = new ListApprovalsRequest$Type();
1261
+ // @generated message type with reflection information, may provide speed optimized methods
1262
+ class ListApprovalsResponse$Type extends MessageType<ListApprovalsResponse> {
1263
+ constructor() {
1264
+ super("services.documents.ListApprovalsResponse", [
1265
+ { no: 3, name: "approvals", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Approval }
1266
+ ]);
1267
+ }
1268
+ create(value?: PartialMessage<ListApprovalsResponse>): ListApprovalsResponse {
1269
+ const message = globalThis.Object.create((this.messagePrototype!));
1270
+ message.approvals = [];
1271
+ if (value !== undefined)
1272
+ reflectionMergePartial<ListApprovalsResponse>(this, message, value);
1273
+ return message;
1274
+ }
1275
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListApprovalsResponse): ListApprovalsResponse {
1276
+ let message = target ?? this.create(), end = reader.pos + length;
1277
+ while (reader.pos < end) {
1278
+ let [fieldNo, wireType] = reader.tag();
1279
+ switch (fieldNo) {
1280
+ case /* repeated resources.documents.approval.Approval approvals */ 3:
1281
+ message.approvals.push(Approval.internalBinaryRead(reader, reader.uint32(), options));
1282
+ break;
1283
+ default:
1284
+ let u = options.readUnknownField;
1285
+ if (u === "throw")
1286
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1287
+ let d = reader.skip(wireType);
1288
+ if (u !== false)
1289
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1290
+ }
1291
+ }
1292
+ return message;
1293
+ }
1294
+ internalBinaryWrite(message: ListApprovalsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1295
+ /* repeated resources.documents.approval.Approval approvals = 3; */
1296
+ for (let i = 0; i < message.approvals.length; i++)
1297
+ Approval.internalBinaryWrite(message.approvals[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1298
+ let u = options.writeUnknownFields;
1299
+ if (u !== false)
1300
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1301
+ return writer;
1302
+ }
1303
+ }
1304
+ /**
1305
+ * @generated MessageType for protobuf message services.documents.ListApprovalsResponse
1306
+ */
1307
+ export const ListApprovalsResponse = new ListApprovalsResponse$Type();
1308
+ // @generated message type with reflection information, may provide speed optimized methods
1309
+ class RevokeApprovalRequest$Type extends MessageType<RevokeApprovalRequest> {
1310
+ constructor() {
1311
+ super("services.documents.RevokeApprovalRequest", [
1312
+ { no: 1, name: "approval_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
1313
+ { no: 2, name: "comment", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } } } }
1314
+ ]);
1315
+ }
1316
+ create(value?: PartialMessage<RevokeApprovalRequest>): RevokeApprovalRequest {
1317
+ const message = globalThis.Object.create((this.messagePrototype!));
1318
+ message.approvalId = 0;
1319
+ message.comment = "";
1320
+ if (value !== undefined)
1321
+ reflectionMergePartial<RevokeApprovalRequest>(this, message, value);
1322
+ return message;
1323
+ }
1324
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RevokeApprovalRequest): RevokeApprovalRequest {
1325
+ let message = target ?? this.create(), end = reader.pos + length;
1326
+ while (reader.pos < end) {
1327
+ let [fieldNo, wireType] = reader.tag();
1328
+ switch (fieldNo) {
1329
+ case /* int64 approval_id */ 1:
1330
+ message.approvalId = reader.int64().toNumber();
1331
+ break;
1332
+ case /* string comment */ 2:
1333
+ message.comment = reader.string();
1334
+ break;
1335
+ default:
1336
+ let u = options.readUnknownField;
1337
+ if (u === "throw")
1338
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1339
+ let d = reader.skip(wireType);
1340
+ if (u !== false)
1341
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1342
+ }
1343
+ }
1344
+ return message;
1345
+ }
1346
+ internalBinaryWrite(message: RevokeApprovalRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1347
+ /* int64 approval_id = 1; */
1348
+ if (message.approvalId !== 0)
1349
+ writer.tag(1, WireType.Varint).int64(message.approvalId);
1350
+ /* string comment = 2; */
1351
+ if (message.comment !== "")
1352
+ writer.tag(2, WireType.LengthDelimited).string(message.comment);
1353
+ let u = options.writeUnknownFields;
1354
+ if (u !== false)
1355
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1356
+ return writer;
1357
+ }
1358
+ }
1359
+ /**
1360
+ * @generated MessageType for protobuf message services.documents.RevokeApprovalRequest
1361
+ */
1362
+ export const RevokeApprovalRequest = new RevokeApprovalRequest$Type();
1363
+ // @generated message type with reflection information, may provide speed optimized methods
1364
+ class RevokeApprovalResponse$Type extends MessageType<RevokeApprovalResponse> {
1365
+ constructor() {
1366
+ super("services.documents.RevokeApprovalResponse", [
1367
+ { no: 1, name: "approval", kind: "message", T: () => Approval }
1368
+ ]);
1369
+ }
1370
+ create(value?: PartialMessage<RevokeApprovalResponse>): RevokeApprovalResponse {
1371
+ const message = globalThis.Object.create((this.messagePrototype!));
1372
+ if (value !== undefined)
1373
+ reflectionMergePartial<RevokeApprovalResponse>(this, message, value);
1374
+ return message;
1375
+ }
1376
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RevokeApprovalResponse): RevokeApprovalResponse {
1377
+ let message = target ?? this.create(), end = reader.pos + length;
1378
+ while (reader.pos < end) {
1379
+ let [fieldNo, wireType] = reader.tag();
1380
+ switch (fieldNo) {
1381
+ case /* resources.documents.approval.Approval approval */ 1:
1382
+ message.approval = Approval.internalBinaryRead(reader, reader.uint32(), options, message.approval);
1383
+ break;
1384
+ default:
1385
+ let u = options.readUnknownField;
1386
+ if (u === "throw")
1387
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1388
+ let d = reader.skip(wireType);
1389
+ if (u !== false)
1390
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1391
+ }
1392
+ }
1393
+ return message;
1394
+ }
1395
+ internalBinaryWrite(message: RevokeApprovalResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1396
+ /* resources.documents.approval.Approval approval = 1; */
1397
+ if (message.approval)
1398
+ Approval.internalBinaryWrite(message.approval, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1399
+ let u = options.writeUnknownFields;
1400
+ if (u !== false)
1401
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1402
+ return writer;
1403
+ }
1404
+ }
1405
+ /**
1406
+ * @generated MessageType for protobuf message services.documents.RevokeApprovalResponse
1407
+ */
1408
+ export const RevokeApprovalResponse = new RevokeApprovalResponse$Type();
1409
+ // @generated message type with reflection information, may provide speed optimized methods
1410
+ class DecideApprovalRequest$Type extends MessageType<DecideApprovalRequest> {
1411
+ constructor() {
1412
+ super("services.documents.DecideApprovalRequest", [
1413
+ { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
1414
+ { no: 2, name: "task_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
1415
+ { no: 3, name: "new_status", kind: "enum", T: () => ["resources.documents.approval.ApprovalTaskStatus", ApprovalTaskStatus, "APPROVAL_TASK_STATUS_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } },
1416
+ { no: 4, name: "comment", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "500" } } } },
1417
+ { no: 5, name: "payload_svg", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "codegen.sanitizer.sanitizer": { enabled: true, method: "SanitizeSVG" } } },
1418
+ { no: 6, name: "stamp_id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }
1419
+ ]);
1420
+ }
1421
+ create(value?: PartialMessage<DecideApprovalRequest>): DecideApprovalRequest {
1422
+ const message = globalThis.Object.create((this.messagePrototype!));
1423
+ message.documentId = 0;
1424
+ message.newStatus = 0;
1425
+ message.comment = "";
1426
+ if (value !== undefined)
1427
+ reflectionMergePartial<DecideApprovalRequest>(this, message, value);
1428
+ return message;
1429
+ }
1430
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DecideApprovalRequest): DecideApprovalRequest {
1431
+ let message = target ?? this.create(), end = reader.pos + length;
1432
+ while (reader.pos < end) {
1433
+ let [fieldNo, wireType] = reader.tag();
1434
+ switch (fieldNo) {
1435
+ case /* int64 document_id */ 1:
1436
+ message.documentId = reader.int64().toNumber();
1437
+ break;
1438
+ case /* optional int64 task_id */ 2:
1439
+ message.taskId = reader.int64().toNumber();
1440
+ break;
1441
+ case /* resources.documents.approval.ApprovalTaskStatus new_status */ 3:
1442
+ message.newStatus = reader.int32();
1443
+ break;
1444
+ case /* string comment */ 4:
1445
+ message.comment = reader.string();
1446
+ break;
1447
+ case /* optional string payload_svg */ 5:
1448
+ message.payloadSvg = reader.string();
1449
+ break;
1450
+ case /* optional int64 stamp_id */ 6:
1451
+ message.stampId = reader.int64().toNumber();
1452
+ break;
1453
+ default:
1454
+ let u = options.readUnknownField;
1455
+ if (u === "throw")
1456
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1457
+ let d = reader.skip(wireType);
1458
+ if (u !== false)
1459
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1460
+ }
1461
+ }
1462
+ return message;
1463
+ }
1464
+ internalBinaryWrite(message: DecideApprovalRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1465
+ /* int64 document_id = 1; */
1466
+ if (message.documentId !== 0)
1467
+ writer.tag(1, WireType.Varint).int64(message.documentId);
1468
+ /* optional int64 task_id = 2; */
1469
+ if (message.taskId !== undefined)
1470
+ writer.tag(2, WireType.Varint).int64(message.taskId);
1471
+ /* resources.documents.approval.ApprovalTaskStatus new_status = 3; */
1472
+ if (message.newStatus !== 0)
1473
+ writer.tag(3, WireType.Varint).int32(message.newStatus);
1474
+ /* string comment = 4; */
1475
+ if (message.comment !== "")
1476
+ writer.tag(4, WireType.LengthDelimited).string(message.comment);
1477
+ /* optional string payload_svg = 5; */
1478
+ if (message.payloadSvg !== undefined)
1479
+ writer.tag(5, WireType.LengthDelimited).string(message.payloadSvg);
1480
+ /* optional int64 stamp_id = 6; */
1481
+ if (message.stampId !== undefined)
1482
+ writer.tag(6, WireType.Varint).int64(message.stampId);
1483
+ let u = options.writeUnknownFields;
1484
+ if (u !== false)
1485
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1486
+ return writer;
1487
+ }
1488
+ }
1489
+ /**
1490
+ * @generated MessageType for protobuf message services.documents.DecideApprovalRequest
1491
+ */
1492
+ export const DecideApprovalRequest = new DecideApprovalRequest$Type();
1493
+ // @generated message type with reflection information, may provide speed optimized methods
1494
+ class DecideApprovalResponse$Type extends MessageType<DecideApprovalResponse> {
1495
+ constructor() {
1496
+ super("services.documents.DecideApprovalResponse", [
1497
+ { no: 1, name: "approval", kind: "message", T: () => Approval },
1498
+ { no: 2, name: "task", kind: "message", T: () => ApprovalTask },
1499
+ { no: 3, name: "policy", kind: "message", T: () => ApprovalPolicy },
1500
+ { no: 4, name: "doc_meta", kind: "message", T: () => DocumentMeta }
1501
+ ]);
1502
+ }
1503
+ create(value?: PartialMessage<DecideApprovalResponse>): DecideApprovalResponse {
1504
+ const message = globalThis.Object.create((this.messagePrototype!));
1505
+ if (value !== undefined)
1506
+ reflectionMergePartial<DecideApprovalResponse>(this, message, value);
1507
+ return message;
1508
+ }
1509
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DecideApprovalResponse): DecideApprovalResponse {
1510
+ let message = target ?? this.create(), end = reader.pos + length;
1511
+ while (reader.pos < end) {
1512
+ let [fieldNo, wireType] = reader.tag();
1513
+ switch (fieldNo) {
1514
+ case /* resources.documents.approval.Approval approval */ 1:
1515
+ message.approval = Approval.internalBinaryRead(reader, reader.uint32(), options, message.approval);
1516
+ break;
1517
+ case /* resources.documents.approval.ApprovalTask task */ 2:
1518
+ message.task = ApprovalTask.internalBinaryRead(reader, reader.uint32(), options, message.task);
1519
+ break;
1520
+ case /* resources.documents.approval.ApprovalPolicy policy */ 3:
1521
+ message.policy = ApprovalPolicy.internalBinaryRead(reader, reader.uint32(), options, message.policy);
1522
+ break;
1523
+ case /* resources.documents.DocumentMeta doc_meta */ 4:
1524
+ message.docMeta = DocumentMeta.internalBinaryRead(reader, reader.uint32(), options, message.docMeta);
1525
+ break;
1526
+ default:
1527
+ let u = options.readUnknownField;
1528
+ if (u === "throw")
1529
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1530
+ let d = reader.skip(wireType);
1531
+ if (u !== false)
1532
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1533
+ }
1534
+ }
1535
+ return message;
1536
+ }
1537
+ internalBinaryWrite(message: DecideApprovalResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1538
+ /* resources.documents.approval.Approval approval = 1; */
1539
+ if (message.approval)
1540
+ Approval.internalBinaryWrite(message.approval, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1541
+ /* resources.documents.approval.ApprovalTask task = 2; */
1542
+ if (message.task)
1543
+ ApprovalTask.internalBinaryWrite(message.task, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1544
+ /* resources.documents.approval.ApprovalPolicy policy = 3; */
1545
+ if (message.policy)
1546
+ ApprovalPolicy.internalBinaryWrite(message.policy, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1547
+ /* resources.documents.DocumentMeta doc_meta = 4; */
1548
+ if (message.docMeta)
1549
+ DocumentMeta.internalBinaryWrite(message.docMeta, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
1550
+ let u = options.writeUnknownFields;
1551
+ if (u !== false)
1552
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1553
+ return writer;
1554
+ }
1555
+ }
1556
+ /**
1557
+ * @generated MessageType for protobuf message services.documents.DecideApprovalResponse
1558
+ */
1559
+ export const DecideApprovalResponse = new DecideApprovalResponse$Type();
1560
+ // @generated message type with reflection information, may provide speed optimized methods
1561
+ class ReopenApprovalTaskRequest$Type extends MessageType<ReopenApprovalTaskRequest> {
1562
+ constructor() {
1563
+ super("services.documents.ReopenApprovalTaskRequest", [
1564
+ { no: 1, name: "task_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
1565
+ { no: 2, name: "comment", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } } } }
1566
+ ]);
1567
+ }
1568
+ create(value?: PartialMessage<ReopenApprovalTaskRequest>): ReopenApprovalTaskRequest {
1569
+ const message = globalThis.Object.create((this.messagePrototype!));
1570
+ message.taskId = 0;
1571
+ message.comment = "";
1572
+ if (value !== undefined)
1573
+ reflectionMergePartial<ReopenApprovalTaskRequest>(this, message, value);
1574
+ return message;
1575
+ }
1576
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReopenApprovalTaskRequest): ReopenApprovalTaskRequest {
1577
+ let message = target ?? this.create(), end = reader.pos + length;
1578
+ while (reader.pos < end) {
1579
+ let [fieldNo, wireType] = reader.tag();
1580
+ switch (fieldNo) {
1581
+ case /* int64 task_id */ 1:
1582
+ message.taskId = reader.int64().toNumber();
1583
+ break;
1584
+ case /* string comment */ 2:
1585
+ message.comment = reader.string();
1586
+ break;
1587
+ default:
1588
+ let u = options.readUnknownField;
1589
+ if (u === "throw")
1590
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1591
+ let d = reader.skip(wireType);
1592
+ if (u !== false)
1593
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1594
+ }
1595
+ }
1596
+ return message;
1597
+ }
1598
+ internalBinaryWrite(message: ReopenApprovalTaskRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1599
+ /* int64 task_id = 1; */
1600
+ if (message.taskId !== 0)
1601
+ writer.tag(1, WireType.Varint).int64(message.taskId);
1602
+ /* string comment = 2; */
1603
+ if (message.comment !== "")
1604
+ writer.tag(2, WireType.LengthDelimited).string(message.comment);
1605
+ let u = options.writeUnknownFields;
1606
+ if (u !== false)
1607
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1608
+ return writer;
1609
+ }
1610
+ }
1611
+ /**
1612
+ * @generated MessageType for protobuf message services.documents.ReopenApprovalTaskRequest
1613
+ */
1614
+ export const ReopenApprovalTaskRequest = new ReopenApprovalTaskRequest$Type();
1615
+ // @generated message type with reflection information, may provide speed optimized methods
1616
+ class ReopenApprovalTaskResponse$Type extends MessageType<ReopenApprovalTaskResponse> {
1617
+ constructor() {
1618
+ super("services.documents.ReopenApprovalTaskResponse", [
1619
+ { no: 1, name: "task", kind: "message", T: () => ApprovalTask },
1620
+ { no: 2, name: "policy", kind: "message", T: () => ApprovalPolicy }
1621
+ ]);
1622
+ }
1623
+ create(value?: PartialMessage<ReopenApprovalTaskResponse>): ReopenApprovalTaskResponse {
1624
+ const message = globalThis.Object.create((this.messagePrototype!));
1625
+ if (value !== undefined)
1626
+ reflectionMergePartial<ReopenApprovalTaskResponse>(this, message, value);
1627
+ return message;
1628
+ }
1629
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReopenApprovalTaskResponse): ReopenApprovalTaskResponse {
1630
+ let message = target ?? this.create(), end = reader.pos + length;
1631
+ while (reader.pos < end) {
1632
+ let [fieldNo, wireType] = reader.tag();
1633
+ switch (fieldNo) {
1634
+ case /* resources.documents.approval.ApprovalTask task */ 1:
1635
+ message.task = ApprovalTask.internalBinaryRead(reader, reader.uint32(), options, message.task);
1636
+ break;
1637
+ case /* resources.documents.approval.ApprovalPolicy policy */ 2:
1638
+ message.policy = ApprovalPolicy.internalBinaryRead(reader, reader.uint32(), options, message.policy);
1639
+ break;
1640
+ default:
1641
+ let u = options.readUnknownField;
1642
+ if (u === "throw")
1643
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1644
+ let d = reader.skip(wireType);
1645
+ if (u !== false)
1646
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1647
+ }
1648
+ }
1649
+ return message;
1650
+ }
1651
+ internalBinaryWrite(message: ReopenApprovalTaskResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1652
+ /* resources.documents.approval.ApprovalTask task = 1; */
1653
+ if (message.task)
1654
+ ApprovalTask.internalBinaryWrite(message.task, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1655
+ /* resources.documents.approval.ApprovalPolicy policy = 2; */
1656
+ if (message.policy)
1657
+ ApprovalPolicy.internalBinaryWrite(message.policy, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1658
+ let u = options.writeUnknownFields;
1659
+ if (u !== false)
1660
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1661
+ return writer;
1662
+ }
1663
+ }
1664
+ /**
1665
+ * @generated MessageType for protobuf message services.documents.ReopenApprovalTaskResponse
1666
+ */
1667
+ export const ReopenApprovalTaskResponse = new ReopenApprovalTaskResponse$Type();
1668
+ // @generated message type with reflection information, may provide speed optimized methods
1669
+ class RecomputeApprovalPolicyCountersRequest$Type extends MessageType<RecomputeApprovalPolicyCountersRequest> {
1670
+ constructor() {
1671
+ super("services.documents.RecomputeApprovalPolicyCountersRequest", [
1672
+ { no: 1, name: "document_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } }
1673
+ ]);
1674
+ }
1675
+ create(value?: PartialMessage<RecomputeApprovalPolicyCountersRequest>): RecomputeApprovalPolicyCountersRequest {
1676
+ const message = globalThis.Object.create((this.messagePrototype!));
1677
+ message.documentId = 0;
1678
+ if (value !== undefined)
1679
+ reflectionMergePartial<RecomputeApprovalPolicyCountersRequest>(this, message, value);
1680
+ return message;
1681
+ }
1682
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RecomputeApprovalPolicyCountersRequest): RecomputeApprovalPolicyCountersRequest {
1683
+ let message = target ?? this.create(), end = reader.pos + length;
1684
+ while (reader.pos < end) {
1685
+ let [fieldNo, wireType] = reader.tag();
1686
+ switch (fieldNo) {
1687
+ case /* int64 document_id */ 1:
1688
+ message.documentId = reader.int64().toNumber();
1689
+ break;
1690
+ default:
1691
+ let u = options.readUnknownField;
1692
+ if (u === "throw")
1693
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1694
+ let d = reader.skip(wireType);
1695
+ if (u !== false)
1696
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1697
+ }
1698
+ }
1699
+ return message;
1700
+ }
1701
+ internalBinaryWrite(message: RecomputeApprovalPolicyCountersRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1702
+ /* int64 document_id = 1; */
1703
+ if (message.documentId !== 0)
1704
+ writer.tag(1, WireType.Varint).int64(message.documentId);
1705
+ let u = options.writeUnknownFields;
1706
+ if (u !== false)
1707
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1708
+ return writer;
1709
+ }
1710
+ }
1711
+ /**
1712
+ * @generated MessageType for protobuf message services.documents.RecomputeApprovalPolicyCountersRequest
1713
+ */
1714
+ export const RecomputeApprovalPolicyCountersRequest = new RecomputeApprovalPolicyCountersRequest$Type();
1715
+ // @generated message type with reflection information, may provide speed optimized methods
1716
+ class RecomputeApprovalPolicyCountersResponse$Type extends MessageType<RecomputeApprovalPolicyCountersResponse> {
1717
+ constructor() {
1718
+ super("services.documents.RecomputeApprovalPolicyCountersResponse", [
1719
+ { no: 1, name: "policy", kind: "message", T: () => ApprovalPolicy }
1720
+ ]);
1721
+ }
1722
+ create(value?: PartialMessage<RecomputeApprovalPolicyCountersResponse>): RecomputeApprovalPolicyCountersResponse {
1723
+ const message = globalThis.Object.create((this.messagePrototype!));
1724
+ if (value !== undefined)
1725
+ reflectionMergePartial<RecomputeApprovalPolicyCountersResponse>(this, message, value);
1726
+ return message;
1727
+ }
1728
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RecomputeApprovalPolicyCountersResponse): RecomputeApprovalPolicyCountersResponse {
1729
+ let message = target ?? this.create(), end = reader.pos + length;
1730
+ while (reader.pos < end) {
1731
+ let [fieldNo, wireType] = reader.tag();
1732
+ switch (fieldNo) {
1733
+ case /* resources.documents.approval.ApprovalPolicy policy */ 1:
1734
+ message.policy = ApprovalPolicy.internalBinaryRead(reader, reader.uint32(), options, message.policy);
1735
+ break;
1736
+ default:
1737
+ let u = options.readUnknownField;
1738
+ if (u === "throw")
1739
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1740
+ let d = reader.skip(wireType);
1741
+ if (u !== false)
1742
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1743
+ }
1744
+ }
1745
+ return message;
1746
+ }
1747
+ internalBinaryWrite(message: RecomputeApprovalPolicyCountersResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1748
+ /* resources.documents.approval.ApprovalPolicy policy = 1; */
1749
+ if (message.policy)
1750
+ ApprovalPolicy.internalBinaryWrite(message.policy, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1751
+ let u = options.writeUnknownFields;
1752
+ if (u !== false)
1753
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1754
+ return writer;
1755
+ }
1756
+ }
1757
+ /**
1758
+ * @generated MessageType for protobuf message services.documents.RecomputeApprovalPolicyCountersResponse
1759
+ */
1760
+ export const RecomputeApprovalPolicyCountersResponse = new RecomputeApprovalPolicyCountersResponse$Type();
1761
+ /**
1762
+ * @generated ServiceType for protobuf service services.documents.ApprovalService
1763
+ */
1764
+ export const ApprovalService = new ServiceType("services.documents.ApprovalService", [
1765
+ { name: "ListApprovalTasksInbox", options: { "codegen.perms.perms": { enabled: true, service: "documents.DocumentsService", name: "ListDocuments" } }, I: ListApprovalTasksInboxRequest, O: ListApprovalTasksInboxResponse },
1766
+ { name: "ListApprovalPolicies", options: { "codegen.perms.perms": { enabled: true, service: "documents.DocumentsService", name: "ListDocuments" } }, I: ListApprovalPoliciesRequest, O: ListApprovalPoliciesResponse },
1767
+ { name: "UpsertApprovalPolicy", options: { "codegen.perms.perms": { enabled: true } }, I: UpsertApprovalPolicyRequest, O: UpsertApprovalPolicyResponse },
1768
+ { name: "ListApprovalTasks", options: { "codegen.perms.perms": { enabled: true, service: "documents.DocumentsService", name: "ListDocuments" } }, I: ListApprovalTasksRequest, O: ListApprovalTasksResponse },
1769
+ { name: "UpsertApprovalTasks", options: { "codegen.perms.perms": { enabled: true } }, I: UpsertApprovalTasksRequest, O: UpsertApprovalTasksResponse },
1770
+ { name: "DeleteApprovalTasks", options: { "codegen.perms.perms": { enabled: true } }, I: DeleteApprovalTasksRequest, O: DeleteApprovalTasksResponse },
1771
+ { name: "ListApprovals", options: { "codegen.perms.perms": { enabled: true, service: "documents.DocumentsService", name: "ListDocuments" } }, I: ListApprovalsRequest, O: ListApprovalsResponse },
1772
+ { name: "RevokeApproval", options: { "codegen.perms.perms": { enabled: true } }, I: RevokeApprovalRequest, O: RevokeApprovalResponse },
1773
+ { name: "DecideApproval", options: { "codegen.perms.perms": { enabled: true, service: "documents.DocumentsService", name: "ListDocuments" } }, I: DecideApprovalRequest, O: DecideApprovalResponse },
1774
+ { name: "ReopenApprovalTask", options: { "codegen.perms.perms": { enabled: true, name: "RevokeApproval" } }, I: ReopenApprovalTaskRequest, O: ReopenApprovalTaskResponse },
1775
+ { name: "RecomputeApprovalPolicyCounters", options: { "codegen.perms.perms": { enabled: true, name: "RevokeApproval" } }, I: RecomputeApprovalPolicyCountersRequest, O: RecomputeApprovalPolicyCountersResponse }
1776
+ ], { "codegen.perms.perms_svc": { order: 52, icon: "i-mdi-approval" } });