alepha 0.11.4 → 0.11.6

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 (49) hide show
  1. package/api/files.d.ts +439 -1
  2. package/api/jobs.d.ts +290 -1
  3. package/api/notifications.d.ts +264 -1
  4. package/api/users.d.ts +924 -1
  5. package/batch.d.ts +154 -1
  6. package/bucket.d.ts +520 -1
  7. package/cache/redis.d.ts +40 -1
  8. package/cache.d.ts +288 -1
  9. package/command.d.ts +269 -1
  10. package/core.d.ts +1877 -1
  11. package/datetime.d.ts +1 -1
  12. package/devtools.d.ts +408 -1
  13. package/email.d.ts +187 -1
  14. package/fake.d.ts +73 -1
  15. package/file.d.ts +528 -1
  16. package/lock/redis.d.ts +24 -1
  17. package/lock.d.ts +552 -1
  18. package/logger.d.ts +288 -1
  19. package/package.json +51 -51
  20. package/postgres.d.ts +2146 -1
  21. package/queue/redis.d.ts +29 -1
  22. package/queue.d.ts +760 -1
  23. package/react/auth.d.ts +504 -1
  24. package/react/form.d.ts +208 -1
  25. package/react/head.d.ts +120 -1
  26. package/react/i18n.d.ts +168 -1
  27. package/react.d.ts +1261 -1
  28. package/redis.d.ts +82 -1
  29. package/retry.d.ts +84 -21
  30. package/scheduler.d.ts +145 -1
  31. package/security.d.ts +586 -1
  32. package/server/cache.d.ts +163 -1
  33. package/server/compress.d.ts +38 -1
  34. package/server/cookies.d.ts +144 -1
  35. package/server/cors.d.ts +45 -1
  36. package/server/health.d.ts +59 -1
  37. package/server/helmet.d.ts +98 -1
  38. package/server/links.d.ts +322 -1
  39. package/server/metrics.d.ts +35 -1
  40. package/server/multipart.d.ts +42 -1
  41. package/server/proxy.d.ts +234 -1
  42. package/server/security.d.ts +92 -1
  43. package/server/static.d.ts +119 -1
  44. package/server/swagger.d.ts +161 -1
  45. package/server.d.ts +849 -1
  46. package/topic/redis.d.ts +42 -1
  47. package/topic.d.ts +819 -1
  48. package/ui.d.ts +786 -1
  49. package/vite.d.ts +186 -1
