@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
@@ -12,41 +12,15 @@ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
12
12
  import type { PartialMessage } from "@protobuf-ts/runtime";
13
13
  import { reflectionMergePartial } from "@protobuf-ts/runtime";
14
14
  import { MessageType } from "@protobuf-ts/runtime";
15
- import { RoleAttribute } from "../../resources/permissions/attributes";
16
- import { Permission } from "../../resources/permissions/permissions";
17
- import { User } from "../../resources/users/users";
18
- import { JobProps } from "../../resources/jobs/job_props";
15
+ import { RoleAttribute } from "../../resources/permissions/attributes/attributes";
16
+ import { Permission } from "../../resources/permissions/permissions/permissions";
17
+ import { User } from "../../resources/users/user";
18
+ import { JobProps } from "../../resources/jobs/props/props";
19
19
  import { Character } from "../../resources/accounts/accounts";
20
- import { OAuth2Account } from "../../resources/accounts/oauth2";
21
- import { OAuth2Provider } from "../../resources/accounts/oauth2";
20
+ import { OAuth2Account } from "../../resources/accounts/oauth2/oauth2";
21
+ import { OAuth2Provider } from "../../resources/accounts/oauth2/oauth2";
22
22
  import { Account } from "../../resources/accounts/accounts";
23
23
  import { Timestamp } from "../../resources/timestamp/timestamp";
24
- /**
25
- * @generated from protobuf message services.auth.CreateAccountRequest
26
- */
27
- export interface CreateAccountRequest {
28
- /**
29
- * @generated from protobuf field: string reg_token = 1
30
- */
31
- regToken: string;
32
- /**
33
- * @generated from protobuf field: string username = 2
34
- */
35
- username: string;
36
- /**
37
- * @generated from protobuf field: string password = 3
38
- */
39
- password: string;
40
- }
41
- /**
42
- * @generated from protobuf message services.auth.CreateAccountResponse
43
- */
44
- export interface CreateAccountResponse {
45
- /**
46
- * @generated from protobuf field: int64 account_id = 1
47
- */
48
- accountId: number;
49
- }
50
24
  /**
51
25
  * @generated from protobuf message services.auth.LoginRequest
52
26
  */
@@ -91,40 +65,62 @@ export interface LogoutResponse {
91
65
  */
92
66
  success: boolean;
93
67
  }
68
+ /**
69
+ * @generated from protobuf message services.auth.CreateAccountRequest
70
+ */
71
+ export interface CreateAccountRequest {
72
+ /**
73
+ * @generated from protobuf field: string reg_token = 1
74
+ */
75
+ regToken: string;
76
+ /**
77
+ * @generated from protobuf field: string username = 2
78
+ */
79
+ username: string;
80
+ /**
81
+ * @generated from protobuf field: string password = 3
82
+ */
83
+ password: string;
84
+ }
85
+ /**
86
+ * @generated from protobuf message services.auth.CreateAccountResponse
87
+ */
88
+ export interface CreateAccountResponse {
89
+ /**
90
+ * @generated from protobuf field: int64 account_id = 1
91
+ */
92
+ accountId: number;
93
+ }
94
94
  /**
95
95
  * @generated from protobuf message services.auth.ChangePasswordRequest
96
96
  */
97
97
  export interface ChangePasswordRequest {
98
98
  /**
99
- * @generated from protobuf field: string current = 1
99
+ * @generated from protobuf field: string current_password = 1
100
100
  */
101
- current: string;
101
+ currentPassword: string;
102
102
  /**
103
- * @generated from protobuf field: string new = 2
103
+ * @generated from protobuf field: string new_password = 2
104
104
  */
105
- new: string;
105
+ newPassword: string;
106
106
  }
107
107
  /**
108
108
  * @generated from protobuf message services.auth.ChangePasswordResponse
109
109
  */
110
110
  export interface ChangePasswordResponse {
111
- /**
112
- * @generated from protobuf field: resources.timestamp.Timestamp expires = 1
113
- */
114
- expires?: Timestamp;
115
111
  }
116
112
  /**
117
113
  * @generated from protobuf message services.auth.ChangeUsernameRequest
118
114
  */
119
115
  export interface ChangeUsernameRequest {
120
116
  /**
121
- * @generated from protobuf field: string current = 1
117
+ * @generated from protobuf field: string current_username = 1
122
118
  */
123
- current: string;
119
+ currentUsername: string;
124
120
  /**
125
- * @generated from protobuf field: string new = 2
121
+ * @generated from protobuf field: string new_username = 2
126
122
  */
127
- new: string;
123
+ newUsername: string;
128
124
  }
129
125
  /**
130
126
  * @generated from protobuf message services.auth.ChangeUsernameResponse
@@ -163,11 +159,11 @@ export interface GetAccountInfoResponse {
163
159
  */
164
160
  account?: Account;
165
161
  /**
166
- * @generated from protobuf field: repeated resources.accounts.OAuth2Provider oauth2_providers = 2
162
+ * @generated from protobuf field: repeated resources.accounts.oauth2.OAuth2Provider oauth2_providers = 2
167
163
  */
168
164
  oauth2Providers: OAuth2Provider[];
169
165
  /**
170
- * @generated from protobuf field: repeated resources.accounts.OAuth2Account oauth2_connections = 3
166
+ * @generated from protobuf field: repeated resources.accounts.oauth2.OAuth2Account oauth2_connections = 3
171
167
  */
172
168
  oauth2Connections: OAuth2Account[];
173
169
  }
