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.
Files changed (167) hide show
  1. package/README.md +61 -17
  2. package/dist/index.cjs +17089 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +1 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.js +17088 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +42 -365
  9. package/src/assets/biomeJson.ts +33 -0
  10. package/src/assets/tsconfigJson.ts +18 -0
  11. package/src/assets/viteConfigTs.ts +14 -0
  12. package/src/commands/BiomeCommands.ts +41 -0
  13. package/src/commands/CoreCommands.ts +169 -0
  14. package/src/commands/DrizzleCommands.ts +228 -0
  15. package/src/commands/VerifyCommands.ts +44 -0
  16. package/src/commands/ViteCommands.ts +119 -0
  17. package/src/index.ts +35 -0
  18. package/src/services/ProcessRunner.ts +89 -0
  19. package/src/services/ProjectUtils.ts +508 -0
  20. package/src/version.ts +7 -0
  21. package/api/files.cjs +0 -8
  22. package/api/files.d.ts +0 -438
  23. package/api/files.js +0 -1
  24. package/api/jobs.cjs +0 -8
  25. package/api/jobs.d.ts +0 -327
  26. package/api/jobs.js +0 -1
  27. package/api/notifications.cjs +0 -8
  28. package/api/notifications.d.ts +0 -263
  29. package/api/notifications.js +0 -1
  30. package/api/users.cjs +0 -8
  31. package/api/users.d.ts +0 -923
  32. package/api/users.js +0 -1
  33. package/api/verifications.cjs +0 -8
  34. package/api/verifications.d.ts +0 -1
  35. package/api/verifications.js +0 -1
  36. package/batch.cjs +0 -8
  37. package/batch.d.ts +0 -154
  38. package/batch.js +0 -1
  39. package/bucket.cjs +0 -8
  40. package/bucket.d.ts +0 -520
  41. package/bucket.js +0 -1
  42. package/cache/redis.cjs +0 -8
  43. package/cache/redis.d.ts +0 -40
  44. package/cache/redis.js +0 -1
  45. package/cache.cjs +0 -8
  46. package/cache.d.ts +0 -288
  47. package/cache.js +0 -1
  48. package/command.cjs +0 -8
  49. package/command.d.ts +0 -269
  50. package/command.js +0 -1
  51. package/core.cjs +0 -8
  52. package/core.d.ts +0 -1904
  53. package/core.js +0 -1
  54. package/datetime.cjs +0 -8
  55. package/datetime.d.ts +0 -144
  56. package/datetime.js +0 -1
  57. package/devtools.cjs +0 -8
  58. package/devtools.d.ts +0 -252
  59. package/devtools.js +0 -1
  60. package/email.cjs +0 -8
  61. package/email.d.ts +0 -187
  62. package/email.js +0 -1
  63. package/fake.cjs +0 -8
  64. package/fake.d.ts +0 -73
  65. package/fake.js +0 -1
  66. package/file.cjs +0 -8
  67. package/file.d.ts +0 -528
  68. package/file.js +0 -1
  69. package/lock/redis.cjs +0 -8
  70. package/lock/redis.d.ts +0 -24
  71. package/lock/redis.js +0 -1
  72. package/lock.cjs +0 -8
  73. package/lock.d.ts +0 -552
  74. package/lock.js +0 -1
  75. package/logger.cjs +0 -8
  76. package/logger.d.ts +0 -287
  77. package/logger.js +0 -1
  78. package/postgres.cjs +0 -8
  79. package/postgres.d.ts +0 -2143
  80. package/postgres.js +0 -1
  81. package/queue/redis.cjs +0 -8
  82. package/queue/redis.d.ts +0 -29
  83. package/queue/redis.js +0 -1
  84. package/queue.cjs +0 -8
  85. package/queue.d.ts +0 -760
  86. package/queue.js +0 -1
  87. package/react/auth.cjs +0 -8
  88. package/react/auth.d.ts +0 -504
  89. package/react/auth.js +0 -1
  90. package/react/form.cjs +0 -8
  91. package/react/form.d.ts +0 -211
  92. package/react/form.js +0 -1
  93. package/react/head.cjs +0 -8
  94. package/react/head.d.ts +0 -120
  95. package/react/head.js +0 -1
  96. package/react/i18n.cjs +0 -8
  97. package/react/i18n.d.ts +0 -168
  98. package/react/i18n.js +0 -1
  99. package/react.cjs +0 -8
  100. package/react.d.ts +0 -1263
  101. package/react.js +0 -1
  102. package/redis.cjs +0 -8
  103. package/redis.d.ts +0 -82
  104. package/redis.js +0 -1
  105. package/retry.cjs +0 -8
  106. package/retry.d.ts +0 -162
  107. package/retry.js +0 -1
  108. package/router.cjs +0 -8
  109. package/router.d.ts +0 -45
  110. package/router.js +0 -1
  111. package/scheduler.cjs +0 -8
  112. package/scheduler.d.ts +0 -145
  113. package/scheduler.js +0 -1
  114. package/security.cjs +0 -8
  115. package/security.d.ts +0 -586
  116. package/security.js +0 -1
  117. package/server/cache.cjs +0 -8
  118. package/server/cache.d.ts +0 -163
  119. package/server/cache.js +0 -1
  120. package/server/compress.cjs +0 -8
  121. package/server/compress.d.ts +0 -38
  122. package/server/compress.js +0 -1
  123. package/server/cookies.cjs +0 -8
  124. package/server/cookies.d.ts +0 -144
  125. package/server/cookies.js +0 -1
  126. package/server/cors.cjs +0 -8
  127. package/server/cors.d.ts +0 -45
  128. package/server/cors.js +0 -1
  129. package/server/health.cjs +0 -8
  130. package/server/health.d.ts +0 -58
  131. package/server/health.js +0 -1
  132. package/server/helmet.cjs +0 -8
  133. package/server/helmet.d.ts +0 -98
  134. package/server/helmet.js +0 -1
  135. package/server/links.cjs +0 -8
  136. package/server/links.d.ts +0 -322
  137. package/server/links.js +0 -1
  138. package/server/metrics.cjs +0 -8
  139. package/server/metrics.d.ts +0 -35
  140. package/server/metrics.js +0 -1
  141. package/server/multipart.cjs +0 -8
  142. package/server/multipart.d.ts +0 -42
  143. package/server/multipart.js +0 -1
  144. package/server/proxy.cjs +0 -8
  145. package/server/proxy.d.ts +0 -234
  146. package/server/proxy.js +0 -1
  147. package/server/security.cjs +0 -8
  148. package/server/security.d.ts +0 -92
  149. package/server/security.js +0 -1
  150. package/server/static.cjs +0 -8
  151. package/server/static.d.ts +0 -119
  152. package/server/static.js +0 -1
  153. package/server/swagger.cjs +0 -8
  154. package/server/swagger.d.ts +0 -161
  155. package/server/swagger.js +0 -1
  156. package/server.cjs +0 -8
  157. package/server.d.ts +0 -849
  158. package/server.js +0 -1
  159. package/topic/redis.cjs +0 -8
  160. package/topic/redis.d.ts +0 -42
  161. package/topic/redis.js +0 -1
  162. package/topic.cjs +0 -8
  163. package/topic.d.ts +0 -819
  164. package/topic.js +0 -1
  165. package/vite.cjs +0 -8
  166. package/vite.d.ts +0 -186
  167. package/vite.js +0 -1