package/api/files.d.ts CHANGED
@@ -1 +1,439 @@
1
- export * from '@alepha/api-files';
1
+ import { BucketDescriptor } from "alepha/bucket";
2
+ import * as _alepha_core1 from "alepha";
3
+ import { Alepha, FileLike, Static } from "alepha";
4
+ import "alepha/server/security";
5
+ import * as _alepha_postgres64 from "alepha/postgres";
6
+ import { Page } from "alepha/postgres";
7
+ import * as _alepha_server0 from "alepha/server";
8
+ import { Ok } from "alepha/server";
9
+ import { DateTime, DateTimeProvider, DurationLike } from "alepha/datetime";
10
+ import * as _alepha_logger0 from "alepha/logger";
11
+ import { UserAccountToken } from "alepha/security";
12
+ import * as typebox169 from "typebox";
13
+ import * as dayjs15 from "dayjs";
14
+
15
+ //#region src/entities/files.d.ts
16
+ declare const files: _alepha_postgres64.EntityDescriptor<typebox169.TObject<{
17
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
18
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
19
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
20
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
21
+ blobId: typebox169.TString;
22
+ creator: typebox169.TOptional<typebox169.TString>;
23
+ creatorRealm: typebox169.TOptional<typebox169.TString>;
24
+ creatorName: typebox169.TOptional<typebox169.TString>;
25
+ bucket: typebox169.TString;
26
+ expirationDate: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
27
+ name: typebox169.TString;
28
+ size: typebox169.TNumber;
29
+ mimeType: typebox169.TString;
30
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
31
+ checksum: typebox169.TOptional<typebox169.TString>;
32
+ }>>;
33
+ type FileEntity = Static<typeof files.schema>;
34
+ //#endregion
35
+ //#region src/schemas/fileQuerySchema.d.ts
36
+ declare const fileQuerySchema: typebox169.TObject<{
37
+ page: typebox169.TOptional<typebox169.TInteger>;
38
+ size: typebox169.TOptional<typebox169.TInteger>;
39
+ sort: typebox169.TOptional<typebox169.TString>;
40
+ bucket: typebox169.TOptional<typebox169.TString>;
41
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
42
+ name: typebox169.TOptional<typebox169.TString>;
43
+ mimeType: typebox169.TOptional<typebox169.TString>;
44
+ creator: typebox169.TOptional<typebox169.TString>;
45
+ createdAfter: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
46
+ createdBefore: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
47
+ }>;
48
+ type FileQuery = Static<typeof fileQuerySchema>;
49
+ //#endregion
50
+ //#region src/schemas/fileResourceSchema.d.ts
51
+ declare const fileResourceSchema: typebox169.TObject<{
52
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
53
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
54
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
55
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
56
+ blobId: typebox169.TString;
57
+ creator: typebox169.TOptional<typebox169.TString>;
58
+ creatorRealm: typebox169.TOptional<typebox169.TString>;
59
+ creatorName: typebox169.TOptional<typebox169.TString>;
60
+ bucket: typebox169.TString;
61
+ expirationDate: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
62
+ name: typebox169.TString;
63
+ size: typebox169.TNumber;
64
+ mimeType: typebox169.TString;
65
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
66
+ checksum: typebox169.TOptional<typebox169.TString>;
67
+ }>;
68
+ type FileResource = Static<typeof fileResourceSchema>;
69
+ //#endregion
70
+ //#region src/schemas/storageStatsSchema.d.ts
71
+ declare const bucketStatsSchema: typebox169.TObject<{
72
+ bucket: typebox169.TString;
73
+ totalSize: typebox169.TNumber;
74
+ fileCount: typebox169.TNumber;
75
+ }>;
76
+ declare const mimeTypeStatsSchema: typebox169.TObject<{
77
+ mimeType: typebox169.TString;
78
+ fileCount: typebox169.TNumber;
79
+ }>;
80
+ declare const storageStatsSchema: typebox169.TObject<{
81
+ totalSize: typebox169.TNumber;
82
+ totalFiles: typebox169.TNumber;
83
+ byBucket: typebox169.TArray<typebox169.TObject<{
84
+ bucket: typebox169.TString;
85
+ totalSize: typebox169.TNumber;
86
+ fileCount: typebox169.TNumber;
87
+ }>>;
88
+ byMimeType: typebox169.TArray<typebox169.TObject<{
89
+ mimeType: typebox169.TString;
90
+ fileCount: typebox169.TNumber;
91
+ }>>;
92
+ }>;
93
+ type BucketStats = Static<typeof bucketStatsSchema>;
94
+ type MimeTypeStats = Static<typeof mimeTypeStatsSchema>;
95
+ type StorageStats = Static<typeof storageStatsSchema>;
96
+ //#endregion
97
+ //#region src/services/FileService.d.ts
98
+ declare class FileService {
99
+ protected readonly alepha: Alepha;
100
+ protected readonly log: _alepha_logger0.Logger;
101
+ protected readonly fileRepository: _alepha_postgres64.Repository<typebox169.TObject<{
102
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
103
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
104
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
105
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
106
+ blobId: typebox169.TString;
107
+ creator: typebox169.TOptional<typebox169.TString>;
108
+ creatorRealm: typebox169.TOptional<typebox169.TString>;
109
+ creatorName: typebox169.TOptional<typebox169.TString>;
110
+ bucket: typebox169.TString;
111
+ expirationDate: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
112
+ name: typebox169.TString;
113
+ size: typebox169.TNumber;
114
+ mimeType: typebox169.TString;
115
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
116
+ checksum: typebox169.TOptional<typebox169.TString>;
117
+ }>>;
118
+ protected readonly dateTimeProvider: DateTimeProvider;
119
+ protected readonly defaultBucket: BucketDescriptor;
120
+ protected onUploadFile: _alepha_core1.HookDescriptor<"bucket:file:uploaded">;
121
+ protected onDeleteBucketFile: _alepha_core1.HookDescriptor<"bucket:file:deleted">;
122
+ /**
123
+ * Calculates SHA-256 checksum of a file.
124
+ *
125
+ * @param file - The file to calculate checksum for
126
+ * @returns Hexadecimal string representation of the SHA-256 hash
127
+ * @protected
128
+ */
129
+ protected calculateChecksum(file: FileLike): Promise<string>;
130
+ /**
131
+ * Gets a bucket descriptor by name.
132
+ *
133
+ * @param bucketName - The name of the bucket to retrieve (defaults to "default")
134
+ * @returns The bucket descriptor
135
+ * @throws {NotFoundError} If the bucket is not found
136
+ */
137
+ bucket(bucketName?: string): BucketDescriptor;
138
+ /**
139
+ * Finds files matching the given query criteria with pagination support.
140
+ * Supports filtering by bucket, tags, name, mimeType, creator, and date range.
141
+ *
142
+ * @param q - Query parameters including bucket, tags, name, mimeType, creator, date range, pagination, and sorting
143
+ * @returns Paginated list of file entities
144
+ */
145
+ findFiles(q?: FileQuery): Promise<Page<FileEntity>>;
146
+ /**
147
+ * Finds files that have expired based on their expiration date.
148
+ * Limited to 1000 files per call to prevent memory issues.
149
+ *
150
+ * @returns Array of expired file entities
151
+ */
152
+ findExpiredFiles(): Promise<FileEntity[]>;
153
+ /**
154
+ * Calculates an expiration date based on a TTL (time to live) duration.
155
+ *
156
+ * @param ttl - Duration like "1 day", "2 hours", etc.
157
+ * @returns DateTime representation of the expiration date, or undefined if no TTL provided
158
+ * @protected
159
+ */
160
+ protected getExpirationDate(ttl?: DurationLike): DateTime | undefined;
161
+ /**
162
+ * Uploads a file to a bucket and creates a database record with metadata.
163
+ * Automatically calculates and stores the file checksum (SHA-256).
164
+ *
165
+ * @param file - The file to upload
166
+ * @param options - Upload options including bucket, expiration, user, and tags
167
+ * @param options.bucket - Target bucket name (defaults to "default")
168
+ * @param options.expirationDate - When the file should expire
169
+ * @param options.user - User performing the upload (for audit trail)
170
+ * @param options.tags - Tags to associate with the file
171
+ * @returns The created file entity with all metadata
172
+ * @throws {NotFoundError} If the specified bucket doesn't exist
173
+ */
174
+ uploadFile(file: FileLike, options?: {
175
+ expirationDate?: string | DateTime;
176
+ bucket?: string;
177
+ user?: UserAccountToken;
178
+ tags?: string[];
179
+ }): Promise<FileEntity>;
180
+ /**
181
+ * Streams a file from storage by its database ID.
182
+ *
183
+ * @param id - The database ID (UUID) of the file to stream
184
+ * @returns The file object ready for streaming/downloading
185
+ * @throws {NotFoundError} If the file doesn't exist in the database
186
+ * @throws {FileNotFoundError} If the file exists in database but not in storage
187
+ */
188
+ streamFile(id: string): Promise<FileLike>;
189
+ /**
190
+ * Updates file metadata (name, tags, expiration date).
191
+ * Does not modify the actual file content in storage.
192
+ *
193
+ * @param id - The database ID (UUID) of the file to update
194
+ * @param data - Partial file data to update
195
+ * @param data.name - New file name
196
+ * @param data.tags - New tags array
197
+ * @param data.expirationDate - New expiration date
198
+ * @returns The updated file entity
199
+ * @throws {NotFoundError} If the file doesn't exist in the database
200
+ */
201
+ updateFile(id: string, data: {
202
+ name?: string;
203
+ tags?: string[];
204
+ expirationDate?: DateTime;
205
+ }): Promise<FileEntity>;
206
+ /**
207
+ * Deletes a file from both storage and database.
208
+ * Handles cases where file is already deleted from storage gracefully.
209
+ * Always ensures database record is removed even if storage deletion fails.
210
+ *
211
+ * @param id - The database ID (UUID) of the file to delete
212
+ * @returns Success response with the deleted file ID
213
+ * @throws {NotFoundError} If the file doesn't exist in the database
214
+ */
215
+ deleteFile(id: string): Promise<Ok>;
216
+ /**
217
+ * Retrieves a file entity by its ID.
218
+ * If already an entity object, returns it as-is (convenience method).
219
+ *
220
+ * @param id - Either a UUID string or an existing FileEntity object
221
+ * @returns The file entity
222
+ * @throws {NotFoundError} If the file doesn't exist in the database
223
+ */
224
+ getFileById(id: string | FileEntity): Promise<FileEntity>;
225
+ /**
226
+ * Gets storage statistics including total size, file count, and breakdowns by bucket and MIME type.
227
+ *
228
+ * @returns Storage statistics with aggregated data
229
+ */
230
+ getStorageStats(): Promise<StorageStats>;
231
+ /**
232
+ * Converts a file entity to a file resource (API response format).
233
+ * Currently a pass-through, but allows for future transformation logic.
234
+ *
235
+ * @param entity - The file entity to convert
236
+ * @returns The file resource for API responses
237
+ */
238
+ entityToResource(entity: FileEntity): FileResource;
239
+ }
240
+ //#endregion
241
+ //#region src/controllers/FileController.d.ts
242
+ /**
243
+ * REST API controller for file management operations.
244
+ * Provides endpoints for uploading, downloading, listing, and deleting files.
245
+ */
246
+ declare class FileController {
247
+ protected readonly url = "/files";
248
+ protected readonly group = "files";
249
+ protected readonly fileService: FileService;
250
+ /**
251
+ * GET /files - Lists files with optional filtering and pagination.
252
+ * Supports filtering by bucket and tags.
253
+ */
254
+ readonly findFiles: _alepha_server0.ActionDescriptorFn<{
255
+ query: typebox169.TObject<{
256
+ page: typebox169.TOptional<typebox169.TInteger>;
257
+ size: typebox169.TOptional<typebox169.TInteger>;
258
+ sort: typebox169.TOptional<typebox169.TString>;
259
+ bucket: typebox169.TOptional<typebox169.TString>;
260
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
261
+ name: typebox169.TOptional<typebox169.TString>;
262
+ mimeType: typebox169.TOptional<typebox169.TString>;
263
+ creator: typebox169.TOptional<typebox169.TString>;
264
+ createdAfter: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
265
+ createdBefore: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
266
+ }>;
267
+ response: _alepha_core1.TPage<typebox169.TObject<{
268
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
269
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
270
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
271
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
272
+ blobId: typebox169.TString;
273
+ creator: typebox169.TOptional<typebox169.TString>;
274
+ creatorRealm: typebox169.TOptional<typebox169.TString>;
275
+ creatorName: typebox169.TOptional<typebox169.TString>;
276
+ bucket: typebox169.TString;
277
+ expirationDate: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
278
+ name: typebox169.TString;
279
+ size: typebox169.TNumber;
280
+ mimeType: typebox169.TString;
281
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
282
+ checksum: typebox169.TOptional<typebox169.TString>;
283
+ }>>;
284
+ }>;
285
+ /**
286
+ * DELETE /files/:id - Deletes a file from both storage and database.
287
+ * Removes the file from the bucket and cleans up the database record.
288
+ */
289
+ readonly deleteFile: _alepha_server0.ActionDescriptorFn<{
290
+ params: typebox169.TObject<{
291
+ id: typebox169.TString;
292
+ }>;
293
+ response: typebox169.TObject<{
294
+ ok: typebox169.TBoolean;
295
+ id: typebox169.TOptional<typebox169.TUnion<[typebox169.TString, typebox169.TInteger]>>;
296
+ count: typebox169.TOptional<typebox169.TNumber>;
297
+ }>;
298
+ }>;
299
+ /**
300
+ * POST /files - Uploads a new file to storage.
301
+ * Creates a database record with metadata and calculates checksum.
302
+ * Optionally specify bucket and expiration date.
303
+ */
304
+ readonly uploadFile: _alepha_server0.ActionDescriptorFn<{
305
+ body: typebox169.TObject<{
306
+ file: _alepha_core1.TFile;
307
+ }>;
308
+ query: typebox169.TObject<{
309
+ expirationDate: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
310
+ bucket: typebox169.TOptional<typebox169.TString>;
311
+ }>;
312
+ response: typebox169.TObject<{
313
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
314
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
315
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
316
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
317
+ blobId: typebox169.TString;
318
+ creator: typebox169.TOptional<typebox169.TString>;
319
+ creatorRealm: typebox169.TOptional<typebox169.TString>;
320
+ creatorName: typebox169.TOptional<typebox169.TString>;
321
+ bucket: typebox169.TString;
322
+ expirationDate: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
323
+ name: typebox169.TString;
324
+ size: typebox169.TNumber;
325
+ mimeType: typebox169.TString;
326
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
327
+ checksum: typebox169.TOptional<typebox169.TString>;
328
+ }>;
329
+ }>;
330
+ /**
331
+ * PATCH /files/:id - Updates file metadata.
332
+ * Allows updating name, tags, and expiration date without modifying file content.
333
+ */
334
+ readonly updateFile: _alepha_server0.ActionDescriptorFn<{
335
+ params: typebox169.TObject<{
336
+ id: typebox169.TString;
337
+ }>;
338
+ body: typebox169.TObject<{
339
+ name: typebox169.TOptional<typebox169.TString>;
340
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
341
+ expirationDate: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
342
+ }>;
343
+ response: typebox169.TObject<{
344
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
345
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
346
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
347
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
348
+ blobId: typebox169.TString;
349
+ creator: typebox169.TOptional<typebox169.TString>;
350
+ creatorRealm: typebox169.TOptional<typebox169.TString>;
351
+ creatorName: typebox169.TOptional<typebox169.TString>;
352
+ bucket: typebox169.TString;
353
+ expirationDate: typebox169.TOptional<typebox169.TCodec<typebox169.TString, dayjs15.Dayjs>>;
354
+ name: typebox169.TString;
355
+ size: typebox169.TNumber;
356
+ mimeType: typebox169.TString;
357
+ tags: typebox169.TOptional<typebox169.TArray<typebox169.TString>>;
358
+ checksum: typebox169.TOptional<typebox169.TString>;
359
+ }>;
360
+ }>;
361
+ /**
362
+ * GET /files/:id - Streams/downloads a file by its ID.
363
+ * Returns the file content with appropriate Content-Type header.
364
+ * Cached with ETag support for 1 year (immutable).
365
+ */
366
+ readonly streamFile: _alepha_server0.ActionDescriptorFn<{
367
+ params: typebox169.TObject<{
368
+ id: typebox169.TString;
369
+ }>;
370
+ response: _alepha_core1.TFile;
371
+ }>;
372
+ }
373
+ //#endregion
374
+ //#region src/controllers/StorageStatsController.d.ts
375
+ /**
376
+ * REST API controller for storage analytics and statistics.
377
+ * Provides endpoints for viewing storage usage metrics.
378
+ */
379
+ declare class StorageStatsController {
380
+ protected readonly url = "/files/stats";
381
+ protected readonly group = "files";
382
+ protected readonly fileService: FileService;
383
+ /**
384
+ * GET /files/stats - Gets storage statistics.
385
+ * Returns aggregated data including total size, file count,
386
+ * and breakdowns by bucket and MIME type.
387
+ */
388
+ readonly getStats: _alepha_server0.ActionDescriptorFn<{
389
+ response: typebox169.TObject<{
390
+ totalSize: typebox169.TNumber;
391
+ totalFiles: typebox169.TNumber;
392
+ byBucket: typebox169.TArray<typebox169.TObject<{
393
+ bucket: typebox169.TString;
394
+ totalSize: typebox169.TNumber;
395
+ fileCount: typebox169.TNumber;
396
+ }>>;
397
+ byMimeType: typebox169.TArray<typebox169.TObject<{
398
+ mimeType: typebox169.TString;
399
+ fileCount: typebox169.TNumber;
400
+ }>>;
401
+ }>;
402
+ }>;
403
+ }
404
+ //#endregion
405
+ //#region src/index.d.ts
406
+ declare module "alepha/bucket" {
407
+ interface BucketFileOptions {
408
+ /**
409
+ * Time to live for the files in the bucket.
410
+ */
411
+ ttl?: DurationLike;
412
+ /**
413
+ * Tags for the bucket.
414
+ */
415
+ tags?: string[];
416
+ /**
417
+ * User performing the operation.
418
+ */
419
+ user?: UserAccountToken;
420
+ /**
421
+ * Whether to persist the file metadata in the database.
422
+ *
423
+ * @default true
424
+ */
425
+ persist?: boolean;
426
+ }
427
+ }
428
+ /**
429
+ * Provides file management API endpoints for Alepha applications.
430
+ *
431
+ * This module includes file upload, download, storage management,
432
+ * and file metadata operations.
433
+ *
434
+ * @module alepha.api.files
435
+ */
436
+ declare const AlephaApiFiles: _alepha_core1.Service<_alepha_core1.Module>;
437
+ //#endregion
438
+ export { AlephaApiFiles, BucketStats, FileController, FileEntity, FileService, MimeTypeStats, StorageStats, StorageStatsController, bucketStatsSchema, files, mimeTypeStatsSchema, storageStatsSchema };
439
+ //# sourceMappingURL=index.d.ts.map