@fivenet-app/gen 2025.9.1 → 2026.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +1 -1
  2. package/clients.ts +36 -0
  3. package/codegen/perms/perms.ts +186 -15
  4. package/codegen/sanitizer/sanitizer.ts +34 -1
  5. package/package.json +2 -2
  6. package/perms.ts +140 -8
  7. package/resources/accounts/accounts.ts +98 -31
  8. package/resources/accounts/{oauth2.ts → oauth2/oauth2.ts} +20 -20
  9. package/resources/audit/audit.ts +156 -38
  10. package/resources/calendar/{access.ts → access/access.ts} +30 -30
  11. package/resources/calendar/calendar.ts +17 -477
  12. package/resources/calendar/entries/entries.ts +474 -0
  13. package/resources/centrum/{access.ts → access/access.ts} +22 -22
  14. package/resources/centrum/{dispatchers.ts → dispatchers/dispatchers.ts} +14 -14
  15. package/resources/centrum/{dispatches.ts → dispatches/dispatches.ts} +151 -185
  16. package/resources/centrum/joblist.ts +136 -0
  17. package/resources/centrum/{settings.ts → settings/settings.ts} +70 -70
  18. package/resources/centrum/{units_access.ts → units/access/access.ts} +30 -30
  19. package/resources/centrum/{units.ts → units/units.ts} +131 -51
  20. package/resources/citizens/labels/labels.ts +526 -0
  21. package/resources/{users → citizens/licenses}/licenses.ts +17 -17
  22. package/resources/clientconfig/clientconfig.ts +126 -258
  23. package/resources/collab/collab.ts +4 -16
  24. package/resources/common/content/content.ts +108 -85
  25. package/resources/common/content/diff_activity.ts +267 -0
  26. package/resources/common/i18n.ts +2 -2
  27. package/resources/{common/cron → cron}/cron.ts +43 -43
  28. package/resources/documents/{access.ts → access/access.ts} +29 -52
  29. package/resources/documents/{activity.ts → activity/activity.ts} +171 -123
  30. package/resources/documents/approval/approval.ts +945 -0
  31. package/resources/documents/{category.ts → category/category.ts} +7 -7
  32. package/resources/documents/{comment.ts → comment/comment.ts} +10 -10
  33. package/resources/documents/data/data.ts +303 -0
  34. package/resources/documents/documents.ts +282 -667
  35. package/resources/{common/uuid.ts → documents/forms/forms.ts} +20 -20
  36. package/resources/documents/{pins.ts → pins/pins.ts} +5 -5
  37. package/resources/documents/references/references.ts +187 -0
  38. package/resources/documents/relations/relations.ts +184 -0
  39. package/resources/documents/{requests.ts → requests/requests.ts} +18 -18
  40. package/resources/documents/stamps/stamp.ts +355 -0
  41. package/resources/documents/{templates.ts → templates/templates.ts} +426 -84
  42. package/resources/documents/{workflow.ts → workflow/workflow.ts} +264 -26
  43. package/resources/file/filestore.ts +1 -1
  44. package/resources/{common/grpcws → grpcws}/grpcws.ts +52 -52
  45. package/resources/jobs/{activity.ts → colleagues/activity/activity.ts} +54 -54
  46. package/resources/jobs/{colleagues.ts → colleagues/colleagues.ts} +17 -28
  47. package/resources/jobs/{conduct.ts → conduct/conduct.ts} +70 -45
  48. package/resources/jobs/{labels.ts → labels/labels.ts} +34 -23
  49. package/resources/jobs/{job_props.ts → props/props.ts} +26 -38
  50. package/resources/jobs/{job_settings.ts → settings/settings.ts} +53 -53
  51. package/resources/jobs/{timeclock.ts → timeclock/timeclock.ts} +17 -17
  52. package/resources/livemap/{heatmap.ts → heatmap/heatmap.ts} +4 -4
  53. package/resources/livemap/{marker_marker.ts → markers/marker_marker.ts} +35 -35
  54. package/resources/livemap/{user_marker.ts → markers/user_marker.ts} +115 -36
  55. package/resources/mailer/{access.ts → access/access.ts} +67 -67
  56. package/resources/mailer/{email.ts → emails/email.ts} +19 -19
  57. package/resources/mailer/{events.ts → events/events.ts} +24 -24
  58. package/resources/mailer/{message.ts → messages/message.ts} +29 -29
  59. package/resources/mailer/{settings.ts → settings/settings.ts} +14 -13
  60. package/resources/mailer/{template.ts → templates/template.ts} +15 -15
  61. package/resources/mailer/{thread.ts → threads/thread.ts} +29 -29
  62. package/resources/notifications/{client_view.ts → clientview/clientview.ts} +22 -22
  63. package/resources/notifications/{events.ts → events/events.ts} +20 -20
  64. package/resources/notifications/notifications.ts +4 -4
  65. package/resources/permissions/{attributes.ts → attributes/attributes.ts} +42 -42
  66. package/resources/permissions/{events.ts → events/events.ts} +7 -7
  67. package/resources/permissions/{permissions.ts → permissions/permissions.ts} +30 -19
  68. package/resources/qualifications/{access.ts → access/access.ts} +19 -19
  69. package/resources/qualifications/{exam.ts → exam/exam.ts} +269 -141
  70. package/resources/qualifications/qualifications.ts +51 -179
  71. package/resources/settings/banner.ts +3 -3
  72. package/resources/settings/config.ts +527 -25
  73. package/resources/{documents/state.ts → settings/data.ts} +41 -20
  74. package/resources/settings/perms.ts +14 -14
  75. package/resources/stats/stats.ts +379 -0
  76. package/resources/sync/{activity.ts → activity/activity.ts} +104 -25
  77. package/resources/sync/{data.ts → data/data.ts} +405 -59
  78. package/resources/userinfo/{user_info.ts → userinfo.ts} +71 -93
  79. package/resources/users/{activity.ts → activity/activity.ts} +242 -101
  80. package/resources/users/{props.ts → props/props.ts} +91 -69
  81. package/resources/users/short/user.ts +184 -0
  82. package/resources/users/{users.ts → user.ts} +266 -195
  83. package/resources/vehicles/{activity.ts → activity/activity.ts} +20 -20
  84. package/resources/vehicles/{props.ts → props/props.ts} +28 -6
  85. package/resources/vehicles/vehicles.ts +20 -8
  86. package/resources/wiki/{access.ts → access/access.ts} +30 -30
  87. package/resources/wiki/{activity.ts → activity/activity.ts} +104 -70
  88. package/resources/wiki/page.ts +39 -15
  89. package/services/auth/auth.client.ts +23 -10
  90. package/services/auth/auth.ts +445 -262
  91. package/services/calendar/calendar.ts +56 -34
  92. package/services/centrum/centrum.ts +127 -127
  93. package/services/citizens/citizens.client.ts +0 -13
  94. package/services/citizens/citizens.ts +44 -134
  95. package/services/citizens/labels.client.ts +77 -0
  96. package/services/citizens/labels.ts +455 -0
  97. package/services/completor/completor.ts +36 -16
  98. package/services/documents/approval.client.ts +188 -0
  99. package/services/documents/approval.ts +1776 -0
  100. package/services/documents/documents.ts +164 -186
  101. package/services/documents/forms.client.ts +51 -0
  102. package/services/documents/forms.ts +232 -0
  103. package/services/documents/stamps.client.ts +77 -0
  104. package/services/documents/stamps.ts +481 -0
  105. package/services/documents/stats.client.ts +38 -0
  106. package/services/documents/stats.ts +245 -0
  107. package/services/jobs/conduct.client.ts +30 -3
  108. package/services/jobs/conduct.ts +159 -33
  109. package/services/jobs/jobs.ts +43 -43
  110. package/services/jobs/stats.client.ts +38 -0
  111. package/services/jobs/stats.ts +207 -0
  112. package/services/jobs/timeclock.ts +39 -39
  113. package/services/livemap/livemap.ts +18 -18
  114. package/services/mailer/mailer.ts +78 -78
  115. package/services/notifications/notifications.ts +35 -35
  116. package/services/qualifications/qualifications.ts +81 -46
  117. package/services/settings/accounts.client.ts +23 -10
  118. package/services/settings/accounts.ts +191 -30
  119. package/services/settings/cron.client.ts +13 -0
  120. package/services/settings/cron.ts +118 -5
  121. package/services/settings/laws.ts +1 -1
  122. package/services/settings/settings.ts +73 -52
  123. package/services/settings/system.client.ts +13 -0
  124. package/services/settings/system.ts +115 -15
  125. package/services/stats/stats.client.ts +7 -7
  126. package/services/stats/stats.ts +24 -24
  127. package/services/sync/sync.client.ts +271 -37
  128. package/services/sync/sync.ts +1525 -421
  129. package/services/vehicles/vehicles.ts +8 -8
  130. package/services/wiki/wiki.ts +8 -8
  131. package/svcs.ts +100 -6
  132. package/resources/centrum/attributes.ts +0 -183
  133. package/resources/documents/signoff.ts +0 -55
  134. package/resources/users/labels.ts +0 -160