package/core.js DELETED
@@ -1 +0,0 @@
1
- export * from '@alepha/core'
package/datetime.cjs DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/datetime');
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/datetime.d.ts DELETED
@@ -1,144 +0,0 @@
1
- import * as _alepha_core1 from "alepha";
2
- import { Alepha, Descriptor, KIND } from "alepha";
3
- import "dayjs/plugin/relativeTime.js";
4
- import dayjsDuration from "dayjs/plugin/duration.js";
5
- import "dayjs/plugin/utc.js";
6
- import "dayjs/plugin/timezone.js";
7
- import "dayjs/plugin/localizedFormat.js";
8
- import "dayjs/locale/ar.js";
9
- import "dayjs/locale/fr.js";
10
- import DayjsApi, { Dayjs, ManipulateType, PluginFunc } from "dayjs";
11
-
12
- //#region src/providers/DateTimeProvider.d.ts
13
- type DateTime = DayjsApi.Dayjs;
14
- type Duration = dayjsDuration.Duration;
15
- type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
16
- declare const dayjs: typeof DayjsApi;
17
- declare const isDateTime: (value: unknown) => value is DateTime;
18
- declare class DateTimeProvider {
19
- static PLUGINS: Array<PluginFunc<any>>;
20
- protected alepha: Alepha;
21
- protected ref: DateTime | null;
22
- protected readonly timeouts: Timeout[];
23
- protected readonly intervals: Interval[];
24
- constructor();
25
- protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
26
- protected readonly onStop: _alepha_core1.HookDescriptor<"stop">;
27
- setLocale(locale: string): void;
28
- isDateTime(value: unknown): value is DateTime;
29
- /**
30
- * Create a new UTC DateTime instance.
31
- */
32
- utc(date: string | number | Date | Dayjs | null | undefined): DateTime;
33
- /**
34
- * Create a new DateTime instance.
35
- */
36
- of(date: string | number | Date | Dayjs | null | undefined): DateTime;
37
- /**
38
- * Get the current date.
39
- */
40
- now(): DateTime;
41
- /**
42
- * Get the current date as a string.
43
- *
44
- * @param date
45
- */
46
- toISOString(date?: Date | string | DateTime): string;
47
- /**
48
- * Get the current date as a string.
49
- */
50
- nowISOString(): string;
51
- /**
52
- * Get the current date as a string.
53
- *
54
- * @protected
55
- */
56
- protected getCurrentDate(): DateTime;
57
- /**
58
- * Create a new Duration instance.
59
- */
60
- duration: (duration: DurationLike, unit?: ManipulateType) => Duration;
61
- isDurationLike(value: unknown): value is DurationLike;
62
- /**
63
- * Return a promise that resolves after the next tick.
64
- * It uses `setTimeout` with 0 ms delay.
65
- */
66
- tick(): Promise<void>;
67
- /**
68
- * Wait for a certain duration.
69
- *
70
- * You can clear the timeout by using the `AbortSignal` API.
71
- * Aborted signal will resolve the promise immediately, it does not reject it.
72
- */
73
- wait(duration: DurationLike, options?: {
74
- signal?: AbortSignal;
75
- now?: number;
76
- }): Promise<void>;
77
- createInterval(run: () => unknown, distance: DurationLike, start?: boolean): Interval;
78
- /**
79
- * Run a callback after a certain duration.
80
- */
81
- createTimeout(callback: () => void, duration: DurationLike, now?: number): Timeout;
82
- clearTimeout(timeout: Timeout): void;
83
- clearInterval(interval: Interval): void;
84
- /**
85
- * Run a function with a deadline.
86
- */
87
- deadline<T>(fn: (signal: AbortSignal) => Promise<T>, duration: DurationLike): Promise<T>;
88
- /**
89
- * Add time to the current date.
90
- */
91
- travel(duration: DurationLike, unit?: ManipulateType): Promise<void>;
92
- /**
93
- * Stop the time.
94
- */
95
- pause(): DateTime;
96
- /**
97
- * Reset the reference date.
98
- */
99
- reset(): void;
100
- }
101
- interface Interval {
102
- timer?: any;
103
- duration: number;
104
- run: () => unknown;
105
- }
106
- interface Timeout {
107
- now: number;
108
- timer?: any;
109
- duration: number;
110
- callback: () => void;
111
- clear: () => void;
112
- }
113
- //#endregion
114
- //#region src/descriptors/$interval.d.ts
115
- /**
116
- * Run a function periodically.
117
- * It uses the `setInterval` internally.
118
- * It starts by default when the context starts and stops when the context stops.
119
- */
120
- declare const $interval: {
121
- (options: IntervalDescriptorOptions): IntervalDescriptor;
122
- [KIND]: typeof IntervalDescriptor;
123
- };
124
- interface IntervalDescriptorOptions {
125
- /**
126
- * The interval handler.
127
- */
128
- handler: () => unknown;
129
- /**
130
- * The interval duration.
131
- */
132
- duration: DurationLike;
133
- }
134
- declare class IntervalDescriptor extends Descriptor<IntervalDescriptorOptions> {
135
- protected readonly dateTimeProvider: DateTimeProvider;
136
- called: number;
137
- protected onInit(): void;
138
- }
139
- //#endregion
140
- //#region src/index.d.ts
141
- declare const AlephaDateTime: _alepha_core1.Service<_alepha_core1.Module>;
142
- //#endregion
143
- export { $interval, AlephaDateTime, DateTime, DateTimeProvider, Duration, DurationLike, Interval, IntervalDescriptor, IntervalDescriptorOptions, Timeout, dayjs, isDateTime };
144
- //# sourceMappingURL=index.d.ts.map
package/datetime.js DELETED
@@ -1 +0,0 @@
1
- export * from '@alepha/datetime'
package/devtools.cjs DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/devtools');
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/devtools.d.ts DELETED
@@ -1,252 +0,0 @@
1
- import * as _alepha_core0 from "alepha";
2
- import { Alepha, Static } from "alepha";
3
- import * as _alepha_logger0 from "alepha/logger";
4
- import * as typebox6 from "typebox";
5
-
6
- //#region src/schemas/DevActionMetadata.d.ts
7
- declare const devActionMetadataSchema: typebox6.TObject<{
8
- name: typebox6.TString;
9
- group: typebox6.TString;
10
- method: typebox6.TString;
11
- path: typebox6.TString;
12
- prefix: typebox6.TString;
13
- fullPath: typebox6.TString;
14
- description: typebox6.TOptional<typebox6.TString>;
15
- summary: typebox6.TOptional<typebox6.TString>;
16
- disabled: typebox6.TOptional<typebox6.TBoolean>;
17
- secure: typebox6.TOptional<typebox6.TBoolean>;
18
- hide: typebox6.TOptional<typebox6.TBoolean>;
19
- body: typebox6.TOptional<typebox6.TAny>;
20
- params: typebox6.TOptional<typebox6.TAny>;
21
- query: typebox6.TOptional<typebox6.TAny>;
22
- response: typebox6.TOptional<typebox6.TAny>;
23
- bodyContentType: typebox6.TOptional<typebox6.TString>;
24
- }>;
25
- type DevActionMetadata = Static<typeof devActionMetadataSchema>;
26
- //#endregion
27
- //#region src/schemas/DevBucketMetadata.d.ts
28
- declare const devBucketMetadataSchema: typebox6.TObject<{
29
- name: typebox6.TString;
30
- description: typebox6.TOptional<typebox6.TString>;
31
- mimeTypes: typebox6.TOptional<typebox6.TArray<typebox6.TString>>;
32
- maxSize: typebox6.TOptional<typebox6.TNumber>;
33
- provider: typebox6.TString;
34
- }>;
35
- type DevBucketMetadata = Static<typeof devBucketMetadataSchema>;
36
- //#endregion
37
- //#region src/schemas/DevCacheMetadata.d.ts
38
- declare const devCacheMetadataSchema: typebox6.TObject<{
39
- name: typebox6.TString;
40
- ttl: typebox6.TOptional<typebox6.TAny>;
41
- disabled: typebox6.TOptional<typebox6.TBoolean>;
42
- provider: typebox6.TString;
43
- }>;
44
- type DevCacheMetadata = Static<typeof devCacheMetadataSchema>;
45
- //#endregion
46
- //#region src/schemas/DevMetadata.d.ts
47
- declare const devMetadataSchema: typebox6.TObject<{
48
- actions: typebox6.TArray<typebox6.TObject<{
49
- name: typebox6.TString;
50
- group: typebox6.TString;
51
- method: typebox6.TString;
52
- path: typebox6.TString;
53
- prefix: typebox6.TString;
54
- fullPath: typebox6.TString;
55
- description: typebox6.TOptional<typebox6.TString>;
56
- summary: typebox6.TOptional<typebox6.TString>;
57
- disabled: typebox6.TOptional<typebox6.TBoolean>;
58
- secure: typebox6.TOptional<typebox6.TBoolean>;
59
- hide: typebox6.TOptional<typebox6.TBoolean>;
60
- body: typebox6.TOptional<typebox6.TAny>;
61
- params: typebox6.TOptional<typebox6.TAny>;
62
- query: typebox6.TOptional<typebox6.TAny>;
63
- response: typebox6.TOptional<typebox6.TAny>;
64
- bodyContentType: typebox6.TOptional<typebox6.TString>;
65
- }>>;
66
- queues: typebox6.TArray<typebox6.TObject<{
67
- name: typebox6.TString;
68
- description: typebox6.TOptional<typebox6.TString>;
69
- schema: typebox6.TOptional<typebox6.TAny>;
70
- provider: typebox6.TString;
71
- }>>;
72
- schedulers: typebox6.TArray<typebox6.TObject<{
73
- name: typebox6.TString;
74
- description: typebox6.TOptional<typebox6.TString>;
75
- cron: typebox6.TOptional<typebox6.TString>;
76
- interval: typebox6.TOptional<typebox6.TAny>;
77
- lock: typebox6.TOptional<typebox6.TBoolean>;
78
- }>>;
79
- topics: typebox6.TArray<typebox6.TObject<{
80
- name: typebox6.TString;
81
- description: typebox6.TOptional<typebox6.TString>;
82
- schema: typebox6.TOptional<typebox6.TAny>;
83
- provider: typebox6.TString;
84
- }>>;
85
- buckets: typebox6.TArray<typebox6.TObject<{
86
- name: typebox6.TString;
87
- description: typebox6.TOptional<typebox6.TString>;
88
- mimeTypes: typebox6.TOptional<typebox6.TArray<typebox6.TString>>;
89
- maxSize: typebox6.TOptional<typebox6.TNumber>;
90
- provider: typebox6.TString;
91
- }>>;
92
- realms: typebox6.TArray<typebox6.TObject<{
93
- name: typebox6.TString;
94
- description: typebox6.TOptional<typebox6.TString>;
95
- roles: typebox6.TOptional<typebox6.TArray<typebox6.TAny>>;
96
- type: typebox6.TUnsafe<"internal" | "external">;
97
- settings: typebox6.TOptional<typebox6.TObject<{
98
- accessTokenExpiration: typebox6.TOptional<typebox6.TAny>;
99
- refreshTokenExpiration: typebox6.TOptional<typebox6.TAny>;
100
- hasOnCreateSession: typebox6.TBoolean;
101
- hasOnRefreshSession: typebox6.TBoolean;
102
- hasOnDeleteSession: typebox6.TBoolean;
103
- }>>;
104
- }>>;
105
- caches: typebox6.TArray<typebox6.TObject<{
106
- name: typebox6.TString;
107
- ttl: typebox6.TOptional<typebox6.TAny>;
108
- disabled: typebox6.TOptional<typebox6.TBoolean>;
109
- provider: typebox6.TString;
110
- }>>;
111
- pages: typebox6.TArray<typebox6.TObject<{
112
- name: typebox6.TString;
113
- description: typebox6.TOptional<typebox6.TString>;
114
- path: typebox6.TOptional<typebox6.TString>;
115
- params: typebox6.TOptional<typebox6.TAny>;
116
- query: typebox6.TOptional<typebox6.TAny>;
117
- hasComponent: typebox6.TBoolean;
118
- hasLazy: typebox6.TBoolean;
119
- hasResolve: typebox6.TBoolean;
120
- hasChildren: typebox6.TBoolean;
121
- hasParent: typebox6.TBoolean;
122
- hasErrorHandler: typebox6.TBoolean;
123
- static: typebox6.TOptional<typebox6.TBoolean>;
124
- cache: typebox6.TOptional<typebox6.TAny>;
125
- client: typebox6.TOptional<typebox6.TAny>;
126
- animation: typebox6.TOptional<typebox6.TAny>;
127
- }>>;
128
- providers: typebox6.TArray<typebox6.TObject<{
129
- name: typebox6.TString;
130
- module: typebox6.TOptional<typebox6.TString>;
131
- dependencies: typebox6.TArray<typebox6.TString>;
132
- aliases: typebox6.TOptional<typebox6.TArray<typebox6.TString>>;
133
- }>>;
134
- modules: typebox6.TArray<typebox6.TObject<{
135
- name: typebox6.TString;
136
- providers: typebox6.TArray<typebox6.TString>;
137
- }>>;
138
- }>;
139
- type DevMetadata = Static<typeof devMetadataSchema>;
140
- //#endregion
141
- //#region src/schemas/DevModuleMetadata.d.ts
142
- declare const devModuleMetadataSchema: typebox6.TObject<{
143
- name: typebox6.TString;
144
- providers: typebox6.TArray<typebox6.TString>;
145
- }>;
146
- type DevModuleMetadata = Static<typeof devModuleMetadataSchema>;
147
- //#endregion
148
- //#region src/schemas/DevPageMetadata.d.ts
149
- declare const devPageMetadataSchema: typebox6.TObject<{
150
- name: typebox6.TString;
151
- description: typebox6.TOptional<typebox6.TString>;
152
- path: typebox6.TOptional<typebox6.TString>;
153
- params: typebox6.TOptional<typebox6.TAny>;
154
- query: typebox6.TOptional<typebox6.TAny>;
155
- hasComponent: typebox6.TBoolean;
156
- hasLazy: typebox6.TBoolean;
157
- hasResolve: typebox6.TBoolean;
158
- hasChildren: typebox6.TBoolean;
159
- hasParent: typebox6.TBoolean;
160
- hasErrorHandler: typebox6.TBoolean;
161
- static: typebox6.TOptional<typebox6.TBoolean>;
162
- cache: typebox6.TOptional<typebox6.TAny>;
163
- client: typebox6.TOptional<typebox6.TAny>;
164
- animation: typebox6.TOptional<typebox6.TAny>;
165
- }>;
166
- type DevPageMetadata = Static<typeof devPageMetadataSchema>;
167
- //#endregion
168
- //#region src/schemas/DevProviderMetadata.d.ts
169
- declare const devProviderMetadataSchema: typebox6.TObject<{
170
- name: typebox6.TString;
171
- module: typebox6.TOptional<typebox6.TString>;
172
- dependencies: typebox6.TArray<typebox6.TString>;
173
- aliases: typebox6.TOptional<typebox6.TArray<typebox6.TString>>;
174
- }>;
175
- type DevProviderMetadata = Static<typeof devProviderMetadataSchema>;
176
- //#endregion
177
- //#region src/schemas/DevQueueMetadata.d.ts
178
- declare const devQueueMetadataSchema: typebox6.TObject<{
179
- name: typebox6.TString;
180
- description: typebox6.TOptional<typebox6.TString>;
181
- schema: typebox6.TOptional<typebox6.TAny>;
182
- provider: typebox6.TString;
183
- }>;
184
- type DevQueueMetadata = Static<typeof devQueueMetadataSchema>;
185
- //#endregion
186
- //#region src/schemas/DevRealmMetadata.d.ts
187
- declare const devRealmMetadataSchema: typebox6.TObject<{
188
- name: typebox6.TString;
189
- description: typebox6.TOptional<typebox6.TString>;
190
- roles: typebox6.TOptional<typebox6.TArray<typebox6.TAny>>;
191
- type: typebox6.TUnsafe<"internal" | "external">;
192
- settings: typebox6.TOptional<typebox6.TObject<{
193
- accessTokenExpiration: typebox6.TOptional<typebox6.TAny>;
194
- refreshTokenExpiration: typebox6.TOptional<typebox6.TAny>;
195
- hasOnCreateSession: typebox6.TBoolean;
196
- hasOnRefreshSession: typebox6.TBoolean;
197
- hasOnDeleteSession: typebox6.TBoolean;
198
- }>>;
199
- }>;
200
- type DevRealmMetadata = Static<typeof devRealmMetadataSchema>;
201
- //#endregion
202
- //#region src/schemas/DevSchedulerMetadata.d.ts
203
- declare const devSchedulerMetadataSchema: typebox6.TObject<{
204
- name: typebox6.TString;
205
- description: typebox6.TOptional<typebox6.TString>;
206
- cron: typebox6.TOptional<typebox6.TString>;
207
- interval: typebox6.TOptional<typebox6.TAny>;
208
- lock: typebox6.TOptional<typebox6.TBoolean>;
209
- }>;
210
- type DevSchedulerMetadata = Static<typeof devSchedulerMetadataSchema>;
211
- //#endregion
212
- //#region src/schemas/DevTopicMetadata.d.ts
213
- declare const devTopicMetadataSchema: typebox6.TObject<{
214
- name: typebox6.TString;
215
- description: typebox6.TOptional<typebox6.TString>;
216
- schema: typebox6.TOptional<typebox6.TAny>;
217
- provider: typebox6.TString;
218
- }>;
219
- type DevTopicMetadata = Static<typeof devTopicMetadataSchema>;
220
- //#endregion
221
- //#region src/providers/DevToolsMetadataProvider.d.ts
222
- declare class DevToolsMetadataProvider {
223
- protected readonly alepha: Alepha;
224
- protected readonly log: _alepha_logger0.Logger;
225
- getActions(): DevActionMetadata[];
226
- getQueues(): DevQueueMetadata[];
227
- getSchedulers(): DevSchedulerMetadata[];
228
- getTopics(): DevTopicMetadata[];
229
- getBuckets(): DevBucketMetadata[];
230
- getRealms(): DevRealmMetadata[];
231
- getCaches(): DevCacheMetadata[];
232
- getPages(): DevPageMetadata[];
233
- getProviders(): DevProviderMetadata[];
234
- getModules(): DevModuleMetadata[];
235
- getMetadata(): DevMetadata;
236
- protected getProviderName(provider?: "memory" | any): string;
237
- }
238
- //#endregion
239
- //#region src/index.d.ts
240
- /**
241
- * Developer tools module for monitoring and debugging Alepha applications.
242
- *
243
- * This module provides comprehensive data collection capabilities for tracking application behavior,
244
- * performance metrics, and debugging information in real-time.
245
- *
246
- * @see {@link DevToolsMetadataProvider}
247
- * @module alepha.devtools
248
- */
249
- declare const AlephaDevtools: _alepha_core0.Service<_alepha_core0.Module>;
250
- //#endregion
251
- export { AlephaDevtools, DevActionMetadata, DevBucketMetadata, DevCacheMetadata, DevMetadata, DevModuleMetadata, DevPageMetadata, DevProviderMetadata, DevQueueMetadata, DevRealmMetadata, DevSchedulerMetadata, DevToolsMetadataProvider, DevTopicMetadata, devActionMetadataSchema, devBucketMetadataSchema, devCacheMetadataSchema, devMetadataSchema, devModuleMetadataSchema, devPageMetadataSchema, devProviderMetadataSchema, devQueueMetadataSchema, devRealmMetadataSchema, devSchedulerMetadataSchema, devTopicMetadataSchema };
252
- //# sourceMappingURL=index.d.ts.map
package/devtools.js DELETED
@@ -1 +0,0 @@
1
- export * from '@alepha/devtools'
package/email.cjs DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/email');
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/email.d.ts DELETED
@@ -1,187 +0,0 @@
1
- import * as _alepha_core1 from "alepha";
2
- import { Descriptor, InstantiableClass, KIND } from "alepha";
3
- import * as _alepha_logger1 from "alepha/logger";
4
- import { Transporter } from "nodemailer";
5
-
6
- //#region src/providers/EmailProvider.d.ts
7
- /**
8
- * Email provider interface.
9
- *
10
- * All methods are asynchronous and return promises.
11
- */
12
- declare abstract class EmailProvider {
13
- /**
14
- * Send an email.
15
- *
16
- * @return Promise that resolves when the email is sent.
17
- */
18
- abstract send(options: EmailSendOptions): Promise<void>;
19
- }
20
- type EmailSendOptions = {
21
- to: string | string[];
22
- subject: string;
23
- body: string;
24
- };
25
- //#endregion
26
- //#region src/descriptors/$email.d.ts
27
- declare const $email: {
28
- (options?: EmailDescriptorOptions): EmailDescriptor;
29
- [KIND]: typeof EmailDescriptor;
30
- };
31
- interface EmailDescriptorOptions {
32
- name?: string;
33
- provider?: InstantiableClass<EmailProvider> | "memory";
34
- }
35
- /**
36
- * Email descriptor for sending emails through various providers.
37
- *
38
- * Usage:
39
- * ```typescript
40
- * class MyService {
41
- * private readonly welcomeEmail = $email({ name: "welcome" });
42
- *
43
- * async sendWelcome(userEmail: string, userName: string) {
44
- * await this.welcomeEmail.send({
45
- * to: userEmail,
46
- * subject: "Welcome!",
47
- * body: `<p>Hello ${userName}!</p>`
48
- * });
49
- * }
50
- * }
51
- * ```
52
- */
53
- declare class EmailDescriptor extends Descriptor<EmailDescriptorOptions> {
54
- protected readonly provider: EmailProvider;
55
- get name(): string;
56
- /**
57
- * Send an email using the configured provider.
58
- */
59
- send(options: EmailSendOptions): Promise<void>;
60
- protected $provider(): EmailProvider;
61
- }
62
- //#endregion
63
- //#region src/errors/EmailError.d.ts
64
- declare class EmailError extends Error {
65
- constructor(message: string, cause?: Error);
66
- }
67
- //#endregion
68
- //#region src/providers/LocalEmailProvider.d.ts
69
- interface LocalEmailProviderOptions {
70
- /**
71
- * Directory to save email files.
72
- * @default "node_modules/.email" (relative to project root)
73
- */
74
- directory?: string;
75
- }
76
- declare class LocalEmailProvider implements EmailProvider {
77
- protected readonly log: _alepha_logger1.Logger;
78
- protected readonly directory: string;
79
- constructor(options?: LocalEmailProviderOptions);
80
- send(options: EmailSendOptions): Promise<void>;
81
- createEmailHtml(options: {
82
- to: string;
83
- subject: string;
84
- body: string;
85
- }): string;
86
- escapeHtml(text: string): string;
87
- }
88
- //#endregion
89
- //#region src/providers/MemoryEmailProvider.d.ts
90
- interface EmailRecord {
91
- to: string;
92
- subject: string;
93
- body: string;
94
- sentAt: Date;
95
- }
96
- declare class MemoryEmailProvider implements EmailProvider {
97
- protected readonly log: _alepha_logger1.Logger;
98
- records: EmailRecord[];
99
- send(options: EmailSendOptions): Promise<void>;
100
- /**
101
- * Get the last email sent (for testing purposes).
102
- */
103
- get last(): EmailRecord | undefined;
104
- }
105
- //#endregion
106
- //#region src/providers/NodemailerEmailProvider.d.ts
107
- interface NodemailerEmailProviderOptions {
108
- /**
109
- * Custom transporter configuration.
110
- * If provided, will override environment variables.
111
- */
112
- transporter?: Transporter;
113
- /**
114
- * Custom from email address.
115
- * If not provided, will use EMAIL_FROM from environment.
116
- */
117
- from?: string;
118
- /**
119
- * Additional nodemailer options.
120
- */
121
- options?: {
122
- pool?: boolean;
123
- maxConnections?: number;
124
- maxMessages?: number;
125
- rateDelta?: number;
126
- rateLimit?: number;
127
- };
128
- }
129
- declare class NodemailerEmailProvider implements EmailProvider {
130
- protected readonly env: {
131
- EMAIL_HOST: string;
132
- EMAIL_PORT: number;
133
- EMAIL_USER: string;
134
- EMAIL_PASS: string;
135
- EMAIL_FROM: string;
136
- EMAIL_SECURE: boolean;
137
- };
138
- protected readonly log: _alepha_logger1.Logger;
139
- protected transporter: Transporter;
140
- protected fromAddress: string;
141
- readonly options: NodemailerEmailProviderOptions;
142
- constructor();
143
- send(options: EmailSendOptions): Promise<void>;
144
- protected createTransporter(): Transporter;
145
- /**
146
- * Verify the connection to the email server.
147
- */
148
- verify(): Promise<boolean>;
149
- /**
150
- * Close the transporter connection.
151
- */
152
- close(): void;
153
- protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
154
- protected readonly onStop: _alepha_core1.HookDescriptor<"stop">;
155
- }
156
- //#endregion
157
- //#region src/index.d.ts
158
- declare module "alepha" {
159
- interface Hooks {
160
- "email:sending": {
161
- to: string | string[];
162
- template: string;
163
- variables: Record<string, unknown>;
164
- provider: EmailProvider;
165
- abort(): void;
166
- };
167
- "email:sent": {
168
- to: string | string[];
169
- template: string;
170
- provider: EmailProvider;
171
- };
172
- }
173
- }
174
- /**
175
- * Provides email sending capabilities for Alepha applications with multiple provider backends.
176
- *
177
- * The email module enables declarative email sending through the `$email` descriptor, allowing you to send
178
- * emails through different providers: memory (for testing), local file system, or SMTP via Nodemailer.
179
- * It supports HTML email content and automatic provider selection based on environment configuration.
180
- *
181
- * @see {@link EmailProvider}
182
- * @module alepha.email
183
- */
184
- declare const AlephaEmail: _alepha_core1.Service<_alepha_core1.Module>;
185
- //#endregion
186
- export { $email, AlephaEmail, EmailDescriptor, EmailDescriptorOptions, EmailError, EmailProvider, EmailRecord, EmailSendOptions, LocalEmailProvider, LocalEmailProviderOptions, MemoryEmailProvider, NodemailerEmailProvider, NodemailerEmailProviderOptions };
187
- //# sourceMappingURL=index.d.ts.map
package/email.js DELETED
@@ -1 +0,0 @@
1
- export * from '@alepha/email'
package/fake.cjs DELETED
@@ -1,8 +0,0 @@
1
- 'use strict';
2
- var m = require('@alepha/fake');
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
- });