alepha 0.11.7 → 0.11.10

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.
Files changed (169) hide show
  1. package/README.md +55 -17
  2. package/dist/index.cjs +15805 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +1 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.js +15804 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +36 -372
  9. package/src/assets/biomeJson.ts +33 -0
  10. package/src/assets/tsconfigJson.ts +17 -0
  11. package/src/assets/viteConfigTs.ts +14 -0
  12. package/src/commands/BiomeCommands.ts +60 -0
  13. package/src/commands/CoreCommands.ts +266 -0
  14. package/src/commands/DrizzleCommands.ts +403 -0
  15. package/src/commands/VerifyCommands.ts +48 -0
  16. package/src/commands/ViteCommands.ts +152 -0
  17. package/src/index.ts +35 -0
  18. package/src/services/ProcessRunner.ts +89 -0
  19. package/src/version.ts +7 -0
  20. package/api/files.cjs +0 -8
  21. package/api/files.d.ts +0 -438
  22. package/api/files.js +0 -1
  23. package/api/jobs.cjs +0 -8
  24. package/api/jobs.d.ts +0 -327
  25. package/api/jobs.js +0 -1
  26. package/api/notifications.cjs +0 -8
  27. package/api/notifications.d.ts +0 -263
  28. package/api/notifications.js +0 -1
  29. package/api/users.cjs +0 -8
  30. package/api/users.d.ts +0 -923
  31. package/api/users.js +0 -1
  32. package/api/verifications.cjs +0 -8
  33. package/api/verifications.d.ts +0 -1
  34. package/api/verifications.js +0 -1
  35. package/batch.cjs +0 -8
  36. package/batch.d.ts +0 -154
  37. package/batch.js +0 -1
  38. package/bucket.cjs +0 -8
  39. package/bucket.d.ts +0 -520
  40. package/bucket.js +0 -1
  41. package/cache/redis.cjs +0 -8
  42. package/cache/redis.d.ts +0 -40
  43. package/cache/redis.js +0 -1
  44. package/cache.cjs +0 -8
  45. package/cache.d.ts +0 -288
  46. package/cache.js +0 -1
  47. package/command.cjs +0 -8
  48. package/command.d.ts +0 -269
  49. package/command.js +0 -1
  50. package/core.cjs +0 -8
  51. package/core.d.ts +0 -1904
  52. package/core.js +0 -1
  53. package/datetime.cjs +0 -8
  54. package/datetime.d.ts +0 -144
  55. package/datetime.js +0 -1
  56. package/devtools.cjs +0 -8
  57. package/devtools.d.ts +0 -252
  58. package/devtools.js +0 -1
  59. package/email.cjs +0 -8
  60. package/email.d.ts +0 -187
  61. package/email.js +0 -1
  62. package/fake.cjs +0 -8
  63. package/fake.d.ts +0 -73
  64. package/fake.js +0 -1
  65. package/file.cjs +0 -8
  66. package/file.d.ts +0 -528
  67. package/file.js +0 -1
  68. package/lock/redis.cjs +0 -8
  69. package/lock/redis.d.ts +0 -24
  70. package/lock/redis.js +0 -1
  71. package/lock.cjs +0 -8
  72. package/lock.d.ts +0 -552
  73. package/lock.js +0 -1
  74. package/logger.cjs +0 -8
  75. package/logger.d.ts +0 -287
  76. package/logger.js +0 -1
  77. package/postgres.cjs +0 -8
  78. package/postgres.d.ts +0 -2143
  79. package/postgres.js +0 -1
  80. package/queue/redis.cjs +0 -8
  81. package/queue/redis.d.ts +0 -29
  82. package/queue/redis.js +0 -1
  83. package/queue.cjs +0 -8
  84. package/queue.d.ts +0 -760
  85. package/queue.js +0 -1
  86. package/react/auth.cjs +0 -8
  87. package/react/auth.d.ts +0 -504
  88. package/react/auth.js +0 -1
  89. package/react/form.cjs +0 -8
  90. package/react/form.d.ts +0 -211
  91. package/react/form.js +0 -1
  92. package/react/head.cjs +0 -8
  93. package/react/head.d.ts +0 -120
  94. package/react/head.js +0 -1
  95. package/react/i18n.cjs +0 -8
  96. package/react/i18n.d.ts +0 -168
  97. package/react/i18n.js +0 -1
  98. package/react.cjs +0 -8
  99. package/react.d.ts +0 -1263
  100. package/react.js +0 -1
  101. package/redis.cjs +0 -8
  102. package/redis.d.ts +0 -82
  103. package/redis.js +0 -1
  104. package/retry.cjs +0 -8
  105. package/retry.d.ts +0 -162
  106. package/retry.js +0 -1
  107. package/router.cjs +0 -8
  108. package/router.d.ts +0 -45
  109. package/router.js +0 -1
  110. package/scheduler.cjs +0 -8
  111. package/scheduler.d.ts +0 -145
  112. package/scheduler.js +0 -1
  113. package/security.cjs +0 -8
  114. package/security.d.ts +0 -586
  115. package/security.js +0 -1
  116. package/server/cache.cjs +0 -8
  117. package/server/cache.d.ts +0 -163
  118. package/server/cache.js +0 -1
  119. package/server/compress.cjs +0 -8
  120. package/server/compress.d.ts +0 -38
  121. package/server/compress.js +0 -1
  122. package/server/cookies.cjs +0 -8
  123. package/server/cookies.d.ts +0 -144
  124. package/server/cookies.js +0 -1
  125. package/server/cors.cjs +0 -8
  126. package/server/cors.d.ts +0 -45
  127. package/server/cors.js +0 -1
  128. package/server/health.cjs +0 -8
  129. package/server/health.d.ts +0 -58
  130. package/server/health.js +0 -1
  131. package/server/helmet.cjs +0 -8
  132. package/server/helmet.d.ts +0 -98
  133. package/server/helmet.js +0 -1
  134. package/server/links.cjs +0 -8
  135. package/server/links.d.ts +0 -322
  136. package/server/links.js +0 -1
  137. package/server/metrics.cjs +0 -8
  138. package/server/metrics.d.ts +0 -35
  139. package/server/metrics.js +0 -1
  140. package/server/multipart.cjs +0 -8
  141. package/server/multipart.d.ts +0 -42
  142. package/server/multipart.js +0 -1
  143. package/server/proxy.cjs +0 -8
  144. package/server/proxy.d.ts +0 -234
  145. package/server/proxy.js +0 -1
  146. package/server/security.cjs +0 -8
  147. package/server/security.d.ts +0 -92
  148. package/server/security.js +0 -1
  149. package/server/static.cjs +0 -8
  150. package/server/static.d.ts +0 -119
  151. package/server/static.js +0 -1
  152. package/server/swagger.cjs +0 -8
  153. package/server/swagger.d.ts +0 -161
  154. package/server/swagger.js +0 -1
  155. package/server.cjs +0 -8
  156. package/server.d.ts +0 -849
  157. package/server.js +0 -1
  158. package/topic/redis.cjs +0 -8
  159. package/topic/redis.d.ts +0 -42
  160. package/topic/redis.js +0 -1
  161. package/topic.cjs +0 -8
  162. package/topic.d.ts +0 -819
  163. package/topic.js +0 -1
  164. package/ui.cjs +0 -8
  165. package/ui.d.ts +0 -813
  166. package/ui.js +0 -1
  167. package/vite.cjs +0 -8
  168. package/vite.d.ts +0 -186
  169. package/vite.js +0 -1