@@ -199,43 +195,85 @@ export interface ChooseCharacterRequest {
199
195
  */
200
196
  export interface ChooseCharacterResponse {
201
197
  /**
202
- * @generated from protobuf field: string username = 1
198
+ * @generated from protobuf field: string token = 1
199
+ */
200
+ token: string;
201
+ /**
202
+ * @generated from protobuf field: string username = 2
203
203
  */
204
204
  username: string;
205
205
  /**
206
- * @generated from protobuf field: resources.timestamp.Timestamp expires = 2
206
+ * @generated from protobuf field: resources.timestamp.Timestamp expires = 3
207
207
  */
208
208
  expires?: Timestamp;
209
209
  /**
210
- * @generated from protobuf field: resources.jobs.JobProps job_props = 3
210
+ * @generated from protobuf field: resources.jobs.props.JobProps job_props = 4
211
211
  */
212
212
  jobProps?: JobProps;
213
213
  /**
214
- * @generated from protobuf field: resources.users.User char = 4
214
+ * @generated from protobuf field: resources.users.User char = 5
215
+ */
216
+ char?: User;
217
+ /**
218
+ * @generated from protobuf field: repeated resources.permissions.permissions.Permission permissions = 6
219
+ */
220
+ permissions: Permission[];
221
+ /**
222
+ * @generated from protobuf field: repeated resources.permissions.attributes.RoleAttribute attributes = 7
223
+ */
224
+ attributes: RoleAttribute[];
225
+ }
226
+ /**
227
+ * @generated from protobuf message services.auth.ImpersonateJobRequest
228
+ */
229
+ export interface ImpersonateJobRequest {
230
+ /**
231
+ * @generated from protobuf field: int32 job_grade = 1
232
+ */
233
+ jobGrade: number;
234
+ }
235
+ /**
236
+ * @generated from protobuf message services.auth.ImpersonateJobResponse
237
+ */
238
+ export interface ImpersonateJobResponse {
239
+ /**
240
+ * @generated from protobuf field: string token = 1
241
+ */
242
+ token: string;
243
+ /**
244
+ * @generated from protobuf field: resources.timestamp.Timestamp expires = 2
245
+ */
246
+ expires?: Timestamp;
247
+ /**
248
+ * @generated from protobuf field: resources.users.User char = 3
215
249
  */
216
250
  char?: User;
217
251
  /**
218
- * @generated from protobuf field: repeated resources.permissions.Permission permissions = 5
252
+ * @generated from protobuf field: repeated resources.permissions.permissions.Permission permissions = 4
219
253
  */
220
254
  permissions: Permission[];
221
255
  /**
222
- * @generated from protobuf field: repeated resources.permissions.RoleAttribute attributes = 6
256
+ * @generated from protobuf field: repeated resources.permissions.attributes.RoleAttribute attributes = 5
223
257
  */
224
258
  attributes: RoleAttribute[];
259
+ /**
260
+ * @generated from protobuf field: bool state = 6
261
+ */
262
+ state: boolean;
225
263
  }
226
264
  /**
227
- * @generated from protobuf message services.auth.DeleteOAuth2ConnectionRequest
265
+ * @generated from protobuf message services.auth.DeleteSocialLoginRequest
228
266
  */
229
- export interface DeleteOAuth2ConnectionRequest {
267
+ export interface DeleteSocialLoginRequest {
230
268
  /**
231
269
  * @generated from protobuf field: string provider = 1
232
270
  */
233
271
  provider: string;
234
272
  }
235
273
  /**
236
- * @generated from protobuf message services.auth.DeleteOAuth2ConnectionResponse
274
+ * @generated from protobuf message services.auth.DeleteSocialLoginResponse
237
275
  */
238
- export interface DeleteOAuth2ConnectionResponse {
276
+ export interface DeleteSocialLoginResponse {
239
277
  /**
240
278
  * @generated from protobuf field: bool success = 1
241
279
  */
@@ -258,12 +296,16 @@ export interface SetSuperuserModeRequest {
258
296
  * @generated from protobuf message services.auth.SetSuperuserModeResponse
259
297
  */
260
298
  export interface SetSuperuserModeResponse {
299
+ /**
300
+ * @generated from protobuf field: string token = 1
301
+ */
302
+ token: string;
261
303
  /**
262
304
  * @generated from protobuf field: resources.timestamp.Timestamp expires = 2
263
305
  */
264
306
  expires?: Timestamp;
265
307
  /**
266
- * @generated from protobuf field: optional resources.jobs.JobProps job_props = 3
308
+ * @generated from protobuf field: optional resources.jobs.props.JobProps job_props = 3
267
309
  */
268
310
  jobProps?: JobProps;
269
311
  /**
@@ -271,130 +313,20 @@ export interface SetSuperuserModeResponse {
271
313
  */
272
314
  char?: User;
273
315
  /**
274
- * @generated from protobuf field: repeated resources.permissions.Permission permissions = 5
316
+ * @generated from protobuf field: repeated resources.permissions.permissions.Permission permissions = 5
275
317
  */
276
318
  permissions: Permission[];
277
319
  /**
278
- * @generated from protobuf field: repeated resources.permissions.RoleAttribute attributes = 6
320
+ * @generated from protobuf field: repeated resources.permissions.attributes.RoleAttribute attributes = 6
279
321
  */
280
322
  attributes: RoleAttribute[];
281
323
  }
282
324
  // @generated message type with reflection information, may provide speed optimized methods
283
- class CreateAccountRequest$Type extends MessageType<CreateAccountRequest> {
284
- constructor() {
285
- super("services.auth.CreateAccountRequest", [
286
- { no: 1, name: "reg_token", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { len: "6", pattern: "^[0-9]{6}$" } } } },
287
- { no: 2, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "24", pattern: "(?i)^[0-9A-Z\u00C4\u00D6\u00DC\u00DF_-]{3,24}$" } } } },
288
- { no: 3, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } }
289
- ]);
290
- }
291
- create(value?: PartialMessage<CreateAccountRequest>): CreateAccountRequest {
292
- const message = globalThis.Object.create((this.messagePrototype!));
293
- message.regToken = "";
294
- message.username = "";
295
- message.password = "";
296
- if (value !== undefined)
297
- reflectionMergePartial<CreateAccountRequest>(this, message, value);
298
- return message;
299
- }
300
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateAccountRequest): CreateAccountRequest {
301
- let message = target ?? this.create(), end = reader.pos + length;
302
- while (reader.pos < end) {
303
- let [fieldNo, wireType] = reader.tag();
304
- switch (fieldNo) {
305
- case /* string reg_token */ 1:
306
- message.regToken = reader.string();
307
- break;
308
- case /* string username */ 2:
309
- message.username = reader.string();
310
- break;
311
- case /* string password */ 3:
312
- message.password = reader.string();
313
- break;
314
- default:
315
- let u = options.readUnknownField;
316
- if (u === "throw")
317
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
318
- let d = reader.skip(wireType);
319
- if (u !== false)
320
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
321
- }
322
- }
323
- return message;
324
- }
325
- internalBinaryWrite(message: CreateAccountRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
326
- /* string reg_token = 1; */
327
- if (message.regToken !== "")
328
- writer.tag(1, WireType.LengthDelimited).string(message.regToken);
329
- /* string username = 2; */
330
- if (message.username !== "")
331
- writer.tag(2, WireType.LengthDelimited).string(message.username);
332
- /* string password = 3; */
333
- if (message.password !== "")
334
- writer.tag(3, WireType.LengthDelimited).string(message.password);
335
- let u = options.writeUnknownFields;
336
- if (u !== false)
337
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
338
- return writer;
339
- }
340
- }
341
- /**
342
- * @generated MessageType for protobuf message services.auth.CreateAccountRequest
343
- */
344
- export const CreateAccountRequest = new CreateAccountRequest$Type();
345
- // @generated message type with reflection information, may provide speed optimized methods
346
- class CreateAccountResponse$Type extends MessageType<CreateAccountResponse> {
347
- constructor() {
348
- super("services.auth.CreateAccountResponse", [
349
- { no: 1, name: "account_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }
350
- ]);
351
- }
352
- create(value?: PartialMessage<CreateAccountResponse>): CreateAccountResponse {
353
- const message = globalThis.Object.create((this.messagePrototype!));
354
- message.accountId = 0;
355
- if (value !== undefined)
356
- reflectionMergePartial<CreateAccountResponse>(this, message, value);
357
- return message;
358
- }
359
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateAccountResponse): CreateAccountResponse {
360
- let message = target ?? this.create(), end = reader.pos + length;
361
- while (reader.pos < end) {
362
- let [fieldNo, wireType] = reader.tag();
363
- switch (fieldNo) {
364
- case /* int64 account_id */ 1:
365
- message.accountId = reader.int64().toNumber();
366
- break;
367
- default:
368
- let u = options.readUnknownField;
369
- if (u === "throw")
370
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
371
- let d = reader.skip(wireType);
372
- if (u !== false)
373
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
374
- }
375
- }
376
- return message;
377
- }
378
- internalBinaryWrite(message: CreateAccountResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
379
- /* int64 account_id = 1; */
380
- if (message.accountId !== 0)
381
- writer.tag(1, WireType.Varint).int64(message.accountId);
382
- let u = options.writeUnknownFields;
383
- if (u !== false)
384
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
385
- return writer;
386
- }
387
- }
388
- /**
389
- * @generated MessageType for protobuf message services.auth.CreateAccountResponse
390
- */
391
- export const CreateAccountResponse = new CreateAccountResponse$Type();
392
- // @generated message type with reflection information, may provide speed optimized methods
393
325
  class LoginRequest$Type extends MessageType<LoginRequest> {
394
326
  constructor() {
395
327
  super("services.auth.LoginRequest", [
396
328
  { no: 1, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "24", pattern: "(?i)^[0-9A-Z\u00C4\u00D6\u00DC\u00DF_-]{3,24}$" } } } },
397
- { no: 2, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } }
329
+ { no: 2, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "codegen.audit.redacted": true, "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } }
398
330
  ]);
