alepha 0.11.3 → 0.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/api/files.d.ts +1 -439
  2. package/api/jobs.d.ts +1 -218
  3. package/api/notifications.d.ts +1 -264
  4. package/api/users.d.ts +1 -924
  5. package/batch.d.ts +1 -585
  6. package/bucket.d.ts +1 -507
  7. package/cache/redis.d.ts +1 -40
  8. package/cache.d.ts +1 -288
  9. package/command.d.ts +1 -238
  10. package/core.d.ts +1 -1564
  11. package/datetime.d.ts +2 -1
  12. package/devtools.d.ts +1 -368
  13. package/email.d.ts +1 -144
  14. package/fake.cjs +8 -0
  15. package/fake.d.ts +1 -0
  16. package/fake.js +1 -0
  17. package/file.d.ts +1 -53
  18. package/lock/redis.d.ts +1 -24
  19. package/lock.d.ts +1 -552
  20. package/logger.d.ts +1 -284
  21. package/package.json +63 -49
  22. package/postgres.d.ts +1 -1931
  23. package/queue/redis.d.ts +1 -29
  24. package/queue.d.ts +1 -760
  25. package/react/auth.d.ts +1 -499
  26. package/react/form.d.ts +1 -188
  27. package/react/head.d.ts +1 -120
  28. package/react/i18n.d.ts +1 -143
  29. package/react.d.ts +1 -929
  30. package/redis.d.ts +1 -82
  31. package/scheduler.d.ts +1 -145
  32. package/security.d.ts +1 -586
  33. package/server/cache.d.ts +1 -163
  34. package/server/compress.d.ts +1 -32
  35. package/server/cookies.d.ts +1 -144
  36. package/server/cors.d.ts +1 -27
  37. package/server/health.d.ts +1 -59
  38. package/server/helmet.d.ts +1 -69
  39. package/server/links.d.ts +1 -316
  40. package/server/metrics.d.ts +1 -35
  41. package/server/multipart.d.ts +1 -42
  42. package/server/proxy.d.ts +1 -234
  43. package/server/security.d.ts +1 -87
  44. package/server/static.d.ts +1 -119
  45. package/server/swagger.d.ts +1 -148
  46. package/server.d.ts +1 -849
  47. package/topic/redis.d.ts +1 -42
  48. package/topic.d.ts +1 -819
  49. package/ui.cjs +8 -0
  50. package/ui.d.ts +1 -0
  51. package/ui.js +1 -0
  52. package/vite.d.ts +1 -197
