@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
@@ -0,0 +1,309 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter optimize_speed,long_type_number,force_server_none
2
+ // @generated from protobuf file "resources/common/access/dummy.proto" (package "resources.common.access", 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
+ /**
14
+ * @generated from protobuf message resources.common.access.DummyJobAccess
15
+ */
16
+ export interface DummyJobAccess {
17
+ /**
18
+ * @generated from protobuf field: uint64 id = 1 [jstype = JS_STRING];
19
+ */
20
+ id: string;
21
+ /**
22
+ * @generated from protobuf field: uint64 target_id = 2 [jstype = JS_STRING];
23
+ */
24
+ targetId: string;
25
+ /**
26
+ * @generated from protobuf field: string job = 3;
27
+ */
28
+ job: string;
29
+ /**
30
+ * @generated from protobuf field: int32 minimum_grade = 4;
31
+ */
32
+ minimumGrade: number;
33
+ /**
34
+ * @generated from protobuf field: resources.common.access.AccessLevel access = 5;
35
+ */
36
+ access: AccessLevel;
37
+ }
38
+ /**
39
+ * @generated from protobuf message resources.common.access.DummyUserAccess
40
+ */
41
+ export interface DummyUserAccess {
42
+ /**
43
+ * @generated from protobuf field: uint64 id = 1 [jstype = JS_STRING];
44
+ */
45
+ id: string;
46
+ /**
47
+ * @generated from protobuf field: uint64 target_id = 2 [jstype = JS_STRING];
48
+ */
49
+ targetId: string;
50
+ /**
51
+ * @generated from protobuf field: int32 user_id = 3;
52
+ */
53
+ userId: number;
54
+ /**
55
+ * @generated from protobuf field: resources.common.access.AccessLevel access = 4;
56
+ */
57
+ access: AccessLevel;
58
+ }
59
+ /**
60
+ * @generated from protobuf message resources.common.access.DummyQualificationAccess
61
+ */
62
+ export interface DummyQualificationAccess {
63
+ /**
64
+ * @generated from protobuf field: uint64 id = 1 [jstype = JS_STRING];
65
+ */
66
+ id: string;
67
+ /**
68
+ * @generated from protobuf field: uint64 target_id = 2 [jstype = JS_STRING];
69
+ */
70
+ targetId: string;
71
+ /**
72
+ * @generated from protobuf field: uint64 qualification_id = 3 [jstype = JS_STRING];
73
+ */
74
+ qualificationId: string;
75
+ /**
76
+ * @generated from protobuf field: resources.common.access.AccessLevel access = 4;
77
+ */
78
+ access: AccessLevel;
79
+ }
80
+ /**
81
+ * @generated from protobuf enum resources.common.access.AccessLevel
82
+ */
83
+ export enum AccessLevel {
84
+ /**
85
+ * @generated from protobuf enum value: ACCESS_LEVEL_UNSPECIFIED = 0;
86
+ */
87
+ UNSPECIFIED = 0
88
+ }
89
+ // @generated message type with reflection information, may provide speed optimized methods
90
+ class DummyJobAccess$Type extends MessageType<DummyJobAccess> {
91
+ constructor() {
92
+ super("resources.common.access.DummyJobAccess", [
93
+ { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
94
+ { no: 2, name: "target_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
95
+ { no: 3, name: "job", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "20" } } } },
96
+ { no: 4, name: "minimum_grade", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gte: 0 } } } },
97
+ { no: 5, name: "access", kind: "enum", T: () => ["resources.common.access.AccessLevel", AccessLevel, "ACCESS_LEVEL_"], options: { "validate.rules": { enum: { definedOnly: true } } } }
98
+ ]);
99
+ }
100
+ create(value?: PartialMessage<DummyJobAccess>): DummyJobAccess {
101
+ const message = globalThis.Object.create((this.messagePrototype!));
102
+ message.id = "0";
103
+ message.targetId = "0";
104
+ message.job = "";
105
+ message.minimumGrade = 0;
106
+ message.access = 0;
107
+ if (value !== undefined)
108
+ reflectionMergePartial<DummyJobAccess>(this, message, value);
109
+ return message;
110
+ }
111
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DummyJobAccess): DummyJobAccess {
112
+ let message = target ?? this.create(), end = reader.pos + length;
113
+ while (reader.pos < end) {
114
+ let [fieldNo, wireType] = reader.tag();
115
+ switch (fieldNo) {
116
+ case /* uint64 id = 1 [jstype = JS_STRING];*/ 1:
117
+ message.id = reader.uint64().toString();
118
+ break;
119
+ case /* uint64 target_id = 2 [jstype = JS_STRING];*/ 2:
120
+ message.targetId = reader.uint64().toString();
121
+ break;
122
+ case /* string job */ 3:
123
+ message.job = reader.string();
124
+ break;
125
+ case /* int32 minimum_grade */ 4:
126
+ message.minimumGrade = reader.int32();
127
+ break;
128
+ case /* resources.common.access.AccessLevel access */ 5:
129
+ message.access = reader.int32();
130
+ break;
131
+ default:
132
+ let u = options.readUnknownField;
133
+ if (u === "throw")
134
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
135
+ let d = reader.skip(wireType);
136
+ if (u !== false)
137
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
138
+ }
139
+ }
140
+ return message;
141
+ }
142
+ internalBinaryWrite(message: DummyJobAccess, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
143
+ /* uint64 id = 1 [jstype = JS_STRING]; */
144
+ if (message.id !== "0")
145
+ writer.tag(1, WireType.Varint).uint64(message.id);
146
+ /* uint64 target_id = 2 [jstype = JS_STRING]; */
147
+ if (message.targetId !== "0")
148
+ writer.tag(2, WireType.Varint).uint64(message.targetId);
149
+ /* string job = 3; */
150
+ if (message.job !== "")
151
+ writer.tag(3, WireType.LengthDelimited).string(message.job);
152
+ /* int32 minimum_grade = 4; */
153
+ if (message.minimumGrade !== 0)
154
+ writer.tag(4, WireType.Varint).int32(message.minimumGrade);
155
+ /* resources.common.access.AccessLevel access = 5; */
156
+ if (message.access !== 0)
157
+ writer.tag(5, WireType.Varint).int32(message.access);
158
+ let u = options.writeUnknownFields;
159
+ if (u !== false)
160
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
161
+ return writer;
162
+ }
163
+ }
164
+ /**
165
+ * @generated MessageType for protobuf message resources.common.access.DummyJobAccess
166
+ */
167
+ export const DummyJobAccess = new DummyJobAccess$Type();
168
+ // @generated message type with reflection information, may provide speed optimized methods
169
+ class DummyUserAccess$Type extends MessageType<DummyUserAccess> {
170
+ constructor() {
171
+ super("resources.common.access.DummyUserAccess", [
172
+ { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
173
+ { no: 2, name: "target_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
174
+ { no: 3, name: "user_id", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gt: 0 } } } },
175
+ { no: 4, name: "access", kind: "enum", T: () => ["resources.common.access.AccessLevel", AccessLevel, "ACCESS_LEVEL_"], options: { "validate.rules": { enum: { definedOnly: true } } } }
176
+ ]);
177
+ }
178
+ create(value?: PartialMessage<DummyUserAccess>): DummyUserAccess {
179
+ const message = globalThis.Object.create((this.messagePrototype!));
180
+ message.id = "0";
181
+ message.targetId = "0";
182
+ message.userId = 0;
183
+ message.access = 0;
184
+ if (value !== undefined)
185
+ reflectionMergePartial<DummyUserAccess>(this, message, value);
186
+ return message;
187
+ }
188
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DummyUserAccess): DummyUserAccess {
189
+ let message = target ?? this.create(), end = reader.pos + length;
190
+ while (reader.pos < end) {
191
+ let [fieldNo, wireType] = reader.tag();
192
+ switch (fieldNo) {
193
+ case /* uint64 id = 1 [jstype = JS_STRING];*/ 1:
194
+ message.id = reader.uint64().toString();
195
+ break;
196
+ case /* uint64 target_id = 2 [jstype = JS_STRING];*/ 2:
197
+ message.targetId = reader.uint64().toString();
198
+ break;
199
+ case /* int32 user_id */ 3:
200
+ message.userId = reader.int32();
201
+ break;
202
+ case /* resources.common.access.AccessLevel access */ 4:
203
+ message.access = reader.int32();
204
+ break;
205
+ default:
206
+ let u = options.readUnknownField;
207
+ if (u === "throw")
208
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
209
+ let d = reader.skip(wireType);
210
+ if (u !== false)
211
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
212
+ }
213
+ }
214
+ return message;
215
+ }
216
+ internalBinaryWrite(message: DummyUserAccess, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
217
+ /* uint64 id = 1 [jstype = JS_STRING]; */
218
+ if (message.id !== "0")
219
+ writer.tag(1, WireType.Varint).uint64(message.id);
220
+ /* uint64 target_id = 2 [jstype = JS_STRING]; */
221
+ if (message.targetId !== "0")
222
+ writer.tag(2, WireType.Varint).uint64(message.targetId);
223
+ /* int32 user_id = 3; */
224
+ if (message.userId !== 0)
225
+ writer.tag(3, WireType.Varint).int32(message.userId);
226
+ /* resources.common.access.AccessLevel access = 4; */
227
+ if (message.access !== 0)
228
+ writer.tag(4, WireType.Varint).int32(message.access);
229
+ let u = options.writeUnknownFields;
230
+ if (u !== false)
231
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
232
+ return writer;
233
+ }
234
+ }
235
+ /**
236
+ * @generated MessageType for protobuf message resources.common.access.DummyUserAccess
237
+ */
238
+ export const DummyUserAccess = new DummyUserAccess$Type();
239
+ // @generated message type with reflection information, may provide speed optimized methods
240
+ class DummyQualificationAccess$Type extends MessageType<DummyQualificationAccess> {
241
+ constructor() {
242
+ super("resources.common.access.DummyQualificationAccess", [
243
+ { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
244
+ { no: 2, name: "target_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
245
+ { no: 3, name: "qualification_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
246
+ { no: 4, name: "access", kind: "enum", T: () => ["resources.common.access.AccessLevel", AccessLevel, "ACCESS_LEVEL_"], options: { "validate.rules": { enum: { definedOnly: true } } } }
247
+ ]);
248
+ }
249
+ create(value?: PartialMessage<DummyQualificationAccess>): DummyQualificationAccess {
250
+ const message = globalThis.Object.create((this.messagePrototype!));
251
+ message.id = "0";
252
+ message.targetId = "0";
253
+ message.qualificationId = "0";
254
+ message.access = 0;
255
+ if (value !== undefined)
256
+ reflectionMergePartial<DummyQualificationAccess>(this, message, value);
257
+ return message;
258
+ }
259
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DummyQualificationAccess): DummyQualificationAccess {
260
+ let message = target ?? this.create(), end = reader.pos + length;
261
+ while (reader.pos < end) {
262
+ let [fieldNo, wireType] = reader.tag();
263
+ switch (fieldNo) {
264
+ case /* uint64 id = 1 [jstype = JS_STRING];*/ 1:
265
+ message.id = reader.uint64().toString();
266
+ break;
267
+ case /* uint64 target_id = 2 [jstype = JS_STRING];*/ 2:
268
+ message.targetId = reader.uint64().toString();
269
+ break;
270
+ case /* uint64 qualification_id = 3 [jstype = JS_STRING];*/ 3:
271
+ message.qualificationId = reader.uint64().toString();
272
+ break;
273
+ case /* resources.common.access.AccessLevel access */ 4:
274
+ message.access = reader.int32();
275
+ break;
276
+ default:
277
+ let u = options.readUnknownField;
278
+ if (u === "throw")
279
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
280
+ let d = reader.skip(wireType);
281
+ if (u !== false)
282
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
283
+ }
284
+ }
285
+ return message;
286
+ }
287
+ internalBinaryWrite(message: DummyQualificationAccess, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
288
+ /* uint64 id = 1 [jstype = JS_STRING]; */
289
+ if (message.id !== "0")
290
+ writer.tag(1, WireType.Varint).uint64(message.id);
291
+ /* uint64 target_id = 2 [jstype = JS_STRING]; */
292
+ if (message.targetId !== "0")
293
+ writer.tag(2, WireType.Varint).uint64(message.targetId);
294
+ /* uint64 qualification_id = 3 [jstype = JS_STRING]; */
295
+ if (message.qualificationId !== "0")
296
+ writer.tag(3, WireType.Varint).uint64(message.qualificationId);
297
+ /* resources.common.access.AccessLevel access = 4; */
298
+ if (message.access !== 0)
299
+ writer.tag(4, WireType.Varint).int32(message.access);
300
+ let u = options.writeUnknownFields;
301
+ if (u !== false)
302
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
303
+ return writer;
304
+ }
305
+ }
306
+ /**
307
+ * @generated MessageType for protobuf message resources.common.access.DummyQualificationAccess
308
+ */
309
+ export const DummyQualificationAccess = new DummyQualificationAccess$Type();
@@ -0,0 +1,252 @@
1
+ // @generated by protobuf-ts 2.9.4 with parameter optimize_speed,long_type_number,force_server_none
2
+ // @generated from protobuf file "resources/common/content/content.proto" (package "resources.common.content", 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
+ /**
14
+ * @generated from protobuf message resources.common.content.Content
15
+ */
16
+ export interface Content {
17
+ /**
18
+ * @generated from protobuf field: optional string version = 1;
19
+ */
20
+ version?: string;
21
+ /**
22
+ * @generated from protobuf field: optional resources.common.content.JSONNode content = 2;
23
+ */
24
+ content?: JSONNode;
25
+ /**
26
+ * @sanitize
27
+ *
28
+ * @generated from protobuf field: optional string raw_content = 3;
29
+ */
30
+ rawContent?: string;
31
+ }
32
+ /**
33
+ * @generated from protobuf message resources.common.content.JSONNode
34
+ */
35
+ export interface JSONNode {
36
+ /**
37
+ * @sanitize: method=StripTags
38
+ *
39
+ * @generated from protobuf field: string type = 1;
40
+ */
41
+ type: string;
42
+ /**
43
+ * @sanitize: method=StripTags
44
+ *
45
+ * @generated from protobuf field: string id = 2;
46
+ */
47
+ id: string;
48
+ /**
49
+ * @sanitize: method=StripTags
50
+ *
51
+ * @generated from protobuf field: string tag = 3;
52
+ */
53
+ tag: string;
54
+ /**
55
+ * @sanitize: method=StripTags
56
+ *
57
+ * @generated from protobuf field: map<string, string> attrs = 4;
58
+ */
59
+ attrs: {
60
+ [key: string]: string;
61
+ };
62
+ /**
63
+ * @sanitize: method=StripTags
64
+ *
65
+ * @generated from protobuf field: string text = 5;
66
+ */
67
+ text: string;
68
+ /**
69
+ * @generated from protobuf field: repeated resources.common.content.JSONNode content = 6;
70
+ */
71
+ content: JSONNode[];
72
+ }
73
+ /**
74
+ * @generated from protobuf enum resources.common.content.ContentType
75
+ */
76
+ export enum ContentType {
77
+ /**
78
+ * @generated from protobuf enum value: CONTENT_TYPE_UNSPECIFIED = 0;
79
+ */
80
+ UNSPECIFIED = 0,
81
+ /**
82
+ * @generated from protobuf enum value: CONTENT_TYPE_HTML = 1;
83
+ */
84
+ HTML = 1,
85
+ /**
86
+ * @generated from protobuf enum value: CONTENT_TYPE_PLAIN = 2;
87
+ */
88
+ PLAIN = 2
89
+ }
90
+ // @generated message type with reflection information, may provide speed optimized methods
91
+ class Content$Type extends MessageType<Content> {
92
+ constructor() {
93
+ super("resources.common.content.Content", [
94
+ { no: 1, name: "version", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "24" } } } },
95
+ { no: 2, name: "content", kind: "message", T: () => JSONNode },
96
+ { no: 3, name: "raw_content", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "2000000" } } } }
97
+ ]);
98
+ }
99
+ create(value?: PartialMessage<Content>): Content {
100
+ const message = globalThis.Object.create((this.messagePrototype!));
101
+ if (value !== undefined)
102
+ reflectionMergePartial<Content>(this, message, value);
103
+ return message;
104
+ }
105
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Content): Content {
106
+ let message = target ?? this.create(), end = reader.pos + length;
107
+ while (reader.pos < end) {
108
+ let [fieldNo, wireType] = reader.tag();
109
+ switch (fieldNo) {
110
+ case /* optional string version */ 1:
111
+ message.version = reader.string();
112
+ break;
113
+ case /* optional resources.common.content.JSONNode content */ 2:
114
+ message.content = JSONNode.internalBinaryRead(reader, reader.uint32(), options, message.content);
115
+ break;
116
+ case /* optional string raw_content */ 3:
117
+ message.rawContent = reader.string();
118
+ break;
119
+ default:
120
+ let u = options.readUnknownField;
121
+ if (u === "throw")
122
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
123
+ let d = reader.skip(wireType);
124
+ if (u !== false)
125
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
126
+ }
127
+ }
128
+ return message;
129
+ }
130
+ internalBinaryWrite(message: Content, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
131
+ /* optional string version = 1; */
132
+ if (message.version !== undefined)
133
+ writer.tag(1, WireType.LengthDelimited).string(message.version);
134
+ /* optional resources.common.content.JSONNode content = 2; */
135
+ if (message.content)
136
+ JSONNode.internalBinaryWrite(message.content, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
137
+ /* optional string raw_content = 3; */
138
+ if (message.rawContent !== undefined)
139
+ writer.tag(3, WireType.LengthDelimited).string(message.rawContent);
140
+ let u = options.writeUnknownFields;
141
+ if (u !== false)
142
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
143
+ return writer;
144
+ }
145
+ }
146
+ /**
147
+ * @generated MessageType for protobuf message resources.common.content.Content
148
+ */
149
+ export const Content = new Content$Type();
150
+ // @generated message type with reflection information, may provide speed optimized methods
151
+ class JSONNode$Type extends MessageType<JSONNode> {
152
+ constructor() {
153
+ super("resources.common.content.JSONNode", [
154
+ { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
155
+ { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
156
+ { no: 3, name: "tag", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
157
+ { no: 4, name: "attrs", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
158
+ { no: 5, name: "text", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
159
+ { no: 6, name: "content", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => JSONNode }
160
+ ]);
161
+ }
162
+ create(value?: PartialMessage<JSONNode>): JSONNode {
163
+ const message = globalThis.Object.create((this.messagePrototype!));
164
+ message.type = "";
165
+ message.id = "";
166
+ message.tag = "";
167
+ message.attrs = {};
168
+ message.text = "";
169
+ message.content = [];
170
+ if (value !== undefined)
171
+ reflectionMergePartial<JSONNode>(this, message, value);
172
+ return message;
173
+ }
174
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JSONNode): JSONNode {
175
+ let message = target ?? this.create(), end = reader.pos + length;
176
+ while (reader.pos < end) {
177
+ let [fieldNo, wireType] = reader.tag();
178
+ switch (fieldNo) {
179
+ case /* string type */ 1:
180
+ message.type = reader.string();
181
+ break;
182
+ case /* string id */ 2:
183
+ message.id = reader.string();
184
+ break;
185
+ case /* string tag */ 3:
186
+ message.tag = reader.string();
187
+ break;
188
+ case /* map<string, string> attrs */ 4:
189
+ this.binaryReadMap4(message.attrs, reader, options);
190
+ break;
191
+ case /* string text */ 5:
192
+ message.text = reader.string();
193
+ break;
194
+ case /* repeated resources.common.content.JSONNode content */ 6:
195
+ message.content.push(JSONNode.internalBinaryRead(reader, reader.uint32(), options));
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
+ private binaryReadMap4(map: JSONNode["attrs"], reader: IBinaryReader, options: BinaryReadOptions): void {
209
+ let len = reader.uint32(), end = reader.pos + len, key: keyof JSONNode["attrs"] | undefined, val: JSONNode["attrs"][any] | undefined;
210
+ while (reader.pos < end) {
211
+ let [fieldNo, wireType] = reader.tag();
212
+ switch (fieldNo) {
213
+ case 1:
214
+ key = reader.string();
215
+ break;
216
+ case 2:
217
+ val = reader.string();
218
+ break;
219
+ default: throw new globalThis.Error("unknown map entry field for field resources.common.content.JSONNode.attrs");
220
+ }
221
+ }
222
+ map[key ?? ""] = val ?? "";
223
+ }
224
+ internalBinaryWrite(message: JSONNode, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
225
+ /* string type = 1; */
226
+ if (message.type !== "")
227
+ writer.tag(1, WireType.LengthDelimited).string(message.type);
228
+ /* string id = 2; */
229
+ if (message.id !== "")
230
+ writer.tag(2, WireType.LengthDelimited).string(message.id);
231
+ /* string tag = 3; */
232
+ if (message.tag !== "")
233
+ writer.tag(3, WireType.LengthDelimited).string(message.tag);
234
+ /* map<string, string> attrs = 4; */
235
+ for (let k of globalThis.Object.keys(message.attrs))
236
+ writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.attrs[k]).join();
237
+ /* string text = 5; */
238
+ if (message.text !== "")
239
+ writer.tag(5, WireType.LengthDelimited).string(message.text);
240
+ /* repeated resources.common.content.JSONNode content = 6; */
241
+ for (let i = 0; i < message.content.length; i++)
242
+ JSONNode.internalBinaryWrite(message.content[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
243
+ let u = options.writeUnknownFields;
244
+ if (u !== false)
245
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
246
+ return writer;
247
+ }
248
+ }
249
+ /**
250
+ * @generated MessageType for protobuf message resources.common.content.JSONNode
251
+ */
252
+ export const JSONNode = new JSONNode$Type();