alepha 0.13.0 → 0.13.1

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 (195) hide show
  1. package/dist/api-jobs/index.d.ts +26 -26
  2. package/dist/api-users/index.d.ts +1 -1
  3. package/dist/cli/{dist-Sz2EXvQX.cjs → dist-Dl9Vl7Ur.js} +17 -13
  4. package/dist/cli/{dist-BBPjuQ56.js.map → dist-Dl9Vl7Ur.js.map} +1 -1
  5. package/dist/cli/index.d.ts +3 -11
  6. package/dist/cli/index.js +106 -74
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/email/index.js +71 -73
  9. package/dist/email/index.js.map +1 -1
  10. package/dist/orm/index.d.ts +1 -1
  11. package/dist/orm/index.js.map +1 -1
  12. package/dist/queue/index.d.ts +4 -4
  13. package/dist/retry/index.d.ts +1 -1
  14. package/dist/retry/index.js +2 -2
  15. package/dist/retry/index.js.map +1 -1
  16. package/dist/scheduler/index.d.ts +6 -6
  17. package/dist/security/index.d.ts +28 -28
  18. package/dist/server/index.js +1 -1
  19. package/dist/server/index.js.map +1 -1
  20. package/dist/server-health/index.d.ts +17 -17
  21. package/dist/server-metrics/index.js +170 -174
  22. package/dist/server-metrics/index.js.map +1 -1
  23. package/dist/server-security/index.d.ts +9 -9
  24. package/dist/vite/index.js +4 -5
  25. package/dist/vite/index.js.map +1 -1
  26. package/dist/websocket/index.d.ts +7 -7
  27. package/package.json +52 -103
  28. package/src/cli/apps/AlephaPackageBuilderCli.ts +7 -2
  29. package/src/cli/assets/appRouterTs.ts +9 -0
  30. package/src/cli/assets/indexHtml.ts +2 -1
  31. package/src/cli/assets/mainBrowserTs.ts +10 -0
  32. package/src/cli/commands/CoreCommands.ts +6 -5
  33. package/src/cli/commands/DrizzleCommands.ts +65 -57
  34. package/src/cli/commands/VerifyCommands.ts +1 -1
  35. package/src/cli/services/ProjectUtils.ts +44 -38
  36. package/src/orm/providers/DrizzleKitProvider.ts +1 -1
  37. package/src/retry/descriptors/$retry.ts +5 -3
  38. package/src/server/providers/NodeHttpServerProvider.ts +1 -1
  39. package/src/vite/helpers/boot.ts +3 -3
  40. package/dist/api-files/index.cjs +0 -1293
  41. package/dist/api-files/index.cjs.map +0 -1
  42. package/dist/api-files/index.d.cts +0 -829
  43. package/dist/api-jobs/index.cjs +0 -274
  44. package/dist/api-jobs/index.cjs.map +0 -1
  45. package/dist/api-jobs/index.d.cts +0 -654
  46. package/dist/api-notifications/index.cjs +0 -380
  47. package/dist/api-notifications/index.cjs.map +0 -1
  48. package/dist/api-notifications/index.d.cts +0 -289
  49. package/dist/api-parameters/index.cjs +0 -66
  50. package/dist/api-parameters/index.cjs.map +0 -1
  51. package/dist/api-parameters/index.d.cts +0 -84
  52. package/dist/api-users/index.cjs +0 -6009
  53. package/dist/api-users/index.cjs.map +0 -1
  54. package/dist/api-users/index.d.cts +0 -4740
  55. package/dist/api-verifications/index.cjs +0 -407
  56. package/dist/api-verifications/index.cjs.map +0 -1
  57. package/dist/api-verifications/index.d.cts +0 -207
  58. package/dist/batch/index.cjs +0 -408
  59. package/dist/batch/index.cjs.map +0 -1
  60. package/dist/batch/index.d.cts +0 -330
  61. package/dist/bin/index.cjs +0 -17
  62. package/dist/bin/index.cjs.map +0 -1
  63. package/dist/bin/index.d.cts +0 -1
  64. package/dist/bucket/index.cjs +0 -303
  65. package/dist/bucket/index.cjs.map +0 -1
  66. package/dist/bucket/index.d.cts +0 -355
  67. package/dist/cache/index.cjs +0 -241
  68. package/dist/cache/index.cjs.map +0 -1
  69. package/dist/cache/index.d.cts +0 -202
  70. package/dist/cache-redis/index.cjs +0 -84
  71. package/dist/cache-redis/index.cjs.map +0 -1
  72. package/dist/cache-redis/index.d.cts +0 -40
  73. package/dist/cli/chunk-DSlc6foC.cjs +0 -43
  74. package/dist/cli/dist-BBPjuQ56.js +0 -2778
  75. package/dist/cli/dist-Sz2EXvQX.cjs.map +0 -1
  76. package/dist/cli/index.cjs +0 -1241
  77. package/dist/cli/index.cjs.map +0 -1
  78. package/dist/cli/index.d.cts +0 -422
  79. package/dist/command/index.cjs +0 -693
  80. package/dist/command/index.cjs.map +0 -1
  81. package/dist/command/index.d.cts +0 -340
  82. package/dist/core/index.cjs +0 -2264
  83. package/dist/core/index.cjs.map +0 -1
  84. package/dist/core/index.d.cts +0 -1927
  85. package/dist/datetime/index.cjs +0 -318
  86. package/dist/datetime/index.cjs.map +0 -1
  87. package/dist/datetime/index.d.cts +0 -145
  88. package/dist/email/index.cjs +0 -10874
  89. package/dist/email/index.cjs.map +0 -1
  90. package/dist/email/index.d.cts +0 -186
  91. package/dist/fake/index.cjs +0 -34641
  92. package/dist/fake/index.cjs.map +0 -1
  93. package/dist/fake/index.d.cts +0 -74
  94. package/dist/file/index.cjs +0 -1212
  95. package/dist/file/index.cjs.map +0 -1
  96. package/dist/file/index.d.cts +0 -698
  97. package/dist/lock/index.cjs +0 -226
  98. package/dist/lock/index.cjs.map +0 -1
  99. package/dist/lock/index.d.cts +0 -361
  100. package/dist/lock-redis/index.cjs +0 -113
  101. package/dist/lock-redis/index.cjs.map +0 -1
  102. package/dist/lock-redis/index.d.cts +0 -24
  103. package/dist/logger/index.cjs +0 -521
  104. package/dist/logger/index.cjs.map +0 -1
  105. package/dist/logger/index.d.cts +0 -281
  106. package/dist/orm/index.cjs +0 -2986
  107. package/dist/orm/index.cjs.map +0 -1
  108. package/dist/orm/index.d.cts +0 -2213
  109. package/dist/queue/index.cjs +0 -1044
  110. package/dist/queue/index.cjs.map +0 -1
  111. package/dist/queue/index.d.cts +0 -1265
  112. package/dist/queue-redis/index.cjs +0 -873
  113. package/dist/queue-redis/index.cjs.map +0 -1
  114. package/dist/queue-redis/index.d.cts +0 -82
  115. package/dist/redis/index.cjs +0 -153
  116. package/dist/redis/index.cjs.map +0 -1
  117. package/dist/redis/index.d.cts +0 -82
  118. package/dist/retry/index.cjs +0 -146
  119. package/dist/retry/index.cjs.map +0 -1
  120. package/dist/retry/index.d.cts +0 -172
  121. package/dist/router/index.cjs +0 -111
  122. package/dist/router/index.cjs.map +0 -1
  123. package/dist/router/index.d.cts +0 -46
  124. package/dist/scheduler/index.cjs +0 -576
  125. package/dist/scheduler/index.cjs.map +0 -1
  126. package/dist/scheduler/index.d.cts +0 -145
  127. package/dist/security/index.cjs +0 -2402
  128. package/dist/security/index.cjs.map +0 -1
  129. package/dist/security/index.d.cts +0 -598
  130. package/dist/server/index.cjs +0 -1680
  131. package/dist/server/index.cjs.map +0 -1
  132. package/dist/server/index.d.cts +0 -810
  133. package/dist/server-auth/index.cjs +0 -3146
  134. package/dist/server-auth/index.cjs.map +0 -1
  135. package/dist/server-auth/index.d.cts +0 -1164
  136. package/dist/server-cache/index.cjs +0 -252
  137. package/dist/server-cache/index.cjs.map +0 -1
  138. package/dist/server-cache/index.d.cts +0 -164
  139. package/dist/server-compress/index.cjs +0 -141
  140. package/dist/server-compress/index.cjs.map +0 -1
  141. package/dist/server-compress/index.d.cts +0 -38
  142. package/dist/server-cookies/index.cjs +0 -234
  143. package/dist/server-cookies/index.cjs.map +0 -1
  144. package/dist/server-cookies/index.d.cts +0 -144
  145. package/dist/server-cors/index.cjs +0 -201
  146. package/dist/server-cors/index.cjs.map +0 -1
  147. package/dist/server-cors/index.d.cts +0 -140
  148. package/dist/server-health/index.cjs +0 -62
  149. package/dist/server-health/index.cjs.map +0 -1
  150. package/dist/server-health/index.d.cts +0 -58
  151. package/dist/server-helmet/index.cjs +0 -131
  152. package/dist/server-helmet/index.cjs.map +0 -1
  153. package/dist/server-helmet/index.d.cts +0 -97
  154. package/dist/server-links/index.cjs +0 -992
  155. package/dist/server-links/index.cjs.map +0 -1
  156. package/dist/server-links/index.d.cts +0 -513
  157. package/dist/server-metrics/index.cjs +0 -4535
  158. package/dist/server-metrics/index.cjs.map +0 -1
  159. package/dist/server-metrics/index.d.cts +0 -35
  160. package/dist/server-multipart/index.cjs +0 -237
  161. package/dist/server-multipart/index.cjs.map +0 -1
  162. package/dist/server-multipart/index.d.cts +0 -50
  163. package/dist/server-proxy/index.cjs +0 -186
  164. package/dist/server-proxy/index.cjs.map +0 -1
  165. package/dist/server-proxy/index.d.cts +0 -234
  166. package/dist/server-rate-limit/index.cjs +0 -241
  167. package/dist/server-rate-limit/index.cjs.map +0 -1
  168. package/dist/server-rate-limit/index.d.cts +0 -183
  169. package/dist/server-security/index.cjs +0 -316
  170. package/dist/server-security/index.cjs.map +0 -1
  171. package/dist/server-security/index.d.cts +0 -173
  172. package/dist/server-static/index.cjs +0 -170
  173. package/dist/server-static/index.cjs.map +0 -1
  174. package/dist/server-static/index.d.cts +0 -121
  175. package/dist/server-swagger/index.cjs +0 -1021
  176. package/dist/server-swagger/index.cjs.map +0 -1
  177. package/dist/server-swagger/index.d.cts +0 -382
  178. package/dist/sms/index.cjs +0 -221
  179. package/dist/sms/index.cjs.map +0 -1
  180. package/dist/sms/index.d.cts +0 -130
  181. package/dist/thread/index.cjs +0 -350
  182. package/dist/thread/index.cjs.map +0 -1
  183. package/dist/thread/index.d.cts +0 -260
  184. package/dist/topic/index.cjs +0 -282
  185. package/dist/topic/index.cjs.map +0 -1
  186. package/dist/topic/index.d.cts +0 -523
  187. package/dist/topic-redis/index.cjs +0 -71
  188. package/dist/topic-redis/index.cjs.map +0 -1
  189. package/dist/topic-redis/index.d.cts +0 -42
  190. package/dist/vite/index.cjs +0 -1077
  191. package/dist/vite/index.cjs.map +0 -1
  192. package/dist/vite/index.d.cts +0 -542
  193. package/dist/websocket/index.cjs +0 -1117
  194. package/dist/websocket/index.cjs.map +0 -1
  195. package/dist/websocket/index.d.cts +0 -861
