alepha 0.11.5 → 0.11.7

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 (51) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +15 -100
  3. package/api/files.d.ts +168 -169
  4. package/api/jobs.d.ts +263 -154
  5. package/api/notifications.d.ts +28 -29
  6. package/api/users.d.ts +476 -477
  7. package/batch.d.ts +59 -493
  8. package/bucket.d.ts +20 -11
  9. package/cache/redis.d.ts +1 -1
  10. package/cache.d.ts +1 -1
  11. package/command.d.ts +24 -7
  12. package/core.d.ts +299 -222
  13. package/datetime.d.ts +4 -29
  14. package/devtools.d.ts +166 -284
  15. package/email.d.ts +45 -2
  16. package/fake.d.ts +1 -1
  17. package/file.d.ts +1 -1
  18. package/lock/redis.d.ts +1 -1
  19. package/lock.d.ts +1 -1
  20. package/logger.d.ts +11 -9
  21. package/package.json +51 -51
  22. package/postgres.d.ts +480 -198
  23. package/queue/redis.d.ts +1 -1
  24. package/queue.d.ts +1 -1
  25. package/react/auth.d.ts +7 -2
  26. package/react/form.d.ts +39 -16
  27. package/react/head.d.ts +1 -1
  28. package/react/i18n.d.ts +2 -2
  29. package/react.d.ts +66 -41
  30. package/redis.d.ts +1 -1
  31. package/retry.d.ts +84 -21
  32. package/scheduler.d.ts +1 -1
  33. package/security.d.ts +29 -29
  34. package/server/cache.d.ts +1 -1
  35. package/server/compress.d.ts +9 -3
  36. package/server/cookies.d.ts +1 -1
  37. package/server/cors.d.ts +28 -10
  38. package/server/health.d.ts +18 -19
  39. package/server/helmet.d.ts +44 -15
  40. package/server/links.d.ts +37 -31
  41. package/server/metrics.d.ts +1 -1
  42. package/server/multipart.d.ts +1 -1
  43. package/server/proxy.d.ts +1 -1
  44. package/server/security.d.ts +8 -3
  45. package/server/static.d.ts +1 -1
  46. package/server/swagger.d.ts +19 -6
  47. package/server.d.ts +1 -1
  48. package/topic/redis.d.ts +1 -1
  49. package/topic.d.ts +1 -1
  50. package/ui.d.ts +142 -12
  51. package/vite.d.ts +2 -2
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Feunard
3
+ Copyright (c) 2025 Nicolas Foures
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -22,14 +22,9 @@ A convention-driven TypeScript framework for building type-safe full-stack appli
22
22
 
23
23
  ## Quick Start
24
24
 
25
- ```bash
26
- npx @alepha/cli create my-app
27
- ```
28
-
29
- Or manually:
30
-
31
25
  ```bash
32
26
  npm install alepha
27
+ npm install -D @alepha/cli
33
28
  ```
34
29
 
35
30
  ## What is this?
