alepha 0.11.9 → 0.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -17
- package/dist/index.cjs +17089 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17088 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -365
- package/src/assets/biomeJson.ts +33 -0
- package/src/assets/tsconfigJson.ts +18 -0
- package/src/assets/viteConfigTs.ts +14 -0
- package/src/commands/BiomeCommands.ts +41 -0
- package/src/commands/CoreCommands.ts +169 -0
- package/src/commands/DrizzleCommands.ts +228 -0
- package/src/commands/VerifyCommands.ts +44 -0
- package/src/commands/ViteCommands.ts +119 -0
- package/src/index.ts +35 -0
- package/src/services/ProcessRunner.ts +89 -0
- package/src/services/ProjectUtils.ts +508 -0
- package/src/version.ts +7 -0
- package/api/files.cjs +0 -8
- package/api/files.d.ts +0 -438
- package/api/files.js +0 -1
- package/api/jobs.cjs +0 -8
- package/api/jobs.d.ts +0 -327
- package/api/jobs.js +0 -1
- package/api/notifications.cjs +0 -8
- package/api/notifications.d.ts +0 -263
- package/api/notifications.js +0 -1
- package/api/users.cjs +0 -8
- package/api/users.d.ts +0 -923
- package/api/users.js +0 -1
- package/api/verifications.cjs +0 -8
- package/api/verifications.d.ts +0 -1
- package/api/verifications.js +0 -1
- package/batch.cjs +0 -8
- package/batch.d.ts +0 -154
- package/batch.js +0 -1
- package/bucket.cjs +0 -8
- package/bucket.d.ts +0 -520
- package/bucket.js +0 -1
- package/cache/redis.cjs +0 -8
- package/cache/redis.d.ts +0 -40
- package/cache/redis.js +0 -1
- package/cache.cjs +0 -8
- package/cache.d.ts +0 -288
- package/cache.js +0 -1
- package/command.cjs +0 -8
- package/command.d.ts +0 -269
- package/command.js +0 -1
- package/core.cjs +0 -8
- package/core.d.ts +0 -1904
- package/core.js +0 -1
- package/datetime.cjs +0 -8
- package/datetime.d.ts +0 -144
- package/datetime.js +0 -1
- package/devtools.cjs +0 -8
- package/devtools.d.ts +0 -252
- package/devtools.js +0 -1
- package/email.cjs +0 -8
- package/email.d.ts +0 -187
- package/email.js +0 -1
- package/fake.cjs +0 -8
- package/fake.d.ts +0 -73
- package/fake.js +0 -1
- package/file.cjs +0 -8
- package/file.d.ts +0 -528
- package/file.js +0 -1
- package/lock/redis.cjs +0 -8
- package/lock/redis.d.ts +0 -24
- package/lock/redis.js +0 -1
- package/lock.cjs +0 -8
- package/lock.d.ts +0 -552
- package/lock.js +0 -1
- package/logger.cjs +0 -8
- package/logger.d.ts +0 -287
- package/logger.js +0 -1
- package/postgres.cjs +0 -8
- package/postgres.d.ts +0 -2143
- package/postgres.js +0 -1
- package/queue/redis.cjs +0 -8
- package/queue/redis.d.ts +0 -29
- package/queue/redis.js +0 -1
- package/queue.cjs +0 -8
- package/queue.d.ts +0 -760
- package/queue.js +0 -1
- package/react/auth.cjs +0 -8
- package/react/auth.d.ts +0 -504
- package/react/auth.js +0 -1
- package/react/form.cjs +0 -8
- package/react/form.d.ts +0 -211
- package/react/form.js +0 -1
- package/react/head.cjs +0 -8
- package/react/head.d.ts +0 -120
- package/react/head.js +0 -1
- package/react/i18n.cjs +0 -8
- package/react/i18n.d.ts +0 -168
- package/react/i18n.js +0 -1
- package/react.cjs +0 -8
- package/react.d.ts +0 -1263
- package/react.js +0 -1
- package/redis.cjs +0 -8
- package/redis.d.ts +0 -82
- package/redis.js +0 -1
- package/retry.cjs +0 -8
- package/retry.d.ts +0 -162
- package/retry.js +0 -1
- package/router.cjs +0 -8
- package/router.d.ts +0 -45
- package/router.js +0 -1
- package/scheduler.cjs +0 -8
- package/scheduler.d.ts +0 -145
- package/scheduler.js +0 -1
- package/security.cjs +0 -8
- package/security.d.ts +0 -586
- package/security.js +0 -1
- package/server/cache.cjs +0 -8
- package/server/cache.d.ts +0 -163
- package/server/cache.js +0 -1
- package/server/compress.cjs +0 -8
- package/server/compress.d.ts +0 -38
- package/server/compress.js +0 -1
- package/server/cookies.cjs +0 -8
- package/server/cookies.d.ts +0 -144
- package/server/cookies.js +0 -1
- package/server/cors.cjs +0 -8
- package/server/cors.d.ts +0 -45
- package/server/cors.js +0 -1
- package/server/health.cjs +0 -8
- package/server/health.d.ts +0 -58
- package/server/health.js +0 -1
- package/server/helmet.cjs +0 -8
- package/server/helmet.d.ts +0 -98
- package/server/helmet.js +0 -1
- package/server/links.cjs +0 -8
- package/server/links.d.ts +0 -322
- package/server/links.js +0 -1
- package/server/metrics.cjs +0 -8
- package/server/metrics.d.ts +0 -35
- package/server/metrics.js +0 -1
- package/server/multipart.cjs +0 -8
- package/server/multipart.d.ts +0 -42
- package/server/multipart.js +0 -1
- package/server/proxy.cjs +0 -8
- package/server/proxy.d.ts +0 -234
- package/server/proxy.js +0 -1
- package/server/security.cjs +0 -8
- package/server/security.d.ts +0 -92
- package/server/security.js +0 -1
- package/server/static.cjs +0 -8
- package/server/static.d.ts +0 -119
- package/server/static.js +0 -1
- package/server/swagger.cjs +0 -8
- package/server/swagger.d.ts +0 -161
- package/server/swagger.js +0 -1
- package/server.cjs +0 -8
- package/server.d.ts +0 -849
- package/server.js +0 -1
- package/topic/redis.cjs +0 -8
- package/topic/redis.d.ts +0 -42
- package/topic/redis.js +0 -1
- package/topic.cjs +0 -8
- package/topic.d.ts +0 -819
- package/topic.js +0 -1
- package/vite.cjs +0 -8
- package/vite.d.ts +0 -186
- package/vite.js +0 -1
package/api/users.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/api-users'
|
package/api/verifications.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/api-verifications');
|
|
3
|
-
Object.keys(m).forEach(function (k) {
|
|
4
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
|
-
enumerable: true,
|
|
6
|
-
get: function () { return m[k]; }
|
|
7
|
-
});
|
|
8
|
-
});
|
package/api/verifications.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/api-verifications';
|
package/api/verifications.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/api-verifications'
|
package/batch.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/batch');
|
|
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/batch.d.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import * as _alepha_core1 from "alepha";
|
|
2
|
-
import { Descriptor, KIND, Static, TSchema } from "alepha";
|
|
3
|
-
import { DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
4
|
-
import * as _alepha_logger0 from "alepha/logger";
|
|
5
|
-
import * as _alepha_retry0 from "alepha/retry";
|
|
6
|
-
import { RetryDescriptorOptions } from "alepha/retry";
|
|
7
|
-
import * as typebox0 from "typebox";
|
|
8
|
-
|
|
9
|
-
//#region src/descriptors/$batch.d.ts
|
|
10
|
-
/**
|
|
11
|
-
* Creates a batch processing descriptor for efficient grouping and processing of multiple operations.
|
|
12
|
-
*/
|
|
13
|
-
declare const $batch: {
|
|
14
|
-
<TItem extends TSchema, TResponse>(options: BatchDescriptorOptions<TItem, TResponse>): BatchDescriptor<TItem, TResponse>;
|
|
15
|
-
[KIND]: typeof BatchDescriptor;
|
|
16
|
-
};
|
|
17
|
-
interface BatchDescriptorOptions<TItem extends TSchema, TResponse = any> {
|
|
18
|
-
/**
|
|
19
|
-
* TypeBox schema for validating each item added to the batch.
|
|
20
|
-
*/
|
|
21
|
-
schema: TItem;
|
|
22
|
-
/**
|
|
23
|
-
* The batch processing handler function that processes arrays of validated items.
|
|
24
|
-
*/
|
|
25
|
-
handler: (items: Static<TItem>[]) => TResponse;
|
|
26
|
-
/**
|
|
27
|
-
* Maximum number of items to collect before automatically flushing the batch.
|
|
28
|
-
*/
|
|
29
|
-
maxSize?: number;
|
|
30
|
-
/**
|
|
31
|
-
* Maximum time to wait before flushing a batch, even if it hasn't reached maxSize.
|
|
32
|
-
*/
|
|
33
|
-
maxDuration?: DurationLike;
|
|
34
|
-
/**
|
|
35
|
-
* Function to determine partition keys for grouping items into separate batches.
|
|
36
|
-
*/
|
|
37
|
-
partitionBy?: (item: Static<TItem>) => string;
|
|
38
|
-
/**
|
|
39
|
-
* Maximum number of batch handlers that can execute simultaneously.
|
|
40
|
-
*/
|
|
41
|
-
concurrency?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Retry configuration for failed batch processing operations.
|
|
44
|
-
*/
|
|
45
|
-
retry?: Omit<RetryDescriptorOptions<() => Array<Static<TItem>>>, "handler">;
|
|
46
|
-
}
|
|
47
|
-
type BatchItemStatus = "pending" | "processing" | "completed" | "failed";
|
|
48
|
-
interface BatchItemState<TItem, TResponse> {
|
|
49
|
-
id: string;
|
|
50
|
-
item: TItem;
|
|
51
|
-
partitionKey: string;
|
|
52
|
-
status: BatchItemStatus;
|
|
53
|
-
result?: TResponse;
|
|
54
|
-
error?: Error;
|
|
55
|
-
promise?: Promise<TResponse>;
|
|
56
|
-
resolve?: (value: TResponse) => void;
|
|
57
|
-
reject?: (error: Error) => void;
|
|
58
|
-
}
|
|
59
|
-
interface PartitionState {
|
|
60
|
-
itemIds: string[];
|
|
61
|
-
timeout?: {
|
|
62
|
-
clear: () => void;
|
|
63
|
-
};
|
|
64
|
-
flushing: boolean;
|
|
65
|
-
}
|
|
66
|
-
declare class BatchDescriptor<TItem extends TSchema, TResponse = any> extends Descriptor<BatchDescriptorOptions<TItem, TResponse>> {
|
|
67
|
-
protected readonly log: _alepha_logger0.Logger;
|
|
68
|
-
protected readonly dateTime: DateTimeProvider;
|
|
69
|
-
protected readonly itemStates: Map<string, BatchItemState<typebox0.StaticType<[], "Decode", {}, {}, TItem>, TResponse>>;
|
|
70
|
-
protected readonly partitions: Map<string, PartitionState>;
|
|
71
|
-
protected activeHandlers: PromiseWithResolvers<void>[];
|
|
72
|
-
protected isShuttingDown: boolean;
|
|
73
|
-
protected get maxSize(): number;
|
|
74
|
-
protected get concurrency(): number;
|
|
75
|
-
protected get maxDuration(): DurationLike;
|
|
76
|
-
protected retry: _alepha_retry0.RetryDescriptorFn<(items: typebox0.StaticType<[], "Decode", {}, {}, TItem>[]) => TResponse>;
|
|
77
|
-
/**
|
|
78
|
-
* Pushes an item into the batch and returns immediately with a unique ID.
|
|
79
|
-
* The item will be processed asynchronously with other items when the batch is flushed.
|
|
80
|
-
* Use wait(id) to get the processing result.
|
|
81
|
-
*/
|
|
82
|
-
push(item: Static<TItem>): Promise<string>;
|
|
83
|
-
/**
|
|
84
|
-
* Wait for a specific item to be processed and get its result.
|
|
85
|
-
* @param id The item ID returned from push()
|
|
86
|
-
* @returns The processing result
|
|
87
|
-
* @throws If the item doesn't exist or processing failed
|
|
88
|
-
*/
|
|
89
|
-
wait(id: string): Promise<TResponse>;
|
|
90
|
-
/**
|
|
91
|
-
* Get the current status of an item.
|
|
92
|
-
* @param id The item ID returned from push()
|
|
93
|
-
* @returns Status information or undefined if item doesn't exist
|
|
94
|
-
*/
|
|
95
|
-
status(id: string): {
|
|
96
|
-
status: "pending" | "processing";
|
|
97
|
-
} | {
|
|
98
|
-
status: "completed";
|
|
99
|
-
result: TResponse;
|
|
100
|
-
} | {
|
|
101
|
-
status: "failed";
|
|
102
|
-
error: Error;
|
|
103
|
-
} | undefined;
|
|
104
|
-
flush(partitionKey?: string): Promise<void>;
|
|
105
|
-
protected flushPartition(partitionKey: string): Promise<void>;
|
|
106
|
-
protected readonly dispose: _alepha_core1.HookDescriptor<"stop">;
|
|
107
|
-
}
|
|
108
|
-
//#endregion
|
|
109
|
-
//#region src/index.d.ts
|
|
110
|
-
/**
|
|
111
|
-
* This module allows you to group multiple asynchronous operations into a single "batch," which is then processed together.
|
|
112
|
-
* This is an essential pattern for improving performance, reducing I/O, and interacting efficiently with rate-limited APIs or databases.
|
|
113
|
-
*
|
|
114
|
-
* ```ts
|
|
115
|
-
* import { Alepha, $hook, run, t } from "alepha";
|
|
116
|
-
* import { $batch } from "alepha/batch";
|
|
117
|
-
*
|
|
118
|
-
* class LoggingService {
|
|
119
|
-
* // define the batch processor
|
|
120
|
-
* logBatch = $batch({
|
|
121
|
-
* schema: t.text(),
|
|
122
|
-
* maxSize: 10,
|
|
123
|
-
* maxDuration: [5, "seconds"],
|
|
124
|
-
* handler: async (items) => {
|
|
125
|
-
* console.log(`[BATCH LOG] Processing ${items.length} events:`, items);
|
|
126
|
-
* },
|
|
127
|
-
* });
|
|
128
|
-
*
|
|
129
|
-
* // example of how to use it
|
|
130
|
-
* onReady = $hook({
|
|
131
|
-
* on: "ready",
|
|
132
|
-
* handler: async () => {
|
|
133
|
-
* // push() returns an ID immediately
|
|
134
|
-
* const id1 = await this.logBatch.push("Application started.");
|
|
135
|
-
* const id2 = await this.logBatch.push("User authenticated.");
|
|
136
|
-
*
|
|
137
|
-
* // optionally wait for processing to complete
|
|
138
|
-
* await this.logBatch.wait(id1);
|
|
139
|
-
*
|
|
140
|
-
* // or check the status
|
|
141
|
-
* const status = this.logBatch.status(id2);
|
|
142
|
-
* console.log(status?.status); // "pending" | "processing" | "completed" | "failed"
|
|
143
|
-
* },
|
|
144
|
-
* });
|
|
145
|
-
* }
|
|
146
|
-
* ```
|
|
147
|
-
*
|
|
148
|
-
* @see {@link $batch}
|
|
149
|
-
* @module alepha.batch
|
|
150
|
-
*/
|
|
151
|
-
declare const AlephaBatch: _alepha_core1.Service<_alepha_core1.Module>;
|
|
152
|
-
//#endregion
|
|
153
|
-
export { $batch, AlephaBatch, BatchDescriptor, BatchDescriptorOptions, BatchItemState, BatchItemStatus };
|
|
154
|
-
//# sourceMappingURL=index.d.ts.map
|
package/batch.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@alepha/batch'
|
package/bucket.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var m = require('@alepha/bucket');
|
|
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
|
-
});
|