@@ -1,289 +0,0 @@
1
- import * as alepha122 from "alepha";
2
- import { Alepha, Descriptor, KIND, Static, StaticEncode, TObject } from "alepha";
3
- import * as alepha_logger0 from "alepha/logger";
4
- import * as alepha_orm50 from "alepha/orm";
5
- import * as alepha_batch0 from "alepha/batch";
6
- import { DateTimeProvider } from "alepha/datetime";
7
- import { EmailProvider } from "alepha/email";
8
- import * as alepha_queue0 from "alepha/queue";
9
-
10
- //#region src/api-notifications/controllers/NotificationController.d.ts
11
- declare class NotificationController {}
12
- //#endregion
13
- //#region src/api-notifications/schemas/notificationCreateSchema.d.ts
14
- declare const notificationCreateSchema: alepha122.TObject<{
15
- type: alepha122.TUnsafe<"email" | "sms">;
16
- template: alepha122.TString;
17
- contact: alepha122.TString;
18
- variables: alepha122.TOptional<alepha122.TRecord<"^.*$", alepha122.TAny>>;
19
- }>;
20
- type NotificationCreate = Static<typeof notificationCreateSchema>;
21
- //#endregion
22
- //#region src/api-notifications/entities/notifications.d.ts
23
- declare const notifications: alepha_orm50.EntityDescriptor<alepha122.TObject<{
24
- id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
25
- version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
26
- createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
27
- updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
28
- type: alepha122.TUnsafe<"email" | "sms">;
29
- template: alepha122.TString;
30
- category: alepha122.TOptional<alepha122.TString>;
31
- critical: alepha122.TOptional<alepha122.TBoolean>;
32
- sensitive: alepha122.TOptional<alepha122.TBoolean>;
33
- contact: alepha122.TString;
34
- variables: alepha122.TOptional<alepha122.TRecord<"^.*$", alepha122.TAny>>;
35
- scheduledAt: alepha122.TOptional<alepha122.TString>;
36
- sentAt: alepha122.TOptional<alepha122.TString>;
37
- error: alepha122.TOptional<alepha122.TObject<{
38
- at: alepha122.TString;
39
- name: alepha122.TString;
40
- message: alepha122.TString;
41
- }>>;
42
- }>>;
43
- type NotificationEntity = Static<typeof notifications.schema>;
44
- //#endregion
45
- //#region src/api-notifications/providers/SmsProvider.d.ts
46
- declare abstract class SmsProvider {
47
- abstract send(options: SmsSendOptions): Promise<void>;
48
- }
49
- interface SmsSendOptions {
50
- to: string;
51
- message: string;
52
- }
53
- //#endregion
54
- //#region src/api-notifications/services/NotificationSenderService.d.ts
55
- declare class NotificationSenderService {
56
- protected readonly alepha: Alepha;
57
- protected readonly log: alepha_logger0.Logger;
58
- protected readonly notificationRepository: alepha_orm50.Repository<alepha122.TObject<{
59
- id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
60
- version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
61
- createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
62
- updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
63
- type: alepha122.TUnsafe<"email" | "sms">;
64
- template: alepha122.TString;
65
- category: alepha122.TOptional<alepha122.TString>;
66
- critical: alepha122.TOptional<alepha122.TBoolean>;
67
- sensitive: alepha122.TOptional<alepha122.TBoolean>;
68
- contact: alepha122.TString;
69
- variables: alepha122.TOptional<alepha122.TRecord<"^.*$", alepha122.TAny>>;
70
- scheduledAt: alepha122.TOptional<alepha122.TString>;
71
- sentAt: alepha122.TOptional<alepha122.TString>;
72
- error: alepha122.TOptional<alepha122.TObject<{
73
- at: alepha122.TString;
74
- name: alepha122.TString;
75
- message: alepha122.TString;
76
- }>>;
77
- }>>;
78
- protected readonly dateTimeProvider: DateTimeProvider;
79
- protected readonly emailProvider: EmailProvider;
80
- protected readonly smsProvider: SmsProvider;
81
- send(notificationId: string | NotificationEntity): Promise<void>;
82
- renderSms(notification: NotificationEntity): {
83
- to: string;
84
- message: string;
85
- };
86
- renderEmail(notification: NotificationEntity): {
87
- to: string;
88
- subject: string;
89
- body: string;
90
- };
91
- protected load(notification: NotificationEntity): {
92
- template: NotificationDescriptor<alepha122.TObject<alepha122.TProperties>>;
93
- variables: Record<string, any>;
94
- contact: string;
95
- };
96
- }
97
- //#endregion
98
- //#region src/api-notifications/services/NotificationService.d.ts
99
- declare const notificationServiceEnvSchema: alepha122.TObject<{
100
- NOTIFICATION_QUEUE: alepha122.TOptional<alepha122.TBoolean>;
101
- }>;
102
- declare module "alepha" {
103
- interface Env extends Partial<Static<typeof notificationServiceEnvSchema>> {}
104
- }
105
- declare class NotificationService {
106
- protected readonly alepha: Alepha;
107
- protected readonly log: alepha_logger0.Logger;
108
- protected readonly env: {
109
- NOTIFICATION_QUEUE?: boolean | undefined;
110
- };
111
- protected readonly notificationRepository: alepha_orm50.Repository<alepha122.TObject<{
112
- id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
113
- version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
114
- createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
115
- updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
116
- type: alepha122.TUnsafe<"email" | "sms">;
117
- template: alepha122.TString;
118
- category: alepha122.TOptional<alepha122.TString>;
119
- critical: alepha122.TOptional<alepha122.TBoolean>;
120
- sensitive: alepha122.TOptional<alepha122.TBoolean>;
121
- contact: alepha122.TString;
122
- variables: alepha122.TOptional<alepha122.TRecord<"^.*$", alepha122.TAny>>;
123
- scheduledAt: alepha122.TOptional<alepha122.TString>;
124
- sentAt: alepha122.TOptional<alepha122.TString>;
125
- error: alepha122.TOptional<alepha122.TObject<{
126
- at: alepha122.TString;
127
- name: alepha122.TString;
128
- message: alepha122.TString;
129
- }>>;
130
- }>>;
131
- protected readonly dateTimeProvider: DateTimeProvider;
132
- protected readonly notificationSenderService: NotificationSenderService;
133
- readonly notificationBatch: alepha_batch0.BatchDescriptor<alepha122.TObject<{
134
- type: alepha122.TUnsafe<"email" | "sms">;
135
- template: alepha122.TString;
136
- contact: alepha122.TString;
137
- variables: alepha122.TOptional<alepha122.TRecord<"^.*$", alepha122.TAny>>;
138
- }>, Promise<void>>;
139
- findNotificationById(id: string): Promise<alepha_orm50.PgStatic<alepha122.TObject<{
140
- id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
141
- version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
142
- createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
143
- updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
144
- type: alepha122.TUnsafe<"email" | "sms">;
145
- template: alepha122.TString;
146
- category: alepha122.TOptional<alepha122.TString>;
147
- critical: alepha122.TOptional<alepha122.TBoolean>;
148
- sensitive: alepha122.TOptional<alepha122.TBoolean>;
149
- contact: alepha122.TString;
150
- variables: alepha122.TOptional<alepha122.TRecord<"^.*$", alepha122.TAny>>;
151
- scheduledAt: alepha122.TOptional<alepha122.TString>;
152
- sentAt: alepha122.TOptional<alepha122.TString>;
153
- error: alepha122.TOptional<alepha122.TObject<{
154
- at: alepha122.TString;
155
- name: alepha122.TString;
156
- message: alepha122.TString;
157
- }>>;
158
- }>, alepha_orm50.PgRelationMap<alepha122.TObject<{
159
- id: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_PRIMARY_KEY>, typeof alepha_orm50.PG_DEFAULT>;
160
- version: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TInteger, typeof alepha_orm50.PG_VERSION>, typeof alepha_orm50.PG_DEFAULT>;
161
- createdAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_CREATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
162
- updatedAt: alepha_orm50.PgAttr<alepha_orm50.PgAttr<alepha122.TString, typeof alepha_orm50.PG_UPDATED_AT>, typeof alepha_orm50.PG_DEFAULT>;
163
- type: alepha122.TUnsafe<"email" | "sms">;
164
- template: alepha122.TString;
165
- category: alepha122.TOptional<alepha122.TString>;
166
- critical: alepha122.TOptional<alepha122.TBoolean>;
167
- sensitive: alepha122.TOptional<alepha122.TBoolean>;
168
- contact: alepha122.TString;
169
- variables: alepha122.TOptional<alepha122.TRecord<"^.*$", alepha122.TAny>>;
170
- scheduledAt: alepha122.TOptional<alepha122.TString>;
171
- sentAt: alepha122.TOptional<alepha122.TString>;
172
- error: alepha122.TOptional<alepha122.TObject<{
173
- at: alepha122.TString;
174
- name: alepha122.TString;
175
- message: alepha122.TString;
176
- }>>;
177
- }>>>>;
178
- /**
179
- * Create a new notification.
180
- */
181
- createNotification(entry: NotificationCreate): Promise<void>;
182
- }
183
- //#endregion
184
- //#region src/api-notifications/descriptors/$notification.d.ts
185
- /**
186
- * Creates a notification descriptor for managing email/SMS notification templates.
187
- *
188
- * Provides type-safe, reusable notification templates with multi-language support,
189
- * variable substitution, and categorization for different notification channels.
190
- *
191
- * @example
192
- * ```ts
193
- * class NotificationTemplates {
194
- * welcomeEmail = $notification({
195
- * name: "welcome-email",
196
- * category: "onboarding",
197
- * schema: t.object({ username: t.text(), activationLink: t.text() }),
198
- * email: {
199
- * subject: "Welcome to our platform!",
200
- * body: (vars) => `Hello ${vars.username}, click: ${vars.activationLink}`
201
- * }
202
- * });
203
- *
204
- * async sendWelcome(user: User) {
205
- * await this.welcomeEmail.push({
206
- * variables: { username: user.name, activationLink: generateLink() },
207
- * contact: user.email
208
- * });
209
- * }
210
- * }
211
- * ```
212
- */
213
- declare const $notification: {
214
- <T extends TObject>(options: NotificationDescriptorOptions<T>): NotificationDescriptor<T>;
215
- [KIND]: typeof NotificationDescriptor;
216
- };
217
- interface NotificationDescriptorOptions<T extends TObject> extends NotificationMessage<T> {
218
- name?: string;
219
- description?: string;
220
- category?: string;
221
- critical?: boolean;
222
- sensitive?: boolean;
223
- translations?: {
224
- [lang: string]: NotificationMessage<T>;
225
- };
226
- schema: T;
227
- }
228
- declare class NotificationDescriptor<T extends TObject> extends Descriptor<NotificationDescriptorOptions<T>> {
229
- protected readonly notificationService: NotificationService;
230
- get name(): string;
231
- push(options: NotificationPushOptions<T>): Promise<void>;
232
- configure(options: Partial<NotificationDescriptorOptions<T>>): void;
233
- }
234
- interface NotificationPushOptions<T extends TObject> {
235
- variables: StaticEncode<T>;
236
- contact: string;
237
- }
238
- interface NotificationMessage<T extends TObject> {
239
- email?: {
240
- subject: string;
241
- body: string | ((variables: Static<T>) => string);
242
- };
243
- sms?: {
244
- message: string | ((variables: Static<T>) => string);
245
- };
246
- }
247
- //#endregion
248
- //#region src/api-notifications/jobs/NotificationJobs.d.ts
249
- declare class NotificationJobs {}
250
- //#endregion
251
- //#region src/api-notifications/providers/MemorySmsProvider.d.ts
252
- interface SmsRecord {
253
- to: string;
254
- message: string;
255
- sentAt: Date;
256
- }
257
- declare class MemorySmsProvider extends SmsProvider {
258
- protected records: SmsRecord[];
259
- send(options: SmsSendOptions): Promise<void>;
260
- }
261
- //#endregion
262
- //#region src/api-notifications/queues/NotificationQueues.d.ts
263
- declare class NotificationQueues {
264
- protected readonly notificationSenderService: NotificationSenderService;
265
- readonly processNotification: alepha_queue0.QueueDescriptor<alepha122.TObject<{
266
- notificationId: alepha122.TString;
267
- }>>;
268
- }
269
- //#endregion
270
- //#region src/api-notifications/schemas/notificationContactPreferencesSchema.d.ts
271
- declare const notificationContactPreferencesSchema: alepha122.TObject<{
272
- language: alepha122.TOptional<alepha122.TString>;
273
- exclude: alepha122.TArray<alepha122.TString>;
274
- }>;
275
- type NotificationContactPreferences = Static<typeof notificationContactPreferencesSchema>;
276
- //#endregion
277
- //#region src/api-notifications/index.d.ts
278
- /**
279
- * Provides notification management API endpoints for Alepha applications.
280
- *
281
- * This module includes notification sending, retrieval, status tracking,
282
- * and user notification preferences management.
283
- *
284
- * @module alepha.api.notifications
285
- */
286
- declare const AlephaApiNotifications: alepha122.Service<alepha122.Module>;
287
- //#endregion
288
- export { $notification, AlephaApiNotifications, MemorySmsProvider, NotificationContactPreferences, NotificationController, NotificationCreate, NotificationDescriptor, NotificationDescriptorOptions, NotificationEntity, NotificationJobs, NotificationMessage, NotificationPushOptions, NotificationQueues, NotificationSenderService, NotificationService, SmsProvider, SmsRecord, SmsSendOptions, notificationContactPreferencesSchema, notificationCreateSchema, notificationServiceEnvSchema, notifications };
289
- //# sourceMappingURL=index.d.cts.map
@@ -1,66 +0,0 @@
1
- let alepha = require("alepha");
2
- let alepha_orm = require("alepha/orm");
3
-
4
- //#region src/api-parameters/descriptors/$config.ts
5
- var ConfigDescriptor = class extends alepha.Descriptor {
6
- get name() {
7
- return this.options.name || this.config.propertyKey;
8
- }
9
- get schema() {
10
- return this.options.schema;
11
- }
12
- get current() {
13
- return this.options.default;
14
- }
15
- get next() {}
16
- get(key) {
17
- return this.current[key];
18
- }
19
- /**
20
- * Apply a new configuration object.
21
- */
22
- async set(value, options) {}
23
- sub(fn) {}
24
- };
25
- const $config = (options) => {
26
- return (0, alepha.createDescriptor)(ConfigDescriptor, options);
27
- };
28
-
29
- //#endregion
30
- //#region src/api-parameters/entities/parameters.ts
31
- const parameters = (0, alepha_orm.$entity)({
32
- name: "parameters",
33
- schema: alepha.t.object({
34
- id: alepha_orm.pg.primaryKey(alepha.t.uuid()),
35
- createdAt: alepha_orm.pg.createdAt(),
36
- updatedAt: alepha_orm.pg.updatedAt(),
37
- name: alepha.t.string(),
38
- content: alepha.t.json(),
39
- tags: alepha.t.optional(alepha.t.array(alepha.t.string())),
40
- creatorId: alepha.t.optional(alepha.t.uuid()),
41
- creatorName: alepha.t.optional(alepha.t.string()),
42
- activationDate: alepha.t.datetime({ description: "Optional activation date. Default to now. Must be now or later." })
43
- })
44
- });
45
-
46
- //#endregion
47
- //#region src/api-parameters/index.ts
48
- /**
49
- * Provides parameter management API endpoints for Alepha applications.
50
- *
51
- * This module includes configuration parameter storage, retrieval,
52
- * and dynamic application settings management.
53
- *
54
- * @module alepha.api.parameters
55
- */
56
- const AlephaApiParameters = (0, alepha.$module)({
57
- name: "alepha.api.parameters",
58
- services: []
59
- });
60
-
61
- //#endregion
62
- exports.$config = $config;
63
- exports.AlephaApiParameters = AlephaApiParameters;
64
- exports.ConfigDescriptor = ConfigDescriptor;
65
- exports.parameters = parameters;
66
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","names":["Descriptor","t","pg"],"sources":["../../src/api-parameters/descriptors/$config.ts","../../src/api-parameters/entities/parameters.ts","../../src/api-parameters/index.ts"],"sourcesContent":["import {\n createDescriptor,\n Descriptor,\n type Static,\n type TObject,\n} from \"alepha\";\nimport type { UserAccount } from \"alepha/security\";\n\n/**\n * Creates a configuration parameter descriptor for managing application settings.\n *\n * Provides type-safe, versioned configuration with schema validation, default values,\n * and scheduled activation. Useful for feature flags, system parameters, and runtime settings.\n *\n * @example\n * ```ts\n * class AppConfig {\n * features = $config({\n * name: \"feature-flags\",\n * schema: t.object({\n * enableBeta: t.boolean(),\n * maxUploadSize: t.number()\n * }),\n * default: { enableBeta: false, maxUploadSize: 10485760 }\n * });\n *\n * async updateFeatures() {\n * await this.features.set(\n * { enableBeta: true, maxUploadSize: 20971520 },\n * { user: currentUser, activationDate: tomorrow }\n * );\n * }\n * }\n * ```\n */\nexport interface ConfigDescriptorOptions<T extends TObject> {\n name?: string;\n description?: string;\n schema: T;\n default: Static<T>;\n}\n\nexport class ConfigDescriptor<T extends TObject> extends Descriptor<\n ConfigDescriptorOptions<T>\n> {\n public get name() {\n return this.options.name || this.config.propertyKey;\n }\n\n public get schema(): T {\n return this.options.schema;\n }\n\n public get current(): Static<T> {\n return this.options.default;\n }\n\n public get next(): Static<T> | undefined {\n return undefined;\n }\n\n public get<Key extends keyof Static<T>>(key: Key): Static<T>[Key] {\n return this.current[key];\n }\n\n /**\n * Apply a new configuration object.\n */\n public async set(\n value: Static<T>,\n options: {\n user?: UserAccount;\n activationDate?: Date; // default to now\n },\n ): Promise<void> {}\n\n public sub(fn: (curr: Static<T>) => void): void {}\n}\n\nexport const $config = <T extends TObject>(\n options: ConfigDescriptorOptions<T>,\n) => {\n return createDescriptor(ConfigDescriptor<T>, options);\n};\n","import { type Static, t } from \"alepha\";\nimport { $entity, pg } from \"alepha/orm\";\n\nexport const parameters = $entity({\n name: \"parameters\",\n schema: t.object({\n id: pg.primaryKey(t.uuid()),\n\n createdAt: pg.createdAt(),\n\n updatedAt: pg.updatedAt(),\n\n name: t.string(),\n\n content: t.json(),\n\n tags: t.optional(t.array(t.string())),\n\n creatorId: t.optional(t.uuid()),\n\n creatorName: t.optional(t.string()),\n\n activationDate: t.datetime({\n description:\n \"Optional activation date. Default to now. Must be now or later.\",\n }),\n }),\n});\n\nexport type ParameterEntity = Static<typeof parameters.schema>;\n","import { $module } from \"alepha\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./descriptors/$config.ts\";\nexport * from \"./entities/parameters.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Provides parameter management API endpoints for Alepha applications.\n *\n * This module includes configuration parameter storage, retrieval,\n * and dynamic application settings management.\n *\n * @module alepha.api.parameters\n */\nexport const AlephaApiParameters = $module({\n name: \"alepha.api.parameters\",\n services: [],\n});\n"],"mappings":";;;;AA0CA,IAAa,mBAAb,cAAyDA,kBAEvD;CACA,IAAW,OAAO;AAChB,SAAO,KAAK,QAAQ,QAAQ,KAAK,OAAO;;CAG1C,IAAW,SAAY;AACrB,SAAO,KAAK,QAAQ;;CAGtB,IAAW,UAAqB;AAC9B,SAAO,KAAK,QAAQ;;CAGtB,IAAW,OAA8B;CAIzC,AAAO,IAAiC,KAA0B;AAChE,SAAO,KAAK,QAAQ;;;;;CAMtB,MAAa,IACX,OACA,SAIe;CAEjB,AAAO,IAAI,IAAqC;;AAGlD,MAAa,WACX,YACG;AACH,qCAAwB,kBAAqB,QAAQ;;;;;AC/EvD,MAAa,qCAAqB;CAChC,MAAM;CACN,QAAQC,SAAE,OAAO;EACf,IAAIC,cAAG,WAAWD,SAAE,MAAM,CAAC;EAE3B,WAAWC,cAAG,WAAW;EAEzB,WAAWA,cAAG,WAAW;EAEzB,MAAMD,SAAE,QAAQ;EAEhB,SAASA,SAAE,MAAM;EAEjB,MAAMA,SAAE,SAASA,SAAE,MAAMA,SAAE,QAAQ,CAAC,CAAC;EAErC,WAAWA,SAAE,SAASA,SAAE,MAAM,CAAC;EAE/B,aAAaA,SAAE,SAASA,SAAE,QAAQ,CAAC;EAEnC,gBAAgBA,SAAE,SAAS,EACzB,aACE,mEACH,CAAC;EACH,CAAC;CACH,CAAC;;;;;;;;;;;;ACVF,MAAa,0CAA8B;CACzC,MAAM;CACN,UAAU,EAAE;CACb,CAAC"}
@@ -1,84 +0,0 @@
1
- import * as alepha1 from "alepha";
2
- import { Descriptor, Static, TObject } from "alepha";
3
- import { UserAccount } from "alepha/security";
4
- import * as alepha_orm0 from "alepha/orm";
5
-
6
- //#region src/api-parameters/descriptors/$config.d.ts
7
-
8
- /**
9
- * Creates a configuration parameter descriptor for managing application settings.
10
- *
11
- * Provides type-safe, versioned configuration with schema validation, default values,
12
- * and scheduled activation. Useful for feature flags, system parameters, and runtime settings.
13
- *
14
- * @example
15
- * ```ts
16
- * class AppConfig {
17
- * features = $config({
18
- * name: "feature-flags",
19
- * schema: t.object({
20
- * enableBeta: t.boolean(),
21
- * maxUploadSize: t.number()
22
- * }),
23
- * default: { enableBeta: false, maxUploadSize: 10485760 }
24
- * });
25
- *
26
- * async updateFeatures() {
27
- * await this.features.set(
28
- * { enableBeta: true, maxUploadSize: 20971520 },
29
- * { user: currentUser, activationDate: tomorrow }
30
- * );
31
- * }
32
- * }
33
- * ```
34
- */
35
- interface ConfigDescriptorOptions<T extends TObject> {
36
- name?: string;
37
- description?: string;
38
- schema: T;
39
- default: Static<T>;
40
- }
41
- declare class ConfigDescriptor<T extends TObject> extends Descriptor<ConfigDescriptorOptions<T>> {
42
- get name(): string;
43
- get schema(): T;
44
- get current(): Static<T>;
45
- get next(): Static<T> | undefined;
46
- get<Key extends keyof Static<T>>(key: Key): Static<T>[Key];
47
- /**
48
- * Apply a new configuration object.
49
- */
50
- set(value: Static<T>, options: {
51
- user?: UserAccount;
52
- activationDate?: Date;
53
- }): Promise<void>;
54
- sub(fn: (curr: Static<T>) => void): void;
55
- }
56
- declare const $config: <T extends TObject>(options: ConfigDescriptorOptions<T>) => ConfigDescriptor<T>;
57
- //#endregion
58
- //#region src/api-parameters/entities/parameters.d.ts
59
- declare const parameters: alepha_orm0.EntityDescriptor<alepha1.TObject<{
60
- id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha1.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
61
- createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha1.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
62
- updatedAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha1.TString, typeof alepha_orm0.PG_UPDATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
63
- name: alepha1.TString;
64
- content: alepha1.TRecord<string, alepha1.TAny>;
65
- tags: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
66
- creatorId: alepha1.TOptional<alepha1.TString>;
67
- creatorName: alepha1.TOptional<alepha1.TString>;
68
- activationDate: alepha1.TString;
69
- }>>;
70
- type ParameterEntity = Static<typeof parameters.schema>;
71
- //#endregion
72
- //#region src/api-parameters/index.d.ts
73
- /**
74
- * Provides parameter management API endpoints for Alepha applications.
75
- *
76
- * This module includes configuration parameter storage, retrieval,
77
- * and dynamic application settings management.
78
- *
79
- * @module alepha.api.parameters
80
- */
81
- declare const AlephaApiParameters: alepha1.Service<alepha1.Module>;
82
- //#endregion
83
- export { $config, AlephaApiParameters, ConfigDescriptor, ConfigDescriptorOptions, ParameterEntity, parameters };
84
- //# sourceMappingURL=index.d.cts.map