@fivenet-app/gen 2025.5.2 → 2025.9.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 (169) hide show
  1. package/buf/validate/validate.ts +11301 -0
  2. package/clients.ts +157 -154
  3. package/codegen/dbscanner/dbscanner.ts +91 -0
  4. package/codegen/perms/perms.ts +208 -0
  5. package/codegen/sanitizer/sanitizer.ts +80 -0
  6. package/google/protobuf/any.ts +4 -3
  7. package/google/protobuf/descriptor.ts +393 -239
  8. package/google/protobuf/duration.ts +4 -3
  9. package/google/protobuf/struct.ts +485 -0
  10. package/google/protobuf/timestamp.ts +4 -3
  11. package/package.json +3 -3
  12. package/perms.ts +85 -159
  13. package/resources/accounts/accounts.ts +26 -25
  14. package/resources/accounts/oauth2.ts +30 -29
  15. package/resources/audit/audit.ts +36 -35
  16. package/resources/calendar/access.ts +49 -48
  17. package/resources/calendar/calendar.ts +122 -126
  18. package/resources/centrum/access.ts +345 -0
  19. package/resources/centrum/attributes.ts +8 -11
  20. package/resources/centrum/dispatchers.ts +149 -0
  21. package/resources/centrum/dispatches.ts +252 -115
  22. package/resources/centrum/settings.ts +384 -34
  23. package/resources/centrum/units.ts +112 -92
  24. package/resources/centrum/units_access.ts +54 -55
  25. package/resources/clientconfig/clientconfig.ts +890 -0
  26. package/resources/collab/collab.ts +817 -0
  27. package/resources/common/content/content.ts +113 -30
  28. package/resources/common/cron/cron.ts +43 -31
  29. package/resources/common/database/database.ts +92 -35
  30. package/resources/common/error.ts +17 -16
  31. package/resources/common/grpcws/grpcws.ts +24 -23
  32. package/resources/common/i18n.ts +20 -24
  33. package/resources/common/id_mapping.ts +69 -0
  34. package/resources/common/tests/objects.ts +4 -3
  35. package/resources/common/uuid.ts +4 -3
  36. package/resources/discord/discord.ts +209 -0
  37. package/resources/documents/access.ts +52 -53
  38. package/resources/documents/activity.ts +235 -58
  39. package/resources/documents/category.ts +20 -27
  40. package/resources/documents/comment.ts +26 -25
  41. package/resources/documents/documents.ts +335 -262
  42. package/resources/documents/pins.ts +127 -0
  43. package/resources/documents/requests.ts +31 -30
  44. package/resources/documents/signoff.ts +55 -0
  45. package/resources/documents/state.ts +69 -0
  46. package/resources/documents/templates.ts +119 -136
  47. package/resources/documents/workflow.ts +35 -24
  48. package/resources/file/file.ts +152 -0
  49. package/{services/settings → resources/file}/filestore.ts +179 -165
  50. package/resources/file/meta.ts +148 -0
  51. package/resources/jobs/activity.ts +39 -42
  52. package/resources/jobs/colleagues.ts +67 -60
  53. package/resources/jobs/conduct.ts +29 -30
  54. package/resources/jobs/job_props.ts +46 -48
  55. package/resources/jobs/job_settings.ts +45 -52
  56. package/resources/jobs/jobs.ts +14 -13
  57. package/resources/jobs/labels.ts +21 -22
  58. package/resources/jobs/timeclock.ts +26 -25
  59. package/resources/laws/laws.ts +40 -49
  60. package/resources/livemap/coords.ts +81 -0
  61. package/resources/livemap/heatmap.ts +93 -0
  62. package/resources/livemap/{livemap.ts → marker_marker.ts} +43 -310
  63. package/resources/livemap/user_marker.ts +298 -0
  64. package/resources/mailer/access.ts +75 -74
  65. package/resources/mailer/email.ts +24 -27
  66. package/resources/mailer/events.ts +25 -24
  67. package/resources/mailer/message.ts +45 -50
  68. package/resources/mailer/settings.ts +12 -15
  69. package/resources/mailer/template.ts +25 -28
  70. package/resources/mailer/thread.ts +70 -71
  71. package/resources/notifications/client_view.ts +239 -0
  72. package/resources/notifications/events.ts +50 -101
  73. package/resources/notifications/notifications.ts +52 -57
  74. package/resources/permissions/attributes.ts +63 -206
  75. package/resources/permissions/events.ts +149 -0
  76. package/resources/permissions/permissions.ts +103 -34
  77. package/resources/qualifications/access.ts +27 -26
  78. package/resources/qualifications/exam.ts +188 -126
  79. package/resources/qualifications/qualifications.ts +370 -303
  80. package/resources/settings/banner.ts +14 -21
  81. package/resources/settings/config.ts +163 -79
  82. package/resources/settings/perms.ts +151 -0
  83. package/resources/settings/status.ts +533 -0
  84. package/resources/stats/stats.ts +3 -2
  85. package/resources/sync/activity.ts +24 -23
  86. package/resources/sync/data.ts +94 -26
  87. package/resources/timestamp/timestamp.ts +3 -2
  88. package/resources/{centrum/user_unit.ts → tracker/mapping.ts} +44 -44
  89. package/resources/userinfo/user_info.ts +464 -0
  90. package/resources/users/activity.ts +80 -85
  91. package/resources/users/labels.ts +18 -21
  92. package/resources/users/licenses.ts +9 -8
  93. package/resources/users/props.ts +61 -51
  94. package/resources/users/users.ts +100 -78
  95. package/resources/vehicles/activity.ts +231 -0
  96. package/resources/vehicles/props.ts +103 -0
  97. package/resources/vehicles/vehicles.ts +28 -15
  98. package/resources/wiki/access.ts +49 -48
  99. package/resources/wiki/activity.ts +133 -51
  100. package/resources/wiki/page.ts +134 -87
  101. package/services/auth/auth.client.ts +24 -27
  102. package/services/auth/auth.ts +222 -195
  103. package/services/calendar/calendar.client.ts +32 -91
  104. package/services/calendar/calendar.ts +110 -109
  105. package/services/centrum/centrum.client.ts +97 -137
  106. package/services/centrum/centrum.ts +701 -298
  107. package/services/citizens/citizens.client.ts +70 -39
  108. package/services/citizens/citizens.ts +183 -93
  109. package/services/completor/completor.client.ts +16 -35
  110. package/services/completor/completor.ts +65 -44
  111. package/services/documents/collab.client.ts +46 -0
  112. package/services/documents/collab.ts +13 -0
  113. package/services/documents/documents.client.ts +88 -217
  114. package/services/documents/documents.ts +490 -508
  115. package/services/filestore/filestore.client.ts +86 -0
  116. package/services/filestore/filestore.ts +262 -0
  117. package/services/jobs/conduct.client.ts +10 -25
  118. package/services/jobs/conduct.ts +36 -35
  119. package/services/jobs/jobs.client.ts +22 -61
  120. package/services/jobs/jobs.ts +108 -91
  121. package/services/jobs/timeclock.client.ts +8 -19
  122. package/services/jobs/timeclock.ts +47 -46
  123. package/services/livemap/livemap.client.ts +8 -19
  124. package/services/livemap/livemap.ts +290 -119
  125. package/services/mailer/mailer.client.ts +44 -127
  126. package/services/mailer/mailer.ts +213 -216
  127. package/services/notifications/notifications.client.ts +65 -0
  128. package/services/{notificator/notificator.ts → notifications/notifications.ts} +117 -74
  129. package/services/qualifications/qualifications.client.ts +46 -91
  130. package/services/qualifications/qualifications.ts +181 -175
  131. package/services/settings/accounts.client.ts +10 -25
  132. package/services/settings/accounts.ts +64 -41
  133. package/services/settings/config.client.ts +6 -13
  134. package/services/settings/config.ts +8 -7
  135. package/services/settings/cron.client.ts +4 -7
  136. package/services/settings/cron.ts +4 -3
  137. package/services/settings/laws.client.ts +10 -25
  138. package/services/settings/laws.ts +29 -28
  139. package/services/settings/settings.client.ts +57 -103
  140. package/services/settings/settings.ts +190 -607
  141. package/services/settings/system.client.ts +90 -0
  142. package/services/settings/system.ts +618 -0
  143. package/services/stats/stats.client.ts +4 -3
  144. package/services/stats/stats.ts +4 -3
  145. package/services/sync/sync.client.ts +16 -15
  146. package/services/sync/sync.ts +82 -52
  147. package/services/vehicles/vehicles.client.ts +17 -7
  148. package/services/vehicles/vehicles.ts +169 -24
  149. package/services/wiki/collab.client.ts +46 -0
  150. package/services/wiki/collab.ts +13 -0
  151. package/services/wiki/wiki.client.ts +28 -37
  152. package/services/wiki/wiki.ts +93 -63
  153. package/svcs.ts +79 -103
  154. package/resources/centrum/disponents.ts +0 -81
  155. package/resources/filestore/file.ts +0 -204
  156. package/resources/internet/access.ts +0 -358
  157. package/resources/internet/ads.ts +0 -257
  158. package/resources/internet/domain.ts +0 -328
  159. package/resources/internet/page.ts +0 -428
  160. package/resources/internet/search.ts +0 -128
  161. package/resources/livemap/tracker.ts +0 -81
  162. package/services/internet/ads.client.ts +0 -41
  163. package/services/internet/ads.ts +0 -145
  164. package/services/internet/domain.client.ts +0 -109
  165. package/services/internet/domain.ts +0 -658
  166. package/services/internet/internet.client.ts +0 -58
  167. package/services/internet/internet.ts +0 -268
  168. package/services/notificator/notificator.client.ts +0 -76
  169. package/services/settings/filestore.client.ts +0 -75
