alepha 0.13.0 → 0.13.2
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 +1 -1
- package/dist/api-files/index.d.ts +28 -91
- package/dist/api-files/index.js +10 -755
- package/dist/api-files/index.js.map +1 -1
- package/dist/api-jobs/index.d.ts +67 -67
- package/dist/api-jobs/index.js +13 -13
- package/dist/api-jobs/index.js.map +1 -1
- package/dist/api-notifications/index.d.ts +129 -146
- package/dist/api-notifications/index.js +17 -39
- package/dist/api-notifications/index.js.map +1 -1
- package/dist/api-parameters/index.d.ts +21 -22
- package/dist/api-parameters/index.js +22 -22
- package/dist/api-parameters/index.js.map +1 -1
- package/dist/api-users/index.d.ts +224 -2001
- package/dist/api-users/index.js +914 -4787
- package/dist/api-users/index.js.map +1 -1
- package/dist/api-verifications/index.d.ts +96 -96
- package/dist/batch/index.d.ts +13 -13
- package/dist/batch/index.js +8 -8
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +14 -14
- package/dist/bucket/index.js +12 -12
- package/dist/bucket/index.js.map +1 -1
- package/dist/cache/index.d.ts +11 -11
- package/dist/cache/index.js +9 -9
- package/dist/cache/index.js.map +1 -1
- package/dist/cli/{dist-Sz2EXvQX.cjs → dist-Dl9Vl7Ur.js} +17 -13
- package/dist/cli/{dist-BBPjuQ56.js.map → dist-Dl9Vl7Ur.js.map} +1 -1
- package/dist/cli/index.d.ts +31 -37
- package/dist/cli/index.js +152 -83
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +19 -19
- package/dist/command/index.js +25 -25
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +218 -218
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +232 -232
- package/dist/core/index.js +218 -218
- package/dist/core/index.js.map +1 -1
- package/dist/core/{index.cjs → index.native.js} +304 -455
- package/dist/core/index.native.js.map +1 -0
- package/dist/datetime/index.d.ts +9 -9
- package/dist/datetime/index.js +7 -7
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +16 -16
- package/dist/email/index.js +80 -82
- package/dist/email/index.js.map +1 -1
- package/dist/file/index.js +1 -1
- package/dist/file/index.js.map +1 -1
- package/dist/lock/index.d.ts +9 -9
- package/dist/lock/index.js +8 -8
- package/dist/lock/index.js.map +1 -1
- package/dist/lock-redis/index.js +3 -66
- package/dist/lock-redis/index.js.map +1 -1
- package/dist/logger/index.d.ts +5 -5
- package/dist/logger/index.js +8 -8
- package/dist/logger/index.js.map +1 -1
- package/dist/orm/index.browser.js +114 -114
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.d.ts +219 -219
- package/dist/orm/index.js +46 -46
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/index.d.ts +25 -25
- package/dist/queue/index.js +20 -20
- package/dist/queue/index.js.map +1 -1
- package/dist/queue-redis/index.d.ts +2 -2
- package/dist/redis/index.d.ts +10 -10
- package/dist/retry/index.d.ts +20 -20
- package/dist/retry/index.js +9 -9
- package/dist/retry/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +12 -12
- package/dist/scheduler/index.js +9 -9
- package/dist/scheduler/index.js.map +1 -1
- package/dist/security/index.d.ts +53 -53
- package/dist/security/index.js +32 -32
- package/dist/security/index.js.map +1 -1
- package/dist/server/index.browser.js +1 -1
- package/dist/server/index.browser.js.map +1 -1
- package/dist/server/index.d.ts +101 -101
- package/dist/server/index.js +17 -17
- package/dist/server/index.js.map +1 -1
- package/dist/server-auth/index.browser.js +4 -982
- package/dist/server-auth/index.browser.js.map +1 -1
- package/dist/server-auth/index.d.ts +204 -785
- package/dist/server-auth/index.js +47 -1239
- package/dist/server-auth/index.js.map +1 -1
- package/dist/server-cache/index.d.ts +10 -10
- package/dist/server-cache/index.js +2 -2
- package/dist/server-cache/index.js.map +1 -1
- package/dist/server-compress/index.d.ts +4 -4
- package/dist/server-compress/index.js +1 -1
- package/dist/server-compress/index.js.map +1 -1
- package/dist/server-cookies/index.browser.js +8 -8
- package/dist/server-cookies/index.browser.js.map +1 -1
- package/dist/server-cookies/index.d.ts +17 -17
- package/dist/server-cookies/index.js +10 -10
- package/dist/server-cookies/index.js.map +1 -1
- package/dist/server-cors/index.d.ts +17 -17
- package/dist/server-cors/index.js +9 -9
- package/dist/server-cors/index.js.map +1 -1
- package/dist/server-health/index.d.ts +2 -2
- package/dist/server-helmet/index.d.ts +1 -1
- package/dist/server-links/index.browser.js +12 -12
- package/dist/server-links/index.browser.js.map +1 -1
- package/dist/server-links/index.d.ts +59 -251
- package/dist/server-links/index.js +23 -502
- package/dist/server-links/index.js.map +1 -1
- package/dist/server-metrics/index.d.ts +4 -4
- package/dist/server-metrics/index.js +170 -174
- package/dist/server-metrics/index.js.map +1 -1
- package/dist/server-multipart/index.d.ts +2 -2
- package/dist/server-proxy/index.d.ts +12 -12
- package/dist/server-proxy/index.js +10 -10
- package/dist/server-proxy/index.js.map +1 -1
- package/dist/server-rate-limit/index.d.ts +22 -22
- package/dist/server-rate-limit/index.js +12 -12
- package/dist/server-rate-limit/index.js.map +1 -1
- package/dist/server-security/index.d.ts +24 -24
- package/dist/server-security/index.js +15 -15
- package/dist/server-security/index.js.map +1 -1
- package/dist/server-static/index.d.ts +14 -14
- package/dist/server-static/index.js +8 -8
- package/dist/server-static/index.js.map +1 -1
- package/dist/server-swagger/index.d.ts +25 -184
- package/dist/server-swagger/index.js +21 -724
- package/dist/server-swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +14 -14
- package/dist/sms/index.js +9 -9
- package/dist/sms/index.js.map +1 -1
- package/dist/thread/index.d.ts +11 -11
- package/dist/thread/index.js +17 -17
- package/dist/thread/index.js.map +1 -1
- package/dist/topic/index.d.ts +26 -26
- package/dist/topic/index.js +16 -16
- package/dist/topic/index.js.map +1 -1
- package/dist/topic-redis/index.d.ts +1 -1
- package/dist/vite/index.d.ts +3 -3
- package/dist/vite/index.js +12 -13
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js +11 -11
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +51 -51
- package/dist/websocket/index.js +13 -13
- package/dist/websocket/index.js.map +1 -1
- package/package.json +62 -52
- package/src/api-files/services/FileService.ts +5 -7
- package/src/api-jobs/index.ts +1 -1
- package/src/api-jobs/{descriptors → primitives}/$job.ts +8 -8
- package/src/api-jobs/providers/JobProvider.ts +9 -9
- package/src/api-jobs/services/JobService.ts +5 -5
- package/src/api-notifications/index.ts +5 -15
- package/src/api-notifications/{descriptors → primitives}/$notification.ts +10 -10
- package/src/api-notifications/services/NotificationSenderService.ts +3 -3
- package/src/api-parameters/index.ts +1 -1
- package/src/api-parameters/{descriptors → primitives}/$config.ts +7 -12
- package/src/api-users/index.ts +1 -1
- package/src/api-users/{descriptors → primitives}/$userRealm.ts +8 -8
- package/src/api-users/providers/UserRealmProvider.ts +1 -1
- package/src/batch/index.ts +3 -3
- package/src/batch/{descriptors → primitives}/$batch.ts +13 -16
- package/src/bucket/index.ts +8 -8
- package/src/bucket/{descriptors → primitives}/$bucket.ts +8 -8
- package/src/bucket/providers/LocalFileStorageProvider.ts +3 -3
- package/src/cache/index.ts +4 -4
- package/src/cache/{descriptors → primitives}/$cache.ts +15 -15
- package/src/cli/apps/AlephaPackageBuilderCli.ts +30 -3
- package/src/cli/assets/appRouterTs.ts +9 -0
- package/src/cli/assets/indexHtml.ts +2 -1
- package/src/cli/assets/mainBrowserTs.ts +10 -0
- package/src/cli/commands/CoreCommands.ts +6 -5
- package/src/cli/commands/DrizzleCommands.ts +69 -61
- package/src/cli/commands/VerifyCommands.ts +2 -2
- package/src/cli/commands/ViteCommands.ts +6 -1
- package/src/cli/services/ProjectUtils.ts +78 -41
- package/src/command/index.ts +5 -5
- package/src/command/{descriptors → primitives}/$command.ts +9 -12
- package/src/command/providers/CliProvider.ts +10 -10
- package/src/core/Alepha.ts +30 -33
- package/src/core/constants/KIND.ts +1 -1
- package/src/core/constants/OPTIONS.ts +1 -1
- package/src/core/helpers/{descriptor.ts → primitive.ts} +18 -18
- package/src/core/helpers/ref.ts +1 -1
- package/src/core/index.shared.ts +8 -8
- package/src/core/{descriptors → primitives}/$context.ts +5 -5
- package/src/core/{descriptors → primitives}/$hook.ts +4 -4
- package/src/core/{descriptors → primitives}/$inject.ts +2 -2
- package/src/core/{descriptors → primitives}/$module.ts +9 -9
- package/src/core/{descriptors → primitives}/$use.ts +2 -2
- package/src/core/providers/CodecManager.ts +1 -1
- package/src/core/providers/JsonSchemaCodec.ts +1 -1
- package/src/core/providers/StateManager.ts +2 -2
- package/src/datetime/index.ts +3 -3
- package/src/datetime/{descriptors → primitives}/$interval.ts +6 -6
- package/src/email/index.ts +4 -4
- package/src/email/{descriptors → primitives}/$email.ts +8 -8
- package/src/file/index.ts +1 -1
- package/src/lock/index.ts +3 -3
- package/src/lock/{descriptors → primitives}/$lock.ts +10 -10
- package/src/logger/index.ts +8 -8
- package/src/logger/{descriptors → primitives}/$logger.ts +2 -2
- package/src/logger/services/Logger.ts +1 -1
- package/src/orm/constants/PG_SYMBOLS.ts +2 -2
- package/src/orm/index.browser.ts +2 -2
- package/src/orm/index.ts +8 -8
- package/src/orm/{descriptors → primitives}/$entity.ts +11 -11
- package/src/orm/{descriptors → primitives}/$repository.ts +2 -2
- package/src/orm/{descriptors → primitives}/$sequence.ts +8 -8
- package/src/orm/{descriptors → primitives}/$transaction.ts +4 -4
- package/src/orm/providers/DrizzleKitProvider.ts +1 -1
- package/src/orm/providers/PostgresTypeProvider.ts +3 -3
- package/src/orm/providers/RepositoryProvider.ts +4 -4
- package/src/orm/providers/drivers/DatabaseProvider.ts +7 -7
- package/src/orm/services/ModelBuilder.ts +9 -9
- package/src/orm/services/PgRelationManager.ts +2 -2
- package/src/orm/services/PostgresModelBuilder.ts +5 -5
- package/src/orm/services/Repository.ts +7 -7
- package/src/orm/services/SqliteModelBuilder.ts +5 -5
- package/src/queue/index.ts +7 -7
- package/src/queue/{descriptors → primitives}/$consumer.ts +15 -15
- package/src/queue/{descriptors → primitives}/$queue.ts +12 -12
- package/src/queue/providers/WorkerProvider.ts +7 -7
- package/src/retry/index.ts +3 -3
- package/src/retry/{descriptors → primitives}/$retry.ts +19 -17
- package/src/scheduler/index.ts +3 -3
- package/src/scheduler/{descriptors → primitives}/$scheduler.ts +9 -9
- package/src/scheduler/providers/CronProvider.ts +1 -1
- package/src/security/index.ts +9 -9
- package/src/security/{descriptors → primitives}/$permission.ts +7 -7
- package/src/security/{descriptors → primitives}/$realm.ts +6 -12
- package/src/security/{descriptors → primitives}/$role.ts +12 -12
- package/src/security/{descriptors → primitives}/$serviceAccount.ts +8 -8
- package/src/server/index.browser.ts +1 -1
- package/src/server/index.ts +14 -14
- package/src/server/{descriptors → primitives}/$action.ts +13 -13
- package/src/server/{descriptors → primitives}/$route.ts +9 -9
- package/src/server/providers/NodeHttpServerProvider.ts +2 -2
- package/src/server/services/HttpClient.ts +1 -1
- package/src/server-auth/index.browser.ts +1 -1
- package/src/server-auth/index.ts +6 -6
- package/src/server-auth/{descriptors → primitives}/$auth.ts +10 -10
- package/src/server-auth/{descriptors → primitives}/$authCredentials.ts +4 -4
- package/src/server-auth/{descriptors → primitives}/$authGithub.ts +4 -4
- package/src/server-auth/{descriptors → primitives}/$authGoogle.ts +4 -4
- package/src/server-auth/providers/ServerAuthProvider.ts +4 -4
- package/src/server-cache/providers/ServerCacheProvider.ts +7 -7
- package/src/server-compress/providers/ServerCompressProvider.ts +3 -3
- package/src/server-cookies/index.browser.ts +2 -2
- package/src/server-cookies/index.ts +5 -5
- package/src/server-cookies/{descriptors → primitives}/$cookie.browser.ts +12 -12
- package/src/server-cookies/{descriptors → primitives}/$cookie.ts +13 -13
- package/src/server-cookies/providers/ServerCookiesProvider.ts +4 -4
- package/src/server-cookies/services/CookieParser.ts +1 -1
- package/src/server-cors/index.ts +3 -3
- package/src/server-cors/{descriptors → primitives}/$cors.ts +11 -13
- package/src/server-cors/providers/ServerCorsProvider.ts +5 -5
- package/src/server-links/index.browser.ts +5 -5
- package/src/server-links/index.ts +9 -9
- package/src/server-links/{descriptors → primitives}/$remote.ts +11 -11
- package/src/server-links/providers/LinkProvider.ts +7 -7
- package/src/server-links/providers/{RemoteDescriptorProvider.ts → RemotePrimitiveProvider.ts} +6 -6
- package/src/server-links/providers/ServerLinksProvider.ts +3 -3
- package/src/server-proxy/index.ts +3 -3
- package/src/server-proxy/{descriptors → primitives}/$proxy.ts +8 -8
- package/src/server-proxy/providers/ServerProxyProvider.ts +4 -4
- package/src/server-rate-limit/index.ts +6 -6
- package/src/server-rate-limit/{descriptors → primitives}/$rateLimit.ts +13 -13
- package/src/server-rate-limit/providers/ServerRateLimitProvider.ts +5 -5
- package/src/server-security/index.ts +3 -3
- package/src/server-security/{descriptors → primitives}/$basicAuth.ts +13 -13
- package/src/server-security/providers/ServerBasicAuthProvider.ts +5 -5
- package/src/server-security/providers/ServerSecurityProvider.ts +4 -4
- package/src/server-static/index.ts +3 -3
- package/src/server-static/{descriptors → primitives}/$serve.ts +8 -10
- package/src/server-static/providers/ServerStaticProvider.ts +6 -6
- package/src/server-swagger/index.ts +5 -5
- package/src/server-swagger/{descriptors → primitives}/$swagger.ts +9 -9
- package/src/server-swagger/providers/ServerSwaggerProvider.ts +11 -10
- package/src/sms/index.ts +4 -4
- package/src/sms/{descriptors → primitives}/$sms.ts +8 -8
- package/src/thread/index.ts +3 -3
- package/src/thread/{descriptors → primitives}/$thread.ts +13 -13
- package/src/thread/providers/ThreadProvider.ts +7 -9
- package/src/topic/index.ts +5 -5
- package/src/topic/{descriptors → primitives}/$subscriber.ts +14 -14
- package/src/topic/{descriptors → primitives}/$topic.ts +10 -10
- package/src/topic/providers/TopicProvider.ts +4 -4
- package/src/vite/helpers/boot.ts +3 -3
- package/src/vite/tasks/copyAssets.ts +1 -1
- package/src/vite/tasks/generateSitemap.ts +3 -3
- package/src/vite/tasks/prerenderPages.ts +2 -2
- package/src/vite/tasks/runAlepha.ts +2 -2
- package/src/websocket/index.browser.ts +3 -3
- package/src/websocket/index.shared.ts +2 -2
- package/src/websocket/index.ts +4 -4
- package/src/websocket/interfaces/WebSocketInterfaces.ts +3 -3
- package/src/websocket/{descriptors → primitives}/$channel.ts +10 -10
- package/src/websocket/{descriptors → primitives}/$websocket.ts +8 -8
- package/src/websocket/providers/NodeWebSocketServerProvider.ts +7 -7
- package/src/websocket/providers/WebSocketServerProvider.ts +3 -3
- package/src/websocket/services/WebSocketClient.ts +5 -5
- package/dist/api-files/index.cjs +0 -1293
- package/dist/api-files/index.cjs.map +0 -1
- package/dist/api-files/index.d.cts +0 -829
- package/dist/api-jobs/index.cjs +0 -274
- package/dist/api-jobs/index.cjs.map +0 -1
- package/dist/api-jobs/index.d.cts +0 -654
- package/dist/api-notifications/index.cjs +0 -380
- package/dist/api-notifications/index.cjs.map +0 -1
- package/dist/api-notifications/index.d.cts +0 -289
- package/dist/api-parameters/index.cjs +0 -66
- package/dist/api-parameters/index.cjs.map +0 -1
- package/dist/api-parameters/index.d.cts +0 -84
- package/dist/api-users/index.cjs +0 -6009
- package/dist/api-users/index.cjs.map +0 -1
- package/dist/api-users/index.d.cts +0 -4740
- package/dist/api-verifications/index.cjs +0 -407
- package/dist/api-verifications/index.cjs.map +0 -1
- package/dist/api-verifications/index.d.cts +0 -207
- package/dist/batch/index.cjs +0 -408
- package/dist/batch/index.cjs.map +0 -1
- package/dist/batch/index.d.cts +0 -330
- package/dist/bin/index.cjs +0 -17
- package/dist/bin/index.cjs.map +0 -1
- package/dist/bin/index.d.cts +0 -1
- package/dist/bucket/index.cjs +0 -303
- package/dist/bucket/index.cjs.map +0 -1
- package/dist/bucket/index.d.cts +0 -355
- package/dist/cache/index.cjs +0 -241
- package/dist/cache/index.cjs.map +0 -1
- package/dist/cache/index.d.cts +0 -202
- package/dist/cache-redis/index.cjs +0 -84
- package/dist/cache-redis/index.cjs.map +0 -1
- package/dist/cache-redis/index.d.cts +0 -40
- package/dist/cli/chunk-DSlc6foC.cjs +0 -43
- package/dist/cli/dist-BBPjuQ56.js +0 -2778
- package/dist/cli/dist-Sz2EXvQX.cjs.map +0 -1
- package/dist/cli/index.cjs +0 -1241
- package/dist/cli/index.cjs.map +0 -1
- package/dist/cli/index.d.cts +0 -422
- package/dist/command/index.cjs +0 -693
- package/dist/command/index.cjs.map +0 -1
- package/dist/command/index.d.cts +0 -340
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -1927
- package/dist/datetime/index.cjs +0 -318
- package/dist/datetime/index.cjs.map +0 -1
- package/dist/datetime/index.d.cts +0 -145
- package/dist/email/index.cjs +0 -10874
- package/dist/email/index.cjs.map +0 -1
- package/dist/email/index.d.cts +0 -186
- package/dist/fake/index.cjs +0 -34641
- package/dist/fake/index.cjs.map +0 -1
- package/dist/fake/index.d.cts +0 -74
- package/dist/file/index.cjs +0 -1212
- package/dist/file/index.cjs.map +0 -1
- package/dist/file/index.d.cts +0 -698
- package/dist/lock/index.cjs +0 -226
- package/dist/lock/index.cjs.map +0 -1
- package/dist/lock/index.d.cts +0 -361
- package/dist/lock-redis/index.cjs +0 -113
- package/dist/lock-redis/index.cjs.map +0 -1
- package/dist/lock-redis/index.d.cts +0 -24
- package/dist/logger/index.cjs +0 -521
- package/dist/logger/index.cjs.map +0 -1
- package/dist/logger/index.d.cts +0 -281
- package/dist/orm/index.cjs +0 -2986
- package/dist/orm/index.cjs.map +0 -1
- package/dist/orm/index.d.cts +0 -2213
- package/dist/queue/index.cjs +0 -1044
- package/dist/queue/index.cjs.map +0 -1
- package/dist/queue/index.d.cts +0 -1265
- package/dist/queue-redis/index.cjs +0 -873
- package/dist/queue-redis/index.cjs.map +0 -1
- package/dist/queue-redis/index.d.cts +0 -82
- package/dist/redis/index.cjs +0 -153
- package/dist/redis/index.cjs.map +0 -1
- package/dist/redis/index.d.cts +0 -82
- package/dist/retry/index.cjs +0 -146
- package/dist/retry/index.cjs.map +0 -1
- package/dist/retry/index.d.cts +0 -172
- package/dist/router/index.cjs +0 -111
- package/dist/router/index.cjs.map +0 -1
- package/dist/router/index.d.cts +0 -46
- package/dist/scheduler/index.cjs +0 -576
- package/dist/scheduler/index.cjs.map +0 -1
- package/dist/scheduler/index.d.cts +0 -145
- package/dist/security/index.cjs +0 -2402
- package/dist/security/index.cjs.map +0 -1
- package/dist/security/index.d.cts +0 -598
- package/dist/server/index.cjs +0 -1680
- package/dist/server/index.cjs.map +0 -1
- package/dist/server/index.d.cts +0 -810
- package/dist/server-auth/index.cjs +0 -3146
- package/dist/server-auth/index.cjs.map +0 -1
- package/dist/server-auth/index.d.cts +0 -1164
- package/dist/server-cache/index.cjs +0 -252
- package/dist/server-cache/index.cjs.map +0 -1
- package/dist/server-cache/index.d.cts +0 -164
- package/dist/server-compress/index.cjs +0 -141
- package/dist/server-compress/index.cjs.map +0 -1
- package/dist/server-compress/index.d.cts +0 -38
- package/dist/server-cookies/index.cjs +0 -234
- package/dist/server-cookies/index.cjs.map +0 -1
- package/dist/server-cookies/index.d.cts +0 -144
- package/dist/server-cors/index.cjs +0 -201
- package/dist/server-cors/index.cjs.map +0 -1
- package/dist/server-cors/index.d.cts +0 -140
- package/dist/server-health/index.cjs +0 -62
- package/dist/server-health/index.cjs.map +0 -1
- package/dist/server-health/index.d.cts +0 -58
- package/dist/server-helmet/index.cjs +0 -131
- package/dist/server-helmet/index.cjs.map +0 -1
- package/dist/server-helmet/index.d.cts +0 -97
- package/dist/server-links/index.cjs +0 -992
- package/dist/server-links/index.cjs.map +0 -1
- package/dist/server-links/index.d.cts +0 -513
- package/dist/server-metrics/index.cjs +0 -4535
- package/dist/server-metrics/index.cjs.map +0 -1
- package/dist/server-metrics/index.d.cts +0 -35
- package/dist/server-multipart/index.cjs +0 -237
- package/dist/server-multipart/index.cjs.map +0 -1
- package/dist/server-multipart/index.d.cts +0 -50
- package/dist/server-proxy/index.cjs +0 -186
- package/dist/server-proxy/index.cjs.map +0 -1
- package/dist/server-proxy/index.d.cts +0 -234
- package/dist/server-rate-limit/index.cjs +0 -241
- package/dist/server-rate-limit/index.cjs.map +0 -1
- package/dist/server-rate-limit/index.d.cts +0 -183
- package/dist/server-security/index.cjs +0 -316
- package/dist/server-security/index.cjs.map +0 -1
- package/dist/server-security/index.d.cts +0 -173
- package/dist/server-static/index.cjs +0 -170
- package/dist/server-static/index.cjs.map +0 -1
- package/dist/server-static/index.d.cts +0 -121
- package/dist/server-swagger/index.cjs +0 -1021
- package/dist/server-swagger/index.cjs.map +0 -1
- package/dist/server-swagger/index.d.cts +0 -382
- package/dist/sms/index.cjs +0 -221
- package/dist/sms/index.cjs.map +0 -1
- package/dist/sms/index.d.cts +0 -130
- package/dist/thread/index.cjs +0 -350
- package/dist/thread/index.cjs.map +0 -1
- package/dist/thread/index.d.cts +0 -260
- package/dist/topic/index.cjs +0 -282
- package/dist/topic/index.cjs.map +0 -1
- package/dist/topic/index.d.cts +0 -523
- package/dist/topic-redis/index.cjs +0 -71
- package/dist/topic-redis/index.cjs.map +0 -1
- package/dist/topic-redis/index.d.cts +0 -42
- package/dist/vite/index.cjs +0 -1077
- package/dist/vite/index.cjs.map +0 -1
- package/dist/vite/index.d.cts +0 -542
- package/dist/websocket/index.cjs +0 -1117
- package/dist/websocket/index.cjs.map +0 -1
- package/dist/websocket/index.d.cts +0 -861
- package/src/api-notifications/providers/MemorySmsProvider.ts +0 -20
- package/src/api-notifications/providers/SmsProvider.ts +0 -8
- /package/src/core/{descriptors → primitives}/$atom.ts +0 -0
- /package/src/core/{descriptors → primitives}/$env.ts +0 -0
- /package/src/server-auth/{descriptors → primitives}/$authApple.ts +0 -0
- /package/src/server-links/{descriptors → primitives}/$client.ts +0 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "alepha",
|
|
3
3
|
"description": "Easy-to-use modern TypeScript framework for building many kind of applications.",
|
|
4
4
|
"author": "Nicolas Foures",
|
|
5
|
-
"version": "0.13.
|
|
5
|
+
"version": "0.13.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=22.0.0"
|
|
@@ -71,267 +71,277 @@
|
|
|
71
71
|
"./api/files": {
|
|
72
72
|
"types": "./dist/api-files/index.js",
|
|
73
73
|
"import": "./dist/api-files/index.js",
|
|
74
|
-
"
|
|
74
|
+
"default": "./dist/api-files/index.js"
|
|
75
75
|
},
|
|
76
76
|
"./api/jobs": {
|
|
77
77
|
"types": "./dist/api-jobs/index.js",
|
|
78
78
|
"import": "./dist/api-jobs/index.js",
|
|
79
|
-
"
|
|
79
|
+
"default": "./dist/api-jobs/index.js"
|
|
80
80
|
},
|
|
81
81
|
"./api/notifications": {
|
|
82
82
|
"types": "./dist/api-notifications/index.js",
|
|
83
83
|
"import": "./dist/api-notifications/index.js",
|
|
84
|
-
"
|
|
84
|
+
"default": "./dist/api-notifications/index.js"
|
|
85
85
|
},
|
|
86
86
|
"./api/parameters": {
|
|
87
87
|
"types": "./dist/api-parameters/index.js",
|
|
88
88
|
"import": "./dist/api-parameters/index.js",
|
|
89
|
-
"
|
|
89
|
+
"default": "./dist/api-parameters/index.js"
|
|
90
90
|
},
|
|
91
91
|
"./api/users": {
|
|
92
92
|
"types": "./dist/api-users/index.js",
|
|
93
|
+
"react-native": "./dist/api-users/index.browser.js",
|
|
93
94
|
"browser": "./dist/api-users/index.browser.js",
|
|
94
95
|
"import": "./dist/api-users/index.js",
|
|
95
|
-
"
|
|
96
|
+
"default": "./dist/api-users/index.js"
|
|
96
97
|
},
|
|
97
98
|
"./api/verifications": {
|
|
98
99
|
"types": "./dist/api-verifications/index.js",
|
|
99
100
|
"import": "./dist/api-verifications/index.js",
|
|
100
|
-
"
|
|
101
|
+
"default": "./dist/api-verifications/index.js"
|
|
101
102
|
},
|
|
102
103
|
"./batch": {
|
|
103
104
|
"types": "./dist/batch/index.js",
|
|
104
105
|
"import": "./dist/batch/index.js",
|
|
105
|
-
"
|
|
106
|
+
"default": "./dist/batch/index.js"
|
|
106
107
|
},
|
|
107
108
|
"./bin": {
|
|
108
109
|
"types": "./dist/bin/index.js",
|
|
109
110
|
"import": "./dist/bin/index.js",
|
|
110
|
-
"
|
|
111
|
+
"default": "./dist/bin/index.js"
|
|
111
112
|
},
|
|
112
113
|
"./bucket": {
|
|
113
114
|
"types": "./dist/bucket/index.js",
|
|
114
115
|
"import": "./dist/bucket/index.js",
|
|
115
|
-
"
|
|
116
|
+
"default": "./dist/bucket/index.js"
|
|
116
117
|
},
|
|
117
118
|
"./cache": {
|
|
118
119
|
"types": "./dist/cache/index.js",
|
|
119
120
|
"import": "./dist/cache/index.js",
|
|
120
|
-
"
|
|
121
|
+
"default": "./dist/cache/index.js"
|
|
121
122
|
},
|
|
122
123
|
"./cache/redis": {
|
|
123
124
|
"types": "./dist/cache-redis/index.js",
|
|
124
125
|
"import": "./dist/cache-redis/index.js",
|
|
125
|
-
"
|
|
126
|
+
"default": "./dist/cache-redis/index.js"
|
|
126
127
|
},
|
|
127
128
|
"./cli": {
|
|
128
129
|
"types": "./dist/cli/index.js",
|
|
129
130
|
"import": "./dist/cli/index.js",
|
|
130
|
-
"
|
|
131
|
+
"default": "./dist/cli/index.js"
|
|
131
132
|
},
|
|
132
133
|
"./command": {
|
|
133
134
|
"types": "./dist/command/index.js",
|
|
134
135
|
"import": "./dist/command/index.js",
|
|
135
|
-
"
|
|
136
|
+
"default": "./dist/command/index.js"
|
|
136
137
|
},
|
|
137
138
|
".": {
|
|
138
139
|
"types": "./dist/core/index.js",
|
|
140
|
+
"react-native": "./dist/core/index.native.js",
|
|
139
141
|
"browser": "./dist/core/index.browser.js",
|
|
140
142
|
"import": "./dist/core/index.js",
|
|
141
|
-
"
|
|
143
|
+
"default": "./dist/core/index.js"
|
|
142
144
|
},
|
|
143
145
|
"./datetime": {
|
|
144
146
|
"types": "./dist/datetime/index.js",
|
|
145
147
|
"import": "./dist/datetime/index.js",
|
|
146
|
-
"
|
|
148
|
+
"default": "./dist/datetime/index.js"
|
|
147
149
|
},
|
|
148
150
|
"./email": {
|
|
149
151
|
"types": "./dist/email/index.js",
|
|
150
152
|
"import": "./dist/email/index.js",
|
|
151
|
-
"
|
|
153
|
+
"default": "./dist/email/index.js"
|
|
152
154
|
},
|
|
153
155
|
"./fake": {
|
|
154
156
|
"types": "./dist/fake/index.js",
|
|
155
157
|
"import": "./dist/fake/index.js",
|
|
156
|
-
"
|
|
158
|
+
"default": "./dist/fake/index.js"
|
|
157
159
|
},
|
|
158
160
|
"./file": {
|
|
159
161
|
"types": "./dist/file/index.js",
|
|
160
162
|
"import": "./dist/file/index.js",
|
|
161
|
-
"
|
|
163
|
+
"default": "./dist/file/index.js"
|
|
162
164
|
},
|
|
163
165
|
"./lock": {
|
|
164
166
|
"types": "./dist/lock/index.js",
|
|
165
167
|
"import": "./dist/lock/index.js",
|
|
166
|
-
"
|
|
168
|
+
"default": "./dist/lock/index.js"
|
|
167
169
|
},
|
|
168
170
|
"./lock/redis": {
|
|
169
171
|
"types": "./dist/lock-redis/index.js",
|
|
170
172
|
"import": "./dist/lock-redis/index.js",
|
|
171
|
-
"
|
|
173
|
+
"default": "./dist/lock-redis/index.js"
|
|
172
174
|
},
|
|
173
175
|
"./logger": {
|
|
174
176
|
"types": "./dist/logger/index.js",
|
|
175
177
|
"import": "./dist/logger/index.js",
|
|
176
|
-
"
|
|
178
|
+
"default": "./dist/logger/index.js"
|
|
177
179
|
},
|
|
178
180
|
"./orm": {
|
|
179
181
|
"types": "./dist/orm/index.js",
|
|
182
|
+
"react-native": "./dist/orm/index.browser.js",
|
|
180
183
|
"browser": "./dist/orm/index.browser.js",
|
|
181
184
|
"import": "./dist/orm/index.js",
|
|
182
|
-
"
|
|
185
|
+
"default": "./dist/orm/index.js"
|
|
183
186
|
},
|
|
184
187
|
"./queue": {
|
|
185
188
|
"types": "./dist/queue/index.js",
|
|
186
189
|
"import": "./dist/queue/index.js",
|
|
187
|
-
"
|
|
190
|
+
"default": "./dist/queue/index.js"
|
|
188
191
|
},
|
|
189
192
|
"./queue/redis": {
|
|
190
193
|
"types": "./dist/queue-redis/index.js",
|
|
191
194
|
"import": "./dist/queue-redis/index.js",
|
|
192
|
-
"
|
|
195
|
+
"default": "./dist/queue-redis/index.js"
|
|
193
196
|
},
|
|
194
197
|
"./redis": {
|
|
195
198
|
"types": "./dist/redis/index.js",
|
|
196
199
|
"import": "./dist/redis/index.js",
|
|
197
|
-
"
|
|
200
|
+
"default": "./dist/redis/index.js"
|
|
198
201
|
},
|
|
199
202
|
"./retry": {
|
|
200
203
|
"types": "./dist/retry/index.js",
|
|
201
204
|
"import": "./dist/retry/index.js",
|
|
202
|
-
"
|
|
205
|
+
"default": "./dist/retry/index.js"
|
|
203
206
|
},
|
|
204
207
|
"./router": {
|
|
205
208
|
"types": "./dist/router/index.js",
|
|
206
209
|
"import": "./dist/router/index.js",
|
|
207
|
-
"
|
|
210
|
+
"default": "./dist/router/index.js"
|
|
208
211
|
},
|
|
209
212
|
"./scheduler": {
|
|
210
213
|
"types": "./dist/scheduler/index.js",
|
|
211
214
|
"import": "./dist/scheduler/index.js",
|
|
212
|
-
"
|
|
215
|
+
"default": "./dist/scheduler/index.js"
|
|
213
216
|
},
|
|
214
217
|
"./security": {
|
|
215
218
|
"types": "./dist/security/index.js",
|
|
219
|
+
"react-native": "./dist/security/index.browser.js",
|
|
216
220
|
"browser": "./dist/security/index.browser.js",
|
|
217
221
|
"import": "./dist/security/index.js",
|
|
218
|
-
"
|
|
222
|
+
"default": "./dist/security/index.js"
|
|
219
223
|
},
|
|
220
224
|
"./server": {
|
|
221
225
|
"types": "./dist/server/index.js",
|
|
226
|
+
"react-native": "./dist/server/index.browser.js",
|
|
222
227
|
"browser": "./dist/server/index.browser.js",
|
|
223
228
|
"import": "./dist/server/index.js",
|
|
224
|
-
"
|
|
229
|
+
"default": "./dist/server/index.js"
|
|
225
230
|
},
|
|
226
231
|
"./server/auth": {
|
|
227
232
|
"types": "./dist/server-auth/index.js",
|
|
233
|
+
"react-native": "./dist/server-auth/index.browser.js",
|
|
228
234
|
"browser": "./dist/server-auth/index.browser.js",
|
|
229
235
|
"import": "./dist/server-auth/index.js",
|
|
230
|
-
"
|
|
236
|
+
"default": "./dist/server-auth/index.js"
|
|
231
237
|
},
|
|
232
238
|
"./server/cache": {
|
|
233
239
|
"types": "./dist/server-cache/index.js",
|
|
234
240
|
"import": "./dist/server-cache/index.js",
|
|
235
|
-
"
|
|
241
|
+
"default": "./dist/server-cache/index.js"
|
|
236
242
|
},
|
|
237
243
|
"./server/compress": {
|
|
238
244
|
"types": "./dist/server-compress/index.js",
|
|
239
245
|
"import": "./dist/server-compress/index.js",
|
|
240
|
-
"
|
|
246
|
+
"default": "./dist/server-compress/index.js"
|
|
241
247
|
},
|
|
242
248
|
"./server/cookies": {
|
|
243
249
|
"types": "./dist/server-cookies/index.js",
|
|
250
|
+
"react-native": "./dist/server-cookies/index.browser.js",
|
|
244
251
|
"browser": "./dist/server-cookies/index.browser.js",
|
|
245
252
|
"import": "./dist/server-cookies/index.js",
|
|
246
|
-
"
|
|
253
|
+
"default": "./dist/server-cookies/index.js"
|
|
247
254
|
},
|
|
248
255
|
"./server/cors": {
|
|
249
256
|
"types": "./dist/server-cors/index.js",
|
|
250
257
|
"import": "./dist/server-cors/index.js",
|
|
251
|
-
"
|
|
258
|
+
"default": "./dist/server-cors/index.js"
|
|
252
259
|
},
|
|
253
260
|
"./server/health": {
|
|
254
261
|
"types": "./dist/server-health/index.js",
|
|
255
262
|
"import": "./dist/server-health/index.js",
|
|
256
|
-
"
|
|
263
|
+
"default": "./dist/server-health/index.js"
|
|
257
264
|
},
|
|
258
265
|
"./server/helmet": {
|
|
259
266
|
"types": "./dist/server-helmet/index.js",
|
|
260
267
|
"import": "./dist/server-helmet/index.js",
|
|
261
|
-
"
|
|
268
|
+
"default": "./dist/server-helmet/index.js"
|
|
262
269
|
},
|
|
263
270
|
"./server/links": {
|
|
264
271
|
"types": "./dist/server-links/index.js",
|
|
272
|
+
"react-native": "./dist/server-links/index.browser.js",
|
|
265
273
|
"browser": "./dist/server-links/index.browser.js",
|
|
266
274
|
"import": "./dist/server-links/index.js",
|
|
267
|
-
"
|
|
275
|
+
"default": "./dist/server-links/index.js"
|
|
268
276
|
},
|
|
269
277
|
"./server/metrics": {
|
|
270
278
|
"types": "./dist/server-metrics/index.js",
|
|
271
279
|
"import": "./dist/server-metrics/index.js",
|
|
272
|
-
"
|
|
280
|
+
"default": "./dist/server-metrics/index.js"
|
|
273
281
|
},
|
|
274
282
|
"./server/multipart": {
|
|
275
283
|
"types": "./dist/server-multipart/index.js",
|
|
276
284
|
"import": "./dist/server-multipart/index.js",
|
|
277
|
-
"
|
|
285
|
+
"default": "./dist/server-multipart/index.js"
|
|
278
286
|
},
|
|
279
287
|
"./server/proxy": {
|
|
280
288
|
"types": "./dist/server-proxy/index.js",
|
|
281
289
|
"import": "./dist/server-proxy/index.js",
|
|
282
|
-
"
|
|
290
|
+
"default": "./dist/server-proxy/index.js"
|
|
283
291
|
},
|
|
284
292
|
"./server/rate-limit": {
|
|
285
293
|
"types": "./dist/server-rate-limit/index.js",
|
|
286
294
|
"import": "./dist/server-rate-limit/index.js",
|
|
287
|
-
"
|
|
295
|
+
"default": "./dist/server-rate-limit/index.js"
|
|
288
296
|
},
|
|
289
297
|
"./server/security": {
|
|
290
298
|
"types": "./dist/server-security/index.js",
|
|
299
|
+
"react-native": "./dist/server-security/index.browser.js",
|
|
291
300
|
"browser": "./dist/server-security/index.browser.js",
|
|
292
301
|
"import": "./dist/server-security/index.js",
|
|
293
|
-
"
|
|
302
|
+
"default": "./dist/server-security/index.js"
|
|
294
303
|
},
|
|
295
304
|
"./server/static": {
|
|
296
305
|
"types": "./dist/server-static/index.js",
|
|
297
306
|
"import": "./dist/server-static/index.js",
|
|
298
|
-
"
|
|
307
|
+
"default": "./dist/server-static/index.js"
|
|
299
308
|
},
|
|
300
309
|
"./server/swagger": {
|
|
301
310
|
"types": "./dist/server-swagger/index.js",
|
|
302
311
|
"import": "./dist/server-swagger/index.js",
|
|
303
|
-
"
|
|
312
|
+
"default": "./dist/server-swagger/index.js"
|
|
304
313
|
},
|
|
305
314
|
"./sms": {
|
|
306
315
|
"types": "./dist/sms/index.js",
|
|
307
316
|
"import": "./dist/sms/index.js",
|
|
308
|
-
"
|
|
317
|
+
"default": "./dist/sms/index.js"
|
|
309
318
|
},
|
|
310
319
|
"./thread": {
|
|
311
320
|
"types": "./dist/thread/index.js",
|
|
312
321
|
"import": "./dist/thread/index.js",
|
|
313
|
-
"
|
|
322
|
+
"default": "./dist/thread/index.js"
|
|
314
323
|
},
|
|
315
324
|
"./topic": {
|
|
316
325
|
"types": "./dist/topic/index.js",
|
|
317
326
|
"import": "./dist/topic/index.js",
|
|
318
|
-
"
|
|
327
|
+
"default": "./dist/topic/index.js"
|
|
319
328
|
},
|
|
320
329
|
"./topic/redis": {
|
|
321
330
|
"types": "./dist/topic-redis/index.js",
|
|
322
331
|
"import": "./dist/topic-redis/index.js",
|
|
323
|
-
"
|
|
332
|
+
"default": "./dist/topic-redis/index.js"
|
|
324
333
|
},
|
|
325
334
|
"./vite": {
|
|
326
335
|
"types": "./dist/vite/index.js",
|
|
327
336
|
"import": "./dist/vite/index.js",
|
|
328
|
-
"
|
|
337
|
+
"default": "./dist/vite/index.js"
|
|
329
338
|
},
|
|
330
339
|
"./websocket": {
|
|
331
340
|
"types": "./dist/websocket/index.js",
|
|
341
|
+
"react-native": "./dist/websocket/index.browser.js",
|
|
332
342
|
"browser": "./dist/websocket/index.browser.js",
|
|
333
343
|
"import": "./dist/websocket/index.js",
|
|
334
|
-
"
|
|
344
|
+
"default": "./dist/websocket/index.js"
|
|
335
345
|
},
|
|
336
346
|
"./tsconfig.base": "./tsconfig.base.json",
|
|
337
347
|
"./package.json": "./package.json"
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { $hook, $inject, Alepha, type FileLike } from "alepha";
|
|
3
3
|
import {
|
|
4
4
|
$bucket,
|
|
5
|
-
type
|
|
5
|
+
type BucketPrimitive,
|
|
6
6
|
FileNotFoundError,
|
|
7
7
|
} from "alepha/bucket";
|
|
8
8
|
import {
|
|
@@ -77,17 +77,15 @@ export class FileService {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
* Gets a bucket
|
|
80
|
+
* Gets a bucket primitive by name.
|
|
81
81
|
*
|
|
82
82
|
* @param bucketName - The name of the bucket to retrieve (defaults to "default")
|
|
83
|
-
* @returns The bucket
|
|
83
|
+
* @returns The bucket primitive
|
|
84
84
|
* @throws {NotFoundError} If the bucket is not found
|
|
85
85
|
*/
|
|
86
|
-
public bucket(
|
|
87
|
-
bucketName: string = this.defaultBucket.name,
|
|
88
|
-
): BucketDescriptor {
|
|
86
|
+
public bucket(bucketName: string = this.defaultBucket.name): BucketPrimitive {
|
|
89
87
|
const bucket = this.alepha
|
|
90
|
-
.
|
|
88
|
+
.primitives($bucket)
|
|
91
89
|
.find((it) => it.name === bucketName);
|
|
92
90
|
|
|
93
91
|
if (!bucket) {
|
package/src/api-jobs/index.ts
CHANGED
|
@@ -6,8 +6,8 @@ import { JobService } from "./services/JobService.ts";
|
|
|
6
6
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
7
7
|
|
|
8
8
|
export * from "./controllers/JobController.ts";
|
|
9
|
-
export * from "./descriptors/$job.ts";
|
|
10
9
|
export * from "./entities/jobExecutions.ts";
|
|
10
|
+
export * from "./primitives/$job.ts";
|
|
11
11
|
export * from "./providers/JobProvider.ts";
|
|
12
12
|
export * from "./schemas/jobExecutionQuerySchema.ts";
|
|
13
13
|
export * from "./schemas/jobExecutionResourceSchema.ts";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { $inject,
|
|
1
|
+
import { $inject, createPrimitive, KIND, Primitive } from "alepha";
|
|
2
2
|
import type { DateTime } from "alepha/datetime";
|
|
3
3
|
import { type Job, JobProvider } from "../providers/JobProvider.ts";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Job
|
|
6
|
+
* Job primitive - a drop-in replacement for $scheduler with built-in execution tracking.
|
|
7
7
|
*/
|
|
8
|
-
export const $job = (options:
|
|
9
|
-
return
|
|
8
|
+
export const $job = (options: JobPrimitiveOptions): JobPrimitive => {
|
|
9
|
+
return createPrimitive(JobPrimitive, options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
13
13
|
|
|
14
|
-
export type
|
|
14
|
+
export type JobPrimitiveOptions = Omit<Job, "name"> & {
|
|
15
15
|
/**
|
|
16
|
-
* Name of the job. Defaults to the
|
|
16
|
+
* Name of the job. Defaults to the primitive property name.
|
|
17
17
|
*/
|
|
18
18
|
name?: string;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
22
22
|
|
|
23
|
-
export class
|
|
23
|
+
export class JobPrimitive extends Primitive<JobPrimitiveOptions> {
|
|
24
24
|
protected readonly jobProvider = $inject(JobProvider);
|
|
25
25
|
|
|
26
26
|
public get name(): string {
|
|
@@ -43,7 +43,7 @@ export class JobDescriptor extends Descriptor<JobDescriptorOptions> {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
$job[KIND] =
|
|
46
|
+
$job[KIND] = JobPrimitive;
|
|
47
47
|
|
|
48
48
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
49
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $env, $inject, Alepha, type Async, type Static, t } from "alepha";
|
|
2
2
|
import { type DateTime, DateTimeProvider } from "alepha/datetime";
|
|
3
|
-
import { $lock, type
|
|
3
|
+
import { $lock, type LockPrimitive } from "alepha/lock";
|
|
4
4
|
import type { LogEntry } from "alepha/logger";
|
|
5
5
|
import { $repository } from "alepha/orm";
|
|
6
6
|
import { CronProvider } from "alepha/scheduler";
|
|
@@ -32,7 +32,7 @@ export class JobProvider {
|
|
|
32
32
|
protected readonly jobs = new Map<string, JobRegistration>();
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Register and set up a job for execution (called during
|
|
35
|
+
* Register and set up a job for execution (called during primitive initialization).
|
|
36
36
|
*/
|
|
37
37
|
public registerJob(options: Job): JobRegistration {
|
|
38
38
|
const jobName = options.name;
|
|
@@ -55,8 +55,8 @@ export class JobProvider {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
// Create lock
|
|
59
|
-
const
|
|
58
|
+
// Create lock primitive if locking is enabled
|
|
59
|
+
const lockPrimitive =
|
|
60
60
|
options.lock !== false
|
|
61
61
|
? $lock({
|
|
62
62
|
name: () => {
|
|
@@ -74,7 +74,7 @@ export class JobProvider {
|
|
|
74
74
|
const registration: JobRegistration = {
|
|
75
75
|
name: jobName,
|
|
76
76
|
options,
|
|
77
|
-
|
|
77
|
+
lockPrimitive,
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
this.jobs.set(jobName, registration);
|
|
@@ -99,15 +99,15 @@ export class JobProvider {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
// Execute handler with or without lock
|
|
102
|
-
if (registration.options.lock !== false && registration.
|
|
103
|
-
await registration.
|
|
102
|
+
if (registration.options.lock !== false && registration.lockPrimitive) {
|
|
103
|
+
await registration.lockPrimitive.run();
|
|
104
104
|
} else {
|
|
105
105
|
await this.executeJob(jobName, registration.options.handler);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* Execute a job handler (called by the job
|
|
110
|
+
* Execute a job handler (called by the job primitive).
|
|
111
111
|
*/
|
|
112
112
|
public async executeJob(
|
|
113
113
|
jobName: string,
|
|
@@ -260,5 +260,5 @@ export interface Job {
|
|
|
260
260
|
export interface JobRegistration {
|
|
261
261
|
name: string;
|
|
262
262
|
options: Job;
|
|
263
|
-
|
|
263
|
+
lockPrimitive: LockPrimitive<() => Promise<void>> | null;
|
|
264
264
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $inject, Alepha } from "alepha";
|
|
2
2
|
import { $repository } from "alepha/orm";
|
|
3
|
-
import { $job } from "../descriptors/$job.ts";
|
|
4
3
|
import { jobExecutions } from "../entities/jobExecutions.ts";
|
|
4
|
+
import { $job } from "../primitives/$job.ts";
|
|
5
5
|
import type { JobExecutionQuery } from "../schemas/jobExecutionQuerySchema.ts";
|
|
6
6
|
|
|
7
7
|
export class JobService {
|
|
@@ -9,8 +9,8 @@ export class JobService {
|
|
|
9
9
|
protected readonly executionRepository = $repository(jobExecutions);
|
|
10
10
|
|
|
11
11
|
public async getJobs(): Promise<string[]> {
|
|
12
|
-
const
|
|
13
|
-
return
|
|
12
|
+
const jobPrimitives = this.alepha.primitives($job);
|
|
13
|
+
return jobPrimitives.map((job) => job.name);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
public async getJobExecutions(query: JobExecutionQuery = {}) {
|
|
@@ -34,8 +34,8 @@ export class JobService {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
public async triggerJob(name: string): Promise<{ ok: boolean }> {
|
|
37
|
-
const
|
|
38
|
-
const job =
|
|
37
|
+
const jobPrimitives = this.alepha.primitives($job);
|
|
38
|
+
const job = jobPrimitives.find((j) => j.name === name);
|
|
39
39
|
|
|
40
40
|
if (!job) {
|
|
41
41
|
throw new Error(`Job not found: ${name}`);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { $module } from "alepha";
|
|
2
2
|
import { NotificationController } from "./controllers/NotificationController.ts";
|
|
3
|
-
import { $notification } from "./descriptors/$notification.ts";
|
|
4
3
|
import { NotificationJobs } from "./jobs/NotificationJobs.ts";
|
|
5
|
-
import {
|
|
6
|
-
import { SmsProvider } from "./providers/SmsProvider.ts";
|
|
4
|
+
import { $notification } from "./primitives/$notification.ts";
|
|
7
5
|
import { NotificationQueues } from "./queues/NotificationQueues.ts";
|
|
8
6
|
import { NotificationSenderService } from "./services/NotificationSenderService.ts";
|
|
9
7
|
import {
|
|
@@ -14,11 +12,9 @@ import {
|
|
|
14
12
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
15
13
|
|
|
16
14
|
export * from "./controllers/NotificationController.ts";
|
|
17
|
-
export * from "./descriptors/$notification.ts";
|
|
18
15
|
export * from "./entities/notifications.ts";
|
|
19
16
|
export * from "./jobs/NotificationJobs.ts";
|
|
20
|
-
export * from "./
|
|
21
|
-
export * from "./providers/SmsProvider.ts";
|
|
17
|
+
export * from "./primitives/$notification.ts";
|
|
22
18
|
export * from "./queues/NotificationQueues.ts";
|
|
23
19
|
export * from "./schemas/notificationContactPreferencesSchema.ts";
|
|
24
20
|
export * from "./schemas/notificationCreateSchema.ts";
|
|
@@ -33,27 +29,21 @@ export * from "./services/NotificationService.ts";
|
|
|
33
29
|
* This module includes notification sending, retrieval, status tracking,
|
|
34
30
|
* and user notification preferences management.
|
|
35
31
|
*
|
|
32
|
+
* Requires `AlephaSms` module to be loaded for SMS notifications.
|
|
33
|
+
*
|
|
36
34
|
* @module alepha.api.notifications
|
|
37
35
|
*/
|
|
38
36
|
export const AlephaApiNotifications = $module({
|
|
39
37
|
name: "alepha.api.notifications",
|
|
40
|
-
|
|
38
|
+
primitives: [$notification],
|
|
41
39
|
services: [
|
|
42
40
|
NotificationController,
|
|
43
41
|
NotificationService,
|
|
44
42
|
NotificationSenderService,
|
|
45
43
|
NotificationQueues,
|
|
46
44
|
NotificationJobs,
|
|
47
|
-
SmsProvider,
|
|
48
|
-
MemorySmsProvider,
|
|
49
45
|
],
|
|
50
46
|
register: (alepha) => {
|
|
51
|
-
alepha.with({
|
|
52
|
-
optional: true,
|
|
53
|
-
provide: SmsProvider,
|
|
54
|
-
use: MemorySmsProvider,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
47
|
const env = alepha.parseEnv(notificationServiceEnvSchema);
|
|
58
48
|
if (env.NOTIFICATION_QUEUE) {
|
|
59
49
|
alepha.with(NotificationQueues);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
$inject,
|
|
3
|
-
|
|
4
|
-
Descriptor,
|
|
3
|
+
createPrimitive,
|
|
5
4
|
KIND,
|
|
5
|
+
Primitive,
|
|
6
6
|
type Static,
|
|
7
7
|
type StaticEncode,
|
|
8
8
|
type TObject,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { NotificationService } from "../services/NotificationService.ts";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Creates a notification
|
|
13
|
+
* Creates a notification primitive for managing email/SMS notification templates.
|
|
14
14
|
*
|
|
15
15
|
* Provides type-safe, reusable notification templates with multi-language support,
|
|
16
16
|
* variable substitution, and categorization for different notification channels.
|
|
@@ -38,12 +38,12 @@ import { NotificationService } from "../services/NotificationService.ts";
|
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
40
|
export const $notification = <T extends TObject>(
|
|
41
|
-
options:
|
|
42
|
-
) =>
|
|
41
|
+
options: NotificationPrimitiveOptions<T>,
|
|
42
|
+
) => createPrimitive(NotificationPrimitive<T>, options);
|
|
43
43
|
|
|
44
44
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
45
45
|
|
|
46
|
-
export interface
|
|
46
|
+
export interface NotificationPrimitiveOptions<T extends TObject>
|
|
47
47
|
extends NotificationMessage<T> {
|
|
48
48
|
name?: string;
|
|
49
49
|
description?: string;
|
|
@@ -59,8 +59,8 @@ export interface NotificationDescriptorOptions<T extends TObject>
|
|
|
59
59
|
|
|
60
60
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
61
61
|
|
|
62
|
-
export class
|
|
63
|
-
|
|
62
|
+
export class NotificationPrimitive<T extends TObject> extends Primitive<
|
|
63
|
+
NotificationPrimitiveOptions<T>
|
|
64
64
|
> {
|
|
65
65
|
protected readonly notificationService = $inject(NotificationService);
|
|
66
66
|
|
|
@@ -78,12 +78,12 @@ export class NotificationDescriptor<T extends TObject> extends Descriptor<
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
public configure(options: Partial<
|
|
81
|
+
public configure(options: Partial<NotificationPrimitiveOptions<T>>) {
|
|
82
82
|
Object.assign(this.options, options);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
$notification[KIND] =
|
|
86
|
+
$notification[KIND] = NotificationPrimitive;
|
|
87
87
|
|
|
88
88
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
89
89
|
|