399
331
  }
400
332
  create(value?: PartialMessage<LoginRequest>): LoginRequest {
@@ -591,17 +523,127 @@ class LogoutResponse$Type extends MessageType<LogoutResponse> {
591
523
  */
592
524
  export const LogoutResponse = new LogoutResponse$Type();
593
525
  // @generated message type with reflection information, may provide speed optimized methods
526
+ class CreateAccountRequest$Type extends MessageType<CreateAccountRequest> {
527
+ constructor() {
528
+ super("services.auth.CreateAccountRequest", [
529
+ { no: 1, name: "reg_token", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "codegen.audit.redacted": true, "buf.validate.field": { string: { len: "6", pattern: "^[0-9]{6}$" } } } },
530
+ { no: 2, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "24", pattern: "(?i)^[0-9A-Z\u00C4\u00D6\u00DC\u00DF_-]{3,24}$" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } },
531
+ { no: 3, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "codegen.audit.redacted": true, "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } }
532
+ ]);
533
+ }
534
+ create(value?: PartialMessage<CreateAccountRequest>): CreateAccountRequest {
535
+ const message = globalThis.Object.create((this.messagePrototype!));
536
+ message.regToken = "";
537
+ message.username = "";
538
+ message.password = "";
539
+ if (value !== undefined)
540
+ reflectionMergePartial<CreateAccountRequest>(this, message, value);
541
+ return message;
542
+ }
543
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateAccountRequest): CreateAccountRequest {
544
+ let message = target ?? this.create(), end = reader.pos + length;
545
+ while (reader.pos < end) {
546
+ let [fieldNo, wireType] = reader.tag();
547
+ switch (fieldNo) {
548
+ case /* string reg_token */ 1:
549
+ message.regToken = reader.string();
550
+ break;
551
+ case /* string username */ 2:
552
+ message.username = reader.string();
553
+ break;
554
+ case /* string password */ 3:
555
+ message.password = reader.string();
556
+ break;
557
+ default:
558
+ let u = options.readUnknownField;
559
+ if (u === "throw")
560
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
561
+ let d = reader.skip(wireType);
562
+ if (u !== false)
563
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
564
+ }
565
+ }
566
+ return message;
567
+ }
568
+ internalBinaryWrite(message: CreateAccountRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
569
+ /* string reg_token = 1; */
570
+ if (message.regToken !== "")
571
+ writer.tag(1, WireType.LengthDelimited).string(message.regToken);
572
+ /* string username = 2; */
573
+ if (message.username !== "")
574
+ writer.tag(2, WireType.LengthDelimited).string(message.username);
575
+ /* string password = 3; */
576
+ if (message.password !== "")
577
+ writer.tag(3, WireType.LengthDelimited).string(message.password);
578
+ let u = options.writeUnknownFields;
579
+ if (u !== false)
580
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
581
+ return writer;
582
+ }
583
+ }
584
+ /**
585
+ * @generated MessageType for protobuf message services.auth.CreateAccountRequest
586
+ */
587
+ export const CreateAccountRequest = new CreateAccountRequest$Type();
588
+ // @generated message type with reflection information, may provide speed optimized methods
589
+ class CreateAccountResponse$Type extends MessageType<CreateAccountResponse> {
590
+ constructor() {
591
+ super("services.auth.CreateAccountResponse", [
592
+ { no: 1, name: "account_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }
593
+ ]);
594
+ }
595
+ create(value?: PartialMessage<CreateAccountResponse>): CreateAccountResponse {
596
+ const message = globalThis.Object.create((this.messagePrototype!));
597
+ message.accountId = 0;
598
+ if (value !== undefined)
599
+ reflectionMergePartial<CreateAccountResponse>(this, message, value);
600
+ return message;
601
+ }
602
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateAccountResponse): CreateAccountResponse {
603
+ let message = target ?? this.create(), end = reader.pos + length;
604
+ while (reader.pos < end) {
605
+ let [fieldNo, wireType] = reader.tag();
606
+ switch (fieldNo) {
607
+ case /* int64 account_id */ 1:
608
+ message.accountId = reader.int64().toNumber();
609
+ break;
610
+ default:
611
+ let u = options.readUnknownField;
612
+ if (u === "throw")
613
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
614
+ let d = reader.skip(wireType);
615
+ if (u !== false)
616
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
617
+ }
618
+ }
619
+ return message;
620
+ }
621
+ internalBinaryWrite(message: CreateAccountResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
622
+ /* int64 account_id = 1; */
623
+ if (message.accountId !== 0)
624
+ writer.tag(1, WireType.Varint).int64(message.accountId);
625
+ let u = options.writeUnknownFields;
626
+ if (u !== false)
627
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
628
+ return writer;
629
+ }
630
+ }
631
+ /**
632
+ * @generated MessageType for protobuf message services.auth.CreateAccountResponse
633
+ */
634
+ export const CreateAccountResponse = new CreateAccountResponse$Type();
635
+ // @generated message type with reflection information, may provide speed optimized methods
594
636
  class ChangePasswordRequest$Type extends MessageType<ChangePasswordRequest> {
595
637
  constructor() {
596
638
  super("services.auth.ChangePasswordRequest", [
597
- { no: 1, name: "current", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } },
598
- { no: 2, name: "new", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } }
639
+ { no: 1, name: "current_password", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "codegen.audit.redacted": true, "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } },
640
+ { no: 2, name: "new_password", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "codegen.audit.redacted": true, "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } }
599
641
  ]);
600
642
  }
601
643
  create(value?: PartialMessage<ChangePasswordRequest>): ChangePasswordRequest {
602
644
  const message = globalThis.Object.create((this.messagePrototype!));
603
- message.current = "";
604
- message.new = "";
645
+ message.currentPassword = "";
646
+ message.newPassword = "";
605
647
  if (value !== undefined)
606
648
  reflectionMergePartial<ChangePasswordRequest>(this, message, value);
607
649
  return message;
@@ -611,11 +653,11 @@ class ChangePasswordRequest$Type extends MessageType<ChangePasswordRequest> {
611
653
  while (reader.pos < end) {
612
654
  let [fieldNo, wireType] = reader.tag();
613
655
  switch (fieldNo) {
614
- case /* string current */ 1:
615
- message.current = reader.string();
656
+ case /* string current_password */ 1:
657
+ message.currentPassword = reader.string();
616
658
  break;
617
- case /* string new */ 2:
618
- message.new = reader.string();
659
+ case /* string new_password */ 2:
660
+ message.newPassword = reader.string();
619
661
  break;
620
662
  default:
621
663
  let u = options.readUnknownField;
@@ -629,12 +671,12 @@ class ChangePasswordRequest$Type extends MessageType<ChangePasswordRequest> {
629
671
  return message;
630
672
  }
631
673
  internalBinaryWrite(message: ChangePasswordRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
632
- /* string current = 1; */
633
- if (message.current !== "")
634
- writer.tag(1, WireType.LengthDelimited).string(message.current);
635
- /* string new = 2; */
636
- if (message.new !== "")
637
- writer.tag(2, WireType.LengthDelimited).string(message.new);
674
+ /* string current_password = 1; */
675
+ if (message.currentPassword !== "")
676
+ writer.tag(1, WireType.LengthDelimited).string(message.currentPassword);
677
+ /* string new_password = 2; */
678
+ if (message.newPassword !== "")
679
+ writer.tag(2, WireType.LengthDelimited).string(message.newPassword);
638
680
  let u = options.writeUnknownFields;
639
681
  if (u !== false)
640
682
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -648,9 +690,7 @@ export const ChangePasswordRequest = new ChangePasswordRequest$Type();
648
690
  // @generated message type with reflection information, may provide speed optimized methods
649
691
  class ChangePasswordResponse$Type extends MessageType<ChangePasswordResponse> {
650
692
  constructor() {
651
- super("services.auth.ChangePasswordResponse", [
652
- { no: 1, name: "expires", kind: "message", T: () => Timestamp }
653
- ]);
693
+ super("services.auth.ChangePasswordResponse", []);
654
694
  }
655
695
  create(value?: PartialMessage<ChangePasswordResponse>): ChangePasswordResponse {
656
696
  const message = globalThis.Object.create((this.messagePrototype!));
@@ -663,9 +703,6 @@ class ChangePasswordResponse$Type extends MessageType<ChangePasswordResponse> {
663
703
  while (reader.pos < end) {
664
704
  let [fieldNo, wireType] = reader.tag();
665
705
  switch (fieldNo) {
666
- case /* resources.timestamp.Timestamp expires */ 1:
667
- message.expires = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expires);
668
- break;
669
706
  default:
670
707
  let u = options.readUnknownField;
671
708
  if (u === "throw")
@@ -678,9 +715,6 @@ class ChangePasswordResponse$Type extends MessageType<ChangePasswordResponse> {
678
715
  return message;
679
716
  }
680
717
  internalBinaryWrite(message: ChangePasswordResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
681
- /* resources.timestamp.Timestamp expires = 1; */
682
- if (message.expires)
683
- Timestamp.internalBinaryWrite(message.expires, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
684
718
  let u = options.writeUnknownFields;
685
719
  if (u !== false)
686
720
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -695,14 +729,14 @@ export const ChangePasswordResponse = new ChangePasswordResponse$Type();
695
729
  class ChangeUsernameRequest$Type extends MessageType<ChangeUsernameRequest> {
696
730
  constructor() {
697
731
  super("services.auth.ChangeUsernameRequest", [
698
- { no: 1, name: "current", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "24", pattern: "(?i)^[0-9A-Z\u00C4\u00D6\u00DC\u00DF_-]{3,24}$" } } } },
699
- { no: 2, name: "new", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "24", pattern: "(?i)^[0-9A-Z\u00C4\u00D6\u00DC\u00DF_-]{3,24}$" } } } }
732
+ { no: 1, name: "current_username", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "24", pattern: "(?i)^[0-9A-Z\u00C4\u00D6\u00DC\u00DF_-]{3,24}$" } } } },
733
+ { no: 2, name: "new_username", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "3", maxLen: "24", pattern: "(?i)^[0-9A-Z\u00C4\u00D6\u00DC\u00DF_-]{3,24}$" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } }
700
734
  ]);
701
735
  }
702
736
  create(value?: PartialMessage<ChangeUsernameRequest>): ChangeUsernameRequest {
703
737
  const message = globalThis.Object.create((this.messagePrototype!));
704
- message.current = "";
705
- message.new = "";
738
+ message.currentUsername = "";
739
+ message.newUsername = "";
706
740
  if (value !== undefined)
707
741
  reflectionMergePartial<ChangeUsernameRequest>(this, message, value);
708
742
  return message;
@@ -712,11 +746,11 @@ class ChangeUsernameRequest$Type extends MessageType<ChangeUsernameRequest> {
712
746
  while (reader.pos < end) {
713
747
  let [fieldNo, wireType] = reader.tag();
714
748
  switch (fieldNo) {
715
- case /* string current */ 1:
716
- message.current = reader.string();
749
+ case /* string current_username */ 1:
750
+ message.currentUsername = reader.string();
717
751
  break;
718
- case /* string new */ 2:
719
- message.new = reader.string();
752
+ case /* string new_username */ 2:
753
+ message.newUsername = reader.string();
720
754
  break;
721
755
  default:
722
756
  let u = options.readUnknownField;
@@ -730,12 +764,12 @@ class ChangeUsernameRequest$Type extends MessageType<ChangeUsernameRequest> {
730
764
  return message;
731
765
  }
732
766
  internalBinaryWrite(message: ChangeUsernameRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
733
- /* string current = 1; */
734
- if (message.current !== "")
735
- writer.tag(1, WireType.LengthDelimited).string(message.current);
736
- /* string new = 2; */
737
- if (message.new !== "")
738
- writer.tag(2, WireType.LengthDelimited).string(message.new);
767
+ /* string current_username = 1; */
768
+ if (message.currentUsername !== "")
769
+ writer.tag(1, WireType.LengthDelimited).string(message.currentUsername);
770
+ /* string new_username = 2; */
771
+ if (message.newUsername !== "")
772
+ writer.tag(2, WireType.LengthDelimited).string(message.newUsername);
739
773
  let u = options.writeUnknownFields;
740
774
  if (u !== false)
741
775
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -788,8 +822,8 @@ export const ChangeUsernameResponse = new ChangeUsernameResponse$Type();
788
822
  class ForgotPasswordRequest$Type extends MessageType<ForgotPasswordRequest> {
789
823
  constructor() {
790
824
  super("services.auth.ForgotPasswordRequest", [
791
- { no: 1, name: "reg_token", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { len: "6", pattern: "^[0-9]{6}$" } } } },
792
- { no: 2, name: "new", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } }
825
+ { no: 1, name: "reg_token", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "codegen.audit.redacted": true, "buf.validate.field": { string: { len: "6", pattern: "^[0-9]{6}$" } } } },
826
+ { no: 2, name: "new", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "codegen.audit.redacted": true, "buf.validate.field": { string: { minLen: "6", maxBytes: "70" } } } }
793
827
  ]);
794
828
  }
795
829
  create(value?: PartialMessage<ForgotPasswordRequest>): ForgotPasswordRequest {
@@ -940,10 +974,10 @@ class GetAccountInfoResponse$Type extends MessageType<GetAccountInfoResponse> {
940
974
  case /* resources.accounts.Account account */ 1:
941
975
  message.account = Account.internalBinaryRead(reader, reader.uint32(), options, message.account);
942
976
  break;
943
- case /* repeated resources.accounts.OAuth2Provider oauth2_providers */ 2:
977
+ case /* repeated resources.accounts.oauth2.OAuth2Provider oauth2_providers */ 2:
944
978
  message.oauth2Providers.push(OAuth2Provider.internalBinaryRead(reader, reader.uint32(), options));
945
979
  break;
946
- case /* repeated resources.accounts.OAuth2Account oauth2_connections */ 3:
980
+ case /* repeated resources.accounts.oauth2.OAuth2Account oauth2_connections */ 3:
947
981
  message.oauth2Connections.push(OAuth2Account.internalBinaryRead(reader, reader.uint32(), options));
948
982
  break;
949
983
  default:
@@ -961,10 +995,10 @@ class GetAccountInfoResponse$Type extends MessageType<GetAccountInfoResponse> {
961
995
  /* resources.accounts.Account account = 1; */
962
996
  if (message.account)
963
997
  Account.internalBinaryWrite(message.account, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
964
- /* repeated resources.accounts.OAuth2Provider oauth2_providers = 2; */
998
+ /* repeated resources.accounts.oauth2.OAuth2Provider oauth2_providers = 2; */
965
999
  for (let i = 0; i < message.oauth2Providers.length; i++)
966
1000
  OAuth2Provider.internalBinaryWrite(message.oauth2Providers[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
967
- /* repeated resources.accounts.OAuth2Account oauth2_connections = 3; */
1001
+ /* repeated resources.accounts.oauth2.OAuth2Account oauth2_connections = 3; */
968
1002
  for (let i = 0; i < message.oauth2Connections.length; i++)
969
1003
  OAuth2Account.internalBinaryWrite(message.oauth2Connections[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
970
1004
  let u = options.writeUnknownFields;
@@ -1113,16 +1147,18 @@ export const ChooseCharacterRequest = new ChooseCharacterRequest$Type();
1113
1147
  class ChooseCharacterResponse$Type extends MessageType<ChooseCharacterResponse> {
1114
1148
  constructor() {
1115
1149
  super("services.auth.ChooseCharacterResponse", [
1116
- { no: 1, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1117
- { no: 2, name: "expires", kind: "message", T: () => Timestamp },
1118
- { no: 3, name: "job_props", kind: "message", T: () => JobProps },
1119
- { no: 4, name: "char", kind: "message", T: () => User, options: { "tagger.tags": "alias:\"user\"" } },
1120
- { no: 5, name: "permissions", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Permission },
1121
- { no: 6, name: "attributes", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RoleAttribute }
1150
+ { no: 1, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1151
+ { no: 2, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1152
+ { no: 3, name: "expires", kind: "message", T: () => Timestamp },
1153
+ { no: 4, name: "job_props", kind: "message", T: () => JobProps },
1154
+ { no: 5, name: "char", kind: "message", T: () => User, options: { "tagger.tags": "alias:\"user\"" } },
1155
+ { no: 6, name: "permissions", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Permission },
1156
+ { no: 7, name: "attributes", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RoleAttribute }
1122
1157
  ]);
1123
1158
  }
1124
1159
  create(value?: PartialMessage<ChooseCharacterResponse>): ChooseCharacterResponse {
1125
1160
  const message = globalThis.Object.create((this.messagePrototype!));
1161
+ message.token = "";
1126
1162
  message.username = "";
1127
1163
  message.permissions = [];
1128
1164
  message.attributes = [];
@@ -1135,22 +1171,25 @@ class ChooseCharacterResponse$Type extends MessageType<ChooseCharacterResponse>
1135
1171
  while (reader.pos < end) {
1136
1172
  let [fieldNo, wireType] = reader.tag();
1137
1173
  switch (fieldNo) {
1138
- case /* string username */ 1:
1174
+ case /* string token */ 1:
1175
+ message.token = reader.string();
1176
+ break;
1177
+ case /* string username */ 2:
1139
1178
  message.username = reader.string();
1140
1179
  break;
1141
- case /* resources.timestamp.Timestamp expires */ 2:
1180
+ case /* resources.timestamp.Timestamp expires */ 3:
1142
1181
  message.expires = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expires);
1143
1182
  break;
1144
- case /* resources.jobs.JobProps job_props */ 3:
1183
+ case /* resources.jobs.props.JobProps job_props */ 4:
1145
1184
  message.jobProps = JobProps.internalBinaryRead(reader, reader.uint32(), options, message.jobProps);
1146
1185
  break;
1147
- case /* resources.users.User char */ 4:
1186
+ case /* resources.users.User char */ 5:
1148
1187
  message.char = User.internalBinaryRead(reader, reader.uint32(), options, message.char);
1149
1188
  break;
1150
- case /* repeated resources.permissions.Permission permissions */ 5:
1189
+ case /* repeated resources.permissions.permissions.Permission permissions */ 6:
1151
1190
  message.permissions.push(Permission.internalBinaryRead(reader, reader.uint32(), options));
1152
1191
  break;
1153
- case /* repeated resources.permissions.RoleAttribute attributes */ 6:
1192
+ case /* repeated resources.permissions.attributes.RoleAttribute attributes */ 7:
1154
1193
  message.attributes.push(RoleAttribute.internalBinaryRead(reader, reader.uint32(), options));
1155
1194
  break;
1156
1195
  default:
@@ -1165,24 +1204,27 @@ class ChooseCharacterResponse$Type extends MessageType<ChooseCharacterResponse>
1165
1204
  return message;
1166
1205
  }
1167
1206
  internalBinaryWrite(message: ChooseCharacterResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1168
- /* string username = 1; */
1207
+ /* string token = 1; */
1208
+ if (message.token !== "")
1209
+ writer.tag(1, WireType.LengthDelimited).string(message.token);
1210
+ /* string username = 2; */
1169
1211
  if (message.username !== "")
1170
- writer.tag(1, WireType.LengthDelimited).string(message.username);
1171
- /* resources.timestamp.Timestamp expires = 2; */
1212
+ writer.tag(2, WireType.LengthDelimited).string(message.username);
1213
+ /* resources.timestamp.Timestamp expires = 3; */
1172
1214
  if (message.expires)
1173
- Timestamp.internalBinaryWrite(message.expires, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1174
- /* resources.jobs.JobProps job_props = 3; */
1215
+ Timestamp.internalBinaryWrite(message.expires, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1216
+ /* resources.jobs.props.JobProps job_props = 4; */
1175
1217
  if (message.jobProps)
1176
- JobProps.internalBinaryWrite(message.jobProps, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1177
- /* resources.users.User char = 4; */
1218
+ JobProps.internalBinaryWrite(message.jobProps, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
1219
+ /* resources.users.User char = 5; */
1178
1220
  if (message.char)
1179
- User.internalBinaryWrite(message.char, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
1180
- /* repeated resources.permissions.Permission permissions = 5; */
1221
+ User.internalBinaryWrite(message.char, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
1222
+ /* repeated resources.permissions.permissions.Permission permissions = 6; */
1181
1223
  for (let i = 0; i < message.permissions.length; i++)
1182
- Permission.internalBinaryWrite(message.permissions[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
1183
- /* repeated resources.permissions.RoleAttribute attributes = 6; */
1224
+ Permission.internalBinaryWrite(message.permissions[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
1225
+ /* repeated resources.permissions.attributes.RoleAttribute attributes = 7; */
1184
1226
  for (let i = 0; i < message.attributes.length; i++)
1185
- RoleAttribute.internalBinaryWrite(message.attributes[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
1227
+ RoleAttribute.internalBinaryWrite(message.attributes[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
1186
1228
  let u = options.writeUnknownFields;
1187
1229
  if (u !== false)
1188
1230
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -1194,20 +1236,152 @@ class ChooseCharacterResponse$Type extends MessageType<ChooseCharacterResponse>
1194
1236
  */
1195
1237
  export const ChooseCharacterResponse = new ChooseCharacterResponse$Type();
1196
1238
  // @generated message type with reflection information, may provide speed optimized methods
1197
- class DeleteOAuth2ConnectionRequest$Type extends MessageType<DeleteOAuth2ConnectionRequest> {
1239
+ class ImpersonateJobRequest$Type extends MessageType<ImpersonateJobRequest> {
1198
1240
  constructor() {
1199
- super("services.auth.DeleteOAuth2ConnectionRequest", [
1200
- { no: 1, name: "provider", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } } } }
1241
+ super("services.auth.ImpersonateJobRequest", [
1242
+ { no: 1, name: "job_grade", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "buf.validate.field": { int32: { gte: -1 } } } }
1201
1243
  ]);
1202
1244
  }
1203
- create(value?: PartialMessage<DeleteOAuth2ConnectionRequest>): DeleteOAuth2ConnectionRequest {
1245
+ create(value?: PartialMessage<ImpersonateJobRequest>): ImpersonateJobRequest {
1246
+ const message = globalThis.Object.create((this.messagePrototype!));
1247
+ message.jobGrade = 0;
1248
+ if (value !== undefined)
1249
+ reflectionMergePartial<ImpersonateJobRequest>(this, message, value);
1250
+ return message;
1251
+ }
1252
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ImpersonateJobRequest): ImpersonateJobRequest {
1253
+ let message = target ?? this.create(), end = reader.pos + length;
1254
+ while (reader.pos < end) {
1255
+ let [fieldNo, wireType] = reader.tag();
1256
+ switch (fieldNo) {
1257
+ case /* int32 job_grade */ 1:
1258
+ message.jobGrade = reader.int32();
1259
+ break;
1260
+ default:
1261
+ let u = options.readUnknownField;
1262
+ if (u === "throw")
1263
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1264
+ let d = reader.skip(wireType);
1265
+ if (u !== false)
1266
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1267
+ }
1268
+ }
1269
+ return message;
1270
+ }
1271
+ internalBinaryWrite(message: ImpersonateJobRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1272
+ /* int32 job_grade = 1; */
1273
+ if (message.jobGrade !== 0)
1274
+ writer.tag(1, WireType.Varint).int32(message.jobGrade);
1275
+ let u = options.writeUnknownFields;
1276
+ if (u !== false)
1277
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1278
+ return writer;
1279
+ }
1280
+ }
1281
+ /**
1282
+ * @generated MessageType for protobuf message services.auth.ImpersonateJobRequest
1283
+ */
1284
+ export const ImpersonateJobRequest = new ImpersonateJobRequest$Type();
1285
+ // @generated message type with reflection information, may provide speed optimized methods
1286
+ class ImpersonateJobResponse$Type extends MessageType<ImpersonateJobResponse> {
1287
+ constructor() {
1288
+ super("services.auth.ImpersonateJobResponse", [
1289
+ { no: 1, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1290
+ { no: 2, name: "expires", kind: "message", T: () => Timestamp },
1291
+ { no: 3, name: "char", kind: "message", T: () => User, options: { "tagger.tags": "alias:\"user\"" } },
1292
+ { no: 4, name: "permissions", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Permission },
1293
+ { no: 5, name: "attributes", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RoleAttribute },
1294
+ { no: 6, name: "state", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
1295
+ ]);
1296
+ }
1297
+ create(value?: PartialMessage<ImpersonateJobResponse>): ImpersonateJobResponse {
1298
+ const message = globalThis.Object.create((this.messagePrototype!));
1299
+ message.token = "";
1300
+ message.permissions = [];
1301
+ message.attributes = [];
1302
+ message.state = false;
1303
+ if (value !== undefined)
1304
+ reflectionMergePartial<ImpersonateJobResponse>(this, message, value);
1305
+ return message;
1306
+ }
1307
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ImpersonateJobResponse): ImpersonateJobResponse {
1308
+ let message = target ?? this.create(), end = reader.pos + length;
1309
+ while (reader.pos < end) {
1310
+ let [fieldNo, wireType] = reader.tag();
1311
+ switch (fieldNo) {
1312
+ case /* string token */ 1:
1313
+ message.token = reader.string();
1314
+ break;
1315
+ case /* resources.timestamp.Timestamp expires */ 2:
1316
+ message.expires = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expires);
1317
+ break;
1318
+ case /* resources.users.User char */ 3:
1319
+ message.char = User.internalBinaryRead(reader, reader.uint32(), options, message.char);
1320
+ break;
1321
+ case /* repeated resources.permissions.permissions.Permission permissions */ 4:
1322
+ message.permissions.push(Permission.internalBinaryRead(reader, reader.uint32(), options));
1323
+ break;
1324
+ case /* repeated resources.permissions.attributes.RoleAttribute attributes */ 5:
1325
+ message.attributes.push(RoleAttribute.internalBinaryRead(reader, reader.uint32(), options));
1326
+ break;
1327
+ case /* bool state */ 6:
1328
+ message.state = reader.bool();
1329
+ break;
1330
+ default:
1331
+ let u = options.readUnknownField;
1332
+ if (u === "throw")
1333
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1334
+ let d = reader.skip(wireType);
1335
+ if (u !== false)
1336
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1337
+ }
1338
+ }
1339
+ return message;
1340
+ }
1341
+ internalBinaryWrite(message: ImpersonateJobResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1342
+ /* string token = 1; */
1343
+ if (message.token !== "")
1344
+ writer.tag(1, WireType.LengthDelimited).string(message.token);
1345
+ /* resources.timestamp.Timestamp expires = 2; */
1346
+ if (message.expires)
1347
+ Timestamp.internalBinaryWrite(message.expires, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1348
+ /* resources.users.User char = 3; */
1349
+ if (message.char)
1350
+ User.internalBinaryWrite(message.char, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1351
+ /* repeated resources.permissions.permissions.Permission permissions = 4; */
1352
+ for (let i = 0; i < message.permissions.length; i++)
1353
+ Permission.internalBinaryWrite(message.permissions[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
1354
+ /* repeated resources.permissions.attributes.RoleAttribute attributes = 5; */
1355
+ for (let i = 0; i < message.attributes.length; i++)
1356
+ RoleAttribute.internalBinaryWrite(message.attributes[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
1357
+ /* bool state = 6; */
1358
+ if (message.state !== false)
1359
+ writer.tag(6, WireType.Varint).bool(message.state);
1360
+ let u = options.writeUnknownFields;
1361
+ if (u !== false)
1362
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1363
+ return writer;
1364
+ }
1365
+ }
1366
+ /**
1367
+ * @generated MessageType for protobuf message services.auth.ImpersonateJobResponse
1368
+ */
1369
+ export const ImpersonateJobResponse = new ImpersonateJobResponse$Type();
1370
+ // @generated message type with reflection information, may provide speed optimized methods
1371
+ class DeleteSocialLoginRequest$Type extends MessageType<DeleteSocialLoginRequest> {
1372
+ constructor() {
1373
+ super("services.auth.DeleteSocialLoginRequest", [
1374
+ { no: 1, name: "provider", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "50" } }, "codegen.sanitizer.sanitizer": { enabled: true, stripHtmlTags: true } } }
1375
+ ]);
1376
+ }
1377
+ create(value?: PartialMessage<DeleteSocialLoginRequest>): DeleteSocialLoginRequest {
1204
1378
  const message = globalThis.Object.create((this.messagePrototype!));
1205
1379
  message.provider = "";
1206
1380
  if (value !== undefined)
1207
- reflectionMergePartial<DeleteOAuth2ConnectionRequest>(this, message, value);
1381
+ reflectionMergePartial<DeleteSocialLoginRequest>(this, message, value);
1208
1382
  return message;
1209
1383
  }
1210
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteOAuth2ConnectionRequest): DeleteOAuth2ConnectionRequest {
1384
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteSocialLoginRequest): DeleteSocialLoginRequest {
1211
1385
  let message = target ?? this.create(), end = reader.pos + length;
1212
1386
  while (reader.pos < end) {
1213
1387
  let [fieldNo, wireType] = reader.tag();
@@ -1226,7 +1400,7 @@ class DeleteOAuth2ConnectionRequest$Type extends MessageType<DeleteOAuth2Connect
1226
1400
  }
1227
1401
  return message;
1228
1402
  }
1229
- internalBinaryWrite(message: DeleteOAuth2ConnectionRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1403
+ internalBinaryWrite(message: DeleteSocialLoginRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1230
1404
  /* string provider = 1; */
1231
1405
  if (message.provider !== "")
1232
1406
  writer.tag(1, WireType.LengthDelimited).string(message.provider);
@@ -1237,24 +1411,24 @@ class DeleteOAuth2ConnectionRequest$Type extends MessageType<DeleteOAuth2Connect
1237
1411
  }
1238
1412
  }
1239
1413
  /**
1240
- * @generated MessageType for protobuf message services.auth.DeleteOAuth2ConnectionRequest
1414
+ * @generated MessageType for protobuf message services.auth.DeleteSocialLoginRequest
1241
1415
  */
1242
- export const DeleteOAuth2ConnectionRequest = new DeleteOAuth2ConnectionRequest$Type();
1416
+ export const DeleteSocialLoginRequest = new DeleteSocialLoginRequest$Type();
1243
1417
  // @generated message type with reflection information, may provide speed optimized methods
1244
- class DeleteOAuth2ConnectionResponse$Type extends MessageType<DeleteOAuth2ConnectionResponse> {
1418
+ class DeleteSocialLoginResponse$Type extends MessageType<DeleteSocialLoginResponse> {
1245
1419
  constructor() {
1246
- super("services.auth.DeleteOAuth2ConnectionResponse", [
1420
+ super("services.auth.DeleteSocialLoginResponse", [
1247
1421
  { no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
1248
1422
  ]);
1249
1423
  }
1250
- create(value?: PartialMessage<DeleteOAuth2ConnectionResponse>): DeleteOAuth2ConnectionResponse {
1424
+ create(value?: PartialMessage<DeleteSocialLoginResponse>): DeleteSocialLoginResponse {
1251
1425
  const message = globalThis.Object.create((this.messagePrototype!));
1252
1426
  message.success = false;
1253
1427
  if (value !== undefined)
1254
- reflectionMergePartial<DeleteOAuth2ConnectionResponse>(this, message, value);
1428
+ reflectionMergePartial<DeleteSocialLoginResponse>(this, message, value);
1255
1429
  return message;
1256
1430
  }
1257
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteOAuth2ConnectionResponse): DeleteOAuth2ConnectionResponse {
1431
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteSocialLoginResponse): DeleteSocialLoginResponse {
1258
1432
  let message = target ?? this.create(), end = reader.pos + length;
1259
1433
  while (reader.pos < end) {
1260
1434
  let [fieldNo, wireType] = reader.tag();
@@ -1273,7 +1447,7 @@ class DeleteOAuth2ConnectionResponse$Type extends MessageType<DeleteOAuth2Connec
1273
1447
  }
1274
1448
  return message;
1275
1449
  }
1276
- internalBinaryWrite(message: DeleteOAuth2ConnectionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1450
+ internalBinaryWrite(message: DeleteSocialLoginResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1277
1451
  /* bool success = 1; */
1278
1452
  if (message.success !== false)
1279
1453
  writer.tag(1, WireType.Varint).bool(message.success);
@@ -1284,9 +1458,9 @@ class DeleteOAuth2ConnectionResponse$Type extends MessageType<DeleteOAuth2Connec
1284
1458
  }
1285
1459
  }
1286
1460
  /**
1287
- * @generated MessageType for protobuf message services.auth.DeleteOAuth2ConnectionResponse
1461
+ * @generated MessageType for protobuf message services.auth.DeleteSocialLoginResponse
1288
1462
  */
1289
- export const DeleteOAuth2ConnectionResponse = new DeleteOAuth2ConnectionResponse$Type();
1463
+ export const DeleteSocialLoginResponse = new DeleteSocialLoginResponse$Type();
1290
1464
  // @generated message type with reflection information, may provide speed optimized methods
1291
1465
  class SetSuperuserModeRequest$Type extends MessageType<SetSuperuserModeRequest> {
1292
1466
  constructor() {
@@ -1345,6 +1519,7 @@ export const SetSuperuserModeRequest = new SetSuperuserModeRequest$Type();
1345
1519
  class SetSuperuserModeResponse$Type extends MessageType<SetSuperuserModeResponse> {
1346
1520
  constructor() {
1347
1521
  super("services.auth.SetSuperuserModeResponse", [
1522
+ { no: 1, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1348
1523
  { no: 2, name: "expires", kind: "message", T: () => Timestamp },
1349
1524
  { no: 3, name: "job_props", kind: "message", T: () => JobProps },
1350
1525
  { no: 4, name: "char", kind: "message", T: () => User, options: { "tagger.tags": "alias:\"user\"" } },
@@ -1354,6 +1529,7 @@ class SetSuperuserModeResponse$Type extends MessageType<SetSuperuserModeResponse
1354
1529
  }
1355
1530
  create(value?: PartialMessage<SetSuperuserModeResponse>): SetSuperuserModeResponse {
1356
1531
  const message = globalThis.Object.create((this.messagePrototype!));
1532
+ message.token = "";
1357
1533
  message.permissions = [];
1358
1534
  message.attributes = [];
1359
1535
  if (value !== undefined)
@@ -1365,19 +1541,22 @@ class SetSuperuserModeResponse$Type extends MessageType<SetSuperuserModeResponse
1365
1541
  while (reader.pos < end) {
1366
1542
  let [fieldNo, wireType] = reader.tag();
1367
1543
  switch (fieldNo) {
1544
+ case /* string token */ 1:
1545
+ message.token = reader.string();
1546
+ break;
1368
1547
  case /* resources.timestamp.Timestamp expires */ 2:
1369
1548
  message.expires = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.expires);
1370
1549
  break;
1371
- case /* optional resources.jobs.JobProps job_props */ 3:
1550
+ case /* optional resources.jobs.props.JobProps job_props */ 3:
1372
1551
  message.jobProps = JobProps.internalBinaryRead(reader, reader.uint32(), options, message.jobProps);
1373
1552
  break;
1374
1553
  case /* resources.users.User char */ 4:
1375
1554
  message.char = User.internalBinaryRead(reader, reader.uint32(), options, message.char);
1376
1555
  break;
1377
- case /* repeated resources.permissions.Permission permissions */ 5:
1556
+ case /* repeated resources.permissions.permissions.Permission permissions */ 5:
1378
1557
  message.permissions.push(Permission.internalBinaryRead(reader, reader.uint32(), options));
1379
1558
  break;
1380
- case /* repeated resources.permissions.RoleAttribute attributes */ 6:
1559
+ case /* repeated resources.permissions.attributes.RoleAttribute attributes */ 6:
1381
1560
  message.attributes.push(RoleAttribute.internalBinaryRead(reader, reader.uint32(), options));
1382
1561
  break;
1383
1562
  default:
@@ -1392,19 +1571,22 @@ class SetSuperuserModeResponse$Type extends MessageType<SetSuperuserModeResponse
1392
1571
  return message;
1393
1572
  }
1394
1573
  internalBinaryWrite(message: SetSuperuserModeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1574
+ /* string token = 1; */
1575
+ if (message.token !== "")
1576
+ writer.tag(1, WireType.LengthDelimited).string(message.token);
1395
1577
  /* resources.timestamp.Timestamp expires = 2; */
1396
1578
  if (message.expires)
1397
1579
  Timestamp.internalBinaryWrite(message.expires, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1398
- /* optional resources.jobs.JobProps job_props = 3; */
1580
+ /* optional resources.jobs.props.JobProps job_props = 3; */
1399
1581
  if (message.jobProps)
1400
1582
  JobProps.internalBinaryWrite(message.jobProps, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1401
1583
  /* resources.users.User char = 4; */
1402
1584
  if (message.char)
1403
1585
  User.internalBinaryWrite(message.char, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
1404
- /* repeated resources.permissions.Permission permissions = 5; */
1586
+ /* repeated resources.permissions.permissions.Permission permissions = 5; */
1405
1587
  for (let i = 0; i < message.permissions.length; i++)
1406
1588
  Permission.internalBinaryWrite(message.permissions[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
1407
- /* repeated resources.permissions.RoleAttribute attributes = 6; */
1589
+ /* repeated resources.permissions.attributes.RoleAttribute attributes = 6; */
1408
1590
  for (let i = 0; i < message.attributes.length; i++)
1409
1591
  RoleAttribute.internalBinaryWrite(message.attributes[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
1410
1592
  let u = options.writeUnknownFields;
@@ -1429,7 +1611,8 @@ export const AuthService = new ServiceType("services.auth.AuthService", [
1429
1611
  { name: "ForgotPassword", options: {}, I: ForgotPasswordRequest, O: ForgotPasswordResponse },
1430
1612
  { name: "GetCharacters", options: {}, I: GetCharactersRequest, O: GetCharactersResponse },
1431
1613
  { name: "ChooseCharacter", options: { "codegen.perms.perms": { enabled: true } }, I: ChooseCharacterRequest, O: ChooseCharacterResponse },
1614
+ { name: "ImpersonateJob", options: { "codegen.perms.perms": { enabled: true, service: "settings.SettingsService", name: "UpdateRolePerms" } }, I: ImpersonateJobRequest, O: ImpersonateJobResponse },
1432
1615
  { name: "GetAccountInfo", options: {}, I: GetAccountInfoRequest, O: GetAccountInfoResponse },
1433
- { name: "DeleteOAuth2Connection", options: {}, I: DeleteOAuth2ConnectionRequest, O: DeleteOAuth2ConnectionResponse },
1616
+ { name: "DeleteSocialLogin", options: {}, I: DeleteSocialLoginRequest, O: DeleteSocialLoginResponse },
1434
1617
  { name: "SetSuperuserMode", options: {}, I: SetSuperuserModeRequest, O: SetSuperuserModeResponse }
1435
- ]);
1618
+ ], { "codegen.perms.perms_svc": { icon: "i-mdi-key-outline" } });