alepha 0.10.3 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/api/files.cjs +8 -0
- package/api/files.d.ts +203 -0
- package/api/files.js +1 -0
- package/api/jobs.cjs +8 -0
- package/api/jobs.d.ts +276 -0
- package/api/jobs.js +1 -0
- package/api/users.cjs +8 -0
- package/api/users.d.ts +394 -0
- package/api/users.js +1 -0
- package/batch.d.ts +14 -14
- package/cache/redis.d.ts +1 -0
- package/cache.d.ts +5 -0
- package/command.d.ts +6 -6
- package/core.d.ts +58 -10
- package/datetime.d.ts +0 -2
- package/devtools.cjs +8 -0
- package/devtools.d.ts +368 -0
- package/devtools.js +1 -0
- package/email.d.ts +15 -15
- package/logger.d.ts +44 -29
- package/package.json +71 -43
- package/postgres.d.ts +104 -310
- package/queue.d.ts +21 -21
- package/react/form.d.ts +2 -2
- package/react.d.ts +29 -29
- package/scheduler.d.ts +22 -2
- package/security.d.ts +12 -4
- package/server/links.d.ts +35 -35
- package/server.d.ts +30 -30
- package/topic.d.ts +26 -161
package/core.d.ts
CHANGED
|
@@ -248,7 +248,7 @@ type AsyncFn = (...args: any[]) => Async<any>;
|
|
|
248
248
|
type MaybePromise<T> = T extends Promise<any> ? T : Promise<T>;
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/interfaces/LoggerInterface.d.ts
|
|
251
|
-
type LogLevel = "
|
|
251
|
+
type LogLevel = "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE" | "SILENT";
|
|
252
252
|
interface LoggerInterface {
|
|
253
253
|
trace(message: string, data?: unknown): void;
|
|
254
254
|
debug(message: string, data?: unknown): void;
|
|
@@ -431,7 +431,7 @@ declare class TypeGuard {
|
|
|
431
431
|
isBigInt: (value: TSchema$1) => value is TString$1;
|
|
432
432
|
isDate: (value: TSchema$1) => value is TString$1;
|
|
433
433
|
isDatetime: (value: TSchema$1) => value is TString$1;
|
|
434
|
-
|
|
434
|
+
isUUID: (value: TSchema$1) => value is TString$1;
|
|
435
435
|
}
|
|
436
436
|
declare module "typebox" {
|
|
437
437
|
interface TString {
|
|
@@ -500,22 +500,52 @@ declare class TypeProvider {
|
|
|
500
500
|
pick: typeof TypeBox.Pick;
|
|
501
501
|
tuple: typeof TypeBox.Tuple;
|
|
502
502
|
interface: typeof TypeBox.Interface;
|
|
503
|
+
/**
|
|
504
|
+
* Type guards to check the type of schema.
|
|
505
|
+
* This is not a runtime type check, but a compile-time type guard.
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* ```ts
|
|
509
|
+
* if (t.schema.isString(schema)) {
|
|
510
|
+
* // schema is TString
|
|
511
|
+
* }
|
|
512
|
+
* ```
|
|
513
|
+
*/
|
|
503
514
|
readonly schema: TypeGuard;
|
|
504
515
|
/**
|
|
505
516
|
* Create a schema for an object.
|
|
517
|
+
* By default, additional properties are not allowed.
|
|
518
|
+
*
|
|
519
|
+
* @example
|
|
520
|
+
* ```ts
|
|
521
|
+
* const userSchema = t.object({
|
|
522
|
+
* id: t.int(),
|
|
523
|
+
* name: t.string(),
|
|
524
|
+
* });
|
|
525
|
+
* ```
|
|
506
526
|
*/
|
|
507
527
|
object<T extends TProperties$1>(properties: T, options?: TObjectOptions$1): TObject$1<T>;
|
|
508
528
|
/**
|
|
509
529
|
* Create a schema for an array.
|
|
530
|
+
* By default, the maximum number of items is limited to prevent excessive memory usage.
|
|
510
531
|
*
|
|
511
|
-
* @
|
|
512
|
-
* @param options
|
|
532
|
+
* @see TypeProvider.DEFAULT_ARRAY_MAX_ITEMS
|
|
513
533
|
*/
|
|
514
534
|
array<T extends TSchema$1>(schema: T, options?: TArrayOptions): TArray$1<T>;
|
|
515
535
|
/**
|
|
516
536
|
* Create a schema for a string.
|
|
537
|
+
* For db or input fields, consider using `t.text()` instead, which has length limits.
|
|
538
|
+
*
|
|
539
|
+
* If you need a string with specific format (e.g. email, uuid, date), consider using the corresponding method (e.g. `t.email()`, `t.uuid()`, `t.date()`).
|
|
540
|
+
*/
|
|
541
|
+
string(options?: TStringOptions$1): TString$1;
|
|
542
|
+
/**
|
|
543
|
+
* Create a schema for a string with length limits.
|
|
544
|
+
* For internal strings without length limits, consider using `t.string()` instead.
|
|
545
|
+
*
|
|
546
|
+
* Default size is "regular", which has a max length of 255 characters.
|
|
517
547
|
*/
|
|
518
|
-
|
|
548
|
+
text(options?: TTextOptions): TString$1;
|
|
519
549
|
/**
|
|
520
550
|
* Create a schema for a JSON object.
|
|
521
551
|
* This is a record with string keys and any values.
|
|
@@ -615,9 +645,27 @@ declare class TypeProvider {
|
|
|
615
645
|
description: TypeBox.TOptional<TString$1>;
|
|
616
646
|
}>;
|
|
617
647
|
}
|
|
618
|
-
type TextLength = "short" | "long" | "rich";
|
|
619
|
-
interface
|
|
648
|
+
type TextLength = "short" | "regular" | "long" | "rich";
|
|
649
|
+
interface TTextOptions extends TStringOptions$1 {
|
|
650
|
+
/**
|
|
651
|
+
* Predefined size of the text.
|
|
652
|
+
*
|
|
653
|
+
* - `short` - short text, such as names or titles. Default max length is 64 characters.
|
|
654
|
+
* - `regular` - regular text, such as single-line input. Default max length is 255 characters.
|
|
655
|
+
* - `long` - long text, such as descriptions or comments. Default max length is 1024 characters.
|
|
656
|
+
* - `rich` - rich text, such as HTML or Markdown. Default max length is 65535 characters.
|
|
657
|
+
*
|
|
658
|
+
* You can override the default max length by specifying `maxLength` in the options.
|
|
659
|
+
*
|
|
660
|
+
* @default "regular"
|
|
661
|
+
*/
|
|
620
662
|
size?: TextLength;
|
|
663
|
+
/**
|
|
664
|
+
* Trim whitespace from both ends of the string.
|
|
665
|
+
*
|
|
666
|
+
* @default true
|
|
667
|
+
*/
|
|
668
|
+
trim?: boolean;
|
|
621
669
|
}
|
|
622
670
|
declare const t: TypeProvider;
|
|
623
671
|
//#endregion
|
|
@@ -683,7 +731,7 @@ declare const t: TypeProvider;
|
|
|
683
731
|
* class App {
|
|
684
732
|
* env = $env(
|
|
685
733
|
* t.object({
|
|
686
|
-
* MY_VAR: t.
|
|
734
|
+
* MY_VAR: t.text(),
|
|
687
735
|
* })
|
|
688
736
|
* );
|
|
689
737
|
* }
|
|
@@ -1263,7 +1311,7 @@ interface CursorDescriptor {
|
|
|
1263
1311
|
*
|
|
1264
1312
|
* // program expect a var env "HELLO" as string to works
|
|
1265
1313
|
* env = $env(t.object({
|
|
1266
|
-
* HELLO: t.
|
|
1314
|
+
* HELLO: t.text()
|
|
1267
1315
|
* }));
|
|
1268
1316
|
*
|
|
1269
1317
|
* sayHello = () => this.log.info("Hello ${this.env.HELLO}")
|
|
@@ -1399,5 +1447,5 @@ declare global {
|
|
|
1399
1447
|
*/
|
|
1400
1448
|
declare const run: (entry: Alepha | Service | Array<Service>, opts?: RunOptions) => void;
|
|
1401
1449
|
//#endregion
|
|
1402
|
-
export { $cursor, $env, $hook, $inject, $module, AbstractClass, Alepha, AlephaError,
|
|
1450
|
+
export { $cursor, $env, $hook, $inject, $module, AbstractClass, Alepha, AlephaError, AlsProvider, AppNotStartedError, Async, AsyncFn, AsyncLocalStorageData, CircularDependencyError, ContainerLockedError, CursorDescriptor, Descriptor, DescriptorArgs, DescriptorConfig, DescriptorFactory, DescriptorFactoryLike, Env, FileLike, Hook, HookDescriptor, HookOptions, Hooks, InjectDescriptor, InjectOptions, InstantiableClass, KIND, LogLevel, LoggerInterface, MaybePromise, Module, ModuleDescriptorOptions, OPTIONS, Service, ServiceEntry, ServiceSubstitution, State, StateManager, type Static, type StaticDecode, type StaticEncode, StreamLike, type TAny, type TArray, type TBigInt, type TBoolean, TFile, type TInteger, type TKeysToIndexer, type TNull, type TNumber, type TNumberOptions, type TObject, type TObjectOptions, type TOptional, type TOptionalAdd, type TPick, type TProperties, type TRecord, type TSchema, TStream, type TString, type TStringOptions, TTextOptions, type TTuple, type TUnion, type TVoid, TextLength, TooLateSubstitutionError, TypeBox, TypeBoxError, TypeBoxFormat, TypeBoxValue, TypeGuard, TypeProvider, WithModule, __alephaRef, createDescriptor, isDate, isDateTime, isEmail, isFileLike, isTypeFile, isURL, isUUID, run, t };
|
|
1403
1451
|
//# sourceMappingURL=index.d.ts.map
|
package/datetime.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as _alepha_core1 from "alepha";
|
|
|
2
2
|
import { Alepha, Descriptor, KIND } from "alepha";
|
|
3
3
|
import "dayjs/plugin/relativeTime.js";
|
|
4
4
|
import dayjsDuration from "dayjs/plugin/duration.js";
|
|
5
|
-
import * as _alepha_logger0 from "alepha/logger";
|
|
6
5
|
import dayjs, { Dayjs, ManipulateType } from "dayjs";
|
|
7
6
|
|
|
8
7
|
//#region src/providers/DateTimeProvider.d.ts
|
|
@@ -12,7 +11,6 @@ type Duration = dayjsDuration.Duration;
|
|
|
12
11
|
type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
|
|
13
12
|
declare class DateTimeProvider {
|
|
14
13
|
protected alepha: Alepha;
|
|
15
|
-
protected log: _alepha_logger0.Logger;
|
|
16
14
|
protected ref: DateTime | null;
|
|
17
15
|
protected readonly timeouts: Timeout[];
|
|
18
16
|
protected readonly intervals: Interval[];
|
package/devtools.cjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import * as _alepha_core1 from "alepha";
|
|
2
|
+
import { Alepha, Static } from "alepha";
|
|
3
|
+
import * as _alepha_server0 from "alepha/server";
|
|
4
|
+
import * as typebox0 from "typebox";
|
|
5
|
+
import { LogEntry } from "alepha/logger";
|
|
6
|
+
|
|
7
|
+
//#region src/schemas/DevActionMetadata.d.ts
|
|
8
|
+
declare const devActionMetadataSchema: typebox0.TObject<{
|
|
9
|
+
name: typebox0.TString;
|
|
10
|
+
group: typebox0.TString;
|
|
11
|
+
method: typebox0.TString;
|
|
12
|
+
path: typebox0.TString;
|
|
13
|
+
prefix: typebox0.TString;
|
|
14
|
+
fullPath: typebox0.TString;
|
|
15
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
16
|
+
summary: typebox0.TOptional<typebox0.TString>;
|
|
17
|
+
disabled: typebox0.TOptional<typebox0.TBoolean>;
|
|
18
|
+
secure: typebox0.TOptional<typebox0.TBoolean>;
|
|
19
|
+
hide: typebox0.TOptional<typebox0.TBoolean>;
|
|
20
|
+
body: typebox0.TOptional<typebox0.TAny>;
|
|
21
|
+
params: typebox0.TOptional<typebox0.TAny>;
|
|
22
|
+
query: typebox0.TOptional<typebox0.TAny>;
|
|
23
|
+
response: typebox0.TOptional<typebox0.TAny>;
|
|
24
|
+
bodyContentType: typebox0.TOptional<typebox0.TString>;
|
|
25
|
+
}>;
|
|
26
|
+
type DevActionMetadata = Static<typeof devActionMetadataSchema>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/schemas/DevBucketMetadata.d.ts
|
|
29
|
+
declare const devBucketMetadataSchema: typebox0.TObject<{
|
|
30
|
+
name: typebox0.TString;
|
|
31
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
32
|
+
mimeTypes: typebox0.TOptional<typebox0.TArray<typebox0.TString>>;
|
|
33
|
+
maxSize: typebox0.TOptional<typebox0.TNumber>;
|
|
34
|
+
provider: typebox0.TString;
|
|
35
|
+
}>;
|
|
36
|
+
type DevBucketMetadata = Static<typeof devBucketMetadataSchema>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/schemas/DevCacheMetadata.d.ts
|
|
39
|
+
declare const devCacheMetadataSchema: typebox0.TObject<{
|
|
40
|
+
name: typebox0.TString;
|
|
41
|
+
ttl: typebox0.TOptional<typebox0.TAny>;
|
|
42
|
+
disabled: typebox0.TOptional<typebox0.TBoolean>;
|
|
43
|
+
provider: typebox0.TString;
|
|
44
|
+
}>;
|
|
45
|
+
type DevCacheMetadata = Static<typeof devCacheMetadataSchema>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/schemas/DevLogEntry.d.ts
|
|
48
|
+
declare const devLogEntrySchema: typebox0.TObject<{
|
|
49
|
+
formatted: typebox0.TString;
|
|
50
|
+
entry: typebox0.TAny;
|
|
51
|
+
}>;
|
|
52
|
+
type DevLogEntry = Static<typeof devLogEntrySchema> & {
|
|
53
|
+
entry: LogEntry;
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/schemas/DevMetadata.d.ts
|
|
57
|
+
declare const devMetadataSchema: typebox0.TObject<{
|
|
58
|
+
actions: typebox0.TArray<typebox0.TObject<{
|
|
59
|
+
name: typebox0.TString;
|
|
60
|
+
group: typebox0.TString;
|
|
61
|
+
method: typebox0.TString;
|
|
62
|
+
path: typebox0.TString;
|
|
63
|
+
prefix: typebox0.TString;
|
|
64
|
+
fullPath: typebox0.TString;
|
|
65
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
66
|
+
summary: typebox0.TOptional<typebox0.TString>;
|
|
67
|
+
disabled: typebox0.TOptional<typebox0.TBoolean>;
|
|
68
|
+
secure: typebox0.TOptional<typebox0.TBoolean>;
|
|
69
|
+
hide: typebox0.TOptional<typebox0.TBoolean>;
|
|
70
|
+
body: typebox0.TOptional<typebox0.TAny>;
|
|
71
|
+
params: typebox0.TOptional<typebox0.TAny>;
|
|
72
|
+
query: typebox0.TOptional<typebox0.TAny>;
|
|
73
|
+
response: typebox0.TOptional<typebox0.TAny>;
|
|
74
|
+
bodyContentType: typebox0.TOptional<typebox0.TString>;
|
|
75
|
+
}>>;
|
|
76
|
+
queues: typebox0.TArray<typebox0.TObject<{
|
|
77
|
+
name: typebox0.TString;
|
|
78
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
79
|
+
schema: typebox0.TOptional<typebox0.TAny>;
|
|
80
|
+
provider: typebox0.TString;
|
|
81
|
+
}>>;
|
|
82
|
+
schedulers: typebox0.TArray<typebox0.TObject<{
|
|
83
|
+
name: typebox0.TString;
|
|
84
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
85
|
+
cron: typebox0.TOptional<typebox0.TString>;
|
|
86
|
+
interval: typebox0.TOptional<typebox0.TAny>;
|
|
87
|
+
lock: typebox0.TOptional<typebox0.TBoolean>;
|
|
88
|
+
}>>;
|
|
89
|
+
topics: typebox0.TArray<typebox0.TObject<{
|
|
90
|
+
name: typebox0.TString;
|
|
91
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
92
|
+
schema: typebox0.TOptional<typebox0.TAny>;
|
|
93
|
+
provider: typebox0.TString;
|
|
94
|
+
}>>;
|
|
95
|
+
buckets: typebox0.TArray<typebox0.TObject<{
|
|
96
|
+
name: typebox0.TString;
|
|
97
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
98
|
+
mimeTypes: typebox0.TOptional<typebox0.TArray<typebox0.TString>>;
|
|
99
|
+
maxSize: typebox0.TOptional<typebox0.TNumber>;
|
|
100
|
+
provider: typebox0.TString;
|
|
101
|
+
}>>;
|
|
102
|
+
realms: typebox0.TArray<typebox0.TObject<{
|
|
103
|
+
name: typebox0.TString;
|
|
104
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
105
|
+
roles: typebox0.TOptional<typebox0.TArray<typebox0.TAny>>;
|
|
106
|
+
type: typebox0.TUnsafe<"internal" | "external">;
|
|
107
|
+
settings: typebox0.TOptional<typebox0.TObject<{
|
|
108
|
+
accessTokenExpiration: typebox0.TOptional<typebox0.TAny>;
|
|
109
|
+
refreshTokenExpiration: typebox0.TOptional<typebox0.TAny>;
|
|
110
|
+
hasOnCreateSession: typebox0.TBoolean;
|
|
111
|
+
hasOnRefreshSession: typebox0.TBoolean;
|
|
112
|
+
hasOnDeleteSession: typebox0.TBoolean;
|
|
113
|
+
}>>;
|
|
114
|
+
}>>;
|
|
115
|
+
caches: typebox0.TArray<typebox0.TObject<{
|
|
116
|
+
name: typebox0.TString;
|
|
117
|
+
ttl: typebox0.TOptional<typebox0.TAny>;
|
|
118
|
+
disabled: typebox0.TOptional<typebox0.TBoolean>;
|
|
119
|
+
provider: typebox0.TString;
|
|
120
|
+
}>>;
|
|
121
|
+
pages: typebox0.TArray<typebox0.TObject<{
|
|
122
|
+
name: typebox0.TString;
|
|
123
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
124
|
+
path: typebox0.TOptional<typebox0.TString>;
|
|
125
|
+
params: typebox0.TOptional<typebox0.TAny>;
|
|
126
|
+
query: typebox0.TOptional<typebox0.TAny>;
|
|
127
|
+
hasComponent: typebox0.TBoolean;
|
|
128
|
+
hasLazy: typebox0.TBoolean;
|
|
129
|
+
hasResolve: typebox0.TBoolean;
|
|
130
|
+
hasChildren: typebox0.TBoolean;
|
|
131
|
+
hasParent: typebox0.TBoolean;
|
|
132
|
+
hasErrorHandler: typebox0.TBoolean;
|
|
133
|
+
static: typebox0.TOptional<typebox0.TBoolean>;
|
|
134
|
+
cache: typebox0.TOptional<typebox0.TAny>;
|
|
135
|
+
client: typebox0.TOptional<typebox0.TAny>;
|
|
136
|
+
animation: typebox0.TOptional<typebox0.TAny>;
|
|
137
|
+
}>>;
|
|
138
|
+
providers: typebox0.TArray<typebox0.TObject<{
|
|
139
|
+
name: typebox0.TString;
|
|
140
|
+
module: typebox0.TOptional<typebox0.TString>;
|
|
141
|
+
dependencies: typebox0.TArray<typebox0.TString>;
|
|
142
|
+
aliases: typebox0.TOptional<typebox0.TArray<typebox0.TString>>;
|
|
143
|
+
}>>;
|
|
144
|
+
modules: typebox0.TArray<typebox0.TObject<{
|
|
145
|
+
name: typebox0.TString;
|
|
146
|
+
providers: typebox0.TArray<typebox0.TString>;
|
|
147
|
+
}>>;
|
|
148
|
+
}>;
|
|
149
|
+
type DevMetadata = Static<typeof devMetadataSchema>;
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/schemas/DevModuleMetadata.d.ts
|
|
152
|
+
declare const devModuleMetadataSchema: typebox0.TObject<{
|
|
153
|
+
name: typebox0.TString;
|
|
154
|
+
providers: typebox0.TArray<typebox0.TString>;
|
|
155
|
+
}>;
|
|
156
|
+
type DevModuleMetadata = Static<typeof devModuleMetadataSchema>;
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/schemas/DevPageMetadata.d.ts
|
|
159
|
+
declare const devPageMetadataSchema: typebox0.TObject<{
|
|
160
|
+
name: typebox0.TString;
|
|
161
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
162
|
+
path: typebox0.TOptional<typebox0.TString>;
|
|
163
|
+
params: typebox0.TOptional<typebox0.TAny>;
|
|
164
|
+
query: typebox0.TOptional<typebox0.TAny>;
|
|
165
|
+
hasComponent: typebox0.TBoolean;
|
|
166
|
+
hasLazy: typebox0.TBoolean;
|
|
167
|
+
hasResolve: typebox0.TBoolean;
|
|
168
|
+
hasChildren: typebox0.TBoolean;
|
|
169
|
+
hasParent: typebox0.TBoolean;
|
|
170
|
+
hasErrorHandler: typebox0.TBoolean;
|
|
171
|
+
static: typebox0.TOptional<typebox0.TBoolean>;
|
|
172
|
+
cache: typebox0.TOptional<typebox0.TAny>;
|
|
173
|
+
client: typebox0.TOptional<typebox0.TAny>;
|
|
174
|
+
animation: typebox0.TOptional<typebox0.TAny>;
|
|
175
|
+
}>;
|
|
176
|
+
type DevPageMetadata = Static<typeof devPageMetadataSchema>;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/schemas/DevProviderMetadata.d.ts
|
|
179
|
+
declare const devProviderMetadataSchema: typebox0.TObject<{
|
|
180
|
+
name: typebox0.TString;
|
|
181
|
+
module: typebox0.TOptional<typebox0.TString>;
|
|
182
|
+
dependencies: typebox0.TArray<typebox0.TString>;
|
|
183
|
+
aliases: typebox0.TOptional<typebox0.TArray<typebox0.TString>>;
|
|
184
|
+
}>;
|
|
185
|
+
type DevProviderMetadata = Static<typeof devProviderMetadataSchema>;
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/schemas/DevQueueMetadata.d.ts
|
|
188
|
+
declare const devQueueMetadataSchema: typebox0.TObject<{
|
|
189
|
+
name: typebox0.TString;
|
|
190
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
191
|
+
schema: typebox0.TOptional<typebox0.TAny>;
|
|
192
|
+
provider: typebox0.TString;
|
|
193
|
+
}>;
|
|
194
|
+
type DevQueueMetadata = Static<typeof devQueueMetadataSchema>;
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/schemas/DevRealmMetadata.d.ts
|
|
197
|
+
declare const devRealmMetadataSchema: typebox0.TObject<{
|
|
198
|
+
name: typebox0.TString;
|
|
199
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
200
|
+
roles: typebox0.TOptional<typebox0.TArray<typebox0.TAny>>;
|
|
201
|
+
type: typebox0.TUnsafe<"internal" | "external">;
|
|
202
|
+
settings: typebox0.TOptional<typebox0.TObject<{
|
|
203
|
+
accessTokenExpiration: typebox0.TOptional<typebox0.TAny>;
|
|
204
|
+
refreshTokenExpiration: typebox0.TOptional<typebox0.TAny>;
|
|
205
|
+
hasOnCreateSession: typebox0.TBoolean;
|
|
206
|
+
hasOnRefreshSession: typebox0.TBoolean;
|
|
207
|
+
hasOnDeleteSession: typebox0.TBoolean;
|
|
208
|
+
}>>;
|
|
209
|
+
}>;
|
|
210
|
+
type DevRealmMetadata = Static<typeof devRealmMetadataSchema>;
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/schemas/DevSchedulerMetadata.d.ts
|
|
213
|
+
declare const devSchedulerMetadataSchema: typebox0.TObject<{
|
|
214
|
+
name: typebox0.TString;
|
|
215
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
216
|
+
cron: typebox0.TOptional<typebox0.TString>;
|
|
217
|
+
interval: typebox0.TOptional<typebox0.TAny>;
|
|
218
|
+
lock: typebox0.TOptional<typebox0.TBoolean>;
|
|
219
|
+
}>;
|
|
220
|
+
type DevSchedulerMetadata = Static<typeof devSchedulerMetadataSchema>;
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/schemas/DevTopicMetadata.d.ts
|
|
223
|
+
declare const devTopicMetadataSchema: typebox0.TObject<{
|
|
224
|
+
name: typebox0.TString;
|
|
225
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
226
|
+
schema: typebox0.TOptional<typebox0.TAny>;
|
|
227
|
+
provider: typebox0.TString;
|
|
228
|
+
}>;
|
|
229
|
+
type DevTopicMetadata = Static<typeof devTopicMetadataSchema>;
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/DevCollectorProvider.d.ts
|
|
232
|
+
declare class DevCollectorProvider {
|
|
233
|
+
protected readonly alepha: Alepha;
|
|
234
|
+
protected readonly logs: DevLogEntry[];
|
|
235
|
+
protected readonly maxLogs = 10000;
|
|
236
|
+
protected readonly onLog: _alepha_core1.HookDescriptor<"log">;
|
|
237
|
+
protected readonly uiRoute: _alepha_server0.RouteDescriptor<{
|
|
238
|
+
response: typebox0.TString;
|
|
239
|
+
}>;
|
|
240
|
+
protected readonly metadataRoute: _alepha_server0.RouteDescriptor<{
|
|
241
|
+
response: typebox0.TObject<{
|
|
242
|
+
actions: typebox0.TArray<typebox0.TObject<{
|
|
243
|
+
name: typebox0.TString;
|
|
244
|
+
group: typebox0.TString;
|
|
245
|
+
method: typebox0.TString;
|
|
246
|
+
path: typebox0.TString;
|
|
247
|
+
prefix: typebox0.TString;
|
|
248
|
+
fullPath: typebox0.TString;
|
|
249
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
250
|
+
summary: typebox0.TOptional<typebox0.TString>;
|
|
251
|
+
disabled: typebox0.TOptional<typebox0.TBoolean>;
|
|
252
|
+
secure: typebox0.TOptional<typebox0.TBoolean>;
|
|
253
|
+
hide: typebox0.TOptional<typebox0.TBoolean>;
|
|
254
|
+
body: typebox0.TOptional<typebox0.TAny>;
|
|
255
|
+
params: typebox0.TOptional<typebox0.TAny>;
|
|
256
|
+
query: typebox0.TOptional<typebox0.TAny>;
|
|
257
|
+
response: typebox0.TOptional<typebox0.TAny>;
|
|
258
|
+
bodyContentType: typebox0.TOptional<typebox0.TString>;
|
|
259
|
+
}>>;
|
|
260
|
+
queues: typebox0.TArray<typebox0.TObject<{
|
|
261
|
+
name: typebox0.TString;
|
|
262
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
263
|
+
schema: typebox0.TOptional<typebox0.TAny>;
|
|
264
|
+
provider: typebox0.TString;
|
|
265
|
+
}>>;
|
|
266
|
+
schedulers: typebox0.TArray<typebox0.TObject<{
|
|
267
|
+
name: typebox0.TString;
|
|
268
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
269
|
+
cron: typebox0.TOptional<typebox0.TString>;
|
|
270
|
+
interval: typebox0.TOptional<typebox0.TAny>;
|
|
271
|
+
lock: typebox0.TOptional<typebox0.TBoolean>;
|
|
272
|
+
}>>;
|
|
273
|
+
topics: typebox0.TArray<typebox0.TObject<{
|
|
274
|
+
name: typebox0.TString;
|
|
275
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
276
|
+
schema: typebox0.TOptional<typebox0.TAny>;
|
|
277
|
+
provider: typebox0.TString;
|
|
278
|
+
}>>;
|
|
279
|
+
buckets: typebox0.TArray<typebox0.TObject<{
|
|
280
|
+
name: typebox0.TString;
|
|
281
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
282
|
+
mimeTypes: typebox0.TOptional<typebox0.TArray<typebox0.TString>>;
|
|
283
|
+
maxSize: typebox0.TOptional<typebox0.TNumber>;
|
|
284
|
+
provider: typebox0.TString;
|
|
285
|
+
}>>;
|
|
286
|
+
realms: typebox0.TArray<typebox0.TObject<{
|
|
287
|
+
name: typebox0.TString;
|
|
288
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
289
|
+
roles: typebox0.TOptional<typebox0.TArray<typebox0.TAny>>;
|
|
290
|
+
type: typebox0.TUnsafe<"internal" | "external">;
|
|
291
|
+
settings: typebox0.TOptional<typebox0.TObject<{
|
|
292
|
+
accessTokenExpiration: typebox0.TOptional<typebox0.TAny>;
|
|
293
|
+
refreshTokenExpiration: typebox0.TOptional<typebox0.TAny>;
|
|
294
|
+
hasOnCreateSession: typebox0.TBoolean;
|
|
295
|
+
hasOnRefreshSession: typebox0.TBoolean;
|
|
296
|
+
hasOnDeleteSession: typebox0.TBoolean;
|
|
297
|
+
}>>;
|
|
298
|
+
}>>;
|
|
299
|
+
caches: typebox0.TArray<typebox0.TObject<{
|
|
300
|
+
name: typebox0.TString;
|
|
301
|
+
ttl: typebox0.TOptional<typebox0.TAny>;
|
|
302
|
+
disabled: typebox0.TOptional<typebox0.TBoolean>;
|
|
303
|
+
provider: typebox0.TString;
|
|
304
|
+
}>>;
|
|
305
|
+
pages: typebox0.TArray<typebox0.TObject<{
|
|
306
|
+
name: typebox0.TString;
|
|
307
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
308
|
+
path: typebox0.TOptional<typebox0.TString>;
|
|
309
|
+
params: typebox0.TOptional<typebox0.TAny>;
|
|
310
|
+
query: typebox0.TOptional<typebox0.TAny>;
|
|
311
|
+
hasComponent: typebox0.TBoolean;
|
|
312
|
+
hasLazy: typebox0.TBoolean;
|
|
313
|
+
hasResolve: typebox0.TBoolean;
|
|
314
|
+
hasChildren: typebox0.TBoolean;
|
|
315
|
+
hasParent: typebox0.TBoolean;
|
|
316
|
+
hasErrorHandler: typebox0.TBoolean;
|
|
317
|
+
static: typebox0.TOptional<typebox0.TBoolean>;
|
|
318
|
+
cache: typebox0.TOptional<typebox0.TAny>;
|
|
319
|
+
client: typebox0.TOptional<typebox0.TAny>;
|
|
320
|
+
animation: typebox0.TOptional<typebox0.TAny>;
|
|
321
|
+
}>>;
|
|
322
|
+
providers: typebox0.TArray<typebox0.TObject<{
|
|
323
|
+
name: typebox0.TString;
|
|
324
|
+
module: typebox0.TOptional<typebox0.TString>;
|
|
325
|
+
dependencies: typebox0.TArray<typebox0.TString>;
|
|
326
|
+
aliases: typebox0.TOptional<typebox0.TArray<typebox0.TString>>;
|
|
327
|
+
}>>;
|
|
328
|
+
modules: typebox0.TArray<typebox0.TObject<{
|
|
329
|
+
name: typebox0.TString;
|
|
330
|
+
providers: typebox0.TArray<typebox0.TString>;
|
|
331
|
+
}>>;
|
|
332
|
+
}>;
|
|
333
|
+
}>;
|
|
334
|
+
protected readonly logsRoute: _alepha_server0.RouteDescriptor<{
|
|
335
|
+
response: typebox0.TArray<typebox0.TObject<{
|
|
336
|
+
formatted: typebox0.TString;
|
|
337
|
+
entry: typebox0.TAny;
|
|
338
|
+
}>>;
|
|
339
|
+
}>;
|
|
340
|
+
getLogs(): DevLogEntry[];
|
|
341
|
+
getActions(): DevActionMetadata[];
|
|
342
|
+
getQueues(): DevQueueMetadata[];
|
|
343
|
+
getSchedulers(): DevSchedulerMetadata[];
|
|
344
|
+
getTopics(): DevTopicMetadata[];
|
|
345
|
+
getBuckets(): DevBucketMetadata[];
|
|
346
|
+
getRealms(): DevRealmMetadata[];
|
|
347
|
+
getCaches(): DevCacheMetadata[];
|
|
348
|
+
getPages(): DevPageMetadata[];
|
|
349
|
+
getProviders(): DevProviderMetadata[];
|
|
350
|
+
getModules(): DevModuleMetadata[];
|
|
351
|
+
getMetadata(): DevMetadata;
|
|
352
|
+
protected getProviderName(provider?: "memory" | any): string;
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/index.d.ts
|
|
356
|
+
/**
|
|
357
|
+
* Developer tools module for monitoring and debugging Alepha applications.
|
|
358
|
+
*
|
|
359
|
+
* This module provides comprehensive data collection capabilities for tracking application behavior,
|
|
360
|
+
* performance metrics, and debugging information in real-time.
|
|
361
|
+
*
|
|
362
|
+
* @see {@link DevCollectorProvider}
|
|
363
|
+
* @module alepha.devtools
|
|
364
|
+
*/
|
|
365
|
+
declare const AlephaDevtools: _alepha_core1.Service<_alepha_core1.Module<{}>>;
|
|
366
|
+
//#endregion
|
|
367
|
+
export { AlephaDevtools, DevActionMetadata, DevBucketMetadata, DevCacheMetadata, DevCollectorProvider, DevLogEntry, DevMetadata, DevModuleMetadata, DevPageMetadata, DevProviderMetadata, DevQueueMetadata, DevRealmMetadata, DevSchedulerMetadata, DevTopicMetadata, devActionMetadataSchema, devBucketMetadataSchema, devCacheMetadataSchema, devLogEntrySchema, devMetadataSchema, devModuleMetadataSchema, devPageMetadataSchema, devProviderMetadataSchema, devQueueMetadataSchema, devRealmMetadataSchema, devSchedulerMetadataSchema, devTopicMetadataSchema };
|
|
368
|
+
//# sourceMappingURL=index.d.ts.map
|
package/devtools.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@alepha/devtools'
|
package/email.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import { Descriptor, KIND, Service, Static, TSchema } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _alepha_logger1 from "alepha/logger";
|
|
4
4
|
import { Transporter } from "nodemailer";
|
|
5
5
|
|
|
6
6
|
//#region src/providers/EmailProvider.d.ts
|
|
@@ -30,7 +30,7 @@ interface EmailRecord {
|
|
|
30
30
|
sentAt: Date;
|
|
31
31
|
}
|
|
32
32
|
declare class MemoryEmailProvider implements EmailProvider {
|
|
33
|
-
protected readonly log:
|
|
33
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
34
34
|
protected emails: EmailRecord[];
|
|
35
35
|
send(to: string, subject: string, body: string): Promise<void>;
|
|
36
36
|
/**
|
|
@@ -134,11 +134,11 @@ declare class TemplateService {
|
|
|
134
134
|
* <p>Get started by visiting your <a href="{{dashboardUrl}}">dashboard</a>.</p>
|
|
135
135
|
* `,
|
|
136
136
|
* schema: t.object({
|
|
137
|
-
* firstName: t.
|
|
138
|
-
* lastName: t.
|
|
139
|
-
* companyName: t.
|
|
137
|
+
* firstName: t.text(),
|
|
138
|
+
* lastName: t.text(),
|
|
139
|
+
* companyName: t.text(),
|
|
140
140
|
* role: t.enum(["admin", "user", "manager"]),
|
|
141
|
-
* dashboardUrl: t.
|
|
141
|
+
* dashboardUrl: t.text()
|
|
142
142
|
* })
|
|
143
143
|
* });
|
|
144
144
|
*
|
|
@@ -165,10 +165,10 @@ declare class TemplateService {
|
|
|
165
165
|
* <p>Estimated delivery: {{deliveryDate}}</p>
|
|
166
166
|
* `,
|
|
167
167
|
* schema: t.object({
|
|
168
|
-
* customerName: t.
|
|
169
|
-
* orderNumber: t.
|
|
170
|
-
* totalAmount: t.
|
|
171
|
-
* deliveryDate: t.
|
|
168
|
+
* customerName: t.text(),
|
|
169
|
+
* orderNumber: t.text(),
|
|
170
|
+
* totalAmount: t.text(),
|
|
171
|
+
* deliveryDate: t.text()
|
|
172
172
|
* })
|
|
173
173
|
* });
|
|
174
174
|
* ```
|
|
@@ -180,8 +180,8 @@ declare class TemplateService {
|
|
|
180
180
|
* body: "<p>{{message}}</p>",
|
|
181
181
|
* provider: "memory", // Captures emails for testing
|
|
182
182
|
* schema: t.object({
|
|
183
|
-
* subject: t.
|
|
184
|
-
* message: t.
|
|
183
|
+
* subject: t.text(),
|
|
184
|
+
* message: t.text()
|
|
185
185
|
* })
|
|
186
186
|
* });
|
|
187
187
|
*
|
|
@@ -224,7 +224,7 @@ interface EmailDescriptorOptions<T extends TSchema> {
|
|
|
224
224
|
provider?: Service<EmailProvider> | "memory";
|
|
225
225
|
}
|
|
226
226
|
declare class EmailDescriptor<T extends TSchema> extends Descriptor<EmailDescriptorOptions<T>> {
|
|
227
|
-
protected readonly log:
|
|
227
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
228
228
|
protected readonly templateService: TemplateService;
|
|
229
229
|
readonly provider: EmailProvider | MemoryEmailProvider;
|
|
230
230
|
get name(): string;
|
|
@@ -252,7 +252,7 @@ interface LocalEmailProviderOptions {
|
|
|
252
252
|
directory?: string;
|
|
253
253
|
}
|
|
254
254
|
declare class LocalEmailProvider implements EmailProvider {
|
|
255
|
-
protected readonly log:
|
|
255
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
256
256
|
protected readonly directory: string;
|
|
257
257
|
constructor(options?: LocalEmailProviderOptions);
|
|
258
258
|
send(to: string, subject: string, body: string): Promise<void>;
|
|
@@ -292,7 +292,7 @@ declare class NodemailerEmailProvider implements EmailProvider {
|
|
|
292
292
|
EMAIL_FROM: string;
|
|
293
293
|
EMAIL_SECURE: boolean;
|
|
294
294
|
};
|
|
295
|
-
protected readonly log:
|
|
295
|
+
protected readonly log: _alepha_logger1.Logger;
|
|
296
296
|
protected transporter: Transporter;
|
|
297
297
|
protected fromAddress: string;
|
|
298
298
|
readonly options: NodemailerEmailProviderOptions;
|