alepha 0.13.4 → 0.13.5
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/dist/api-files/index.browser.js +5 -5
- package/dist/api-files/index.d.ts +191 -191
- package/dist/api-files/index.js +9 -9
- package/dist/api-jobs/index.browser.js +5 -5
- package/dist/api-jobs/index.d.ts +173 -173
- package/dist/api-jobs/index.js +9 -9
- package/dist/api-notifications/index.browser.js +11 -11
- package/dist/api-notifications/index.d.ts +11 -11
- package/dist/api-notifications/index.js +11 -11
- package/dist/api-parameters/index.browser.js +2 -2
- package/dist/api-parameters/index.d.ts +3 -3
- package/dist/api-parameters/index.js +3 -3
- package/dist/api-users/index.browser.js +6 -6
- package/dist/api-users/index.d.ts +55 -55
- package/dist/api-users/index.js +36 -36
- package/dist/api-verifications/index.browser.js +5 -5
- package/dist/api-verifications/index.d.ts +21 -21
- package/dist/api-verifications/index.js +10 -10
- package/dist/batch/index.d.ts +3 -3
- package/dist/batch/index.js +3 -3
- package/dist/bin/index.js +1 -1
- package/dist/bucket/index.d.ts +6 -6
- package/dist/bucket/index.js +7 -7
- package/dist/cache/index.d.ts +4 -4
- package/dist/cache/index.js +5 -5
- package/dist/cache-redis/index.d.ts +2 -2
- package/dist/cache-redis/index.js +2 -2
- package/dist/cli/{dist-lGnqsKpu.js → dist-BlfFtOk2.js} +16 -16
- package/dist/cli/{dist-lGnqsKpu.js.map → dist-BlfFtOk2.js.map} +1 -1
- package/dist/cli/index.d.ts +31 -75
- package/dist/cli/index.js +94 -171
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +8 -8
- package/dist/command/index.js +11 -10
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +35 -35
- package/dist/core/index.d.ts +39 -39
- package/dist/core/index.js +35 -35
- package/dist/core/index.native.js +35 -35
- package/dist/datetime/index.d.ts +3 -3
- package/dist/datetime/index.js +3 -3
- package/dist/email/index.d.ts +11 -11
- package/dist/email/index.js +42 -42
- package/dist/fake/index.d.ts +2 -2
- package/dist/fake/index.js +5 -5
- package/dist/file/index.d.ts +4 -4
- package/dist/file/index.js +4 -4
- package/dist/lock/index.d.ts +5 -5
- package/dist/lock/index.js +5 -5
- package/dist/lock-redis/index.d.ts +2 -2
- package/dist/lock-redis/index.js +2 -2
- package/dist/logger/index.d.ts +11 -11
- package/dist/logger/index.js +12 -12
- package/dist/orm/index.browser.js +12 -12
- package/dist/orm/index.d.ts +52 -52
- package/dist/orm/index.js +32 -32
- package/dist/queue/index.d.ts +7 -7
- package/dist/queue/index.js +6 -6
- package/dist/queue-redis/index.d.ts +2 -2
- package/dist/queue-redis/index.js +2 -2
- package/dist/redis/index.d.ts +13 -13
- package/dist/redis/index.js +3 -3
- package/dist/retry/index.d.ts +5 -5
- package/dist/retry/index.js +5 -5
- package/dist/router/index.d.ts +1 -1
- package/dist/router/index.js +1 -1
- package/dist/scheduler/index.d.ts +4 -4
- package/dist/scheduler/index.js +7 -7
- package/dist/security/index.browser.js +7 -7
- package/dist/security/index.d.ts +15 -15
- package/dist/security/index.js +46 -46
- package/dist/server/index.browser.js +14 -14
- package/dist/server/index.d.ts +26 -26
- package/dist/server/index.js +26 -26
- package/dist/server-auth/index.browser.js +6 -6
- package/dist/server-auth/index.d.ts +163 -163
- package/dist/server-auth/index.js +13 -13
- package/dist/server-cache/index.d.ts +2 -2
- package/dist/server-cache/index.js +2 -2
- package/dist/server-compress/index.d.ts +2 -2
- package/dist/server-compress/index.js +2 -2
- package/dist/server-cookies/index.browser.js +3 -3
- package/dist/server-cookies/index.d.ts +4 -4
- package/dist/server-cookies/index.js +4 -4
- package/dist/server-cors/index.d.ts +3 -3
- package/dist/server-cors/index.js +3 -3
- package/dist/server-health/index.d.ts +3 -3
- package/dist/server-health/index.js +3 -3
- package/dist/server-helmet/index.d.ts +2 -2
- package/dist/server-helmet/index.js +2 -2
- package/dist/server-links/index.browser.js +5 -5
- package/dist/server-links/index.d.ts +40 -40
- package/dist/server-links/index.js +7 -7
- package/dist/server-metrics/index.d.ts +2 -2
- package/dist/server-metrics/index.js +86 -86
- package/dist/server-multipart/index.d.ts +2 -2
- package/dist/server-multipart/index.js +2 -2
- package/dist/server-proxy/index.d.ts +3 -3
- package/dist/server-proxy/index.js +3 -3
- package/dist/server-rate-limit/index.d.ts +3 -3
- package/dist/server-rate-limit/index.js +3 -3
- package/dist/server-security/index.browser.js +1 -1
- package/dist/server-security/index.d.ts +13 -13
- package/dist/server-security/index.js +4 -4
- package/dist/server-static/index.d.ts +3 -3
- package/dist/server-static/index.js +3 -3
- package/dist/server-swagger/index.d.ts +3 -3
- package/dist/server-swagger/index.js +3 -3
- package/dist/sms/index.d.ts +6 -6
- package/dist/sms/index.js +6 -6
- package/dist/thread/index.d.ts +3 -3
- package/dist/thread/index.js +3 -3
- package/dist/topic/index.d.ts +6 -6
- package/dist/topic/index.js +6 -6
- package/dist/topic-redis/index.d.ts +2 -2
- package/dist/topic-redis/index.js +2 -2
- package/dist/vite/index.d.ts +17 -17
- package/dist/vite/index.js +20 -20
- package/dist/websocket/index.browser.js +9 -9
- package/dist/websocket/index.d.ts +17 -17
- package/dist/websocket/index.js +10 -10
- package/package.json +5 -4
- package/src/cli/apps/AlephaCli.ts +1 -2
- package/src/cli/commands/BiomeCommands.ts +4 -6
- package/src/cli/commands/CoreCommands.ts +2 -2
- package/src/cli/commands/DrizzleCommands.ts +76 -78
- package/src/cli/commands/VerifyCommands.ts +3 -5
- package/src/cli/commands/ViteCommands.ts +6 -8
- package/src/cli/index.ts +1 -1
- package/src/cli/services/{ProjectUtils.ts → AlephaCliUtils.ts} +101 -16
- package/src/command/providers/CliProvider.ts +12 -4
- package/src/cli/services/ProcessRunner.ts +0 -89
|
@@ -5,7 +5,7 @@ import TypeBoxFormat from "typebox/format";
|
|
|
5
5
|
import { Locale } from "typebox/system";
|
|
6
6
|
import * as TypeBoxValue from "typebox/value";
|
|
7
7
|
|
|
8
|
-
//#region src/core/constants/KIND.ts
|
|
8
|
+
//#region ../../src/core/constants/KIND.ts
|
|
9
9
|
/**
|
|
10
10
|
* Used for identifying primitives.
|
|
11
11
|
*
|
|
@@ -14,7 +14,7 @@ import * as TypeBoxValue from "typebox/value";
|
|
|
14
14
|
const KIND = Symbol.for("Alepha.Kind");
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
|
-
//#region src/core/constants/MODULE.ts
|
|
17
|
+
//#region ../../src/core/constants/MODULE.ts
|
|
18
18
|
/**
|
|
19
19
|
* Used for identifying modules.
|
|
20
20
|
*
|
|
@@ -23,7 +23,7 @@ const KIND = Symbol.for("Alepha.Kind");
|
|
|
23
23
|
const MODULE = Symbol.for("Alepha.Module");
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
|
-
//#region src/core/constants/OPTIONS.ts
|
|
26
|
+
//#region ../../src/core/constants/OPTIONS.ts
|
|
27
27
|
/**
|
|
28
28
|
* Used for primitives options.
|
|
29
29
|
*
|
|
@@ -32,7 +32,7 @@ const MODULE = Symbol.for("Alepha.Module");
|
|
|
32
32
|
const OPTIONS = Symbol.for("Alepha.Options");
|
|
33
33
|
|
|
34
34
|
//#endregion
|
|
35
|
-
//#region src/core/errors/AlephaError.ts
|
|
35
|
+
//#region ../../src/core/errors/AlephaError.ts
|
|
36
36
|
/**
|
|
37
37
|
* Default error class for Alepha.
|
|
38
38
|
*/
|
|
@@ -41,7 +41,7 @@ var AlephaError = class extends Error {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
|
-
//#region src/core/errors/CircularDependencyError.ts
|
|
44
|
+
//#region ../../src/core/errors/CircularDependencyError.ts
|
|
45
45
|
var CircularDependencyError = class extends AlephaError {
|
|
46
46
|
name = "CircularDependencyError";
|
|
47
47
|
constructor(provider, parents) {
|
|
@@ -50,7 +50,7 @@ var CircularDependencyError = class extends AlephaError {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
//#endregion
|
|
53
|
-
//#region src/core/errors/ContainerLockedError.ts
|
|
53
|
+
//#region ../../src/core/errors/ContainerLockedError.ts
|
|
54
54
|
var ContainerLockedError = class extends AlephaError {
|
|
55
55
|
name = "ContainerLockedError";
|
|
56
56
|
constructor(message = "Container is locked. No more providers can be added.") {
|
|
@@ -59,7 +59,7 @@ var ContainerLockedError = class extends AlephaError {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
//#endregion
|
|
62
|
-
//#region src/core/errors/TooLateSubstitutionError.ts
|
|
62
|
+
//#region ../../src/core/errors/TooLateSubstitutionError.ts
|
|
63
63
|
var TooLateSubstitutionError = class extends AlephaError {
|
|
64
64
|
name = "TooLateSubstitutionError";
|
|
65
65
|
constructor(original, substitution) {
|
|
@@ -68,7 +68,7 @@ var TooLateSubstitutionError = class extends AlephaError {
|
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
//#endregion
|
|
71
|
-
//#region src/core/errors/MissingContextError.ts
|
|
71
|
+
//#region ../../src/core/errors/MissingContextError.ts
|
|
72
72
|
var MissingContextError = class extends AlephaError {
|
|
73
73
|
name = "MissingContextError";
|
|
74
74
|
constructor() {
|
|
@@ -78,7 +78,7 @@ var MissingContextError = class extends AlephaError {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
//#endregion
|
|
81
|
-
//#region src/core/helpers/ref.ts
|
|
81
|
+
//#region ../../src/core/helpers/ref.ts
|
|
82
82
|
/**
|
|
83
83
|
* Store the current context and definition during injection phase.
|
|
84
84
|
*
|
|
@@ -127,7 +127,7 @@ const __alephaRef = {};
|
|
|
127
127
|
*/
|
|
128
128
|
|
|
129
129
|
//#endregion
|
|
130
|
-
//#region src/core/primitives/$context.ts
|
|
130
|
+
//#region ../../src/core/primitives/$context.ts
|
|
131
131
|
/**
|
|
132
132
|
* Get Alepha instance and current service from the current context.
|
|
133
133
|
*
|
|
@@ -165,7 +165,7 @@ const $context = () => {
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
//#endregion
|
|
168
|
-
//#region src/core/helpers/primitive.ts
|
|
168
|
+
//#region ../../src/core/helpers/primitive.ts
|
|
169
169
|
var Primitive = class {
|
|
170
170
|
alepha;
|
|
171
171
|
options;
|
|
@@ -198,7 +198,7 @@ const createPrimitive = (primitive, options) => {
|
|
|
198
198
|
};
|
|
199
199
|
|
|
200
200
|
//#endregion
|
|
201
|
-
//#region src/core/interfaces/Service.ts
|
|
201
|
+
//#region ../../src/core/interfaces/Service.ts
|
|
202
202
|
function isClass(func) {
|
|
203
203
|
if (typeof func !== "function") return false;
|
|
204
204
|
const descriptor = Object.getOwnPropertyDescriptor(func, "prototype");
|
|
@@ -206,7 +206,7 @@ function isClass(func) {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
//#endregion
|
|
209
|
-
//#region src/core/primitives/$module.ts
|
|
209
|
+
//#region ../../src/core/primitives/$module.ts
|
|
210
210
|
/**
|
|
211
211
|
* Wrap Services and Primitives into a Module.
|
|
212
212
|
*
|
|
@@ -298,7 +298,7 @@ var Module = class Module {
|
|
|
298
298
|
};
|
|
299
299
|
|
|
300
300
|
//#endregion
|
|
301
|
-
//#region src/core/providers/AlsProvider.ts
|
|
301
|
+
//#region ../../src/core/providers/AlsProvider.ts
|
|
302
302
|
var AlsProvider = class AlsProvider {
|
|
303
303
|
static create = () => {};
|
|
304
304
|
als;
|
|
@@ -330,7 +330,7 @@ var AlsProvider = class AlsProvider {
|
|
|
330
330
|
};
|
|
331
331
|
|
|
332
332
|
//#endregion
|
|
333
|
-
//#region src/core/primitives/$inject.ts
|
|
333
|
+
//#region ../../src/core/primitives/$inject.ts
|
|
334
334
|
/**
|
|
335
335
|
* Get the instance of the specified type from the context.
|
|
336
336
|
*
|
|
@@ -352,7 +352,7 @@ const $inject = (type, opts = {}) => {
|
|
|
352
352
|
var InjectPrimitive = class extends Primitive {};
|
|
353
353
|
|
|
354
354
|
//#endregion
|
|
355
|
-
//#region src/core/providers/Json.ts
|
|
355
|
+
//#region ../../src/core/providers/Json.ts
|
|
356
356
|
/**
|
|
357
357
|
* Mimics the JSON global object with stringify and parse methods.
|
|
358
358
|
*
|
|
@@ -368,11 +368,11 @@ var Json = class {
|
|
|
368
368
|
};
|
|
369
369
|
|
|
370
370
|
//#endregion
|
|
371
|
-
//#region src/core/providers/SchemaCodec.ts
|
|
371
|
+
//#region ../../src/core/providers/SchemaCodec.ts
|
|
372
372
|
var SchemaCodec = class {};
|
|
373
373
|
|
|
374
374
|
//#endregion
|
|
375
|
-
//#region src/core/providers/JsonSchemaCodec.ts
|
|
375
|
+
//#region ../../src/core/providers/JsonSchemaCodec.ts
|
|
376
376
|
var JsonSchemaCodec = class extends SchemaCodec {
|
|
377
377
|
json = $inject(Json);
|
|
378
378
|
encoder = new TextEncoder();
|
|
@@ -398,7 +398,7 @@ var JsonSchemaCodec = class extends SchemaCodec {
|
|
|
398
398
|
};
|
|
399
399
|
|
|
400
400
|
//#endregion
|
|
401
|
-
//#region src/core/errors/TypeBoxError.ts
|
|
401
|
+
//#region ../../src/core/errors/TypeBoxError.ts
|
|
402
402
|
var TypeBoxError = class extends AlephaError {
|
|
403
403
|
name = "TypeBoxError";
|
|
404
404
|
cause;
|
|
@@ -419,7 +419,7 @@ var TypeBoxError = class extends AlephaError {
|
|
|
419
419
|
};
|
|
420
420
|
|
|
421
421
|
//#endregion
|
|
422
|
-
//#region src/core/providers/SchemaValidator.ts
|
|
422
|
+
//#region ../../src/core/providers/SchemaValidator.ts
|
|
423
423
|
var SchemaValidator = class {
|
|
424
424
|
cache = /* @__PURE__ */ new Map();
|
|
425
425
|
/**
|
|
@@ -488,7 +488,7 @@ var SchemaValidator = class {
|
|
|
488
488
|
};
|
|
489
489
|
|
|
490
490
|
//#endregion
|
|
491
|
-
//#region src/core/providers/CodecManager.ts
|
|
491
|
+
//#region ../../src/core/providers/CodecManager.ts
|
|
492
492
|
/**
|
|
493
493
|
* CodecManager manages multiple codec formats and provides a unified interface
|
|
494
494
|
* for encoding and decoding data with different formats.
|
|
@@ -553,7 +553,7 @@ var CodecManager = class {
|
|
|
553
553
|
};
|
|
554
554
|
|
|
555
555
|
//#endregion
|
|
556
|
-
//#region src/core/providers/EventManager.ts
|
|
556
|
+
//#region ../../src/core/providers/EventManager.ts
|
|
557
557
|
var EventManager = class {
|
|
558
558
|
logFn;
|
|
559
559
|
/**
|
|
@@ -617,7 +617,7 @@ var EventManager = class {
|
|
|
617
617
|
};
|
|
618
618
|
|
|
619
619
|
//#endregion
|
|
620
|
-
//#region src/core/primitives/$atom.ts
|
|
620
|
+
//#region ../../src/core/primitives/$atom.ts
|
|
621
621
|
/**
|
|
622
622
|
* Define an atom for state management.
|
|
623
623
|
*
|
|
@@ -668,7 +668,7 @@ var Atom = class {
|
|
|
668
668
|
$atom[KIND] = "atom";
|
|
669
669
|
|
|
670
670
|
//#endregion
|
|
671
|
-
//#region src/core/providers/StateManager.ts
|
|
671
|
+
//#region ../../src/core/providers/StateManager.ts
|
|
672
672
|
var StateManager = class {
|
|
673
673
|
als = $inject(AlsProvider);
|
|
674
674
|
events = $inject(EventManager);
|
|
@@ -762,7 +762,7 @@ var StateManager = class {
|
|
|
762
762
|
};
|
|
763
763
|
|
|
764
764
|
//#endregion
|
|
765
|
-
//#region src/core/Alepha.ts
|
|
765
|
+
//#region ../../src/core/Alepha.ts
|
|
766
766
|
/**
|
|
767
767
|
* Core container of the Alepha framework.
|
|
768
768
|
*
|
|
@@ -1366,7 +1366,7 @@ var Alepha = class Alepha {
|
|
|
1366
1366
|
};
|
|
1367
1367
|
|
|
1368
1368
|
//#endregion
|
|
1369
|
-
//#region src/core/errors/AppNotStartedError.ts
|
|
1369
|
+
//#region ../../src/core/errors/AppNotStartedError.ts
|
|
1370
1370
|
var AppNotStartedError = class extends AlephaError {
|
|
1371
1371
|
name = "AppNotStartedError";
|
|
1372
1372
|
constructor() {
|
|
@@ -1375,7 +1375,7 @@ var AppNotStartedError = class extends AlephaError {
|
|
|
1375
1375
|
};
|
|
1376
1376
|
|
|
1377
1377
|
//#endregion
|
|
1378
|
-
//#region src/core/helpers/createPagination.ts
|
|
1378
|
+
//#region ../../src/core/helpers/createPagination.ts
|
|
1379
1379
|
/**
|
|
1380
1380
|
* Create a pagination object from an array of entities.
|
|
1381
1381
|
*
|
|
@@ -1446,7 +1446,7 @@ function createPagination(entities, limit = 10, offset = 0, sort) {
|
|
|
1446
1446
|
}
|
|
1447
1447
|
|
|
1448
1448
|
//#endregion
|
|
1449
|
-
//#region src/core/helpers/FileLike.ts
|
|
1449
|
+
//#region ../../src/core/helpers/FileLike.ts
|
|
1450
1450
|
const isTypeFile = (value) => {
|
|
1451
1451
|
return value && typeof value === "object" && "format" in value && value.format === "binary";
|
|
1452
1452
|
};
|
|
@@ -1455,7 +1455,7 @@ const isFileLike = (value) => {
|
|
|
1455
1455
|
};
|
|
1456
1456
|
|
|
1457
1457
|
//#endregion
|
|
1458
|
-
//#region src/core/providers/TypeProvider.ts
|
|
1458
|
+
//#region ../../src/core/providers/TypeProvider.ts
|
|
1459
1459
|
const isUUID = TypeBoxFormat.IsUuid;
|
|
1460
1460
|
const isEmail = TypeBoxFormat.IsEmail;
|
|
1461
1461
|
const isURL = TypeBoxFormat.IsUrl;
|
|
@@ -1900,7 +1900,7 @@ var TypeProvider = class TypeProvider {
|
|
|
1900
1900
|
const t = new TypeProvider();
|
|
1901
1901
|
|
|
1902
1902
|
//#endregion
|
|
1903
|
-
//#region src/core/primitives/$env.ts
|
|
1903
|
+
//#region ../../src/core/primitives/$env.ts
|
|
1904
1904
|
/**
|
|
1905
1905
|
* Get typed values from environment variables.
|
|
1906
1906
|
*
|
|
@@ -1934,7 +1934,7 @@ const $env = (type) => {
|
|
|
1934
1934
|
};
|
|
1935
1935
|
|
|
1936
1936
|
//#endregion
|
|
1937
|
-
//#region src/core/primitives/$hook.ts
|
|
1937
|
+
//#region ../../src/core/primitives/$hook.ts
|
|
1938
1938
|
/**
|
|
1939
1939
|
* Registers a new hook.
|
|
1940
1940
|
*
|
|
@@ -1991,7 +1991,7 @@ var HookPrimitive = class extends Primitive {
|
|
|
1991
1991
|
$hook[KIND] = HookPrimitive;
|
|
1992
1992
|
|
|
1993
1993
|
//#endregion
|
|
1994
|
-
//#region src/core/primitives/$use.ts
|
|
1994
|
+
//#region ../../src/core/primitives/$use.ts
|
|
1995
1995
|
/**
|
|
1996
1996
|
* Subscribes to an atom's state and returns its current value for use in components.
|
|
1997
1997
|
*
|
|
@@ -2025,7 +2025,7 @@ const $use = (atom) => {
|
|
|
2025
2025
|
};
|
|
2026
2026
|
|
|
2027
2027
|
//#endregion
|
|
2028
|
-
//#region src/core/schemas/pageQuerySchema.ts
|
|
2028
|
+
//#region ../../src/core/schemas/pageQuerySchema.ts
|
|
2029
2029
|
const pageQuerySchema = t.object({
|
|
2030
2030
|
page: t.optional(t.integer({
|
|
2031
2031
|
description: "The page number to retrieve.",
|
|
@@ -2042,7 +2042,7 @@ const pageQuerySchema = t.object({
|
|
|
2042
2042
|
});
|
|
2043
2043
|
|
|
2044
2044
|
//#endregion
|
|
2045
|
-
//#region src/core/schemas/pageSchema.ts
|
|
2045
|
+
//#region ../../src/core/schemas/pageSchema.ts
|
|
2046
2046
|
const pageMetadataSchema = t.object({
|
|
2047
2047
|
number: t.integer({ description: "Page number, starting from 0" }),
|
|
2048
2048
|
size: t.integer({ description: "Number of items per page (requested page size)" }),
|
|
@@ -2090,7 +2090,7 @@ const pageSchema = (objectSchema, options) => t.object({
|
|
|
2090
2090
|
TypeProvider.prototype.page = (itemSchema) => pageSchema(itemSchema);
|
|
2091
2091
|
|
|
2092
2092
|
//#endregion
|
|
2093
|
-
//#region src/core/index.native.ts
|
|
2093
|
+
//#region ../../src/core/index.native.ts
|
|
2094
2094
|
if (!Promise.withResolvers) Promise.withResolvers = () => {
|
|
2095
2095
|
let resolve;
|
|
2096
2096
|
let reject;
|
package/dist/datetime/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import "dayjs/locale/ar.js";
|
|
|
9
9
|
import "dayjs/locale/fr.js";
|
|
10
10
|
import DayjsApi, { Dayjs, ManipulateType, PluginFunc } from "dayjs";
|
|
11
11
|
|
|
12
|
-
//#region src/datetime/providers/DateTimeProvider.d.ts
|
|
12
|
+
//#region ../../src/datetime/providers/DateTimeProvider.d.ts
|
|
13
13
|
type DateTime = DayjsApi.Dayjs;
|
|
14
14
|
type Duration = dayjsDuration.Duration;
|
|
15
15
|
type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
|
|
@@ -117,7 +117,7 @@ interface Timeout {
|
|
|
117
117
|
clear: () => void;
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
|
-
//#region src/datetime/primitives/$interval.d.ts
|
|
120
|
+
//#region ../../src/datetime/primitives/$interval.d.ts
|
|
121
121
|
/**
|
|
122
122
|
* Run a function periodically.
|
|
123
123
|
* It uses the `setInterval` internally.
|
|
@@ -143,7 +143,7 @@ declare class IntervalPrimitive extends Primitive<IntervalPrimitiveOptions> {
|
|
|
143
143
|
protected onInit(): void;
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
|
-
//#region src/datetime/index.d.ts
|
|
146
|
+
//#region ../../src/datetime/index.d.ts
|
|
147
147
|
declare const AlephaDateTime: alepha1.Service<alepha1.Module>;
|
|
148
148
|
//#endregion
|
|
149
149
|
export { $interval, AlephaDateTime, DateTime, DateTimeProvider, Duration, DurationLike, Interval, IntervalPrimitive, IntervalPrimitiveOptions, Timeout, dayjs, isDateTime };
|
package/dist/datetime/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import "dayjs/locale/ar.js";
|
|
|
8
8
|
import "dayjs/locale/fr.js";
|
|
9
9
|
import DayjsApi from "dayjs";
|
|
10
10
|
|
|
11
|
-
//#region src/datetime/providers/DateTimeProvider.ts
|
|
11
|
+
//#region ../../src/datetime/providers/DateTimeProvider.ts
|
|
12
12
|
const dayjs = DayjsApi;
|
|
13
13
|
const isDateTime = (value) => {
|
|
14
14
|
return dayjs.isDayjs(value);
|
|
@@ -248,7 +248,7 @@ var DateTimeProvider = class DateTimeProvider {
|
|
|
248
248
|
};
|
|
249
249
|
|
|
250
250
|
//#endregion
|
|
251
|
-
//#region src/datetime/primitives/$interval.ts
|
|
251
|
+
//#region ../../src/datetime/primitives/$interval.ts
|
|
252
252
|
/**
|
|
253
253
|
* Run a function periodically.
|
|
254
254
|
* It uses the `setInterval` internally.
|
|
@@ -268,7 +268,7 @@ var IntervalPrimitive = class extends Primitive {
|
|
|
268
268
|
$interval[KIND] = IntervalPrimitive;
|
|
269
269
|
|
|
270
270
|
//#endregion
|
|
271
|
-
//#region src/datetime/index.ts
|
|
271
|
+
//#region ../../src/datetime/index.ts
|
|
272
272
|
const AlephaDateTime = $module({
|
|
273
273
|
name: "alepha.datetime",
|
|
274
274
|
primitives: [$interval],
|
package/dist/email/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as alepha1 from "alepha";
|
|
2
2
|
import { InstantiableClass, KIND, Primitive } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as alepha_logger0 from "alepha/logger";
|
|
4
4
|
import { Transporter } from "nodemailer";
|
|
5
5
|
|
|
6
|
-
//#region src/email/providers/EmailProvider.d.ts
|
|
6
|
+
//#region ../../src/email/providers/EmailProvider.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Email provider interface.
|
|
9
9
|
*
|
|
@@ -23,12 +23,12 @@ type EmailSendOptions = {
|
|
|
23
23
|
body: string;
|
|
24
24
|
};
|
|
25
25
|
//#endregion
|
|
26
|
-
//#region src/email/errors/EmailError.d.ts
|
|
26
|
+
//#region ../../src/email/errors/EmailError.d.ts
|
|
27
27
|
declare class EmailError extends Error {
|
|
28
28
|
constructor(message: string, cause?: Error);
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region src/email/primitives/$email.d.ts
|
|
31
|
+
//#region ../../src/email/primitives/$email.d.ts
|
|
32
32
|
declare const $email: {
|
|
33
33
|
(options?: EmailPrimitiveOptions): EmailPrimitive;
|
|
34
34
|
[KIND]: typeof EmailPrimitive;
|
|
@@ -65,7 +65,7 @@ declare class EmailPrimitive extends Primitive<EmailPrimitiveOptions> {
|
|
|
65
65
|
protected $provider(): EmailProvider;
|
|
66
66
|
}
|
|
67
67
|
//#endregion
|
|
68
|
-
//#region src/email/providers/LocalEmailProvider.d.ts
|
|
68
|
+
//#region ../../src/email/providers/LocalEmailProvider.d.ts
|
|
69
69
|
interface LocalEmailProviderOptions {
|
|
70
70
|
/**
|
|
71
71
|
* Directory to save email files.
|
|
@@ -73,7 +73,7 @@ interface LocalEmailProviderOptions {
|
|
|
73
73
|
directory?: string;
|
|
74
74
|
}
|
|
75
75
|
declare class LocalEmailProvider implements EmailProvider {
|
|
76
|
-
protected readonly log:
|
|
76
|
+
protected readonly log: alepha_logger0.Logger;
|
|
77
77
|
protected readonly directory: string;
|
|
78
78
|
constructor(options?: LocalEmailProviderOptions);
|
|
79
79
|
send(options: EmailSendOptions): Promise<void>;
|
|
@@ -85,7 +85,7 @@ declare class LocalEmailProvider implements EmailProvider {
|
|
|
85
85
|
escapeHtml(text: string): string;
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
|
-
//#region src/email/providers/MemoryEmailProvider.d.ts
|
|
88
|
+
//#region ../../src/email/providers/MemoryEmailProvider.d.ts
|
|
89
89
|
interface EmailRecord {
|
|
90
90
|
to: string;
|
|
91
91
|
subject: string;
|
|
@@ -93,7 +93,7 @@ interface EmailRecord {
|
|
|
93
93
|
sentAt: Date;
|
|
94
94
|
}
|
|
95
95
|
declare class MemoryEmailProvider implements EmailProvider {
|
|
96
|
-
protected readonly log:
|
|
96
|
+
protected readonly log: alepha_logger0.Logger;
|
|
97
97
|
records: EmailRecord[];
|
|
98
98
|
send(options: EmailSendOptions): Promise<void>;
|
|
99
99
|
/**
|
|
@@ -102,7 +102,7 @@ declare class MemoryEmailProvider implements EmailProvider {
|
|
|
102
102
|
get last(): EmailRecord | undefined;
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
|
-
//#region src/email/providers/NodemailerEmailProvider.d.ts
|
|
105
|
+
//#region ../../src/email/providers/NodemailerEmailProvider.d.ts
|
|
106
106
|
interface NodemailerEmailProviderOptions {
|
|
107
107
|
/**
|
|
108
108
|
* Custom transporter configuration.
|
|
@@ -134,7 +134,7 @@ declare class NodemailerEmailProvider implements EmailProvider {
|
|
|
134
134
|
EMAIL_FROM: string;
|
|
135
135
|
EMAIL_SECURE: boolean;
|
|
136
136
|
};
|
|
137
|
-
protected readonly log:
|
|
137
|
+
protected readonly log: alepha_logger0.Logger;
|
|
138
138
|
protected transporter: Transporter;
|
|
139
139
|
protected fromAddress: string;
|
|
140
140
|
readonly options: NodemailerEmailProviderOptions;
|
|
@@ -153,7 +153,7 @@ declare class NodemailerEmailProvider implements EmailProvider {
|
|
|
153
153
|
protected readonly onStop: alepha1.HookPrimitive<"stop">;
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
|
-
//#region src/email/index.d.ts
|
|
156
|
+
//#region ../../src/email/index.d.ts
|
|
157
157
|
declare module "alepha" {
|
|
158
158
|
interface Hooks {
|
|
159
159
|
"email:sending": {
|