alepha 0.20.6 → 0.20.8
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/AGENTS.md +0 -1
- package/CLAUDE.md +0 -1
- package/assets/agents-template.md +0 -1
- package/dist/api/audits/index.browser.js +1 -0
- package/dist/api/audits/index.browser.js.map +1 -1
- package/dist/api/audits/index.d.ts +370 -355
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +1 -0
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.browser.js +1 -0
- package/dist/api/files/index.browser.js.map +1 -1
- package/dist/api/files/index.d.ts +179 -170
- package/dist/api/files/index.d.ts.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.browser.js +7 -0
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +259 -250
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +21 -3
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +198 -192
- package/dist/api/keys/index.d.ts.map +1 -1
- package/dist/api/keys/index.js +1 -0
- package/dist/api/keys/index.js.map +1 -1
- package/dist/api/notifications/index.d.ts +246 -245
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/organizations/index.d.ts +100 -97
- package/dist/api/organizations/index.d.ts.map +1 -1
- package/dist/api/parameters/index.d.ts +323 -320
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/payments/index.d.ts +431 -376
- package/dist/api/payments/index.d.ts.map +1 -1
- package/dist/api/payments/index.js +202 -87
- package/dist/api/payments/index.js.map +1 -1
- package/dist/api/subscriptions/index.d.ts +1695 -0
- package/dist/api/subscriptions/index.d.ts.map +1 -0
- package/dist/api/subscriptions/index.js +1919 -0
- package/dist/api/subscriptions/index.js.map +1 -0
- package/dist/api/users/index.d.ts +857 -841
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/verifications/index.d.ts +128 -127
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/bucket/index.d.ts +3 -2
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/cache/core/index.d.ts +114 -4
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/core/index.js +181 -15
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/core/index.workerd.js +181 -15
- package/dist/cache/core/index.workerd.js.map +1 -1
- package/dist/cache/database/index.d.ts +20 -19
- package/dist/cache/database/index.d.ts.map +1 -1
- package/dist/cache/redis/index.d.ts +3 -2
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cli/core/index.d.ts +116 -132
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +75 -7
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.d.ts +3 -2
- package/dist/cli/devtools/index.d.ts.map +1 -1
- package/dist/cli/platform/index.d.ts +346 -290
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +105 -6
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +12 -11
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/command/index.d.ts +5 -4
- package/dist/command/index.d.ts.map +1 -1
- package/dist/core/index.browser.js +1 -1
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +119 -118
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +1 -1
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +1 -1
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/crypto/index.d.ts +3 -2
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/email/core/index.d.ts +3 -2
- package/dist/email/core/index.d.ts.map +1 -1
- package/dist/email/smtp/index.d.ts +7 -6
- package/dist/email/smtp/index.d.ts.map +1 -1
- package/dist/lock/core/index.d.ts +5 -4
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/logger/index.d.ts +10 -9
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +9 -8
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +9 -3
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +31 -10
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +33 -14
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +31 -10
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +6 -5
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/queue/core/index.d.ts +5 -4
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/redis/index.d.ts +3 -2
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/react/form/index.d.ts +5 -0
- package/dist/react/form/index.d.ts.map +1 -1
- package/dist/react/form/index.js +6 -4
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +2 -1
- package/dist/react/i18n/index.d.ts.map +1 -1
- package/dist/react/router/index.d.ts +206 -205
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/ui/index.d.ts +11 -11
- package/dist/react/ui/index.d.ts.map +1 -1
- package/dist/scheduler/index.d.ts +3 -2
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/security/index.browser.js +29 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +82 -35
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +56 -3
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +163 -158
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +16 -4
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/core/index.d.ts +35 -34
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/cors/index.d.ts +7 -6
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/health/index.d.ts +16 -15
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/links/index.d.ts +51 -50
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.d.ts +6 -5
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/swagger/index.d.ts +2 -1
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/topic/redis/index.d.ts +3 -2
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/package.json +16 -32
- package/src/api/audits/entities/audits.ts +1 -0
- package/src/api/files/entities/files.ts +1 -0
- package/src/api/jobs/__tests__/$job.spec.ts +92 -40
- package/src/api/jobs/entities/jobExecutionEntity.ts +1 -0
- package/src/api/jobs/providers/JobProvider.ts +20 -5
- package/src/api/jobs/schemas/jobConfigAtom.ts +5 -0
- package/src/api/keys/entities/apiKeyEntity.ts +1 -0
- package/src/api/payments/controllers/MockCheckoutController.ts +146 -0
- package/src/api/payments/index.ts +3 -0
- package/src/api/payments/providers/MemoryPaymentProvider.ts +9 -4
- package/src/api/payments/providers/PaymentProvider.ts +25 -9
- package/src/api/payments/services/PaymentService.ts +3 -0
- package/src/api/subscriptions/__tests__/BillingService.spec.ts +218 -0
- package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +278 -0
- package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +212 -0
- package/src/api/subscriptions/controllers/SubscriptionController.ts +189 -0
- package/src/api/subscriptions/entities/subscriptionEvents.ts +54 -0
- package/src/api/subscriptions/entities/subscriptions.ts +68 -0
- package/src/api/subscriptions/index.ts +133 -0
- package/src/api/subscriptions/jobs/SubscriptionJobs.ts +382 -0
- package/src/api/subscriptions/middleware/$requireLimit.ts +50 -0
- package/src/api/subscriptions/middleware/$requirePlan.ts +49 -0
- package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +110 -0
- package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +8 -0
- package/src/api/subscriptions/schemas/changePlanSchema.ts +9 -0
- package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +11 -0
- package/src/api/subscriptions/schemas/entitlementsSchema.ts +21 -0
- package/src/api/subscriptions/schemas/mrrSchema.ts +13 -0
- package/src/api/subscriptions/schemas/planDefinitionSchema.ts +71 -0
- package/src/api/subscriptions/schemas/planResourceSchema.ts +25 -0
- package/src/api/subscriptions/schemas/subscriptionEventResourceSchema.ts +8 -0
- package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +19 -0
- package/src/api/subscriptions/schemas/subscriptionResourceSchema.ts +6 -0
- package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +32 -0
- package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +23 -0
- package/src/api/subscriptions/services/BillingService.ts +437 -0
- package/src/api/subscriptions/services/SubscriptionConfig.ts +56 -0
- package/src/api/subscriptions/services/SubscriptionService.ts +867 -0
- package/src/api/subscriptions/services/UsageService.ts +118 -0
- package/src/cache/core/__tests__/$cache.memory.spec.ts +450 -0
- package/src/cache/core/__tests__/$cache.swr.spec.ts +394 -0
- package/src/cache/core/index.ts +16 -0
- package/src/cache/core/primitives/$cache.ts +347 -21
- package/src/cli/core/tasks/BuildCloudflareTask.ts +16 -0
- package/src/cli/core/templates/agentMd.ts +39 -4
- package/src/cli/core/templates/biomeJson.ts +25 -1
- package/src/cli/core/templates/saasAdminLayoutTsx.ts +2 -2
- package/src/cli/platform/__tests__/CloudflareAdapter.spec.ts +117 -0
- package/src/cli/platform/adapters/CloudflareAdapter.ts +104 -7
- package/src/cli/platform/atoms/platformOptions.ts +13 -0
- package/src/cli/platform/schemas/platform.ts +1 -0
- package/src/cli/platform/services/CloudflareApi.ts +61 -0
- package/src/cli/platform/services/PlatformOrchestrator.ts +9 -4
- package/src/core/__tests__/$module.spec.ts +2 -2
- package/src/core/primitives/$module.ts +4 -4
- package/src/mcp/providers/McpServerProvider.ts +1 -1
- package/src/orm/core/providers/DatabaseTypeProvider.ts +9 -3
- package/src/orm/core/providers/drivers/DatabaseProvider.ts +1 -1
- package/src/orm/core/schemas/insertSchema.ts +10 -2
- package/src/orm/core/services/Repository.ts +27 -7
- package/src/react/form/hooks/useFormState.ts +8 -1
- package/src/react/form/index.ts +10 -1
- package/src/react/form/services/FormModel.ts +9 -3
- package/src/security/atoms/currentTenantAtom.ts +34 -0
- package/src/security/index.browser.ts +1 -0
- package/src/security/index.ts +12 -1
- package/src/security/primitives/$issuer.ts +17 -1
- package/src/security/providers/SecurityProvider.ts +37 -0
- package/src/server/auth/__tests__/validateRedirectUri.spec.ts +78 -0
- package/src/server/auth/providers/ServerAuthProvider.ts +21 -5
- package/tsconfig.base.json +2 -1
- package/dist/react/websocket/index.d.ts +0 -117
- package/dist/react/websocket/index.d.ts.map +0 -1
- package/dist/react/websocket/index.js +0 -108
- package/dist/react/websocket/index.js.map +0 -1
- package/dist/websocket/index.browser.js +0 -848
- package/dist/websocket/index.browser.js.map +0 -1
- package/dist/websocket/index.d.ts +0 -876
- package/dist/websocket/index.d.ts.map +0 -1
- package/dist/websocket/index.js +0 -1185
- package/dist/websocket/index.js.map +0 -1
- package/src/react/websocket/hooks/useRoom.tsx +0 -251
- package/src/react/websocket/index.ts +0 -7
- package/src/websocket/__tests__/$channel.spec.ts +0 -30
- package/src/websocket/__tests__/$websocket-new.spec.ts +0 -195
- package/src/websocket/__tests__/RoomManager.spec.ts +0 -146
- package/src/websocket/__tests__/websocket-integration.spec.ts +0 -951
- package/src/websocket/errors/WebSocketError.ts +0 -34
- package/src/websocket/index.browser.ts +0 -25
- package/src/websocket/index.shared.ts +0 -8
- package/src/websocket/index.ts +0 -85
- package/src/websocket/interfaces/WebSocketInterfaces.ts +0 -252
- package/src/websocket/primitives/$channel.ts +0 -131
- package/src/websocket/primitives/$websocket.ts +0 -107
- package/src/websocket/providers/NodeWebSocketServerProvider.ts +0 -617
- package/src/websocket/providers/WebSocketServerProvider.ts +0 -56
- package/src/websocket/services/RoomManager.ts +0 -160
- package/src/websocket/services/WebSocketClient.ts +0 -642
- package/src/websocket/services/WebSocketTopicService.ts +0 -108
package/dist/api/jobs/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import * as _$alepha_logger0 from "alepha/logger";
|
|
|
8
8
|
import { LogEntry } from "alepha/logger";
|
|
9
9
|
import * as _$alepha_orm0 from "alepha/orm";
|
|
10
10
|
import { DateTime, DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
11
|
+
import * as _$typebox from "typebox";
|
|
11
12
|
import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
|
|
12
13
|
import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
13
14
|
//#region ../../src/orm/core/schemas/insertSchema.d.ts
|
|
@@ -24,6 +25,8 @@ type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"] as
|
|
|
24
25
|
[PG_GENERATED]: any;
|
|
25
26
|
} ? never : K]: T["properties"][K] extends {
|
|
26
27
|
[PG_DEFAULT]: any;
|
|
28
|
+
} | {
|
|
29
|
+
[PG_ORGANIZATION]: any;
|
|
27
30
|
} | {
|
|
28
31
|
"~optional": true;
|
|
29
32
|
} ? TOptional<T["properties"][K]> : T["properties"][K] }>;
|
|
@@ -299,8 +302,8 @@ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]:
|
|
|
299
302
|
* - `d1://BINDING_NAME` — Cloudflare D1
|
|
300
303
|
* - `hyperdrive://BINDING_NAME` — Cloudflare Hyperdrive
|
|
301
304
|
*/
|
|
302
|
-
declare const databaseEnvSchema: _$
|
|
303
|
-
DATABASE_URL: _$
|
|
305
|
+
declare const databaseEnvSchema: _$typebox.TObject<{
|
|
306
|
+
DATABASE_URL: _$typebox.TOptional<_$typebox.TString>;
|
|
304
307
|
/**
|
|
305
308
|
* Enable or disable push-based schema synchronization (drizzle-kit push).
|
|
306
309
|
*
|
|
@@ -308,7 +311,7 @@ declare const databaseEnvSchema: _$alepha.TObject<{
|
|
|
308
311
|
* Set to `false` in development to skip automatic schema sync
|
|
309
312
|
* (e.g. when managing migrations manually).
|
|
310
313
|
*/
|
|
311
|
-
DATABASE_SYNC: _$
|
|
314
|
+
DATABASE_SYNC: _$typebox.TOptional<_$typebox.TBoolean>;
|
|
312
315
|
}>;
|
|
313
316
|
declare module "alepha" {
|
|
314
317
|
interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
|
|
@@ -332,35 +335,35 @@ declare module "alepha" {
|
|
|
332
335
|
* - sweep picks due ones → pending
|
|
333
336
|
* - cancel → cancelled
|
|
334
337
|
*/
|
|
335
|
-
declare const jobExecutionEntity: _$alepha_orm0.EntityPrimitive<_$
|
|
336
|
-
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
337
|
-
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
338
|
-
updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
339
|
-
jobName: _$
|
|
340
|
-
key: _$
|
|
341
|
-
status: _$alepha_orm0.PgAttr<_$
|
|
342
|
-
priority: _$alepha_orm0.PgAttr<_$
|
|
343
|
-
attempt: _$alepha_orm0.PgAttr<_$
|
|
344
|
-
maxAttempts: _$alepha_orm0.PgAttr<_$
|
|
345
|
-
payload: _$
|
|
346
|
-
scheduledAt: _$
|
|
347
|
-
startedAt: _$
|
|
348
|
-
completedAt: _$
|
|
349
|
-
error: _$
|
|
350
|
-
logs: _$
|
|
351
|
-
level: _$
|
|
352
|
-
message: _$
|
|
353
|
-
service: _$
|
|
354
|
-
module: _$
|
|
355
|
-
context: _$
|
|
356
|
-
app: _$
|
|
357
|
-
data: _$
|
|
358
|
-
timestamp: _$
|
|
338
|
+
declare const jobExecutionEntity: _$alepha_orm0.EntityPrimitive<_$typebox.TObject<{
|
|
339
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
340
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
341
|
+
updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
342
|
+
jobName: _$typebox.TString;
|
|
343
|
+
key: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TNull, _$typebox.TString]>>;
|
|
344
|
+
status: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"ok" | "error" | "pending" | "running" | "scheduled" | "cancelled">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
345
|
+
priority: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
346
|
+
attempt: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
347
|
+
maxAttempts: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
348
|
+
payload: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
|
|
349
|
+
scheduledAt: _$typebox.TOptional<_$typebox.TString>;
|
|
350
|
+
startedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
351
|
+
completedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
352
|
+
error: _$typebox.TOptional<_$typebox.TString>;
|
|
353
|
+
logs: _$typebox.TOptional<_$typebox.TArray<_$typebox.TObject<{
|
|
354
|
+
level: _$typebox.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
355
|
+
message: _$typebox.TString;
|
|
356
|
+
service: _$typebox.TString;
|
|
357
|
+
module: _$typebox.TString;
|
|
358
|
+
context: _$typebox.TOptional<_$typebox.TString>;
|
|
359
|
+
app: _$typebox.TOptional<_$typebox.TString>;
|
|
360
|
+
data: _$typebox.TOptional<_$typebox.TAny>;
|
|
361
|
+
timestamp: _$typebox.TNumber;
|
|
359
362
|
}>>>;
|
|
360
|
-
triggeredBy: _$
|
|
361
|
-
triggeredByName: _$
|
|
362
|
-
cancelledBy: _$
|
|
363
|
-
cancelledByName: _$
|
|
363
|
+
triggeredBy: _$typebox.TOptional<_$typebox.TString>;
|
|
364
|
+
triggeredByName: _$typebox.TOptional<_$typebox.TString>;
|
|
365
|
+
cancelledBy: _$typebox.TOptional<_$typebox.TString>;
|
|
366
|
+
cancelledByName: _$typebox.TOptional<_$typebox.TString>;
|
|
364
367
|
}>>;
|
|
365
368
|
type JobExecutionEntity = Static<typeof jobExecutionEntity.schema>;
|
|
366
369
|
type JobStatus = "pending" | "running" | "scheduled" | "ok" | "error" | "cancelled";
|
|
@@ -610,7 +613,11 @@ type JobEffectiveMode = "cron" | "queue" | "direct";
|
|
|
610
613
|
* - re-enqueue pending rows older than `staleThreshold`
|
|
611
614
|
* - mark crashed running rows as failed and apply retry policy
|
|
612
615
|
* - move `scheduled` rows with `scheduledAt <= now` to pending + dispatch
|
|
613
|
-
*
|
|
616
|
+
*
|
|
617
|
+
* Trim runs on its own cron (`trimCron`, default hourly):
|
|
618
|
+
* - per-job history trimmed beyond `keepLastSuccess` / `keepLastError`
|
|
619
|
+
* - decoupled from sweep because trim cost scales with job count, not
|
|
620
|
+
* retry latency — running it every sweep is wasted work for most apps.
|
|
614
621
|
*/
|
|
615
622
|
declare class JobProvider {
|
|
616
623
|
protected readonly alepha: Alepha;
|
|
@@ -619,6 +626,7 @@ declare class JobProvider {
|
|
|
619
626
|
protected readonly lockProvider: LockProvider;
|
|
620
627
|
protected readonly config: Readonly<{
|
|
621
628
|
sweepCron: string;
|
|
629
|
+
trimCron: string;
|
|
622
630
|
staleThreshold: number;
|
|
623
631
|
runTimeout: number;
|
|
624
632
|
keepLastSuccess: number;
|
|
@@ -636,35 +644,35 @@ declare class JobProvider {
|
|
|
636
644
|
protected dispatcherRef?: JobDispatcher;
|
|
637
645
|
get dispatcher(): JobDispatcher;
|
|
638
646
|
protected readonly log: _$alepha_logger0.Logger;
|
|
639
|
-
protected readonly executions: _$alepha_orm0.Repository<_$
|
|
640
|
-
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
641
|
-
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
642
|
-
updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
643
|
-
jobName: _$
|
|
644
|
-
key: _$
|
|
645
|
-
status: _$alepha_orm0.PgAttr<_$
|
|
646
|
-
priority: _$alepha_orm0.PgAttr<_$
|
|
647
|
-
attempt: _$alepha_orm0.PgAttr<_$
|
|
648
|
-
maxAttempts: _$alepha_orm0.PgAttr<_$
|
|
649
|
-
payload: _$
|
|
650
|
-
scheduledAt: _$
|
|
651
|
-
startedAt: _$
|
|
652
|
-
completedAt: _$
|
|
653
|
-
error: _$
|
|
654
|
-
logs: _$
|
|
655
|
-
level: _$
|
|
656
|
-
message: _$
|
|
657
|
-
service: _$
|
|
658
|
-
module: _$
|
|
659
|
-
context: _$
|
|
660
|
-
app: _$
|
|
661
|
-
data: _$
|
|
662
|
-
timestamp: _$
|
|
647
|
+
protected readonly executions: _$alepha_orm0.Repository<_$typebox.TObject<{
|
|
648
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
649
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
650
|
+
updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
651
|
+
jobName: _$typebox.TString;
|
|
652
|
+
key: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TNull, _$typebox.TString]>>;
|
|
653
|
+
status: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"ok" | "error" | "pending" | "running" | "scheduled" | "cancelled">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
654
|
+
priority: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
655
|
+
attempt: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
656
|
+
maxAttempts: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
657
|
+
payload: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
|
|
658
|
+
scheduledAt: _$typebox.TOptional<_$typebox.TString>;
|
|
659
|
+
startedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
660
|
+
completedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
661
|
+
error: _$typebox.TOptional<_$typebox.TString>;
|
|
662
|
+
logs: _$typebox.TOptional<_$typebox.TArray<_$typebox.TObject<{
|
|
663
|
+
level: _$typebox.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
664
|
+
message: _$typebox.TString;
|
|
665
|
+
service: _$typebox.TString;
|
|
666
|
+
module: _$typebox.TString;
|
|
667
|
+
context: _$typebox.TOptional<_$typebox.TString>;
|
|
668
|
+
app: _$typebox.TOptional<_$typebox.TString>;
|
|
669
|
+
data: _$typebox.TOptional<_$typebox.TAny>;
|
|
670
|
+
timestamp: _$typebox.TNumber;
|
|
663
671
|
}>>>;
|
|
664
|
-
triggeredBy: _$
|
|
665
|
-
triggeredByName: _$
|
|
666
|
-
cancelledBy: _$
|
|
667
|
-
cancelledByName: _$
|
|
672
|
+
triggeredBy: _$typebox.TOptional<_$typebox.TString>;
|
|
673
|
+
triggeredByName: _$typebox.TOptional<_$typebox.TString>;
|
|
674
|
+
cancelledBy: _$typebox.TOptional<_$typebox.TString>;
|
|
675
|
+
cancelledByName: _$typebox.TOptional<_$typebox.TString>;
|
|
668
676
|
}>>;
|
|
669
677
|
protected readonly jobs: Map<string, JobRuntimeRegistration>;
|
|
670
678
|
protected readonly inFlight: Set<Promise<void>>;
|
|
@@ -850,9 +858,9 @@ declare class JobProvider {
|
|
|
850
858
|
}
|
|
851
859
|
//#endregion
|
|
852
860
|
//#region ../../src/api/jobs/schemas/jobExecutionQuerySchema.d.ts
|
|
853
|
-
declare const jobExecutionQuerySchema: _$
|
|
854
|
-
status: _$
|
|
855
|
-
limit: _$
|
|
861
|
+
declare const jobExecutionQuerySchema: _$typebox.TObject<{
|
|
862
|
+
status: _$typebox.TOptional<_$typebox.TUnsafe<"ok" | "error" | "pending" | "running" | "scheduled" | "cancelled">>;
|
|
863
|
+
limit: _$typebox.TOptional<_$typebox.TInteger>;
|
|
856
864
|
}>;
|
|
857
865
|
type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;
|
|
858
866
|
//#endregion
|
|
@@ -867,57 +875,57 @@ type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;
|
|
|
867
875
|
* `JobService` is responsible for the int → string transform.
|
|
868
876
|
* - `can` derives the available admin actions from the row's status.
|
|
869
877
|
*/
|
|
870
|
-
declare const jobExecutionResourceSchema: _$
|
|
871
|
-
id: PgAttr<PgAttr<_$
|
|
872
|
-
createdAt: PgAttr<PgAttr<_$
|
|
873
|
-
updatedAt: PgAttr<PgAttr<_$
|
|
874
|
-
jobName: _$
|
|
875
|
-
key: _$
|
|
876
|
-
status: PgAttr<_$
|
|
877
|
-
priority: PgAttr<_$
|
|
878
|
-
attempt: PgAttr<_$
|
|
879
|
-
maxAttempts: PgAttr<_$
|
|
880
|
-
payload: _$
|
|
881
|
-
scheduledAt: _$
|
|
882
|
-
startedAt: _$
|
|
883
|
-
completedAt: _$
|
|
884
|
-
error: _$
|
|
885
|
-
logs: _$
|
|
886
|
-
level: _$
|
|
887
|
-
message: _$
|
|
888
|
-
service: _$
|
|
889
|
-
module: _$
|
|
890
|
-
context: _$
|
|
891
|
-
app: _$
|
|
892
|
-
data: _$
|
|
893
|
-
timestamp: _$
|
|
878
|
+
declare const jobExecutionResourceSchema: _$typebox.TObject<{
|
|
879
|
+
id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
880
|
+
createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
881
|
+
updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
882
|
+
jobName: _$typebox.TString;
|
|
883
|
+
key: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TNull, _$typebox.TString]>>;
|
|
884
|
+
status: PgAttr<_$typebox.TUnsafe<"ok" | "error" | "pending" | "running" | "scheduled" | "cancelled">, typeof PG_DEFAULT>;
|
|
885
|
+
priority: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
886
|
+
attempt: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
887
|
+
maxAttempts: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
888
|
+
payload: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
|
|
889
|
+
scheduledAt: _$typebox.TOptional<_$typebox.TString>;
|
|
890
|
+
startedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
891
|
+
completedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
892
|
+
error: _$typebox.TOptional<_$typebox.TString>;
|
|
893
|
+
logs: _$typebox.TOptional<_$typebox.TArray<_$typebox.TObject<{
|
|
894
|
+
level: _$typebox.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
895
|
+
message: _$typebox.TString;
|
|
896
|
+
service: _$typebox.TString;
|
|
897
|
+
module: _$typebox.TString;
|
|
898
|
+
context: _$typebox.TOptional<_$typebox.TString>;
|
|
899
|
+
app: _$typebox.TOptional<_$typebox.TString>;
|
|
900
|
+
data: _$typebox.TOptional<_$typebox.TAny>;
|
|
901
|
+
timestamp: _$typebox.TNumber;
|
|
894
902
|
}>>>;
|
|
895
|
-
triggeredBy: _$
|
|
896
|
-
triggeredByName: _$
|
|
897
|
-
cancelledBy: _$
|
|
898
|
-
cancelledByName: _$
|
|
899
|
-
can: _$
|
|
900
|
-
retry: _$
|
|
901
|
-
cancel: _$
|
|
903
|
+
triggeredBy: _$typebox.TOptional<_$typebox.TString>;
|
|
904
|
+
triggeredByName: _$typebox.TOptional<_$typebox.TString>;
|
|
905
|
+
cancelledBy: _$typebox.TOptional<_$typebox.TString>;
|
|
906
|
+
cancelledByName: _$typebox.TOptional<_$typebox.TString>;
|
|
907
|
+
can: _$typebox.TObject<{
|
|
908
|
+
retry: _$typebox.TBoolean;
|
|
909
|
+
cancel: _$typebox.TBoolean;
|
|
902
910
|
}>;
|
|
903
911
|
}>;
|
|
904
912
|
type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;
|
|
905
913
|
//#endregion
|
|
906
914
|
//#region ../../src/api/jobs/schemas/jobRegistrationSchema.d.ts
|
|
907
|
-
declare const jobRegistrationSchema: _$
|
|
908
|
-
name: _$
|
|
909
|
-
description: _$
|
|
910
|
-
type: _$
|
|
911
|
-
priority: _$
|
|
912
|
-
cron: _$
|
|
913
|
-
timeout: _$
|
|
914
|
-
retry: _$
|
|
915
|
-
retries: _$
|
|
915
|
+
declare const jobRegistrationSchema: _$typebox.TObject<{
|
|
916
|
+
name: _$typebox.TString;
|
|
917
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
918
|
+
type: _$typebox.TUnsafe<"cron" | "queue" | "direct">;
|
|
919
|
+
priority: _$typebox.TUnsafe<"critical" | "high" | "normal" | "low">;
|
|
920
|
+
cron: _$typebox.TOptional<_$typebox.TString>;
|
|
921
|
+
timeout: _$typebox.TOptional<_$typebox.TString>;
|
|
922
|
+
retry: _$typebox.TOptional<_$typebox.TObject<{
|
|
923
|
+
retries: _$typebox.TInteger;
|
|
916
924
|
}>>;
|
|
917
|
-
recent: _$
|
|
918
|
-
ok: _$
|
|
919
|
-
error: _$
|
|
920
|
-
lastRun: _$
|
|
925
|
+
recent: _$typebox.TObject<{
|
|
926
|
+
ok: _$typebox.TInteger;
|
|
927
|
+
error: _$typebox.TInteger;
|
|
928
|
+
lastRun: _$typebox.TOptional<_$typebox.TString>;
|
|
921
929
|
}>;
|
|
922
930
|
}>;
|
|
923
931
|
type JobRegistration = Static<typeof jobRegistrationSchema>;
|
|
@@ -935,35 +943,35 @@ declare class JobService {
|
|
|
935
943
|
protected readonly alepha: Alepha;
|
|
936
944
|
protected readonly log: _$alepha_logger0.Logger;
|
|
937
945
|
protected readonly jobProvider: JobProvider;
|
|
938
|
-
protected readonly executions: _$alepha_orm0.Repository<_$
|
|
939
|
-
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
940
|
-
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
941
|
-
updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
942
|
-
jobName: _$
|
|
943
|
-
key: _$
|
|
944
|
-
status: _$alepha_orm0.PgAttr<_$
|
|
945
|
-
priority: _$alepha_orm0.PgAttr<_$
|
|
946
|
-
attempt: _$alepha_orm0.PgAttr<_$
|
|
947
|
-
maxAttempts: _$alepha_orm0.PgAttr<_$
|
|
948
|
-
payload: _$
|
|
949
|
-
scheduledAt: _$
|
|
950
|
-
startedAt: _$
|
|
951
|
-
completedAt: _$
|
|
952
|
-
error: _$
|
|
953
|
-
logs: _$
|
|
954
|
-
level: _$
|
|
955
|
-
message: _$
|
|
956
|
-
service: _$
|
|
957
|
-
module: _$
|
|
958
|
-
context: _$
|
|
959
|
-
app: _$
|
|
960
|
-
data: _$
|
|
961
|
-
timestamp: _$
|
|
946
|
+
protected readonly executions: _$alepha_orm0.Repository<_$typebox.TObject<{
|
|
947
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
948
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
949
|
+
updatedAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_UPDATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
950
|
+
jobName: _$typebox.TString;
|
|
951
|
+
key: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TNull, _$typebox.TString]>>;
|
|
952
|
+
status: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"ok" | "error" | "pending" | "running" | "scheduled" | "cancelled">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
953
|
+
priority: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
954
|
+
attempt: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
955
|
+
maxAttempts: _$alepha_orm0.PgAttr<_$typebox.TInteger, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
956
|
+
payload: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
|
|
957
|
+
scheduledAt: _$typebox.TOptional<_$typebox.TString>;
|
|
958
|
+
startedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
959
|
+
completedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
960
|
+
error: _$typebox.TOptional<_$typebox.TString>;
|
|
961
|
+
logs: _$typebox.TOptional<_$typebox.TArray<_$typebox.TObject<{
|
|
962
|
+
level: _$typebox.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
963
|
+
message: _$typebox.TString;
|
|
964
|
+
service: _$typebox.TString;
|
|
965
|
+
module: _$typebox.TString;
|
|
966
|
+
context: _$typebox.TOptional<_$typebox.TString>;
|
|
967
|
+
app: _$typebox.TOptional<_$typebox.TString>;
|
|
968
|
+
data: _$typebox.TOptional<_$typebox.TAny>;
|
|
969
|
+
timestamp: _$typebox.TNumber;
|
|
962
970
|
}>>>;
|
|
963
|
-
triggeredBy: _$
|
|
964
|
-
triggeredByName: _$
|
|
965
|
-
cancelledBy: _$
|
|
966
|
-
cancelledByName: _$
|
|
971
|
+
triggeredBy: _$typebox.TOptional<_$typebox.TString>;
|
|
972
|
+
triggeredByName: _$typebox.TOptional<_$typebox.TString>;
|
|
973
|
+
cancelledBy: _$typebox.TOptional<_$typebox.TString>;
|
|
974
|
+
cancelledByName: _$typebox.TOptional<_$typebox.TString>;
|
|
967
975
|
}>>;
|
|
968
976
|
protected computeCan(status: string): {
|
|
969
977
|
retry: boolean;
|
|
@@ -1090,136 +1098,136 @@ declare class AdminJobController {
|
|
|
1090
1098
|
protected readonly group: string;
|
|
1091
1099
|
protected readonly jobService: JobService;
|
|
1092
1100
|
readonly listJobs: _$alepha_server0.ActionPrimitiveFn<{
|
|
1093
|
-
response: _$
|
|
1094
|
-
name: _$
|
|
1095
|
-
description: _$
|
|
1096
|
-
type: _$
|
|
1097
|
-
priority: _$
|
|
1098
|
-
cron: _$
|
|
1099
|
-
timeout: _$
|
|
1100
|
-
retry: _$
|
|
1101
|
-
retries: _$
|
|
1101
|
+
response: _$typebox.TArray<_$typebox.TObject<{
|
|
1102
|
+
name: _$typebox.TString;
|
|
1103
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
1104
|
+
type: _$typebox.TUnsafe<"cron" | "queue" | "direct">;
|
|
1105
|
+
priority: _$typebox.TUnsafe<"critical" | "high" | "normal" | "low">;
|
|
1106
|
+
cron: _$typebox.TOptional<_$typebox.TString>;
|
|
1107
|
+
timeout: _$typebox.TOptional<_$typebox.TString>;
|
|
1108
|
+
retry: _$typebox.TOptional<_$typebox.TObject<{
|
|
1109
|
+
retries: _$typebox.TInteger;
|
|
1102
1110
|
}>>;
|
|
1103
|
-
recent: _$
|
|
1104
|
-
ok: _$
|
|
1105
|
-
error: _$
|
|
1106
|
-
lastRun: _$
|
|
1111
|
+
recent: _$typebox.TObject<{
|
|
1112
|
+
ok: _$typebox.TInteger;
|
|
1113
|
+
error: _$typebox.TInteger;
|
|
1114
|
+
lastRun: _$typebox.TOptional<_$typebox.TString>;
|
|
1107
1115
|
}>;
|
|
1108
1116
|
}>>;
|
|
1109
1117
|
}>;
|
|
1110
1118
|
readonly listExecutions: _$alepha_server0.ActionPrimitiveFn<{
|
|
1111
|
-
params: _$
|
|
1112
|
-
name: _$
|
|
1119
|
+
params: _$typebox.TObject<{
|
|
1120
|
+
name: _$typebox.TString;
|
|
1113
1121
|
}>;
|
|
1114
|
-
query: _$
|
|
1115
|
-
status: _$
|
|
1116
|
-
limit: _$
|
|
1122
|
+
query: _$typebox.TObject<{
|
|
1123
|
+
status: _$typebox.TOptional<_$typebox.TUnsafe<"ok" | "error" | "pending" | "running" | "scheduled" | "cancelled">>;
|
|
1124
|
+
limit: _$typebox.TOptional<_$typebox.TInteger>;
|
|
1117
1125
|
}>;
|
|
1118
|
-
response: _$
|
|
1119
|
-
id: PgAttr<PgAttr<_$
|
|
1120
|
-
createdAt: PgAttr<PgAttr<_$
|
|
1121
|
-
updatedAt: PgAttr<PgAttr<_$
|
|
1122
|
-
jobName: _$
|
|
1123
|
-
key: _$
|
|
1124
|
-
status: PgAttr<_$
|
|
1125
|
-
priority: PgAttr<_$
|
|
1126
|
-
attempt: PgAttr<_$
|
|
1127
|
-
maxAttempts: PgAttr<_$
|
|
1128
|
-
payload: _$
|
|
1129
|
-
scheduledAt: _$
|
|
1130
|
-
startedAt: _$
|
|
1131
|
-
completedAt: _$
|
|
1132
|
-
error: _$
|
|
1133
|
-
logs: _$
|
|
1134
|
-
level: _$
|
|
1135
|
-
message: _$
|
|
1136
|
-
service: _$
|
|
1137
|
-
module: _$
|
|
1138
|
-
context: _$
|
|
1139
|
-
app: _$
|
|
1140
|
-
data: _$
|
|
1141
|
-
timestamp: _$
|
|
1126
|
+
response: _$typebox.TArray<_$typebox.TObject<{
|
|
1127
|
+
id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1128
|
+
createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1129
|
+
updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1130
|
+
jobName: _$typebox.TString;
|
|
1131
|
+
key: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TNull, _$typebox.TString]>>;
|
|
1132
|
+
status: PgAttr<_$typebox.TUnsafe<"ok" | "error" | "pending" | "running" | "scheduled" | "cancelled">, typeof PG_DEFAULT>;
|
|
1133
|
+
priority: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
1134
|
+
attempt: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
1135
|
+
maxAttempts: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
1136
|
+
payload: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
|
|
1137
|
+
scheduledAt: _$typebox.TOptional<_$typebox.TString>;
|
|
1138
|
+
startedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
1139
|
+
completedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
1140
|
+
error: _$typebox.TOptional<_$typebox.TString>;
|
|
1141
|
+
logs: _$typebox.TOptional<_$typebox.TArray<_$typebox.TObject<{
|
|
1142
|
+
level: _$typebox.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
1143
|
+
message: _$typebox.TString;
|
|
1144
|
+
service: _$typebox.TString;
|
|
1145
|
+
module: _$typebox.TString;
|
|
1146
|
+
context: _$typebox.TOptional<_$typebox.TString>;
|
|
1147
|
+
app: _$typebox.TOptional<_$typebox.TString>;
|
|
1148
|
+
data: _$typebox.TOptional<_$typebox.TAny>;
|
|
1149
|
+
timestamp: _$typebox.TNumber;
|
|
1142
1150
|
}>>>;
|
|
1143
|
-
triggeredBy: _$
|
|
1144
|
-
triggeredByName: _$
|
|
1145
|
-
cancelledBy: _$
|
|
1146
|
-
cancelledByName: _$
|
|
1147
|
-
can: _$
|
|
1148
|
-
retry: _$
|
|
1149
|
-
cancel: _$
|
|
1151
|
+
triggeredBy: _$typebox.TOptional<_$typebox.TString>;
|
|
1152
|
+
triggeredByName: _$typebox.TOptional<_$typebox.TString>;
|
|
1153
|
+
cancelledBy: _$typebox.TOptional<_$typebox.TString>;
|
|
1154
|
+
cancelledByName: _$typebox.TOptional<_$typebox.TString>;
|
|
1155
|
+
can: _$typebox.TObject<{
|
|
1156
|
+
retry: _$typebox.TBoolean;
|
|
1157
|
+
cancel: _$typebox.TBoolean;
|
|
1150
1158
|
}>;
|
|
1151
1159
|
}>>;
|
|
1152
1160
|
}>;
|
|
1153
1161
|
readonly getExecution: _$alepha_server0.ActionPrimitiveFn<{
|
|
1154
|
-
params: _$
|
|
1155
|
-
id: _$
|
|
1162
|
+
params: _$typebox.TObject<{
|
|
1163
|
+
id: _$typebox.TString;
|
|
1156
1164
|
}>;
|
|
1157
|
-
response: _$
|
|
1158
|
-
id: PgAttr<PgAttr<_$
|
|
1159
|
-
createdAt: PgAttr<PgAttr<_$
|
|
1160
|
-
updatedAt: PgAttr<PgAttr<_$
|
|
1161
|
-
jobName: _$
|
|
1162
|
-
key: _$
|
|
1163
|
-
status: PgAttr<_$
|
|
1164
|
-
priority: PgAttr<_$
|
|
1165
|
-
attempt: PgAttr<_$
|
|
1166
|
-
maxAttempts: PgAttr<_$
|
|
1167
|
-
payload: _$
|
|
1168
|
-
scheduledAt: _$
|
|
1169
|
-
startedAt: _$
|
|
1170
|
-
completedAt: _$
|
|
1171
|
-
error: _$
|
|
1172
|
-
logs: _$
|
|
1173
|
-
level: _$
|
|
1174
|
-
message: _$
|
|
1175
|
-
service: _$
|
|
1176
|
-
module: _$
|
|
1177
|
-
context: _$
|
|
1178
|
-
app: _$
|
|
1179
|
-
data: _$
|
|
1180
|
-
timestamp: _$
|
|
1165
|
+
response: _$typebox.TObject<{
|
|
1166
|
+
id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1167
|
+
createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1168
|
+
updatedAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1169
|
+
jobName: _$typebox.TString;
|
|
1170
|
+
key: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TNull, _$typebox.TString]>>;
|
|
1171
|
+
status: PgAttr<_$typebox.TUnsafe<"ok" | "error" | "pending" | "running" | "scheduled" | "cancelled">, typeof PG_DEFAULT>;
|
|
1172
|
+
priority: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
1173
|
+
attempt: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
1174
|
+
maxAttempts: PgAttr<_$typebox.TInteger, typeof PG_DEFAULT>;
|
|
1175
|
+
payload: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
|
|
1176
|
+
scheduledAt: _$typebox.TOptional<_$typebox.TString>;
|
|
1177
|
+
startedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
1178
|
+
completedAt: _$typebox.TOptional<_$typebox.TString>;
|
|
1179
|
+
error: _$typebox.TOptional<_$typebox.TString>;
|
|
1180
|
+
logs: _$typebox.TOptional<_$typebox.TArray<_$typebox.TObject<{
|
|
1181
|
+
level: _$typebox.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
1182
|
+
message: _$typebox.TString;
|
|
1183
|
+
service: _$typebox.TString;
|
|
1184
|
+
module: _$typebox.TString;
|
|
1185
|
+
context: _$typebox.TOptional<_$typebox.TString>;
|
|
1186
|
+
app: _$typebox.TOptional<_$typebox.TString>;
|
|
1187
|
+
data: _$typebox.TOptional<_$typebox.TAny>;
|
|
1188
|
+
timestamp: _$typebox.TNumber;
|
|
1181
1189
|
}>>>;
|
|
1182
|
-
triggeredBy: _$
|
|
1183
|
-
triggeredByName: _$
|
|
1184
|
-
cancelledBy: _$
|
|
1185
|
-
cancelledByName: _$
|
|
1186
|
-
can: _$
|
|
1187
|
-
retry: _$
|
|
1188
|
-
cancel: _$
|
|
1190
|
+
triggeredBy: _$typebox.TOptional<_$typebox.TString>;
|
|
1191
|
+
triggeredByName: _$typebox.TOptional<_$typebox.TString>;
|
|
1192
|
+
cancelledBy: _$typebox.TOptional<_$typebox.TString>;
|
|
1193
|
+
cancelledByName: _$typebox.TOptional<_$typebox.TString>;
|
|
1194
|
+
can: _$typebox.TObject<{
|
|
1195
|
+
retry: _$typebox.TBoolean;
|
|
1196
|
+
cancel: _$typebox.TBoolean;
|
|
1189
1197
|
}>;
|
|
1190
1198
|
}>;
|
|
1191
1199
|
}>;
|
|
1192
1200
|
readonly triggerJob: _$alepha_server0.ActionPrimitiveFn<{
|
|
1193
|
-
params: _$
|
|
1194
|
-
name: _$
|
|
1201
|
+
params: _$typebox.TObject<{
|
|
1202
|
+
name: _$typebox.TString;
|
|
1195
1203
|
}>;
|
|
1196
|
-
body: _$
|
|
1197
|
-
payload: _$
|
|
1204
|
+
body: _$typebox.TObject<{
|
|
1205
|
+
payload: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
|
|
1198
1206
|
}>;
|
|
1199
|
-
response: _$
|
|
1200
|
-
ok: _$
|
|
1201
|
-
id: _$
|
|
1202
|
-
count: _$
|
|
1207
|
+
response: _$typebox.TObject<{
|
|
1208
|
+
ok: _$typebox.TBoolean;
|
|
1209
|
+
id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
|
|
1210
|
+
count: _$typebox.TOptional<_$typebox.TNumber>;
|
|
1203
1211
|
}>;
|
|
1204
1212
|
}>;
|
|
1205
1213
|
readonly retryExecution: _$alepha_server0.ActionPrimitiveFn<{
|
|
1206
|
-
params: _$
|
|
1207
|
-
id: _$
|
|
1214
|
+
params: _$typebox.TObject<{
|
|
1215
|
+
id: _$typebox.TString;
|
|
1208
1216
|
}>;
|
|
1209
|
-
response: _$
|
|
1210
|
-
ok: _$
|
|
1211
|
-
id: _$
|
|
1212
|
-
count: _$
|
|
1217
|
+
response: _$typebox.TObject<{
|
|
1218
|
+
ok: _$typebox.TBoolean;
|
|
1219
|
+
id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
|
|
1220
|
+
count: _$typebox.TOptional<_$typebox.TNumber>;
|
|
1213
1221
|
}>;
|
|
1214
1222
|
}>;
|
|
1215
1223
|
readonly cancelExecution: _$alepha_server0.ActionPrimitiveFn<{
|
|
1216
|
-
params: _$
|
|
1217
|
-
id: _$
|
|
1224
|
+
params: _$typebox.TObject<{
|
|
1225
|
+
id: _$typebox.TString;
|
|
1218
1226
|
}>;
|
|
1219
|
-
response: _$
|
|
1220
|
-
ok: _$
|
|
1221
|
-
id: _$
|
|
1222
|
-
count: _$
|
|
1227
|
+
response: _$typebox.TObject<{
|
|
1228
|
+
ok: _$typebox.TBoolean;
|
|
1229
|
+
id: _$typebox.TOptional<_$typebox.TUnion<[_$typebox.TString, _$typebox.TInteger]>>;
|
|
1230
|
+
count: _$typebox.TOptional<_$typebox.TNumber>;
|
|
1223
1231
|
}>;
|
|
1224
1232
|
}>;
|
|
1225
1233
|
}
|
|
@@ -1270,9 +1278,9 @@ declare class JobQueueProvider extends JobDispatcher {
|
|
|
1270
1278
|
protected readonly alepha: Alepha;
|
|
1271
1279
|
protected jobProviderRef?: JobProvider;
|
|
1272
1280
|
protected getJobProvider(): JobProvider;
|
|
1273
|
-
protected readonly queue: _$alepha_queue0.QueuePrimitive<_$
|
|
1274
|
-
jobName: _$
|
|
1275
|
-
executionId: _$
|
|
1281
|
+
protected readonly queue: _$alepha_queue0.QueuePrimitive<_$typebox.TObject<{
|
|
1282
|
+
jobName: _$typebox.TString;
|
|
1283
|
+
executionId: _$typebox.TString;
|
|
1276
1284
|
}>>;
|
|
1277
1285
|
dispatch(jobName: string, executionId: string): Promise<void>;
|
|
1278
1286
|
/**
|
|
@@ -1293,14 +1301,15 @@ declare class JobQueueProvider extends JobDispatcher {
|
|
|
1293
1301
|
}
|
|
1294
1302
|
//#endregion
|
|
1295
1303
|
//#region ../../src/api/jobs/schemas/jobConfigAtom.d.ts
|
|
1296
|
-
declare const jobConfig: _$alepha.Atom<_$
|
|
1297
|
-
sweepCron: _$
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
+
declare const jobConfig: _$alepha.Atom<_$typebox.TObject<{
|
|
1305
|
+
sweepCron: _$typebox.TString;
|
|
1306
|
+
trimCron: _$typebox.TString;
|
|
1307
|
+
staleThreshold: _$typebox.TInteger;
|
|
1308
|
+
runTimeout: _$typebox.TInteger;
|
|
1309
|
+
keepLastSuccess: _$typebox.TInteger;
|
|
1310
|
+
keepLastError: _$typebox.TInteger;
|
|
1311
|
+
logMaxEntries: _$typebox.TInteger;
|
|
1312
|
+
drainTimeout: _$typebox.TInteger;
|
|
1304
1313
|
}>, "alepha.jobs">;
|
|
1305
1314
|
type JobConfig = Static<typeof jobConfig.schema>;
|
|
1306
1315
|
declare module "alepha" {
|
|
@@ -1310,8 +1319,8 @@ declare module "alepha" {
|
|
|
1310
1319
|
} //# sourceMappingURL=jobConfigAtom.d.ts.map
|
|
1311
1320
|
//#endregion
|
|
1312
1321
|
//#region ../../src/api/jobs/schemas/triggerJobSchema.d.ts
|
|
1313
|
-
declare const triggerJobSchema: _$
|
|
1314
|
-
payload: _$
|
|
1322
|
+
declare const triggerJobSchema: _$typebox.TObject<{
|
|
1323
|
+
payload: _$typebox.TOptional<_$typebox.TRecord<"^.*$", _$typebox.TAny>>;
|
|
1315
1324
|
}>;
|
|
1316
1325
|
type TriggerJob = Static<typeof triggerJobSchema>;
|
|
1317
1326
|
//#endregion
|