package/api/jobs.d.ts DELETED
@@ -1,327 +0,0 @@
1
- import * as _alepha_core1 from "alepha";
2
- import { Alepha, Async, Descriptor, KIND, Static } from "alepha";
3
- import "alepha/server/security";
4
- import * as _alepha_postgres0 from "alepha/postgres";
5
- import * as _alepha_server0 from "alepha/server";
6
- import { DateTime, DateTimeProvider } from "alepha/datetime";
7
- import { LockDescriptor } from "alepha/lock";
8
- import { CronProvider } from "alepha/scheduler";
9
- import * as typebox79 from "typebox";
10
-
11
- //#region src/schemas/jobExecutionQuerySchema.d.ts
12
- declare const jobExecutionQuerySchema: typebox79.TObject<{
13
- page: typebox79.TOptional<typebox79.TInteger>;
14
- size: typebox79.TOptional<typebox79.TInteger>;
15
- sort: typebox79.TOptional<typebox79.TString>;
16
- status: typebox79.TOptional<typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
17
- job: typebox79.TOptional<typebox79.TString>;
18
- }>;
19
- type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;
20
- //#endregion
21
- //#region src/services/JobService.d.ts
22
- declare class JobService {
23
- protected readonly alepha: Alepha;
24
- protected readonly executionRepository: _alepha_postgres0.Repository<typebox79.TObject<{
25
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
26
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
27
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
28
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
29
- finishedAt: typebox79.TOptional<typebox79.TString>;
30
- job: typebox79.TString;
31
- status: typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
32
- error: typebox79.TOptional<typebox79.TString>;
33
- logs: typebox79.TOptional<typebox79.TArray<typebox79.TObject<{
34
- level: typebox79.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
35
- message: typebox79.TString;
36
- service: typebox79.TString;
37
- module: typebox79.TString;
38
- context: typebox79.TOptional<typebox79.TString>;
39
- app: typebox79.TOptional<typebox79.TString>;
40
- data: typebox79.TOptional<typebox79.TAny>;
41
- timestamp: typebox79.TString;
42
- }>>>;
43
- }>>;
44
- getJobs(): Promise<string[]>;
45
- getJobExecutions(query?: JobExecutionQuery): Promise<_alepha_core1.Page<_alepha_postgres0.PgStatic<typebox79.TObject<{
46
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
47
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
48
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
49
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
50
- finishedAt: typebox79.TOptional<typebox79.TString>;
51
- job: typebox79.TString;
52
- status: typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
53
- error: typebox79.TOptional<typebox79.TString>;
54
- logs: typebox79.TOptional<typebox79.TArray<typebox79.TObject<{
55
- level: typebox79.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
56
- message: typebox79.TString;
57
- service: typebox79.TString;
58
- module: typebox79.TString;
59
- context: typebox79.TOptional<typebox79.TString>;
60
- app: typebox79.TOptional<typebox79.TString>;
61
- data: typebox79.TOptional<typebox79.TAny>;
62
- timestamp: typebox79.TString;
63
- }>>>;
64
- }>, _alepha_postgres0.PgRelationMap<typebox79.TObject<{
65
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
66
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
67
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
68
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
69
- finishedAt: typebox79.TOptional<typebox79.TString>;
70
- job: typebox79.TString;
71
- status: typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
72
- error: typebox79.TOptional<typebox79.TString>;
73
- logs: typebox79.TOptional<typebox79.TArray<typebox79.TObject<{
74
- level: typebox79.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
75
- message: typebox79.TString;
76
- service: typebox79.TString;
77
- module: typebox79.TString;
78
- context: typebox79.TOptional<typebox79.TString>;
79
- app: typebox79.TOptional<typebox79.TString>;
80
- data: typebox79.TOptional<typebox79.TAny>;
81
- timestamp: typebox79.TString;
82
- }>>>;
83
- }>>>>>;
84
- triggerJob(name: string): Promise<{
85
- ok: boolean;
86
- }>;
87
- }
88
- //#endregion
89
- //#region src/controllers/JobController.d.ts
90
- declare class JobController {
91
- protected readonly url: string;
92
- protected readonly group: string;
93
- protected readonly jobService: JobService;
94
- readonly getJobs: _alepha_server0.ActionDescriptorFn<{
95
- response: typebox79.TArray<typebox79.TString>;
96
- }>;
97
- readonly getJobExecutions: _alepha_server0.ActionDescriptorFn<{
98
- query: typebox79.TObject<{
99
- page: typebox79.TOptional<typebox79.TInteger>;
100
- size: typebox79.TOptional<typebox79.TInteger>;
101
- sort: typebox79.TOptional<typebox79.TString>;
102
- status: typebox79.TOptional<typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
103
- job: typebox79.TOptional<typebox79.TString>;
104
- }>;
105
- response: _alepha_core1.TPage<typebox79.TObject<{
106
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
107
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
108
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
109
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
110
- finishedAt: typebox79.TOptional<typebox79.TString>;
111
- job: typebox79.TString;
112
- status: typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
113
- error: typebox79.TOptional<typebox79.TString>;
114
- logs: typebox79.TOptional<typebox79.TArray<typebox79.TObject<{
115
- level: typebox79.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
116
- message: typebox79.TString;
117
- service: typebox79.TString;
118
- module: typebox79.TString;
119
- context: typebox79.TOptional<typebox79.TString>;
120
- app: typebox79.TOptional<typebox79.TString>;
121
- data: typebox79.TOptional<typebox79.TAny>;
122
- timestamp: typebox79.TString;
123
- }>>>;
124
- }>>;
125
- }>;
126
- readonly triggerJob: _alepha_server0.ActionDescriptorFn<{
127
- body: typebox79.TObject<{
128
- name: typebox79.TString;
129
- }>;
130
- response: typebox79.TObject<{
131
- ok: typebox79.TBoolean;
132
- id: typebox79.TOptional<typebox79.TUnion<[typebox79.TString, typebox79.TInteger]>>;
133
- count: typebox79.TOptional<typebox79.TNumber>;
134
- }>;
135
- }>;
136
- }
137
- //#endregion
138
- //#region src/providers/JobProvider.d.ts
139
- declare const envSchema: _alepha_core1.TObject<{
140
- JOB_PREFIX: _alepha_core1.TOptional<_alepha_core1.TString>;
141
- }>;
142
- declare module "alepha" {
143
- interface Env extends Partial<Static<typeof envSchema>> {}
144
- }
145
- /**
146
- * Provider for job management and execution.
147
- * Handles job lifecycle, execution tracking, log capturing, and event emission.
148
- */
149
- declare class JobProvider {
150
- protected readonly alepha: Alepha;
151
- protected readonly dateTimeProvider: DateTimeProvider;
152
- protected readonly cronProvider: CronProvider;
153
- protected readonly executionRepository: _alepha_postgres0.Repository<_alepha_core1.TObject<{
154
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<_alepha_core1.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
155
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
156
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<_alepha_core1.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
157
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<_alepha_core1.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
158
- finishedAt: _alepha_core1.TOptional<_alepha_core1.TString>;
159
- job: _alepha_core1.TString;
160
- status: typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
161
- error: _alepha_core1.TOptional<_alepha_core1.TString>;
162
- logs: _alepha_core1.TOptional<typebox79.TArray<_alepha_core1.TObject<{
163
- level: typebox79.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
164
- message: _alepha_core1.TString;
165
- service: _alepha_core1.TString;
166
- module: _alepha_core1.TString;
167
- context: _alepha_core1.TOptional<_alepha_core1.TString>;
168
- app: _alepha_core1.TOptional<_alepha_core1.TString>;
169
- data: _alepha_core1.TOptional<typebox79.TAny>;
170
- timestamp: _alepha_core1.TString;
171
- }>>>;
172
- }>>;
173
- protected readonly env: {
174
- JOB_PREFIX?: string | undefined;
175
- };
176
- protected readonly logs: Map<string, {
177
- context?: string | undefined;
178
- app?: string | undefined;
179
- data?: any;
180
- level: "SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR";
181
- message: string;
182
- service: string;
183
- module: string;
184
- timestamp: string;
185
- }[]>;
186
- protected readonly jobs: Map<string, JobRegistration>;
187
- /**
188
- * Register and set up a job for execution (called during descriptor initialization).
189
- */
190
- registerJob(options: Job): JobRegistration;
191
- /**
192
- * Trigger a job by name.
193
- */
194
- triggerJob(jobName: string): Promise<void>;
195
- /**
196
- * Execute a job handler (called by the job descriptor).
197
- */
198
- executeJob(jobName: string, handler: (args: {
199
- now: DateTime;
200
- }) => Async<void>): Promise<void>;
201
- }
202
- interface Job {
203
- /**
204
- * Name of the job.
205
- */
206
- name: string;
207
- /**
208
- * Optional description of the job.
209
- */
210
- description?: string;
211
- /**
212
- * Function to run on schedule.
213
- */
214
- handler: (args: {
215
- now: DateTime;
216
- }) => Async<void>;
217
- /**
218
- * Cron expression to run the job.
219
- */
220
- cron?: string;
221
- /**
222
- * If true, the job will be locked and only one instance will run at a time.
223
- * You probably need to import {@link AlephaLockRedis} for distributed locking.
224
- *
225
- * @default true
226
- */
227
- lock?: boolean;
228
- /**
229
- * Optional prefix for job lock keys.
230
- */
231
- lockPrefix?: string;
232
- }
233
- interface JobRegistration {
234
- name: string;
235
- options: Job;
236
- lockDescriptor: LockDescriptor<() => Promise<void>> | null;
237
- }
238
- //#endregion
239
- //#region src/descriptors/$job.d.ts
240
- /**
241
- * Job descriptor - a drop-in replacement for $scheduler with built-in execution tracking.
242
- */
243
- declare const $job: {
244
- (options: JobDescriptorOptions): JobDescriptor;
245
- [KIND]: typeof JobDescriptor;
246
- };
247
- type JobDescriptorOptions = Omit<Job, "name"> & {
248
- /**
249
- * Name of the job. Defaults to the descriptor property name.
250
- */
251
- name?: string;
252
- };
253
- declare class JobDescriptor extends Descriptor<JobDescriptorOptions> {
254
- protected readonly jobProvider: JobProvider;
255
- get name(): string;
256
- protected onInit(): void;
257
- trigger(): Promise<void>;
258
- }
259
- interface JobHandlerArguments {
260
- now: DateTime;
261
- }
262
- //#endregion
263
- //#region src/entities/jobExecutions.d.ts
264
- declare const jobExecutions: _alepha_postgres0.EntityDescriptor<typebox79.TObject<{
265
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
266
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
267
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
268
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
269
- finishedAt: typebox79.TOptional<typebox79.TString>;
270
- job: typebox79.TString;
271
- status: typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
272
- error: typebox79.TOptional<typebox79.TString>;
273
- logs: typebox79.TOptional<typebox79.TArray<typebox79.TObject<{
274
- level: typebox79.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
275
- message: typebox79.TString;
276
- service: typebox79.TString;
277
- module: typebox79.TString;
278
- context: typebox79.TOptional<typebox79.TString>;
279
- app: typebox79.TOptional<typebox79.TString>;
280
- data: typebox79.TOptional<typebox79.TAny>;
281
- timestamp: typebox79.TString;
282
- }>>>;
283
- }>>;
284
- type JobExecutionEntity = Static<typeof jobExecutions.schema>;
285
- //#endregion
286
- //#region src/schemas/jobExecutionResourceSchema.d.ts
287
- declare const jobExecutionResourceSchema: typebox79.TObject<{
288
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
289
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
290
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
291
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox79.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
292
- finishedAt: typebox79.TOptional<typebox79.TString>;
293
- job: typebox79.TString;
294
- status: typebox79.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
295
- error: typebox79.TOptional<typebox79.TString>;
296
- logs: typebox79.TOptional<typebox79.TArray<typebox79.TObject<{
297
- level: typebox79.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
298
- message: typebox79.TString;
299
- service: typebox79.TString;
300
- module: typebox79.TString;
301
- context: typebox79.TOptional<typebox79.TString>;
302
- app: typebox79.TOptional<typebox79.TString>;
303
- data: typebox79.TOptional<typebox79.TAny>;
304
- timestamp: typebox79.TString;
305
- }>>>;
306
- }>;
307
- type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;
308
- //#endregion
309
- //#region src/schemas/triggerJobSchema.d.ts
310
- declare const triggerJobSchema: typebox79.TObject<{
311
- name: typebox79.TString;
312
- }>;
313
- type TriggerJob = Static<typeof triggerJobSchema>;
314
- //#endregion
315
- //#region src/index.d.ts
316
- /**
317
- * Provides job management API endpoints for Alepha applications.
318
- *
319
- * This module includes job queue operations, job status monitoring,
320
- * and background task management capabilities.
321
- *
322
- * @module alepha.api.jobs
323
- */
324
- declare const AlephaApiJobs: _alepha_core1.Service<_alepha_core1.Module>;
325
- //#endregion
326
- export { $job, AlephaApiJobs, Job, JobController, JobDescriptor, JobDescriptorOptions, JobExecutionEntity, JobExecutionQuery, JobExecutionResource, JobHandlerArguments, JobProvider, JobRegistration, JobService, TriggerJob, jobExecutionQuerySchema, jobExecutionResourceSchema, jobExecutions, triggerJobSchema };
327
- //# sourceMappingURL=index.d.ts.map
package/api/jobs.js DELETED
@@ -1 +0,0 @@
1
- export * from '@alepha/api-jobs'
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/api-notifications');
3
- Object.keys(m).forEach(function (k) {
4
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
- enumerable: true,
6
- get: function () { return m[k]; }
7
- });
8
- });
@@ -1,263 +0,0 @@
1
- import * as _alepha_core1 from "alepha";
2
- import { Alepha, Descriptor, KIND, Static, StaticEncode, TObject } from "alepha";
3
- import * as _alepha_batch0 from "alepha/batch";
4
- import { DateTimeProvider } from "alepha/datetime";
5
- import * as _alepha_logger0 from "alepha/logger";
6
- import * as _alepha_postgres0 from "alepha/postgres";
7
- import * as _alepha_queue0 from "alepha/queue";
8
- import { EmailProvider } from "alepha/email";
9
- import * as typebox0 from "typebox";
10
-
11
- //#region src/controllers/NotificationController.d.ts
12
- declare class NotificationController {}
13
- //#endregion
14
- //#region src/entities/notifications.d.ts
15
- declare const notifications: _alepha_postgres0.EntityDescriptor<typebox0.TObject<{
16
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
17
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
18
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
19
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
20
- type: typebox0.TUnsafe<"email" | "sms">;
21
- template: typebox0.TString;
22
- category: typebox0.TOptional<typebox0.TString>;
23
- critical: typebox0.TOptional<typebox0.TBoolean>;
24
- sensitive: typebox0.TOptional<typebox0.TBoolean>;
25
- contact: typebox0.TString;
26
- variables: typebox0.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
27
- scheduledAt: typebox0.TOptional<typebox0.TString>;
28
- sentAt: typebox0.TOptional<typebox0.TString>;
29
- error: typebox0.TOptional<typebox0.TObject<{
30
- at: typebox0.TString;
31
- name: typebox0.TString;
32
- message: typebox0.TString;
33
- }>>;
34
- }>>;
35
- type NotificationEntity = Static<typeof notifications.schema>;
36
- //#endregion
37
- //#region src/providers/SmsProvider.d.ts
38
- declare abstract class SmsProvider {
39
- abstract send(options: SmsSendOptions): Promise<void>;
40
- }
41
- interface SmsSendOptions {
42
- to: string;
43
- message: string;
44
- }
45
- //#endregion
46
- //#region src/services/NotificationSenderService.d.ts
47
- declare class NotificationSenderService {
48
- protected readonly alepha: Alepha;
49
- protected readonly log: _alepha_logger0.Logger;
50
- protected readonly notificationRepository: _alepha_postgres0.Repository<typebox0.TObject<{
51
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
52
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
53
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
54
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
55
- type: typebox0.TUnsafe<"email" | "sms">;
56
- template: typebox0.TString;
57
- category: typebox0.TOptional<typebox0.TString>;
58
- critical: typebox0.TOptional<typebox0.TBoolean>;
59
- sensitive: typebox0.TOptional<typebox0.TBoolean>;
60
- contact: typebox0.TString;
61
- variables: typebox0.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
62
- scheduledAt: typebox0.TOptional<typebox0.TString>;
63
- sentAt: typebox0.TOptional<typebox0.TString>;
64
- error: typebox0.TOptional<typebox0.TObject<{
65
- at: typebox0.TString;
66
- name: typebox0.TString;
67
- message: typebox0.TString;
68
- }>>;
69
- }>>;
70
- protected readonly dateTimeProvider: DateTimeProvider;
71
- protected readonly emailProvider: EmailProvider;
72
- protected readonly smsProvider: SmsProvider;
73
- send(notificationId: string | NotificationEntity): Promise<void>;
74
- renderSms(notification: NotificationEntity): {
75
- to: string;
76
- message: string;
77
- };
78
- renderEmail(notification: NotificationEntity): {
79
- to: string;
80
- subject: string;
81
- body: string;
82
- };
83
- protected load(notification: NotificationEntity): {
84
- template: NotificationDescriptor<typebox0.TObject<typebox0.TProperties>>;
85
- variables: Record<string, any>;
86
- contact: string;
87
- };
88
- }
89
- //#endregion
90
- //#region src/queues/NotificationQueues.d.ts
91
- declare class NotificationQueues {
92
- protected readonly notificationSenderService: NotificationSenderService;
93
- readonly processNotification: _alepha_queue0.QueueDescriptor<typebox0.TObject<{
94
- notificationId: typebox0.TString;
95
- }>>;
96
- }
97
- //#endregion
98
- //#region src/schemas/notificationCreateSchema.d.ts
99
- declare const notificationCreateSchema: typebox0.TObject<{
100
- type: typebox0.TUnsafe<"email" | "sms">;
101
- template: typebox0.TString;
102
- contact: typebox0.TString;
103
- variables: typebox0.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
104
- }>;
105
- type NotificationCreate = Static<typeof notificationCreateSchema>;
106
- //#endregion
107
- //#region src/services/NotificationService.d.ts
108
- declare const envSchema: _alepha_core1.TObject<{
109
- NOTIFICATION_IMMEDIATE: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
110
- }>;
111
- declare module "alepha" {
112
- interface Env extends Partial<Static<typeof envSchema>> {}
113
- }
114
- declare class NotificationService {
115
- protected readonly alepha: Alepha;
116
- protected readonly log: _alepha_logger0.Logger;
117
- protected readonly env: {
118
- NOTIFICATION_IMMEDIATE?: boolean | undefined;
119
- };
120
- protected readonly notificationRepository: _alepha_postgres0.Repository<_alepha_core1.TObject<{
121
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
122
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
123
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
124
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
125
- type: typebox0.TUnsafe<"email" | "sms">;
126
- template: typebox0.TString;
127
- category: _alepha_core1.TOptional<typebox0.TString>;
128
- critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
129
- sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
130
- contact: typebox0.TString;
131
- variables: _alepha_core1.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
132
- scheduledAt: _alepha_core1.TOptional<typebox0.TString>;
133
- sentAt: _alepha_core1.TOptional<typebox0.TString>;
134
- error: _alepha_core1.TOptional<_alepha_core1.TObject<{
135
- at: typebox0.TString;
136
- name: typebox0.TString;
137
- message: typebox0.TString;
138
- }>>;
139
- }>>;
140
- protected readonly dateTimeProvider: DateTimeProvider;
141
- protected readonly notificationQueues: NotificationQueues;
142
- protected readonly notificationSenderService: NotificationSenderService;
143
- readonly notificationBatch: _alepha_batch0.BatchDescriptor<_alepha_core1.TObject<{
144
- type: typebox0.TUnsafe<"email" | "sms">;
145
- template: typebox0.TString;
146
- contact: typebox0.TString;
147
- variables: _alepha_core1.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
148
- }>, Promise<void>>;
149
- findNotificationById(id: string): Promise<_alepha_postgres0.PgStatic<_alepha_core1.TObject<{
150
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
151
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
152
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
153
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
154
- type: typebox0.TUnsafe<"email" | "sms">;
155
- template: typebox0.TString;
156
- category: _alepha_core1.TOptional<typebox0.TString>;
157
- critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
158
- sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
159
- contact: typebox0.TString;
160
- variables: _alepha_core1.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
161
- scheduledAt: _alepha_core1.TOptional<typebox0.TString>;
162
- sentAt: _alepha_core1.TOptional<typebox0.TString>;
163
- error: _alepha_core1.TOptional<_alepha_core1.TObject<{
164
- at: typebox0.TString;
165
- name: typebox0.TString;
166
- message: typebox0.TString;
167
- }>>;
168
- }>, _alepha_postgres0.PgRelationMap<_alepha_core1.TObject<{
169
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
170
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
171
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
172
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
173
- type: typebox0.TUnsafe<"email" | "sms">;
174
- template: typebox0.TString;
175
- category: _alepha_core1.TOptional<typebox0.TString>;
176
- critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
177
- sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
178
- contact: typebox0.TString;
179
- variables: _alepha_core1.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
180
- scheduledAt: _alepha_core1.TOptional<typebox0.TString>;
181
- sentAt: _alepha_core1.TOptional<typebox0.TString>;
182
- error: _alepha_core1.TOptional<_alepha_core1.TObject<{
183
- at: typebox0.TString;
184
- name: typebox0.TString;
185
- message: typebox0.TString;
186
- }>>;
187
- }>>>>;
188
- /**
189
- * Create a new notification.
190
- */
191
- createNotification(entry: NotificationCreate, now?: boolean): Promise<void>;
192
- }
193
- //#endregion
194
- //#region src/descriptors/$notification.d.ts
195
- declare const $notification: {
196
- <T extends TObject>(options: NotificationDescriptorOptions<T>): NotificationDescriptor<T>;
197
- [KIND]: typeof NotificationDescriptor;
198
- };
199
- interface NotificationDescriptorOptions<T extends TObject> extends NotificationMessage<T> {
200
- name?: string;
201
- description?: string;
202
- category?: string;
203
- critical?: boolean;
204
- sensitive?: boolean;
205
- translations?: {
206
- [lang: string]: NotificationMessage<T>;
207
- };
208
- schema: T;
209
- }
210
- declare class NotificationDescriptor<T extends TObject> extends Descriptor<NotificationDescriptorOptions<T>> {
211
- protected readonly notificationService: NotificationService;
212
- get name(): string;
213
- push(options: NotificationPushOptions<T>): Promise<void>;
214
- configure(options: Partial<NotificationDescriptorOptions<T>>): void;
215
- }
216
- interface NotificationPushOptions<T extends TObject> {
217
- variables: StaticEncode<T>;
218
- contact: string;
219
- }
220
- interface NotificationMessage<T extends TObject> {
221
- email?: {
222
- subject: string;
223
- body: string | ((variables: Static<T>) => string);
224
- };
225
- sms?: {
226
- message: string | ((variables: Static<T>) => string);
227
- };
228
- }
229
- //#endregion
230
- //#region src/jobs/NotificationJobs.d.ts
231
- declare class NotificationJobs {}
232
- //#endregion
233
- //#region src/providers/MemorySmsProvider.d.ts
234
- interface SmsRecord {
235
- to: string;
236
- message: string;
237
- sentAt: Date;
238
- }
239
- declare class MemorySmsProvider extends SmsProvider {
240
- protected records: SmsRecord[];
241
- send(options: SmsSendOptions): Promise<void>;
242
- }
243
- //#endregion
244
- //#region src/schemas/notificationContactPreferencesSchema.d.ts
245
- declare const notificationContactPreferencesSchema: typebox0.TObject<{
246
- language: typebox0.TOptional<typebox0.TString>;
247
- exclude: typebox0.TArray<typebox0.TString>;
248
- }>;
249
- type NotificationContactPreferences = Static<typeof notificationContactPreferencesSchema>;
250
- //#endregion
251
- //#region src/index.d.ts
252
- /**
253
- * Provides notification management API endpoints for Alepha applications.
254
- *
255
- * This module includes notification sending, retrieval, status tracking,
256
- * and user notification preferences management.
257
- *
258
- * @module alepha.api.notifications
259
- */
260
- declare const AlephaApiNotifications: _alepha_core1.Service<_alepha_core1.Module>;
261
- //#endregion
262
- export { $notification, AlephaApiNotifications, MemorySmsProvider, NotificationContactPreferences, NotificationController, NotificationCreate, NotificationDescriptor, NotificationDescriptorOptions, NotificationEntity, NotificationJobs, NotificationMessage, NotificationPushOptions, NotificationQueues, NotificationSenderService, NotificationService, SmsProvider, SmsRecord, SmsSendOptions, notificationContactPreferencesSchema, notificationCreateSchema, notifications };
263
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export * from '@alepha/api-notifications'
package/api/users.cjs DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/api-users');
3
- Object.keys(m).forEach(function (k) {
4
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
- enumerable: true,
6
- get: function () { return m[k]; }
7
- });
8
- });