@@ -1,7 +1,7 @@
1
- // @generated by protobuf-ts 2.10.0 with parameter optimize_speed,long_type_number,force_server_none
2
- // @generated from protobuf file "services/settings/filestore.proto" (package "services.settings", syntax proto3)
1
+ // @generated by protobuf-ts 2.11.1 with parameter force_server_none,long_type_number,optimize_speed,ts_nocheck
2
+ // @generated from protobuf file "resources/file/filestore.proto" (package "resources.file", syntax proto3)
3
+ // tslint:disable
3
4
  // @ts-nocheck
4
- import { ServiceType } from "@protobuf-ts/runtime-rpc";
5
5
  import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
6
6
  import type { IBinaryWriter } from "@protobuf-ts/runtime";
7
7
  import { WireType } from "@protobuf-ts/runtime";
@@ -11,100 +11,127 @@ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
11
  import type { PartialMessage } from "@protobuf-ts/runtime";
12
12
  import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
13
  import { MessageType } from "@protobuf-ts/runtime";
14
- import { File } from "../../resources/filestore/file";
15
- import { FileInfo } from "../../resources/filestore/file";
16
- import { PaginationResponse } from "../../resources/common/database/database";
17
- import { PaginationRequest } from "../../resources/common/database/database";
14
+ import { File } from "./file";
18
15
  /**
19
- * @generated from protobuf message services.settings.ListFilesRequest
16
+ * @generated from protobuf message resources.file.UploadFileRequest
20
17
  */
