alepha 0.13.4 → 0.13.5
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/dist/api-files/index.browser.js +5 -5
- package/dist/api-files/index.d.ts +191 -191
- package/dist/api-files/index.js +9 -9
- package/dist/api-jobs/index.browser.js +5 -5
- package/dist/api-jobs/index.d.ts +173 -173
- package/dist/api-jobs/index.js +9 -9
- package/dist/api-notifications/index.browser.js +11 -11
- package/dist/api-notifications/index.d.ts +11 -11
- package/dist/api-notifications/index.js +11 -11
- package/dist/api-parameters/index.browser.js +2 -2
- package/dist/api-parameters/index.d.ts +3 -3
- package/dist/api-parameters/index.js +3 -3
- package/dist/api-users/index.browser.js +6 -6
- package/dist/api-users/index.d.ts +55 -55
- package/dist/api-users/index.js +36 -36
- package/dist/api-verifications/index.browser.js +5 -5
- package/dist/api-verifications/index.d.ts +21 -21
- package/dist/api-verifications/index.js +10 -10
- package/dist/batch/index.d.ts +3 -3
- package/dist/batch/index.js +3 -3
- package/dist/bin/index.js +1 -1
- package/dist/bucket/index.d.ts +6 -6
- package/dist/bucket/index.js +7 -7
- package/dist/cache/index.d.ts +4 -4
- package/dist/cache/index.js +5 -5
- package/dist/cache-redis/index.d.ts +2 -2
- package/dist/cache-redis/index.js +2 -2
- package/dist/cli/{dist-lGnqsKpu.js → dist-BlfFtOk2.js} +16 -16
- package/dist/cli/{dist-lGnqsKpu.js.map → dist-BlfFtOk2.js.map} +1 -1
- package/dist/cli/index.d.ts +31 -75
- package/dist/cli/index.js +94 -171
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +8 -8
- package/dist/command/index.js +11 -10
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +35 -35
- package/dist/core/index.d.ts +39 -39
- package/dist/core/index.js +35 -35
- package/dist/core/index.native.js +35 -35
- package/dist/datetime/index.d.ts +3 -3
- package/dist/datetime/index.js +3 -3
- package/dist/email/index.d.ts +11 -11
- package/dist/email/index.js +42 -42
- package/dist/fake/index.d.ts +2 -2
- package/dist/fake/index.js +5 -5
- package/dist/file/index.d.ts +4 -4
- package/dist/file/index.js +4 -4
- package/dist/lock/index.d.ts +5 -5
- package/dist/lock/index.js +5 -5
- package/dist/lock-redis/index.d.ts +2 -2
- package/dist/lock-redis/index.js +2 -2
- package/dist/logger/index.d.ts +11 -11
- package/dist/logger/index.js +12 -12
- package/dist/orm/index.browser.js +12 -12
- package/dist/orm/index.d.ts +52 -52
- package/dist/orm/index.js +32 -32
- package/dist/queue/index.d.ts +7 -7
- package/dist/queue/index.js +6 -6
- package/dist/queue-redis/index.d.ts +2 -2
- package/dist/queue-redis/index.js +2 -2
- package/dist/redis/index.d.ts +13 -13
- package/dist/redis/index.js +3 -3
- package/dist/retry/index.d.ts +5 -5
- package/dist/retry/index.js +5 -5
- package/dist/router/index.d.ts +1 -1
- package/dist/router/index.js +1 -1
- package/dist/scheduler/index.d.ts +4 -4
- package/dist/scheduler/index.js +7 -7
- package/dist/security/index.browser.js +7 -7
- package/dist/security/index.d.ts +15 -15
- package/dist/security/index.js +46 -46
- package/dist/server/index.browser.js +14 -14
- package/dist/server/index.d.ts +26 -26
- package/dist/server/index.js +26 -26
- package/dist/server-auth/index.browser.js +6 -6
- package/dist/server-auth/index.d.ts +163 -163
- package/dist/server-auth/index.js +13 -13
- package/dist/server-cache/index.d.ts +2 -2
- package/dist/server-cache/index.js +2 -2
- package/dist/server-compress/index.d.ts +2 -2
- package/dist/server-compress/index.js +2 -2
- package/dist/server-cookies/index.browser.js +3 -3
- package/dist/server-cookies/index.d.ts +4 -4
- package/dist/server-cookies/index.js +4 -4
- package/dist/server-cors/index.d.ts +3 -3
- package/dist/server-cors/index.js +3 -3
- package/dist/server-health/index.d.ts +3 -3
- package/dist/server-health/index.js +3 -3
- package/dist/server-helmet/index.d.ts +2 -2
- package/dist/server-helmet/index.js +2 -2
- package/dist/server-links/index.browser.js +5 -5
- package/dist/server-links/index.d.ts +40 -40
- package/dist/server-links/index.js +7 -7
- package/dist/server-metrics/index.d.ts +2 -2
- package/dist/server-metrics/index.js +86 -86
- package/dist/server-multipart/index.d.ts +2 -2
- package/dist/server-multipart/index.js +2 -2
- package/dist/server-proxy/index.d.ts +3 -3
- package/dist/server-proxy/index.js +3 -3
- package/dist/server-rate-limit/index.d.ts +3 -3
- package/dist/server-rate-limit/index.js +3 -3
- package/dist/server-security/index.browser.js +1 -1
- package/dist/server-security/index.d.ts +13 -13
- package/dist/server-security/index.js +4 -4
- package/dist/server-static/index.d.ts +3 -3
- package/dist/server-static/index.js +3 -3
- package/dist/server-swagger/index.d.ts +3 -3
- package/dist/server-swagger/index.js +3 -3
- package/dist/sms/index.d.ts +6 -6
- package/dist/sms/index.js +6 -6
- package/dist/thread/index.d.ts +3 -3
- package/dist/thread/index.js +3 -3
- package/dist/topic/index.d.ts +6 -6
- package/dist/topic/index.js +6 -6
- package/dist/topic-redis/index.d.ts +2 -2
- package/dist/topic-redis/index.js +2 -2
- package/dist/vite/index.d.ts +17 -17
- package/dist/vite/index.js +20 -20
- package/dist/websocket/index.browser.js +9 -9
- package/dist/websocket/index.d.ts +17 -17
- package/dist/websocket/index.js +10 -10
- package/package.json +5 -4
- package/src/cli/apps/AlephaCli.ts +1 -2
- package/src/cli/commands/BiomeCommands.ts +4 -6
- package/src/cli/commands/CoreCommands.ts +2 -2
- package/src/cli/commands/DrizzleCommands.ts +76 -78
- package/src/cli/commands/VerifyCommands.ts +3 -5
- package/src/cli/commands/ViteCommands.ts +6 -8
- package/src/cli/index.ts +1 -1
- package/src/cli/services/{ProjectUtils.ts → AlephaCliUtils.ts} +101 -16
- package/src/command/providers/CliProvider.ts +12 -4
- package/src/cli/services/ProcessRunner.ts +0 -89
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $module, t } from "alepha";
|
|
2
2
|
import { $entity, pageQuerySchema, pg } from "alepha/orm";
|
|
3
3
|
|
|
4
|
-
//#region src/api-files/entities/files.ts
|
|
4
|
+
//#region ../../src/api-files/entities/files.ts
|
|
5
5
|
const files = $entity({
|
|
6
6
|
name: "files",
|
|
7
7
|
schema: t.object({
|
|
@@ -32,7 +32,7 @@ const files = $entity({
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
//#endregion
|
|
35
|
-
//#region src/api-files/schemas/fileQuerySchema.ts
|
|
35
|
+
//#region ../../src/api-files/schemas/fileQuerySchema.ts
|
|
36
36
|
const fileQuerySchema = t.extend(pageQuerySchema, {
|
|
37
37
|
bucket: t.optional(t.string()),
|
|
38
38
|
tags: t.optional(t.array(t.string())),
|
|
@@ -44,14 +44,14 @@ const fileQuerySchema = t.extend(pageQuerySchema, {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
//#endregion
|
|
47
|
-
//#region src/api-files/schemas/fileResourceSchema.ts
|
|
47
|
+
//#region ../../src/api-files/schemas/fileResourceSchema.ts
|
|
48
48
|
const fileResourceSchema = t.extend(files.schema, {}, {
|
|
49
49
|
title: "FileResource",
|
|
50
50
|
description: "A file resource representing a file stored in the system."
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
//#endregion
|
|
54
|
-
//#region src/api-files/schemas/storageStatsSchema.ts
|
|
54
|
+
//#region ../../src/api-files/schemas/storageStatsSchema.ts
|
|
55
55
|
const bucketStatsSchema = t.object({
|
|
56
56
|
bucket: t.string(),
|
|
57
57
|
totalSize: t.number(),
|
|
@@ -69,7 +69,7 @@ const storageStatsSchema = t.object({
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
72
|
-
//#region src/api-files/index.browser.ts
|
|
72
|
+
//#region ../../src/api-files/index.browser.ts
|
|
73
73
|
const AlephaApiFiles = $module({
|
|
74
74
|
name: "alepha.api.files",
|
|
75
75
|
services: []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha160 from "alepha";
|
|
2
2
|
import { Alepha, FileLike, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
3
|
import { BucketPrimitive } from "alepha/bucket";
|
|
4
|
-
import * as
|
|
4
|
+
import * as alepha_orm64 from "alepha/orm";
|
|
5
5
|
import { Page } from "alepha/orm";
|
|
6
6
|
import * as alepha_server0 from "alepha/server";
|
|
7
7
|
import { Ok } from "alepha/server";
|
|
@@ -17,42 +17,42 @@ import "drizzle-orm/postgres-js";
|
|
|
17
17
|
import "postgres";
|
|
18
18
|
import "drizzle-orm/sqlite-core";
|
|
19
19
|
|
|
20
|
-
//#region src/api-files/entities/files.d.ts
|
|
21
|
-
declare const files:
|
|
22
|
-
id:
|
|
23
|
-
version:
|
|
24
|
-
createdAt:
|
|
25
|
-
updatedAt:
|
|
26
|
-
blobId:
|
|
27
|
-
creator:
|
|
28
|
-
creatorRealm:
|
|
29
|
-
creatorName:
|
|
30
|
-
bucket:
|
|
31
|
-
expirationDate:
|
|
32
|
-
name:
|
|
33
|
-
size:
|
|
34
|
-
mimeType:
|
|
35
|
-
tags:
|
|
36
|
-
checksum:
|
|
20
|
+
//#region ../../src/api-files/entities/files.d.ts
|
|
21
|
+
declare const files: alepha_orm64.EntityPrimitive<alepha160.TObject<{
|
|
22
|
+
id: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_PRIMARY_KEY>, typeof alepha_orm64.PG_DEFAULT>;
|
|
23
|
+
version: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TInteger, typeof alepha_orm64.PG_VERSION>, typeof alepha_orm64.PG_DEFAULT>;
|
|
24
|
+
createdAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_CREATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
25
|
+
updatedAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_UPDATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
26
|
+
blobId: alepha160.TString;
|
|
27
|
+
creator: alepha160.TOptional<alepha160.TString>;
|
|
28
|
+
creatorRealm: alepha160.TOptional<alepha160.TString>;
|
|
29
|
+
creatorName: alepha160.TOptional<alepha160.TString>;
|
|
30
|
+
bucket: alepha160.TString;
|
|
31
|
+
expirationDate: alepha160.TOptional<alepha160.TString>;
|
|
32
|
+
name: alepha160.TString;
|
|
33
|
+
size: alepha160.TNumber;
|
|
34
|
+
mimeType: alepha160.TString;
|
|
35
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
36
|
+
checksum: alepha160.TOptional<alepha160.TString>;
|
|
37
37
|
}>>;
|
|
38
38
|
type FileEntity = Static<typeof files.schema>;
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region src/api-files/schemas/fileQuerySchema.d.ts
|
|
41
|
-
declare const fileQuerySchema:
|
|
42
|
-
page:
|
|
43
|
-
size:
|
|
44
|
-
sort:
|
|
45
|
-
bucket:
|
|
46
|
-
tags:
|
|
47
|
-
name:
|
|
48
|
-
mimeType:
|
|
49
|
-
creator:
|
|
50
|
-
createdAfter:
|
|
51
|
-
createdBefore:
|
|
40
|
+
//#region ../../src/api-files/schemas/fileQuerySchema.d.ts
|
|
41
|
+
declare const fileQuerySchema: alepha160.TObject<{
|
|
42
|
+
page: alepha160.TOptional<alepha160.TInteger>;
|
|
43
|
+
size: alepha160.TOptional<alepha160.TInteger>;
|
|
44
|
+
sort: alepha160.TOptional<alepha160.TString>;
|
|
45
|
+
bucket: alepha160.TOptional<alepha160.TString>;
|
|
46
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
47
|
+
name: alepha160.TOptional<alepha160.TString>;
|
|
48
|
+
mimeType: alepha160.TOptional<alepha160.TString>;
|
|
49
|
+
creator: alepha160.TOptional<alepha160.TString>;
|
|
50
|
+
createdAfter: alepha160.TOptional<alepha160.TString>;
|
|
51
|
+
createdBefore: alepha160.TOptional<alepha160.TString>;
|
|
52
52
|
}>;
|
|
53
53
|
type FileQuery = Static<typeof fileQuerySchema>;
|
|
54
54
|
//#endregion
|
|
55
|
-
//#region src/orm/schemas/insertSchema.d.ts
|
|
55
|
+
//#region ../../src/orm/schemas/insertSchema.d.ts
|
|
56
56
|
/**
|
|
57
57
|
* Transforms a TObject schema for insert operations.
|
|
58
58
|
* All default properties at the root level are made optional.
|
|
@@ -67,7 +67,7 @@ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
|
|
|
67
67
|
"~optional": true;
|
|
68
68
|
} ? TOptional<T["properties"][K]> : T["properties"][K] }>;
|
|
69
69
|
//#endregion
|
|
70
|
-
//#region src/orm/schemas/updateSchema.d.ts
|
|
70
|
+
//#region ../../src/orm/schemas/updateSchema.d.ts
|
|
71
71
|
/**
|
|
72
72
|
* Transforms a TObject schema for update operations.
|
|
73
73
|
* All optional properties at the root level are made nullable (i.e., `T | null`).
|
|
@@ -79,7 +79,7 @@ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
|
|
|
79
79
|
*/
|
|
80
80
|
type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]: T["properties"][K] extends TOptional<infer U> ? TOptional<TUnion<[U, TNull]>> : T["properties"][K] }>;
|
|
81
81
|
//#endregion
|
|
82
|
-
//#region src/orm/primitives/$entity.d.ts
|
|
82
|
+
//#region ../../src/orm/primitives/$entity.d.ts
|
|
83
83
|
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
84
84
|
/**
|
|
85
85
|
* The database table name that will be created for this entity.
|
|
@@ -212,7 +212,7 @@ type EntityColumn<T extends TObject> = {
|
|
|
212
212
|
};
|
|
213
213
|
type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T> };
|
|
214
214
|
//#endregion
|
|
215
|
-
//#region src/orm/constants/PG_SYMBOLS.d.ts
|
|
215
|
+
//#region ../../src/orm/constants/PG_SYMBOLS.d.ts
|
|
216
216
|
declare const PG_DEFAULT: unique symbol;
|
|
217
217
|
declare const PG_PRIMARY_KEY: unique symbol;
|
|
218
218
|
declare const PG_CREATED_AT: unique symbol;
|
|
@@ -262,17 +262,17 @@ interface PgRefOptions {
|
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
//#endregion
|
|
265
|
-
//#region src/orm/helpers/pgAttr.d.ts
|
|
265
|
+
//#region ../../src/orm/helpers/pgAttr.d.ts
|
|
266
266
|
/**
|
|
267
267
|
* Type representation.
|
|
268
268
|
*/
|
|
269
269
|
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
270
270
|
//#endregion
|
|
271
|
-
//#region src/orm/providers/drivers/NodePostgresProvider.d.ts
|
|
271
|
+
//#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
|
|
272
272
|
declare module "alepha" {
|
|
273
273
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
274
274
|
}
|
|
275
|
-
declare const envSchema:
|
|
275
|
+
declare const envSchema: alepha160.TObject<{
|
|
276
276
|
/**
|
|
277
277
|
* Main configuration for database connection.
|
|
278
278
|
* Accept a string in the format of a Postgres connection URL.
|
|
@@ -280,21 +280,21 @@ declare const envSchema: alepha135.TObject<{
|
|
|
280
280
|
* or
|
|
281
281
|
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
282
282
|
*/
|
|
283
|
-
DATABASE_URL:
|
|
283
|
+
DATABASE_URL: alepha160.TOptional<alepha160.TString>;
|
|
284
284
|
/**
|
|
285
285
|
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
286
286
|
*
|
|
287
287
|
* It will monkey patch drizzle tables.
|
|
288
288
|
*/
|
|
289
|
-
POSTGRES_SCHEMA:
|
|
289
|
+
POSTGRES_SCHEMA: alepha160.TOptional<alepha160.TString>;
|
|
290
290
|
}>;
|
|
291
291
|
//#endregion
|
|
292
|
-
//#region src/orm/providers/drivers/NodeSqliteProvider.d.ts
|
|
292
|
+
//#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
|
|
293
293
|
/**
|
|
294
294
|
* Configuration options for the Node.js SQLite database provider.
|
|
295
295
|
*/
|
|
296
|
-
declare const nodeSqliteOptions:
|
|
297
|
-
path:
|
|
296
|
+
declare const nodeSqliteOptions: alepha160.Atom<alepha160.TObject<{
|
|
297
|
+
path: alepha160.TOptional<alepha160.TString>;
|
|
298
298
|
}>, "alepha.postgres.node-sqlite.options">;
|
|
299
299
|
type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
|
|
300
300
|
declare module "alepha" {
|
|
@@ -309,7 +309,7 @@ declare module "alepha" {
|
|
|
309
309
|
* This is NOT recommended for production use.
|
|
310
310
|
*/
|
|
311
311
|
//#endregion
|
|
312
|
-
//#region src/orm/index.d.ts
|
|
312
|
+
//#region ../../src/orm/index.d.ts
|
|
313
313
|
declare module "alepha" {
|
|
314
314
|
interface Hooks {
|
|
315
315
|
/**
|
|
@@ -377,78 +377,78 @@ declare module "alepha" {
|
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
//#endregion
|
|
380
|
-
//#region src/api-files/schemas/fileResourceSchema.d.ts
|
|
381
|
-
declare const fileResourceSchema:
|
|
382
|
-
id: PgAttr<PgAttr<
|
|
383
|
-
version: PgAttr<PgAttr<
|
|
384
|
-
createdAt: PgAttr<PgAttr<
|
|
385
|
-
updatedAt: PgAttr<PgAttr<
|
|
386
|
-
blobId:
|
|
387
|
-
creator:
|
|
388
|
-
creatorRealm:
|
|
389
|
-
creatorName:
|
|
390
|
-
bucket:
|
|
391
|
-
expirationDate:
|
|
392
|
-
name:
|
|
393
|
-
size:
|
|
394
|
-
mimeType:
|
|
395
|
-
tags:
|
|
396
|
-
checksum:
|
|
380
|
+
//#region ../../src/api-files/schemas/fileResourceSchema.d.ts
|
|
381
|
+
declare const fileResourceSchema: alepha160.TObject<{
|
|
382
|
+
id: PgAttr<PgAttr<alepha160.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
383
|
+
version: PgAttr<PgAttr<alepha160.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
384
|
+
createdAt: PgAttr<PgAttr<alepha160.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
385
|
+
updatedAt: PgAttr<PgAttr<alepha160.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
386
|
+
blobId: alepha160.TString;
|
|
387
|
+
creator: alepha160.TOptional<alepha160.TString>;
|
|
388
|
+
creatorRealm: alepha160.TOptional<alepha160.TString>;
|
|
389
|
+
creatorName: alepha160.TOptional<alepha160.TString>;
|
|
390
|
+
bucket: alepha160.TString;
|
|
391
|
+
expirationDate: alepha160.TOptional<alepha160.TString>;
|
|
392
|
+
name: alepha160.TString;
|
|
393
|
+
size: alepha160.TNumber;
|
|
394
|
+
mimeType: alepha160.TString;
|
|
395
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
396
|
+
checksum: alepha160.TOptional<alepha160.TString>;
|
|
397
397
|
}>;
|
|
398
398
|
type FileResource = Static<typeof fileResourceSchema>;
|
|
399
399
|
//#endregion
|
|
400
|
-
//#region src/api-files/schemas/storageStatsSchema.d.ts
|
|
401
|
-
declare const bucketStatsSchema:
|
|
402
|
-
bucket:
|
|
403
|
-
totalSize:
|
|
404
|
-
fileCount:
|
|
400
|
+
//#region ../../src/api-files/schemas/storageStatsSchema.d.ts
|
|
401
|
+
declare const bucketStatsSchema: alepha160.TObject<{
|
|
402
|
+
bucket: alepha160.TString;
|
|
403
|
+
totalSize: alepha160.TNumber;
|
|
404
|
+
fileCount: alepha160.TNumber;
|
|
405
405
|
}>;
|
|
406
|
-
declare const mimeTypeStatsSchema:
|
|
407
|
-
mimeType:
|
|
408
|
-
fileCount:
|
|
406
|
+
declare const mimeTypeStatsSchema: alepha160.TObject<{
|
|
407
|
+
mimeType: alepha160.TString;
|
|
408
|
+
fileCount: alepha160.TNumber;
|
|
409
409
|
}>;
|
|
410
|
-
declare const storageStatsSchema:
|
|
411
|
-
totalSize:
|
|
412
|
-
totalFiles:
|
|
413
|
-
byBucket:
|
|
414
|
-
bucket:
|
|
415
|
-
totalSize:
|
|
416
|
-
fileCount:
|
|
410
|
+
declare const storageStatsSchema: alepha160.TObject<{
|
|
411
|
+
totalSize: alepha160.TNumber;
|
|
412
|
+
totalFiles: alepha160.TNumber;
|
|
413
|
+
byBucket: alepha160.TArray<alepha160.TObject<{
|
|
414
|
+
bucket: alepha160.TString;
|
|
415
|
+
totalSize: alepha160.TNumber;
|
|
416
|
+
fileCount: alepha160.TNumber;
|
|
417
417
|
}>>;
|
|
418
|
-
byMimeType:
|
|
419
|
-
mimeType:
|
|
420
|
-
fileCount:
|
|
418
|
+
byMimeType: alepha160.TArray<alepha160.TObject<{
|
|
419
|
+
mimeType: alepha160.TString;
|
|
420
|
+
fileCount: alepha160.TNumber;
|
|
421
421
|
}>>;
|
|
422
422
|
}>;
|
|
423
423
|
type BucketStats = Static<typeof bucketStatsSchema>;
|
|
424
424
|
type MimeTypeStats = Static<typeof mimeTypeStatsSchema>;
|
|
425
425
|
type StorageStats = Static<typeof storageStatsSchema>;
|
|
426
426
|
//#endregion
|
|
427
|
-
//#region src/api-files/services/FileService.d.ts
|
|
427
|
+
//#region ../../src/api-files/services/FileService.d.ts
|
|
428
428
|
declare class FileService {
|
|
429
429
|
protected readonly alepha: Alepha;
|
|
430
430
|
protected readonly log: alepha_logger0.Logger;
|
|
431
|
-
protected readonly fileRepository:
|
|
432
|
-
id:
|
|
433
|
-
version:
|
|
434
|
-
createdAt:
|
|
435
|
-
updatedAt:
|
|
436
|
-
blobId:
|
|
437
|
-
creator:
|
|
438
|
-
creatorRealm:
|
|
439
|
-
creatorName:
|
|
440
|
-
bucket:
|
|
441
|
-
expirationDate:
|
|
442
|
-
name:
|
|
443
|
-
size:
|
|
444
|
-
mimeType:
|
|
445
|
-
tags:
|
|
446
|
-
checksum:
|
|
431
|
+
protected readonly fileRepository: alepha_orm64.Repository<alepha160.TObject<{
|
|
432
|
+
id: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_PRIMARY_KEY>, typeof alepha_orm64.PG_DEFAULT>;
|
|
433
|
+
version: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TInteger, typeof alepha_orm64.PG_VERSION>, typeof alepha_orm64.PG_DEFAULT>;
|
|
434
|
+
createdAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_CREATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
435
|
+
updatedAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_UPDATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
436
|
+
blobId: alepha160.TString;
|
|
437
|
+
creator: alepha160.TOptional<alepha160.TString>;
|
|
438
|
+
creatorRealm: alepha160.TOptional<alepha160.TString>;
|
|
439
|
+
creatorName: alepha160.TOptional<alepha160.TString>;
|
|
440
|
+
bucket: alepha160.TString;
|
|
441
|
+
expirationDate: alepha160.TOptional<alepha160.TString>;
|
|
442
|
+
name: alepha160.TString;
|
|
443
|
+
size: alepha160.TNumber;
|
|
444
|
+
mimeType: alepha160.TString;
|
|
445
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
446
|
+
checksum: alepha160.TOptional<alepha160.TString>;
|
|
447
447
|
}>>;
|
|
448
448
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
449
449
|
protected readonly defaultBucket: BucketPrimitive;
|
|
450
|
-
protected onUploadFile:
|
|
451
|
-
protected onDeleteBucketFile:
|
|
450
|
+
protected onUploadFile: alepha160.HookPrimitive<"bucket:file:uploaded">;
|
|
451
|
+
protected onDeleteBucketFile: alepha160.HookPrimitive<"bucket:file:deleted">;
|
|
452
452
|
/**
|
|
453
453
|
* Calculates SHA-256 checksum of a file.
|
|
454
454
|
*
|
|
@@ -568,7 +568,7 @@ declare class FileService {
|
|
|
568
568
|
entityToResource(entity: FileEntity): FileResource;
|
|
569
569
|
}
|
|
570
570
|
//#endregion
|
|
571
|
-
//#region src/api-files/controllers/FileController.d.ts
|
|
571
|
+
//#region ../../src/api-files/controllers/FileController.d.ts
|
|
572
572
|
/**
|
|
573
573
|
* REST API controller for file management operations.
|
|
574
574
|
* Provides endpoints for uploading, downloading, listing, and deleting files.
|
|
@@ -582,34 +582,34 @@ declare class FileController {
|
|
|
582
582
|
* Supports filtering by bucket and tags.
|
|
583
583
|
*/
|
|
584
584
|
readonly findFiles: alepha_server0.ActionPrimitiveFn<{
|
|
585
|
-
query:
|
|
586
|
-
page:
|
|
587
|
-
size:
|
|
588
|
-
sort:
|
|
589
|
-
bucket:
|
|
590
|
-
tags:
|
|
591
|
-
name:
|
|
592
|
-
mimeType:
|
|
593
|
-
creator:
|
|
594
|
-
createdAfter:
|
|
595
|
-
createdBefore:
|
|
585
|
+
query: alepha160.TObject<{
|
|
586
|
+
page: alepha160.TOptional<alepha160.TInteger>;
|
|
587
|
+
size: alepha160.TOptional<alepha160.TInteger>;
|
|
588
|
+
sort: alepha160.TOptional<alepha160.TString>;
|
|
589
|
+
bucket: alepha160.TOptional<alepha160.TString>;
|
|
590
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
591
|
+
name: alepha160.TOptional<alepha160.TString>;
|
|
592
|
+
mimeType: alepha160.TOptional<alepha160.TString>;
|
|
593
|
+
creator: alepha160.TOptional<alepha160.TString>;
|
|
594
|
+
createdAfter: alepha160.TOptional<alepha160.TString>;
|
|
595
|
+
createdBefore: alepha160.TOptional<alepha160.TString>;
|
|
596
596
|
}>;
|
|
597
|
-
response:
|
|
598
|
-
id:
|
|
599
|
-
version:
|
|
600
|
-
createdAt:
|
|
601
|
-
updatedAt:
|
|
602
|
-
blobId:
|
|
603
|
-
creator:
|
|
604
|
-
creatorRealm:
|
|
605
|
-
creatorName:
|
|
606
|
-
bucket:
|
|
607
|
-
expirationDate:
|
|
608
|
-
name:
|
|
609
|
-
size:
|
|
610
|
-
mimeType:
|
|
611
|
-
tags:
|
|
612
|
-
checksum:
|
|
597
|
+
response: alepha160.TPage<alepha160.TObject<{
|
|
598
|
+
id: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_PRIMARY_KEY>, typeof alepha_orm64.PG_DEFAULT>;
|
|
599
|
+
version: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TInteger, typeof alepha_orm64.PG_VERSION>, typeof alepha_orm64.PG_DEFAULT>;
|
|
600
|
+
createdAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_CREATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
601
|
+
updatedAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_UPDATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
602
|
+
blobId: alepha160.TString;
|
|
603
|
+
creator: alepha160.TOptional<alepha160.TString>;
|
|
604
|
+
creatorRealm: alepha160.TOptional<alepha160.TString>;
|
|
605
|
+
creatorName: alepha160.TOptional<alepha160.TString>;
|
|
606
|
+
bucket: alepha160.TString;
|
|
607
|
+
expirationDate: alepha160.TOptional<alepha160.TString>;
|
|
608
|
+
name: alepha160.TString;
|
|
609
|
+
size: alepha160.TNumber;
|
|
610
|
+
mimeType: alepha160.TString;
|
|
611
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
612
|
+
checksum: alepha160.TOptional<alepha160.TString>;
|
|
613
613
|
}>>;
|
|
614
614
|
}>;
|
|
615
615
|
/**
|
|
@@ -617,13 +617,13 @@ declare class FileController {
|
|
|
617
617
|
* Removes the file from the bucket and cleans up the database record.
|
|
618
618
|
*/
|
|
619
619
|
readonly deleteFile: alepha_server0.ActionPrimitiveFn<{
|
|
620
|
-
params:
|
|
621
|
-
id:
|
|
620
|
+
params: alepha160.TObject<{
|
|
621
|
+
id: alepha160.TString;
|
|
622
622
|
}>;
|
|
623
|
-
response:
|
|
624
|
-
ok:
|
|
625
|
-
id:
|
|
626
|
-
count:
|
|
623
|
+
response: alepha160.TObject<{
|
|
624
|
+
ok: alepha160.TBoolean;
|
|
625
|
+
id: alepha160.TOptional<alepha160.TUnion<[alepha160.TString, alepha160.TInteger]>>;
|
|
626
|
+
count: alepha160.TOptional<alepha160.TNumber>;
|
|
627
627
|
}>;
|
|
628
628
|
}>;
|
|
629
629
|
/**
|
|
@@ -632,29 +632,29 @@ declare class FileController {
|
|
|
632
632
|
* Optionally specify bucket and expiration date.
|
|
633
633
|
*/
|
|
634
634
|
readonly uploadFile: alepha_server0.ActionPrimitiveFn<{
|
|
635
|
-
body:
|
|
636
|
-
file:
|
|
635
|
+
body: alepha160.TObject<{
|
|
636
|
+
file: alepha160.TFile;
|
|
637
637
|
}>;
|
|
638
|
-
query:
|
|
639
|
-
expirationDate:
|
|
640
|
-
bucket:
|
|
638
|
+
query: alepha160.TObject<{
|
|
639
|
+
expirationDate: alepha160.TOptional<alepha160.TString>;
|
|
640
|
+
bucket: alepha160.TOptional<alepha160.TString>;
|
|
641
641
|
}>;
|
|
642
|
-
response:
|
|
643
|
-
id:
|
|
644
|
-
version:
|
|
645
|
-
createdAt:
|
|
646
|
-
updatedAt:
|
|
647
|
-
blobId:
|
|
648
|
-
creator:
|
|
649
|
-
creatorRealm:
|
|
650
|
-
creatorName:
|
|
651
|
-
bucket:
|
|
652
|
-
expirationDate:
|
|
653
|
-
name:
|
|
654
|
-
size:
|
|
655
|
-
mimeType:
|
|
656
|
-
tags:
|
|
657
|
-
checksum:
|
|
642
|
+
response: alepha160.TObject<{
|
|
643
|
+
id: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_PRIMARY_KEY>, typeof alepha_orm64.PG_DEFAULT>;
|
|
644
|
+
version: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TInteger, typeof alepha_orm64.PG_VERSION>, typeof alepha_orm64.PG_DEFAULT>;
|
|
645
|
+
createdAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_CREATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
646
|
+
updatedAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_UPDATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
647
|
+
blobId: alepha160.TString;
|
|
648
|
+
creator: alepha160.TOptional<alepha160.TString>;
|
|
649
|
+
creatorRealm: alepha160.TOptional<alepha160.TString>;
|
|
650
|
+
creatorName: alepha160.TOptional<alepha160.TString>;
|
|
651
|
+
bucket: alepha160.TString;
|
|
652
|
+
expirationDate: alepha160.TOptional<alepha160.TString>;
|
|
653
|
+
name: alepha160.TString;
|
|
654
|
+
size: alepha160.TNumber;
|
|
655
|
+
mimeType: alepha160.TString;
|
|
656
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
657
|
+
checksum: alepha160.TOptional<alepha160.TString>;
|
|
658
658
|
}>;
|
|
659
659
|
}>;
|
|
660
660
|
/**
|
|
@@ -662,30 +662,30 @@ declare class FileController {
|
|
|
662
662
|
* Allows updating name, tags, and expiration date without modifying file content.
|
|
663
663
|
*/
|
|
664
664
|
readonly updateFile: alepha_server0.ActionPrimitiveFn<{
|
|
665
|
-
params:
|
|
666
|
-
id:
|
|
665
|
+
params: alepha160.TObject<{
|
|
666
|
+
id: alepha160.TString;
|
|
667
667
|
}>;
|
|
668
|
-
body:
|
|
669
|
-
name:
|
|
670
|
-
tags:
|
|
671
|
-
expirationDate:
|
|
668
|
+
body: alepha160.TObject<{
|
|
669
|
+
name: alepha160.TOptional<alepha160.TString>;
|
|
670
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
671
|
+
expirationDate: alepha160.TOptional<alepha160.TString>;
|
|
672
672
|
}>;
|
|
673
|
-
response:
|
|
674
|
-
id:
|
|
675
|
-
version:
|
|
676
|
-
createdAt:
|
|
677
|
-
updatedAt:
|
|
678
|
-
blobId:
|
|
679
|
-
creator:
|
|
680
|
-
creatorRealm:
|
|
681
|
-
creatorName:
|
|
682
|
-
bucket:
|
|
683
|
-
expirationDate:
|
|
684
|
-
name:
|
|
685
|
-
size:
|
|
686
|
-
mimeType:
|
|
687
|
-
tags:
|
|
688
|
-
checksum:
|
|
673
|
+
response: alepha160.TObject<{
|
|
674
|
+
id: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_PRIMARY_KEY>, typeof alepha_orm64.PG_DEFAULT>;
|
|
675
|
+
version: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TInteger, typeof alepha_orm64.PG_VERSION>, typeof alepha_orm64.PG_DEFAULT>;
|
|
676
|
+
createdAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_CREATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
677
|
+
updatedAt: alepha_orm64.PgAttr<alepha_orm64.PgAttr<alepha160.TString, typeof alepha_orm64.PG_UPDATED_AT>, typeof alepha_orm64.PG_DEFAULT>;
|
|
678
|
+
blobId: alepha160.TString;
|
|
679
|
+
creator: alepha160.TOptional<alepha160.TString>;
|
|
680
|
+
creatorRealm: alepha160.TOptional<alepha160.TString>;
|
|
681
|
+
creatorName: alepha160.TOptional<alepha160.TString>;
|
|
682
|
+
bucket: alepha160.TString;
|
|
683
|
+
expirationDate: alepha160.TOptional<alepha160.TString>;
|
|
684
|
+
name: alepha160.TString;
|
|
685
|
+
size: alepha160.TNumber;
|
|
686
|
+
mimeType: alepha160.TString;
|
|
687
|
+
tags: alepha160.TOptional<alepha160.TArray<alepha160.TString>>;
|
|
688
|
+
checksum: alepha160.TOptional<alepha160.TString>;
|
|
689
689
|
}>;
|
|
690
690
|
}>;
|
|
691
691
|
/**
|
|
@@ -694,14 +694,14 @@ declare class FileController {
|
|
|
694
694
|
* Cached with ETag support for 1 year (immutable).
|
|
695
695
|
*/
|
|
696
696
|
readonly streamFile: alepha_server0.ActionPrimitiveFn<{
|
|
697
|
-
params:
|
|
698
|
-
id:
|
|
697
|
+
params: alepha160.TObject<{
|
|
698
|
+
id: alepha160.TString;
|
|
699
699
|
}>;
|
|
700
|
-
response:
|
|
700
|
+
response: alepha160.TFile;
|
|
701
701
|
}>;
|
|
702
702
|
}
|
|
703
703
|
//#endregion
|
|
704
|
-
//#region src/api-files/controllers/StorageStatsController.d.ts
|
|
704
|
+
//#region ../../src/api-files/controllers/StorageStatsController.d.ts
|
|
705
705
|
/**
|
|
706
706
|
* REST API controller for storage analytics and statistics.
|
|
707
707
|
* Provides endpoints for viewing storage usage metrics.
|
|
@@ -716,23 +716,23 @@ declare class StorageStatsController {
|
|
|
716
716
|
* and breakdowns by bucket and MIME type.
|
|
717
717
|
*/
|
|
718
718
|
readonly getStats: alepha_server0.ActionPrimitiveFn<{
|
|
719
|
-
response:
|
|
720
|
-
totalSize:
|
|
721
|
-
totalFiles:
|
|
722
|
-
byBucket:
|
|
723
|
-
bucket:
|
|
724
|
-
totalSize:
|
|
725
|
-
fileCount:
|
|
719
|
+
response: alepha160.TObject<{
|
|
720
|
+
totalSize: alepha160.TNumber;
|
|
721
|
+
totalFiles: alepha160.TNumber;
|
|
722
|
+
byBucket: alepha160.TArray<alepha160.TObject<{
|
|
723
|
+
bucket: alepha160.TString;
|
|
724
|
+
totalSize: alepha160.TNumber;
|
|
725
|
+
fileCount: alepha160.TNumber;
|
|
726
726
|
}>>;
|
|
727
|
-
byMimeType:
|
|
728
|
-
mimeType:
|
|
729
|
-
fileCount:
|
|
727
|
+
byMimeType: alepha160.TArray<alepha160.TObject<{
|
|
728
|
+
mimeType: alepha160.TString;
|
|
729
|
+
fileCount: alepha160.TNumber;
|
|
730
730
|
}>>;
|
|
731
731
|
}>;
|
|
732
732
|
}>;
|
|
733
733
|
}
|
|
734
734
|
//#endregion
|
|
735
|
-
//#region src/api-files/index.d.ts
|
|
735
|
+
//#region ../../src/api-files/index.d.ts
|
|
736
736
|
declare module "alepha/bucket" {
|
|
737
737
|
interface BucketFileOptions {
|
|
738
738
|
/**
|
|
@@ -763,7 +763,7 @@ declare module "alepha/bucket" {
|
|
|
763
763
|
*
|
|
764
764
|
* @module alepha.api.files
|
|
765
765
|
*/
|
|
766
|
-
declare const AlephaApiFiles:
|
|
766
|
+
declare const AlephaApiFiles: alepha160.Service<alepha160.Module>;
|
|
767
767
|
//#endregion
|
|
768
768
|
export { AlephaApiFiles, BucketStats, FileController, FileEntity, FileService, MimeTypeStats, StorageStats, StorageStatsController, bucketStatsSchema, files, mimeTypeStatsSchema, storageStatsSchema };
|
|
769
769
|
//# sourceMappingURL=index.d.ts.map
|