alepha 0.14.3 → 0.15.0
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 +2 -5
- package/dist/api/audits/index.d.ts +620 -811
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/files/index.d.ts +185 -377
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +0 -1
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +245 -435
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/notifications/index.d.ts +238 -429
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/parameters/index.d.ts +236 -427
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/users/index.browser.js +1 -2
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +1010 -1196
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +178 -151
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +17 -17
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/batch/index.d.ts +122 -122
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +1 -2
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +163 -163
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/cache/core/index.d.ts +46 -46
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cli/index.d.ts +384 -285
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1113 -623
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +299 -300
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +13 -9
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +445 -103
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +733 -625
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +446 -103
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +445 -103
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.d.ts +44 -44
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +4 -4
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +97 -50
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +129 -33
- package/dist/email/index.js.map +1 -1
- package/dist/fake/index.d.ts +7981 -14
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/file/index.d.ts +523 -390
- package/dist/file/index.d.ts.map +1 -1
- package/dist/file/index.js +253 -1
- package/dist/file/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +208 -208
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/logger/index.d.ts +25 -26
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +12 -2
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +197 -197
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/chunk-DtkW-qnP.js +38 -0
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.bun.js +2814 -0
- package/dist/orm/index.bun.js.map +1 -0
- package/dist/orm/index.d.ts +1228 -1216
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +2041 -1967
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +248 -248
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/redis/index.bun.js +285 -0
- package/dist/redis/index.bun.js.map +1 -0
- package/dist/redis/index.d.ts +118 -136
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +18 -38
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +69 -69
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/router/index.d.ts +6 -6
- package/dist/router/index.d.ts.map +1 -1
- package/dist/scheduler/index.d.ts +25 -25
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/security/index.browser.js +5 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +417 -254
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +386 -86
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +110 -110
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +20 -20
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.d.ts +62 -47
- package/dist/server/cache/index.d.ts.map +1 -1
- package/dist/server/cache/index.js +56 -3
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/compress/index.d.ts +6 -0
- package/dist/server/compress/index.d.ts.map +1 -1
- package/dist/server/compress/index.js +36 -1
- package/dist/server/compress/index.js.map +1 -1
- package/dist/server/cookies/index.d.ts +6 -6
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +3 -3
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js +2 -2
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.d.ts +242 -150
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +294 -125
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +11 -12
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/health/index.d.ts +0 -1
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/helmet/index.d.ts +2 -2
- package/dist/server/helmet/index.d.ts.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +123 -124
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +1 -2
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/multipart/index.d.ts +6 -6
- package/dist/server/multipart/index.d.ts.map +1 -1
- package/dist/server/proxy/index.d.ts +102 -103
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.d.ts +16 -16
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/static/index.d.ts +44 -44
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/static/index.js +4 -0
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +48 -49
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +3 -5
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +13 -11
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js +7 -7
- package/dist/sms/index.js.map +1 -1
- package/dist/thread/index.d.ts +71 -72
- package/dist/thread/index.d.ts.map +1 -1
- package/dist/topic/core/index.d.ts +318 -318
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/redis/index.d.ts +6 -6
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/vite/index.d.ts +5805 -249
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +599 -513
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js +6 -6
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +247 -247
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +6 -6
- package/dist/websocket/index.js.map +1 -1
- package/package.json +9 -14
- package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
- package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
- package/src/api/users/entities/users.ts +1 -1
- package/src/api/users/index.ts +8 -8
- package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
- package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
- package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
- package/src/api/users/services/CredentialService.ts +7 -7
- package/src/api/users/services/IdentityService.ts +4 -4
- package/src/api/users/services/RegistrationService.spec.ts +25 -27
- package/src/api/users/services/RegistrationService.ts +38 -27
- package/src/api/users/services/SessionCrudService.ts +3 -3
- package/src/api/users/services/SessionService.spec.ts +3 -3
- package/src/api/users/services/SessionService.ts +28 -9
- package/src/api/users/services/UserService.ts +7 -7
- package/src/batch/providers/BatchProvider.ts +1 -2
- package/src/cli/apps/AlephaCli.ts +0 -2
- package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
- package/src/cli/assets/apiHelloControllerTs.ts +18 -0
- package/src/cli/assets/apiIndexTs.ts +16 -0
- package/src/cli/assets/claudeMd.ts +303 -0
- package/src/cli/assets/mainBrowserTs.ts +2 -2
- package/src/cli/assets/mainServerTs.ts +24 -0
- package/src/cli/assets/webAppRouterTs.ts +15 -0
- package/src/cli/assets/webHelloComponentTsx.ts +16 -0
- package/src/cli/assets/webIndexTs.ts +16 -0
- package/src/cli/atoms/buildOptions.ts +88 -0
- package/src/cli/commands/build.ts +70 -87
- package/src/cli/commands/db.ts +21 -22
- package/src/cli/commands/deploy.ts +17 -5
- package/src/cli/commands/dev.ts +22 -14
- package/src/cli/commands/format.ts +8 -2
- package/src/cli/commands/gen/env.ts +53 -0
- package/src/cli/commands/gen/openapi.ts +1 -1
- package/src/cli/commands/gen/resource.ts +15 -0
- package/src/cli/commands/gen.ts +7 -1
- package/src/cli/commands/init.ts +74 -30
- package/src/cli/commands/lint.ts +8 -2
- package/src/cli/commands/test.ts +8 -3
- package/src/cli/commands/typecheck.ts +5 -1
- package/src/cli/commands/verify.ts +5 -3
- package/src/cli/defineConfig.ts +49 -7
- package/src/cli/index.ts +0 -1
- package/src/cli/services/AlephaCliUtils.ts +39 -589
- package/src/cli/services/PackageManagerUtils.ts +301 -0
- package/src/cli/services/ProjectScaffolder.ts +306 -0
- package/src/command/helpers/Runner.spec.ts +2 -2
- package/src/command/helpers/Runner.ts +16 -4
- package/src/command/primitives/$command.ts +0 -6
- package/src/command/providers/CliProvider.ts +1 -3
- package/src/core/Alepha.ts +42 -0
- package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
- package/src/core/index.shared.ts +1 -0
- package/src/core/index.ts +2 -0
- package/src/core/primitives/$hook.ts +6 -2
- package/src/core/primitives/$module.spec.ts +4 -0
- package/src/core/providers/AlsProvider.ts +1 -1
- package/src/core/providers/CodecManager.spec.ts +12 -6
- package/src/core/providers/CodecManager.ts +26 -6
- package/src/core/providers/EventManager.ts +169 -13
- package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
- package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
- package/src/core/providers/StateManager.spec.ts +27 -16
- package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
- package/src/email/providers/LocalEmailProvider.ts +52 -15
- package/src/email/providers/NodemailerEmailProvider.ts +167 -56
- package/src/file/errors/FileError.ts +7 -0
- package/src/file/index.ts +9 -1
- package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
- package/src/logger/index.ts +15 -3
- package/src/mcp/transports/StdioMcpTransport.ts +1 -1
- package/src/orm/index.browser.ts +1 -19
- package/src/orm/index.bun.ts +77 -0
- package/src/orm/index.shared-server.ts +22 -0
- package/src/orm/index.shared.ts +15 -0
- package/src/orm/index.ts +13 -39
- package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
- package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
- package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
- package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
- package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
- package/src/orm/services/Repository.ts +8 -0
- package/src/queue/core/providers/WorkerProvider.spec.ts +48 -32
- package/src/redis/index.bun.ts +35 -0
- package/src/redis/providers/BunRedisProvider.ts +12 -43
- package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
- package/src/redis/providers/NodeRedisProvider.ts +16 -34
- package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
- package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
- package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
- package/src/security/index.browser.ts +5 -0
- package/src/security/index.ts +90 -7
- package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
- package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
- package/src/security/primitives/$role.ts +5 -5
- package/src/security/primitives/$serviceAccount.spec.ts +5 -5
- package/src/security/primitives/$serviceAccount.ts +3 -3
- package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
- package/src/server/auth/primitives/$auth.ts +10 -10
- package/src/server/auth/primitives/$authCredentials.ts +3 -3
- package/src/server/auth/primitives/$authGithub.ts +3 -3
- package/src/server/auth/primitives/$authGoogle.ts +3 -3
- package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
- package/src/server/cache/providers/ServerCacheProvider.spec.ts +183 -0
- package/src/server/cache/providers/ServerCacheProvider.ts +95 -10
- package/src/server/compress/providers/ServerCompressProvider.ts +61 -2
- package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
- package/src/server/core/helpers/ServerReply.ts +2 -2
- package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
- package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
- package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
- package/src/server/core/providers/ServerProvider.ts +155 -22
- package/src/server/core/providers/ServerRouterProvider.ts +259 -115
- package/src/server/core/providers/ServerTimingProvider.ts +2 -2
- package/src/server/links/index.ts +1 -1
- package/src/server/links/providers/LinkProvider.ts +1 -1
- package/src/server/static/providers/ServerStaticProvider.ts +10 -0
- package/src/server/swagger/index.ts +1 -1
- package/src/server/swagger/providers/ServerSwaggerProvider.ts +5 -8
- package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
- package/src/sms/providers/LocalSmsProvider.ts +8 -7
- package/src/vite/helpers/boot.ts +28 -17
- package/src/vite/helpers/importViteReact.ts +13 -0
- package/src/vite/index.ts +1 -21
- package/src/vite/plugins/viteAlephaDev.ts +16 -1
- package/src/vite/plugins/viteAlephaSsrPreload.ts +222 -0
- package/src/vite/tasks/buildClient.ts +11 -0
- package/src/vite/tasks/buildServer.ts +59 -4
- package/src/vite/tasks/devServer.ts +71 -0
- package/src/vite/tasks/generateCloudflare.ts +7 -0
- package/src/vite/tasks/index.ts +2 -1
- package/dist/server/security/index.browser.js +0 -13
- package/dist/server/security/index.browser.js.map +0 -1
- package/dist/server/security/index.d.ts +0 -173
- package/dist/server/security/index.d.ts.map +0 -1
- package/dist/server/security/index.js +0 -311
- package/dist/server/security/index.js.map +0 -1
- package/src/cli/assets/appRouterTs.ts +0 -9
- package/src/cli/assets/mainTs.ts +0 -13
- package/src/cli/assets/viteConfigTs.ts +0 -14
- package/src/cli/commands/run.ts +0 -24
- package/src/server/security/index.browser.ts +0 -10
- package/src/server/security/index.ts +0 -94
- package/src/vite/plugins/viteAlepha.ts +0 -37
- package/src/vite/plugins/viteAlephaBuild.ts +0 -281
- /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
- /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
package/dist/api/jobs/index.d.ts
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha151 from "alepha";
|
|
2
2
|
import { Alepha, Async, KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
3
|
import * as alepha_server0 from "alepha/server";
|
|
4
|
-
import * as
|
|
4
|
+
import * as alepha_orm16 from "alepha/orm";
|
|
5
5
|
import "alepha/logger";
|
|
6
6
|
import { DateTime, DateTimeProvider } from "alepha/datetime";
|
|
7
7
|
import { LockPrimitive } from "alepha/lock";
|
|
8
8
|
import { CronProvider } from "alepha/scheduler";
|
|
9
|
-
import "bun";
|
|
10
|
-
import "bun:sqlite";
|
|
11
|
-
import "drizzle-orm/bun-sql";
|
|
12
|
-
import "drizzle-orm/bun-sqlite";
|
|
13
9
|
import "drizzle-orm/d1";
|
|
14
10
|
import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
|
|
15
11
|
import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
16
12
|
import "alepha/retry";
|
|
17
13
|
import "drizzle-orm/sqlite-core";
|
|
18
|
-
import "drizzle-orm/postgres-js";
|
|
19
|
-
import "postgres";
|
|
20
14
|
|
|
21
15
|
//#region ../../src/orm/schemas/insertSchema.d.ts
|
|
22
16
|
/**
|
|
@@ -48,114 +42,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
|
|
|
48
42
|
//#region ../../src/orm/primitives/$entity.d.ts
|
|
49
43
|
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
50
44
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
* The database table name that will be created for this entity.
|
|
46
|
+
* If not provided, name will be inferred from the $repository variable name.
|
|
47
|
+
*/
|
|
54
48
|
name: string;
|
|
55
49
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
* TypeBox schema defining the table structure and column types.
|
|
51
|
+
*/
|
|
58
52
|
schema: T;
|
|
59
53
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
* Database indexes to create for query optimization.
|
|
55
|
+
*/
|
|
62
56
|
indexes?: (Keys | {
|
|
63
57
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
* Single column to index.
|
|
59
|
+
*/
|
|
66
60
|
column: Keys;
|
|
67
61
|
/**
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
63
|
+
*/
|
|
70
64
|
unique?: boolean;
|
|
71
65
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
67
|
+
*/
|
|
74
68
|
name?: string;
|
|
75
69
|
} | {
|
|
76
70
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
* Multiple columns for composite index (order matters for query optimization).
|
|
72
|
+
*/
|
|
79
73
|
columns: Keys[];
|
|
80
74
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
76
|
+
*/
|
|
83
77
|
unique?: boolean;
|
|
84
78
|
/**
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
80
|
+
*/
|
|
87
81
|
name?: string;
|
|
88
82
|
})[];
|
|
89
83
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
* Foreign key constraints to maintain referential integrity.
|
|
85
|
+
*/
|
|
92
86
|
foreignKeys?: Array<{
|
|
93
87
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
* Optional name for the foreign key constraint.
|
|
89
|
+
*/
|
|
96
90
|
name?: string;
|
|
97
91
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
* Local columns that reference the foreign table.
|
|
93
|
+
*/
|
|
100
94
|
columns: Array<keyof Static<T>>;
|
|
101
95
|
/**
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
* Referenced columns in the foreign table.
|
|
97
|
+
* Must be EntityColumn references from other entities.
|
|
98
|
+
*/
|
|
105
99
|
foreignColumns: Array<() => EntityColumn<any>>;
|
|
106
100
|
}>;
|
|
107
101
|
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
102
|
+
* Additional table constraints for data validation.
|
|
103
|
+
*
|
|
104
|
+
* Constraints enforce business rules at the database level, providing
|
|
105
|
+
* an additional layer of data integrity beyond application validation.
|
|
106
|
+
*
|
|
107
|
+
* **Constraint Types**:
|
|
108
|
+
* - **Unique constraints**: Prevent duplicate values across columns
|
|
109
|
+
* - **Check constraints**: Enforce custom validation rules with SQL expressions
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* constraints: [
|
|
114
|
+
* {
|
|
115
|
+
* name: "unique_user_email",
|
|
116
|
+
* columns: ["email"],
|
|
117
|
+
* unique: true
|
|
118
|
+
* },
|
|
119
|
+
* {
|
|
120
|
+
* name: "valid_age_range",
|
|
121
|
+
* columns: ["age"],
|
|
122
|
+
* check: sql`age >= 0 AND age <= 150`
|
|
123
|
+
* },
|
|
124
|
+
* {
|
|
125
|
+
* name: "unique_user_username_per_tenant",
|
|
126
|
+
* columns: ["tenantId", "username"],
|
|
127
|
+
* unique: true
|
|
128
|
+
* }
|
|
129
|
+
* ]
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
138
132
|
constraints?: Array<{
|
|
139
133
|
/**
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
* Columns involved in this constraint.
|
|
135
|
+
*/
|
|
142
136
|
columns: Array<keyof Static<T>>;
|
|
143
137
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
* Optional name for the constraint.
|
|
139
|
+
*/
|
|
146
140
|
name?: string;
|
|
147
141
|
/**
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
* Whether this is a unique constraint.
|
|
143
|
+
*/
|
|
150
144
|
unique?: boolean | {};
|
|
151
145
|
/**
|
|
152
|
-
|
|
153
|
-
|
|
146
|
+
* SQL expression for check constraint validation.
|
|
147
|
+
*/
|
|
154
148
|
check?: SQL;
|
|
155
149
|
}>;
|
|
156
150
|
/**
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
* Advanced Drizzle ORM configuration for complex table setups.
|
|
152
|
+
*/
|
|
159
153
|
config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
|
|
160
154
|
}
|
|
161
155
|
declare class EntityPrimitive<T extends TObject = TObject> {
|
|
@@ -203,8 +197,8 @@ type PgSymbols = {
|
|
|
203
197
|
[PG_REF]: PgRefOptions;
|
|
204
198
|
[PG_ENUM]: PgEnumOptions;
|
|
205
199
|
/**
|
|
206
|
-
|
|
207
|
-
|
|
200
|
+
* @deprecated Use `PG_IDENTITY` instead.
|
|
201
|
+
*/
|
|
208
202
|
[PG_SERIAL]: {};
|
|
209
203
|
};
|
|
210
204
|
type PgSymbolKeys = keyof PgSymbols;
|
|
@@ -234,261 +228,77 @@ interface PgRefOptions {
|
|
|
234
228
|
*/
|
|
235
229
|
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
236
230
|
//#endregion
|
|
237
|
-
//#region ../../src/orm/providers/drivers/BunPostgresProvider.d.ts
|
|
238
|
-
declare module "alepha" {
|
|
239
|
-
interface Env extends Partial<Static<typeof envSchema$2>> {}
|
|
240
|
-
}
|
|
241
|
-
declare const envSchema$2: alepha225.TObject<{
|
|
242
|
-
/**
|
|
243
|
-
* Main configuration for database connection.
|
|
244
|
-
* Accept a string in the format of a Postgres connection URL.
|
|
245
|
-
* Example: postgres://user:password@localhost:5432/database
|
|
246
|
-
* or
|
|
247
|
-
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
248
|
-
*/
|
|
249
|
-
DATABASE_URL: alepha225.TOptional<alepha225.TString>;
|
|
250
|
-
/**
|
|
251
|
-
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
252
|
-
*/
|
|
253
|
-
POSTGRES_SCHEMA: alepha225.TOptional<alepha225.TString>;
|
|
254
|
-
}>;
|
|
255
|
-
/**
|
|
256
|
-
* Bun PostgreSQL provider using Drizzle ORM with Bun's native SQL client.
|
|
257
|
-
*
|
|
258
|
-
* This provider uses Bun's built-in SQL class for PostgreSQL connections,
|
|
259
|
-
* which provides excellent performance on the Bun runtime.
|
|
260
|
-
*
|
|
261
|
-
* @example
|
|
262
|
-
* ```ts
|
|
263
|
-
* // Set DATABASE_URL environment variable
|
|
264
|
-
* // DATABASE_URL=postgres://user:password@localhost:5432/database
|
|
265
|
-
*
|
|
266
|
-
* // Or configure programmatically
|
|
267
|
-
* alepha.with({
|
|
268
|
-
* provide: DatabaseProvider,
|
|
269
|
-
* use: BunPostgresProvider,
|
|
270
|
-
* });
|
|
271
|
-
* ```
|
|
272
|
-
*/
|
|
273
|
-
//#endregion
|
|
274
|
-
//#region ../../src/orm/providers/drivers/BunSqliteProvider.d.ts
|
|
275
|
-
/**
|
|
276
|
-
* Configuration options for the Bun SQLite database provider.
|
|
277
|
-
*/
|
|
278
|
-
declare const bunSqliteOptions: alepha225.Atom<alepha225.TObject<{
|
|
279
|
-
path: alepha225.TOptional<alepha225.TString>;
|
|
280
|
-
}>, "alepha.postgres.bun-sqlite.options">;
|
|
281
|
-
type BunSqliteProviderOptions = Static<typeof bunSqliteOptions.schema>;
|
|
282
|
-
declare module "alepha" {
|
|
283
|
-
interface State {
|
|
284
|
-
[bunSqliteOptions.key]: BunSqliteProviderOptions;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Bun SQLite provider using Drizzle ORM with Bun's native SQLite client.
|
|
289
|
-
*
|
|
290
|
-
* This provider uses Bun's built-in `bun:sqlite` for SQLite connections,
|
|
291
|
-
* which provides excellent performance on the Bun runtime.
|
|
292
|
-
*
|
|
293
|
-
* @example
|
|
294
|
-
* ```ts
|
|
295
|
-
* // Set DATABASE_URL environment variable
|
|
296
|
-
* // DATABASE_URL=sqlite://./my-database.db
|
|
297
|
-
*
|
|
298
|
-
* // Or configure programmatically
|
|
299
|
-
* alepha.with({
|
|
300
|
-
* provide: DatabaseProvider,
|
|
301
|
-
* use: BunSqliteProvider,
|
|
302
|
-
* });
|
|
303
|
-
*
|
|
304
|
-
* // Or use options atom
|
|
305
|
-
* alepha.store.mut(bunSqliteOptions, (old) => ({
|
|
306
|
-
* ...old,
|
|
307
|
-
* path: ":memory:",
|
|
308
|
-
* }));
|
|
309
|
-
* ```
|
|
310
|
-
*/
|
|
311
|
-
//#endregion
|
|
312
|
-
//#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
|
|
313
|
-
declare module "alepha" {
|
|
314
|
-
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
315
|
-
}
|
|
316
|
-
declare const envSchema$1: alepha225.TObject<{
|
|
317
|
-
/**
|
|
318
|
-
* Main configuration for database connection.
|
|
319
|
-
* Accept a string in the format of a Postgres connection URL.
|
|
320
|
-
* Example: postgres://user:password@localhost:5432/database
|
|
321
|
-
* or
|
|
322
|
-
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
323
|
-
*/
|
|
324
|
-
DATABASE_URL: alepha225.TOptional<alepha225.TString>;
|
|
325
|
-
/**
|
|
326
|
-
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
327
|
-
*
|
|
328
|
-
* It will monkey patch drizzle tables.
|
|
329
|
-
*/
|
|
330
|
-
POSTGRES_SCHEMA: alepha225.TOptional<alepha225.TString>;
|
|
331
|
-
}>;
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
|
|
334
|
-
/**
|
|
335
|
-
* Configuration options for the Node.js SQLite database provider.
|
|
336
|
-
*/
|
|
337
|
-
declare const nodeSqliteOptions: alepha225.Atom<alepha225.TObject<{
|
|
338
|
-
path: alepha225.TOptional<alepha225.TString>;
|
|
339
|
-
}>, "alepha.postgres.node-sqlite.options">;
|
|
340
|
-
type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
|
|
341
|
-
declare module "alepha" {
|
|
342
|
-
interface State {
|
|
343
|
-
[nodeSqliteOptions.key]: NodeSqliteProviderOptions;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Add a fake support for SQLite in Node.js based on Postgres interfaces.
|
|
348
|
-
*
|
|
349
|
-
* This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
|
|
350
|
-
* This is NOT recommended for production use.
|
|
351
|
-
*/
|
|
352
|
-
//#endregion
|
|
353
|
-
//#region ../../src/orm/index.d.ts
|
|
354
|
-
declare module "alepha" {
|
|
355
|
-
interface Hooks {
|
|
356
|
-
/**
|
|
357
|
-
* Fires before creating an entity in the repository.
|
|
358
|
-
*/
|
|
359
|
-
"repository:create:before": {
|
|
360
|
-
tableName: string;
|
|
361
|
-
data: any;
|
|
362
|
-
};
|
|
363
|
-
/**
|
|
364
|
-
* Fires after creating an entity in the repository.
|
|
365
|
-
*/
|
|
366
|
-
"repository:create:after": {
|
|
367
|
-
tableName: string;
|
|
368
|
-
data: any;
|
|
369
|
-
entity: any;
|
|
370
|
-
};
|
|
371
|
-
/**
|
|
372
|
-
* Fires before updating entities in the repository.
|
|
373
|
-
*/
|
|
374
|
-
"repository:update:before": {
|
|
375
|
-
tableName: string;
|
|
376
|
-
where: any;
|
|
377
|
-
data: any;
|
|
378
|
-
};
|
|
379
|
-
/**
|
|
380
|
-
* Fires after updating entities in the repository.
|
|
381
|
-
*/
|
|
382
|
-
"repository:update:after": {
|
|
383
|
-
tableName: string;
|
|
384
|
-
where: any;
|
|
385
|
-
data: any;
|
|
386
|
-
entities: any[];
|
|
387
|
-
};
|
|
388
|
-
/**
|
|
389
|
-
* Fires before deleting entities from the repository.
|
|
390
|
-
*/
|
|
391
|
-
"repository:delete:before": {
|
|
392
|
-
tableName: string;
|
|
393
|
-
where: any;
|
|
394
|
-
};
|
|
395
|
-
/**
|
|
396
|
-
* Fires after deleting entities from the repository.
|
|
397
|
-
*/
|
|
398
|
-
"repository:delete:after": {
|
|
399
|
-
tableName: string;
|
|
400
|
-
where: any;
|
|
401
|
-
ids: Array<string | number>;
|
|
402
|
-
};
|
|
403
|
-
/**
|
|
404
|
-
* Fires before reading entities from the repository.
|
|
405
|
-
*/
|
|
406
|
-
"repository:read:before": {
|
|
407
|
-
tableName: string;
|
|
408
|
-
query: any;
|
|
409
|
-
};
|
|
410
|
-
/**
|
|
411
|
-
* Fires after reading entities from the repository.
|
|
412
|
-
*/
|
|
413
|
-
"repository:read:after": {
|
|
414
|
-
tableName: string;
|
|
415
|
-
query: any;
|
|
416
|
-
entities: any[];
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
//#endregion
|
|
421
231
|
//#region ../../src/api/jobs/schemas/jobExecutionQuerySchema.d.ts
|
|
422
|
-
declare const jobExecutionQuerySchema:
|
|
423
|
-
page:
|
|
424
|
-
size:
|
|
425
|
-
sort:
|
|
426
|
-
status:
|
|
427
|
-
job:
|
|
232
|
+
declare const jobExecutionQuerySchema: alepha151.TObject<{
|
|
233
|
+
page: alepha151.TOptional<alepha151.TInteger>;
|
|
234
|
+
size: alepha151.TOptional<alepha151.TInteger>;
|
|
235
|
+
sort: alepha151.TOptional<alepha151.TString>;
|
|
236
|
+
status: alepha151.TOptional<alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
|
|
237
|
+
job: alepha151.TOptional<alepha151.TString>;
|
|
428
238
|
}>;
|
|
429
239
|
type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;
|
|
430
240
|
//#endregion
|
|
431
241
|
//#region ../../src/api/jobs/services/JobService.d.ts
|
|
432
242
|
declare class JobService {
|
|
433
243
|
protected readonly alepha: Alepha;
|
|
434
|
-
protected readonly executionRepository:
|
|
435
|
-
id:
|
|
436
|
-
version:
|
|
437
|
-
createdAt:
|
|
438
|
-
updatedAt:
|
|
439
|
-
finishedAt:
|
|
440
|
-
job:
|
|
441
|
-
status:
|
|
442
|
-
error:
|
|
443
|
-
logs:
|
|
444
|
-
level:
|
|
445
|
-
message:
|
|
446
|
-
service:
|
|
447
|
-
module:
|
|
448
|
-
context:
|
|
449
|
-
app:
|
|
450
|
-
data:
|
|
451
|
-
timestamp:
|
|
244
|
+
protected readonly executionRepository: alepha_orm16.Repository<alepha151.TObject<{
|
|
245
|
+
id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
|
|
246
|
+
version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
|
|
247
|
+
createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
248
|
+
updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
249
|
+
finishedAt: alepha151.TOptional<alepha151.TString>;
|
|
250
|
+
job: alepha151.TString;
|
|
251
|
+
status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
252
|
+
error: alepha151.TOptional<alepha151.TString>;
|
|
253
|
+
logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
|
|
254
|
+
level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
255
|
+
message: alepha151.TString;
|
|
256
|
+
service: alepha151.TString;
|
|
257
|
+
module: alepha151.TString;
|
|
258
|
+
context: alepha151.TOptional<alepha151.TString>;
|
|
259
|
+
app: alepha151.TOptional<alepha151.TString>;
|
|
260
|
+
data: alepha151.TOptional<alepha151.TAny>;
|
|
261
|
+
timestamp: alepha151.TNumber;
|
|
452
262
|
}>>>;
|
|
453
263
|
}>>;
|
|
454
264
|
getJobs(): Promise<string[]>;
|
|
455
|
-
getJobExecutions(query?: JobExecutionQuery): Promise<
|
|
456
|
-
id:
|
|
457
|
-
version:
|
|
458
|
-
createdAt:
|
|
459
|
-
updatedAt:
|
|
460
|
-
finishedAt:
|
|
461
|
-
job:
|
|
462
|
-
status:
|
|
463
|
-
error:
|
|
464
|
-
logs:
|
|
465
|
-
level:
|
|
466
|
-
message:
|
|
467
|
-
service:
|
|
468
|
-
module:
|
|
469
|
-
context:
|
|
470
|
-
app:
|
|
471
|
-
data:
|
|
472
|
-
timestamp:
|
|
265
|
+
getJobExecutions(query?: JobExecutionQuery): Promise<alepha151.Page<alepha_orm16.PgStatic<alepha151.TObject<{
|
|
266
|
+
id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
|
|
267
|
+
version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
|
|
268
|
+
createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
269
|
+
updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
270
|
+
finishedAt: alepha151.TOptional<alepha151.TString>;
|
|
271
|
+
job: alepha151.TString;
|
|
272
|
+
status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
273
|
+
error: alepha151.TOptional<alepha151.TString>;
|
|
274
|
+
logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
|
|
275
|
+
level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
276
|
+
message: alepha151.TString;
|
|
277
|
+
service: alepha151.TString;
|
|
278
|
+
module: alepha151.TString;
|
|
279
|
+
context: alepha151.TOptional<alepha151.TString>;
|
|
280
|
+
app: alepha151.TOptional<alepha151.TString>;
|
|
281
|
+
data: alepha151.TOptional<alepha151.TAny>;
|
|
282
|
+
timestamp: alepha151.TNumber;
|
|
473
283
|
}>>>;
|
|
474
|
-
}>,
|
|
475
|
-
id:
|
|
476
|
-
version:
|
|
477
|
-
createdAt:
|
|
478
|
-
updatedAt:
|
|
479
|
-
finishedAt:
|
|
480
|
-
job:
|
|
481
|
-
status:
|
|
482
|
-
error:
|
|
483
|
-
logs:
|
|
484
|
-
level:
|
|
485
|
-
message:
|
|
486
|
-
service:
|
|
487
|
-
module:
|
|
488
|
-
context:
|
|
489
|
-
app:
|
|
490
|
-
data:
|
|
491
|
-
timestamp:
|
|
284
|
+
}>, alepha_orm16.PgRelationMap<alepha151.TObject<{
|
|
285
|
+
id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
|
|
286
|
+
version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
|
|
287
|
+
createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
288
|
+
updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
289
|
+
finishedAt: alepha151.TOptional<alepha151.TString>;
|
|
290
|
+
job: alepha151.TString;
|
|
291
|
+
status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
292
|
+
error: alepha151.TOptional<alepha151.TString>;
|
|
293
|
+
logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
|
|
294
|
+
level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
295
|
+
message: alepha151.TString;
|
|
296
|
+
service: alepha151.TString;
|
|
297
|
+
module: alepha151.TString;
|
|
298
|
+
context: alepha151.TOptional<alepha151.TString>;
|
|
299
|
+
app: alepha151.TOptional<alepha151.TString>;
|
|
300
|
+
data: alepha151.TOptional<alepha151.TAny>;
|
|
301
|
+
timestamp: alepha151.TNumber;
|
|
492
302
|
}>>>;
|
|
493
303
|
}>>>>>;
|
|
494
304
|
triggerJob(name: string): Promise<{
|
|
@@ -502,75 +312,75 @@ declare class AdminJobController {
|
|
|
502
312
|
protected readonly group: string;
|
|
503
313
|
protected readonly jobService: JobService;
|
|
504
314
|
readonly getJobs: alepha_server0.ActionPrimitiveFn<{
|
|
505
|
-
response:
|
|
315
|
+
response: alepha151.TArray<alepha151.TString>;
|
|
506
316
|
}>;
|
|
507
317
|
readonly getJobExecutions: alepha_server0.ActionPrimitiveFn<{
|
|
508
|
-
query:
|
|
509
|
-
page:
|
|
510
|
-
size:
|
|
511
|
-
sort:
|
|
512
|
-
status:
|
|
513
|
-
job:
|
|
318
|
+
query: alepha151.TObject<{
|
|
319
|
+
page: alepha151.TOptional<alepha151.TInteger>;
|
|
320
|
+
size: alepha151.TOptional<alepha151.TInteger>;
|
|
321
|
+
sort: alepha151.TOptional<alepha151.TString>;
|
|
322
|
+
status: alepha151.TOptional<alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
|
|
323
|
+
job: alepha151.TOptional<alepha151.TString>;
|
|
514
324
|
}>;
|
|
515
|
-
response:
|
|
516
|
-
id: PgAttr<PgAttr<
|
|
517
|
-
version: PgAttr<PgAttr<
|
|
518
|
-
createdAt: PgAttr<PgAttr<
|
|
519
|
-
updatedAt: PgAttr<PgAttr<
|
|
520
|
-
finishedAt:
|
|
521
|
-
job:
|
|
522
|
-
status:
|
|
523
|
-
error:
|
|
524
|
-
logs:
|
|
525
|
-
level:
|
|
526
|
-
message:
|
|
527
|
-
service:
|
|
528
|
-
module:
|
|
529
|
-
context:
|
|
530
|
-
app:
|
|
531
|
-
data:
|
|
532
|
-
timestamp:
|
|
325
|
+
response: alepha151.TPage<alepha151.TObject<{
|
|
326
|
+
id: PgAttr<PgAttr<alepha151.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
327
|
+
version: PgAttr<PgAttr<alepha151.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
328
|
+
createdAt: PgAttr<PgAttr<alepha151.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
329
|
+
updatedAt: PgAttr<PgAttr<alepha151.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
330
|
+
finishedAt: alepha151.TOptional<alepha151.TString>;
|
|
331
|
+
job: alepha151.TString;
|
|
332
|
+
status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
333
|
+
error: alepha151.TOptional<alepha151.TString>;
|
|
334
|
+
logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
|
|
335
|
+
level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
336
|
+
message: alepha151.TString;
|
|
337
|
+
service: alepha151.TString;
|
|
338
|
+
module: alepha151.TString;
|
|
339
|
+
context: alepha151.TOptional<alepha151.TString>;
|
|
340
|
+
app: alepha151.TOptional<alepha151.TString>;
|
|
341
|
+
data: alepha151.TOptional<alepha151.TAny>;
|
|
342
|
+
timestamp: alepha151.TNumber;
|
|
533
343
|
}>>>;
|
|
534
344
|
}>>;
|
|
535
345
|
}>;
|
|
536
346
|
readonly triggerJob: alepha_server0.ActionPrimitiveFn<{
|
|
537
|
-
body:
|
|
538
|
-
name:
|
|
347
|
+
body: alepha151.TObject<{
|
|
348
|
+
name: alepha151.TString;
|
|
539
349
|
}>;
|
|
540
|
-
response:
|
|
541
|
-
ok:
|
|
542
|
-
id:
|
|
543
|
-
count:
|
|
350
|
+
response: alepha151.TObject<{
|
|
351
|
+
ok: alepha151.TBoolean;
|
|
352
|
+
id: alepha151.TOptional<alepha151.TUnion<[alepha151.TString, alepha151.TInteger]>>;
|
|
353
|
+
count: alepha151.TOptional<alepha151.TNumber>;
|
|
544
354
|
}>;
|
|
545
355
|
}>;
|
|
546
356
|
}
|
|
547
357
|
//#endregion
|
|
548
358
|
//#region ../../src/api/jobs/entities/jobExecutions.d.ts
|
|
549
|
-
declare const jobExecutions:
|
|
550
|
-
id:
|
|
551
|
-
version:
|
|
552
|
-
createdAt:
|
|
553
|
-
updatedAt:
|
|
554
|
-
finishedAt:
|
|
555
|
-
job:
|
|
556
|
-
status:
|
|
557
|
-
error:
|
|
558
|
-
logs:
|
|
559
|
-
level:
|
|
560
|
-
message:
|
|
561
|
-
service:
|
|
562
|
-
module:
|
|
563
|
-
context:
|
|
564
|
-
app:
|
|
565
|
-
data:
|
|
566
|
-
timestamp:
|
|
359
|
+
declare const jobExecutions: alepha_orm16.EntityPrimitive<alepha151.TObject<{
|
|
360
|
+
id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
|
|
361
|
+
version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
|
|
362
|
+
createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
363
|
+
updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
364
|
+
finishedAt: alepha151.TOptional<alepha151.TString>;
|
|
365
|
+
job: alepha151.TString;
|
|
366
|
+
status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
367
|
+
error: alepha151.TOptional<alepha151.TString>;
|
|
368
|
+
logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
|
|
369
|
+
level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
370
|
+
message: alepha151.TString;
|
|
371
|
+
service: alepha151.TString;
|
|
372
|
+
module: alepha151.TString;
|
|
373
|
+
context: alepha151.TOptional<alepha151.TString>;
|
|
374
|
+
app: alepha151.TOptional<alepha151.TString>;
|
|
375
|
+
data: alepha151.TOptional<alepha151.TAny>;
|
|
376
|
+
timestamp: alepha151.TNumber;
|
|
567
377
|
}>>>;
|
|
568
378
|
}>>;
|
|
569
379
|
type JobExecutionEntity = Static<typeof jobExecutions.schema>;
|
|
570
380
|
//#endregion
|
|
571
381
|
//#region ../../src/api/jobs/providers/JobProvider.d.ts
|
|
572
|
-
declare const envSchema:
|
|
573
|
-
JOB_PREFIX:
|
|
382
|
+
declare const envSchema: alepha151.TObject<{
|
|
383
|
+
JOB_PREFIX: alepha151.TOptional<alepha151.TString>;
|
|
574
384
|
}>;
|
|
575
385
|
declare module "alepha" {
|
|
576
386
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -583,24 +393,24 @@ declare class JobProvider {
|
|
|
583
393
|
protected readonly alepha: Alepha;
|
|
584
394
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
585
395
|
protected readonly cronProvider: CronProvider;
|
|
586
|
-
protected readonly executionRepository:
|
|
587
|
-
id:
|
|
588
|
-
version:
|
|
589
|
-
createdAt:
|
|
590
|
-
updatedAt:
|
|
591
|
-
finishedAt:
|
|
592
|
-
job:
|
|
593
|
-
status:
|
|
594
|
-
error:
|
|
595
|
-
logs:
|
|
596
|
-
level:
|
|
597
|
-
message:
|
|
598
|
-
service:
|
|
599
|
-
module:
|
|
600
|
-
context:
|
|
601
|
-
app:
|
|
602
|
-
data:
|
|
603
|
-
timestamp:
|
|
396
|
+
protected readonly executionRepository: alepha_orm16.Repository<alepha151.TObject<{
|
|
397
|
+
id: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_PRIMARY_KEY>, typeof alepha_orm16.PG_DEFAULT>;
|
|
398
|
+
version: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TInteger, typeof alepha_orm16.PG_VERSION>, typeof alepha_orm16.PG_DEFAULT>;
|
|
399
|
+
createdAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_CREATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
400
|
+
updatedAt: alepha_orm16.PgAttr<alepha_orm16.PgAttr<alepha151.TString, typeof alepha_orm16.PG_UPDATED_AT>, typeof alepha_orm16.PG_DEFAULT>;
|
|
401
|
+
finishedAt: alepha151.TOptional<alepha151.TString>;
|
|
402
|
+
job: alepha151.TString;
|
|
403
|
+
status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
404
|
+
error: alepha151.TOptional<alepha151.TString>;
|
|
405
|
+
logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
|
|
406
|
+
level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
407
|
+
message: alepha151.TString;
|
|
408
|
+
service: alepha151.TString;
|
|
409
|
+
module: alepha151.TString;
|
|
410
|
+
context: alepha151.TOptional<alepha151.TString>;
|
|
411
|
+
app: alepha151.TOptional<alepha151.TString>;
|
|
412
|
+
data: alepha151.TOptional<alepha151.TAny>;
|
|
413
|
+
timestamp: alepha151.TNumber;
|
|
604
414
|
}>>>;
|
|
605
415
|
}>>;
|
|
606
416
|
protected readonly env: {
|
|
@@ -618,49 +428,49 @@ declare class JobProvider {
|
|
|
618
428
|
}[]>;
|
|
619
429
|
protected readonly jobs: Map<string, JobRegistration>;
|
|
620
430
|
/**
|
|
621
|
-
|
|
622
|
-
|
|
431
|
+
* Register and set up a job for execution (called during primitive initialization).
|
|
432
|
+
*/
|
|
623
433
|
registerJob(options: Job): JobRegistration;
|
|
624
434
|
/**
|
|
625
|
-
|
|
626
|
-
|
|
435
|
+
* Trigger a job by name.
|
|
436
|
+
*/
|
|
627
437
|
triggerJob(jobName: string): Promise<void>;
|
|
628
438
|
/**
|
|
629
|
-
|
|
630
|
-
|
|
439
|
+
* Execute a job handler (called by the job primitive).
|
|
440
|
+
*/
|
|
631
441
|
executeJob(jobName: string, handler: (args: {
|
|
632
442
|
now: DateTime;
|
|
633
443
|
}) => Async<void>): Promise<void>;
|
|
634
444
|
}
|
|
635
445
|
interface Job {
|
|
636
446
|
/**
|
|
637
|
-
|
|
638
|
-
|
|
447
|
+
* Name of the job.
|
|
448
|
+
*/
|
|
639
449
|
name: string;
|
|
640
450
|
/**
|
|
641
|
-
|
|
642
|
-
|
|
451
|
+
* Optional description of the job.
|
|
452
|
+
*/
|
|
643
453
|
description?: string;
|
|
644
454
|
/**
|
|
645
|
-
|
|
646
|
-
|
|
455
|
+
* Function to run on schedule.
|
|
456
|
+
*/
|
|
647
457
|
handler: (args: {
|
|
648
458
|
now: DateTime;
|
|
649
459
|
}) => Async<void>;
|
|
650
460
|
/**
|
|
651
|
-
|
|
652
|
-
|
|
461
|
+
* Cron expression to run the job.
|
|
462
|
+
*/
|
|
653
463
|
cron?: string;
|
|
654
464
|
/**
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
465
|
+
* If true, the job will be locked and only one instance will run at a time.
|
|
466
|
+
* You probably need to import {@link AlephaLockRedis} for distributed locking.
|
|
467
|
+
*
|
|
468
|
+
* @default true
|
|
469
|
+
*/
|
|
660
470
|
lock?: boolean;
|
|
661
471
|
/**
|
|
662
|
-
|
|
663
|
-
|
|
472
|
+
* Optional prefix for job lock keys.
|
|
473
|
+
*/
|
|
664
474
|
lockPrefix?: string;
|
|
665
475
|
}
|
|
666
476
|
interface JobRegistration {
|
|
@@ -679,8 +489,8 @@ declare const $job: {
|
|
|
679
489
|
};
|
|
680
490
|
type JobPrimitiveOptions = Omit<Job, "name"> & {
|
|
681
491
|
/**
|
|
682
|
-
|
|
683
|
-
|
|
492
|
+
* Name of the job. Defaults to the primitive property name.
|
|
493
|
+
*/
|
|
684
494
|
name?: string;
|
|
685
495
|
};
|
|
686
496
|
declare class JobPrimitive extends Primitive<JobPrimitiveOptions> {
|
|
@@ -694,31 +504,31 @@ interface JobHandlerArguments {
|
|
|
694
504
|
}
|
|
695
505
|
//#endregion
|
|
696
506
|
//#region ../../src/api/jobs/schemas/jobExecutionResourceSchema.d.ts
|
|
697
|
-
declare const jobExecutionResourceSchema:
|
|
698
|
-
id: PgAttr<PgAttr<
|
|
699
|
-
version: PgAttr<PgAttr<
|
|
700
|
-
createdAt: PgAttr<PgAttr<
|
|
701
|
-
updatedAt: PgAttr<PgAttr<
|
|
702
|
-
finishedAt:
|
|
703
|
-
job:
|
|
704
|
-
status:
|
|
705
|
-
error:
|
|
706
|
-
logs:
|
|
707
|
-
level:
|
|
708
|
-
message:
|
|
709
|
-
service:
|
|
710
|
-
module:
|
|
711
|
-
context:
|
|
712
|
-
app:
|
|
713
|
-
data:
|
|
714
|
-
timestamp:
|
|
507
|
+
declare const jobExecutionResourceSchema: alepha151.TObject<{
|
|
508
|
+
id: PgAttr<PgAttr<alepha151.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
509
|
+
version: PgAttr<PgAttr<alepha151.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
510
|
+
createdAt: PgAttr<PgAttr<alepha151.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
511
|
+
updatedAt: PgAttr<PgAttr<alepha151.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
512
|
+
finishedAt: alepha151.TOptional<alepha151.TString>;
|
|
513
|
+
job: alepha151.TString;
|
|
514
|
+
status: alepha151.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
515
|
+
error: alepha151.TOptional<alepha151.TString>;
|
|
516
|
+
logs: alepha151.TOptional<alepha151.TArray<alepha151.TObject<{
|
|
517
|
+
level: alepha151.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
518
|
+
message: alepha151.TString;
|
|
519
|
+
service: alepha151.TString;
|
|
520
|
+
module: alepha151.TString;
|
|
521
|
+
context: alepha151.TOptional<alepha151.TString>;
|
|
522
|
+
app: alepha151.TOptional<alepha151.TString>;
|
|
523
|
+
data: alepha151.TOptional<alepha151.TAny>;
|
|
524
|
+
timestamp: alepha151.TNumber;
|
|
715
525
|
}>>>;
|
|
716
526
|
}>;
|
|
717
527
|
type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;
|
|
718
528
|
//#endregion
|
|
719
529
|
//#region ../../src/api/jobs/schemas/triggerJobSchema.d.ts
|
|
720
|
-
declare const triggerJobSchema:
|
|
721
|
-
name:
|
|
530
|
+
declare const triggerJobSchema: alepha151.TObject<{
|
|
531
|
+
name: alepha151.TString;
|
|
722
532
|
}>;
|
|
723
533
|
type TriggerJob = Static<typeof triggerJobSchema>;
|
|
724
534
|
//#endregion
|
|
@@ -731,7 +541,7 @@ type TriggerJob = Static<typeof triggerJobSchema>;
|
|
|
731
541
|
*
|
|
732
542
|
* @module alepha.api.jobs
|
|
733
543
|
*/
|
|
734
|
-
declare const AlephaApiJobs:
|
|
544
|
+
declare const AlephaApiJobs: alepha151.Service<alepha151.Module>;
|
|
735
545
|
//#endregion
|
|
736
546
|
export { $job, AdminJobController, AlephaApiJobs, Job, JobExecutionEntity, JobExecutionQuery, JobExecutionResource, JobHandlerArguments, JobPrimitive, JobPrimitiveOptions, JobProvider, JobRegistration, JobService, TriggerJob, jobExecutionQuerySchema, jobExecutionResourceSchema, jobExecutions, triggerJobSchema };
|
|
737
547
|
//# sourceMappingURL=index.d.ts.map
|