@@ -42,24 +37,18 @@ For more information, please visit the [documentation](https://feunard.github.io
42
37
 
43
38
  ## Examples
44
39
 
45
- ### Type-safe API endpoint
46
-
47
- Write type-safe API endpoints with automatic OpenAPI documentation and more.
40
+ ### API endpoint
48
41
 
42
+ Write API endpoints with automatic OpenAPI documentation.
49
43
 
50
44
  ```ts
51
- // app.ts
52
- import { run, t } from "alepha";
45
+ // hello.ts
46
+ import { run, t, Alepha } from "alepha";
53
47
  import { $action } from "alepha/server";
54
48
  import { $swagger } from "alepha/server/swagger";
55
49
 
56
50
  class Api {
57
- docs = $swagger({
58
- info: {
59
- title: "My API",
60
- version: "1.0.0",
61
- }
62
- })
51
+ docs = $swagger();
63
52
 
64
53
  sayHello = $action({
65
54
  path: "/hello/:name",
@@ -77,71 +66,21 @@ class Api {
77
66
  });
78
67
  }
79
68
 
80
- run(Api);
81
- ```
82
-
83
- ```bash
84
- node app.ts
85
- ```
86
-
87
- ### Database with Drizzle ORM
88
-
89
- [Drizzle ORM](https://orm.drizzle.team/) is a type-safe ORM for TypeScript, bundled inside Alepha.
90
-
91
- You need `drizzle-kit` CLI as dev dependencies:
92
-
93
- ```bash
94
- npm install -D drizzle-kit
95
- ```
69
+ const alepha = Alepha.create();
96
70
 
97
- ```ts
98
- // app.ts
99
- import { $hook, run, t } from "alepha";
100
- import { $entity, $repository, pg } from "alepha/postgres";
101
- import { $logger } from "alepha/logger";
102
-
103
- export const users = $entity({
104
- name: "users",
105
- schema: t.object({
106
- id: pg.primaryKey(),
107
- name: t.text(),
108
- }),
109
- });
110
-
111
-
112
- class Db {
113
- log = $logger();
114
- users = $repository(users);
115
-
116
- ready = $hook({
117
- on: "ready",
118
- handler: async () => {
119
- await this.users.create({
120
- name: "John Doe",
121
- });
122
- this.log.info("Users:", await this.users.find());
123
- }
124
- })
125
- }
71
+ alepha.with(Api);
126
72
 
127
- run(Db)
73
+ run(alepha);
128
74
  ```
129
75
 
130
76
  ```bash
131
- node app.ts
77
+ npx alepha dev hello.ts
132
78
  ```
133
79
 
134
80
  ### React Application
135
81
 
136
82
  Build full-stack React applications, with server-side rendering (SSR) and client-side rendering (CSR).
137
83
 
138
- [React](https://react.dev) is required as a `dependency`:
139
-
140
- ```bash
141
- npm install react react-dom
142
- npm install -D @types/react
143
- ```
144
-
145
84
  ```tsx
146
85
  // app.tsx
147
86
  import { run, t } from "alepha";
@@ -153,7 +92,7 @@ const Hello = (props: { count: number }) => {
153
92
  return <button onClick={() => setCount(count + 1)}>Clicked: {count}</button>
154
93
  }
155
94
 
156
- class HomePage {
95
+ class AppRouter {
157
96
  index = $page({
158
97
  schema: {
159
98
  query: t.object({
@@ -167,33 +106,15 @@ class HomePage {
167
106
  });
168
107
  }
169
108
 
170
- run(HomePage);
171
- ```
109
+ const alepha = Alepha.create();
172
110
 
173
- [Vite](https://vite.dev) is required as a `devDependencies`:
111
+ alepha.with(AppRouter);
174
112
 
175
- ```bash
176
- npm install -D vite
113
+ run(alepha);
177
114
  ```
178
-
179
- Add the Alepha Vite plugin to your Vite config:
180
-
181
- ```ts
182
- // vite.config.ts
183
- import { viteAlepha } from "alepha/vite";
184
- import { defineConfig } from "vite";
185
-
186
- export default defineConfig({
187
- plugins: [
188
- viteAlepha()
189
- ]
190
- });
191
- ```
192
-
193
115
  Create an `index.html` file:
194
116
 
195
117
  ```html
196
- <!-- index.html -->
197
118
  <!DOCTYPE html>
198
119
  <html lang="en">
199
120
  <head>
@@ -206,12 +127,6 @@ Create an `index.html` file:
206
127
  </html>
207
128
  ```
208
129
 
209
- Then run Vite:
210
-
211
130
  ```bash
212
- npx vite
131
+ npx alepha dev
213
132
  ```
214
-
215
- ## License
216
-
217
- MIT
package/api/files.d.ts CHANGED
@@ -2,92 +2,91 @@ import { BucketDescriptor } from "alepha/bucket";
2
2
  import * as _alepha_core1 from "alepha";
3
3
  import { Alepha, FileLike, Static } from "alepha";
4
4
  import "alepha/server/security";
5
- import * as _alepha_postgres16 from "alepha/postgres";
5
+ import * as _alepha_postgres64 from "alepha/postgres";
6
6
  import { Page } from "alepha/postgres";
7
7
  import * as _alepha_server0 from "alepha/server";
8
8
  import { Ok } from "alepha/server";
9
9
  import { DateTime, DateTimeProvider, DurationLike } from "alepha/datetime";
10
10
  import * as _alepha_logger0 from "alepha/logger";
11
11
  import { UserAccountToken } from "alepha/security";
12
- import * as typebox25 from "typebox";
13
- import * as dayjs2 from "dayjs";
12
+ import * as typebox172 from "typebox";
14
13
 
15
14
  //#region src/entities/files.d.ts
16
- declare const files: _alepha_postgres16.EntityDescriptor<typebox25.TObject<{
17
- id: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TString, typeof _alepha_postgres16.PG_PRIMARY_KEY>, typeof _alepha_postgres16.PG_DEFAULT>;
18
- version: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TInteger, typeof _alepha_postgres16.PG_VERSION>, typeof _alepha_postgres16.PG_DEFAULT>;
19
- createdAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_CREATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
20
- updatedAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_UPDATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
21
- blobId: typebox25.TString;
22
- creator: typebox25.TOptional<typebox25.TString>;
23
- creatorRealm: typebox25.TOptional<typebox25.TString>;
24
- creatorName: typebox25.TOptional<typebox25.TString>;
25
- bucket: typebox25.TString;
26
- expirationDate: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
27
- name: typebox25.TString;
28
- size: typebox25.TNumber;
29
- mimeType: typebox25.TString;
30
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
31
- checksum: typebox25.TOptional<typebox25.TString>;
15
+ declare const files: _alepha_postgres64.EntityDescriptor<typebox172.TObject<{
16
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
17
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
18
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
19
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
20
+ blobId: typebox172.TString;
21
+ creator: typebox172.TOptional<typebox172.TString>;
22
+ creatorRealm: typebox172.TOptional<typebox172.TString>;
23
+ creatorName: typebox172.TOptional<typebox172.TString>;
24
+ bucket: typebox172.TString;
25
+ expirationDate: typebox172.TOptional<typebox172.TString>;
26
+ name: typebox172.TString;
27
+ size: typebox172.TNumber;
28
+ mimeType: typebox172.TString;
29
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
30
+ checksum: typebox172.TOptional<typebox172.TString>;
32
31
  }>>;
33
32
  type FileEntity = Static<typeof files.schema>;
34
33
  //#endregion
35
34
  //#region src/schemas/fileQuerySchema.d.ts
36
- declare const fileQuerySchema: typebox25.TObject<{
37
- page: typebox25.TOptional<typebox25.TInteger>;
38
- size: typebox25.TOptional<typebox25.TInteger>;
39
- sort: typebox25.TOptional<typebox25.TString>;
40
- bucket: typebox25.TOptional<typebox25.TString>;
41
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
42
- name: typebox25.TOptional<typebox25.TString>;
43
- mimeType: typebox25.TOptional<typebox25.TString>;
44
- creator: typebox25.TOptional<typebox25.TString>;
45
- createdAfter: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
46
- createdBefore: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
35
+ declare const fileQuerySchema: typebox172.TObject<{
36
+ page: typebox172.TOptional<typebox172.TInteger>;
37
+ size: typebox172.TOptional<typebox172.TInteger>;
38
+ sort: typebox172.TOptional<typebox172.TString>;
39
+ bucket: typebox172.TOptional<typebox172.TString>;
40
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
41
+ name: typebox172.TOptional<typebox172.TString>;
42
+ mimeType: typebox172.TOptional<typebox172.TString>;
43
+ creator: typebox172.TOptional<typebox172.TString>;
44
+ createdAfter: typebox172.TOptional<typebox172.TString>;
45
+ createdBefore: typebox172.TOptional<typebox172.TString>;
47
46
  }>;
48
47
  type FileQuery = Static<typeof fileQuerySchema>;
49
48
  //#endregion
50
49
  //#region src/schemas/fileResourceSchema.d.ts
51
- declare const fileResourceSchema: typebox25.TObject<{
52
- id: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TString, typeof _alepha_postgres16.PG_PRIMARY_KEY>, typeof _alepha_postgres16.PG_DEFAULT>;
53
- version: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TInteger, typeof _alepha_postgres16.PG_VERSION>, typeof _alepha_postgres16.PG_DEFAULT>;
54
- createdAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_CREATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
55
- updatedAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_UPDATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
56
- blobId: typebox25.TString;
57
- creator: typebox25.TOptional<typebox25.TString>;
58
- creatorRealm: typebox25.TOptional<typebox25.TString>;
59
- creatorName: typebox25.TOptional<typebox25.TString>;
60
- bucket: typebox25.TString;
61
- expirationDate: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
62
- name: typebox25.TString;
63
- size: typebox25.TNumber;
64
- mimeType: typebox25.TString;
65
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
66
- checksum: typebox25.TOptional<typebox25.TString>;
50
+ declare const fileResourceSchema: typebox172.TObject<{
51
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
52
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
53
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
54
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
55
+ blobId: typebox172.TString;
56
+ creator: typebox172.TOptional<typebox172.TString>;
57
+ creatorRealm: typebox172.TOptional<typebox172.TString>;
58
+ creatorName: typebox172.TOptional<typebox172.TString>;
59
+ bucket: typebox172.TString;
60
+ expirationDate: typebox172.TOptional<typebox172.TString>;
61
+ name: typebox172.TString;
62
+ size: typebox172.TNumber;
63
+ mimeType: typebox172.TString;
64
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
65
+ checksum: typebox172.TOptional<typebox172.TString>;
67
66
  }>;
68
67
  type FileResource = Static<typeof fileResourceSchema>;
69
68
  //#endregion
70
69
  //#region src/schemas/storageStatsSchema.d.ts
71
- declare const bucketStatsSchema: typebox25.TObject<{
72
- bucket: typebox25.TString;
73
- totalSize: typebox25.TNumber;
74
- fileCount: typebox25.TNumber;
70
+ declare const bucketStatsSchema: typebox172.TObject<{
71
+ bucket: typebox172.TString;
72
+ totalSize: typebox172.TNumber;
73
+ fileCount: typebox172.TNumber;
75
74
  }>;
76
- declare const mimeTypeStatsSchema: typebox25.TObject<{
77
- mimeType: typebox25.TString;
78
- fileCount: typebox25.TNumber;
75
+ declare const mimeTypeStatsSchema: typebox172.TObject<{
76
+ mimeType: typebox172.TString;
77
+ fileCount: typebox172.TNumber;
79
78
  }>;
80
- declare const storageStatsSchema: typebox25.TObject<{
81
- totalSize: typebox25.TNumber;
82
- totalFiles: typebox25.TNumber;
83
- byBucket: typebox25.TArray<typebox25.TObject<{
84
- bucket: typebox25.TString;
85
- totalSize: typebox25.TNumber;
86
- fileCount: typebox25.TNumber;
79
+ declare const storageStatsSchema: typebox172.TObject<{
80
+ totalSize: typebox172.TNumber;
81
+ totalFiles: typebox172.TNumber;
82
+ byBucket: typebox172.TArray<typebox172.TObject<{
83
+ bucket: typebox172.TString;
84
+ totalSize: typebox172.TNumber;
85
+ fileCount: typebox172.TNumber;
87
86
  }>>;
88
- byMimeType: typebox25.TArray<typebox25.TObject<{
89
- mimeType: typebox25.TString;
90
- fileCount: typebox25.TNumber;
87
+ byMimeType: typebox172.TArray<typebox172.TObject<{
88
+ mimeType: typebox172.TString;
89
+ fileCount: typebox172.TNumber;
91
90
  }>>;
92
91
  }>;
93
92
  type BucketStats = Static<typeof bucketStatsSchema>;
@@ -98,22 +97,22 @@ type StorageStats = Static<typeof storageStatsSchema>;
98
97
  declare class FileService {
99
98
  protected readonly alepha: Alepha;
100
99
  protected readonly log: _alepha_logger0.Logger;
101
- protected readonly fileRepository: _alepha_postgres16.RepositoryDescriptor<typebox25.TObject<{
102
- id: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TString, typeof _alepha_postgres16.PG_PRIMARY_KEY>, typeof _alepha_postgres16.PG_DEFAULT>;
103
- version: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TInteger, typeof _alepha_postgres16.PG_VERSION>, typeof _alepha_postgres16.PG_DEFAULT>;
104
- createdAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_CREATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
105
- updatedAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_UPDATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
106
- blobId: typebox25.TString;
107
- creator: typebox25.TOptional<typebox25.TString>;
108
- creatorRealm: typebox25.TOptional<typebox25.TString>;
109
- creatorName: typebox25.TOptional<typebox25.TString>;
110
- bucket: typebox25.TString;
111
- expirationDate: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
112
- name: typebox25.TString;
113
- size: typebox25.TNumber;
114
- mimeType: typebox25.TString;
115
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
116
- checksum: typebox25.TOptional<typebox25.TString>;
100
+ protected readonly fileRepository: _alepha_postgres64.Repository<typebox172.TObject<{
101
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
102
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
103
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
104
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
105
+ blobId: typebox172.TString;
106
+ creator: typebox172.TOptional<typebox172.TString>;
107
+ creatorRealm: typebox172.TOptional<typebox172.TString>;
108
+ creatorName: typebox172.TOptional<typebox172.TString>;
109
+ bucket: typebox172.TString;
110
+ expirationDate: typebox172.TOptional<typebox172.TString>;
111
+ name: typebox172.TString;
112
+ size: typebox172.TNumber;
113
+ mimeType: typebox172.TString;
114
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
115
+ checksum: typebox172.TOptional<typebox172.TString>;
117
116
  }>>;
118
117
  protected readonly dateTimeProvider: DateTimeProvider;
119
118
  protected readonly defaultBucket: BucketDescriptor;
@@ -157,7 +156,7 @@ declare class FileService {
157
156
  * @returns DateTime representation of the expiration date, or undefined if no TTL provided
158
157
  * @protected
159
158
  */
160
- protected getExpirationDate(ttl?: DurationLike): DateTime | undefined;
159
+ protected getExpirationDate(ttl?: DurationLike): string | undefined;
161
160
  /**
162
161
  * Uploads a file to a bucket and creates a database record with metadata.
163
162
  * Automatically calculates and stores the file checksum (SHA-256).
@@ -201,7 +200,7 @@ declare class FileService {
201
200
  updateFile(id: string, data: {
202
201
  name?: string;
203
202
  tags?: string[];
204
- expirationDate?: DateTime;
203
+ expirationDate?: DateTime | string;
205
204
  }): Promise<FileEntity>;
206
205
  /**
207
206
  * Deletes a file from both storage and database.
@@ -252,34 +251,34 @@ declare class FileController {
252
251
  * Supports filtering by bucket and tags.
253
252
  */
254
253
  readonly findFiles: _alepha_server0.ActionDescriptorFn<{
255
- query: typebox25.TObject<{
256
- page: typebox25.TOptional<typebox25.TInteger>;
257
- size: typebox25.TOptional<typebox25.TInteger>;
258
- sort: typebox25.TOptional<typebox25.TString>;
259
- bucket: typebox25.TOptional<typebox25.TString>;
260
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
261
- name: typebox25.TOptional<typebox25.TString>;
262
- mimeType: typebox25.TOptional<typebox25.TString>;
263
- creator: typebox25.TOptional<typebox25.TString>;
264
- createdAfter: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
265
- createdBefore: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
254
+ query: typebox172.TObject<{
255
+ page: typebox172.TOptional<typebox172.TInteger>;
256
+ size: typebox172.TOptional<typebox172.TInteger>;
257
+ sort: typebox172.TOptional<typebox172.TString>;
258
+ bucket: typebox172.TOptional<typebox172.TString>;
259
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
260
+ name: typebox172.TOptional<typebox172.TString>;
261
+ mimeType: typebox172.TOptional<typebox172.TString>;
262
+ creator: typebox172.TOptional<typebox172.TString>;
263
+ createdAfter: typebox172.TOptional<typebox172.TString>;
264
+ createdBefore: typebox172.TOptional<typebox172.TString>;
266
265
  }>;
267
- response: _alepha_core1.TPage<typebox25.TObject<{
268
- id: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TString, typeof _alepha_postgres16.PG_PRIMARY_KEY>, typeof _alepha_postgres16.PG_DEFAULT>;
269
- version: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TInteger, typeof _alepha_postgres16.PG_VERSION>, typeof _alepha_postgres16.PG_DEFAULT>;
270
- createdAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_CREATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
271
- updatedAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_UPDATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
272
- blobId: typebox25.TString;
273
- creator: typebox25.TOptional<typebox25.TString>;
274
- creatorRealm: typebox25.TOptional<typebox25.TString>;
275
- creatorName: typebox25.TOptional<typebox25.TString>;
276
- bucket: typebox25.TString;
277
- expirationDate: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
278
- name: typebox25.TString;
279
- size: typebox25.TNumber;
280
- mimeType: typebox25.TString;
281
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
282
- checksum: typebox25.TOptional<typebox25.TString>;
266
+ response: _alepha_core1.TPage<typebox172.TObject<{
267
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
268
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
269
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
270
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
271
+ blobId: typebox172.TString;
272
+ creator: typebox172.TOptional<typebox172.TString>;
273
+ creatorRealm: typebox172.TOptional<typebox172.TString>;
274
+ creatorName: typebox172.TOptional<typebox172.TString>;
275
+ bucket: typebox172.TString;
276
+ expirationDate: typebox172.TOptional<typebox172.TString>;
277
+ name: typebox172.TString;
278
+ size: typebox172.TNumber;
279
+ mimeType: typebox172.TString;
280
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
281
+ checksum: typebox172.TOptional<typebox172.TString>;
283
282
  }>>;
284
283
  }>;
285
284
  /**
@@ -287,13 +286,13 @@ declare class FileController {
287
286
  * Removes the file from the bucket and cleans up the database record.
288
287
  */
289
288
  readonly deleteFile: _alepha_server0.ActionDescriptorFn<{
290
- params: typebox25.TObject<{
291
- id: typebox25.TString;
289
+ params: typebox172.TObject<{
290
+ id: typebox172.TString;
292
291
  }>;
293
- response: typebox25.TObject<{
294
- ok: typebox25.TBoolean;
295
- id: typebox25.TOptional<typebox25.TUnion<[typebox25.TString, typebox25.TInteger]>>;
296
- count: typebox25.TOptional<typebox25.TNumber>;
292
+ response: typebox172.TObject<{
293
+ ok: typebox172.TBoolean;
294
+ id: typebox172.TOptional<typebox172.TUnion<[typebox172.TString, typebox172.TInteger]>>;
295
+ count: typebox172.TOptional<typebox172.TNumber>;
297
296
  }>;
298
297
  }>;
299
298
  /**
@@ -302,29 +301,29 @@ declare class FileController {
302
301
  * Optionally specify bucket and expiration date.
303
302
  */
304
303
  readonly uploadFile: _alepha_server0.ActionDescriptorFn<{
305
- body: typebox25.TObject<{
304
+ body: typebox172.TObject<{
306
305
  file: _alepha_core1.TFile;
307
306
  }>;
308
- query: typebox25.TObject<{
309
- expirationDate: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
310
- bucket: typebox25.TOptional<typebox25.TString>;
307
+ query: typebox172.TObject<{
308
+ expirationDate: typebox172.TOptional<typebox172.TString>;
309
+ bucket: typebox172.TOptional<typebox172.TString>;
311
310
  }>;
312
- response: typebox25.TObject<{
313
- id: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TString, typeof _alepha_postgres16.PG_PRIMARY_KEY>, typeof _alepha_postgres16.PG_DEFAULT>;
314
- version: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TInteger, typeof _alepha_postgres16.PG_VERSION>, typeof _alepha_postgres16.PG_DEFAULT>;
315
- createdAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_CREATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
316
- updatedAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_UPDATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
317
- blobId: typebox25.TString;
318
- creator: typebox25.TOptional<typebox25.TString>;
319
- creatorRealm: typebox25.TOptional<typebox25.TString>;
320
- creatorName: typebox25.TOptional<typebox25.TString>;
321
- bucket: typebox25.TString;
322
- expirationDate: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
323
- name: typebox25.TString;
324
- size: typebox25.TNumber;
325
- mimeType: typebox25.TString;
326
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
327
- checksum: typebox25.TOptional<typebox25.TString>;
311
+ response: typebox172.TObject<{
312
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
313
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
314
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
315
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
316
+ blobId: typebox172.TString;
317
+ creator: typebox172.TOptional<typebox172.TString>;
318
+ creatorRealm: typebox172.TOptional<typebox172.TString>;
319
+ creatorName: typebox172.TOptional<typebox172.TString>;
320
+ bucket: typebox172.TString;
321
+ expirationDate: typebox172.TOptional<typebox172.TString>;
322
+ name: typebox172.TString;
323
+ size: typebox172.TNumber;
324
+ mimeType: typebox172.TString;
325
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
326
+ checksum: typebox172.TOptional<typebox172.TString>;
328
327
  }>;
329
328
  }>;
330
329
  /**
@@ -332,30 +331,30 @@ declare class FileController {
332
331
  * Allows updating name, tags, and expiration date without modifying file content.
333
332
  */
334
333
  readonly updateFile: _alepha_server0.ActionDescriptorFn<{
335
- params: typebox25.TObject<{
336
- id: typebox25.TString;
334
+ params: typebox172.TObject<{
335
+ id: typebox172.TString;
337
336
  }>;
338
- body: typebox25.TObject<{
339
- name: typebox25.TOptional<typebox25.TString>;
340
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
341
- expirationDate: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
337
+ body: typebox172.TObject<{
338
+ name: typebox172.TOptional<typebox172.TString>;
339
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
340
+ expirationDate: typebox172.TOptional<typebox172.TString>;
342
341
  }>;
343
- response: typebox25.TObject<{
344
- id: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TString, typeof _alepha_postgres16.PG_PRIMARY_KEY>, typeof _alepha_postgres16.PG_DEFAULT>;
345
- version: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TInteger, typeof _alepha_postgres16.PG_VERSION>, typeof _alepha_postgres16.PG_DEFAULT>;
346
- createdAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_CREATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
347
- updatedAt: _alepha_postgres16.PgAttr<_alepha_postgres16.PgAttr<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>, typeof _alepha_postgres16.PG_UPDATED_AT>, typeof _alepha_postgres16.PG_DEFAULT>;
348
- blobId: typebox25.TString;
349
- creator: typebox25.TOptional<typebox25.TString>;
350
- creatorRealm: typebox25.TOptional<typebox25.TString>;
351
- creatorName: typebox25.TOptional<typebox25.TString>;
352
- bucket: typebox25.TString;
353
- expirationDate: typebox25.TOptional<typebox25.TCodec<typebox25.TString, dayjs2.Dayjs>>;
354
- name: typebox25.TString;
355
- size: typebox25.TNumber;
356
- mimeType: typebox25.TString;
357
- tags: typebox25.TOptional<typebox25.TArray<typebox25.TString>>;
358
- checksum: typebox25.TOptional<typebox25.TString>;
342
+ response: typebox172.TObject<{
343
+ id: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_PRIMARY_KEY>, typeof _alepha_postgres64.PG_DEFAULT>;
344
+ version: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TInteger, typeof _alepha_postgres64.PG_VERSION>, typeof _alepha_postgres64.PG_DEFAULT>;
345
+ createdAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_CREATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
346
+ updatedAt: _alepha_postgres64.PgAttr<_alepha_postgres64.PgAttr<typebox172.TString, typeof _alepha_postgres64.PG_UPDATED_AT>, typeof _alepha_postgres64.PG_DEFAULT>;
347
+ blobId: typebox172.TString;
348
+ creator: typebox172.TOptional<typebox172.TString>;
349
+ creatorRealm: typebox172.TOptional<typebox172.TString>;
350
+ creatorName: typebox172.TOptional<typebox172.TString>;
351
+ bucket: typebox172.TString;
352
+ expirationDate: typebox172.TOptional<typebox172.TString>;
353
+ name: typebox172.TString;
354
+ size: typebox172.TNumber;
355
+ mimeType: typebox172.TString;
356
+ tags: typebox172.TOptional<typebox172.TArray<typebox172.TString>>;
357
+ checksum: typebox172.TOptional<typebox172.TString>;
359
358
  }>;
360
359
  }>;
361
360
  /**
@@ -364,8 +363,8 @@ declare class FileController {
364
363
  * Cached with ETag support for 1 year (immutable).
365
364
  */
366
365
  readonly streamFile: _alepha_server0.ActionDescriptorFn<{
367
- params: typebox25.TObject<{
368
- id: typebox25.TString;
366
+ params: typebox172.TObject<{
367
+ id: typebox172.TString;
369
368
  }>;
370
369
  response: _alepha_core1.TFile;
371
370
  }>;
@@ -386,17 +385,17 @@ declare class StorageStatsController {
386
385
  * and breakdowns by bucket and MIME type.
387
386
  */
388
387
  readonly getStats: _alepha_server0.ActionDescriptorFn<{
389
- response: typebox25.TObject<{
390
- totalSize: typebox25.TNumber;
391
- totalFiles: typebox25.TNumber;
392
- byBucket: typebox25.TArray<typebox25.TObject<{
393
- bucket: typebox25.TString;
394
- totalSize: typebox25.TNumber;
395
- fileCount: typebox25.TNumber;
388
+ response: typebox172.TObject<{
389
+ totalSize: typebox172.TNumber;
390
+ totalFiles: typebox172.TNumber;
391
+ byBucket: typebox172.TArray<typebox172.TObject<{
392
+ bucket: typebox172.TString;
393
+ totalSize: typebox172.TNumber;
394
+ fileCount: typebox172.TNumber;
396
395
  }>>;
397
- byMimeType: typebox25.TArray<typebox25.TObject<{
398
- mimeType: typebox25.TString;
399
- fileCount: typebox25.TNumber;
396
+ byMimeType: typebox172.TArray<typebox172.TObject<{
397
+ mimeType: typebox172.TString;
398
+ fileCount: typebox172.TNumber;
400
399
  }>>;
401
400
  }>;
402
401
  }>;
@@ -433,7 +432,7 @@ declare module "alepha/bucket" {
433
432
  *
434
433
  * @module alepha.api.files
435
434
  */
436
- declare const AlephaApiFiles: _alepha_core1.Service<_alepha_core1.Module<{}>>;
435
+ declare const AlephaApiFiles: _alepha_core1.Service<_alepha_core1.Module>;
437
436
  //#endregion
438
437
  export { AlephaApiFiles, BucketStats, FileController, FileEntity, FileService, MimeTypeStats, StorageStats, StorageStatsController, bucketStatsSchema, files, mimeTypeStatsSchema, storageStatsSchema };
439
438
  //# sourceMappingURL=index.d.ts.map