@@ -1,5 +1,5 @@
1
1
  // @generated by protobuf-ts 2.11.1 with parameter force_server_none,long_type_number,optimize_speed,ts_nocheck
2
- // @generated from protobuf file "resources/documents/templates.proto" (package "resources.documents", syntax proto3)
2
+ // @generated from protobuf file "resources/documents/templates/templates.proto" (package "resources.documents.templates", syntax proto3)
3
3
  // tslint:disable
4
4
  // @ts-nocheck
5
5
  import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
@@ -11,17 +11,19 @@ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
11
  import type { PartialMessage } from "@protobuf-ts/runtime";
12
12
  import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
13
  import { MessageType } from "@protobuf-ts/runtime";
14
- import { AccessLevel } from "./access";
15
- import { Vehicle } from "../vehicles/vehicles";
16
- import { UserShort } from "../users/users";
17
- import { DocumentShort } from "./documents";
18
- import { User } from "../users/users";
19
- import { Workflow } from "./workflow";
20
- import { DocumentAccess } from "./access";
21
- import { Category } from "./category";
22
- import { Timestamp } from "../timestamp/timestamp";
14
+ import { OnEditBehavior } from "../approval/approval";
15
+ import { ApprovalRuleKind } from "../approval/approval";
16
+ import { AccessLevel } from "../access/access";
17
+ import { Vehicle } from "../../vehicles/vehicles";
18
+ import { UserShort } from "../../users/short/user";
19
+ import { DocumentShort } from "../documents";
20
+ import { User } from "../../users/user";
21
+ import { Workflow } from "../workflow/workflow";
22
+ import { DocumentAccess } from "../access/access";
23
+ import { Category } from "../category/category";
24
+ import { Timestamp } from "../../timestamp/timestamp";
23
25
  /**
24
- * @generated from protobuf message resources.documents.Template
26
+ * @generated from protobuf message resources.documents.templates.Template
25
27
  */
26
28
  export interface Template {
27
29
  /**
@@ -37,7 +39,7 @@ export interface Template {
37
39
  */
38
40
  updatedAt?: Timestamp;
39
41
  /**
40
- * @generated from protobuf field: resources.documents.Category category = 4
42
+ * @generated from protobuf field: resources.documents.category.Category category = 4
41
43
  */
42
44
  category?: Category;
43
45
  /**
@@ -73,7 +75,7 @@ export interface Template {
73
75
  */
74
76
  state: string;
75
77
  /**
76
- * @generated from protobuf field: resources.documents.TemplateSchema schema = 13
78
+ * @generated from protobuf field: resources.documents.templates.TemplateSchema schema = 13
77
79
  */
78
80
  schema?: TemplateSchema;
79
81
  /**
@@ -85,20 +87,24 @@ export interface Template {
85
87
  */
86
88
  creatorJobLabel?: string;
87
89
  /**
88
- * @generated from protobuf field: repeated resources.documents.TemplateJobAccess job_access = 16
90
+ * @generated from protobuf field: repeated resources.documents.templates.TemplateJobAccess job_access = 16
89
91
  */
90
92
  jobAccess: TemplateJobAccess[];
91
93
  /**
92
- * @generated from protobuf field: resources.documents.DocumentAccess content_access = 17
94
+ * @generated from protobuf field: resources.documents.access.DocumentAccess content_access = 17
93
95
  */
94
96
  contentAccess?: DocumentAccess;
95
97
  /**
96
- * @generated from protobuf field: optional resources.documents.Workflow workflow = 18
98
+ * @generated from protobuf field: optional resources.documents.workflow.Workflow workflow = 18
97
99
  */
98
100
  workflow?: Workflow;
101
+ /**
102
+ * @generated from protobuf field: optional resources.documents.templates.TemplateApproval approval = 19
103
+ */
104
+ approval?: TemplateApproval;
99
105
  }
100
106
  /**
101
- * @generated from protobuf message resources.documents.TemplateShort
107
+ * @generated from protobuf message resources.documents.templates.TemplateShort
102
108
  */
103
109
  export interface TemplateShort {
104
110
  /**
@@ -114,7 +120,7 @@ export interface TemplateShort {
114
120
  */
115
121
  updatedAt?: Timestamp;
116
122
  /**
117
- * @generated from protobuf field: resources.documents.Category category = 4
123
+ * @generated from protobuf field: resources.documents.category.Category category = 4
118
124
  */
119
125
  category?: Category;
120
126
  /**
@@ -138,7 +144,7 @@ export interface TemplateShort {
138
144
  */
139
145
  icon?: string;
140
146
  /**
141
- * @generated from protobuf field: resources.documents.TemplateSchema schema = 10
147
+ * @generated from protobuf field: resources.documents.templates.TemplateSchema schema = 10
142
148
  */
143
149
  schema?: TemplateSchema;
144
150
  /**
@@ -150,38 +156,38 @@ export interface TemplateShort {
150
156
  */
151
157
  creatorJobLabel?: string;
152
158
  /**
153
- * @generated from protobuf field: optional resources.documents.Workflow workflow = 18
159
+ * @generated from protobuf field: optional resources.documents.workflow.Workflow workflow = 18
154
160
  */
155
161
  workflow?: Workflow;
156
162
  }
157
163
  /**
158
- * @generated from protobuf message resources.documents.TemplateSchema
164
+ * @generated from protobuf message resources.documents.templates.TemplateSchema
159
165
  */
160
166
  export interface TemplateSchema {
161
167
  /**
162
- * @generated from protobuf field: resources.documents.TemplateRequirements requirements = 1
168
+ * @generated from protobuf field: resources.documents.templates.TemplateRequirements requirements = 1
163
169
  */
164
170
  requirements?: TemplateRequirements;
165
171
  }
