alepha 0.15.3 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/audits/index.d.ts +332 -332
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +8 -0
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.js +1 -0
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +151 -151
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +3 -0
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +195 -195
- package/dist/api/keys/index.d.ts.map +1 -1
- package/dist/api/notifications/index.browser.js +1 -0
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.js +1 -0
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/parameters/index.d.ts +260 -260
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +10 -0
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/users/index.d.ts +10 -10
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +11 -0
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +128 -128
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/batch/index.d.ts +4 -4
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +19 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/email/index.d.ts +13 -13
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +10554 -2
- package/dist/email/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +6 -1
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js +9 -1
- package/dist/lock/core/index.js.map +1 -1
- package/dist/react/auth/index.browser.js +2 -1
- package/dist/react/auth/index.browser.js.map +1 -1
- package/dist/react/auth/index.js +2 -1
- package/dist/react/auth/index.js.map +1 -1
- package/dist/react/core/index.d.ts +3 -3
- package/dist/react/router/index.d.ts +10 -0
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +16 -6
- package/dist/react/router/index.js.map +1 -1
- package/dist/redis/index.d.ts +19 -19
- package/dist/scheduler/index.d.ts +13 -1
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +42 -4
- package/dist/scheduler/index.js.map +1 -1
- package/dist/server/compress/index.d.ts.map +1 -1
- package/dist/server/compress/index.js +1 -0
- package/dist/server/compress/index.js.map +1 -1
- package/dist/server/core/index.d.ts +9 -9
- package/dist/server/links/index.js +1 -1
- package/dist/server/links/index.js.map +1 -1
- package/dist/vite/index.d.ts +2 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +28 -2
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.d.ts +34 -34
- package/dist/websocket/index.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/api/audits/controllers/AdminAuditController.ts +8 -0
- package/src/api/files/controllers/AdminFileStatsController.ts +1 -0
- package/src/api/jobs/controllers/AdminJobController.ts +3 -0
- package/src/api/notifications/controllers/AdminNotificationController.ts +1 -0
- package/src/api/parameters/controllers/AdminConfigController.ts +10 -0
- package/src/api/users/controllers/AdminIdentityController.ts +3 -0
- package/src/api/users/controllers/AdminSessionController.ts +3 -0
- package/src/api/users/controllers/AdminUserController.ts +5 -0
- package/src/cli/commands/build.ts +1 -0
- package/src/cli/providers/ViteDevServerProvider.ts +31 -0
- package/src/email/index.workerd.ts +36 -0
- package/src/email/providers/WorkermailerEmailProvider.ts +221 -0
- package/src/lock/core/primitives/$lock.ts +13 -1
- package/src/react/auth/services/ReactAuth.ts +3 -1
- package/src/react/router/atoms/ssrManifestAtom.ts +7 -0
- package/src/react/router/providers/ReactServerProvider.ts +14 -4
- package/src/react/router/providers/SSRManifestProvider.ts +7 -0
- package/src/scheduler/index.workerd.ts +43 -0
- package/src/scheduler/providers/CronProvider.ts +53 -6
- package/src/scheduler/providers/WorkerdCronProvider.ts +102 -0
- package/src/server/compress/providers/ServerCompressProvider.ts +6 -0
- package/src/server/links/providers/ServerLinksProvider.spec.ts +332 -0
- package/src/server/links/providers/ServerLinksProvider.ts +1 -1
- package/src/vite/tasks/generateCloudflare.ts +38 -2
package/dist/api/jobs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha179 from "alepha";
|
|
2
2
|
import { Alepha, Async, KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
3
|
import * as alepha_server0 from "alepha/server";
|
|
4
4
|
import * as alepha_orm0 from "alepha/orm";
|
|
@@ -229,76 +229,76 @@ interface PgRefOptions {
|
|
|
229
229
|
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
230
230
|
//#endregion
|
|
231
231
|
//#region ../../src/api/jobs/schemas/jobExecutionQuerySchema.d.ts
|
|
232
|
-
declare const jobExecutionQuerySchema:
|
|
233
|
-
page:
|
|
234
|
-
size:
|
|
235
|
-
sort:
|
|
236
|
-
status:
|
|
237
|
-
job:
|
|
232
|
+
declare const jobExecutionQuerySchema: alepha179.TObject<{
|
|
233
|
+
page: alepha179.TOptional<alepha179.TInteger>;
|
|
234
|
+
size: alepha179.TOptional<alepha179.TInteger>;
|
|
235
|
+
sort: alepha179.TOptional<alepha179.TString>;
|
|
236
|
+
status: alepha179.TOptional<alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
|
|
237
|
+
job: alepha179.TOptional<alepha179.TString>;
|
|
238
238
|
}>;
|
|
239
239
|
type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;
|
|
240
240
|
//#endregion
|
|
241
241
|
//#region ../../src/api/jobs/services/JobService.d.ts
|
|
242
242
|
declare class JobService {
|
|
243
243
|
protected readonly alepha: Alepha;
|
|
244
|
-
protected readonly executionRepository: alepha_orm0.Repository<
|
|
245
|
-
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
246
|
-
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
247
|
-
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
248
|
-
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
249
|
-
finishedAt:
|
|
250
|
-
job:
|
|
251
|
-
status:
|
|
252
|
-
error:
|
|
253
|
-
logs:
|
|
254
|
-
level:
|
|
255
|
-
message:
|
|
256
|
-
service:
|
|
257
|
-
module:
|
|
258
|
-
context:
|
|
259
|
-
app:
|
|
260
|
-
data:
|
|
261
|
-
timestamp:
|
|
244
|
+
protected readonly executionRepository: alepha_orm0.Repository<alepha179.TObject<{
|
|
245
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
246
|
+
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
|
|
247
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
248
|
+
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
249
|
+
finishedAt: alepha179.TOptional<alepha179.TString>;
|
|
250
|
+
job: alepha179.TString;
|
|
251
|
+
status: alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
252
|
+
error: alepha179.TOptional<alepha179.TString>;
|
|
253
|
+
logs: alepha179.TOptional<alepha179.TArray<alepha179.TObject<{
|
|
254
|
+
level: alepha179.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
255
|
+
message: alepha179.TString;
|
|
256
|
+
service: alepha179.TString;
|
|
257
|
+
module: alepha179.TString;
|
|
258
|
+
context: alepha179.TOptional<alepha179.TString>;
|
|
259
|
+
app: alepha179.TOptional<alepha179.TString>;
|
|
260
|
+
data: alepha179.TOptional<alepha179.TAny>;
|
|
261
|
+
timestamp: alepha179.TNumber;
|
|
262
262
|
}>>>;
|
|
263
263
|
}>>;
|
|
264
264
|
getJobs(): Promise<string[]>;
|
|
265
|
-
getJobExecutions(query?: JobExecutionQuery): Promise<
|
|
266
|
-
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
267
|
-
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
268
|
-
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
269
|
-
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
270
|
-
finishedAt:
|
|
271
|
-
job:
|
|
272
|
-
status:
|
|
273
|
-
error:
|
|
274
|
-
logs:
|
|
275
|
-
level:
|
|
276
|
-
message:
|
|
277
|
-
service:
|
|
278
|
-
module:
|
|
279
|
-
context:
|
|
280
|
-
app:
|
|
281
|
-
data:
|
|
282
|
-
timestamp:
|
|
265
|
+
getJobExecutions(query?: JobExecutionQuery): Promise<alepha179.Page<alepha_orm0.PgStatic<alepha179.TObject<{
|
|
266
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
267
|
+
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
|
|
268
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
269
|
+
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
270
|
+
finishedAt: alepha179.TOptional<alepha179.TString>;
|
|
271
|
+
job: alepha179.TString;
|
|
272
|
+
status: alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
273
|
+
error: alepha179.TOptional<alepha179.TString>;
|
|
274
|
+
logs: alepha179.TOptional<alepha179.TArray<alepha179.TObject<{
|
|
275
|
+
level: alepha179.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
276
|
+
message: alepha179.TString;
|
|
277
|
+
service: alepha179.TString;
|
|
278
|
+
module: alepha179.TString;
|
|
279
|
+
context: alepha179.TOptional<alepha179.TString>;
|
|
280
|
+
app: alepha179.TOptional<alepha179.TString>;
|
|
281
|
+
data: alepha179.TOptional<alepha179.TAny>;
|
|
282
|
+
timestamp: alepha179.TNumber;
|
|
283
283
|
}>>>;
|
|
284
|
-
}>, alepha_orm0.PgRelationMap<
|
|
285
|
-
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
286
|
-
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
287
|
-
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
288
|
-
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
289
|
-
finishedAt:
|
|
290
|
-
job:
|
|
291
|
-
status:
|
|
292
|
-
error:
|
|
293
|
-
logs:
|
|
294
|
-
level:
|
|
295
|
-
message:
|
|
296
|
-
service:
|
|
297
|
-
module:
|
|
298
|
-
context:
|
|
299
|
-
app:
|
|
300
|
-
data:
|
|
301
|
-
timestamp:
|
|
284
|
+
}>, alepha_orm0.PgRelationMap<alepha179.TObject<{
|
|
285
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
286
|
+
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
|
|
287
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
288
|
+
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
289
|
+
finishedAt: alepha179.TOptional<alepha179.TString>;
|
|
290
|
+
job: alepha179.TString;
|
|
291
|
+
status: alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
292
|
+
error: alepha179.TOptional<alepha179.TString>;
|
|
293
|
+
logs: alepha179.TOptional<alepha179.TArray<alepha179.TObject<{
|
|
294
|
+
level: alepha179.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
295
|
+
message: alepha179.TString;
|
|
296
|
+
service: alepha179.TString;
|
|
297
|
+
module: alepha179.TString;
|
|
298
|
+
context: alepha179.TOptional<alepha179.TString>;
|
|
299
|
+
app: alepha179.TOptional<alepha179.TString>;
|
|
300
|
+
data: alepha179.TOptional<alepha179.TAny>;
|
|
301
|
+
timestamp: alepha179.TNumber;
|
|
302
302
|
}>>>;
|
|
303
303
|
}>>>>>;
|
|
304
304
|
triggerJob(name: string): Promise<{
|
|
@@ -312,75 +312,75 @@ declare class AdminJobController {
|
|
|
312
312
|
protected readonly group: string;
|
|
313
313
|
protected readonly jobService: JobService;
|
|
314
314
|
readonly getJobs: alepha_server0.ActionPrimitiveFn<{
|
|
315
|
-
response:
|
|
315
|
+
response: alepha179.TArray<alepha179.TString>;
|
|
316
316
|
}>;
|
|
317
317
|
readonly getJobExecutions: alepha_server0.ActionPrimitiveFn<{
|
|
318
|
-
query:
|
|
319
|
-
page:
|
|
320
|
-
size:
|
|
321
|
-
sort:
|
|
322
|
-
status:
|
|
323
|
-
job:
|
|
318
|
+
query: alepha179.TObject<{
|
|
319
|
+
page: alepha179.TOptional<alepha179.TInteger>;
|
|
320
|
+
size: alepha179.TOptional<alepha179.TInteger>;
|
|
321
|
+
sort: alepha179.TOptional<alepha179.TString>;
|
|
322
|
+
status: alepha179.TOptional<alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
|
|
323
|
+
job: alepha179.TOptional<alepha179.TString>;
|
|
324
324
|
}>;
|
|
325
|
-
response:
|
|
326
|
-
id: PgAttr<PgAttr<
|
|
327
|
-
version: PgAttr<PgAttr<
|
|
328
|
-
createdAt: PgAttr<PgAttr<
|
|
329
|
-
updatedAt: PgAttr<PgAttr<
|
|
330
|
-
finishedAt:
|
|
331
|
-
job:
|
|
332
|
-
status:
|
|
333
|
-
error:
|
|
334
|
-
logs:
|
|
335
|
-
level:
|
|
336
|
-
message:
|
|
337
|
-
service:
|
|
338
|
-
module:
|
|
339
|
-
context:
|
|
340
|
-
app:
|
|
341
|
-
data:
|
|
342
|
-
timestamp:
|
|
325
|
+
response: alepha179.TPage<alepha179.TObject<{
|
|
326
|
+
id: PgAttr<PgAttr<alepha179.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
327
|
+
version: PgAttr<PgAttr<alepha179.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
328
|
+
createdAt: PgAttr<PgAttr<alepha179.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
329
|
+
updatedAt: PgAttr<PgAttr<alepha179.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
330
|
+
finishedAt: alepha179.TOptional<alepha179.TString>;
|
|
331
|
+
job: alepha179.TString;
|
|
332
|
+
status: alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
333
|
+
error: alepha179.TOptional<alepha179.TString>;
|
|
334
|
+
logs: alepha179.TOptional<alepha179.TArray<alepha179.TObject<{
|
|
335
|
+
level: alepha179.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
336
|
+
message: alepha179.TString;
|
|
337
|
+
service: alepha179.TString;
|
|
338
|
+
module: alepha179.TString;
|
|
339
|
+
context: alepha179.TOptional<alepha179.TString>;
|
|
340
|
+
app: alepha179.TOptional<alepha179.TString>;
|
|
341
|
+
data: alepha179.TOptional<alepha179.TAny>;
|
|
342
|
+
timestamp: alepha179.TNumber;
|
|
343
343
|
}>>>;
|
|
344
344
|
}>>;
|
|
345
345
|
}>;
|
|
346
346
|
readonly triggerJob: alepha_server0.ActionPrimitiveFn<{
|
|
347
|
-
body:
|
|
348
|
-
name:
|
|
347
|
+
body: alepha179.TObject<{
|
|
348
|
+
name: alepha179.TString;
|
|
349
349
|
}>;
|
|
350
|
-
response:
|
|
351
|
-
ok:
|
|
352
|
-
id:
|
|
353
|
-
count:
|
|
350
|
+
response: alepha179.TObject<{
|
|
351
|
+
ok: alepha179.TBoolean;
|
|
352
|
+
id: alepha179.TOptional<alepha179.TUnion<[alepha179.TString, alepha179.TInteger]>>;
|
|
353
|
+
count: alepha179.TOptional<alepha179.TNumber>;
|
|
354
354
|
}>;
|
|
355
355
|
}>;
|
|
356
356
|
}
|
|
357
357
|
//#endregion
|
|
358
358
|
//#region ../../src/api/jobs/entities/jobExecutions.d.ts
|
|
359
|
-
declare const jobExecutions: alepha_orm0.EntityPrimitive<
|
|
360
|
-
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
361
|
-
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
362
|
-
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
363
|
-
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
364
|
-
finishedAt:
|
|
365
|
-
job:
|
|
366
|
-
status:
|
|
367
|
-
error:
|
|
368
|
-
logs:
|
|
369
|
-
level:
|
|
370
|
-
message:
|
|
371
|
-
service:
|
|
372
|
-
module:
|
|
373
|
-
context:
|
|
374
|
-
app:
|
|
375
|
-
data:
|
|
376
|
-
timestamp:
|
|
359
|
+
declare const jobExecutions: alepha_orm0.EntityPrimitive<alepha179.TObject<{
|
|
360
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
361
|
+
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
|
|
362
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
363
|
+
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
364
|
+
finishedAt: alepha179.TOptional<alepha179.TString>;
|
|
365
|
+
job: alepha179.TString;
|
|
366
|
+
status: alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
367
|
+
error: alepha179.TOptional<alepha179.TString>;
|
|
368
|
+
logs: alepha179.TOptional<alepha179.TArray<alepha179.TObject<{
|
|
369
|
+
level: alepha179.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
370
|
+
message: alepha179.TString;
|
|
371
|
+
service: alepha179.TString;
|
|
372
|
+
module: alepha179.TString;
|
|
373
|
+
context: alepha179.TOptional<alepha179.TString>;
|
|
374
|
+
app: alepha179.TOptional<alepha179.TString>;
|
|
375
|
+
data: alepha179.TOptional<alepha179.TAny>;
|
|
376
|
+
timestamp: alepha179.TNumber;
|
|
377
377
|
}>>>;
|
|
378
378
|
}>>;
|
|
379
379
|
type JobExecutionEntity = Static<typeof jobExecutions.schema>;
|
|
380
380
|
//#endregion
|
|
381
381
|
//#region ../../src/api/jobs/providers/JobProvider.d.ts
|
|
382
|
-
declare const envSchema:
|
|
383
|
-
JOB_PREFIX:
|
|
382
|
+
declare const envSchema: alepha179.TObject<{
|
|
383
|
+
JOB_PREFIX: alepha179.TOptional<alepha179.TString>;
|
|
384
384
|
}>;
|
|
385
385
|
declare module "alepha" {
|
|
386
386
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -393,24 +393,24 @@ declare class JobProvider {
|
|
|
393
393
|
protected readonly alepha: Alepha;
|
|
394
394
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
395
395
|
protected readonly cronProvider: CronProvider;
|
|
396
|
-
protected readonly executionRepository: alepha_orm0.Repository<
|
|
397
|
-
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
398
|
-
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
399
|
-
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
400
|
-
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<
|
|
401
|
-
finishedAt:
|
|
402
|
-
job:
|
|
403
|
-
status:
|
|
404
|
-
error:
|
|
405
|
-
logs:
|
|
406
|
-
level:
|
|
407
|
-
message:
|
|
408
|
-
service:
|
|
409
|
-
module:
|
|
410
|
-
context:
|
|
411
|
-
app:
|
|
412
|
-
data:
|
|
413
|
-
timestamp:
|
|
396
|
+
protected readonly executionRepository: alepha_orm0.Repository<alepha179.TObject<{
|
|
397
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
398
|
+
version: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TInteger, typeof alepha_orm0.PG_VERSION>, typeof alepha_orm0.PG_DEFAULT>;
|
|
399
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
400
|
+
updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha179.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
401
|
+
finishedAt: alepha179.TOptional<alepha179.TString>;
|
|
402
|
+
job: alepha179.TString;
|
|
403
|
+
status: alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
404
|
+
error: alepha179.TOptional<alepha179.TString>;
|
|
405
|
+
logs: alepha179.TOptional<alepha179.TArray<alepha179.TObject<{
|
|
406
|
+
level: alepha179.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
407
|
+
message: alepha179.TString;
|
|
408
|
+
service: alepha179.TString;
|
|
409
|
+
module: alepha179.TString;
|
|
410
|
+
context: alepha179.TOptional<alepha179.TString>;
|
|
411
|
+
app: alepha179.TOptional<alepha179.TString>;
|
|
412
|
+
data: alepha179.TOptional<alepha179.TAny>;
|
|
413
|
+
timestamp: alepha179.TNumber;
|
|
414
414
|
}>>>;
|
|
415
415
|
}>>;
|
|
416
416
|
protected readonly env: {
|
|
@@ -504,31 +504,31 @@ interface JobHandlerArguments {
|
|
|
504
504
|
}
|
|
505
505
|
//#endregion
|
|
506
506
|
//#region ../../src/api/jobs/schemas/jobExecutionResourceSchema.d.ts
|
|
507
|
-
declare const jobExecutionResourceSchema:
|
|
508
|
-
id: PgAttr<PgAttr<
|
|
509
|
-
version: PgAttr<PgAttr<
|
|
510
|
-
createdAt: PgAttr<PgAttr<
|
|
511
|
-
updatedAt: PgAttr<PgAttr<
|
|
512
|
-
finishedAt:
|
|
513
|
-
job:
|
|
514
|
-
status:
|
|
515
|
-
error:
|
|
516
|
-
logs:
|
|
517
|
-
level:
|
|
518
|
-
message:
|
|
519
|
-
service:
|
|
520
|
-
module:
|
|
521
|
-
context:
|
|
522
|
-
app:
|
|
523
|
-
data:
|
|
524
|
-
timestamp:
|
|
507
|
+
declare const jobExecutionResourceSchema: alepha179.TObject<{
|
|
508
|
+
id: PgAttr<PgAttr<alepha179.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
509
|
+
version: PgAttr<PgAttr<alepha179.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
510
|
+
createdAt: PgAttr<PgAttr<alepha179.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
511
|
+
updatedAt: PgAttr<PgAttr<alepha179.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
512
|
+
finishedAt: alepha179.TOptional<alepha179.TString>;
|
|
513
|
+
job: alepha179.TString;
|
|
514
|
+
status: alepha179.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
|
|
515
|
+
error: alepha179.TOptional<alepha179.TString>;
|
|
516
|
+
logs: alepha179.TOptional<alepha179.TArray<alepha179.TObject<{
|
|
517
|
+
level: alepha179.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
518
|
+
message: alepha179.TString;
|
|
519
|
+
service: alepha179.TString;
|
|
520
|
+
module: alepha179.TString;
|
|
521
|
+
context: alepha179.TOptional<alepha179.TString>;
|
|
522
|
+
app: alepha179.TOptional<alepha179.TString>;
|
|
523
|
+
data: alepha179.TOptional<alepha179.TAny>;
|
|
524
|
+
timestamp: alepha179.TNumber;
|
|
525
525
|
}>>>;
|
|
526
526
|
}>;
|
|
527
527
|
type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;
|
|
528
528
|
//#endregion
|
|
529
529
|
//#region ../../src/api/jobs/schemas/triggerJobSchema.d.ts
|
|
530
|
-
declare const triggerJobSchema:
|
|
531
|
-
name:
|
|
530
|
+
declare const triggerJobSchema: alepha179.TObject<{
|
|
531
|
+
name: alepha179.TString;
|
|
532
532
|
}>;
|
|
533
533
|
type TriggerJob = Static<typeof triggerJobSchema>;
|
|
534
534
|
//#endregion
|
|
@@ -548,7 +548,7 @@ type TriggerJob = Static<typeof triggerJobSchema>;
|
|
|
548
548
|
*
|
|
549
549
|
* @module alepha.api.jobs
|
|
550
550
|
*/
|
|
551
|
-
declare const AlephaApiJobs:
|
|
551
|
+
declare const AlephaApiJobs: alepha179.Service<alepha179.Module>;
|
|
552
552
|
//#endregion
|
|
553
553
|
export { $job, AdminJobController, AlephaApiJobs, Job, JobExecutionEntity, JobExecutionQuery, JobExecutionResource, JobHandlerArguments, JobPrimitive, JobPrimitiveOptions, JobProvider, JobRegistration, JobService, TriggerJob, jobExecutionQuerySchema, jobExecutionResourceSchema, jobExecutions, triggerJobSchema };
|
|
554
554
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/orm/schemas/insertSchema.ts","../../../src/orm/schemas/updateSchema.ts","../../../src/orm/primitives/$entity.ts","../../../src/orm/constants/PG_SYMBOLS.ts","../../../src/orm/helpers/pgAttr.ts","../../../src/api/jobs/schemas/jobExecutionQuerySchema.ts","../../../src/api/jobs/services/JobService.ts","../../../src/api/jobs/controllers/AdminJobController.ts","../../../src/api/jobs/entities/jobExecutions.ts","../../../src/api/jobs/providers/JobProvider.ts","../../../src/api/jobs/primitives/$job.ts","../../../src/api/jobs/schemas/jobExecutionResourceSchema.ts","../../../src/api/jobs/schemas/triggerJobSchema.ts","../../../src/api/jobs/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;KAaY,aAAA,WAAwB,OAAA,IAAW,OAAA,eACjC,CAAA,iBAAkB,CAAA,eAAgB,CAAA;EAAA,CACvC,UAAA;AAAA;EACD,WAAA;AAAA,IACF,SAAA,CAAU,CAAA,eAAgB,CAAA,KAC1B,CAAA,eAAgB,CAAA;;;;;;;;;;;;KCDV,aAAA,WAAwB,OAAA,IAAW,OAAA,eACjC,CAAA,iBAAkB,CAAA,eAAgB,C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AAA,CAAA,UAAA,WAAA,OAAA;8CADb,SAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;EAGZ,OAAA,CAAA,GAAW,OAAA;EAKX,gBAAA,CAAiB,KAAA,GAAO,iBAAA,GAAsB,OAAA,CAAA,SAAA,CAAA,IAAA,aAAA,QAAA,WAAA,OAAA;8CAAA,SAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;8CAAA,SAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;EAoB9C,UAAA,CAAW,IAAA,WAAe,OAAA;IAAU,EAAA;EAAA;AAAA;;;cC5BtC,kBAAA;EAAA,mBACQ,GAAA;EAAA,mBACA,KAAA;EAAA,mBACA,UAAA,EAAU,UAAA;EAAA,SAEb,OAAA,iBAAO,iBAAA;+BAFM,SAAA,CAAA,OAAA;EAAA;EAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/orm/schemas/insertSchema.ts","../../../src/orm/schemas/updateSchema.ts","../../../src/orm/primitives/$entity.ts","../../../src/orm/constants/PG_SYMBOLS.ts","../../../src/orm/helpers/pgAttr.ts","../../../src/api/jobs/schemas/jobExecutionQuerySchema.ts","../../../src/api/jobs/services/JobService.ts","../../../src/api/jobs/controllers/AdminJobController.ts","../../../src/api/jobs/entities/jobExecutions.ts","../../../src/api/jobs/providers/JobProvider.ts","../../../src/api/jobs/primitives/$job.ts","../../../src/api/jobs/schemas/jobExecutionResourceSchema.ts","../../../src/api/jobs/schemas/triggerJobSchema.ts","../../../src/api/jobs/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;KAaY,aAAA,WAAwB,OAAA,IAAW,OAAA,eACjC,CAAA,iBAAkB,CAAA,eAAgB,CAAA;EAAA,CACvC,UAAA;AAAA;EACD,WAAA;AAAA,IACF,SAAA,CAAU,CAAA,eAAgB,CAAA,KAC1B,CAAA,eAAgB,CAAA;;;;;;;;;;;;KCDV,aAAA,WAAwB,OAAA,IAAW,OAAA,eACjC,CAAA,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A,CAGxB,SAAA,CAHwB,MAAA"}
|
package/dist/api/jobs/index.js
CHANGED
|
@@ -217,12 +217,14 @@ var AdminJobController = class {
|
|
|
217
217
|
getJobs = $action({
|
|
218
218
|
path: this.url,
|
|
219
219
|
group: this.group,
|
|
220
|
+
secure: true,
|
|
220
221
|
schema: { response: t.array(t.string()) },
|
|
221
222
|
handler: () => this.jobService.getJobs()
|
|
222
223
|
});
|
|
223
224
|
getJobExecutions = $action({
|
|
224
225
|
path: `${this.url}/executions`,
|
|
225
226
|
group: this.group,
|
|
227
|
+
secure: true,
|
|
226
228
|
schema: {
|
|
227
229
|
query: jobExecutionQuerySchema,
|
|
228
230
|
response: t.page(jobExecutionResourceSchema)
|
|
@@ -233,6 +235,7 @@ var AdminJobController = class {
|
|
|
233
235
|
method: "POST",
|
|
234
236
|
path: `${this.url}/trigger`,
|
|
235
237
|
group: this.group,
|
|
238
|
+
secure: true,
|
|
236
239
|
schema: {
|
|
237
240
|
body: triggerJobSchema,
|
|
238
241
|
response: okSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/api/jobs/schemas/jobExecutionQuerySchema.ts","../../../src/api/jobs/entities/jobExecutions.ts","../../../src/api/jobs/schemas/jobExecutionResourceSchema.ts","../../../src/api/jobs/schemas/triggerJobSchema.ts","../../../src/api/jobs/providers/JobProvider.ts","../../../src/api/jobs/primitives/$job.ts","../../../src/api/jobs/services/JobService.ts","../../../src/api/jobs/controllers/AdminJobController.ts","../../../src/api/jobs/index.ts"],"sourcesContent":["import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { pageQuerySchema } from \"alepha/orm\";\n\nexport const jobExecutionQuerySchema = t.extend(pageQuerySchema, {\n status: t.optional(t.enum([\"STARTED\", \"FAILED\", \"COMPLETED\"])),\n job: t.optional(\n t.text({\n description: \"Filter by job name\",\n }),\n ),\n});\n\nexport type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;\n","import { type Static, t } from \"alepha\";\nimport { logEntrySchema } from \"alepha/logger\";\nimport { $entity, db } from \"alepha/orm\";\n\nexport const jobExecutions = $entity({\n name: \"job_executions\",\n schema: t.object({\n id: db.primaryKey(t.uuid()),\n version: db.version(),\n createdAt: db.createdAt(),\n updatedAt: db.updatedAt(),\n finishedAt: t.optional(t.datetime()),\n job: t.string(),\n status: t.enum([\"STARTED\", \"FAILED\", \"COMPLETED\"]),\n error: t.optional(t.string()),\n logs: t.optional(t.array(logEntrySchema)),\n }),\n});\n\nexport type JobExecutionEntity = Static<typeof jobExecutions.schema>;\n","import { type Static, t } from \"alepha\";\nimport { jobExecutions } from \"../entities/jobExecutions.ts\";\n\nexport const jobExecutionResourceSchema = t.extend(\n jobExecutions.schema,\n {},\n {\n title: \"JobExecutionResource\",\n description:\n \"A job execution resource representing the execution details of a job.\",\n },\n);\n\nexport type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const triggerJobSchema = t.object({\n name: t.string(),\n});\n\nexport type TriggerJob = Static<typeof triggerJobSchema>;\n","import { $env, $inject, Alepha, type Async, type Static, t } from \"alepha\";\nimport { type DateTime, DateTimeProvider } from \"alepha/datetime\";\nimport { $lock, type LockPrimitive } from \"alepha/lock\";\nimport type { LogEntry } from \"alepha/logger\";\nimport { $repository } from \"alepha/orm\";\nimport { CronProvider } from \"alepha/scheduler\";\nimport { jobExecutions } from \"../entities/jobExecutions.ts\";\n\nconst envSchema = t.object({\n JOB_PREFIX: t.optional(\n t.text({\n description: \"Prefix for job lock keys\",\n }),\n ),\n});\n\ndeclare module \"alepha\" {\n interface Env extends Partial<Static<typeof envSchema>> {}\n}\n\n/**\n * Provider for job management and execution.\n * Handles job lifecycle, execution tracking, log capturing, and event emission.\n */\nexport class JobProvider {\n protected readonly alepha = $inject(Alepha);\n protected readonly dateTimeProvider = $inject(DateTimeProvider);\n protected readonly cronProvider = $inject(CronProvider);\n protected readonly executionRepository = $repository(jobExecutions);\n protected readonly env = $env(envSchema);\n protected readonly logs = new Map<string, LogEntry[]>();\n protected readonly jobs = new Map<string, JobRegistration>();\n\n /**\n * Register and set up a job for execution (called during primitive initialization).\n */\n public registerJob(options: Job): JobRegistration {\n const jobName = options.name;\n\n // Set up log capturing for this job (only once)\n if (this.jobs.size === 0) {\n this.alepha.events.on(\"log\", ({ entry }) => {\n const context = entry.context;\n if (!context) {\n return;\n }\n\n const entries = this.logs.get(context);\n if (!entries) {\n return;\n }\n\n entries.push(entry);\n this.logs.set(context, entries);\n });\n }\n\n // Create lock primitive if locking is enabled\n const lockPrimitive =\n options.lock !== false\n ? $lock({\n name: () => {\n const prefix = this.env.JOB_PREFIX\n ? `${this.env.JOB_PREFIX}:`\n : \"\";\n return `${prefix}job:${jobName}`;\n },\n handler: async () => {\n await this.executeJob(jobName, options.handler);\n },\n })\n : null;\n\n const registration: JobRegistration = {\n name: jobName,\n options,\n lockPrimitive,\n };\n\n this.jobs.set(jobName, registration);\n\n // Set up cron scheduling if provided\n if (options.cron) {\n this.cronProvider.createCronJob(jobName, options.cron, () =>\n this.triggerJob(jobName),\n );\n }\n\n return registration;\n }\n\n /**\n * Trigger a job by name.\n */\n public async triggerJob(jobName: string): Promise<void> {\n const registration = this.jobs.get(jobName);\n if (!registration) {\n throw new Error(`Job not registered: ${jobName}`);\n }\n\n // Execute handler with or without lock\n if (registration.options.lock !== false && registration.lockPrimitive) {\n await registration.lockPrimitive.run();\n } else {\n await this.executeJob(jobName, registration.options.handler);\n }\n }\n\n /**\n * Execute a job handler (called by the job primitive).\n */\n public async executeJob(\n jobName: string,\n handler: (args: { now: DateTime }) => Async<void>,\n ): Promise<void> {\n if (!this.alepha.isStarted()) {\n return;\n }\n\n const context = this.alepha.context.createContextId();\n\n await this.alepha.context.run(\n async () => {\n try {\n const now = this.dateTimeProvider.now();\n\n // Initialize log collection for this context\n this.logs.set(context, []);\n\n // Create execution record\n await this.executionRepository.create({\n job: jobName,\n status: \"STARTED\",\n });\n\n await this.alepha.events.emit(\"scheduler:begin\", {\n name: jobName,\n now,\n context,\n });\n\n // Execute the handler\n await handler({ now });\n\n // Update execution as completed\n const logs = this.logs.get(context) || [];\n const exec = await this.executionRepository.findOne({\n where: {\n job: jobName,\n status: \"STARTED\",\n },\n });\n\n exec.status = \"COMPLETED\";\n exec.logs = logs;\n exec.finishedAt = this.dateTimeProvider.nowISOString();\n\n await this.executionRepository.save(exec);\n\n await this.alepha.events.emit(\n \"scheduler:success\",\n {\n name: jobName,\n context,\n },\n {\n catch: true,\n },\n );\n } catch (error) {\n // Update execution as failed\n const logs = this.logs.get(context) || [];\n const exec = await this.executionRepository.findOne({\n where: {\n job: jobName,\n status: \"STARTED\",\n },\n });\n\n exec.status = \"FAILED\";\n exec.error = (error as Error).message;\n exec.logs = logs;\n exec.finishedAt = this.dateTimeProvider.nowISOString();\n\n await this.executionRepository.save(exec);\n\n await this.alepha.events.emit(\n \"scheduler:error\",\n {\n name: jobName,\n error: error as Error,\n context,\n },\n {\n catch: true,\n },\n );\n\n // Don't re-throw, jobs should handle errors gracefully\n }\n\n // Clean up logs\n this.logs.delete(context);\n\n await this.alepha.events.emit(\n \"scheduler:end\",\n {\n name: jobName,\n context,\n },\n {\n catch: true,\n },\n );\n },\n {\n context,\n },\n );\n }\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface Job {\n /**\n * Name of the job.\n */\n name: string;\n\n /**\n * Optional description of the job.\n */\n description?: string;\n\n /**\n * Function to run on schedule.\n */\n handler: (args: { now: DateTime }) => Async<void>;\n\n /**\n * Cron expression to run the job.\n */\n cron?: string;\n\n /**\n * If true, the job will be locked and only one instance will run at a time.\n * You probably need to import {@link AlephaLockRedis} for distributed locking.\n *\n * @default true\n */\n lock?: boolean;\n\n /**\n * Optional prefix for job lock keys.\n */\n lockPrefix?: string;\n}\n\nexport interface JobRegistration {\n name: string;\n options: Job;\n lockPrimitive: LockPrimitive<() => Promise<void>> | null;\n}\n","import { $inject, createPrimitive, KIND, Primitive } from \"alepha\";\nimport type { DateTime } from \"alepha/datetime\";\nimport { type Job, JobProvider } from \"../providers/JobProvider.ts\";\n\n/**\n * Job primitive - a drop-in replacement for $scheduler with built-in execution tracking.\n */\nexport const $job = (options: JobPrimitiveOptions): JobPrimitive => {\n return createPrimitive(JobPrimitive, options);\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport type JobPrimitiveOptions = Omit<Job, \"name\"> & {\n /**\n * Name of the job. Defaults to the primitive property name.\n */\n name?: string;\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport class JobPrimitive extends Primitive<JobPrimitiveOptions> {\n protected readonly jobProvider = $inject(JobProvider);\n\n public get name(): string {\n return (\n this.options.name ??\n `${this.config.service.name}.${this.config.propertyKey}`\n );\n }\n\n protected onInit() {\n // Register job with JobProvider\n this.jobProvider.registerJob({\n ...this.options,\n name: this.name,\n });\n }\n\n public async trigger(): Promise<void> {\n await this.jobProvider.triggerJob(this.name);\n }\n}\n\n$job[KIND] = JobPrimitive;\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface JobHandlerArguments {\n now: DateTime;\n}\n","import { $inject, Alepha } from \"alepha\";\nimport { $repository } from \"alepha/orm\";\nimport { jobExecutions } from \"../entities/jobExecutions.ts\";\nimport { $job } from \"../primitives/$job.ts\";\nimport type { JobExecutionQuery } from \"../schemas/jobExecutionQuerySchema.ts\";\n\nexport class JobService {\n protected readonly alepha = $inject(Alepha);\n protected readonly executionRepository = $repository(jobExecutions);\n\n public async getJobs(): Promise<string[]> {\n const jobPrimitives = this.alepha.primitives($job);\n return jobPrimitives.map((job) => job.name);\n }\n\n public async getJobExecutions(query: JobExecutionQuery = {}) {\n query.sort ??= \"-createdAt\";\n\n const where = this.executionRepository.createQueryWhere();\n\n if (query.job) {\n where.job = { eq: query.job };\n }\n\n if (query.status) {\n where.status = { eq: query.status };\n }\n\n return await this.executionRepository.paginate(\n query,\n { where },\n { count: true },\n );\n }\n\n public async triggerJob(name: string): Promise<{ ok: boolean }> {\n const jobPrimitives = this.alepha.primitives($job);\n const job = jobPrimitives.find((j) => j.name === name);\n\n if (!job) {\n throw new Error(`Job not found: ${name}`);\n }\n\n await job.trigger();\n return { ok: true };\n }\n}\n","import { $inject, t } from \"alepha\";\nimport { $action, okSchema } from \"alepha/server\";\nimport { jobExecutionQuerySchema } from \"../schemas/jobExecutionQuerySchema.ts\";\nimport { jobExecutionResourceSchema } from \"../schemas/jobExecutionResourceSchema.ts\";\nimport { triggerJobSchema } from \"../schemas/triggerJobSchema.ts\";\nimport { JobService } from \"../services/JobService.ts\";\n\nexport class AdminJobController {\n protected readonly url: string = \"/jobs\";\n protected readonly group: string = \"admin:jobs\";\n protected readonly jobService = $inject(JobService);\n\n public readonly getJobs = $action({\n path: this.url,\n group: this.group,\n schema: {\n response: t.array(t.string()),\n },\n handler: () => this.jobService.getJobs(),\n });\n\n public readonly getJobExecutions = $action({\n path: `${this.url}/executions`,\n group: this.group,\n schema: {\n query: jobExecutionQuerySchema,\n response: t.page(jobExecutionResourceSchema),\n },\n handler: ({ query }) => this.jobService.getJobExecutions(query),\n });\n\n public readonly triggerJob = $action({\n method: \"POST\",\n path: `${this.url}/trigger`,\n group: this.group,\n schema: {\n body: triggerJobSchema,\n response: okSchema,\n },\n handler: ({ body }) => this.jobService.triggerJob(body.name),\n });\n}\n","import { $module } from \"alepha\";\nimport { AdminJobController } from \"./controllers/AdminJobController.ts\";\nimport { JobProvider } from \"./providers/JobProvider.ts\";\nimport { JobService } from \"./services/JobService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./controllers/AdminJobController.ts\";\nexport * from \"./entities/jobExecutions.ts\";\nexport * from \"./primitives/$job.ts\";\nexport * from \"./providers/JobProvider.ts\";\nexport * from \"./schemas/jobExecutionQuerySchema.ts\";\nexport * from \"./schemas/jobExecutionResourceSchema.ts\";\nexport * from \"./schemas/triggerJobSchema.ts\";\nexport * from \"./services/JobService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * | type | quality | stability |\n * |------|---------|-----------|\n * | backend | standard | stable |\n *\n * Job execution monitoring.\n *\n * **Features:**\n * - Job definitions for tracking\n * - Job status tracking\n * - Execution history\n * - Retry management\n *\n * @module alepha.api.jobs\n */\nexport const AlephaApiJobs = $module({\n name: \"alepha.api.jobs\",\n services: [AdminJobController, JobProvider, JobService],\n});\n"],"mappings":";;;;;;;;;AAIA,MAAa,0BAA0B,EAAE,OAAO,iBAAiB;CAC/D,QAAQ,EAAE,SAAS,EAAE,KAAK;EAAC;EAAW;EAAU;EAAY,CAAC,CAAC;CAC9D,KAAK,EAAE,SACL,EAAE,KAAK,EACL,aAAa,sBACd,CAAC,CACH;CACF,CAAC;;;;ACPF,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,QAAQ,EAAE,OAAO;EACf,IAAI,GAAG,WAAW,EAAE,MAAM,CAAC;EAC3B,SAAS,GAAG,SAAS;EACrB,WAAW,GAAG,WAAW;EACzB,WAAW,GAAG,WAAW;EACzB,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC;EACpC,KAAK,EAAE,QAAQ;EACf,QAAQ,EAAE,KAAK;GAAC;GAAW;GAAU;GAAY,CAAC;EAClD,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC7B,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;EAC1C,CAAC;CACH,CAAC;;;;ACdF,MAAa,6BAA6B,EAAE,OAC1C,cAAc,QACd,EAAE,EACF;CACE,OAAO;CACP,aACE;CACH,CACF;;;;ACRD,MAAa,mBAAmB,EAAE,OAAO,EACvC,MAAM,EAAE,QAAQ,EACjB,CAAC;;;;ACGF,MAAM,YAAY,EAAE,OAAO,EACzB,YAAY,EAAE,SACZ,EAAE,KAAK,EACL,aAAa,4BACd,CAAC,CACH,EACF,CAAC;;;;;AAUF,IAAa,cAAb,MAAyB;CACvB,AAAmB,SAAS,QAAQ,OAAO;CAC3C,AAAm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ACnC,AAAmB,aAAa,QAAQ,WAAW;CAEnD,AAAgB,UAAU,QAAQ;EAChC,MAAM,KAAK;EACX,OAAO,KAAK;EACZ,QAAQ,EACN,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC9B;EACD,eAAe,KAAK,WAAW,SAAS;EACzC,CAAC;CAEF,AAAgB,mBAAmB,QAAQ;EACzC,MAAM,GAAG,KAAK,IAAI;EAClB,OAAO,KAAK;EACZ,QAAQ;GACN,OAAO;GACP,UAAU,EAAE,KAAK,2BAA2B;GAC7C;EACD,UAAU,EAAE,YAAY,KAAK,WAAW,iBAAiB,MAAM;EAChE,CAAC;CAEF,AAAgB,aAAa,QAAQ;EACnC,QAAQ;EACR,MAAM,GAAG,KAAK,IAAI;EAClB,OAAO,KAAK;EACZ,QAAQ;GACN,MAAM;GACN,UAAU;GACX;EACD,UAAU,EAAE,WAAW,KAAK,WAAW,WAAW,KAAK,KAAK;EAC7D,CAAC;;;;;;;;;;;;;;;;;;;;ACPJ,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,UAAU;EAAC;EAAoB;EAAa;EAAW;CACxD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/api/jobs/schemas/jobExecutionQuerySchema.ts","../../../src/api/jobs/entities/jobExecutions.ts","../../../src/api/jobs/schemas/jobExecutionResourceSchema.ts","../../../src/api/jobs/schemas/triggerJobSchema.ts","../../../src/api/jobs/providers/JobProvider.ts","../../../src/api/jobs/primitives/$job.ts","../../../src/api/jobs/services/JobService.ts","../../../src/api/jobs/controllers/AdminJobController.ts","../../../src/api/jobs/index.ts"],"sourcesContent":["import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\nimport { pageQuerySchema } from \"alepha/orm\";\n\nexport const jobExecutionQuerySchema = t.extend(pageQuerySchema, {\n status: t.optional(t.enum([\"STARTED\", \"FAILED\", \"COMPLETED\"])),\n job: t.optional(\n t.text({\n description: \"Filter by job name\",\n }),\n ),\n});\n\nexport type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;\n","import { type Static, t } from \"alepha\";\nimport { logEntrySchema } from \"alepha/logger\";\nimport { $entity, db } from \"alepha/orm\";\n\nexport const jobExecutions = $entity({\n name: \"job_executions\",\n schema: t.object({\n id: db.primaryKey(t.uuid()),\n version: db.version(),\n createdAt: db.createdAt(),\n updatedAt: db.updatedAt(),\n finishedAt: t.optional(t.datetime()),\n job: t.string(),\n status: t.enum([\"STARTED\", \"FAILED\", \"COMPLETED\"]),\n error: t.optional(t.string()),\n logs: t.optional(t.array(logEntrySchema)),\n }),\n});\n\nexport type JobExecutionEntity = Static<typeof jobExecutions.schema>;\n","import { type Static, t } from \"alepha\";\nimport { jobExecutions } from \"../entities/jobExecutions.ts\";\n\nexport const jobExecutionResourceSchema = t.extend(\n jobExecutions.schema,\n {},\n {\n title: \"JobExecutionResource\",\n description:\n \"A job execution resource representing the execution details of a job.\",\n },\n);\n\nexport type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;\n","import type { Static } from \"alepha\";\nimport { t } from \"alepha\";\n\nexport const triggerJobSchema = t.object({\n name: t.string(),\n});\n\nexport type TriggerJob = Static<typeof triggerJobSchema>;\n","import { $env, $inject, Alepha, type Async, type Static, t } from \"alepha\";\nimport { type DateTime, DateTimeProvider } from \"alepha/datetime\";\nimport { $lock, type LockPrimitive } from \"alepha/lock\";\nimport type { LogEntry } from \"alepha/logger\";\nimport { $repository } from \"alepha/orm\";\nimport { CronProvider } from \"alepha/scheduler\";\nimport { jobExecutions } from \"../entities/jobExecutions.ts\";\n\nconst envSchema = t.object({\n JOB_PREFIX: t.optional(\n t.text({\n description: \"Prefix for job lock keys\",\n }),\n ),\n});\n\ndeclare module \"alepha\" {\n interface Env extends Partial<Static<typeof envSchema>> {}\n}\n\n/**\n * Provider for job management and execution.\n * Handles job lifecycle, execution tracking, log capturing, and event emission.\n */\nexport class JobProvider {\n protected readonly alepha = $inject(Alepha);\n protected readonly dateTimeProvider = $inject(DateTimeProvider);\n protected readonly cronProvider = $inject(CronProvider);\n protected readonly executionRepository = $repository(jobExecutions);\n protected readonly env = $env(envSchema);\n protected readonly logs = new Map<string, LogEntry[]>();\n protected readonly jobs = new Map<string, JobRegistration>();\n\n /**\n * Register and set up a job for execution (called during primitive initialization).\n */\n public registerJob(options: Job): JobRegistration {\n const jobName = options.name;\n\n // Set up log capturing for this job (only once)\n if (this.jobs.size === 0) {\n this.alepha.events.on(\"log\", ({ entry }) => {\n const context = entry.context;\n if (!context) {\n return;\n }\n\n const entries = this.logs.get(context);\n if (!entries) {\n return;\n }\n\n entries.push(entry);\n this.logs.set(context, entries);\n });\n }\n\n // Create lock primitive if locking is enabled\n const lockPrimitive =\n options.lock !== false\n ? $lock({\n name: () => {\n const prefix = this.env.JOB_PREFIX\n ? `${this.env.JOB_PREFIX}:`\n : \"\";\n return `${prefix}job:${jobName}`;\n },\n handler: async () => {\n await this.executeJob(jobName, options.handler);\n },\n })\n : null;\n\n const registration: JobRegistration = {\n name: jobName,\n options,\n lockPrimitive,\n };\n\n this.jobs.set(jobName, registration);\n\n // Set up cron scheduling if provided\n if (options.cron) {\n this.cronProvider.createCronJob(jobName, options.cron, () =>\n this.triggerJob(jobName),\n );\n }\n\n return registration;\n }\n\n /**\n * Trigger a job by name.\n */\n public async triggerJob(jobName: string): Promise<void> {\n const registration = this.jobs.get(jobName);\n if (!registration) {\n throw new Error(`Job not registered: ${jobName}`);\n }\n\n // Execute handler with or without lock\n if (registration.options.lock !== false && registration.lockPrimitive) {\n await registration.lockPrimitive.run();\n } else {\n await this.executeJob(jobName, registration.options.handler);\n }\n }\n\n /**\n * Execute a job handler (called by the job primitive).\n */\n public async executeJob(\n jobName: string,\n handler: (args: { now: DateTime }) => Async<void>,\n ): Promise<void> {\n if (!this.alepha.isStarted()) {\n return;\n }\n\n const context = this.alepha.context.createContextId();\n\n await this.alepha.context.run(\n async () => {\n try {\n const now = this.dateTimeProvider.now();\n\n // Initialize log collection for this context\n this.logs.set(context, []);\n\n // Create execution record\n await this.executionRepository.create({\n job: jobName,\n status: \"STARTED\",\n });\n\n await this.alepha.events.emit(\"scheduler:begin\", {\n name: jobName,\n now,\n context,\n });\n\n // Execute the handler\n await handler({ now });\n\n // Update execution as completed\n const logs = this.logs.get(context) || [];\n const exec = await this.executionRepository.findOne({\n where: {\n job: jobName,\n status: \"STARTED\",\n },\n });\n\n exec.status = \"COMPLETED\";\n exec.logs = logs;\n exec.finishedAt = this.dateTimeProvider.nowISOString();\n\n await this.executionRepository.save(exec);\n\n await this.alepha.events.emit(\n \"scheduler:success\",\n {\n name: jobName,\n context,\n },\n {\n catch: true,\n },\n );\n } catch (error) {\n // Update execution as failed\n const logs = this.logs.get(context) || [];\n const exec = await this.executionRepository.findOne({\n where: {\n job: jobName,\n status: \"STARTED\",\n },\n });\n\n exec.status = \"FAILED\";\n exec.error = (error as Error).message;\n exec.logs = logs;\n exec.finishedAt = this.dateTimeProvider.nowISOString();\n\n await this.executionRepository.save(exec);\n\n await this.alepha.events.emit(\n \"scheduler:error\",\n {\n name: jobName,\n error: error as Error,\n context,\n },\n {\n catch: true,\n },\n );\n\n // Don't re-throw, jobs should handle errors gracefully\n }\n\n // Clean up logs\n this.logs.delete(context);\n\n await this.alepha.events.emit(\n \"scheduler:end\",\n {\n name: jobName,\n context,\n },\n {\n catch: true,\n },\n );\n },\n {\n context,\n },\n );\n }\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface Job {\n /**\n * Name of the job.\n */\n name: string;\n\n /**\n * Optional description of the job.\n */\n description?: string;\n\n /**\n * Function to run on schedule.\n */\n handler: (args: { now: DateTime }) => Async<void>;\n\n /**\n * Cron expression to run the job.\n */\n cron?: string;\n\n /**\n * If true, the job will be locked and only one instance will run at a time.\n * You probably need to import {@link AlephaLockRedis} for distributed locking.\n *\n * @default true\n */\n lock?: boolean;\n\n /**\n * Optional prefix for job lock keys.\n */\n lockPrefix?: string;\n}\n\nexport interface JobRegistration {\n name: string;\n options: Job;\n lockPrimitive: LockPrimitive<() => Promise<void>> | null;\n}\n","import { $inject, createPrimitive, KIND, Primitive } from \"alepha\";\nimport type { DateTime } from \"alepha/datetime\";\nimport { type Job, JobProvider } from \"../providers/JobProvider.ts\";\n\n/**\n * Job primitive - a drop-in replacement for $scheduler with built-in execution tracking.\n */\nexport const $job = (options: JobPrimitiveOptions): JobPrimitive => {\n return createPrimitive(JobPrimitive, options);\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport type JobPrimitiveOptions = Omit<Job, \"name\"> & {\n /**\n * Name of the job. Defaults to the primitive property name.\n */\n name?: string;\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport class JobPrimitive extends Primitive<JobPrimitiveOptions> {\n protected readonly jobProvider = $inject(JobProvider);\n\n public get name(): string {\n return (\n this.options.name ??\n `${this.config.service.name}.${this.config.propertyKey}`\n );\n }\n\n protected onInit() {\n // Register job with JobProvider\n this.jobProvider.registerJob({\n ...this.options,\n name: this.name,\n });\n }\n\n public async trigger(): Promise<void> {\n await this.jobProvider.triggerJob(this.name);\n }\n}\n\n$job[KIND] = JobPrimitive;\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface JobHandlerArguments {\n now: DateTime;\n}\n","import { $inject, Alepha } from \"alepha\";\nimport { $repository } from \"alepha/orm\";\nimport { jobExecutions } from \"../entities/jobExecutions.ts\";\nimport { $job } from \"../primitives/$job.ts\";\nimport type { JobExecutionQuery } from \"../schemas/jobExecutionQuerySchema.ts\";\n\nexport class JobService {\n protected readonly alepha = $inject(Alepha);\n protected readonly executionRepository = $repository(jobExecutions);\n\n public async getJobs(): Promise<string[]> {\n const jobPrimitives = this.alepha.primitives($job);\n return jobPrimitives.map((job) => job.name);\n }\n\n public async getJobExecutions(query: JobExecutionQuery = {}) {\n query.sort ??= \"-createdAt\";\n\n const where = this.executionRepository.createQueryWhere();\n\n if (query.job) {\n where.job = { eq: query.job };\n }\n\n if (query.status) {\n where.status = { eq: query.status };\n }\n\n return await this.executionRepository.paginate(\n query,\n { where },\n { count: true },\n );\n }\n\n public async triggerJob(name: string): Promise<{ ok: boolean }> {\n const jobPrimitives = this.alepha.primitives($job);\n const job = jobPrimitives.find((j) => j.name === name);\n\n if (!job) {\n throw new Error(`Job not found: ${name}`);\n }\n\n await job.trigger();\n return { ok: true };\n }\n}\n","import { $inject, t } from \"alepha\";\nimport { $action, okSchema } from \"alepha/server\";\nimport { jobExecutionQuerySchema } from \"../schemas/jobExecutionQuerySchema.ts\";\nimport { jobExecutionResourceSchema } from \"../schemas/jobExecutionResourceSchema.ts\";\nimport { triggerJobSchema } from \"../schemas/triggerJobSchema.ts\";\nimport { JobService } from \"../services/JobService.ts\";\n\nexport class AdminJobController {\n protected readonly url: string = \"/jobs\";\n protected readonly group: string = \"admin:jobs\";\n protected readonly jobService = $inject(JobService);\n\n public readonly getJobs = $action({\n path: this.url,\n group: this.group,\n secure: true,\n schema: {\n response: t.array(t.string()),\n },\n handler: () => this.jobService.getJobs(),\n });\n\n public readonly getJobExecutions = $action({\n path: `${this.url}/executions`,\n group: this.group,\n secure: true,\n schema: {\n query: jobExecutionQuerySchema,\n response: t.page(jobExecutionResourceSchema),\n },\n handler: ({ query }) => this.jobService.getJobExecutions(query),\n });\n\n public readonly triggerJob = $action({\n method: \"POST\",\n path: `${this.url}/trigger`,\n group: this.group,\n secure: true,\n schema: {\n body: triggerJobSchema,\n response: okSchema,\n },\n handler: ({ body }) => this.jobService.triggerJob(body.name),\n });\n}\n","import { $module } from \"alepha\";\nimport { AdminJobController } from \"./controllers/AdminJobController.ts\";\nimport { JobProvider } from \"./providers/JobProvider.ts\";\nimport { JobService } from \"./services/JobService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./controllers/AdminJobController.ts\";\nexport * from \"./entities/jobExecutions.ts\";\nexport * from \"./primitives/$job.ts\";\nexport * from \"./providers/JobProvider.ts\";\nexport * from \"./schemas/jobExecutionQuerySchema.ts\";\nexport * from \"./schemas/jobExecutionResourceSchema.ts\";\nexport * from \"./schemas/triggerJobSchema.ts\";\nexport * from \"./services/JobService.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * | type | quality | stability |\n * |------|---------|-----------|\n * | backend | standard | stable |\n *\n * Job execution monitoring.\n *\n * **Features:**\n * - Job definitions for tracking\n * - Job status tracking\n * - Execution history\n * - Retry management\n *\n * @module alepha.api.jobs\n */\nexport const AlephaApiJobs = $module({\n name: \"alepha.api.jobs\",\n services: [AdminJobController, JobProvider, JobService],\n});\n"],"mappings":";;;;;;;;;AAIA,MAAa,0BAA0B,EAAE,OAAO,iBAAiB;CAC/D,QAAQ,EAAE,SAAS,EAAE,KAAK;EAAC;EAAW;EAAU;EAAY,CAAC,CAAC;CAC9D,KAAK,EAAE,SACL,EAAE,KAAK,EACL,aAAa,sBACd,CAAC,CACH;CACF,CAAC;;;;ACPF,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,QAAQ,EAAE,OAAO;EACf,IAAI,GAAG,WAAW,EAAE,MAAM,CAAC;EAC3B,SAAS,GAAG,SAAS;EACrB,WAAW,GAAG,WAAW;EACzB,WAAW,GAAG,WAAW;EACzB,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC;EACpC,KAAK,EAAE,QAAQ;EACf,QAAQ,EAAE,KAAK;GAAC;GAAW;GAAU;GAAY,CAAC;EAClD,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC;EAC7B,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;EAC1C,CAAC;CACH,CAAC;;;;ACdF,MAAa,6BAA6B,EAAE,OAC1C,cAAc,QACd,EAAE,EACF;CACE,OAAO;CACP,aACE;CACH,CACF;;;;ACRD,MAAa,mBAAmB,EAAE,OAAO,EACvC,MAAM,EAAE,QAAQ,EACjB,CAAC;;;;ACGF,MAAM,YAAY,EAAE,OAAO,EACzB,YAAY,EAAE,SACZ,EAAE,KAAK,EACL,aAAa,4BACd,CAAC,CACH,EACF,CAAC;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