alepha 0.11.5 → 0.11.6

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/api/jobs.d.ts CHANGED
@@ -1,100 +1,86 @@
1
- import * as _alepha_core2 from "alepha";
2
- import { Alepha, Static } from "alepha";
3
- import "alepha/scheduler";
1
+ import * as _alepha_core1 from "alepha";
2
+ import { Alepha, Async, Descriptor, KIND, Static } from "alepha";
4
3
  import "alepha/server/security";
5
- import * as _alepha_postgres48 from "alepha/postgres";
4
+ import * as _alepha_postgres0 from "alepha/postgres";
6
5
  import * as _alepha_server0 from "alepha/server";
7
- import { DateTimeProvider } from "alepha/datetime";
8
- import * as typebox82 from "typebox";
9
- import * as dayjs11 from "dayjs";
6
+ import * as _alepha_logger0 from "alepha/logger";
7
+ import { DateTime, DateTimeProvider } from "alepha/datetime";
8
+ import * as _alepha_lock0 from "alepha/lock";
9
+ import { CronProvider } from "alepha/scheduler";
10
+ import * as typebox176 from "typebox";
11
+ import * as dayjs0 from "dayjs";
10
12
 
11
13
  //#region src/schemas/jobExecutionQuerySchema.d.ts
12
- declare const jobExecutionQuerySchema: typebox82.TObject<{
13
- page: typebox82.TOptional<typebox82.TInteger>;
14
- size: typebox82.TOptional<typebox82.TInteger>;
15
- sort: typebox82.TOptional<typebox82.TString>;
16
- status: typebox82.TOptional<typebox82.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
17
- job: typebox82.TOptional<typebox82.TString>;
14
+ declare const jobExecutionQuerySchema: typebox176.TObject<{
15
+ page: typebox176.TOptional<typebox176.TInteger>;
16
+ size: typebox176.TOptional<typebox176.TInteger>;
17
+ sort: typebox176.TOptional<typebox176.TString>;
18
+ status: typebox176.TOptional<typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
19
+ job: typebox176.TOptional<typebox176.TString>;
18
20
  }>;
19
21
  type JobExecutionQuery = Static<typeof jobExecutionQuerySchema>;
20
22
  //#endregion
21
23
  //#region src/services/JobService.d.ts
22
24
  declare class JobService {
23
25
  protected readonly alepha: Alepha;
24
- protected readonly executionRepository: _alepha_postgres48.RepositoryDescriptor<typebox82.TObject<{
25
- id: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TString, typeof _alepha_postgres48.PG_PRIMARY_KEY>, typeof _alepha_postgres48.PG_DEFAULT>;
26
- version: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TInteger, typeof _alepha_postgres48.PG_VERSION>, typeof _alepha_postgres48.PG_DEFAULT>;
27
- createdAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_CREATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
28
- updatedAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_UPDATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
29
- finishedAt: typebox82.TOptional<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>>;
30
- job: typebox82.TString;
31
- status: typebox82.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
32
- error: typebox82.TOptional<typebox82.TString>;
33
- logs: typebox82.TOptional<typebox82.TArray<typebox82.TObject<{
34
- level: typebox82.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
35
- message: typebox82.TString;
36
- service: typebox82.TString;
37
- module: typebox82.TString;
38
- context: typebox82.TOptional<typebox82.TString>;
39
- app: typebox82.TOptional<typebox82.TString>;
40
- data: typebox82.TOptional<typebox82.TAny>;
41
- timestamp: typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>;
26
+ protected readonly executionRepository: _alepha_postgres0.Repository<typebox176.TObject<{
27
+ id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
28
+ version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
29
+ createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
30
+ updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
31
+ finishedAt: typebox176.TOptional<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>>;
32
+ job: typebox176.TString;
33
+ status: typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
34
+ error: typebox176.TOptional<typebox176.TString>;
35
+ logs: typebox176.TOptional<typebox176.TArray<typebox176.TObject<{
36
+ level: typebox176.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
37
+ message: typebox176.TString;
38
+ service: typebox176.TString;
39
+ module: typebox176.TString;
40
+ context: typebox176.TOptional<typebox176.TString>;
41
+ app: typebox176.TOptional<typebox176.TString>;
42
+ data: typebox176.TOptional<typebox176.TAny>;
43
+ timestamp: typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>;
42
44
  }>>>;
43
45
  }>>;
44
- protected readonly dtp: DateTimeProvider;
45
- protected readonly logs: Map<string, {
46
- context?: string | undefined;
47
- app?: string | undefined;
48
- data?: any;
49
- level: "SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR";
50
- message: string;
51
- service: string;
52
- module: string;
53
- timestamp: dayjs11.Dayjs;
54
- }[]>;
55
- protected readonly onLogs: _alepha_core2.HookDescriptor<"log">;
56
- protected readonly onSchedulerBegin: _alepha_core2.HookDescriptor<"scheduler:begin">;
57
- protected readonly onSchedulerError: _alepha_core2.HookDescriptor<"scheduler:error">;
58
- readonly onSchedulerSuccess: _alepha_core2.HookDescriptor<"scheduler:success">;
59
- readonly onSchedulerEnd: _alepha_core2.HookDescriptor<"scheduler:end">;
60
46
  getJobs(): Promise<string[]>;
61
- getJobExecutions(query?: JobExecutionQuery): Promise<_alepha_core2.Page<_alepha_postgres48.PgStatic<typebox82.TObject<{
62
- id: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TString, typeof _alepha_postgres48.PG_PRIMARY_KEY>, typeof _alepha_postgres48.PG_DEFAULT>;
63
- version: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TInteger, typeof _alepha_postgres48.PG_VERSION>, typeof _alepha_postgres48.PG_DEFAULT>;
64
- createdAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_CREATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
65
- updatedAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_UPDATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
66
- finishedAt: typebox82.TOptional<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>>;
67
- job: typebox82.TString;
68
- status: typebox82.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
69
- error: typebox82.TOptional<typebox82.TString>;
70
- logs: typebox82.TOptional<typebox82.TArray<typebox82.TObject<{
71
- level: typebox82.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
72
- message: typebox82.TString;
73
- service: typebox82.TString;
74
- module: typebox82.TString;
75
- context: typebox82.TOptional<typebox82.TString>;
76
- app: typebox82.TOptional<typebox82.TString>;
77
- data: typebox82.TOptional<typebox82.TAny>;
78
- timestamp: typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>;
47
+ getJobExecutions(query?: JobExecutionQuery): Promise<_alepha_core1.Page<_alepha_postgres0.PgStatic<typebox176.TObject<{
48
+ id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
49
+ version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
50
+ createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
51
+ updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
52
+ finishedAt: typebox176.TOptional<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>>;
53
+ job: typebox176.TString;
54
+ status: typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
55
+ error: typebox176.TOptional<typebox176.TString>;
56
+ logs: typebox176.TOptional<typebox176.TArray<typebox176.TObject<{
57
+ level: typebox176.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
58
+ message: typebox176.TString;
59
+ service: typebox176.TString;
60
+ module: typebox176.TString;
61
+ context: typebox176.TOptional<typebox176.TString>;
62
+ app: typebox176.TOptional<typebox176.TString>;
63
+ data: typebox176.TOptional<typebox176.TAny>;
64
+ timestamp: typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>;
79
65
  }>>>;
80
- }>, _alepha_postgres48.PgRelationMap<typebox82.TObject<{
81
- id: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TString, typeof _alepha_postgres48.PG_PRIMARY_KEY>, typeof _alepha_postgres48.PG_DEFAULT>;
82
- version: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TInteger, typeof _alepha_postgres48.PG_VERSION>, typeof _alepha_postgres48.PG_DEFAULT>;
83
- createdAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_CREATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
84
- updatedAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_UPDATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
85
- finishedAt: typebox82.TOptional<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>>;
86
- job: typebox82.TString;
87
- status: typebox82.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
88
- error: typebox82.TOptional<typebox82.TString>;
89
- logs: typebox82.TOptional<typebox82.TArray<typebox82.TObject<{
90
- level: typebox82.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
91
- message: typebox82.TString;
92
- service: typebox82.TString;
93
- module: typebox82.TString;
94
- context: typebox82.TOptional<typebox82.TString>;
95
- app: typebox82.TOptional<typebox82.TString>;
96
- data: typebox82.TOptional<typebox82.TAny>;
97
- timestamp: typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>;
66
+ }>, _alepha_postgres0.PgRelationMap<typebox176.TObject<{
67
+ id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
68
+ version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
69
+ createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
70
+ updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
71
+ finishedAt: typebox176.TOptional<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>>;
72
+ job: typebox176.TString;
73
+ status: typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
74
+ error: typebox176.TOptional<typebox176.TString>;
75
+ logs: typebox176.TOptional<typebox176.TArray<typebox176.TObject<{
76
+ level: typebox176.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
77
+ message: typebox176.TString;
78
+ service: typebox176.TString;
79
+ module: typebox176.TString;
80
+ context: typebox176.TOptional<typebox176.TString>;
81
+ app: typebox176.TOptional<typebox176.TString>;
82
+ data: typebox176.TOptional<typebox176.TAny>;
83
+ timestamp: typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>;
98
84
  }>>>;
99
85
  }>>>>>;
100
86
  triggerJob(name: string): Promise<{
@@ -108,98 +94,184 @@ declare class JobController {
108
94
  protected readonly group: string;
109
95
  protected readonly jobService: JobService;
110
96
  readonly getJobs: _alepha_server0.ActionDescriptorFn<{
111
- response: typebox82.TArray<typebox82.TString>;
97
+ response: typebox176.TArray<typebox176.TString>;
112
98
  }>;
113
99
  readonly getJobExecutions: _alepha_server0.ActionDescriptorFn<{
114
- query: typebox82.TObject<{
115
- page: typebox82.TOptional<typebox82.TInteger>;
116
- size: typebox82.TOptional<typebox82.TInteger>;
117
- sort: typebox82.TOptional<typebox82.TString>;
118
- status: typebox82.TOptional<typebox82.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
119
- job: typebox82.TOptional<typebox82.TString>;
100
+ query: typebox176.TObject<{
101
+ page: typebox176.TOptional<typebox176.TInteger>;
102
+ size: typebox176.TOptional<typebox176.TInteger>;
103
+ sort: typebox176.TOptional<typebox176.TString>;
104
+ status: typebox176.TOptional<typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">>;
105
+ job: typebox176.TOptional<typebox176.TString>;
120
106
  }>;
121
- response: _alepha_core2.TPage<typebox82.TObject<{
122
- id: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TString, typeof _alepha_postgres48.PG_PRIMARY_KEY>, typeof _alepha_postgres48.PG_DEFAULT>;
123
- version: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TInteger, typeof _alepha_postgres48.PG_VERSION>, typeof _alepha_postgres48.PG_DEFAULT>;
124
- createdAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_CREATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
125
- updatedAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_UPDATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
126
- finishedAt: typebox82.TOptional<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>>;
127
- job: typebox82.TString;
128
- status: typebox82.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
129
- error: typebox82.TOptional<typebox82.TString>;
130
- logs: typebox82.TOptional<typebox82.TArray<typebox82.TObject<{
131
- level: typebox82.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
132
- message: typebox82.TString;
133
- service: typebox82.TString;
134
- module: typebox82.TString;
135
- context: typebox82.TOptional<typebox82.TString>;
136
- app: typebox82.TOptional<typebox82.TString>;
137
- data: typebox82.TOptional<typebox82.TAny>;
138
- timestamp: typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>;
107
+ response: _alepha_core1.TPage<typebox176.TObject<{
108
+ id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
109
+ version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
110
+ createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
111
+ updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
112
+ finishedAt: typebox176.TOptional<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>>;
113
+ job: typebox176.TString;
114
+ status: typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
115
+ error: typebox176.TOptional<typebox176.TString>;
116
+ logs: typebox176.TOptional<typebox176.TArray<typebox176.TObject<{
117
+ level: typebox176.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
118
+ message: typebox176.TString;
119
+ service: typebox176.TString;
120
+ module: typebox176.TString;
121
+ context: typebox176.TOptional<typebox176.TString>;
122
+ app: typebox176.TOptional<typebox176.TString>;
123
+ data: typebox176.TOptional<typebox176.TAny>;
124
+ timestamp: typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>;
139
125
  }>>>;
140
126
  }>>;
141
127
  }>;
142
128
  readonly triggerJob: _alepha_server0.ActionDescriptorFn<{
143
- body: typebox82.TObject<{
144
- name: typebox82.TString;
129
+ body: typebox176.TObject<{
130
+ name: typebox176.TString;
145
131
  }>;
146
- response: typebox82.TObject<{
147
- ok: typebox82.TBoolean;
148
- id: typebox82.TOptional<typebox82.TUnion<[typebox82.TString, typebox82.TInteger]>>;
149
- count: typebox82.TOptional<typebox82.TNumber>;
132
+ response: typebox176.TObject<{
133
+ ok: typebox176.TBoolean;
134
+ id: typebox176.TOptional<typebox176.TUnion<[typebox176.TString, typebox176.TInteger]>>;
135
+ count: typebox176.TOptional<typebox176.TNumber>;
150
136
  }>;
151
137
  }>;
152
138
  }
153
139
  //#endregion
140
+ //#region src/descriptors/$job.d.ts
141
+ /**
142
+ * Job descriptor - a drop-in replacement for $scheduler with built-in execution tracking.
143
+ */
144
+ declare const $job: {
145
+ (options: JobDescriptorOptions): JobDescriptor;
146
+ [KIND]: typeof JobDescriptor;
147
+ };
148
+ type JobDescriptorOptions = {
149
+ /**
150
+ * Function to run on schedule.
151
+ */
152
+ handler: (args: JobHandlerArguments) => Async<void>;
153
+ /**
154
+ * Name of the job. Defaults to the function name.
155
+ */
156
+ name?: string;
157
+ /**
158
+ * Optional description of the job.
159
+ */
160
+ description?: string;
161
+ /**
162
+ * Cron expression to run the job.
163
+ */
164
+ cron?: string;
165
+ /**
166
+ * If true, the job will be locked and only one instance will run at a time.
167
+ * You probably need to import {@link AlephaLockRedis} for distributed locking.
168
+ *
169
+ * @default true
170
+ */
171
+ lock?: boolean;
172
+ };
173
+ declare const envSchema: _alepha_core1.TObject<{
174
+ JOB_PREFIX: _alepha_core1.TOptional<_alepha_core1.TString>;
175
+ }>;
176
+ declare module "alepha" {
177
+ interface Env extends Partial<Static<typeof envSchema>> {}
178
+ }
179
+ declare class JobDescriptor extends Descriptor<JobDescriptorOptions> {
180
+ protected readonly log: _alepha_logger0.Logger;
181
+ protected readonly env: {
182
+ JOB_PREFIX?: string | undefined;
183
+ };
184
+ protected readonly alepha: Alepha;
185
+ protected readonly dateTimeProvider: DateTimeProvider;
186
+ protected readonly cronProvider: CronProvider;
187
+ protected readonly executionRepository: _alepha_postgres0.Repository<_alepha_core1.TObject<{
188
+ id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<_alepha_core1.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
189
+ version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
190
+ createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<_alepha_core1.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
191
+ updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<_alepha_core1.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
192
+ finishedAt: _alepha_core1.TOptional<typebox176.TCodec<_alepha_core1.TString, dayjs0.Dayjs>>;
193
+ job: _alepha_core1.TString;
194
+ status: typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
195
+ error: _alepha_core1.TOptional<_alepha_core1.TString>;
196
+ logs: _alepha_core1.TOptional<typebox176.TArray<_alepha_core1.TObject<{
197
+ level: typebox176.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
198
+ message: _alepha_core1.TString;
199
+ service: _alepha_core1.TString;
200
+ module: _alepha_core1.TString;
201
+ context: _alepha_core1.TOptional<_alepha_core1.TString>;
202
+ app: _alepha_core1.TOptional<_alepha_core1.TString>;
203
+ data: _alepha_core1.TOptional<typebox176.TAny>;
204
+ timestamp: typebox176.TCodec<_alepha_core1.TString, dayjs0.Dayjs>;
205
+ }>>>;
206
+ }>>;
207
+ protected readonly logs: Map<string, {
208
+ context?: string | undefined;
209
+ app?: string | undefined;
210
+ data?: any;
211
+ level: "SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR";
212
+ message: string;
213
+ service: string;
214
+ module: string;
215
+ timestamp: dayjs0.Dayjs;
216
+ }[]>;
217
+ get name(): string;
218
+ protected onInit(): void;
219
+ trigger(): Promise<void>;
220
+ protected jobLock: _alepha_lock0.LockDescriptor<(args: JobHandlerArguments) => Promise<void>>;
221
+ }
222
+ interface JobHandlerArguments {
223
+ now: DateTime;
224
+ }
225
+ //#endregion
154
226
  //#region src/entities/jobExecutions.d.ts
155
- declare const jobExecutions: _alepha_postgres48.EntityDescriptor<typebox82.TObject<{
156
- id: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TString, typeof _alepha_postgres48.PG_PRIMARY_KEY>, typeof _alepha_postgres48.PG_DEFAULT>;
157
- version: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TInteger, typeof _alepha_postgres48.PG_VERSION>, typeof _alepha_postgres48.PG_DEFAULT>;
158
- createdAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_CREATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
159
- updatedAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_UPDATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
160
- finishedAt: typebox82.TOptional<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>>;
161
- job: typebox82.TString;
162
- status: typebox82.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
163
- error: typebox82.TOptional<typebox82.TString>;
164
- logs: typebox82.TOptional<typebox82.TArray<typebox82.TObject<{
165
- level: typebox82.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
166
- message: typebox82.TString;
167
- service: typebox82.TString;
168
- module: typebox82.TString;
169
- context: typebox82.TOptional<typebox82.TString>;
170
- app: typebox82.TOptional<typebox82.TString>;
171
- data: typebox82.TOptional<typebox82.TAny>;
172
- timestamp: typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>;
227
+ declare const jobExecutions: _alepha_postgres0.EntityDescriptor<typebox176.TObject<{
228
+ id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
229
+ version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
230
+ createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
231
+ updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
232
+ finishedAt: typebox176.TOptional<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>>;
233
+ job: typebox176.TString;
234
+ status: typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
235
+ error: typebox176.TOptional<typebox176.TString>;
236
+ logs: typebox176.TOptional<typebox176.TArray<typebox176.TObject<{
237
+ level: typebox176.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
238
+ message: typebox176.TString;
239
+ service: typebox176.TString;
240
+ module: typebox176.TString;
241
+ context: typebox176.TOptional<typebox176.TString>;
242
+ app: typebox176.TOptional<typebox176.TString>;
243
+ data: typebox176.TOptional<typebox176.TAny>;
244
+ timestamp: typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>;
173
245
  }>>>;
174
246
  }>>;
175
247
  type JobExecutionEntity = Static<typeof jobExecutions.schema>;
176
248
  //#endregion
177
249
  //#region src/schemas/jobExecutionResourceSchema.d.ts
178
- declare const jobExecutionResourceSchema: typebox82.TObject<{
179
- id: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TString, typeof _alepha_postgres48.PG_PRIMARY_KEY>, typeof _alepha_postgres48.PG_DEFAULT>;
180
- version: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TInteger, typeof _alepha_postgres48.PG_VERSION>, typeof _alepha_postgres48.PG_DEFAULT>;
181
- createdAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_CREATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
182
- updatedAt: _alepha_postgres48.PgAttr<_alepha_postgres48.PgAttr<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>, typeof _alepha_postgres48.PG_UPDATED_AT>, typeof _alepha_postgres48.PG_DEFAULT>;
183
- finishedAt: typebox82.TOptional<typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>>;
184
- job: typebox82.TString;
185
- status: typebox82.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
186
- error: typebox82.TOptional<typebox82.TString>;
187
- logs: typebox82.TOptional<typebox82.TArray<typebox82.TObject<{
188
- level: typebox82.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
189
- message: typebox82.TString;
190
- service: typebox82.TString;
191
- module: typebox82.TString;
192
- context: typebox82.TOptional<typebox82.TString>;
193
- app: typebox82.TOptional<typebox82.TString>;
194
- data: typebox82.TOptional<typebox82.TAny>;
195
- timestamp: typebox82.TCodec<typebox82.TString, dayjs11.Dayjs>;
250
+ declare const jobExecutionResourceSchema: typebox176.TObject<{
251
+ id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
252
+ version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
253
+ createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
254
+ updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
255
+ finishedAt: typebox176.TOptional<typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>>;
256
+ job: typebox176.TString;
257
+ status: typebox176.TUnsafe<"STARTED" | "FAILED" | "COMPLETED">;
258
+ error: typebox176.TOptional<typebox176.TString>;
259
+ logs: typebox176.TOptional<typebox176.TArray<typebox176.TObject<{
260
+ level: typebox176.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
261
+ message: typebox176.TString;
262
+ service: typebox176.TString;
263
+ module: typebox176.TString;
264
+ context: typebox176.TOptional<typebox176.TString>;
265
+ app: typebox176.TOptional<typebox176.TString>;
266
+ data: typebox176.TOptional<typebox176.TAny>;
267
+ timestamp: typebox176.TCodec<typebox176.TString, dayjs0.Dayjs>;
196
268
  }>>>;
197
269
  }>;
198
270
  type JobExecutionResource = Static<typeof jobExecutionResourceSchema>;
199
271
  //#endregion
200
272
  //#region src/schemas/triggerJobSchema.d.ts
201
- declare const triggerJobSchema: typebox82.TObject<{
202
- name: typebox82.TString;
273
+ declare const triggerJobSchema: typebox176.TObject<{
274
+ name: typebox176.TString;
203
275
  }>;
204
276
  type TriggerJob = Static<typeof triggerJobSchema>;
205
277
  //#endregion
@@ -212,7 +284,7 @@ type TriggerJob = Static<typeof triggerJobSchema>;
212
284
  *
213
285
  * @module alepha.api.jobs
214
286
  */
215
- declare const AlephaApiJobs: _alepha_core2.Service<_alepha_core2.Module<{}>>;
287
+ declare const AlephaApiJobs: _alepha_core1.Service<_alepha_core1.Module>;
216
288
  //#endregion
217
- export { AlephaApiJobs, JobController, JobExecutionEntity, JobExecutionQuery, JobExecutionResource, JobService, TriggerJob, jobExecutionQuerySchema, jobExecutionResourceSchema, jobExecutions, triggerJobSchema };
289
+ export { $job, AlephaApiJobs, JobController, JobDescriptor, JobDescriptorOptions, JobExecutionEntity, JobExecutionQuery, JobExecutionResource, JobHandlerArguments, JobService, TriggerJob, jobExecutionQuerySchema, jobExecutionResourceSchema, jobExecutions, triggerJobSchema };
218
290
  //# sourceMappingURL=index.d.ts.map