21
- export interface ListFilesRequest {
22
- /**
23
- * @generated from protobuf field: resources.common.database.PaginationRequest pagination = 1;
24
- */
25
- pagination?: PaginationRequest;
18
+ export interface UploadFileRequest {
26
19
  /**
27
- * @generated from protobuf field: optional string path = 2;
20
+ * @generated from protobuf oneof: payload
28
21
  */
29
- path?: string;
22
+ payload: {
23
+ oneofKind: "meta";
24
+ /**
25
+ * @generated from protobuf field: resources.file.UploadMeta meta = 1
26
+ */
27
+ meta: UploadMeta;
28
+ } | {
29
+ oneofKind: "data";
30
+ /**
31
+ * Raw bytes <= 128 KiB each, browsers should only read 64 KiB at a time, but this is a buffer just in case
32
+ *
33
+ * @generated from protobuf field: bytes data = 2
34
+ */
35
+ data: Uint8Array;
36
+ } | {
37
+ oneofKind: undefined;
38
+ };
30
39
  }
31
40
  /**
32
- * @generated from protobuf message services.settings.ListFilesResponse
41
+ * @generated from protobuf message resources.file.UploadMeta
33
42
  */
34
- export interface ListFilesResponse {
43
+ export interface UploadMeta {
35
44
  /**
36
- * @generated from protobuf field: resources.common.database.PaginationResponse pagination = 1;
45
+ * @generated from protobuf field: int64 parent_id = 1
37
46
  */
38
- pagination?: PaginationResponse;
47
+ parentId: number;
39
48
  /**
40
- * @generated from protobuf field: repeated resources.filestore.FileInfo files = 2;
49
+ * @generated from protobuf field: string namespace = 2
41
50
  */
42
- files: FileInfo[];
43
- }
44
- /**
45
- * @generated from protobuf message services.settings.UploadFileRequest
46
- */
47
- export interface UploadFileRequest {
51
+ namespace: string; // "documents", "wiki", …
52
+ /**
53
+ * @generated from protobuf field: string original_name = 3
54
+ */
55
+ originalName: string;
48
56
  /**
49
- * @generated from protobuf field: string prefix = 1;
57
+ * @generated from protobuf field: string content_type = 4
50
58
  */
51
- prefix: string;
59
+ contentType: string; // optional - server re-validates
52
60
  /**
53
- * @generated from protobuf field: string name = 2;
61
+ * @generated from protobuf field: int64 size = 5
54
62
  */
55
- name: string;
63
+ size: number; // Size in bytes
56
64
  /**
57
- * @generated from protobuf field: resources.filestore.File file = 3;
65
+ * @generated from protobuf field: string reason = 6
58
66
  */
59
- file?: File;
67
+ reason: string;
60
68
  }
61
69
  /**
62
- * @generated from protobuf message services.settings.UploadFileResponse
70
+ * @generated from protobuf message resources.file.UploadFileResponse
63
71
  */
64
72
  export interface UploadFileResponse {
65
73
  /**
66
- * @generated from protobuf field: resources.filestore.FileInfo file = 1;
74
+ * @generated from protobuf field: int64 id = 1
67
75
  */
68
- file?: FileInfo;
76
+ id: number; // Unique ID for the uploaded file
77
+ /**
78
+ * @generated from protobuf field: string url = 2
79
+ */
80
+ url: string; // URL to the uploaded file
81
+ /**
82
+ * @generated from protobuf field: resources.file.File file = 3
83
+ */
84
+ file?: File; // File info
69
85
  }
70
86
  /**
71
- * @generated from protobuf message services.settings.DeleteFileRequest
87
+ * @generated from protobuf message resources.file.DeleteFileRequest
72
88
  */
73
89
  export interface DeleteFileRequest {
74
90
  /**
75
- * @generated from protobuf field: string path = 1;
91
+ * @generated from protobuf field: int64 parent_id = 1
76
92
  */
77
- path: string;
93
+ parentId: number;
94
+ /**
95
+ * @generated from protobuf field: int64 file_id = 2
96
+ */
97
+ fileId: number;
78
98
  }
79
99
  /**
80
- * @generated from protobuf message services.settings.DeleteFileResponse
100
+ * @generated from protobuf message resources.file.DeleteFileResponse
81
101
  */
82
102
  export interface DeleteFileResponse {
83
103
  }
84
104
  // @generated message type with reflection information, may provide speed optimized methods
85
- class ListFilesRequest$Type extends MessageType<ListFilesRequest> {
105
+ class UploadFileRequest$Type extends MessageType<UploadFileRequest> {
86
106
  constructor() {
87
- super("services.settings.ListFilesRequest", [
88
- { no: 1, name: "pagination", kind: "message", T: () => PaginationRequest, options: { "validate.rules": { message: { required: true } } } },
89
- { no: 2, name: "path", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxLen: "128" } } } }
107
+ super("resources.file.UploadFileRequest", [
108
+ { no: 1, name: "meta", kind: "message", oneof: "payload", T: () => UploadMeta },
109
+ { no: 2, name: "data", kind: "scalar", oneof: "payload", T: 12 /*ScalarType.BYTES*/, options: { "buf.validate.field": { bytes: { maxLen: "131072" } } } }
90
110
  ]);
91
111
  }
92
- create(value?: PartialMessage<ListFilesRequest>): ListFilesRequest {
112
+ create(value?: PartialMessage<UploadFileRequest>): UploadFileRequest {
93
113
  const message = globalThis.Object.create((this.messagePrototype!));
114
+ message.payload = { oneofKind: undefined };
94
115
  if (value !== undefined)
95
- reflectionMergePartial<ListFilesRequest>(this, message, value);
116
+ reflectionMergePartial<UploadFileRequest>(this, message, value);
96
117
  return message;
97
118
  }
98
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListFilesRequest): ListFilesRequest {
119
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadFileRequest): UploadFileRequest {
99
120
  let message = target ?? this.create(), end = reader.pos + length;
100
121
  while (reader.pos < end) {
101
122
  let [fieldNo, wireType] = reader.tag();
102
123
  switch (fieldNo) {
103
- case /* resources.common.database.PaginationRequest pagination */ 1:
104
- message.pagination = PaginationRequest.internalBinaryRead(reader, reader.uint32(), options, message.pagination);
124
+ case /* resources.file.UploadMeta meta */ 1:
125
+ message.payload = {
126
+ oneofKind: "meta",
127
+ meta: UploadMeta.internalBinaryRead(reader, reader.uint32(), options, (message.payload as any).meta)
128
+ };
105
129
  break;
106
- case /* optional string path */ 2:
107
- message.path = reader.string();
130
+ case /* bytes data */ 2:
131
+ message.payload = {
132
+ oneofKind: "data",
133
+ data: reader.bytes()
134
+ };
108
135
  break;
109
136
  default:
110
137
  let u = options.readUnknownField;
@@ -117,13 +144,13 @@ class ListFilesRequest$Type extends MessageType<ListFilesRequest> {
117
144
  }
118
145
  return message;
119
146
  }
120
- internalBinaryWrite(message: ListFilesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
121
- /* resources.common.database.PaginationRequest pagination = 1; */
122
- if (message.pagination)
123
- PaginationRequest.internalBinaryWrite(message.pagination, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
124
- /* optional string path = 2; */
125
- if (message.path !== undefined)
126
- writer.tag(2, WireType.LengthDelimited).string(message.path);
147
+ internalBinaryWrite(message: UploadFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
148
+ /* resources.file.UploadMeta meta = 1; */
149
+ if (message.payload.oneofKind === "meta")
150
+ UploadMeta.internalBinaryWrite(message.payload.meta, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
151
+ /* bytes data = 2; */
152
+ if (message.payload.oneofKind === "data")
153
+ writer.tag(2, WireType.LengthDelimited).bytes(message.payload.data);
127
154
  let u = options.writeUnknownFields;
128
155
  if (u !== false)
129
156
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -131,93 +158,55 @@ class ListFilesRequest$Type extends MessageType<ListFilesRequest> {
131
158
  }
132
159
  }
133
160
  /**
134
- * @generated MessageType for protobuf message services.settings.ListFilesRequest
161
+ * @generated MessageType for protobuf message resources.file.UploadFileRequest
135
162
  */
136
- export const ListFilesRequest = new ListFilesRequest$Type();
163
+ export const UploadFileRequest = new UploadFileRequest$Type();
137
164
  // @generated message type with reflection information, may provide speed optimized methods
138
- class ListFilesResponse$Type extends MessageType<ListFilesResponse> {
165
+ class UploadMeta$Type extends MessageType<UploadMeta> {
139
166
  constructor() {
140
- super("services.settings.ListFilesResponse", [
141
- { no: 1, name: "pagination", kind: "message", T: () => PaginationResponse },
142
- { no: 2, name: "files", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FileInfo }
167
+ super("resources.file.UploadMeta", [
168
+ { no: 1, name: "parent_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
169
+ { no: 2, name: "namespace", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
170
+ { no: 3, name: "original_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { maxLen: "255" } } } },
171
+ { no: 4, name: "content_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
172
+ { no: 5, name: "size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
173
+ { no: 6, name: "reason", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { ignore: "IGNORE_IF_ZERO_VALUE", string: { minLen: "3", maxLen: "255" } }, "codegen.sanitizer.sanitizer": { enabled: true } } }
143
174
  ]);
144
175
  }
145
- create(value?: PartialMessage<ListFilesResponse>): ListFilesResponse {
176
+ create(value?: PartialMessage<UploadMeta>): UploadMeta {
146
177
  const message = globalThis.Object.create((this.messagePrototype!));
147
- message.files = [];
178
+ message.parentId = 0;
179
+ message.namespace = "";
180
+ message.originalName = "";
181
+ message.contentType = "";
182
+ message.size = 0;
183
+ message.reason = "";
148
184
  if (value !== undefined)
149
- reflectionMergePartial<ListFilesResponse>(this, message, value);
185
+ reflectionMergePartial<UploadMeta>(this, message, value);
150
186
  return message;
151
187
  }
152
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListFilesResponse): ListFilesResponse {
188
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadMeta): UploadMeta {
153
189
  let message = target ?? this.create(), end = reader.pos + length;
154
190
  while (reader.pos < end) {
155
191
  let [fieldNo, wireType] = reader.tag();
156
192
  switch (fieldNo) {
157
- case /* resources.common.database.PaginationResponse pagination */ 1:
158
- message.pagination = PaginationResponse.internalBinaryRead(reader, reader.uint32(), options, message.pagination);
193
+ case /* int64 parent_id */ 1:
194
+ message.parentId = reader.int64().toNumber();
159
195
  break;
160
- case /* repeated resources.filestore.FileInfo files */ 2:
161
- message.files.push(FileInfo.internalBinaryRead(reader, reader.uint32(), options));
196
+ case /* string namespace */ 2:
197
+ message.namespace = reader.string();
162
198
  break;
163
- default:
164
- let u = options.readUnknownField;
165
- if (u === "throw")
166
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
167
- let d = reader.skip(wireType);
168
- if (u !== false)
169
- (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
170
- }
171
- }
172
- return message;
173
- }
174
- internalBinaryWrite(message: ListFilesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
175
- /* resources.common.database.PaginationResponse pagination = 1; */
176
- if (message.pagination)
177
- PaginationResponse.internalBinaryWrite(message.pagination, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
178
- /* repeated resources.filestore.FileInfo files = 2; */
179
- for (let i = 0; i < message.files.length; i++)
180
- FileInfo.internalBinaryWrite(message.files[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
181
- let u = options.writeUnknownFields;
182
- if (u !== false)
183
- (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
184
- return writer;
185
- }
186
- }
187
- /**
188
- * @generated MessageType for protobuf message services.settings.ListFilesResponse
189
- */
190
- export const ListFilesResponse = new ListFilesResponse$Type();
191
- // @generated message type with reflection information, may provide speed optimized methods
192
- class UploadFileRequest$Type extends MessageType<UploadFileRequest> {
193
- constructor() {
194
- super("services.settings.UploadFileRequest", [
195
- { no: 1, name: "prefix", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
196
- { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
197
- { no: 3, name: "file", kind: "message", T: () => File, options: { "validate.rules": { message: { required: true } } } }
198
- ]);
199
- }
200
- create(value?: PartialMessage<UploadFileRequest>): UploadFileRequest {
201
- const message = globalThis.Object.create((this.messagePrototype!));
202
- message.prefix = "";
203
- message.name = "";
204
- if (value !== undefined)
205
- reflectionMergePartial<UploadFileRequest>(this, message, value);
206
- return message;
207
- }
208
- internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadFileRequest): UploadFileRequest {
209
- let message = target ?? this.create(), end = reader.pos + length;
210
- while (reader.pos < end) {
211
- let [fieldNo, wireType] = reader.tag();
212
- switch (fieldNo) {
213
- case /* string prefix */ 1:
214
- message.prefix = reader.string();
199
+ case /* string original_name */ 3:
200
+ message.originalName = reader.string();
215
201
  break;
216
- case /* string name */ 2:
217
- message.name = reader.string();
202
+ case /* string content_type */ 4:
203
+ message.contentType = reader.string();
218
204
  break;
219
- case /* resources.filestore.File file */ 3:
220
- message.file = File.internalBinaryRead(reader, reader.uint32(), options, message.file);
205
+ case /* int64 size */ 5:
206
+ message.size = reader.int64().toNumber();
207
+ break;
208
+ case /* string reason */ 6:
209
+ message.reason = reader.string();
221
210
  break;
222
211
  default:
223
212
  let u = options.readUnknownField;
@@ -230,16 +219,25 @@ class UploadFileRequest$Type extends MessageType<UploadFileRequest> {
230
219
  }
231
220
  return message;
232
221
  }
233
- internalBinaryWrite(message: UploadFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
234
- /* string prefix = 1; */
235
- if (message.prefix !== "")
236
- writer.tag(1, WireType.LengthDelimited).string(message.prefix);
237
- /* string name = 2; */
238
- if (message.name !== "")
239
- writer.tag(2, WireType.LengthDelimited).string(message.name);
240
- /* resources.filestore.File file = 3; */
241
- if (message.file)
242
- File.internalBinaryWrite(message.file, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
222
+ internalBinaryWrite(message: UploadMeta, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
223
+ /* int64 parent_id = 1; */
224
+ if (message.parentId !== 0)
225
+ writer.tag(1, WireType.Varint).int64(message.parentId);
226
+ /* string namespace = 2; */
227
+ if (message.namespace !== "")
228
+ writer.tag(2, WireType.LengthDelimited).string(message.namespace);
229
+ /* string original_name = 3; */
230
+ if (message.originalName !== "")
231
+ writer.tag(3, WireType.LengthDelimited).string(message.originalName);
232
+ /* string content_type = 4; */
233
+ if (message.contentType !== "")
234
+ writer.tag(4, WireType.LengthDelimited).string(message.contentType);
235
+ /* int64 size = 5; */
236
+ if (message.size !== 0)
237
+ writer.tag(5, WireType.Varint).int64(message.size);
238
+ /* string reason = 6; */
239
+ if (message.reason !== "")
240
+ writer.tag(6, WireType.LengthDelimited).string(message.reason);
243
241
  let u = options.writeUnknownFields;
244
242
  if (u !== false)
245
243
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -247,18 +245,22 @@ class UploadFileRequest$Type extends MessageType<UploadFileRequest> {
247
245
  }
248
246
  }
249
247
  /**
250
- * @generated MessageType for protobuf message services.settings.UploadFileRequest
248
+ * @generated MessageType for protobuf message resources.file.UploadMeta
251
249
  */
252
- export const UploadFileRequest = new UploadFileRequest$Type();
250
+ export const UploadMeta = new UploadMeta$Type();
253
251
  // @generated message type with reflection information, may provide speed optimized methods
254
252
  class UploadFileResponse$Type extends MessageType<UploadFileResponse> {
255
253
  constructor() {
256
- super("services.settings.UploadFileResponse", [
257
- { no: 1, name: "file", kind: "message", T: () => FileInfo }
254
+ super("resources.file.UploadFileResponse", [
255
+ { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ },
256
+ { no: 2, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
257
+ { no: 3, name: "file", kind: "message", T: () => File }
258
258
  ]);
259
259
  }
260
260
  create(value?: PartialMessage<UploadFileResponse>): UploadFileResponse {
261
261
  const message = globalThis.Object.create((this.messagePrototype!));
262
+ message.id = 0;
263
+ message.url = "";
262
264
  if (value !== undefined)
263
265
  reflectionMergePartial<UploadFileResponse>(this, message, value);
264
266
  return message;
@@ -268,8 +270,14 @@ class UploadFileResponse$Type extends MessageType<UploadFileResponse> {
268
270
  while (reader.pos < end) {
269
271
  let [fieldNo, wireType] = reader.tag();
270
272
  switch (fieldNo) {
271
- case /* resources.filestore.FileInfo file */ 1:
272
- message.file = FileInfo.internalBinaryRead(reader, reader.uint32(), options, message.file);
273
+ case /* int64 id */ 1:
274
+ message.id = reader.int64().toNumber();
275
+ break;
276
+ case /* string url */ 2:
277
+ message.url = reader.string();
278
+ break;
279
+ case /* resources.file.File file */ 3:
280
+ message.file = File.internalBinaryRead(reader, reader.uint32(), options, message.file);
273
281
  break;
274
282
  default:
275
283
  let u = options.readUnknownField;
@@ -283,9 +291,15 @@ class UploadFileResponse$Type extends MessageType<UploadFileResponse> {
283
291
  return message;
284
292
  }
285
293
  internalBinaryWrite(message: UploadFileResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
286
- /* resources.filestore.FileInfo file = 1; */
294
+ /* int64 id = 1; */
295
+ if (message.id !== 0)
296
+ writer.tag(1, WireType.Varint).int64(message.id);
297
+ /* string url = 2; */
298
+ if (message.url !== "")
299
+ writer.tag(2, WireType.LengthDelimited).string(message.url);
300
+ /* resources.file.File file = 3; */
287
301
  if (message.file)
288
- FileInfo.internalBinaryWrite(message.file, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
302
+ File.internalBinaryWrite(message.file, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
289
303
  let u = options.writeUnknownFields;
290
304
  if (u !== false)
291
305
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -293,19 +307,21 @@ class UploadFileResponse$Type extends MessageType<UploadFileResponse> {
293
307
  }
294
308
  }
295
309
  /**
296
- * @generated MessageType for protobuf message services.settings.UploadFileResponse
310
+ * @generated MessageType for protobuf message resources.file.UploadFileResponse
297
311
  */
298
312
  export const UploadFileResponse = new UploadFileResponse$Type();
299
313
  // @generated message type with reflection information, may provide speed optimized methods
300
314
  class DeleteFileRequest$Type extends MessageType<DeleteFileRequest> {
301
315
  constructor() {
302
- super("services.settings.DeleteFileRequest", [
303
- { no: 1, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
316
+ super("resources.file.DeleteFileRequest", [
317
+ { no: 1, name: "parent_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } },
318
+ { no: 2, name: "file_id", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/, options: { "buf.validate.field": { int64: { gt: "0" } } } }
304
319
  ]);
305
320
  }
306
321
  create(value?: PartialMessage<DeleteFileRequest>): DeleteFileRequest {
307
322
  const message = globalThis.Object.create((this.messagePrototype!));
308
- message.path = "";
323
+ message.parentId = 0;
324
+ message.fileId = 0;
309
325
  if (value !== undefined)
310
326
  reflectionMergePartial<DeleteFileRequest>(this, message, value);
311
327
  return message;
@@ -315,8 +331,11 @@ class DeleteFileRequest$Type extends MessageType<DeleteFileRequest> {
315
331
  while (reader.pos < end) {
316
332
  let [fieldNo, wireType] = reader.tag();
317
333
  switch (fieldNo) {
318
- case /* string path */ 1:
319
- message.path = reader.string();
334
+ case /* int64 parent_id */ 1:
335
+ message.parentId = reader.int64().toNumber();
336
+ break;
337
+ case /* int64 file_id */ 2:
338
+ message.fileId = reader.int64().toNumber();
320
339
  break;
321
340
  default:
322
341
  let u = options.readUnknownField;
@@ -330,9 +349,12 @@ class DeleteFileRequest$Type extends MessageType<DeleteFileRequest> {
330
349
  return message;
331
350
  }
332
351
  internalBinaryWrite(message: DeleteFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
333
- /* string path = 1; */
334
- if (message.path !== "")
335
- writer.tag(1, WireType.LengthDelimited).string(message.path);
352
+ /* int64 parent_id = 1; */
353
+ if (message.parentId !== 0)
354
+ writer.tag(1, WireType.Varint).int64(message.parentId);
355
+ /* int64 file_id = 2; */
356
+ if (message.fileId !== 0)
357
+ writer.tag(2, WireType.Varint).int64(message.fileId);
336
358
  let u = options.writeUnknownFields;
337
359
  if (u !== false)
338
360
  (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -340,13 +362,13 @@ class DeleteFileRequest$Type extends MessageType<DeleteFileRequest> {
340
362
  }
341
363
  }
342
364
  /**
343
- * @generated MessageType for protobuf message services.settings.DeleteFileRequest
365
+ * @generated MessageType for protobuf message resources.file.DeleteFileRequest
344
366
  */
345
367
  export const DeleteFileRequest = new DeleteFileRequest$Type();
346
368
  // @generated message type with reflection information, may provide speed optimized methods
347
369
  class DeleteFileResponse$Type extends MessageType<DeleteFileResponse> {
348
370
  constructor() {
349
- super("services.settings.DeleteFileResponse", []);
371
+ super("resources.file.DeleteFileResponse", []);
350
372
  }
351
373
  create(value?: PartialMessage<DeleteFileResponse>): DeleteFileResponse {
352
374
  const message = globalThis.Object.create((this.messagePrototype!));
@@ -378,14 +400,6 @@ class DeleteFileResponse$Type extends MessageType<DeleteFileResponse> {
378
400
  }
379
401
  }
380
402
  /**
381
- * @generated MessageType for protobuf message services.settings.DeleteFileResponse
403
+ * @generated MessageType for protobuf message resources.file.DeleteFileResponse
382
404
  */
383
405
  export const DeleteFileResponse = new DeleteFileResponse$Type();
384
- /**
385
- * @generated ServiceType for protobuf service services.settings.FilestoreService
386
- */
387
- export const FilestoreService = new ServiceType("services.settings.FilestoreService", [
388
- { name: "ListFiles", options: {}, I: ListFilesRequest, O: ListFilesResponse },
389
- { name: "UploadFile", options: {}, I: UploadFileRequest, O: UploadFileResponse },
390
- { name: "DeleteFile", options: {}, I: DeleteFileRequest, O: DeleteFileResponse }
391
- ]);