@fivenet-app/gen 0.9.3-1

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 (123) hide show
  1. package/README.md +1 -0
  2. package/google/protobuf/any.ts +322 -0
  3. package/google/protobuf/descriptor.ts +3475 -0
  4. package/google/protobuf/duration.ts +231 -0
  5. package/google/protobuf/timestamp.ts +290 -0
  6. package/package.json +15 -0
  7. package/perms.ts +178 -0
  8. package/resources/accounts/accounts.ts +195 -0
  9. package/resources/accounts/oauth2.ts +230 -0
  10. package/resources/calendar/access.ts +362 -0
  11. package/resources/calendar/calendar.ts +955 -0
  12. package/resources/centrum/access.ts +380 -0
  13. package/resources/centrum/dispatches.ts +854 -0
  14. package/resources/centrum/general.ts +231 -0
  15. package/resources/centrum/settings.ts +303 -0
  16. package/resources/centrum/units.ts +620 -0
  17. package/resources/common/access/dummy.ts +309 -0
  18. package/resources/common/content/content.ts +252 -0
  19. package/resources/common/cron/cron.ts +536 -0
  20. package/resources/common/database/database.ts +306 -0
  21. package/resources/common/error.ts +79 -0
  22. package/resources/common/grpcws/grpcws.ts +615 -0
  23. package/resources/common/i18n.ts +102 -0
  24. package/resources/common/uuid.ts +68 -0
  25. package/resources/documents/access.ts +388 -0
  26. package/resources/documents/activity.ts +803 -0
  27. package/resources/documents/category.ts +132 -0
  28. package/resources/documents/comment.ts +161 -0
  29. package/resources/documents/documents.ts +1124 -0
  30. package/resources/documents/requests.ts +196 -0
  31. package/resources/documents/templates.ts +949 -0
  32. package/resources/documents/workflow.ts +349 -0
  33. package/resources/filestore/file.ts +204 -0
  34. package/resources/internet/ads.ts +257 -0
  35. package/resources/internet/domain.ts +136 -0
  36. package/resources/internet/internet.ts +344 -0
  37. package/resources/internet/page.ts +236 -0
  38. package/resources/internet/search.ts +104 -0
  39. package/resources/jobs/activity.ts +600 -0
  40. package/resources/jobs/colleagues.ts +346 -0
  41. package/resources/jobs/conduct.ts +220 -0
  42. package/resources/jobs/labels.ts +240 -0
  43. package/resources/jobs/timeclock.ts +372 -0
  44. package/resources/laws/laws.ts +293 -0
  45. package/resources/livemap/livemap.ts +728 -0
  46. package/resources/livemap/tracker.ts +81 -0
  47. package/resources/mailer/access.ts +485 -0
  48. package/resources/mailer/email.ts +222 -0
  49. package/resources/mailer/events.ts +196 -0
  50. package/resources/mailer/message.ts +285 -0
  51. package/resources/mailer/settings.ts +95 -0
  52. package/resources/mailer/template.ts +164 -0
  53. package/resources/mailer/thread.ts +422 -0
  54. package/resources/mailer/user.ts +93 -0
  55. package/resources/notifications/events.ts +287 -0
  56. package/resources/notifications/notifications.ts +444 -0
  57. package/resources/permissions/permissions.ts +829 -0
  58. package/resources/qualifications/access.ts +275 -0
  59. package/resources/qualifications/exam.ts +1421 -0
  60. package/resources/qualifications/qualifications.ts +1289 -0
  61. package/resources/rector/audit.ts +226 -0
  62. package/resources/rector/config.ts +922 -0
  63. package/resources/stats/stats.ts +67 -0
  64. package/resources/sync/activity.ts +356 -0
  65. package/resources/sync/data.ts +455 -0
  66. package/resources/timestamp/timestamp.ts +78 -0
  67. package/resources/users/activity.ts +211 -0
  68. package/resources/users/job_props.ts +992 -0
  69. package/resources/users/jobs.ts +171 -0
  70. package/resources/users/labels.ts +161 -0
  71. package/resources/users/props.ts +207 -0
  72. package/resources/users/users.ts +570 -0
  73. package/resources/vehicles/vehicles.ts +114 -0
  74. package/resources/wiki/access.ts +362 -0
  75. package/resources/wiki/activity.ts +591 -0
  76. package/resources/wiki/page.ts +548 -0
  77. package/services/auth/auth.client.ts +171 -0
  78. package/services/auth/auth.ts +1331 -0
  79. package/services/calendar/calendar.client.ts +262 -0
  80. package/services/calendar/calendar.ts +1733 -0
  81. package/services/centrum/centrum.client.ts +365 -0
  82. package/services/centrum/centrum.ts +2619 -0
  83. package/services/citizenstore/citizenstore.client.ts +126 -0
  84. package/services/citizenstore/citizenstore.ts +847 -0
  85. package/services/completor/completor.client.ts +109 -0
  86. package/services/completor/completor.ts +616 -0
  87. package/services/dmv/vehicles.client.ts +41 -0
  88. package/services/dmv/vehicles.ts +191 -0
  89. package/services/docstore/docstore.client.ts +653 -0
  90. package/services/docstore/docstore.ts +4571 -0
  91. package/services/internet/ads.client.ts +41 -0
  92. package/services/internet/ads.ts +145 -0
  93. package/services/internet/internet.client.ts +58 -0
  94. package/services/internet/internet.ts +257 -0
  95. package/services/jobs/conduct.client.ts +92 -0
  96. package/services/jobs/conduct.ts +541 -0
  97. package/services/jobs/jobs.client.ts +194 -0
  98. package/services/jobs/jobs.ts +1301 -0
  99. package/services/jobs/timeclock.client.ts +75 -0
  100. package/services/jobs/timeclock.ts +808 -0
  101. package/services/livemapper/livemap.client.ts +76 -0
  102. package/services/livemapper/livemap.ts +552 -0
  103. package/services/mailer/mailer.client.ts +381 -0
  104. package/services/mailer/mailer.ts +2590 -0
  105. package/services/notificator/notificator.client.ts +76 -0
  106. package/services/notificator/notificator.ts +510 -0
  107. package/services/qualifications/qualifications.client.ts +279 -0
  108. package/services/qualifications/qualifications.ts +2142 -0
  109. package/services/rector/config.client.ts +58 -0
  110. package/services/rector/config.ts +216 -0
  111. package/services/rector/filestore.client.ts +75 -0
  112. package/services/rector/filestore.ts +378 -0
  113. package/services/rector/laws.client.ts +92 -0
  114. package/services/rector/laws.ts +416 -0
  115. package/services/rector/rector.client.ts +211 -0
  116. package/services/rector/rector.ts +1540 -0
  117. package/services/stats/stats.client.ts +37 -0
  118. package/services/stats/stats.ts +128 -0
  119. package/services/sync/sync.client.ts +110 -0
  120. package/services/sync/sync.ts +831 -0
  121. package/services/wiki/wiki.client.ts +126 -0
  122. package/services/wiki/wiki.ts +749 -0
  123. package/svcs.ts +307 -0