166
172
  /**
167
- * @generated from protobuf message resources.documents.TemplateRequirements
173
+ * @generated from protobuf message resources.documents.templates.TemplateRequirements
168
174
  */
169
175
  export interface TemplateRequirements {
170
176
  /**
171
- * @generated from protobuf field: optional resources.documents.ObjectSpecs documents = 1
177
+ * @generated from protobuf field: optional resources.documents.templates.ObjectSpecs documents = 1
172
178
  */
173
179
  documents?: ObjectSpecs;
174
180
  /**
175
- * @generated from protobuf field: optional resources.documents.ObjectSpecs users = 2
181
+ * @generated from protobuf field: optional resources.documents.templates.ObjectSpecs users = 2
176
182
  */
177
183
  users?: ObjectSpecs;
178
184
  /**
179
- * @generated from protobuf field: optional resources.documents.ObjectSpecs vehicles = 3
185
+ * @generated from protobuf field: optional resources.documents.templates.ObjectSpecs vehicles = 3
180
186
  */
181
187
  vehicles?: ObjectSpecs;
182
188
  }
183
189
  /**
184
- * @generated from protobuf message resources.documents.ObjectSpecs
190
+ * @generated from protobuf message resources.documents.templates.ObjectSpecs
185
191
  */
186
192
  export interface ObjectSpecs {
187
193
  /**
@@ -198,7 +204,7 @@ export interface ObjectSpecs {
198
204
  max?: number;
199
205
  }
200
206
  /**
201
- * @generated from protobuf message resources.documents.TemplateData
207
+ * @generated from protobuf message resources.documents.templates.TemplateData
202
208
  */
203
209
  export interface TemplateData {
204
210
  /**
@@ -210,7 +216,7 @@ export interface TemplateData {
210
216
  */
211
217
  documents: DocumentShort[];
212
218
  /**
213
- * @generated from protobuf field: repeated resources.users.UserShort users = 3
219
+ * @generated from protobuf field: repeated resources.users.short.UserShort users = 3
214
220
  */
215
221
  users: UserShort[];
216
222
  /**
@@ -219,7 +225,7 @@ export interface TemplateData {
219
225
  vehicles: Vehicle[];
220
226
  }
221
227
  /**
222
- * @generated from protobuf message resources.documents.TemplateJobAccess
228
+ * @generated from protobuf message resources.documents.templates.TemplateJobAccess
223
229
  */
224
230
  export interface TemplateJobAccess {
225
231
  /**
@@ -251,21 +257,110 @@ export interface TemplateJobAccess {
251
257
  */
252
258
  jobGradeLabel?: string;
253
259
  /**
254
- * @generated from protobuf field: resources.documents.AccessLevel access = 8
260
+ * @generated from protobuf field: resources.documents.access.AccessLevel access = 8
255
261
  */
256
262
  access: AccessLevel;
257
263
  }
258
264
  /**
259
265
  * Dummy - DO NOT USE!
260
266
  *
261
- * @generated from protobuf message resources.documents.TemplateUserAccess
267
+ * @generated from protobuf message resources.documents.templates.TemplateUserAccess
262
268
  */
263
269
  export interface TemplateUserAccess {
264
270
  }
271
+ /**
272
+ * @generated from protobuf message resources.documents.templates.TemplateApproval
273
+ */
274
+ export interface TemplateApproval {
275
+ /**
276
+ * @generated from protobuf field: bool enabled = 1
277
+ */
278
+ enabled: boolean;
279
+ /**
280
+ * @generated from protobuf field: optional resources.documents.templates.TemplateApprovalPolicy policy = 2
281
+ */
282
+ policy?: TemplateApprovalPolicy;
283
+ /**
284
+ * @generated from protobuf field: repeated resources.documents.templates.TemplateApprovalTaskSeed tasks = 3
285
+ */
286
+ tasks: TemplateApprovalTaskSeed[];
287
+ }
288
+ /**
289
+ * @generated from protobuf message resources.documents.templates.TemplateApprovalPolicy
290
+ */
291
+ export interface TemplateApprovalPolicy {
292
+ /**
293
+ * @generated from protobuf field: resources.documents.approval.ApprovalRuleKind rule_kind = 1
294
+ */
295
+ ruleKind: ApprovalRuleKind;
296
+ /**
297
+ * @generated from protobuf field: resources.documents.approval.OnEditBehavior on_edit_behavior = 2
298
+ */
299
+ onEditBehavior: OnEditBehavior;
300
+ /**
301
+ * @generated from protobuf field: optional int32 required_count = 3
302
+ */
303
+ requiredCount?: number;
304
+ /**
305
+ * @generated from protobuf field: bool signature_required = 4
306
+ */
307
+ signatureRequired: boolean;
308
+ /**
309
+ * @generated from protobuf field: bool self_approve_allowed = 5
310
+ */
311
+ selfApproveAllowed: boolean;
312
+ }
313
+ /**
314
+ * @generated from protobuf message resources.documents.templates.TemplateApprovalTaskSeed
315
+ */
316
+ export interface TemplateApprovalTaskSeed {
317
+ /**
318
+ * @generated from protobuf field: int32 user_id = 1
319
+ */
320
+ userId: number;
321
+ /**
322
+ * If user_id == 0 -> JOB task
323
+ *
324
+ * @generated from protobuf field: string job = 2
325
+ */
326
+ job: string;
327
+ /**
328
+ * @generated from protobuf field: int32 minimum_grade = 3
329
+ */
330
+ minimumGrade: number;
331
+ /**
332
+ * Label of task
333
+ *
334
+ * @generated from protobuf field: optional string label = 4
335
+ */
336
+ label?: string;
337
+ /**
338
+ * @generated from protobuf field: bool signature_required = 5
339
+ */
340
+ signatureRequired: boolean;
341
+ /**
342
+ * Only for JOB tasks; number of PENDING slots to ensure (>=1)
343
+ *
344
+ * @generated from protobuf field: int32 slots = 6
345
+ */
346
+ slots: number;
347
+ /**
348
+ * Optional default due date for created slots
349
+ *
350
+ * @generated from protobuf field: optional int32 due_in_days = 7
351
+ */
352
+ dueInDays?: number;
353
+ /**
354
+ * Optional note set on created tasks
355
+ *
356
+ * @generated from protobuf field: optional string comment = 8
357
+ */
358
+ comment?: string;
359
+ }
265
360
  // @generated message type with reflection information, may provide speed optimized methods
266
361
  class Template$Type extends MessageType<Template> {
267
362
  constructor() {
268
- super("resources.documents.Template", [
363
+ super("resources.documents.templates.Template", [
269
364
  { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "tagger.tags": "alias:\"id\"" } },
270
365
  { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
271
366
  { no: 3, name: "updated_at", kind: "message", T: () => Timestamp },
@@ -273,17 +368,18 @@ class Template$Type extends MessageType<Template> {
273
368
  { no: 5, name: "weight", kind: "scalar", T: 13 /*ScalarType.UINT32*/, options: { "buf.validate.field": { uint32: { lt: 4294967295 } } } },
274
369
  { no: 6, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
275
370
  { no: 7, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
276
- { no: 8, name: "color", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "7" } }, "codegen.sanitizer.sanitizer": { enabled: true, method: "StripTags" } } },
277
- { no: 9, name: "icon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "128", suffix: "Icon" } }, "codegen.sanitizer.sanitizer": { enabled: true, method: "StripTags" } } },
278
- { no: 10, name: "content_title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxBytes: "10240" } }, "tagger.tags": "alias:\"content_title\"" } },
279
- { no: 11, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "0", maxBytes: "2000000" } }, "tagger.tags": "alias:\"content\"" } },
371
+ { no: 8, name: "color", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "7" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
372
+ { no: 9, name: "icon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "128" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
373
+ { no: 10, name: "content_title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxBytes: "10240" } }, "codegen.sanitizer.sanitizer": { enabled: true, method: "SanitizeAndUnescape" }, "tagger.tags": "alias:\"content_title\"" } },
374
+ { no: 11, name: "content", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "0", maxBytes: "2000000" } }, "codegen.sanitizer.sanitizer": { enabled: true, method: "SanitizeAndUnescape" }, "tagger.tags": "alias:\"content\"" } },
280
375
  { no: 12, name: "state", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "512" } }, "tagger.tags": "alias:\"state\"" } },
