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