package/perms.ts ADDED
@@ -0,0 +1,178 @@
1
+ // Code generated by protoc-gen-fronthelper. DO NOT EDIT.
2
+ // source: resources/accounts/accounts.proto
3
+ // source: resources/accounts/oauth2.proto
4
+ // source: resources/calendar/access.proto
5
+ // source: resources/calendar/calendar.proto
6
+ // source: resources/centrum/access.proto
7
+ // source: resources/centrum/dispatches.proto
8
+ // source: resources/centrum/general.proto
9
+ // source: resources/centrum/settings.proto
10
+ // source: resources/centrum/units.proto
11
+ // source: resources/common/error.proto
12
+ // source: resources/common/i18n.proto
13
+ // source: resources/common/uuid.proto
14
+ // source: resources/common/content/content.proto
15
+ // source: resources/common/cron/cron.proto
16
+ // source: resources/common/database/database.proto
17
+ // source: resources/common/grpcws/grpcws.proto
18
+ // source: resources/documents/access.proto
19
+ // source: resources/documents/activity.proto
20
+ // source: resources/documents/category.proto
21
+ // source: resources/documents/comment.proto
22
+ // source: resources/documents/documents.proto
23
+ // source: resources/documents/requests.proto
24
+ // source: resources/documents/templates.proto
25
+ // source: resources/documents/workflow.proto
26
+ // source: resources/filestore/file.proto
27
+ // source: resources/internet/ads.proto
28
+ // source: resources/internet/domain.proto
29
+ // source: resources/internet/page.proto
30
+ // source: resources/internet/search.proto
31
+ // source: resources/jobs/activity.proto
32
+ // source: resources/jobs/colleagues.proto
33
+ // source: resources/jobs/conduct.proto
34
+ // source: resources/jobs/labels.proto
35
+ // source: resources/jobs/timeclock.proto
36
+ // source: resources/laws/laws.proto
37
+ // source: resources/livemap/livemap.proto
38
+ // source: resources/livemap/tracker.proto
39
+ // source: resources/mailer/access.proto
40
+ // source: resources/mailer/email.proto
41
+ // source: resources/mailer/events.proto
42
+ // source: resources/mailer/message.proto
43
+ // source: resources/mailer/settings.proto
44
+ // source: resources/mailer/template.proto
45
+ // source: resources/mailer/thread.proto
46
+ // source: resources/notifications/events.proto
47
+ // source: resources/notifications/notifications.proto
48
+ // source: resources/permissions/permissions.proto
49
+ // source: resources/qualifications/access.proto
50
+ // source: resources/qualifications/exam.proto
51
+ // source: resources/qualifications/qualifications.proto
52
+ // source: resources/rector/audit.proto
53
+ // source: resources/rector/config.proto
54
+ // source: resources/stats/stats.proto
55
+ // source: resources/sync/activity.proto
56
+ // source: resources/sync/data.proto
57
+ // source: resources/timestamp/timestamp.proto
58
+ // source: resources/users/activity.proto
59
+ // source: resources/users/job_props.proto
60
+ // source: resources/users/jobs.proto
61
+ // source: resources/users/labels.proto
62
+ // source: resources/users/props.proto
63
+ // source: resources/users/users.proto
64
+ // source: resources/vehicles/vehicles.proto
65
+ // source: resources/wiki/access.proto
66
+ // source: resources/wiki/activity.proto
67
+ // source: resources/wiki/page.proto
68
+ // source: services/auth/auth.proto
69
+ // source: services/calendar/calendar.proto
70
+ // source: services/centrum/centrum.proto
71
+ // source: services/citizenstore/citizenstore.proto
72
+ // source: services/completor/completor.proto
73
+ // source: services/dmv/vehicles.proto
74
+ // source: services/docstore/docstore.proto
75
+ // source: services/internet/ads.proto
76
+ // source: services/internet/internet.proto
77
+ // source: services/jobs/conduct.proto
78
+ // source: services/jobs/jobs.proto
79
+ // source: services/jobs/timeclock.proto
80
+ // source: services/livemapper/livemap.proto
81
+ // source: services/mailer/mailer.proto
82
+ // source: services/notificator/notificator.proto
83
+ // source: services/qualifications/qualifications.proto
84
+ // source: services/rector/config.proto
85
+ // source: services/rector/filestore.proto
86
+ // source: services/rector/laws.proto
87
+ // source: services/rector/rector.proto
88
+ // source: services/stats/stats.proto
89
+ // source: services/sync/sync.proto
90
+ // source: services/wiki/wiki.proto
91
+
92
+ export type Perms =
93
+ | 'CanBeSuper'
94
+ | 'SuperUser'
95
+ | 'TODOService.TODOMethod'
96
+ | 'AuthService.ChooseCharacter'
97
+ | 'CalendarService.CreateOrUpdateCalendar'
98
+ | 'CalendarService.CreateOrUpdateCalendarEntry'
99
+ | 'CalendarService.DeleteCalendar'
100
+ | 'CalendarService.DeleteCalendarEntry'
101
+ | 'CentrumService.CreateDispatch'
102
+ | 'CentrumService.CreateOrUpdateUnit'
103
+ | 'CentrumService.DeleteDispatch'
104
+ | 'CentrumService.DeleteUnit'
105
+ | 'CentrumService.Stream'
106
+ | 'CentrumService.TakeControl'
107
+ | 'CentrumService.TakeDispatch'
108
+ | 'CentrumService.UpdateDispatch'
109
+ | 'CentrumService.UpdateSettings'
110
+ | 'CitizenStoreService.GetUser'
111
+ | 'CitizenStoreService.ListCitizens'
112
+ | 'CitizenStoreService.ListUserActivity'
113
+ | 'CitizenStoreService.ManageCitizenLabels'
114
+ | 'CitizenStoreService.SetUserProps'
115
+ | 'CompletorService.CompleteCitizenLabels'
116
+ | 'CompletorService.CompleteCitizens'
117
+ | 'CompletorService.CompleteDocumentCategories'
118
+ | 'DMVService.ListVehicles'
119
+ | 'DocStoreService.AddDocumentReference'
120
+ | 'DocStoreService.AddDocumentRelation'
121
+ | 'DocStoreService.ChangeDocumentOwner'
122
+ | 'DocStoreService.CreateCategory'
123
+ | 'DocStoreService.CreateDocument'
124
+ | 'DocStoreService.CreateDocumentReq'
125
+ | 'DocStoreService.CreateTemplate'
126
+ | 'DocStoreService.DeleteCategory'
127
+ | 'DocStoreService.DeleteComment'
128
+ | 'DocStoreService.DeleteDocument'
129
+ | 'DocStoreService.DeleteDocumentReq'
130
+ | 'DocStoreService.DeleteTemplate'
131
+ | 'DocStoreService.ListCategories'
132
+ | 'DocStoreService.ListDocumentActivity'
133
+ | 'DocStoreService.ListDocumentReqs'
134
+ | 'DocStoreService.ListDocuments'
135
+ | 'DocStoreService.ListTemplates'
136
+ | 'DocStoreService.ListUserDocuments'
137
+ | 'DocStoreService.PostComment'
138
+ | 'DocStoreService.SetDocumentReminder'
139
+ | 'DocStoreService.ToggleDocument'
140
+ | 'DocStoreService.ToggleDocumentPin'
141
+ | 'DocStoreService.UpdateDocument'
142
+ | 'JobsConductService.CreateConductEntry'
143
+ | 'JobsConductService.DeleteConductEntry'
144
+ | 'JobsConductService.ListConductEntries'
145
+ | 'JobsConductService.UpdateConductEntry'
146
+ | 'JobsService.GetColleague'
147
+ | 'JobsService.ListColleagueActivity'
148
+ | 'JobsService.ListColleagues'
149
+ | 'JobsService.ManageColleagueLabels'
150
+ | 'JobsService.SetJobsUserProps'
151
+ | 'JobsService.SetMOTD'
152
+ | 'JobsTimeclockService.ListInactiveEmployees'
153
+ | 'JobsTimeclockService.ListTimeclock'
154
+ | 'LivemapperService.CreateOrUpdateMarker'
155
+ | 'LivemapperService.DeleteMarker'
156
+ | 'LivemapperService.Stream'
157
+ | 'MailerService.CreateOrUpdateEmail'
158
+ | 'MailerService.DeleteEmail'
159
+ | 'MailerService.ListEmails'
160
+ | 'QualificationsService.CreateOrUpdateQualificationResult'
161
+ | 'QualificationsService.CreateQualification'
162
+ | 'QualificationsService.DeleteQualification'
163
+ | 'QualificationsService.DeleteQualificationReq'
164
+ | 'QualificationsService.DeleteQualificationResult'
165
+ | 'QualificationsService.ListQualifications'
166
+ | 'QualificationsService.UpdateQualification'
167
+ | 'RectorService.CreateRole'
168
+ | 'RectorService.DeleteRole'
169
+ | 'RectorService.GetJobProps'
170
+ | 'RectorService.GetRoles'
171
+ | 'RectorService.SetJobProps'
172
+ | 'RectorService.UpdateRolePerms'
173
+ | 'RectorService.ViewAuditLog'
174
+ | 'WikiService.CreatePage'
175
+ | 'WikiService.DeletePage'
176
+ | 'WikiService.ListPageActivity'
177
+ | 'WikiService.ListPages'
178
+ | 'WikiService.UpdatePage';
@@ -0,0 +1,195 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter optimize_speed,long_type_number,force_server_none
2
+ // @generated from protobuf file "resources/accounts/accounts.proto" (package "resources.accounts", syntax proto3)
3
+ // @ts-nocheck
4
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
5
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
6
+ import { WireType } from "@protobuf-ts/runtime";
7
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
8
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
9
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
10
+ import type { PartialMessage } from "@protobuf-ts/runtime";
11
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
12
+ import { MessageType } from "@protobuf-ts/runtime";
13
+ import { User } from "../users/users";
14
+ import { Timestamp } from "../timestamp/timestamp";
15
+ /**
16
+ * @generated from protobuf message resources.accounts.Account
17
+ */
18
+ export interface Account {
19
+ /**
20
+ * @generated from protobuf field: uint64 id = 1 [jstype = JS_STRING];
21
+ */
22
+ id: string;
23
+ /**
24
+ * @generated from protobuf field: optional resources.timestamp.Timestamp created_at = 2;
25
+ */
26
+ createdAt?: Timestamp;
27
+ /**
28
+ * @generated from protobuf field: optional resources.timestamp.Timestamp updated_at = 3;
29
+ */
30
+ updatedAt?: Timestamp;
31
+ /**
32
+ * @generated from protobuf field: string username = 4;
33
+ */
34
+ username: string;
35
+ /**
36
+ * @generated from protobuf field: string license = 5;
37
+ */
38
+ license: string;
39
+ }
40
+ /**
41
+ * @generated from protobuf message resources.accounts.Character
42
+ */
43
+ export interface Character {
44
+ /**
45
+ * @generated from protobuf field: bool available = 1;
46
+ */
47
+ available: boolean;
48
+ /**
49
+ * @generated from protobuf field: string group = 2;
50
+ */
51
+ group: string;
52
+ /**
53
+ * @generated from protobuf field: resources.users.User char = 3;
54
+ */
55
+ char?: User; // @gotags: alias:"user"
56
+ }
57
+ // @generated message type with reflection information, may provide speed optimized methods
58
+ class Account$Type extends MessageType<Account> {
59
+ constructor() {
60
+ super("resources.accounts.Account", [
61
+ { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
62
+ { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
63
+ { no: 3, name: "updated_at", kind: "message", T: () => Timestamp },
64
+ { no: 4, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "24" } } } },
65
+ { no: 5, name: "license", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "64" } } } }
66
+ ]);
67
+ }
68
+ create(value?: PartialMessage<Account>): Account {
69
+ const message = globalThis.Object.create((this.messagePrototype!));
70
+ message.id = "0";
71
+ message.username = "";
72
+ message.license = "";
73
+ if (value !== undefined)
74
+ reflectionMergePartial<Account>(this, message, value);
75
+ return message;
76
+ }
77
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Account): Account {
78
+ let message = target ?? this.create(), end = reader.pos + length;
79
+ while (reader.pos < end) {
80
+ let [fieldNo, wireType] = reader.tag();
81
+ switch (fieldNo) {
82
+ case /* uint64 id = 1 [jstype = JS_STRING];*/ 1:
83
+ message.id = reader.uint64().toString();
84
+ break;
85
+ case /* optional resources.timestamp.Timestamp created_at */ 2:
86
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
87
+ break;
88
+ case /* optional resources.timestamp.Timestamp updated_at */ 3:
89
+ message.updatedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.updatedAt);
90
+ break;
91
+ case /* string username */ 4:
92
+ message.username = reader.string();
93
+ break;
94
+ case /* string license */ 5:
95
+ message.license = reader.string();
96
+ break;
97
+ default:
98
+ let u = options.readUnknownField;
99
+ if (u === "throw")
100
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
101
+ let d = reader.skip(wireType);
102
+ if (u !== false)
103
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
104
+ }
105
+ }
106
+ return message;
107
+ }
108
+ internalBinaryWrite(message: Account, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
109
+ /* uint64 id = 1 [jstype = JS_STRING]; */
110
+ if (message.id !== "0")
111
+ writer.tag(1, WireType.Varint).uint64(message.id);
112
+ /* optional resources.timestamp.Timestamp created_at = 2; */
113
+ if (message.createdAt)
114
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
115
+ /* optional resources.timestamp.Timestamp updated_at = 3; */
116
+ if (message.updatedAt)
117
+ Timestamp.internalBinaryWrite(message.updatedAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
118
+ /* string username = 4; */
119
+ if (message.username !== "")
120
+ writer.tag(4, WireType.LengthDelimited).string(message.username);
121
+ /* string license = 5; */
122
+ if (message.license !== "")
123
+ writer.tag(5, WireType.LengthDelimited).string(message.license);
124
+ let u = options.writeUnknownFields;
125
+ if (u !== false)
126
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
127
+ return writer;
128
+ }
129
+ }
130
+ /**
131
+ * @generated MessageType for protobuf message resources.accounts.Account
132
+ */
133
+ export const Account = new Account$Type();
134
+ // @generated message type with reflection information, may provide speed optimized methods
135
+ class Character$Type extends MessageType<Character> {
136
+ constructor() {
137
+ super("resources.accounts.Character", [
138
+ { no: 1, name: "available", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
139
+ { no: 2, name: "group", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
140
+ { no: 3, name: "char", kind: "message", T: () => User }
141
+ ]);
142
+ }
143
+ create(value?: PartialMessage<Character>): Character {
144
+ const message = globalThis.Object.create((this.messagePrototype!));
145
+ message.available = false;
146
+ message.group = "";
147
+ if (value !== undefined)
148
+ reflectionMergePartial<Character>(this, message, value);
149
+ return message;
150
+ }
151
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Character): Character {
152
+ let message = target ?? this.create(), end = reader.pos + length;
153
+ while (reader.pos < end) {
154
+ let [fieldNo, wireType] = reader.tag();
155
+ switch (fieldNo) {
156
+ case /* bool available */ 1:
157
+ message.available = reader.bool();
158
+ break;
159
+ case /* string group */ 2:
160
+ message.group = reader.string();
161
+ break;
162
+ case /* resources.users.User char */ 3:
163
+ message.char = User.internalBinaryRead(reader, reader.uint32(), options, message.char);
164
+ break;
165
+ default:
166
+ let u = options.readUnknownField;
167
+ if (u === "throw")
168
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
169
+ let d = reader.skip(wireType);
170
+ if (u !== false)
171
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
172
+ }
173
+ }
174
+ return message;
175
+ }
176
+ internalBinaryWrite(message: Character, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
177
+ /* bool available = 1; */
178
+ if (message.available !== false)
179
+ writer.tag(1, WireType.Varint).bool(message.available);
180
+ /* string group = 2; */
181
+ if (message.group !== "")
182
+ writer.tag(2, WireType.LengthDelimited).string(message.group);
183
+ /* resources.users.User char = 3; */
184
+ if (message.char)
185
+ User.internalBinaryWrite(message.char, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
186
+ let u = options.writeUnknownFields;
187
+ if (u !== false)
188
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
189
+ return writer;
190
+ }
191
+ }
192
+ /**
193
+ * @generated MessageType for protobuf message resources.accounts.Character
194
+ */
195
+ export const Character = new Character$Type();
@@ -0,0 +1,230 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter optimize_speed,long_type_number,force_server_none
2
+ // @generated from protobuf file "resources/accounts/oauth2.proto" (package "resources.accounts", syntax proto3)
3
+ // @ts-nocheck
4
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
5
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
6
+ import { WireType } from "@protobuf-ts/runtime";
7
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
8
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
9
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
10
+ import type { PartialMessage } from "@protobuf-ts/runtime";
11
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
12
+ import { MessageType } from "@protobuf-ts/runtime";
13
+ import { Timestamp } from "../timestamp/timestamp";
14
+ /**
15
+ * @generated from protobuf message resources.accounts.OAuth2Account
16
+ */
17
+ export interface OAuth2Account {
18
+ /**
19
+ * @generated from protobuf field: uint64 account_id = 1 [jstype = JS_STRING];
20
+ */
21
+ accountId: string;
22
+ /**
23
+ * @generated from protobuf field: optional resources.timestamp.Timestamp created_at = 2;
24
+ */
25
+ createdAt?: Timestamp;
26
+ /**
27
+ * @generated from protobuf field: string provider_name = 3;
28
+ */
29
+ providerName: string;
30
+ /**
31
+ * @generated from protobuf field: resources.accounts.OAuth2Provider provider = 4;
32
+ */
33
+ provider?: OAuth2Provider;
34
+ /**
35
+ * @generated from protobuf field: uint64 external_id = 5 [jstype = JS_STRING];
36
+ */
37
+ externalId: string;
38
+ /**
39
+ * @generated from protobuf field: string username = 6;
40
+ */
41
+ username: string;
42
+ /**
43
+ * @generated from protobuf field: string avatar = 7;
44
+ */
45
+ avatar: string;
46
+ }
47
+ /**
48
+ * @generated from protobuf message resources.accounts.OAuth2Provider
49
+ */
50
+ export interface OAuth2Provider {
51
+ /**
52
+ * @generated from protobuf field: string name = 1;
53
+ */
54
+ name: string;
55
+ /**
56
+ * @generated from protobuf field: string label = 2;
57
+ */
58
+ label: string;
59
+ /**
60
+ * @generated from protobuf field: string homepage = 3;
61
+ */
62
+ homepage: string;
63
+ /**
64
+ * @generated from protobuf field: optional string icon = 4;
65
+ */
66
+ icon?: string;
67
+ }
68
+ // @generated message type with reflection information, may provide speed optimized methods
69
+ class OAuth2Account$Type extends MessageType<OAuth2Account> {
70
+ constructor() {
71
+ super("resources.accounts.OAuth2Account", [
72
+ { no: 1, name: "account_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
73
+ { no: 2, name: "created_at", kind: "message", T: () => Timestamp },
74
+ { no: 3, name: "provider_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
75
+ { no: 4, name: "provider", kind: "message", T: () => OAuth2Provider },
76
+ { no: 5, name: "external_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
77
+ { no: 6, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
78
+ { no: 7, name: "avatar", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
79
+ ]);
80
+ }
81
+ create(value?: PartialMessage<OAuth2Account>): OAuth2Account {
82
+ const message = globalThis.Object.create((this.messagePrototype!));
83
+ message.accountId = "0";
84
+ message.providerName = "";
85
+ message.externalId = "0";
86
+ message.username = "";
87
+ message.avatar = "";
88
+ if (value !== undefined)
89
+ reflectionMergePartial<OAuth2Account>(this, message, value);
90
+ return message;
91
+ }
92
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OAuth2Account): OAuth2Account {
93
+ let message = target ?? this.create(), end = reader.pos + length;
94
+ while (reader.pos < end) {
95
+ let [fieldNo, wireType] = reader.tag();
96
+ switch (fieldNo) {
97
+ case /* uint64 account_id = 1 [jstype = JS_STRING];*/ 1:
98
+ message.accountId = reader.uint64().toString();
99
+ break;
100
+ case /* optional resources.timestamp.Timestamp created_at */ 2:
101
+ message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt);
102
+ break;
103
+ case /* string provider_name */ 3:
104
+ message.providerName = reader.string();
105
+ break;
106
+ case /* resources.accounts.OAuth2Provider provider */ 4:
107
+ message.provider = OAuth2Provider.internalBinaryRead(reader, reader.uint32(), options, message.provider);
108
+ break;
109
+ case /* uint64 external_id = 5 [jstype = JS_STRING];*/ 5:
110
+ message.externalId = reader.uint64().toString();
111
+ break;
112
+ case /* string username */ 6:
113
+ message.username = reader.string();
114
+ break;
115
+ case /* string avatar */ 7:
116
+ message.avatar = reader.string();
117
+ break;
118
+ default:
119
+ let u = options.readUnknownField;
120
+ if (u === "throw")
121
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
122
+ let d = reader.skip(wireType);
123
+ if (u !== false)
124
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
125
+ }
126
+ }
127
+ return message;
128
+ }
129
+ internalBinaryWrite(message: OAuth2Account, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
130
+ /* uint64 account_id = 1 [jstype = JS_STRING]; */
131
+ if (message.accountId !== "0")
132
+ writer.tag(1, WireType.Varint).uint64(message.accountId);
133
+ /* optional resources.timestamp.Timestamp created_at = 2; */
134
+ if (message.createdAt)
135
+ Timestamp.internalBinaryWrite(message.createdAt, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
136
+ /* string provider_name = 3; */
137
+ if (message.providerName !== "")
138
+ writer.tag(3, WireType.LengthDelimited).string(message.providerName);
139
+ /* resources.accounts.OAuth2Provider provider = 4; */
140
+ if (message.provider)
141
+ OAuth2Provider.internalBinaryWrite(message.provider, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
142
+ /* uint64 external_id = 5 [jstype = JS_STRING]; */
143
+ if (message.externalId !== "0")
144
+ writer.tag(5, WireType.Varint).uint64(message.externalId);
145
+ /* string username = 6; */
146
+ if (message.username !== "")
147
+ writer.tag(6, WireType.LengthDelimited).string(message.username);
148
+ /* string avatar = 7; */
149
+ if (message.avatar !== "")
150
+ writer.tag(7, WireType.LengthDelimited).string(message.avatar);
151
+ let u = options.writeUnknownFields;
152
+ if (u !== false)
153
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
154
+ return writer;
155
+ }
156
+ }
157
+ /**
158
+ * @generated MessageType for protobuf message resources.accounts.OAuth2Account
159
+ */
160
+ export const OAuth2Account = new OAuth2Account$Type();
161
+ // @generated message type with reflection information, may provide speed optimized methods
162
+ class OAuth2Provider$Type extends MessageType<OAuth2Provider> {
163
+ constructor() {
164
+ super("resources.accounts.OAuth2Provider", [
165
+ { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
166
+ { no: 2, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
167
+ { no: 3, name: "homepage", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
168
+ { no: 4, name: "icon", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
169
+ ]);
170
+ }
171
+ create(value?: PartialMessage<OAuth2Provider>): OAuth2Provider {
172
+ const message = globalThis.Object.create((this.messagePrototype!));
173
+ message.name = "";
174
+ message.label = "";
175
+ message.homepage = "";
176
+ if (value !== undefined)
177
+ reflectionMergePartial<OAuth2Provider>(this, message, value);
178
+ return message;
179
+ }
180
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OAuth2Provider): OAuth2Provider {
181
+ let message = target ?? this.create(), end = reader.pos + length;
182
+ while (reader.pos < end) {
183
+ let [fieldNo, wireType] = reader.tag();
184
+ switch (fieldNo) {
185
+ case /* string name */ 1:
186
+ message.name = reader.string();
187
+ break;
188
+ case /* string label */ 2:
189
+ message.label = reader.string();
190
+ break;
191
+ case /* string homepage */ 3:
192
+ message.homepage = reader.string();
193
+ break;
194
+ case /* optional string icon */ 4:
195
+ message.icon = reader.string();
196
+ break;
197
+ default:
198
+ let u = options.readUnknownField;
199
+ if (u === "throw")
200
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
201
+ let d = reader.skip(wireType);
202
+ if (u !== false)
203
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
204
+ }
205
+ }
206
+ return message;
207
+ }
208
+ internalBinaryWrite(message: OAuth2Provider, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
209
+ /* string name = 1; */
210
+ if (message.name !== "")
211
+ writer.tag(1, WireType.LengthDelimited).string(message.name);
212
+ /* string label = 2; */
213
+ if (message.label !== "")
214
+ writer.tag(2, WireType.LengthDelimited).string(message.label);
215
+ /* string homepage = 3; */
216
+ if (message.homepage !== "")
217
+ writer.tag(3, WireType.LengthDelimited).string(message.homepage);
218
+ /* optional string icon = 4; */
219
+ if (message.icon !== undefined)
220
+ writer.tag(4, WireType.LengthDelimited).string(message.icon);
221
+ let u = options.writeUnknownFields;
222
+ if (u !== false)
223
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
224
+ return writer;
225
+ }
226
+ }
227
+ /**
228
+ * @generated MessageType for protobuf message resources.accounts.OAuth2Provider
229
+ */
230
+ export const OAuth2Provider = new OAuth2Provider$Type();