281
376
  { no: 13, name: "schema", kind: "message", T: () => TemplateSchema, options: { "tagger.tags": "alias:\"schema\"" } },
282
377
  { no: 14, name: "creator_job", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "20" } } } },
283
378
  { no: 15, name: "creator_job_label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } },
284
379
  { no: 16, name: "job_access", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => TemplateJobAccess, options: { "buf.validate.field": { repeated: { maxItems: "20" } } } },
285
380
  { no: 17, name: "content_access", kind: "message", T: () => DocumentAccess, options: { "tagger.tags": "alias:\"access\"" } },
286
- { no: 18, name: "workflow", kind: "message", T: () => Workflow }
381
+ { no: 18, name: "workflow", kind: "message", T: () => Workflow },
382
+ { no: 19, name: "approval", kind: "message", T: () => TemplateApproval }
287
383
  ]);
288
384
  }
289
385
  create(value?: PartialMessage<Template>): Template {
@@ -315,7 +411,7 @@ class Template$Type extends MessageType<Template> {
315
411
  case /* optional resources.timestamp.Timestamp updated_at */ 3:
316
412
  message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
317
413
  break;
318
- case /* resources.documents.Category category */ 4:
414
+ case /* resources.documents.category.Category category */ 4:
319
415
  message.category = Category.internalBinaryRead(reader, reader.uint32(), options, message.category);
320
416
  break;
321
417
  case /* uint32 weight */ 5:
@@ -342,7 +438,7 @@ class Template$Type extends MessageType<Template> {
342
438
  case /* string state */ 12:
343
439
  message.state = reader.string();
344
440
  break;
345
- case /* resources.documents.TemplateSchema schema */ 13:
441
+ case /* resources.documents.templates.TemplateSchema schema */ 13:
346
442
  message.schema = TemplateSchema.internalBinaryRead(reader, reader.uint32(), options, message.schema);
347
443
  break;
348
444
  case /* string creator_job */ 14:
@@ -351,15 +447,18 @@ class Template$Type extends MessageType<Template> {
351
447
  case /* optional string creator_job_label */ 15:
352
448
  message.creatorJobLabel = reader.string();
353
449
  break;
354
- case /* repeated resources.documents.TemplateJobAccess job_access */ 16:
450
+ case /* repeated resources.documents.templates.TemplateJobAccess job_access */ 16:
355
451
  message.jobAccess.push(TemplateJobAccess.internalBinaryRead(reader, reader.uint32(), options));
356
452
  break;
357
- case /* resources.documents.DocumentAccess content_access */ 17:
453
+ case /* resources.documents.access.DocumentAccess content_access */ 17:
358
454
  message.contentAccess = DocumentAccess.internalBinaryRead(reader, reader.uint32(), options, message.contentAccess);
359
455
  break;
360
- case /* optional resources.documents.Workflow workflow */ 18:
456
+ case /* optional resources.documents.workflow.Workflow workflow */ 18:
361
457
  message.workflow = Workflow.internalBinaryRead(reader, reader.uint32(), options, message.workflow);
362
458
  break;
459
+ case /* optional resources.documents.templates.TemplateApproval approval */ 19:
460
+ message.approval = TemplateApproval.internalBinaryRead(reader, reader.uint32(), options, message.approval);
461
+ break;
363
462
  default:
364
463
  let u = options.readUnknownField;
365
464
  if (u === "throw")
@@ -381,7 +480,7 @@ class Template$Type extends MessageType<Template> {
381
480
  /* optional resources.timestamp.Timestamp updated_at = 3; */
382
481
  if (message.updatedAt)
383
482
  Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
384
- /* resources.documents.Category category = 4; */
483
+ /* resources.documents.category.Category category = 4; */
385
484
  if (message.category)
386
485
  Category.internalBinaryWrite(message.category, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
387
486
  /* uint32 weight = 5; */
@@ -408,7 +507,7 @@ class Template$Type extends MessageType<Template> {
408
507
  /* string state = 12; */
409
508
  if (message.state !== "")
410
509
  writer.tag(12, WireType.LengthDelimited).string(message.state);
411
- /* resources.documents.TemplateSchema schema = 13; */
510
+ /* resources.documents.templates.TemplateSchema schema = 13; */
412
511
  if (message.schema)
413
512
  TemplateSchema.internalBinaryWrite(message.schema, writer.tag(13, WireType.LengthDelimited).fork(), options).join();
414
513
  /* string creator_job = 14; */
@@ -417,15 +516,18 @@ class Template$Type extends MessageType<Template> {
417
516
  /* optional string creator_job_label = 15; */
418
517
  if (message.creatorJobLabel !== undefined)
419
518
  writer.tag(15, WireType.LengthDelimited).string(message.creatorJobLabel);
420
- /* repeated resources.documents.TemplateJobAccess job_access = 16; */
519
+ /* repeated resources.documents.templates.TemplateJobAccess job_access = 16; */
421
520
  for (let i = 0; i < message.jobAccess.length; i++)
422
521
  TemplateJobAccess.internalBinaryWrite(message.jobAccess[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join();
423
- /* resources.documents.DocumentAccess content_access = 17; */
522
+ /* resources.documents.access.DocumentAccess content_access = 17; */
424
523
  if (message.contentAccess)
425
524
  DocumentAccess.internalBinaryWrite(message.contentAccess, writer.tag(17, WireType.LengthDelimited).fork(), options).join();
426
- /* optional resources.documents.Workflow workflow = 18; */
525
+ /* optional resources.documents.workflow.Workflow workflow = 18; */
427
526
  if (message.workflow)
428
527
  Workflow.internalBinaryWrite(message.workflow, writer.tag(18, WireType.LengthDelimited).fork(), options).join();
528
+ /* optional resources.documents.templates.TemplateApproval approval = 19; */
529
+ if (message.approval)
530
+ TemplateApproval.internalBinaryWrite(message.approval, writer.tag(19, WireType.LengthDelimited).fork(), options).join();
429
531
  let u = options.writeUnknownFields;
430
532
  if (u !== false)
431
533
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -433,13 +535,13 @@ class Template$Type extends MessageType<Template> {
433
535
  }
434
536
  }
435
537
  /**
436
- * @generated MessageType for protobuf message resources.documents.Template
538
+ * @generated MessageType for protobuf message resources.documents.templates.Template
437
539
  */
438
540
  export const Template = new Template$Type();
439
541
  // @generated message type with reflection information, may provide speed optimized methods
440
542
  class TemplateShort$Type extends MessageType<TemplateShort> {
441
543
  constructor() {
442
- super("resources.documents.TemplateShort", [
544
+ super("resources.documents.templates.TemplateShort", [
443
545
  { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "tagger.tags": "alias:\"id\"" } },
444
546
  { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
445
547
  { no: 3, name: "updated_at", kind: "message", T: () => Timestamp },
@@ -447,8 +549,8 @@ class TemplateShort$Type extends MessageType<TemplateShort> {
447
549
  { no: 5, name: "weight", kind: "scalar", T: 13 /*ScalarType.UINT32*/, options: { "buf.validate.field": { uint32: { lt: 4294967295 } } } },
448
550
  { no: 6, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
449
551
  { no: 7, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } }, "codegen.sanitizer.sanitizer": { enabled: true } } },
450
- { no: 8, name: "color", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "7" } }, "codegen.sanitizer.sanitizer": { enabled: true, method: "StripTags" } } },
451
- { no: 9, name: "icon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "128", suffix: "Icon" } }, "codegen.sanitizer.sanitizer": { enabled: true, method: "StripTags" } } },
552
+ { no: 8, name: "color", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "7" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
553
+ { no: 9, name: "icon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "128" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
452
554
  { no: 10, name: "schema", kind: "message", T: () => TemplateSchema, options: { "tagger.tags": "alias:\"schema\"" } },
453
555
  { no: 11, name: "creator_job", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "20" } } } },
454
556
  { no: 12, name: "creator_job_label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } },
@@ -480,7 +582,7 @@ class TemplateShort$Type extends MessageType<TemplateShort> {
480
582
  case /* optional resources.timestamp.Timestamp updated_at */ 3:
481
583
  message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
482
584
  break;
483
- case /* resources.documents.Category category */ 4:
585
+ case /* resources.documents.category.Category category */ 4:
484
586
  message.category = Category.internalBinaryRead(reader, reader.uint32(), options, message.category);
485
587
  break;
486
588
  case /* uint32 weight */ 5:
@@ -498,7 +600,7 @@ class TemplateShort$Type extends MessageType<TemplateShort> {
498
600
  case /* optional string icon */ 9:
499
601
  message.icon = reader.string();
500
602
  break;
501
- case /* resources.documents.TemplateSchema schema */ 10:
603
+ case /* resources.documents.templates.TemplateSchema schema */ 10:
502
604
  message.schema = TemplateSchema.internalBinaryRead(reader, reader.uint32(), options, message.schema);
503
605
  break;
504
606
  case /* string creator_job */ 11:
@@ -507,7 +609,7 @@ class TemplateShort$Type extends MessageType<TemplateShort> {
507
609
  case /* optional string creator_job_label */ 12:
508
610
  message.creatorJobLabel = reader.string();
509
611
  break;
510
- case /* optional resources.documents.Workflow workflow */ 18:
612
+ case /* optional resources.documents.workflow.Workflow workflow */ 18:
511
613
  message.workflow = Workflow.internalBinaryRead(reader, reader.uint32(), options, message.workflow);
512
614
  break;
513
615
  default:
@@ -531,7 +633,7 @@ class TemplateShort$Type extends MessageType<TemplateShort> {
531
633
  /* optional resources.timestamp.Timestamp updated_at = 3; */
532
634
  if (message.updatedAt)
533
635
  Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
534
- /* resources.documents.Category category = 4; */
636
+ /* resources.documents.category.Category category = 4; */
535
637
  if (message.category)
536
638
  Category.internalBinaryWrite(message.category, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
537
639
  /* uint32 weight = 5; */
@@ -549,7 +651,7 @@ class TemplateShort$Type extends MessageType<TemplateShort> {
549
651
  /* optional string icon = 9; */
550
652
  if (message.icon !== undefined)
551
653
  writer.tag(9, WireType.LengthDelimited).string(message.icon);
552
- /* resources.documents.TemplateSchema schema = 10; */
654
+ /* resources.documents.templates.TemplateSchema schema = 10; */
553
655
  if (message.schema)
554
656
  TemplateSchema.internalBinaryWrite(message.schema, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
555
657
  /* string creator_job = 11; */
@@ -558,7 +660,7 @@ class TemplateShort$Type extends MessageType<TemplateShort> {
558
660
  /* optional string creator_job_label = 12; */
559
661
  if (message.creatorJobLabel !== undefined)
560
662
  writer.tag(12, WireType.LengthDelimited).string(message.creatorJobLabel);
561
- /* optional resources.documents.Workflow workflow = 18; */
663
+ /* optional resources.documents.workflow.Workflow workflow = 18; */
562
664
  if (message.workflow)
563
665
  Workflow.internalBinaryWrite(message.workflow, writer.tag(18, WireType.LengthDelimited).fork(), options).join();
564
666
  let u = options.writeUnknownFields;
@@ -568,13 +670,13 @@ class TemplateShort$Type extends MessageType<TemplateShort> {
568
670
  }
569
671
  }
570
672
  /**
571
- * @generated MessageType for protobuf message resources.documents.TemplateShort
673
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateShort
572
674
  */
573
675
  export const TemplateShort = new TemplateShort$Type();
574
676
  // @generated message type with reflection information, may provide speed optimized methods
575
677
  class TemplateSchema$Type extends MessageType<TemplateSchema> {
576
678
  constructor() {
577
- super("resources.documents.TemplateSchema", [
679
+ super("resources.documents.templates.TemplateSchema", [
578
680
  { no: 1, name: "requirements", kind: "message", T: () => TemplateRequirements }
579
681
  ], { "codegen.dbscanner.dbscanner": { enabled: true } });
580
682
  }
@@ -589,7 +691,7 @@ class TemplateSchema$Type extends MessageType<TemplateSchema> {
589
691
  while (reader.pos < end) {
590
692
  let [fieldNo, wireType] = reader.tag();
591
693
  switch (fieldNo) {
592
- case /* resources.documents.TemplateRequirements requirements */ 1:
694
+ case /* resources.documents.templates.TemplateRequirements requirements */ 1:
593
695
  message.requirements = TemplateRequirements.internalBinaryRead(reader, reader.uint32(), options, message.requirements);
594
696
  break;
595
697
  default:
@@ -604,7 +706,7 @@ class TemplateSchema$Type extends MessageType<TemplateSchema> {
604
706
  return message;
605
707
  }
606
708
  internalBinaryWrite(message: TemplateSchema, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
607
- /* resources.documents.TemplateRequirements requirements = 1; */
709
+ /* resources.documents.templates.TemplateRequirements requirements = 1; */
608
710
  if (message.requirements)
609
711
  TemplateRequirements.internalBinaryWrite(message.requirements, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
610
712
  let u = options.writeUnknownFields;
@@ -614,13 +716,13 @@ class TemplateSchema$Type extends MessageType<TemplateSchema> {
614
716
  }
615
717
  }
616
718
  /**
617
- * @generated MessageType for protobuf message resources.documents.TemplateSchema
719
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateSchema
618
720
  */
619
721
  export const TemplateSchema = new TemplateSchema$Type();
620
722
  // @generated message type with reflection information, may provide speed optimized methods
621
723
  class TemplateRequirements$Type extends MessageType<TemplateRequirements> {
622
724
  constructor() {
623
- super("resources.documents.TemplateRequirements", [
725
+ super("resources.documents.templates.TemplateRequirements", [
624
726
  { no: 1, name: "documents", kind: "message", T: () => ObjectSpecs },
625
727
  { no: 2, name: "users", kind: "message", T: () => ObjectSpecs },
626
728
  { no: 3, name: "vehicles", kind: "message", T: () => ObjectSpecs }
@@ -637,13 +739,13 @@ class TemplateRequirements$Type extends MessageType<TemplateRequirements> {
637
739
  while (reader.pos < end) {
638
740
  let [fieldNo, wireType] = reader.tag();
639
741
  switch (fieldNo) {
640
- case /* optional resources.documents.ObjectSpecs documents */ 1:
742
+ case /* optional resources.documents.templates.ObjectSpecs documents */ 1:
641
743
  message.documents = ObjectSpecs.internalBinaryRead(reader, reader.uint32(), options, message.documents);
642
744
  break;
643
- case /* optional resources.documents.ObjectSpecs users */ 2:
745
+ case /* optional resources.documents.templates.ObjectSpecs users */ 2:
644
746
  message.users = ObjectSpecs.internalBinaryRead(reader, reader.uint32(), options, message.users);
645
747
  break;
646
- case /* optional resources.documents.ObjectSpecs vehicles */ 3:
748
+ case /* optional resources.documents.templates.ObjectSpecs vehicles */ 3:
647
749
  message.vehicles = ObjectSpecs.internalBinaryRead(reader, reader.uint32(), options, message.vehicles);
648
750
  break;
649
751
  default:
@@ -658,13 +760,13 @@ class TemplateRequirements$Type extends MessageType<TemplateRequirements> {
658
760
  return message;
659
761
  }
660
762
  internalBinaryWrite(message: TemplateRequirements, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
661
- /* optional resources.documents.ObjectSpecs documents = 1; */
763
+ /* optional resources.documents.templates.ObjectSpecs documents = 1; */
662
764
  if (message.documents)
663
765
  ObjectSpecs.internalBinaryWrite(message.documents, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
664
- /* optional resources.documents.ObjectSpecs users = 2; */
766
+ /* optional resources.documents.templates.ObjectSpecs users = 2; */
665
767
  if (message.users)
666
768
  ObjectSpecs.internalBinaryWrite(message.users, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
667
- /* optional resources.documents.ObjectSpecs vehicles = 3; */
769
+ /* optional resources.documents.templates.ObjectSpecs vehicles = 3; */
668
770
  if (message.vehicles)
669
771
  ObjectSpecs.internalBinaryWrite(message.vehicles, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
670
772
  let u = options.writeUnknownFields;
@@ -674,13 +776,13 @@ class TemplateRequirements$Type extends MessageType<TemplateRequirements> {
674
776
  }
675
777
  }
676
778
  /**
677
- * @generated MessageType for protobuf message resources.documents.TemplateRequirements
779
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateRequirements
678
780
  */
679
781
  export const TemplateRequirements = new TemplateRequirements$Type();
680
782
  // @generated message type with reflection information, may provide speed optimized methods
681
783
  class ObjectSpecs$Type extends MessageType<ObjectSpecs> {
682
784
  constructor() {
683
- super("resources.documents.ObjectSpecs", [
785
+ super("resources.documents.templates.ObjectSpecs", [
684
786
  { no: 1, name: "required", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
685
787
  { no: 2, name: "min", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
686
788
  { no: 3, name: "max", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }
@@ -734,13 +836,13 @@ class ObjectSpecs$Type extends MessageType<ObjectSpecs> {
734
836
  }
735
837
  }
736
838
  /**
737
- * @generated MessageType for protobuf message resources.documents.ObjectSpecs
839
+ * @generated MessageType for protobuf message resources.documents.templates.ObjectSpecs
738
840
  */
739
841
  export const ObjectSpecs = new ObjectSpecs$Type();
740
842
  // @generated message type with reflection information, may provide speed optimized methods
741
843
  class TemplateData$Type extends MessageType<TemplateData> {
742
844
  constructor() {
743
- super("resources.documents.TemplateData", [
845
+ super("resources.documents.templates.TemplateData", [
744
846
  { no: 1, name: "active_char", kind: "message", T: () => User, options: { "buf.validate.field": { required: true } } },
745
847
  { no: 2, name: "documents", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DocumentShort, options: { "buf.validate.field": { repeated: { maxItems: "12" } } } },
746
848
  { no: 3, name: "users", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UserShort, options: { "buf.validate.field": { repeated: { maxItems: "12" } } } },
@@ -767,7 +869,7 @@ class TemplateData$Type extends MessageType<TemplateData> {
767
869
  case /* repeated resources.documents.DocumentShort documents */ 2:
768
870
  message.documents.push(DocumentShort.internalBinaryRead(reader, reader.uint32(), options));
769
871
  break;
770
- case /* repeated resources.users.UserShort users */ 3:
872
+ case /* repeated resources.users.short.UserShort users */ 3:
771
873
  message.users.push(UserShort.internalBinaryRead(reader, reader.uint32(), options));
772
874
  break;
773
875
  case /* repeated resources.vehicles.Vehicle vehicles */ 4:
@@ -791,7 +893,7 @@ class TemplateData$Type extends MessageType<TemplateData> {
791
893
  /* repeated resources.documents.DocumentShort documents = 2; */
792
894
  for (let i = 0; i < message.documents.length; i++)
793
895
  DocumentShort.internalBinaryWrite(message.documents[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
794
- /* repeated resources.users.UserShort users = 3; */
896
+ /* repeated resources.users.short.UserShort users = 3; */
795
897
  for (let i = 0; i < message.users.length; i++)
796
898
  UserShort.internalBinaryWrite(message.users[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
797
899
  /* repeated resources.vehicles.Vehicle vehicles = 4; */
@@ -804,13 +906,13 @@ class TemplateData$Type extends MessageType<TemplateData> {
804
906
  }
805
907
  }
806
908
  /**
807
- * @generated MessageType for protobuf message resources.documents.TemplateData
909
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateData
808
910
  */
809
911
  export const TemplateData = new TemplateData$Type();
810
912
  // @generated message type with reflection information, may provide speed optimized methods
811
913
  class TemplateJobAccess$Type extends MessageType<TemplateJobAccess> {
812
914
  constructor() {
813
- super("resources.documents.TemplateJobAccess", [
915
+ super("resources.documents.templates.TemplateJobAccess", [
814
916
  { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "tagger.tags": "alias:\"id\"" } },
815
917
  { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
816
918
  { no: 3, name: "target_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "tagger.tags": "alias:\"template_id\"" } },
@@ -818,7 +920,7 @@ class TemplateJobAccess$Type extends MessageType<TemplateJobAccess> {
818
920
  { no: 5, name: "job_label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } },
819
921
  { no: 6, name: "minimum_grade", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: 0 } } } },
820
922
  { no: 7, name: "job_grade_label", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } },
821
- { no: 8, name: "access", kind: "enum", T: () => ["resources.documents.AccessLevel", AccessLevel, "ACCESS_LEVEL_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } }
923
+ { no: 8, name: "access", kind: "enum", T: () => ["resources.documents.access.AccessLevel", AccessLevel, "ACCESS_LEVEL_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } }
822
924
  ]);
823
925
  }
824
926
  create(value?: PartialMessage<TemplateJobAccess>): TemplateJobAccess {
@@ -858,7 +960,7 @@ class TemplateJobAccess$Type extends MessageType<TemplateJobAccess> {
858
960
  case /* optional string job_grade_label */ 7:
859
961
  message.jobGradeLabel = reader.string();
860
962
  break;
861
- case /* resources.documents.AccessLevel access */ 8:
963
+ case /* resources.documents.access.AccessLevel access */ 8:
862
964
  message.access = reader.int32();
863
965
  break;
864
966
  default:
@@ -894,7 +996,7 @@ class TemplateJobAccess$Type extends MessageType<TemplateJobAccess> {
894
996
  /* optional string job_grade_label = 7; */
895
997
  if (message.jobGradeLabel !== undefined)
896
998
  writer.tag(7, WireType.LengthDelimited).string(message.jobGradeLabel);
897
- /* resources.documents.AccessLevel access = 8; */
999
+ /* resources.documents.access.AccessLevel access = 8; */
898
1000
  if (message.access !== 0)
899
1001
  writer.tag(8, WireType.Varint).int32(message.access);
900
1002
  let u = options.writeUnknownFields;
@@ -904,13 +1006,13 @@ class TemplateJobAccess$Type extends MessageType<TemplateJobAccess> {
904
1006
  }
905
1007
  }
906
1008
  /**
907
- * @generated MessageType for protobuf message resources.documents.TemplateJobAccess
1009
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateJobAccess
908
1010
  */
909
1011
  export const TemplateJobAccess = new TemplateJobAccess$Type();
910
1012
  // @generated message type with reflection information, may provide speed optimized methods
911
1013
  class TemplateUserAccess$Type extends MessageType<TemplateUserAccess> {
912
1014
  constructor() {
913
- super("resources.documents.TemplateUserAccess", []);
1015
+ super("resources.documents.templates.TemplateUserAccess", []);
914
1016
  }
915
1017
  create(value?: PartialMessage<TemplateUserAccess>): TemplateUserAccess {
916
1018
  const message = globalThis.Object.create((this.messagePrototype!));
@@ -942,6 +1044,246 @@ class TemplateUserAccess$Type extends MessageType<TemplateUserAccess> {
942
1044
  }
943
1045
  }
944
1046
  /**
945
- * @generated MessageType for protobuf message resources.documents.TemplateUserAccess
1047
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateUserAccess
946
1048
  */
947
1049
  export const TemplateUserAccess = new TemplateUserAccess$Type();
1050
+ // @generated message type with reflection information, may provide speed optimized methods
1051
+ class TemplateApproval$Type extends MessageType<TemplateApproval> {
1052
+ constructor() {
1053
+ super("resources.documents.templates.TemplateApproval", [
1054
+ { no: 1, name: "enabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
1055
+ { no: 2, name: "policy", kind: "message", T: () => TemplateApprovalPolicy },
1056
+ { no: 3, name: "tasks", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => TemplateApprovalTaskSeed, options: { "buf.validate.field": { repeated: { maxItems: "5" } } } }
1057
+ ], { "codegen.dbscanner.dbscanner": { enabled: true } });
1058
+ }
1059
+ create(value?: PartialMessage<TemplateApproval>): TemplateApproval {
1060
+ const message = globalThis.Object.create((this.messagePrototype!));
1061
+ message.enabled = false;
1062
+ message.tasks = [];
1063
+ if (value !== undefined)
1064
+ reflectionMergePartial<TemplateApproval>(this, message, value);
1065
+ return message;
1066
+ }
1067
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TemplateApproval): TemplateApproval {
1068
+ let message = target ?? this.create(), end = reader.pos + length;
1069
+ while (reader.pos < end) {
1070
+ let [fieldNo, wireType] = reader.tag();
1071
+ switch (fieldNo) {
1072
+ case /* bool enabled */ 1:
1073
+ message.enabled = reader.bool();
1074
+ break;
1075
+ case /* optional resources.documents.templates.TemplateApprovalPolicy policy */ 2:
1076
+ message.policy = TemplateApprovalPolicy.internalBinaryRead(reader, reader.uint32(), options, message.policy);
1077
+ break;
1078
+ case /* repeated resources.documents.templates.TemplateApprovalTaskSeed tasks */ 3:
1079
+ message.tasks.push(TemplateApprovalTaskSeed.internalBinaryRead(reader, reader.uint32(), options));
1080
+ break;
1081
+ default:
1082
+ let u = options.readUnknownField;
1083
+ if (u === "throw")
1084
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1085
+ let d = reader.skip(wireType);
1086
+ if (u !== false)
1087
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1088
+ }
1089
+ }
1090
+ return message;
1091
+ }
1092
+ internalBinaryWrite(message: TemplateApproval, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1093
+ /* bool enabled = 1; */
1094
+ if (message.enabled !== false)
1095
+ writer.tag(1, WireType.Varint).bool(message.enabled);
1096
+ /* optional resources.documents.templates.TemplateApprovalPolicy policy = 2; */
1097
+ if (message.policy)
1098
+ TemplateApprovalPolicy.internalBinaryWrite(message.policy, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1099
+ /* repeated resources.documents.templates.TemplateApprovalTaskSeed tasks = 3; */
1100
+ for (let i = 0; i < message.tasks.length; i++)
1101
+ TemplateApprovalTaskSeed.internalBinaryWrite(message.tasks[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1102
+ let u = options.writeUnknownFields;
1103
+ if (u !== false)
1104
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1105
+ return writer;
1106
+ }
1107
+ }
1108
+ /**
1109
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateApproval
1110
+ */
1111
+ export const TemplateApproval = new TemplateApproval$Type();
1112
+ // @generated message type with reflection information, may provide speed optimized methods
1113
+ class TemplateApprovalPolicy$Type extends MessageType<TemplateApprovalPolicy> {
1114
+ constructor() {
1115
+ super("resources.documents.templates.TemplateApprovalPolicy", [
1116
+ { no: 1, name: "rule_kind", kind: "enum", T: () => ["resources.documents.approval.ApprovalRuleKind", ApprovalRuleKind, "APPROVAL_RULE_KIND_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } },
1117
+ { no: 2, name: "on_edit_behavior", kind: "enum", T: () => ["resources.documents.approval.OnEditBehavior", OnEditBehavior, "ON_EDIT_BEHAVIOR_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } },
1118
+ { no: 3, name: "required_count", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: 1 } } } },
1119
+ { no: 4, name: "signature_required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
1120
+ { no: 5, name: "self_approve_allowed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
1121
+ ]);
1122
+ }
1123
+ create(value?: PartialMessage<TemplateApprovalPolicy>): TemplateApprovalPolicy {
1124
+ const message = globalThis.Object.create((this.messagePrototype!));
1125
+ message.ruleKind = 0;
1126
+ message.onEditBehavior = 0;
1127
+ message.signatureRequired = false;
1128
+ message.selfApproveAllowed = false;
1129
+ if (value !== undefined)
1130
+ reflectionMergePartial<TemplateApprovalPolicy>(this, message, value);
1131
+ return message;
1132
+ }
1133
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TemplateApprovalPolicy): TemplateApprovalPolicy {
1134
+ let message = target ?? this.create(), end = reader.pos + length;
1135
+ while (reader.pos < end) {
1136
+ let [fieldNo, wireType] = reader.tag();
1137
+ switch (fieldNo) {
1138
+ case /* resources.documents.approval.ApprovalRuleKind rule_kind */ 1:
1139
+ message.ruleKind = reader.int32();
1140
+ break;
1141
+ case /* resources.documents.approval.OnEditBehavior on_edit_behavior */ 2:
1142
+ message.onEditBehavior = reader.int32();
1143
+ break;
1144
+ case /* optional int32 required_count */ 3:
1145
+ message.requiredCount = reader.int32();
1146
+ break;
1147
+ case /* bool signature_required */ 4:
1148
+ message.signatureRequired = reader.bool();
1149
+ break;
1150
+ case /* bool self_approve_allowed */ 5:
1151
+ message.selfApproveAllowed = reader.bool();
1152
+ break;
1153
+ default:
1154
+ let u = options.readUnknownField;
1155
+ if (u === "throw")
1156
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1157
+ let d = reader.skip(wireType);
1158
+ if (u !== false)
1159
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1160
+ }
1161
+ }
1162
+ return message;
1163
+ }
1164
+ internalBinaryWrite(message: TemplateApprovalPolicy, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1165
+ /* resources.documents.approval.ApprovalRuleKind rule_kind = 1; */
1166
+ if (message.ruleKind !== 0)
1167
+ writer.tag(1, WireType.Varint).int32(message.ruleKind);
1168
+ /* resources.documents.approval.OnEditBehavior on_edit_behavior = 2; */
1169
+ if (message.onEditBehavior !== 0)
1170
+ writer.tag(2, WireType.Varint).int32(message.onEditBehavior);
1171
+ /* optional int32 required_count = 3; */
1172
+ if (message.requiredCount !== undefined)
1173
+ writer.tag(3, WireType.Varint).int32(message.requiredCount);
1174
+ /* bool signature_required = 4; */
1175
+ if (message.signatureRequired !== false)
1176
+ writer.tag(4, WireType.Varint).bool(message.signatureRequired);
1177
+ /* bool self_approve_allowed = 5; */
1178
+ if (message.selfApproveAllowed !== false)
1179
+ writer.tag(5, WireType.Varint).bool(message.selfApproveAllowed);
1180
+ let u = options.writeUnknownFields;
1181
+ if (u !== false)
1182
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1183
+ return writer;
1184
+ }
1185
+ }
1186
+ /**
1187
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateApprovalPolicy
1188
+ */
1189
+ export const TemplateApprovalPolicy = new TemplateApprovalPolicy$Type();
1190
+ // @generated message type with reflection information, may provide speed optimized methods
1191
+ class TemplateApprovalTaskSeed$Type extends MessageType<TemplateApprovalTaskSeed> {
1192
+ constructor() {
1193
+ super("resources.documents.templates.TemplateApprovalTaskSeed", [
1194
+ { no: 1, name: "user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
1195
+ { no: 2, name: "job", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1196
+ { no: 3, name: "minimum_grade", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
1197
+ { 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 } } },
1198
+ { no: 5, name: "signature_required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
1199
+ { no: 6, name: "slots", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { lte: 5, gte: 1 } } } },
1200
+ { no: 7, name: "due_in_days", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
1201
+ { no: 8, name: "comment", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
1202
+ ]);
1203
+ }
1204
+ create(value?: PartialMessage<TemplateApprovalTaskSeed>): TemplateApprovalTaskSeed {
1205
+ const message = globalThis.Object.create((this.messagePrototype!));
1206
+ message.userId = 0;
1207
+ message.job = "";
1208
+ message.minimumGrade = 0;
1209
+ message.signatureRequired = false;
1210
+ message.slots = 0;
1211
+ if (value !== undefined)
1212
+ reflectionMergePartial<TemplateApprovalTaskSeed>(this, message, value);
1213
+ return message;
1214
+ }
1215
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TemplateApprovalTaskSeed): TemplateApprovalTaskSeed {
1216
+ let message = target ?? this.create(), end = reader.pos + length;
1217
+ while (reader.pos < end) {
1218
+ let [fieldNo, wireType] = reader.tag();
1219
+ switch (fieldNo) {
1220
+ case /* int32 user_id */ 1:
1221
+ message.userId = reader.int32();
1222
+ break;
1223
+ case /* string job */ 2:
1224
+ message.job = reader.string();
1225
+ break;
1226
+ case /* int32 minimum_grade */ 3:
1227
+ message.minimumGrade = reader.int32();
1228
+ break;
1229
+ case /* optional string label */ 4:
1230
+ message.label = reader.string();
1231
+ break;
1232
+ case /* bool signature_required */ 5:
1233
+ message.signatureRequired = reader.bool();
1234
+ break;
1235
+ case /* int32 slots */ 6:
1236
+ message.slots = reader.int32();
1237
+ break;
1238
+ case /* optional int32 due_in_days */ 7:
1239
+ message.dueInDays = reader.int32();
1240
+ break;
1241
+ case /* optional string comment */ 8:
1242
+ message.comment = reader.string();
1243
+ break;
1244
+ default:
1245
+ let u = options.readUnknownField;
1246
+ if (u === "throw")
1247
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1248
+ let d = reader.skip(wireType);
1249
+ if (u !== false)
1250
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1251
+ }
1252
+ }
1253
+ return message;
1254
+ }
1255
+ internalBinaryWrite(message: TemplateApprovalTaskSeed, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1256
+ /* int32 user_id = 1; */
1257
+ if (message.userId !== 0)
1258
+ writer.tag(1, WireType.Varint).int32(message.userId);
1259
+ /* string job = 2; */
1260
+ if (message.job !== "")
1261
+ writer.tag(2, WireType.LengthDelimited).string(message.job);
1262
+ /* int32 minimum_grade = 3; */
1263
+ if (message.minimumGrade !== 0)
1264
+ writer.tag(3, WireType.Varint).int32(message.minimumGrade);
1265
+ /* optional string label = 4; */
1266
+ if (message.label !== undefined)
1267
+ writer.tag(4, WireType.LengthDelimited).string(message.label);
1268
+ /* bool signature_required = 5; */
1269
+ if (message.signatureRequired !== false)
1270
+ writer.tag(5, WireType.Varint).bool(message.signatureRequired);
1271
+ /* int32 slots = 6; */
1272
+ if (message.slots !== 0)
1273
+ writer.tag(6, WireType.Varint).int32(message.slots);
1274
+ /* optional int32 due_in_days = 7; */
1275
+ if (message.dueInDays !== undefined)
1276
+ writer.tag(7, WireType.Varint).int32(message.dueInDays);
1277
+ /* optional string comment = 8; */
1278
+ if (message.comment !== undefined)
1279
+ writer.tag(8, WireType.LengthDelimited).string(message.comment);
1280
+ let u = options.writeUnknownFields;
1281
+ if (u !== false)
1282
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1283
+ return writer;
1284
+ }
1285
+ }
1286
+ /**
1287
+ * @generated MessageType for protobuf message resources.documents.templates.TemplateApprovalTaskSeed
1288
+ */
1289
+ export const TemplateApprovalTaskSeed = new TemplateApprovalTaskSeed$Type();