@@ -1,264 +1 @@
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
- import * as dayjs0 from "dayjs";
11
-
12
- //#region src/controllers/NotificationController.d.ts
13
- declare class NotificationController {}
14
- //#endregion
15
- //#region src/entities/notifications.d.ts
16
- declare const notifications: _alepha_postgres0.EntityDescriptor<typebox0.TObject<{
17
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
18
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
19
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
20
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
21
- type: typebox0.TUnsafe<"email" | "sms">;
22
- template: typebox0.TString;
23
- category: typebox0.TOptional<typebox0.TString>;
24
- critical: typebox0.TOptional<typebox0.TBoolean>;
25
- sensitive: typebox0.TOptional<typebox0.TBoolean>;
26
- contact: typebox0.TString;
27
- variables: typebox0.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
28
- scheduledAt: typebox0.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
29
- sentAt: typebox0.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
30
- error: typebox0.TOptional<typebox0.TObject<{
31
- at: typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>;
32
- name: typebox0.TString;
33
- message: typebox0.TString;
34
- }>>;
35
- }>>;
36
- type NotificationEntity = Static<typeof notifications.schema>;
37
- //#endregion
38
- //#region src/providers/SmsProvider.d.ts
39
- declare abstract class SmsProvider {
40
- abstract send(options: SmsSendOptions): Promise<void>;
41
- }
42
- interface SmsSendOptions {
43
- to: string;
44
- message: string;
45
- }
46
- //#endregion
47
- //#region src/services/NotificationSenderService.d.ts
48
- declare class NotificationSenderService {
49
- protected readonly alepha: Alepha;
50
- protected readonly log: _alepha_logger0.Logger;
51
- protected readonly notificationRepository: _alepha_postgres0.RepositoryDescriptor<typebox0.TObject<{
52
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
53
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
54
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
55
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
56
- type: typebox0.TUnsafe<"email" | "sms">;
57
- template: typebox0.TString;
58
- category: typebox0.TOptional<typebox0.TString>;
59
- critical: typebox0.TOptional<typebox0.TBoolean>;
60
- sensitive: typebox0.TOptional<typebox0.TBoolean>;
61
- contact: typebox0.TString;
62
- variables: typebox0.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
63
- scheduledAt: typebox0.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
64
- sentAt: typebox0.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
65
- error: typebox0.TOptional<typebox0.TObject<{
66
- at: typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>;
67
- name: typebox0.TString;
68
- message: typebox0.TString;
69
- }>>;
70
- }>>;
71
- protected readonly dateTimeProvider: DateTimeProvider;
72
- protected readonly emailProvider: EmailProvider;
73
- protected readonly smsProvider: SmsProvider;
74
- send(notificationId: string | NotificationEntity): Promise<void>;
75
- renderSms(notification: NotificationEntity): {
76
- to: string;
77
- message: string;
78
- };
79
- renderEmail(notification: NotificationEntity): {
80
- to: string;
81
- subject: string;
82
- body: string;
83
- };
84
- protected load(notification: NotificationEntity): {
85
- template: NotificationDescriptor<typebox0.TObject<typebox0.TProperties>>;
86
- variables: Record<string, any>;
87
- contact: string;
88
- };
89
- }
90
- //#endregion
91
- //#region src/queues/NotificationQueues.d.ts
92
- declare class NotificationQueues {
93
- protected readonly notificationSenderService: NotificationSenderService;
94
- readonly processNotification: _alepha_queue0.QueueDescriptor<typebox0.TObject<{
95
- notificationId: typebox0.TString;
96
- }>>;
97
- }
98
- //#endregion
99
- //#region src/schemas/notificationCreateSchema.d.ts
100
- declare const notificationCreateSchema: typebox0.TObject<{
101
- type: typebox0.TUnsafe<"email" | "sms">;
102
- template: typebox0.TString;
103
- contact: typebox0.TString;
104
- variables: typebox0.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
105
- }>;
106
- type NotificationCreate = Static<typeof notificationCreateSchema>;
107
- //#endregion
108
- //#region src/services/NotificationService.d.ts
109
- declare const envSchema: _alepha_core1.TObject<{
110
- NOTIFICATION_IMMEDIATE: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
111
- }>;
112
- declare module "alepha" {
113
- interface Env extends Partial<Static<typeof envSchema>> {}
114
- }
115
- declare class NotificationService {
116
- protected readonly alepha: Alepha;
117
- protected readonly log: _alepha_logger0.Logger;
118
- protected readonly env: {
119
- NOTIFICATION_IMMEDIATE?: boolean | undefined;
120
- };
121
- protected readonly notificationRepository: _alepha_postgres0.RepositoryDescriptor<_alepha_core1.TObject<{
122
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
123
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
124
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
125
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
126
- type: typebox0.TUnsafe<"email" | "sms">;
127
- template: typebox0.TString;
128
- category: _alepha_core1.TOptional<typebox0.TString>;
129
- critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
130
- sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
131
- contact: typebox0.TString;
132
- variables: _alepha_core1.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
133
- scheduledAt: _alepha_core1.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
134
- sentAt: _alepha_core1.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
135
- error: _alepha_core1.TOptional<_alepha_core1.TObject<{
136
- at: typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>;
137
- name: typebox0.TString;
138
- message: typebox0.TString;
139
- }>>;
140
- }>>;
141
- protected readonly dateTimeProvider: DateTimeProvider;
142
- protected readonly notificationQueues: NotificationQueues;
143
- protected readonly notificationSenderService: NotificationSenderService;
144
- readonly notificationBatch: _alepha_batch0.BatchDescriptor<_alepha_core1.TObject<{
145
- type: typebox0.TUnsafe<"email" | "sms">;
146
- template: typebox0.TString;
147
- contact: typebox0.TString;
148
- variables: _alepha_core1.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
149
- }>, Promise<void>>;
150
- findNotificationById(id: string): Promise<_alepha_postgres0.PgStatic<_alepha_core1.TObject<{
151
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
152
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
153
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
154
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
155
- type: typebox0.TUnsafe<"email" | "sms">;
156
- template: typebox0.TString;
157
- category: _alepha_core1.TOptional<typebox0.TString>;
158
- critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
159
- sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
160
- contact: typebox0.TString;
161
- variables: _alepha_core1.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
162
- scheduledAt: _alepha_core1.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
163
- sentAt: _alepha_core1.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
164
- error: _alepha_core1.TOptional<_alepha_core1.TObject<{
165
- at: typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>;
166
- name: typebox0.TString;
167
- message: typebox0.TString;
168
- }>>;
169
- }>, _alepha_postgres0.PgRelationMap<_alepha_core1.TObject<{
170
- id: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TString, typeof _alepha_postgres0.PG_PRIMARY_KEY>, typeof _alepha_postgres0.PG_DEFAULT>;
171
- version: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TInteger, typeof _alepha_postgres0.PG_VERSION>, typeof _alepha_postgres0.PG_DEFAULT>;
172
- createdAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_CREATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
173
- updatedAt: _alepha_postgres0.PgAttr<_alepha_postgres0.PgAttr<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>, typeof _alepha_postgres0.PG_UPDATED_AT>, typeof _alepha_postgres0.PG_DEFAULT>;
174
- type: typebox0.TUnsafe<"email" | "sms">;
175
- template: typebox0.TString;
176
- category: _alepha_core1.TOptional<typebox0.TString>;
177
- critical: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
178
- sensitive: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
179
- contact: typebox0.TString;
180
- variables: _alepha_core1.TOptional<typebox0.TRecord<"^.*$", typebox0.TAny>>;
181
- scheduledAt: _alepha_core1.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
182
- sentAt: _alepha_core1.TOptional<typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>>;
183
- error: _alepha_core1.TOptional<_alepha_core1.TObject<{
184
- at: typebox0.TCodec<typebox0.TString, dayjs0.Dayjs>;
185
- name: typebox0.TString;
186
- message: typebox0.TString;
187
- }>>;
188
- }>>>>;
189
- /**
190
- * Create a new notification.
191
- */
192
- createNotification(entry: NotificationCreate, now?: boolean): Promise<void>;
193
- }
194
- //#endregion
195
- //#region src/descriptors/$notification.d.ts
196
- declare const $notification: {
197
- <T extends TObject>(options: NotificationDescriptorOptions<T>): NotificationDescriptor<T>;
198
- [KIND]: typeof NotificationDescriptor;
199
- };
200
- interface NotificationDescriptorOptions<T extends TObject> extends NotificationMessage<T> {
201
- name?: string;
202
- description?: string;
203
- category?: string;
204
- critical?: boolean;
205
- sensitive?: boolean;
206
- translations?: {
207
- [lang: string]: NotificationMessage<T>;
208
- };
209
- schema: T;
210
- }
211
- declare class NotificationDescriptor<T extends TObject> extends Descriptor<NotificationDescriptorOptions<T>> {
212
- protected readonly notificationService: NotificationService;
213
- get name(): string;
214
- push(options: NotificationPushOptions<T>): Promise<void>;
215
- configure(options: Partial<NotificationDescriptorOptions<T>>): void;
216
- }
217
- interface NotificationPushOptions<T extends TObject> {
218
- variables: StaticEncode<T>;
219
- contact: string;
220
- }
221
- interface NotificationMessage<T extends TObject> {
222
- email?: {
223
- subject: string;
224
- body: string | ((variables: Static<T>) => string);
225
- };
226
- sms?: {
227
- message: string | ((variables: Static<T>) => string);
228
- };
229
- }
230
- //#endregion
231
- //#region src/jobs/NotificationJobs.d.ts
232
- declare class NotificationJobs {}
233
- //#endregion
234
- //#region src/providers/MemorySmsProvider.d.ts
235
- interface SmsRecord {
236
- to: string;
237
- message: string;
238
- sentAt: Date;
239
- }
240
- declare class MemorySmsProvider extends SmsProvider {
241
- protected records: SmsRecord[];
242
- send(options: SmsSendOptions): Promise<void>;
243
- }
244
- //#endregion
245
- //#region src/schemas/notificationContactPreferencesSchema.d.ts
246
- declare const notificationContactPreferencesSchema: typebox0.TObject<{
247
- language: typebox0.TOptional<typebox0.TString>;
248
- exclude: typebox0.TArray<typebox0.TString>;
249
- }>;
250
- type NotificationContactPreferences = Static<typeof notificationContactPreferencesSchema>;
251
- //#endregion
252
- //#region src/index.d.ts
253
- /**
254
- * Provides notification management API endpoints for Alepha applications.
255
- *
256
- * This module includes notification sending, retrieval, status tracking,
257
- * and user notification preferences management.
258
- *
259
- * @module alepha.api.notifications
260
- */
261
- declare const AlephaApiNotifications: _alepha_core1.Service<_alepha_core1.Module<{}>>;
262
- //#endregion
263
- export { $notification, AlephaApiNotifications, MemorySmsProvider, NotificationContactPreferences, NotificationController, NotificationCreate, NotificationDescriptor, NotificationDescriptorOptions, NotificationEntity, NotificationJobs, NotificationMessage, NotificationPushOptions, NotificationQueues, NotificationSenderService, NotificationService, SmsProvider, SmsRecord, SmsSendOptions, notificationContactPreferencesSchema, notificationCreateSchema, notifications };
264
- //# sourceMappingURL=index.d.ts.map
1
+ export * from '@alepha/api-notifications';