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 +7 -19
- package/api/files.d.ts +200 -125
- package/api/jobs.d.ts +170 -172
- package/api/users.d.ts +216 -215
- package/bucket.d.ts +81 -4
- package/command.d.ts +1 -1
- package/email.d.ts +5 -5
- package/package.json +48 -48
- package/postgres.d.ts +48 -5
- package/react/auth.d.ts +5 -0
- package/react.d.ts +28 -28
- package/security.d.ts +4 -7
- package/server/cache.d.ts +16 -7
- package/server/links.d.ts +2 -2
- package/server/security.d.ts +4 -6
- package/server.d.ts +20 -20
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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:
|
|
16
|
-
id:
|
|
17
|
-
version:
|
|
18
|
-
createdAt:
|
|
19
|
-
updatedAt:
|
|
20
|
-
blobId:
|
|
21
|
-
creator:
|
|
22
|
-
creatorRealm:
|
|
23
|
-
creatorName:
|
|
24
|
-
|
|
25
|
-
expirationDate:
|
|
26
|
-
name:
|
|
27
|
-
size:
|
|
28
|
-
mimeType:
|
|
29
|
-
tags:
|
|
30
|
-
checksum:
|
|
31
|
-
}>,
|
|
32
|
-
id:
|
|
33
|
-
version:
|
|
34
|
-
createdAt:
|
|
35
|
-
updatedAt:
|
|
36
|
-
blobId:
|
|
37
|
-
creator:
|
|
38
|
-
creatorRealm:
|
|
39
|
-
creatorName:
|
|
40
|
-
|
|
41
|
-
expirationDate:
|
|
42
|
-
name:
|
|
43
|
-
size:
|
|
44
|
-
mimeType:
|
|
45
|
-
tags:
|
|
46
|
-
checksum:
|
|
47
|
-
}>>>,
|
|
48
|
-
id:
|
|
49
|
-
version:
|
|
50
|
-
createdAt:
|
|
51
|
-
updatedAt:
|
|
52
|
-
blobId:
|
|
53
|
-
creator:
|
|
54
|
-
creatorRealm:
|
|
55
|
-
creatorName:
|
|
56
|
-
|
|
57
|
-
expirationDate:
|
|
58
|
-
name:
|
|
59
|
-
size:
|
|
60
|
-
mimeType:
|
|
61
|
-
tags:
|
|
62
|
-
checksum:
|
|
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:
|
|
68
|
-
page:
|
|
69
|
-
size:
|
|
70
|
-
sort:
|
|
71
|
-
|
|
72
|
-
tags:
|
|
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:
|
|
78
|
-
id:
|
|
79
|
-
version:
|
|
80
|
-
createdAt:
|
|
81
|
-
updatedAt:
|
|
82
|
-
blobId:
|
|
83
|
-
creator:
|
|
84
|
-
creatorRealm:
|
|
85
|
-
creatorName:
|
|
86
|
-
|
|
87
|
-
expirationDate:
|
|
88
|
-
name:
|
|
89
|
-
size:
|
|
90
|
-
mimeType:
|
|
91
|
-
tags:
|
|
92
|
-
checksum:
|
|
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:
|
|
101
|
-
id:
|
|
102
|
-
version:
|
|
103
|
-
createdAt:
|
|
104
|
-
updatedAt:
|
|
105
|
-
blobId:
|
|
106
|
-
creator:
|
|
107
|
-
creatorRealm:
|
|
108
|
-
creatorName:
|
|
109
|
-
|
|
110
|
-
expirationDate:
|
|
111
|
-
name:
|
|
112
|
-
size:
|
|
113
|
-
mimeType:
|
|
114
|
-
tags:
|
|
115
|
-
checksum:
|
|
116
|
-
}>,
|
|
117
|
-
id:
|
|
118
|
-
version:
|
|
119
|
-
createdAt:
|
|
120
|
-
updatedAt:
|
|
121
|
-
blobId:
|
|
122
|
-
creator:
|
|
123
|
-
creatorRealm:
|
|
124
|
-
creatorName:
|
|
125
|
-
|
|
126
|
-
expirationDate:
|
|
127
|
-
name:
|
|
128
|
-
size:
|
|
129
|
-
mimeType:
|
|
130
|
-
tags:
|
|
131
|
-
checksum:
|
|
132
|
-
}>>>,
|
|
133
|
-
id:
|
|
134
|
-
version:
|
|
135
|
-
createdAt:
|
|
136
|
-
updatedAt:
|
|
137
|
-
blobId:
|
|
138
|
-
creator:
|
|
139
|
-
creatorRealm:
|
|
140
|
-
creatorName:
|
|
141
|
-
|
|
142
|
-
expirationDate:
|
|
143
|
-
name:
|
|
144
|
-
size:
|
|
145
|
-
mimeType:
|
|
146
|
-
tags:
|
|
147
|
-
checksum:
|
|
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
|
-
|
|
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
|
-
|
|
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
|