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.
- package/LICENSE +1 -1
- package/README.md +15 -100
- package/api/files.d.ts +168 -169
- package/api/jobs.d.ts +263 -154
- package/api/notifications.d.ts +28 -29
- package/api/users.d.ts +476 -477
- package/batch.d.ts +59 -493
- package/bucket.d.ts +20 -11
- package/cache/redis.d.ts +1 -1
- package/cache.d.ts +1 -1
- package/command.d.ts +24 -7
- package/core.d.ts +299 -222
- package/datetime.d.ts +4 -29
- package/devtools.d.ts +166 -284
- package/email.d.ts +45 -2
- package/fake.d.ts +1 -1
- package/file.d.ts +1 -1
- package/lock/redis.d.ts +1 -1
- package/lock.d.ts +1 -1
- package/logger.d.ts +11 -9
- package/package.json +51 -51
- package/postgres.d.ts +480 -198
- package/queue/redis.d.ts +1 -1
- package/queue.d.ts +1 -1
- package/react/auth.d.ts +7 -2
- package/react/form.d.ts +39 -16
- package/react/head.d.ts +1 -1
- package/react/i18n.d.ts +2 -2
- package/react.d.ts +66 -41
- package/redis.d.ts +1 -1
- package/retry.d.ts +84 -21
- package/scheduler.d.ts +1 -1
- package/security.d.ts +29 -29
- package/server/cache.d.ts +1 -1
- package/server/compress.d.ts +9 -3
- package/server/cookies.d.ts +1 -1
- package/server/cors.d.ts +28 -10
- package/server/health.d.ts +18 -19
- package/server/helmet.d.ts +44 -15
- package/server/links.d.ts +37 -31
- package/server/metrics.d.ts +1 -1
- package/server/multipart.d.ts +1 -1
- package/server/proxy.d.ts +1 -1
- package/server/security.d.ts +8 -3
- package/server/static.d.ts +1 -1
- package/server/swagger.d.ts +19 -6
- package/server.d.ts +1 -1
- package/topic/redis.d.ts +1 -1
- package/topic.d.ts +1 -1
- package/ui.d.ts +142 -12
- package/vite.d.ts +2 -2
package/LICENSE
CHANGED
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
|
-
###
|
|
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
|
-
//
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
73
|
+
run(alepha);
|
|
128
74
|
```
|
|
129
75
|
|
|
130
76
|
```bash
|
|
131
|
-
|
|
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
|
|
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
|
-
|
|
171
|
-
```
|
|
109
|
+
const alepha = Alepha.create();
|
|
172
110
|
|
|
173
|
-
|
|
111
|
+
alepha.with(AppRouter);
|
|
174
112
|
|
|
175
|
-
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
17
|
-
id:
|
|
18
|
-
version:
|
|
19
|
-
createdAt:
|
|
20
|
-
updatedAt:
|
|
21
|
-
blobId:
|
|
22
|
-
creator:
|
|
23
|
-
creatorRealm:
|
|
24
|
-
creatorName:
|
|
25
|
-
bucket:
|
|
26
|
-
expirationDate:
|
|
27
|
-
name:
|
|
28
|
-
size:
|
|
29
|
-
mimeType:
|
|
30
|
-
tags:
|
|
31
|
-
checksum:
|
|
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:
|
|
37
|
-
page:
|
|
38
|
-
size:
|
|
39
|
-
sort:
|
|
40
|
-
bucket:
|
|
41
|
-
tags:
|
|
42
|
-
name:
|
|
43
|
-
mimeType:
|
|
44
|
-
creator:
|
|
45
|
-
createdAfter:
|
|
46
|
-
createdBefore:
|
|
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:
|
|
52
|
-
id:
|
|
53
|
-
version:
|
|
54
|
-
createdAt:
|
|
55
|
-
updatedAt:
|
|
56
|
-
blobId:
|
|
57
|
-
creator:
|
|
58
|
-
creatorRealm:
|
|
59
|
-
creatorName:
|
|
60
|
-
bucket:
|
|
61
|
-
expirationDate:
|
|
62
|
-
name:
|
|
63
|
-
size:
|
|
64
|
-
mimeType:
|
|
65
|
-
tags:
|
|
66
|
-
checksum:
|
|
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:
|
|
72
|
-
bucket:
|
|
73
|
-
totalSize:
|
|
74
|
-
fileCount:
|
|
70
|
+
declare const bucketStatsSchema: typebox172.TObject<{
|
|
71
|
+
bucket: typebox172.TString;
|
|
72
|
+
totalSize: typebox172.TNumber;
|
|
73
|
+
fileCount: typebox172.TNumber;
|
|
75
74
|
}>;
|
|
76
|
-
declare const mimeTypeStatsSchema:
|
|
77
|
-
mimeType:
|
|
78
|
-
fileCount:
|
|
75
|
+
declare const mimeTypeStatsSchema: typebox172.TObject<{
|
|
76
|
+
mimeType: typebox172.TString;
|
|
77
|
+
fileCount: typebox172.TNumber;
|
|
79
78
|
}>;
|
|
80
|
-
declare const storageStatsSchema:
|
|
81
|
-
totalSize:
|
|
82
|
-
totalFiles:
|
|
83
|
-
byBucket:
|
|
84
|
-
bucket:
|
|
85
|
-
totalSize:
|
|
86
|
-
fileCount:
|
|
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:
|
|
89
|
-
mimeType:
|
|
90
|
-
fileCount:
|
|
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:
|
|
102
|
-
id:
|
|
103
|
-
version:
|
|
104
|
-
createdAt:
|
|
105
|
-
updatedAt:
|
|
106
|
-
blobId:
|
|
107
|
-
creator:
|
|
108
|
-
creatorRealm:
|
|
109
|
-
creatorName:
|
|
110
|
-
bucket:
|
|
111
|
-
expirationDate:
|
|
112
|
-
name:
|
|
113
|
-
size:
|
|
114
|
-
mimeType:
|
|
115
|
-
tags:
|
|
116
|
-
checksum:
|
|
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):
|
|
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:
|
|
256
|
-
page:
|
|
257
|
-
size:
|
|
258
|
-
sort:
|
|
259
|
-
bucket:
|
|
260
|
-
tags:
|
|
261
|
-
name:
|
|
262
|
-
mimeType:
|
|
263
|
-
creator:
|
|
264
|
-
createdAfter:
|
|
265
|
-
createdBefore:
|
|
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<
|
|
268
|
-
id:
|
|
269
|
-
version:
|
|
270
|
-
createdAt:
|
|
271
|
-
updatedAt:
|
|
272
|
-
blobId:
|
|
273
|
-
creator:
|
|
274
|
-
creatorRealm:
|
|
275
|
-
creatorName:
|
|
276
|
-
bucket:
|
|
277
|
-
expirationDate:
|
|
278
|
-
name:
|
|
279
|
-
size:
|
|
280
|
-
mimeType:
|
|
281
|
-
tags:
|
|
282
|
-
checksum:
|
|
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:
|
|
291
|
-
id:
|
|
289
|
+
params: typebox172.TObject<{
|
|
290
|
+
id: typebox172.TString;
|
|
292
291
|
}>;
|
|
293
|
-
response:
|
|
294
|
-
ok:
|
|
295
|
-
id:
|
|
296
|
-
count:
|
|
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:
|
|
304
|
+
body: typebox172.TObject<{
|
|
306
305
|
file: _alepha_core1.TFile;
|
|
307
306
|
}>;
|
|
308
|
-
query:
|
|
309
|
-
expirationDate:
|
|
310
|
-
bucket:
|
|
307
|
+
query: typebox172.TObject<{
|
|
308
|
+
expirationDate: typebox172.TOptional<typebox172.TString>;
|
|
309
|
+
bucket: typebox172.TOptional<typebox172.TString>;
|
|
311
310
|
}>;
|
|
312
|
-
response:
|
|
313
|
-
id:
|
|
314
|
-
version:
|
|
315
|
-
createdAt:
|
|
316
|
-
updatedAt:
|
|
317
|
-
blobId:
|
|
318
|
-
creator:
|
|
319
|
-
creatorRealm:
|
|
320
|
-
creatorName:
|
|
321
|
-
bucket:
|
|
322
|
-
expirationDate:
|
|
323
|
-
name:
|
|
324
|
-
size:
|
|
325
|
-
mimeType:
|
|
326
|
-
tags:
|
|
327
|
-
checksum:
|
|
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:
|
|
336
|
-
id:
|
|
334
|
+
params: typebox172.TObject<{
|
|
335
|
+
id: typebox172.TString;
|
|
337
336
|
}>;
|
|
338
|
-
body:
|
|
339
|
-
name:
|
|
340
|
-
tags:
|
|
341
|
-
expirationDate:
|
|
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:
|
|
344
|
-
id:
|
|
345
|
-
version:
|
|
346
|
-
createdAt:
|
|
347
|
-
updatedAt:
|
|
348
|
-
blobId:
|
|
349
|
-
creator:
|
|
350
|
-
creatorRealm:
|
|
351
|
-
creatorName:
|
|
352
|
-
bucket:
|
|
353
|
-
expirationDate:
|
|
354
|
-
name:
|
|
355
|
-
size:
|
|
356
|
-
mimeType:
|
|
357
|
-
tags:
|
|
358
|
-
checksum:
|
|
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:
|
|
368
|
-
id:
|
|
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:
|
|
390
|
-
totalSize:
|
|
391
|
-
totalFiles:
|
|
392
|
-
byBucket:
|
|
393
|
-
bucket:
|
|
394
|
-
totalSize:
|
|
395
|
-
fileCount:
|
|
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:
|
|
398
|
-
mimeType:
|
|
399
|
-
fileCount:
|
|
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
|