alepha 0.10.4 → 0.10.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.
package/README.md CHANGED
@@ -38,25 +38,15 @@ Alepha is an opinionated framework that handles everything from database to fron
38
38
 
39
39
  It uses a descriptor-based architecture (`$action`, `$page`, `$repository`, etc.) and enforces type safety across the entire stack.
40
40
 
41
- ```ts
42
- import { run } from "alepha";
43
- import { $action } from "alepha/server";
44
-
45
- class App {
46
- hello = $action({
47
- handler: () => "Hello world!",
48
- })
49
- }
50
-
51
- run(App);
52
- ```
53
-
54
- 👉 For more information, please visit the [documentation](https://feunard.github.io/alepha/).
41
+ For more information, please visit the [documentation](https://feunard.github.io/alepha/).
55
42
 
56
43
  ## Examples
57
44
 
58
45
  ### Type-safe API endpoint
59
46
 
47
+ Write type-safe API endpoints with automatic OpenAPI documentation and more.
48
+
49
+
60
50
  ```ts
61
51
  // app.ts
62
52
  import { run, t } from "alepha";
@@ -96,9 +86,9 @@ node app.ts
96
86
 
97
87
  ### Database with Drizzle ORM
98
88
 
99
- Drizzle ORM is a type-safe ORM for TypeScript, bundled inside Alepha.
89
+ [Drizzle ORM](https://orm.drizzle.team/) is a type-safe ORM for TypeScript, bundled inside Alepha.
100
90
 
101
- Drizzle Kit CLI is required as dev dependencies:
91
+ You need `drizzle-kit` CLI as dev dependencies:
102
92
 
103
93
  ```bash
104
94
  npm install -D drizzle-kit
@@ -143,7 +133,7 @@ node app.ts
143
133
 
144
134
  ### React Application
145
135
 
146
- Alepha has built-in React **CSR** & **SSR** support.
136
+ Build full-stack React applications, with server-side rendering (SSR) and client-side rendering (CSR).
147
137
 
148
138
  [React](https://react.dev) is required as a `dependency`:
149
139
 
@@ -222,8 +212,6 @@ Then run Vite:
222
212
  npx vite
223
213
  ```
224
214
 
225
- Plenty of other features are available, please check the [documentation](https://feunard.github.io/alepha/).
226
-
227
215
  ## License
228
216
 
229
217
  MIT
package/api/files.d.ts CHANGED
@@ -1,95 +1,95 @@
1
1
  import { BucketDescriptor } from "alepha/bucket";
2
2
  import * as _alepha_core1 from "alepha";
3
3
  import { Alepha, FileLike, Static } from "alepha";
4
- import * as _alepha_postgres26 from "alepha/postgres";
4
+ import "alepha/server/security";
5
+ import * as _alepha_postgres83 from "alepha/postgres";
5
6
  import { Page } from "alepha/postgres";
7
+ import * as _alepha_server0 from "alepha/server";
6
8
  import { Ok } from "alepha/server";
7
9
  import { DateTimeProvider, DurationLike } from "alepha/datetime";
8
10
  import * as _alepha_logger0 from "alepha/logger";
9
11
  import { UserAccountToken } from "alepha/security";
10
- import * as typebox68 from "typebox";
11
- import * as _alepha_postgres_src_helpers_pgAttr0 from "alepha/postgres/src/helpers/pgAttr";
12
- import * as _alepha_postgres_src_helpers_pgAttr_ts23 from "alepha/postgres/src/helpers/pgAttr.ts";
12
+ import * as typebox144 from "typebox";
13
13
 
14
14
  //#region src/entities/files.d.ts
15
- declare const files: _alepha_postgres26.PgTableWithColumnsAndSchema<_alepha_postgres26.PgTableConfig<"files", typebox68.TObject<{
16
- id: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_PRIMARY_KEY>, typeof _alepha_postgres26.PG_DEFAULT>;
17
- version: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TInteger, typeof _alepha_postgres26.PG_VERSION>, typeof _alepha_postgres26.PG_DEFAULT>;
18
- createdAt: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_CREATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
19
- updatedAt: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_UPDATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
20
- blobId: typebox68.TString;
21
- creator: typebox68.TOptional<typebox68.TString>;
22
- creatorRealm: typebox68.TOptional<typebox68.TString>;
23
- creatorName: typebox68.TOptional<typebox68.TString>;
24
- container: typebox68.TString;
25
- expirationDate: typebox68.TOptional<typebox68.TString>;
26
- name: typebox68.TString;
27
- size: typebox68.TNumber;
28
- mimeType: typebox68.TString;
29
- tags: typebox68.TOptional<typebox68.TArray<typebox68.TString>>;
30
- checksum: typebox68.TOptional<typebox68.TString>;
31
- }>, _alepha_postgres26.FromSchema<typebox68.TObject<{
32
- id: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_PRIMARY_KEY>, typeof _alepha_postgres26.PG_DEFAULT>;
33
- version: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TInteger, typeof _alepha_postgres26.PG_VERSION>, typeof _alepha_postgres26.PG_DEFAULT>;
34
- createdAt: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_CREATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
35
- updatedAt: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_UPDATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
36
- blobId: typebox68.TString;
37
- creator: typebox68.TOptional<typebox68.TString>;
38
- creatorRealm: typebox68.TOptional<typebox68.TString>;
39
- creatorName: typebox68.TOptional<typebox68.TString>;
40
- container: typebox68.TString;
41
- expirationDate: typebox68.TOptional<typebox68.TString>;
42
- name: typebox68.TString;
43
- size: typebox68.TNumber;
44
- mimeType: typebox68.TString;
45
- tags: typebox68.TOptional<typebox68.TArray<typebox68.TString>>;
46
- checksum: typebox68.TOptional<typebox68.TString>;
47
- }>>>, typebox68.TObject<{
48
- id: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_PRIMARY_KEY>, typeof _alepha_postgres26.PG_DEFAULT>;
49
- version: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TInteger, typeof _alepha_postgres26.PG_VERSION>, typeof _alepha_postgres26.PG_DEFAULT>;
50
- createdAt: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_CREATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
51
- updatedAt: _alepha_postgres_src_helpers_pgAttr0.PgAttr<_alepha_postgres_src_helpers_pgAttr0.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_UPDATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
52
- blobId: typebox68.TString;
53
- creator: typebox68.TOptional<typebox68.TString>;
54
- creatorRealm: typebox68.TOptional<typebox68.TString>;
55
- creatorName: typebox68.TOptional<typebox68.TString>;
56
- container: typebox68.TString;
57
- expirationDate: typebox68.TOptional<typebox68.TString>;
58
- name: typebox68.TString;
59
- size: typebox68.TNumber;
60
- mimeType: typebox68.TString;
61
- tags: typebox68.TOptional<typebox68.TArray<typebox68.TString>>;
62
- checksum: typebox68.TOptional<typebox68.TString>;
15
+ declare const files: _alepha_postgres83.PgTableWithColumnsAndSchema<_alepha_postgres83.PgTableConfig<"files", typebox144.TObject<{
16
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
17
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
18
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
19
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
20
+ blobId: typebox144.TString;
21
+ creator: typebox144.TOptional<typebox144.TString>;
22
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
23
+ creatorName: typebox144.TOptional<typebox144.TString>;
24
+ bucket: typebox144.TString;
25
+ expirationDate: typebox144.TOptional<typebox144.TString>;
26
+ name: typebox144.TString;
27
+ size: typebox144.TNumber;
28
+ mimeType: typebox144.TString;
29
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
30
+ checksum: typebox144.TOptional<typebox144.TString>;
31
+ }>, _alepha_postgres83.FromSchema<typebox144.TObject<{
32
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
33
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
34
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
35
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
36
+ blobId: typebox144.TString;
37
+ creator: typebox144.TOptional<typebox144.TString>;
38
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
39
+ creatorName: typebox144.TOptional<typebox144.TString>;
40
+ bucket: typebox144.TString;
41
+ expirationDate: typebox144.TOptional<typebox144.TString>;
42
+ name: typebox144.TString;
43
+ size: typebox144.TNumber;
44
+ mimeType: typebox144.TString;
45
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
46
+ checksum: typebox144.TOptional<typebox144.TString>;
47
+ }>>>, typebox144.TObject<{
48
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
49
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
50
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
51
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
52
+ blobId: typebox144.TString;
53
+ creator: typebox144.TOptional<typebox144.TString>;
54
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
55
+ creatorName: typebox144.TOptional<typebox144.TString>;
56
+ bucket: typebox144.TString;
57
+ expirationDate: typebox144.TOptional<typebox144.TString>;
58
+ name: typebox144.TString;
59
+ size: typebox144.TNumber;
60
+ mimeType: typebox144.TString;
61
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
62
+ checksum: typebox144.TOptional<typebox144.TString>;
63
63
  }>>;
64
64
  type FileEntity = Static<typeof files.$schema>;
65
65
  //#endregion
66
66
  //#region src/schemas/fileQuerySchema.d.ts
67
- declare const fileQuerySchema: typebox68.TObject<{
68
- page: typebox68.TOptional<typebox68.TInteger>;
69
- size: typebox68.TOptional<typebox68.TInteger>;
70
- sort: typebox68.TOptional<typebox68.TString>;
71
- container: typebox68.TOptional<typebox68.TString>;
72
- tags: typebox68.TOptional<typebox68.TArray<typebox68.TString>>;
67
+ declare const fileQuerySchema: typebox144.TObject<{
68
+ page: typebox144.TOptional<typebox144.TInteger>;
69
+ size: typebox144.TOptional<typebox144.TInteger>;
70
+ sort: typebox144.TOptional<typebox144.TString>;
71
+ bucket: typebox144.TOptional<typebox144.TString>;
72
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
73
73
  }>;
74
74
  type FileQuery = Static<typeof fileQuerySchema>;
75
75
  //#endregion
76
76
  //#region src/schemas/fileResourceSchema.d.ts
77
- declare const fileResourceSchema: typebox68.TObject<{
78
- id: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_PRIMARY_KEY>, typeof _alepha_postgres26.PG_DEFAULT>;
79
- version: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TInteger, typeof _alepha_postgres26.PG_VERSION>, typeof _alepha_postgres26.PG_DEFAULT>;
80
- createdAt: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_CREATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
81
- updatedAt: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_UPDATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
82
- blobId: typebox68.TString;
83
- creator: typebox68.TOptional<typebox68.TString>;
84
- creatorRealm: typebox68.TOptional<typebox68.TString>;
85
- creatorName: typebox68.TOptional<typebox68.TString>;
86
- container: typebox68.TString;
87
- expirationDate: typebox68.TOptional<typebox68.TString>;
88
- name: typebox68.TString;
89
- size: typebox68.TNumber;
90
- mimeType: typebox68.TString;
91
- tags: typebox68.TOptional<typebox68.TArray<typebox68.TString>>;
92
- checksum: typebox68.TOptional<typebox68.TString>;
77
+ declare const fileResourceSchema: typebox144.TObject<{
78
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
79
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
80
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
81
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
82
+ blobId: typebox144.TString;
83
+ creator: typebox144.TOptional<typebox144.TString>;
84
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
85
+ creatorName: typebox144.TOptional<typebox144.TString>;
86
+ bucket: typebox144.TString;
87
+ expirationDate: typebox144.TOptional<typebox144.TString>;
88
+ name: typebox144.TString;
89
+ size: typebox144.TNumber;
90
+ mimeType: typebox144.TString;
91
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
92
+ checksum: typebox144.TOptional<typebox144.TString>;
93
93
  }>;
94
94
  type FileResource = Static<typeof fileResourceSchema>;
95
95
  //#endregion
@@ -97,66 +97,66 @@ type FileResource = Static<typeof fileResourceSchema>;
97
97
  declare class FileService {
98
98
  protected readonly alepha: Alepha;
99
99
  protected readonly log: _alepha_logger0.Logger;
100
- protected readonly fileRepository: _alepha_postgres26.RepositoryDescriptor<_alepha_postgres26.PgTableConfig<"files", typebox68.TObject<{
101
- id: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_PRIMARY_KEY>, typeof _alepha_postgres26.PG_DEFAULT>;
102
- version: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TInteger, typeof _alepha_postgres26.PG_VERSION>, typeof _alepha_postgres26.PG_DEFAULT>;
103
- createdAt: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_CREATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
104
- updatedAt: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_UPDATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
105
- blobId: typebox68.TString;
106
- creator: typebox68.TOptional<typebox68.TString>;
107
- creatorRealm: typebox68.TOptional<typebox68.TString>;
108
- creatorName: typebox68.TOptional<typebox68.TString>;
109
- container: typebox68.TString;
110
- expirationDate: typebox68.TOptional<typebox68.TString>;
111
- name: typebox68.TString;
112
- size: typebox68.TNumber;
113
- mimeType: typebox68.TString;
114
- tags: typebox68.TOptional<typebox68.TArray<typebox68.TString>>;
115
- checksum: typebox68.TOptional<typebox68.TString>;
116
- }>, _alepha_postgres26.FromSchema<typebox68.TObject<{
117
- id: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_PRIMARY_KEY>, typeof _alepha_postgres26.PG_DEFAULT>;
118
- version: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TInteger, typeof _alepha_postgres26.PG_VERSION>, typeof _alepha_postgres26.PG_DEFAULT>;
119
- createdAt: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_CREATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
120
- updatedAt: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_UPDATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
121
- blobId: typebox68.TString;
122
- creator: typebox68.TOptional<typebox68.TString>;
123
- creatorRealm: typebox68.TOptional<typebox68.TString>;
124
- creatorName: typebox68.TOptional<typebox68.TString>;
125
- container: typebox68.TString;
126
- expirationDate: typebox68.TOptional<typebox68.TString>;
127
- name: typebox68.TString;
128
- size: typebox68.TNumber;
129
- mimeType: typebox68.TString;
130
- tags: typebox68.TOptional<typebox68.TArray<typebox68.TString>>;
131
- checksum: typebox68.TOptional<typebox68.TString>;
132
- }>>>, typebox68.TObject<{
133
- id: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_PRIMARY_KEY>, typeof _alepha_postgres26.PG_DEFAULT>;
134
- version: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TInteger, typeof _alepha_postgres26.PG_VERSION>, typeof _alepha_postgres26.PG_DEFAULT>;
135
- createdAt: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_CREATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
136
- updatedAt: _alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<_alepha_postgres_src_helpers_pgAttr_ts23.PgAttr<typebox68.TString, typeof _alepha_postgres26.PG_UPDATED_AT>, typeof _alepha_postgres26.PG_DEFAULT>;
137
- blobId: typebox68.TString;
138
- creator: typebox68.TOptional<typebox68.TString>;
139
- creatorRealm: typebox68.TOptional<typebox68.TString>;
140
- creatorName: typebox68.TOptional<typebox68.TString>;
141
- container: typebox68.TString;
142
- expirationDate: typebox68.TOptional<typebox68.TString>;
143
- name: typebox68.TString;
144
- size: typebox68.TNumber;
145
- mimeType: typebox68.TString;
146
- tags: typebox68.TOptional<typebox68.TArray<typebox68.TString>>;
147
- checksum: typebox68.TOptional<typebox68.TString>;
100
+ protected readonly fileRepository: _alepha_postgres83.RepositoryDescriptor<_alepha_postgres83.PgTableConfig<"files", typebox144.TObject<{
101
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
102
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
103
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
104
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
105
+ blobId: typebox144.TString;
106
+ creator: typebox144.TOptional<typebox144.TString>;
107
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
108
+ creatorName: typebox144.TOptional<typebox144.TString>;
109
+ bucket: typebox144.TString;
110
+ expirationDate: typebox144.TOptional<typebox144.TString>;
111
+ name: typebox144.TString;
112
+ size: typebox144.TNumber;
113
+ mimeType: typebox144.TString;
114
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
115
+ checksum: typebox144.TOptional<typebox144.TString>;
116
+ }>, _alepha_postgres83.FromSchema<typebox144.TObject<{
117
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
118
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
119
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
120
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
121
+ blobId: typebox144.TString;
122
+ creator: typebox144.TOptional<typebox144.TString>;
123
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
124
+ creatorName: typebox144.TOptional<typebox144.TString>;
125
+ bucket: typebox144.TString;
126
+ expirationDate: typebox144.TOptional<typebox144.TString>;
127
+ name: typebox144.TString;
128
+ size: typebox144.TNumber;
129
+ mimeType: typebox144.TString;
130
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
131
+ checksum: typebox144.TOptional<typebox144.TString>;
132
+ }>>>, typebox144.TObject<{
133
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
134
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
135
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
136
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
137
+ blobId: typebox144.TString;
138
+ creator: typebox144.TOptional<typebox144.TString>;
139
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
140
+ creatorName: typebox144.TOptional<typebox144.TString>;
141
+ bucket: typebox144.TString;
142
+ expirationDate: typebox144.TOptional<typebox144.TString>;
143
+ name: typebox144.TString;
144
+ size: typebox144.TNumber;
145
+ mimeType: typebox144.TString;
146
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
147
+ checksum: typebox144.TOptional<typebox144.TString>;
148
148
  }>>;
149
149
  protected readonly dateTimeProvider: DateTimeProvider;
150
150
  protected readonly defaultBucket: BucketDescriptor;
151
151
  protected onUploadFile: _alepha_core1.HookDescriptor<"bucket:file:uploaded">;
152
152
  protected onDeleteBucketFile: _alepha_core1.HookDescriptor<"bucket:file:deleted">;
153
- storage(storageName?: string): BucketDescriptor;
153
+ bucket(bucketName?: string): BucketDescriptor;
154
154
  findFiles(q?: FileQuery): Promise<Page<FileEntity>>;
155
155
  findExpiredFiles(): Promise<FileEntity[]>;
156
156
  protected getExpirationDate(ttl?: DurationLike): string | undefined;
157
157
  uploadFile(file: FileLike, options?: {
158
158
  expirationDate?: string | Date;
159
- container?: string;
159
+ bucket?: string;
160
160
  user?: UserAccountToken;
161
161
  tags?: string[];
162
162
  }): Promise<FileEntity>;
@@ -166,6 +166,81 @@ declare class FileService {
166
166
  entityToResource(entity: FileEntity): FileResource;
167
167
  }
168
168
  //#endregion
169
+ //#region src/controllers/FileController.d.ts
170
+ declare class FileController {
171
+ protected readonly url = "/files";
172
+ protected readonly group = "files";
173
+ protected readonly fileService: FileService;
174
+ readonly findFiles: _alepha_server0.ActionDescriptorFn<{
175
+ query: typebox144.TObject<{
176
+ page: typebox144.TOptional<typebox144.TInteger>;
177
+ size: typebox144.TOptional<typebox144.TInteger>;
178
+ sort: typebox144.TOptional<typebox144.TString>;
179
+ bucket: typebox144.TOptional<typebox144.TString>;
180
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
181
+ }>;
182
+ response: _alepha_postgres83.TPage<typebox144.TObject<{
183
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
184
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
185
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
186
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
187
+ blobId: typebox144.TString;
188
+ creator: typebox144.TOptional<typebox144.TString>;
189
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
190
+ creatorName: typebox144.TOptional<typebox144.TString>;
191
+ bucket: typebox144.TString;
192
+ expirationDate: typebox144.TOptional<typebox144.TString>;
193
+ name: typebox144.TString;
194
+ size: typebox144.TNumber;
195
+ mimeType: typebox144.TString;
196
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
197
+ checksum: typebox144.TOptional<typebox144.TString>;
198
+ }>>;
199
+ }>;
200
+ readonly deleteFile: _alepha_server0.ActionDescriptorFn<{
201
+ params: typebox144.TObject<{
202
+ id: typebox144.TString;
203
+ }>;
204
+ response: typebox144.TObject<{
205
+ ok: typebox144.TBoolean;
206
+ id: typebox144.TOptional<typebox144.TUnion<[typebox144.TString, typebox144.TInteger]>>;
207
+ count: typebox144.TOptional<typebox144.TNumber>;
208
+ }>;
209
+ }>;
210
+ readonly uploadFile: _alepha_server0.ActionDescriptorFn<{
211
+ body: typebox144.TObject<{
212
+ file: _alepha_core1.TFile;
213
+ }>;
214
+ query: typebox144.TObject<{
215
+ expirationDate: typebox144.TOptional<typebox144.TString>;
216
+ bucket: typebox144.TOptional<typebox144.TString>;
217
+ }>;
218
+ response: typebox144.TObject<{
219
+ id: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_PRIMARY_KEY>, typeof _alepha_postgres83.PG_DEFAULT>;
220
+ version: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TInteger, typeof _alepha_postgres83.PG_VERSION>, typeof _alepha_postgres83.PG_DEFAULT>;
221
+ createdAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_CREATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
222
+ updatedAt: _alepha_postgres83.PgAttr<_alepha_postgres83.PgAttr<typebox144.TString, typeof _alepha_postgres83.PG_UPDATED_AT>, typeof _alepha_postgres83.PG_DEFAULT>;
223
+ blobId: typebox144.TString;
224
+ creator: typebox144.TOptional<typebox144.TString>;
225
+ creatorRealm: typebox144.TOptional<typebox144.TString>;
226
+ creatorName: typebox144.TOptional<typebox144.TString>;
227
+ bucket: typebox144.TString;
228
+ expirationDate: typebox144.TOptional<typebox144.TString>;
229
+ name: typebox144.TString;
230
+ size: typebox144.TNumber;
231
+ mimeType: typebox144.TString;
232
+ tags: typebox144.TOptional<typebox144.TArray<typebox144.TString>>;
233
+ checksum: typebox144.TOptional<typebox144.TString>;
234
+ }>;
235
+ }>;
236
+ readonly streamFile: _alepha_server0.ActionDescriptorFn<{
237
+ params: typebox144.TObject<{
238
+ id: typebox144.TString;
239
+ }>;
240
+ response: _alepha_core1.TFile;
241
+ }>;
242
+ }
243
+ //#endregion
169
244
  //#region src/index.d.ts
170
245
  declare module "alepha/bucket" {
171
246
  interface BucketFileOptions {
@@ -199,5 +274,5 @@ declare module "alepha/bucket" {
199
274
  */
200
275
  declare const AlephaApiFiles: _alepha_core1.Service<_alepha_core1.Module<{}>>;
201
276
  //#endregion
202
- export { AlephaApiFiles, FileEntity, FileService, files };
277
+ export { AlephaApiFiles, FileController, FileEntity, FileService, files };
203
278
  //# sourceMappingURL=index.d.ts.map