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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha133 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, KIND, Primitive, Static, StaticEncode, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
3
|
import * as alepha_server0 from "alepha/server";
|
|
4
4
|
import * as alepha_orm50 from "alepha/orm";
|
|
@@ -9,19 +9,12 @@ import * as alepha_logger0 from "alepha/logger";
|
|
|
9
9
|
import * as alepha_queue0 from "alepha/queue";
|
|
10
10
|
import { EmailProvider } from "alepha/email";
|
|
11
11
|
import { SmsProvider } from "alepha/sms";
|
|
12
|
-
import "bun";
|
|
13
|
-
import "bun:sqlite";
|
|
14
|
-
import "drizzle-orm/bun-sql";
|
|
15
|
-
import "drizzle-orm/bun-sqlite";
|
|
16
12
|
import "drizzle-orm/d1";
|
|
17
13
|
import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
|
|
18
14
|
import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
19
15
|
import "alepha/retry";
|
|
20
|
-
import "alepha/lock";
|
|
21
16
|
import * as typebox0 from "typebox";
|
|
22
17
|
import "drizzle-orm/sqlite-core";
|
|
23
|
-
import "drizzle-orm/postgres-js";
|
|
24
|
-
import "postgres";
|
|
25
18
|
|
|
26
19
|
//#region ../../src/orm/schemas/insertSchema.d.ts
|
|
27
20
|
/**
|
|
@@ -53,114 +46,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
|
|
|
53
46
|
//#region ../../src/orm/primitives/$entity.d.ts
|
|
54
47
|
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
55
48
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
* The database table name that will be created for this entity.
|
|
50
|
+
* If not provided, name will be inferred from the $repository variable name.
|
|
51
|
+
*/
|
|
59
52
|
name: string;
|
|
60
53
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
* TypeBox schema defining the table structure and column types.
|
|
55
|
+
*/
|
|
63
56
|
schema: T;
|
|
64
57
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
* Database indexes to create for query optimization.
|
|
59
|
+
*/
|
|
67
60
|
indexes?: (Keys | {
|
|
68
61
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
* Single column to index.
|
|
63
|
+
*/
|
|
71
64
|
column: Keys;
|
|
72
65
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
67
|
+
*/
|
|
75
68
|
unique?: boolean;
|
|
76
69
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
71
|
+
*/
|
|
79
72
|
name?: string;
|
|
80
73
|
} | {
|
|
81
74
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
* Multiple columns for composite index (order matters for query optimization).
|
|
76
|
+
*/
|
|
84
77
|
columns: Keys[];
|
|
85
78
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
80
|
+
*/
|
|
88
81
|
unique?: boolean;
|
|
89
82
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
84
|
+
*/
|
|
92
85
|
name?: string;
|
|
93
86
|
})[];
|
|
94
87
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
* Foreign key constraints to maintain referential integrity.
|
|
89
|
+
*/
|
|
97
90
|
foreignKeys?: Array<{
|
|
98
91
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
* Optional name for the foreign key constraint.
|
|
93
|
+
*/
|
|
101
94
|
name?: string;
|
|
102
95
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
* Local columns that reference the foreign table.
|
|
97
|
+
*/
|
|
105
98
|
columns: Array<keyof Static<T>>;
|
|
106
99
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
* Referenced columns in the foreign table.
|
|
101
|
+
* Must be EntityColumn references from other entities.
|
|
102
|
+
*/
|
|
110
103
|
foreignColumns: Array<() => EntityColumn<any>>;
|
|
111
104
|
}>;
|
|
112
105
|
/**
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
106
|
+
* Additional table constraints for data validation.
|
|
107
|
+
*
|
|
108
|
+
* Constraints enforce business rules at the database level, providing
|
|
109
|
+
* an additional layer of data integrity beyond application validation.
|
|
110
|
+
*
|
|
111
|
+
* **Constraint Types**:
|
|
112
|
+
* - **Unique constraints**: Prevent duplicate values across columns
|
|
113
|
+
* - **Check constraints**: Enforce custom validation rules with SQL expressions
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* constraints: [
|
|
118
|
+
* {
|
|
119
|
+
* name: "unique_user_email",
|
|
120
|
+
* columns: ["email"],
|
|
121
|
+
* unique: true
|
|
122
|
+
* },
|
|
123
|
+
* {
|
|
124
|
+
* name: "valid_age_range",
|
|
125
|
+
* columns: ["age"],
|
|
126
|
+
* check: sql`age >= 0 AND age <= 150`
|
|
127
|
+
* },
|
|
128
|
+
* {
|
|
129
|
+
* name: "unique_user_username_per_tenant",
|
|
130
|
+
* columns: ["tenantId", "username"],
|
|
131
|
+
* unique: true
|
|
132
|
+
* }
|
|
133
|
+
* ]
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
143
136
|
constraints?: Array<{
|
|
144
137
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
* Columns involved in this constraint.
|
|
139
|
+
*/
|
|
147
140
|
columns: Array<keyof Static<T>>;
|
|
148
141
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
* Optional name for the constraint.
|
|
143
|
+
*/
|
|
151
144
|
name?: string;
|
|
152
145
|
/**
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
* Whether this is a unique constraint.
|
|
147
|
+
*/
|
|
155
148
|
unique?: boolean | {};
|
|
156
149
|
/**
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
* SQL expression for check constraint validation.
|
|
151
|
+
*/
|
|
159
152
|
check?: SQL;
|
|
160
153
|
}>;
|
|
161
154
|
/**
|
|
162
|
-
|
|
163
|
-
|
|
155
|
+
* Advanced Drizzle ORM configuration for complex table setups.
|
|
156
|
+
*/
|
|
164
157
|
config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
|
|
165
158
|
}
|
|
166
159
|
declare class EntityPrimitive<T extends TObject = TObject> {
|
|
@@ -208,8 +201,8 @@ type PgSymbols = {
|
|
|
208
201
|
[PG_REF]: PgRefOptions;
|
|
209
202
|
[PG_ENUM]: PgEnumOptions;
|
|
210
203
|
/**
|
|
211
|
-
|
|
212
|
-
|
|
204
|
+
* @deprecated Use `PG_IDENTITY` instead.
|
|
205
|
+
*/
|
|
213
206
|
[PG_SERIAL]: {};
|
|
214
207
|
};
|
|
215
208
|
type PgSymbolKeys = keyof PgSymbols;
|
|
@@ -239,232 +232,48 @@ interface PgRefOptions {
|
|
|
239
232
|
*/
|
|
240
233
|
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
241
234
|
//#endregion
|
|
242
|
-
//#region ../../src/orm/providers/drivers/BunPostgresProvider.d.ts
|
|
243
|
-
declare module "alepha" {
|
|
244
|
-
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
245
|
-
}
|
|
246
|
-
declare const envSchema$1: alepha252.TObject<{
|
|
247
|
-
/**
|
|
248
|
-
* Main configuration for database connection.
|
|
249
|
-
* Accept a string in the format of a Postgres connection URL.
|
|
250
|
-
* Example: postgres://user:password@localhost:5432/database
|
|
251
|
-
* or
|
|
252
|
-
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
253
|
-
*/
|
|
254
|
-
DATABASE_URL: alepha252.TOptional<alepha252.TString>;
|
|
255
|
-
/**
|
|
256
|
-
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
257
|
-
*/
|
|
258
|
-
POSTGRES_SCHEMA: alepha252.TOptional<alepha252.TString>;
|
|
259
|
-
}>;
|
|
260
|
-
/**
|
|
261
|
-
* Bun PostgreSQL provider using Drizzle ORM with Bun's native SQL client.
|
|
262
|
-
*
|
|
263
|
-
* This provider uses Bun's built-in SQL class for PostgreSQL connections,
|
|
264
|
-
* which provides excellent performance on the Bun runtime.
|
|
265
|
-
*
|
|
266
|
-
* @example
|
|
267
|
-
* ```ts
|
|
268
|
-
* // Set DATABASE_URL environment variable
|
|
269
|
-
* // DATABASE_URL=postgres://user:password@localhost:5432/database
|
|
270
|
-
*
|
|
271
|
-
* // Or configure programmatically
|
|
272
|
-
* alepha.with({
|
|
273
|
-
* provide: DatabaseProvider,
|
|
274
|
-
* use: BunPostgresProvider,
|
|
275
|
-
* });
|
|
276
|
-
* ```
|
|
277
|
-
*/
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region ../../src/orm/providers/drivers/BunSqliteProvider.d.ts
|
|
280
|
-
/**
|
|
281
|
-
* Configuration options for the Bun SQLite database provider.
|
|
282
|
-
*/
|
|
283
|
-
declare const bunSqliteOptions: alepha252.Atom<alepha252.TObject<{
|
|
284
|
-
path: alepha252.TOptional<alepha252.TString>;
|
|
285
|
-
}>, "alepha.postgres.bun-sqlite.options">;
|
|
286
|
-
type BunSqliteProviderOptions = Static<typeof bunSqliteOptions.schema>;
|
|
287
|
-
declare module "alepha" {
|
|
288
|
-
interface State {
|
|
289
|
-
[bunSqliteOptions.key]: BunSqliteProviderOptions;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Bun SQLite provider using Drizzle ORM with Bun's native SQLite client.
|
|
294
|
-
*
|
|
295
|
-
* This provider uses Bun's built-in `bun:sqlite` for SQLite connections,
|
|
296
|
-
* which provides excellent performance on the Bun runtime.
|
|
297
|
-
*
|
|
298
|
-
* @example
|
|
299
|
-
* ```ts
|
|
300
|
-
* // Set DATABASE_URL environment variable
|
|
301
|
-
* // DATABASE_URL=sqlite://./my-database.db
|
|
302
|
-
*
|
|
303
|
-
* // Or configure programmatically
|
|
304
|
-
* alepha.with({
|
|
305
|
-
* provide: DatabaseProvider,
|
|
306
|
-
* use: BunSqliteProvider,
|
|
307
|
-
* });
|
|
308
|
-
*
|
|
309
|
-
* // Or use options atom
|
|
310
|
-
* alepha.store.mut(bunSqliteOptions, (old) => ({
|
|
311
|
-
* ...old,
|
|
312
|
-
* path: ":memory:",
|
|
313
|
-
* }));
|
|
314
|
-
* ```
|
|
315
|
-
*/
|
|
316
|
-
//#endregion
|
|
317
|
-
//#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
|
|
318
|
-
declare module "alepha" {
|
|
319
|
-
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
320
|
-
}
|
|
321
|
-
declare const envSchema: alepha252.TObject<{
|
|
322
|
-
/**
|
|
323
|
-
* Main configuration for database connection.
|
|
324
|
-
* Accept a string in the format of a Postgres connection URL.
|
|
325
|
-
* Example: postgres://user:password@localhost:5432/database
|
|
326
|
-
* or
|
|
327
|
-
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
328
|
-
*/
|
|
329
|
-
DATABASE_URL: alepha252.TOptional<alepha252.TString>;
|
|
330
|
-
/**
|
|
331
|
-
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
332
|
-
*
|
|
333
|
-
* It will monkey patch drizzle tables.
|
|
334
|
-
*/
|
|
335
|
-
POSTGRES_SCHEMA: alepha252.TOptional<alepha252.TString>;
|
|
336
|
-
}>;
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
|
|
339
|
-
/**
|
|
340
|
-
* Configuration options for the Node.js SQLite database provider.
|
|
341
|
-
*/
|
|
342
|
-
declare const nodeSqliteOptions: alepha252.Atom<alepha252.TObject<{
|
|
343
|
-
path: alepha252.TOptional<alepha252.TString>;
|
|
344
|
-
}>, "alepha.postgres.node-sqlite.options">;
|
|
345
|
-
type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
|
|
346
|
-
declare module "alepha" {
|
|
347
|
-
interface State {
|
|
348
|
-
[nodeSqliteOptions.key]: NodeSqliteProviderOptions;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* Add a fake support for SQLite in Node.js based on Postgres interfaces.
|
|
353
|
-
*
|
|
354
|
-
* This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
|
|
355
|
-
* This is NOT recommended for production use.
|
|
356
|
-
*/
|
|
357
|
-
//#endregion
|
|
358
|
-
//#region ../../src/orm/index.d.ts
|
|
359
|
-
declare module "alepha" {
|
|
360
|
-
interface Hooks {
|
|
361
|
-
/**
|
|
362
|
-
* Fires before creating an entity in the repository.
|
|
363
|
-
*/
|
|
364
|
-
"repository:create:before": {
|
|
365
|
-
tableName: string;
|
|
366
|
-
data: any;
|
|
367
|
-
};
|
|
368
|
-
/**
|
|
369
|
-
* Fires after creating an entity in the repository.
|
|
370
|
-
*/
|
|
371
|
-
"repository:create:after": {
|
|
372
|
-
tableName: string;
|
|
373
|
-
data: any;
|
|
374
|
-
entity: any;
|
|
375
|
-
};
|
|
376
|
-
/**
|
|
377
|
-
* Fires before updating entities in the repository.
|
|
378
|
-
*/
|
|
379
|
-
"repository:update:before": {
|
|
380
|
-
tableName: string;
|
|
381
|
-
where: any;
|
|
382
|
-
data: any;
|
|
383
|
-
};
|
|
384
|
-
/**
|
|
385
|
-
* Fires after updating entities in the repository.
|
|
386
|
-
*/
|
|
387
|
-
"repository:update:after": {
|
|
388
|
-
tableName: string;
|
|
389
|
-
where: any;
|
|
390
|
-
data: any;
|
|
391
|
-
entities: any[];
|
|
392
|
-
};
|
|
393
|
-
/**
|
|
394
|
-
* Fires before deleting entities from the repository.
|
|
395
|
-
*/
|
|
396
|
-
"repository:delete:before": {
|
|
397
|
-
tableName: string;
|
|
398
|
-
where: any;
|
|
399
|
-
};
|
|
400
|
-
/**
|
|
401
|
-
* Fires after deleting entities from the repository.
|
|
402
|
-
*/
|
|
403
|
-
"repository:delete:after": {
|
|
404
|
-
tableName: string;
|
|
405
|
-
where: any;
|
|
406
|
-
ids: Array<string | number>;
|
|
407
|
-
};
|
|
408
|
-
/**
|
|
409
|
-
* Fires before reading entities from the repository.
|
|
410
|
-
*/
|
|
411
|
-
"repository:read:before": {
|
|
412
|
-
tableName: string;
|
|
413
|
-
query: any;
|
|
414
|
-
};
|
|
415
|
-
/**
|
|
416
|
-
* Fires after reading entities from the repository.
|
|
417
|
-
*/
|
|
418
|
-
"repository:read:after": {
|
|
419
|
-
tableName: string;
|
|
420
|
-
query: any;
|
|
421
|
-
entities: any[];
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
//#endregion
|
|
426
235
|
//#region ../../src/api/notifications/entities/notifications.d.ts
|
|
427
|
-
declare const notifications: alepha_orm50.EntityPrimitive<
|
|
428
|
-
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
429
|
-
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
430
|
-
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
431
|
-
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
432
|
-
type:
|
|
433
|
-
template:
|
|
434
|
-
category:
|
|
435
|
-
critical:
|
|
436
|
-
sensitive:
|
|
437
|
-
contact:
|
|
438
|
-
variables:
|
|
439
|
-
scheduledAt:
|
|
440
|
-
sentAt:
|
|
441
|
-
error:
|
|
442
|
-
at:
|
|
443
|
-
name:
|
|
444
|
-
message:
|
|
236
|
+
declare const notifications: alepha_orm50.EntityPrimitive<alepha133.TObject<{
|
|
237
|
+
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
|
|
238
|
+
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
|
|
239
|
+
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
240
|
+
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
241
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
242
|
+
template: alepha133.TString;
|
|
243
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
244
|
+
critical: alepha133.TOptional<alepha133.TBoolean>;
|
|
245
|
+
sensitive: alepha133.TOptional<alepha133.TBoolean>;
|
|
246
|
+
contact: alepha133.TString;
|
|
247
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
248
|
+
scheduledAt: alepha133.TOptional<alepha133.TString>;
|
|
249
|
+
sentAt: alepha133.TOptional<alepha133.TString>;
|
|
250
|
+
error: alepha133.TOptional<alepha133.TObject<{
|
|
251
|
+
at: alepha133.TString;
|
|
252
|
+
name: alepha133.TString;
|
|
253
|
+
message: alepha133.TString;
|
|
445
254
|
}>>;
|
|
446
255
|
}>>;
|
|
447
256
|
type NotificationEntity = Static<typeof notifications.schema>;
|
|
448
257
|
//#endregion
|
|
449
258
|
//#region ../../src/api/notifications/schemas/notificationCreateSchema.d.ts
|
|
450
|
-
declare const notificationCreateSchema:
|
|
451
|
-
type:
|
|
452
|
-
template:
|
|
453
|
-
contact:
|
|
454
|
-
variables:
|
|
259
|
+
declare const notificationCreateSchema: alepha133.TObject<{
|
|
260
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
261
|
+
template: alepha133.TString;
|
|
262
|
+
contact: alepha133.TString;
|
|
263
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
455
264
|
}>;
|
|
456
265
|
type NotificationCreate = Static<typeof notificationCreateSchema>;
|
|
457
266
|
//#endregion
|
|
458
267
|
//#region ../../src/api/notifications/schemas/notificationQuerySchema.d.ts
|
|
459
|
-
declare const notificationQuerySchema:
|
|
460
|
-
page:
|
|
461
|
-
size:
|
|
462
|
-
sort:
|
|
463
|
-
type:
|
|
464
|
-
template:
|
|
465
|
-
contact:
|
|
466
|
-
category:
|
|
467
|
-
status:
|
|
268
|
+
declare const notificationQuerySchema: alepha133.TObject<{
|
|
269
|
+
page: alepha133.TOptional<alepha133.TInteger>;
|
|
270
|
+
size: alepha133.TOptional<alepha133.TInteger>;
|
|
271
|
+
sort: alepha133.TOptional<alepha133.TString>;
|
|
272
|
+
type: alepha133.TOptional<alepha133.TUnsafe<"email" | "sms">>;
|
|
273
|
+
template: alepha133.TOptional<alepha133.TString>;
|
|
274
|
+
contact: alepha133.TOptional<alepha133.TString>;
|
|
275
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
276
|
+
status: alepha133.TOptional<alepha133.TUnsafe<"pending" | "sent" | "failed">>;
|
|
468
277
|
}>;
|
|
469
278
|
type NotificationQuery = Static<typeof notificationQuerySchema>;
|
|
470
279
|
//#endregion
|
|
@@ -536,24 +345,24 @@ interface NotificationMessage<T extends TObject> {
|
|
|
536
345
|
declare class NotificationSenderService {
|
|
537
346
|
protected readonly alepha: Alepha;
|
|
538
347
|
protected readonly log: alepha_logger0.Logger;
|
|
539
|
-
protected readonly notificationRepository: alepha_orm50.Repository<
|
|
540
|
-
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
541
|
-
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
542
|
-
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
543
|
-
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
544
|
-
type:
|
|
545
|
-
template:
|
|
546
|
-
category:
|
|
547
|
-
critical:
|
|
548
|
-
sensitive:
|
|
549
|
-
contact:
|
|
550
|
-
variables:
|
|
551
|
-
scheduledAt:
|
|
552
|
-
sentAt:
|
|
553
|
-
error:
|
|
554
|
-
at:
|
|
555
|
-
name:
|
|
556
|
-
message:
|
|
348
|
+
protected readonly notificationRepository: alepha_orm50.Repository<alepha133.TObject<{
|
|
349
|
+
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
|
|
350
|
+
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
|
|
351
|
+
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
352
|
+
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
353
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
354
|
+
template: alepha133.TString;
|
|
355
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
356
|
+
critical: alepha133.TOptional<alepha133.TBoolean>;
|
|
357
|
+
sensitive: alepha133.TOptional<alepha133.TBoolean>;
|
|
358
|
+
contact: alepha133.TString;
|
|
359
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
360
|
+
scheduledAt: alepha133.TOptional<alepha133.TString>;
|
|
361
|
+
sentAt: alepha133.TOptional<alepha133.TString>;
|
|
362
|
+
error: alepha133.TOptional<alepha133.TObject<{
|
|
363
|
+
at: alepha133.TString;
|
|
364
|
+
name: alepha133.TString;
|
|
365
|
+
message: alepha133.TString;
|
|
557
366
|
}>>;
|
|
558
367
|
}>>;
|
|
559
368
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
@@ -570,34 +379,34 @@ declare class NotificationSenderService {
|
|
|
570
379
|
body: string;
|
|
571
380
|
};
|
|
572
381
|
protected load(notification: NotificationEntity): {
|
|
573
|
-
template: NotificationPrimitive<
|
|
382
|
+
template: NotificationPrimitive<alepha133.TObject<alepha133.TProperties>>;
|
|
574
383
|
variables: typebox0.StaticRecord<[], "Decode", {}, {
|
|
575
|
-
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
576
|
-
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
577
|
-
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
578
|
-
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
579
|
-
type:
|
|
580
|
-
template:
|
|
581
|
-
category:
|
|
582
|
-
critical:
|
|
583
|
-
sensitive:
|
|
584
|
-
contact:
|
|
585
|
-
variables:
|
|
586
|
-
scheduledAt:
|
|
587
|
-
sentAt:
|
|
588
|
-
error:
|
|
589
|
-
at:
|
|
590
|
-
name:
|
|
591
|
-
message:
|
|
384
|
+
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
|
|
385
|
+
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
|
|
386
|
+
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
387
|
+
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
388
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
389
|
+
template: alepha133.TString;
|
|
390
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
391
|
+
critical: alepha133.TOptional<alepha133.TBoolean>;
|
|
392
|
+
sensitive: alepha133.TOptional<alepha133.TBoolean>;
|
|
393
|
+
contact: alepha133.TString;
|
|
394
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
395
|
+
scheduledAt: alepha133.TOptional<alepha133.TString>;
|
|
396
|
+
sentAt: alepha133.TOptional<alepha133.TString>;
|
|
397
|
+
error: alepha133.TOptional<alepha133.TObject<{
|
|
398
|
+
at: alepha133.TString;
|
|
399
|
+
name: alepha133.TString;
|
|
400
|
+
message: alepha133.TString;
|
|
592
401
|
}>>;
|
|
593
|
-
}, "^.*$",
|
|
402
|
+
}, "^.*$", alepha133.TAny>;
|
|
594
403
|
contact: string;
|
|
595
404
|
};
|
|
596
405
|
}
|
|
597
406
|
//#endregion
|
|
598
407
|
//#region ../../src/api/notifications/services/NotificationService.d.ts
|
|
599
|
-
declare const notificationServiceEnvSchema:
|
|
600
|
-
NOTIFICATION_QUEUE:
|
|
408
|
+
declare const notificationServiceEnvSchema: alepha133.TObject<{
|
|
409
|
+
NOTIFICATION_QUEUE: alepha133.TOptional<alepha133.TBoolean>;
|
|
601
410
|
}>;
|
|
602
411
|
declare module "alepha" {
|
|
603
412
|
interface Env extends Partial<Static<typeof notificationServiceEnvSchema>> {}
|
|
@@ -608,77 +417,77 @@ declare class NotificationService {
|
|
|
608
417
|
protected readonly env: {
|
|
609
418
|
NOTIFICATION_QUEUE?: boolean | undefined;
|
|
610
419
|
};
|
|
611
|
-
protected readonly notificationRepository: alepha_orm50.Repository<
|
|
612
|
-
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
613
|
-
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
614
|
-
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
615
|
-
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
616
|
-
type:
|
|
617
|
-
template:
|
|
618
|
-
category:
|
|
619
|
-
critical:
|
|
620
|
-
sensitive:
|
|
621
|
-
contact:
|
|
622
|
-
variables:
|
|
623
|
-
scheduledAt:
|
|
624
|
-
sentAt:
|
|
625
|
-
error:
|
|
626
|
-
at:
|
|
627
|
-
name:
|
|
628
|
-
message:
|
|
420
|
+
protected readonly notificationRepository: alepha_orm50.Repository<alepha133.TObject<{
|
|
421
|
+
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
|
|
422
|
+
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
|
|
423
|
+
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
424
|
+
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
425
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
426
|
+
template: alepha133.TString;
|
|
427
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
428
|
+
critical: alepha133.TOptional<alepha133.TBoolean>;
|
|
429
|
+
sensitive: alepha133.TOptional<alepha133.TBoolean>;
|
|
430
|
+
contact: alepha133.TString;
|
|
431
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
432
|
+
scheduledAt: alepha133.TOptional<alepha133.TString>;
|
|
433
|
+
sentAt: alepha133.TOptional<alepha133.TString>;
|
|
434
|
+
error: alepha133.TOptional<alepha133.TObject<{
|
|
435
|
+
at: alepha133.TString;
|
|
436
|
+
name: alepha133.TString;
|
|
437
|
+
message: alepha133.TString;
|
|
629
438
|
}>>;
|
|
630
439
|
}>>;
|
|
631
440
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
632
441
|
protected readonly notificationSenderService: NotificationSenderService;
|
|
633
|
-
readonly notificationBatch: alepha_batch0.BatchPrimitive<
|
|
634
|
-
type:
|
|
635
|
-
template:
|
|
636
|
-
contact:
|
|
637
|
-
variables:
|
|
442
|
+
readonly notificationBatch: alepha_batch0.BatchPrimitive<alepha133.TObject<{
|
|
443
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
444
|
+
template: alepha133.TString;
|
|
445
|
+
contact: alepha133.TString;
|
|
446
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
638
447
|
}>, Promise<void>>;
|
|
639
|
-
findNotificationById(id: string): Promise<alepha_orm50.PgStatic<
|
|
640
|
-
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
641
|
-
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
642
|
-
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
643
|
-
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
644
|
-
type:
|
|
645
|
-
template:
|
|
646
|
-
category:
|
|
647
|
-
critical:
|
|
648
|
-
sensitive:
|
|
649
|
-
contact:
|
|
650
|
-
variables:
|
|
651
|
-
scheduledAt:
|
|
652
|
-
sentAt:
|
|
653
|
-
error:
|
|
654
|
-
at:
|
|
655
|
-
name:
|
|
656
|
-
message:
|
|
448
|
+
findNotificationById(id: string): Promise<alepha_orm50.PgStatic<alepha133.TObject<{
|
|
449
|
+
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
|
|
450
|
+
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
|
|
451
|
+
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
452
|
+
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
453
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
454
|
+
template: alepha133.TString;
|
|
455
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
456
|
+
critical: alepha133.TOptional<alepha133.TBoolean>;
|
|
457
|
+
sensitive: alepha133.TOptional<alepha133.TBoolean>;
|
|
458
|
+
contact: alepha133.TString;
|
|
459
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
460
|
+
scheduledAt: alepha133.TOptional<alepha133.TString>;
|
|
461
|
+
sentAt: alepha133.TOptional<alepha133.TString>;
|
|
462
|
+
error: alepha133.TOptional<alepha133.TObject<{
|
|
463
|
+
at: alepha133.TString;
|
|
464
|
+
name: alepha133.TString;
|
|
465
|
+
message: alepha133.TString;
|
|
657
466
|
}>>;
|
|
658
|
-
}>, alepha_orm50.PgRelationMap<
|
|
659
|
-
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
660
|
-
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
661
|
-
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
662
|
-
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<
|
|
663
|
-
type:
|
|
664
|
-
template:
|
|
665
|
-
category:
|
|
666
|
-
critical:
|
|
667
|
-
sensitive:
|
|
668
|
-
contact:
|
|
669
|
-
variables:
|
|
670
|
-
scheduledAt:
|
|
671
|
-
sentAt:
|
|
672
|
-
error:
|
|
673
|
-
at:
|
|
674
|
-
name:
|
|
675
|
-
message:
|
|
467
|
+
}>, alepha_orm50.PgRelationMap<alepha133.TObject<{
|
|
468
|
+
id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
|
|
469
|
+
version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
|
|
470
|
+
createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
471
|
+
updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha133.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
|
|
472
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
473
|
+
template: alepha133.TString;
|
|
474
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
475
|
+
critical: alepha133.TOptional<alepha133.TBoolean>;
|
|
476
|
+
sensitive: alepha133.TOptional<alepha133.TBoolean>;
|
|
477
|
+
contact: alepha133.TString;
|
|
478
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
479
|
+
scheduledAt: alepha133.TOptional<alepha133.TString>;
|
|
480
|
+
sentAt: alepha133.TOptional<alepha133.TString>;
|
|
481
|
+
error: alepha133.TOptional<alepha133.TObject<{
|
|
482
|
+
at: alepha133.TString;
|
|
483
|
+
name: alepha133.TString;
|
|
484
|
+
message: alepha133.TString;
|
|
676
485
|
}>>;
|
|
677
486
|
}>>>>;
|
|
678
487
|
findNotifications(q?: NotificationQuery): Promise<Page<NotificationEntity>>;
|
|
679
488
|
/**
|
|
680
|
-
|
|
681
|
-
|
|
489
|
+
* Create a new notification.
|
|
490
|
+
*/
|
|
682
491
|
createNotification(entry: NotificationCreate): Promise<void>;
|
|
683
492
|
}
|
|
684
493
|
//#endregion
|
|
@@ -688,37 +497,37 @@ declare class AdminNotificationController {
|
|
|
688
497
|
protected readonly group = "admin:notifications";
|
|
689
498
|
protected readonly notificationService: NotificationService;
|
|
690
499
|
/**
|
|
691
|
-
|
|
692
|
-
|
|
500
|
+
* Find notifications with pagination and filtering.
|
|
501
|
+
*/
|
|
693
502
|
readonly findNotifications: alepha_server0.ActionPrimitiveFn<{
|
|
694
|
-
query:
|
|
695
|
-
page:
|
|
696
|
-
size:
|
|
697
|
-
sort:
|
|
698
|
-
type:
|
|
699
|
-
template:
|
|
700
|
-
contact:
|
|
701
|
-
category:
|
|
702
|
-
status:
|
|
503
|
+
query: alepha133.TObject<{
|
|
504
|
+
page: alepha133.TOptional<alepha133.TInteger>;
|
|
505
|
+
size: alepha133.TOptional<alepha133.TInteger>;
|
|
506
|
+
sort: alepha133.TOptional<alepha133.TString>;
|
|
507
|
+
type: alepha133.TOptional<alepha133.TUnsafe<"email" | "sms">>;
|
|
508
|
+
template: alepha133.TOptional<alepha133.TString>;
|
|
509
|
+
contact: alepha133.TOptional<alepha133.TString>;
|
|
510
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
511
|
+
status: alepha133.TOptional<alepha133.TUnsafe<"pending" | "sent" | "failed">>;
|
|
703
512
|
}>;
|
|
704
|
-
response:
|
|
705
|
-
id: PgAttr<PgAttr<
|
|
706
|
-
version: PgAttr<PgAttr<
|
|
707
|
-
createdAt: PgAttr<PgAttr<
|
|
708
|
-
updatedAt: PgAttr<PgAttr<
|
|
709
|
-
type:
|
|
710
|
-
template:
|
|
711
|
-
category:
|
|
712
|
-
critical:
|
|
713
|
-
sensitive:
|
|
714
|
-
contact:
|
|
715
|
-
variables:
|
|
716
|
-
scheduledAt:
|
|
717
|
-
sentAt:
|
|
718
|
-
error:
|
|
719
|
-
at:
|
|
720
|
-
name:
|
|
721
|
-
message:
|
|
513
|
+
response: alepha133.TPage<alepha133.TObject<{
|
|
514
|
+
id: PgAttr<PgAttr<alepha133.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
515
|
+
version: PgAttr<PgAttr<alepha133.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
516
|
+
createdAt: PgAttr<PgAttr<alepha133.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
517
|
+
updatedAt: PgAttr<PgAttr<alepha133.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
518
|
+
type: alepha133.TUnsafe<"email" | "sms">;
|
|
519
|
+
template: alepha133.TString;
|
|
520
|
+
category: alepha133.TOptional<alepha133.TString>;
|
|
521
|
+
critical: alepha133.TOptional<alepha133.TBoolean>;
|
|
522
|
+
sensitive: alepha133.TOptional<alepha133.TBoolean>;
|
|
523
|
+
contact: alepha133.TString;
|
|
524
|
+
variables: alepha133.TOptional<alepha133.TRecord<"^.*$", alepha133.TAny>>;
|
|
525
|
+
scheduledAt: alepha133.TOptional<alepha133.TString>;
|
|
526
|
+
sentAt: alepha133.TOptional<alepha133.TString>;
|
|
527
|
+
error: alepha133.TOptional<alepha133.TObject<{
|
|
528
|
+
at: alepha133.TString;
|
|
529
|
+
name: alepha133.TString;
|
|
530
|
+
message: alepha133.TString;
|
|
722
531
|
}>>;
|
|
723
532
|
}>>;
|
|
724
533
|
}>;
|
|
@@ -730,15 +539,15 @@ declare class NotificationJobs {}
|
|
|
730
539
|
//#region ../../src/api/notifications/queues/NotificationQueues.d.ts
|
|
731
540
|
declare class NotificationQueues {
|
|
732
541
|
protected readonly notificationSenderService: NotificationSenderService;
|
|
733
|
-
readonly processNotification: alepha_queue0.QueuePrimitive<
|
|
734
|
-
notificationId:
|
|
542
|
+
readonly processNotification: alepha_queue0.QueuePrimitive<alepha133.TObject<{
|
|
543
|
+
notificationId: alepha133.TString;
|
|
735
544
|
}>>;
|
|
736
545
|
}
|
|
737
546
|
//#endregion
|
|
738
547
|
//#region ../../src/api/notifications/schemas/notificationContactPreferencesSchema.d.ts
|
|
739
|
-
declare const notificationContactPreferencesSchema:
|
|
740
|
-
language:
|
|
741
|
-
exclude:
|
|
548
|
+
declare const notificationContactPreferencesSchema: alepha133.TObject<{
|
|
549
|
+
language: alepha133.TOptional<alepha133.TString>;
|
|
550
|
+
exclude: alepha133.TArray<alepha133.TString>;
|
|
742
551
|
}>;
|
|
743
552
|
type NotificationContactPreferences = Static<typeof notificationContactPreferencesSchema>;
|
|
744
553
|
//#endregion
|
|
@@ -753,7 +562,7 @@ type NotificationContactPreferences = Static<typeof notificationContactPreferenc
|
|
|
753
562
|
*
|
|
754
563
|
* @module alepha.api.notifications
|
|
755
564
|
*/
|
|
756
|
-
declare const AlephaApiNotifications:
|
|
565
|
+
declare const AlephaApiNotifications: alepha133.Service<alepha133.Module>;
|
|
757
566
|
//#endregion
|
|
758
567
|
export { $notification, AdminNotificationController, AlephaApiNotifications, NotificationContactPreferences, NotificationCreate, NotificationEntity, NotificationJobs, NotificationMessage, NotificationPrimitive, NotificationPrimitiveOptions, NotificationPushOptions, NotificationQuery, NotificationQueues, NotificationSenderService, NotificationService, notificationContactPreferencesSchema, notificationCreateSchema, notificationQuerySchema, notificationServiceEnvSchema, notifications };
|
|
759
568
|
//# sourceMappingURL=index.d.ts.map
|