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/react.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/react'
|
package/redis.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/redis');
|
|
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/redis.d.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as _alepha_core3 from "alepha";
|
|
2
|
-
import { Alepha, Static } from "alepha";
|
|
3
|
-
import * as _alepha_logger0 from "alepha/logger";
|
|
4
|
-
import { RedisClientType, SetOptions, createClient } from "@redis/client";
|
|
5
|
-
|
|
6
|
-
//#region src/providers/RedisProvider.d.ts
|
|
7
|
-
declare const envSchema: _alepha_core3.TObject<{
|
|
8
|
-
REDIS_PORT: _alepha_core3.TInteger;
|
|
9
|
-
REDIS_HOST: _alepha_core3.TString;
|
|
10
|
-
REDIS_PASSWORD: _alepha_core3.TOptional<_alepha_core3.TString>;
|
|
11
|
-
}>;
|
|
12
|
-
declare module "alepha" {
|
|
13
|
-
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
14
|
-
}
|
|
15
|
-
type RedisClient = RedisClientType<{}, {}, {}, 3, {
|
|
16
|
-
36: BufferConstructor;
|
|
17
|
-
}>;
|
|
18
|
-
type RedisClientOptions = Parameters<typeof createClient>[0];
|
|
19
|
-
type RedisSetOptions = SetOptions;
|
|
20
|
-
/**
|
|
21
|
-
* Redis client provider.
|
|
22
|
-
*/
|
|
23
|
-
declare class RedisProvider {
|
|
24
|
-
protected readonly log: _alepha_logger0.Logger;
|
|
25
|
-
protected readonly alepha: Alepha;
|
|
26
|
-
protected readonly env: {
|
|
27
|
-
REDIS_PASSWORD?: string | undefined;
|
|
28
|
-
REDIS_PORT: number;
|
|
29
|
-
REDIS_HOST: string;
|
|
30
|
-
};
|
|
31
|
-
protected readonly client: RedisClient;
|
|
32
|
-
get publisher(): RedisClient;
|
|
33
|
-
protected readonly start: _alepha_core3.HookDescriptor<"start">;
|
|
34
|
-
protected readonly stop: _alepha_core3.HookDescriptor<"stop">;
|
|
35
|
-
/**
|
|
36
|
-
* Connect to the Redis server.
|
|
37
|
-
*/
|
|
38
|
-
connect(): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* Close the connection to the Redis server.
|
|
41
|
-
*/
|
|
42
|
-
close(): Promise<void>;
|
|
43
|
-
duplicate(options?: Partial<RedisClientOptions>): RedisClient;
|
|
44
|
-
get(key: string): Promise<Buffer | undefined>;
|
|
45
|
-
set(key: string, value: Buffer | string, options?: RedisSetOptions): Promise<Buffer>;
|
|
46
|
-
has(key: string): Promise<boolean>;
|
|
47
|
-
keys(pattern: string): Promise<string[]>;
|
|
48
|
-
del(keys: string[]): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Redis subscriber client factory method.
|
|
51
|
-
*/
|
|
52
|
-
protected createClient(): RedisClient;
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/providers/RedisSubscriberProvider.d.ts
|
|
56
|
-
declare class RedisSubscriberProvider {
|
|
57
|
-
protected readonly log: _alepha_logger0.Logger;
|
|
58
|
-
protected readonly alepha: Alepha;
|
|
59
|
-
protected readonly redisProvider: RedisProvider;
|
|
60
|
-
protected readonly client: RedisClient;
|
|
61
|
-
get subscriber(): RedisClient;
|
|
62
|
-
protected readonly start: _alepha_core3.HookDescriptor<"start">;
|
|
63
|
-
protected readonly stop: _alepha_core3.HookDescriptor<"stop">;
|
|
64
|
-
connect(): Promise<void>;
|
|
65
|
-
close(): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Redis subscriber client factory method.
|
|
68
|
-
*/
|
|
69
|
-
protected createClient(): RedisClient;
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/index.d.ts
|
|
73
|
-
/**
|
|
74
|
-
* Redis client provider for Alepha applications.
|
|
75
|
-
*
|
|
76
|
-
* @see {@link RedisProvider}
|
|
77
|
-
* @module alepha.redis
|
|
78
|
-
*/
|
|
79
|
-
declare const AlephaRedis: _alepha_core3.Service<_alepha_core3.Module>;
|
|
80
|
-
//#endregion
|
|
81
|
-
export { AlephaRedis, RedisClient, RedisClientOptions, RedisProvider, RedisSetOptions, RedisSubscriberProvider };
|
|
82
|
-
//# sourceMappingURL=index.d.ts.map
|
package/redis.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/redis'
|
package/retry.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/retry');
|
|
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/retry.d.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { AlephaError, Descriptor, DescriptorArgs, KIND } from "alepha";
|
|
2
|
-
import { DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
3
|
-
import * as _alepha_logger0 from "alepha/logger";
|
|
4
|
-
|
|
5
|
-
//#region src/providers/RetryProvider.d.ts
|
|
6
|
-
interface RetryOptions<T extends (...args: any[]) => any> {
|
|
7
|
-
/**
|
|
8
|
-
* The function to retry.
|
|
9
|
-
*/
|
|
10
|
-
handler: T;
|
|
11
|
-
/**
|
|
12
|
-
* The maximum number of attempts.
|
|
13
|
-
*
|
|
14
|
-
* @default 3
|
|
15
|
-
*/
|
|
16
|
-
max?: number;
|
|
17
|
-
/**
|
|
18
|
-
* The backoff strategy for delays between retries.
|
|
19
|
-
* Can be a fixed number (in ms) or a configuration object for exponential backoff.
|
|
20
|
-
*
|
|
21
|
-
* @default { initial: 200, factor: 2, jitter: true }
|
|
22
|
-
*/
|
|
23
|
-
backoff?: number | RetryBackoffOptions;
|
|
24
|
-
/**
|
|
25
|
-
* An overall time limit for all retry attempts combined.
|
|
26
|
-
*
|
|
27
|
-
* e.g., `[5, 'seconds']`
|
|
28
|
-
*/
|
|
29
|
-
maxDuration?: DurationLike;
|
|
30
|
-
/**
|
|
31
|
-
* A function that determines if a retry should be attempted based on the error.
|
|
32
|
-
*
|
|
33
|
-
* @default (error) => true (retries on any error)
|
|
34
|
-
*/
|
|
35
|
-
when?: (error: Error) => boolean;
|
|
36
|
-
/**
|
|
37
|
-
* A custom callback for when a retry attempt fails.
|
|
38
|
-
* This is called before the delay.
|
|
39
|
-
*/
|
|
40
|
-
onError?: (error: Error, attempt: number, ...args: Parameters<T>) => void;
|
|
41
|
-
/**
|
|
42
|
-
* An AbortSignal to allow for external cancellation of the retry loop.
|
|
43
|
-
*/
|
|
44
|
-
signal?: AbortSignal;
|
|
45
|
-
/**
|
|
46
|
-
* An additional AbortSignal to combine with the provided signal.
|
|
47
|
-
* Used internally by $retry to handle app lifecycle.
|
|
48
|
-
*/
|
|
49
|
-
additionalSignal?: AbortSignal;
|
|
50
|
-
}
|
|
51
|
-
interface RetryBackoffOptions {
|
|
52
|
-
/**
|
|
53
|
-
* Initial delay in milliseconds.
|
|
54
|
-
*
|
|
55
|
-
* @default 200
|
|
56
|
-
*/
|
|
57
|
-
initial?: number;
|
|
58
|
-
/**
|
|
59
|
-
* Multiplier for each subsequent delay.
|
|
60
|
-
*
|
|
61
|
-
* @default 2
|
|
62
|
-
*/
|
|
63
|
-
factor?: number;
|
|
64
|
-
/**
|
|
65
|
-
* Maximum delay in milliseconds.
|
|
66
|
-
*/
|
|
67
|
-
max?: number;
|
|
68
|
-
/**
|
|
69
|
-
* If true, adds a random jitter to the delay to prevent thundering herd.
|
|
70
|
-
*
|
|
71
|
-
* @default true
|
|
72
|
-
*/
|
|
73
|
-
jitter?: boolean;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Service for executing functions with automatic retry logic.
|
|
77
|
-
* Supports exponential backoff, max duration, conditional retries, and cancellation.
|
|
78
|
-
*/
|
|
79
|
-
declare class RetryProvider {
|
|
80
|
-
protected readonly log: _alepha_logger0.Logger;
|
|
81
|
-
protected readonly dateTime: DateTimeProvider;
|
|
82
|
-
/**
|
|
83
|
-
* Execute a function with automatic retry logic.
|
|
84
|
-
*/
|
|
85
|
-
retry<T extends (...args: any[]) => any>(options: RetryOptions<T>, ...args: Parameters<T>): Promise<ReturnType<T>>;
|
|
86
|
-
/**
|
|
87
|
-
* Calculate the backoff delay for a given attempt.
|
|
88
|
-
*/
|
|
89
|
-
protected calculateBackoff(attempt: number, options?: number | RetryBackoffOptions): number;
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/descriptors/$retry.d.ts
|
|
93
|
-
/**
|
|
94
|
-
* Creates a function that automatically retries a handler upon failure,
|
|
95
|
-
* with support for exponential backoff, max duration, and cancellation.
|
|
96
|
-
*/
|
|
97
|
-
declare const $retry: {
|
|
98
|
-
<T extends (...args: any[]) => any>(options: RetryDescriptorOptions<T>): RetryDescriptorFn<T>;
|
|
99
|
-
[KIND]: typeof RetryDescriptor;
|
|
100
|
-
};
|
|
101
|
-
interface RetryDescriptorOptions<T extends (...args: any[]) => any> {
|
|
102
|
-
/**
|
|
103
|
-
* The function to retry.
|
|
104
|
-
*/
|
|
105
|
-
handler: T;
|
|
106
|
-
/**
|
|
107
|
-
* The maximum number of attempts.
|
|
108
|
-
*
|
|
109
|
-
* @default 3
|
|
110
|
-
*/
|
|
111
|
-
max?: number;
|
|
112
|
-
/**
|
|
113
|
-
* The backoff strategy for delays between retries.
|
|
114
|
-
* Can be a fixed number (in ms) or a configuration object for exponential backoff.
|
|
115
|
-
*
|
|
116
|
-
* @default { initial: 200, factor: 2, jitter: true }
|
|
117
|
-
*/
|
|
118
|
-
backoff?: number | RetryBackoffOptions;
|
|
119
|
-
/**
|
|
120
|
-
* An overall time limit for all retry attempts combined.
|
|
121
|
-
*
|
|
122
|
-
* e.g., `[5, 'seconds']`
|
|
123
|
-
*/
|
|
124
|
-
maxDuration?: DurationLike;
|
|
125
|
-
/**
|
|
126
|
-
* A function that determines if a retry should be attempted based on the error.
|
|
127
|
-
*
|
|
128
|
-
* @default (error) => true (retries on any error)
|
|
129
|
-
*/
|
|
130
|
-
when?: (error: Error) => boolean;
|
|
131
|
-
/**
|
|
132
|
-
* A custom callback for when a retry attempt fails.
|
|
133
|
-
* This is called before the delay.
|
|
134
|
-
*/
|
|
135
|
-
onError?: (error: Error, attempt: number, ...args: Parameters<T>) => void;
|
|
136
|
-
/**
|
|
137
|
-
* An AbortSignal to allow for external cancellation of the retry loop.
|
|
138
|
-
*/
|
|
139
|
-
signal?: AbortSignal;
|
|
140
|
-
}
|
|
141
|
-
declare class RetryDescriptor<T extends (...args: any[]) => any> extends Descriptor<RetryDescriptorOptions<T>> {
|
|
142
|
-
protected readonly retryProvider: RetryProvider;
|
|
143
|
-
protected appAbortController: AbortController;
|
|
144
|
-
constructor(args: DescriptorArgs<RetryDescriptorOptions<T>>);
|
|
145
|
-
run(...args: Parameters<T>): Promise<ReturnType<T>>;
|
|
146
|
-
}
|
|
147
|
-
interface RetryDescriptorFn<T extends (...args: any[]) => any> extends RetryDescriptor<T> {
|
|
148
|
-
(...args: Parameters<T>): Promise<ReturnType<T>>;
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/errors/RetryCancelError.d.ts
|
|
152
|
-
declare class RetryCancelError extends AlephaError {
|
|
153
|
-
constructor();
|
|
154
|
-
}
|
|
155
|
-
//#endregion
|
|
156
|
-
//#region src/errors/RetryTimeoutError.d.ts
|
|
157
|
-
declare class RetryTimeoutError extends AlephaError {
|
|
158
|
-
constructor(duration: number);
|
|
159
|
-
}
|
|
160
|
-
//#endregion
|
|
161
|
-
export { $retry, RetryBackoffOptions, RetryCancelError, RetryDescriptor, RetryDescriptorFn, RetryDescriptorOptions, RetryOptions, RetryProvider, RetryTimeoutError };
|
|
162
|
-
//# sourceMappingURL=index.d.ts.map
|
package/retry.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/retry'
|
package/router.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/router');
|
|
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/router.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//#region src/providers/RouterProvider.d.ts
|
|
2
|
-
declare abstract class RouterProvider<T extends Route = Route> {
|
|
3
|
-
protected routePathRegex: RegExp;
|
|
4
|
-
protected tree: Tree<T>;
|
|
5
|
-
match(path: string): RouteMatch<T>;
|
|
6
|
-
protected test(path: string): void;
|
|
7
|
-
protected push(route: T): void;
|
|
8
|
-
protected createRouteMatch(path: string): RouteMatch<T>;
|
|
9
|
-
protected mapParams(match: RouteMatch<T>): RouteMatch<T>;
|
|
10
|
-
protected createParts(path: string): string[];
|
|
11
|
-
}
|
|
12
|
-
interface RouteMatch<T extends Route> {
|
|
13
|
-
route?: T;
|
|
14
|
-
params?: Record<string, string>;
|
|
15
|
-
}
|
|
16
|
-
interface Route {
|
|
17
|
-
path: string;
|
|
18
|
-
/**
|
|
19
|
-
* Rename a param in the route.
|
|
20
|
-
* This is automatically filled when you have scenarios like:
|
|
21
|
-
* `/customers/:id` and `/customers/:userId/payments`
|
|
22
|
-
*
|
|
23
|
-
* In this case, `:id` will be renamed to `:userId` in the second route.
|
|
24
|
-
*/
|
|
25
|
-
mapParams?: Record<string, string>;
|
|
26
|
-
}
|
|
27
|
-
interface Tree<T extends Route> {
|
|
28
|
-
route?: T;
|
|
29
|
-
children: {
|
|
30
|
-
[key: string]: Tree<T>;
|
|
31
|
-
};
|
|
32
|
-
param?: {
|
|
33
|
-
route?: T;
|
|
34
|
-
name: string;
|
|
35
|
-
children: {
|
|
36
|
-
[key: string]: Tree<T>;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
wildcard?: {
|
|
40
|
-
route: T;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
export { Route, RouteMatch, RouterProvider, Tree };
|
|
45
|
-
//# sourceMappingURL=index.d.ts.map
|
package/router.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/router'
|
package/scheduler.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/scheduler');
|
|
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/scheduler.d.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import * as _alepha_core1 from "alepha";
|
|
2
|
-
import { Alepha, Async, Descriptor, KIND, Static } from "alepha";
|
|
3
|
-
import * as _alepha_lock0 from "alepha/lock";
|
|
4
|
-
import { DateTime, DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
5
|
-
import * as _alepha_logger0 from "alepha/logger";
|
|
6
|
-
import * as dayjs0 from "dayjs";
|
|
7
|
-
import { Cron } from "cron-schedule";
|
|
8
|
-
|
|
9
|
-
//#region src/constants/CRON.d.ts
|
|
10
|
-
declare const CRON: {
|
|
11
|
-
EVERY_MINUTE: string;
|
|
12
|
-
EVERY_5_MINUTES: string;
|
|
13
|
-
EVERY_15_MINUTES: string;
|
|
14
|
-
EVERY_30_MINUTES: string;
|
|
15
|
-
EVERY_HOUR: string;
|
|
16
|
-
EVERY_DAY_AT_MIDNIGHT: string;
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/providers/CronProvider.d.ts
|
|
20
|
-
declare class CronProvider {
|
|
21
|
-
protected readonly dt: DateTimeProvider;
|
|
22
|
-
protected readonly alepha: Alepha;
|
|
23
|
-
protected readonly log: _alepha_logger0.Logger;
|
|
24
|
-
protected readonly cronJobs: Array<CronJob>;
|
|
25
|
-
getCronJobs(): Array<CronJob>;
|
|
26
|
-
protected readonly start: _alepha_core1.HookDescriptor<"start">;
|
|
27
|
-
protected readonly stop: _alepha_core1.HookDescriptor<"stop">;
|
|
28
|
-
protected boot(name: string | CronJob): void;
|
|
29
|
-
abort(name: string | CronJob): void;
|
|
30
|
-
/**
|
|
31
|
-
* Registers a cron job.
|
|
32
|
-
*
|
|
33
|
-
* It's automatically done when using the `$scheduler` descriptor but can also be used manually.
|
|
34
|
-
*/
|
|
35
|
-
createCronJob(name: string, expression: string, handler: (context: {
|
|
36
|
-
now: DateTime;
|
|
37
|
-
}) => Promise<void>, start?: boolean): void;
|
|
38
|
-
protected run(task: CronJob, now?: dayjs0.Dayjs): void;
|
|
39
|
-
}
|
|
40
|
-
interface CronJob {
|
|
41
|
-
name: string;
|
|
42
|
-
expression: string;
|
|
43
|
-
handler: (context: {
|
|
44
|
-
now: DateTime;
|
|
45
|
-
}) => Promise<void>;
|
|
46
|
-
cron: Cron;
|
|
47
|
-
loop: boolean;
|
|
48
|
-
running?: boolean;
|
|
49
|
-
onError?: (error: Error) => void;
|
|
50
|
-
abort: AbortController;
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/descriptors/$scheduler.d.ts
|
|
54
|
-
/**
|
|
55
|
-
* Scheduler descriptor.
|
|
56
|
-
*/
|
|
57
|
-
declare const $scheduler: {
|
|
58
|
-
(options: SchedulerDescriptorOptions): SchedulerDescriptor;
|
|
59
|
-
[KIND]: typeof SchedulerDescriptor;
|
|
60
|
-
};
|
|
61
|
-
type SchedulerDescriptorOptions = {
|
|
62
|
-
/**
|
|
63
|
-
* Function to run on schedule.
|
|
64
|
-
*/
|
|
65
|
-
handler: (args: SchedulerHandlerArguments) => Async<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Name of the scheduler. Defaults to the function name.
|
|
68
|
-
*/
|
|
69
|
-
name?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Optional description of the scheduler.
|
|
72
|
-
*/
|
|
73
|
-
description?: string;
|
|
74
|
-
/**
|
|
75
|
-
* Cron expression or interval to run the scheduler.
|
|
76
|
-
*/
|
|
77
|
-
cron?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Cron expression or interval to run the scheduler.
|
|
80
|
-
*/
|
|
81
|
-
interval?: DurationLike;
|
|
82
|
-
/**
|
|
83
|
-
* If true, the scheduler will be locked and only one instance will run at a time.
|
|
84
|
-
* You probably need to import {@link AlephaLockRedis} for distributed locking.
|
|
85
|
-
*
|
|
86
|
-
* @default true
|
|
87
|
-
*/
|
|
88
|
-
lock?: boolean;
|
|
89
|
-
};
|
|
90
|
-
declare const envSchema: _alepha_core1.TObject<{
|
|
91
|
-
SCHEDULER_PREFIX: _alepha_core1.TOptional<_alepha_core1.TString>;
|
|
92
|
-
}>;
|
|
93
|
-
declare module "alepha" {
|
|
94
|
-
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
95
|
-
}
|
|
96
|
-
declare class SchedulerDescriptor extends Descriptor<SchedulerDescriptorOptions> {
|
|
97
|
-
protected readonly log: _alepha_logger0.Logger;
|
|
98
|
-
protected readonly env: {
|
|
99
|
-
SCHEDULER_PREFIX?: string | undefined;
|
|
100
|
-
};
|
|
101
|
-
protected readonly alepha: Alepha;
|
|
102
|
-
protected readonly dateTimeProvider: DateTimeProvider;
|
|
103
|
-
protected readonly cronProvider: CronProvider;
|
|
104
|
-
get name(): string;
|
|
105
|
-
protected onInit(): void;
|
|
106
|
-
trigger(): Promise<void>;
|
|
107
|
-
protected schedulerLock: _alepha_lock0.LockDescriptor<(args: SchedulerHandlerArguments) => Promise<void>>;
|
|
108
|
-
}
|
|
109
|
-
interface SchedulerHandlerArguments {
|
|
110
|
-
now: DateTime;
|
|
111
|
-
}
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region src/index.d.ts
|
|
114
|
-
declare module "alepha" {
|
|
115
|
-
interface Hooks {
|
|
116
|
-
"scheduler:begin": {
|
|
117
|
-
name: string;
|
|
118
|
-
now: DateTime;
|
|
119
|
-
context: string;
|
|
120
|
-
};
|
|
121
|
-
"scheduler:success": {
|
|
122
|
-
name: string;
|
|
123
|
-
context: string;
|
|
124
|
-
};
|
|
125
|
-
"scheduler:error": {
|
|
126
|
-
name: string;
|
|
127
|
-
error: Error;
|
|
128
|
-
context: string;
|
|
129
|
-
};
|
|
130
|
-
"scheduler:end": {
|
|
131
|
-
name: string;
|
|
132
|
-
context: string;
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Generic interface for scheduling tasks.
|
|
138
|
-
*
|
|
139
|
-
* @see {@link $scheduler}
|
|
140
|
-
* @module alepha.scheduler
|
|
141
|
-
*/
|
|
142
|
-
declare const AlephaScheduler: _alepha_core1.Service<_alepha_core1.Module>;
|
|
143
|
-
//#endregion
|
|
144
|
-
export { $scheduler, AlephaScheduler, CRON, CronJob, CronProvider, SchedulerDescriptor, SchedulerDescriptorOptions, SchedulerHandlerArguments };
|
|
145
|
-
//# sourceMappingURL=index.d.ts.map
|
package/scheduler.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/scheduler'
|
package/security.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/security');
|
|
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
|
-
});
|