alepha 0.14.4 → 0.15.0
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 +1 -4
- package/dist/api/audits/index.d.ts +619 -731
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/files/index.d.ts +185 -298
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +0 -1
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +245 -356
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/notifications/index.d.ts +238 -350
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/parameters/index.d.ts +499 -611
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/users/index.browser.js +1 -2
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +1697 -1804
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +178 -151
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +132 -132
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/batch/index.d.ts +122 -122
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +1 -2
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +163 -163
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/cache/core/index.d.ts +46 -46
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cli/index.d.ts +302 -299
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +966 -564
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +303 -299
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +11 -7
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +419 -99
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +718 -625
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +420 -99
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +419 -99
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.d.ts +44 -44
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +4 -4
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +97 -50
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +129 -33
- package/dist/email/index.js.map +1 -1
- package/dist/fake/index.d.ts +7981 -14
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/file/index.d.ts +523 -390
- package/dist/file/index.d.ts.map +1 -1
- package/dist/file/index.js +253 -1
- package/dist/file/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +208 -208
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/logger/index.d.ts +25 -26
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +197 -197
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/orm/chunk-DtkW-qnP.js +38 -0
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.bun.js +2814 -0
- package/dist/orm/index.bun.js.map +1 -0
- package/dist/orm/index.d.ts +1205 -1057
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +2056 -1753
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +248 -248
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/redis/index.bun.js +285 -0
- package/dist/redis/index.bun.js.map +1 -0
- package/dist/redis/index.d.ts +118 -136
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +18 -38
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +69 -69
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/router/index.d.ts +6 -6
- package/dist/router/index.d.ts.map +1 -1
- package/dist/scheduler/index.d.ts +25 -25
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/security/index.browser.js +5 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +417 -254
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +386 -86
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +277 -277
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +20 -20
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.d.ts +60 -57
- package/dist/server/cache/index.d.ts.map +1 -1
- package/dist/server/cache/index.js +1 -1
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/compress/index.d.ts +3 -3
- package/dist/server/compress/index.d.ts.map +1 -1
- package/dist/server/cookies/index.d.ts +6 -6
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +3 -3
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.d.ts +242 -150
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +288 -122
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +11 -12
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/health/index.d.ts +0 -1
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/helmet/index.d.ts +2 -2
- package/dist/server/helmet/index.d.ts.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +84 -85
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +1 -2
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/multipart/index.d.ts +6 -6
- package/dist/server/multipart/index.d.ts.map +1 -1
- package/dist/server/proxy/index.d.ts +102 -103
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.d.ts +16 -16
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/static/index.d.ts +44 -44
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/swagger/index.d.ts +48 -49
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +1 -2
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +13 -11
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js +7 -7
- package/dist/sms/index.js.map +1 -1
- package/dist/thread/index.d.ts +71 -72
- package/dist/thread/index.d.ts.map +1 -1
- package/dist/topic/core/index.d.ts +318 -318
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/redis/index.d.ts +6 -6
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/vite/index.d.ts +5720 -159
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +41 -18
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js +6 -6
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +247 -247
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +6 -6
- package/dist/websocket/index.js.map +1 -1
- package/package.json +9 -14
- package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
- package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
- package/src/api/users/entities/users.ts +1 -1
- package/src/api/users/index.ts +8 -8
- package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
- package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
- package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
- package/src/api/users/services/CredentialService.ts +7 -7
- package/src/api/users/services/IdentityService.ts +4 -4
- package/src/api/users/services/RegistrationService.spec.ts +25 -27
- package/src/api/users/services/RegistrationService.ts +38 -27
- package/src/api/users/services/SessionCrudService.ts +3 -3
- package/src/api/users/services/SessionService.spec.ts +3 -3
- package/src/api/users/services/SessionService.ts +28 -9
- package/src/api/users/services/UserService.ts +7 -7
- package/src/batch/providers/BatchProvider.ts +1 -2
- package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
- package/src/cli/assets/apiHelloControllerTs.ts +18 -0
- package/src/cli/assets/apiIndexTs.ts +16 -0
- package/src/cli/assets/claudeMd.ts +303 -0
- package/src/cli/assets/mainBrowserTs.ts +2 -2
- package/src/cli/assets/mainServerTs.ts +24 -0
- package/src/cli/assets/webAppRouterTs.ts +15 -0
- package/src/cli/assets/webHelloComponentTsx.ts +16 -0
- package/src/cli/assets/webIndexTs.ts +16 -0
- package/src/cli/commands/build.ts +41 -21
- package/src/cli/commands/db.ts +21 -18
- package/src/cli/commands/deploy.ts +17 -5
- package/src/cli/commands/dev.ts +13 -17
- package/src/cli/commands/format.ts +8 -2
- package/src/cli/commands/init.ts +74 -29
- package/src/cli/commands/lint.ts +8 -2
- package/src/cli/commands/test.ts +8 -2
- package/src/cli/commands/typecheck.ts +5 -1
- package/src/cli/commands/verify.ts +4 -2
- package/src/cli/services/AlephaCliUtils.ts +39 -600
- package/src/cli/services/PackageManagerUtils.ts +301 -0
- package/src/cli/services/ProjectScaffolder.ts +306 -0
- package/src/command/helpers/Runner.ts +15 -3
- package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
- package/src/core/index.shared.ts +1 -0
- package/src/core/index.ts +2 -0
- package/src/core/primitives/$hook.ts +6 -2
- package/src/core/primitives/$module.spec.ts +4 -0
- package/src/core/providers/AlsProvider.ts +1 -1
- package/src/core/providers/CodecManager.spec.ts +12 -6
- package/src/core/providers/CodecManager.ts +26 -6
- package/src/core/providers/EventManager.ts +169 -13
- package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
- package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
- package/src/core/providers/StateManager.spec.ts +27 -16
- package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
- package/src/email/providers/LocalEmailProvider.ts +52 -15
- package/src/email/providers/NodemailerEmailProvider.ts +167 -56
- package/src/file/errors/FileError.ts +7 -0
- package/src/file/index.ts +9 -1
- package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
- package/src/orm/index.browser.ts +1 -19
- package/src/orm/index.bun.ts +77 -0
- package/src/orm/index.shared-server.ts +22 -0
- package/src/orm/index.shared.ts +15 -0
- package/src/orm/index.ts +19 -39
- package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
- package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
- package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
- package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
- package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
- package/src/orm/services/Repository.ts +8 -0
- package/src/redis/index.bun.ts +35 -0
- package/src/redis/providers/BunRedisProvider.ts +12 -43
- package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
- package/src/redis/providers/NodeRedisProvider.ts +16 -34
- package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
- package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
- package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
- package/src/security/index.browser.ts +5 -0
- package/src/security/index.ts +90 -7
- package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
- package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
- package/src/security/primitives/$role.ts +5 -5
- package/src/security/primitives/$serviceAccount.spec.ts +5 -5
- package/src/security/primitives/$serviceAccount.ts +3 -3
- package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
- package/src/server/auth/primitives/$auth.ts +10 -10
- package/src/server/auth/primitives/$authCredentials.ts +3 -3
- package/src/server/auth/primitives/$authGithub.ts +3 -3
- package/src/server/auth/primitives/$authGoogle.ts +3 -3
- package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
- package/src/server/cache/providers/ServerCacheProvider.ts +1 -1
- package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
- package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
- package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
- package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
- package/src/server/core/providers/ServerProvider.ts +144 -21
- package/src/server/core/providers/ServerRouterProvider.ts +259 -115
- package/src/server/core/providers/ServerTimingProvider.ts +2 -2
- package/src/server/links/index.ts +1 -1
- package/src/server/links/providers/LinkProvider.ts +1 -1
- package/src/server/swagger/index.ts +1 -1
- package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
- package/src/sms/providers/LocalSmsProvider.ts +8 -7
- package/src/vite/helpers/boot.ts +28 -17
- package/src/vite/tasks/buildServer.ts +12 -1
- package/src/vite/tasks/devServer.ts +3 -1
- package/src/vite/tasks/generateCloudflare.ts +7 -0
- package/dist/server/security/index.browser.js +0 -13
- package/dist/server/security/index.browser.js.map +0 -1
- package/dist/server/security/index.d.ts +0 -173
- package/dist/server/security/index.d.ts.map +0 -1
- package/dist/server/security/index.js +0 -311
- package/dist/server/security/index.js.map +0 -1
- package/src/cli/assets/appRouterTs.ts +0 -9
- package/src/cli/assets/mainTs.ts +0 -13
- package/src/server/security/index.browser.ts +0 -10
- package/src/server/security/index.ts +0 -94
- /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
- /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
package/dist/core/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import cluster from "node:cluster";
|
|
3
3
|
import { cpus } from "node:os";
|
|
4
|
-
import { Compile } from "typebox/compile";
|
|
5
4
|
import { Type } from "typebox";
|
|
6
5
|
import Format from "typebox/format";
|
|
7
6
|
import * as Value from "typebox/value";
|
|
7
|
+
import { Compile } from "typebox/compile";
|
|
8
8
|
|
|
9
9
|
//#region ../../src/core/constants/KIND.ts
|
|
10
10
|
/**
|
|
@@ -313,7 +313,7 @@ var AlsProvider = class AlsProvider {
|
|
|
313
313
|
if (!this.als) return callback();
|
|
314
314
|
data.registry ??= /* @__PURE__ */ new Map();
|
|
315
315
|
data.context ??= this.createContextId();
|
|
316
|
-
return this.als.run(data, callback);
|
|
316
|
+
return this.als.run({ ...data }, callback);
|
|
317
317
|
}
|
|
318
318
|
exists() {
|
|
319
319
|
return !!this.get("context");
|
|
@@ -398,84 +398,6 @@ var JsonSchemaCodec = class extends SchemaCodec {
|
|
|
398
398
|
}
|
|
399
399
|
};
|
|
400
400
|
|
|
401
|
-
//#endregion
|
|
402
|
-
//#region ../../src/core/errors/TypeBoxError.ts
|
|
403
|
-
var TypeBoxError = class extends AlephaError {
|
|
404
|
-
name = "TypeBoxError";
|
|
405
|
-
cause;
|
|
406
|
-
value;
|
|
407
|
-
constructor(error) {
|
|
408
|
-
super(`Invalid input: ${error.message}${error.instancePath ? ` at ${error.instancePath}` : ""}`, { cause: error });
|
|
409
|
-
const params = error.params;
|
|
410
|
-
if (params?.requiredProperties) this.value = {
|
|
411
|
-
path: `/${params.requiredProperties[0]}`,
|
|
412
|
-
message: "must be defined"
|
|
413
|
-
};
|
|
414
|
-
else this.value = {
|
|
415
|
-
path: error.instancePath,
|
|
416
|
-
message: error.message
|
|
417
|
-
};
|
|
418
|
-
this.cause = error;
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
|
|
422
|
-
//#endregion
|
|
423
|
-
//#region ../../src/core/primitives/$hook.ts
|
|
424
|
-
/**
|
|
425
|
-
* Registers a new hook.
|
|
426
|
-
*
|
|
427
|
-
* ```ts
|
|
428
|
-
* import { $hook } from "alepha";
|
|
429
|
-
*
|
|
430
|
-
* class MyProvider {
|
|
431
|
-
* onStart = $hook({
|
|
432
|
-
* name: "start", // or "configure", "ready", "stop", ...
|
|
433
|
-
* handler: async (app) => {
|
|
434
|
-
* // await db.connect(); ...
|
|
435
|
-
* }
|
|
436
|
-
* });
|
|
437
|
-
* }
|
|
438
|
-
* ```
|
|
439
|
-
*
|
|
440
|
-
* Hooks are used to run async functions from all registered providers/services.
|
|
441
|
-
*
|
|
442
|
-
* You can't register a hook after the App has started.
|
|
443
|
-
*
|
|
444
|
-
* It's used under the hood by the `configure`, `start`, and `stop` methods.
|
|
445
|
-
* Some modules also use hooks to run their own logic. (e.g. `alepha/server`).
|
|
446
|
-
*
|
|
447
|
-
* You can create your own hooks by using module augmentation:
|
|
448
|
-
*
|
|
449
|
-
* ```ts
|
|
450
|
-
* declare module "alepha" {
|
|
451
|
-
*
|
|
452
|
-
* interface Hooks {
|
|
453
|
-
* "my:custom:hook": {
|
|
454
|
-
* arg1: string;
|
|
455
|
-
* }
|
|
456
|
-
* }
|
|
457
|
-
* }
|
|
458
|
-
*
|
|
459
|
-
* await alepha.events.emit("my:custom:hook", { arg1: "value" });
|
|
460
|
-
* ```
|
|
461
|
-
*
|
|
462
|
-
*/
|
|
463
|
-
const $hook = (options) => createPrimitive(HookPrimitive, options);
|
|
464
|
-
var HookPrimitive = class extends Primitive {
|
|
465
|
-
called = 0;
|
|
466
|
-
onInit() {
|
|
467
|
-
this.alepha.events.on(this.options.on, {
|
|
468
|
-
caller: this.config.service,
|
|
469
|
-
priority: this.options.priority,
|
|
470
|
-
callback: async (args) => {
|
|
471
|
-
this.called += 1;
|
|
472
|
-
await this.options.handler(args);
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
$hook[KIND] = HookPrimitive;
|
|
478
|
-
|
|
479
401
|
//#endregion
|
|
480
402
|
//#region ../../src/core/helpers/FileLike.ts
|
|
481
403
|
const isTypeFile = (value) => {
|
|
@@ -910,6 +832,322 @@ var TypeProvider = class TypeProvider {
|
|
|
910
832
|
};
|
|
911
833
|
const t = new TypeProvider();
|
|
912
834
|
|
|
835
|
+
//#endregion
|
|
836
|
+
//#region ../../src/core/providers/KeylessJsonSchemaCodec.ts
|
|
837
|
+
/**
|
|
838
|
+
* KeylessJsonSchemaCodec provides schema-driven JSON encoding without keys.
|
|
839
|
+
*
|
|
840
|
+
* It uses the schema to determine field order, allowing the encoded output
|
|
841
|
+
* to be a simple JSON array instead of an object with keys.
|
|
842
|
+
*
|
|
843
|
+
* Performance characteristics:
|
|
844
|
+
* - Encode: 0.94-1.53x vs JSON.stringify (faster for complex objects)
|
|
845
|
+
* - Decode: 1.76-2.00x vs JSON.parse
|
|
846
|
+
* - Size: 50-56% smaller than JSON
|
|
847
|
+
*/
|
|
848
|
+
var KeylessJsonSchemaCodec = class extends SchemaCodec {
|
|
849
|
+
cache = /* @__PURE__ */ new Map();
|
|
850
|
+
encoder = new TextEncoder();
|
|
851
|
+
decoder = new TextDecoder();
|
|
852
|
+
varCounter = 0;
|
|
853
|
+
/**
|
|
854
|
+
* Encode value to a keyless JSON string.
|
|
855
|
+
*/
|
|
856
|
+
encodeToString(schema, value) {
|
|
857
|
+
return this.getCodec(schema).encode(value);
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Encode value to binary (UTF-8 encoded keyless JSON).
|
|
861
|
+
*/
|
|
862
|
+
encodeToBinary(schema, value) {
|
|
863
|
+
return this.encoder.encode(this.encodeToString(schema, value));
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* Decode keyless JSON string or binary to value.
|
|
867
|
+
*/
|
|
868
|
+
decode(schema, value) {
|
|
869
|
+
if (value instanceof Uint8Array) {
|
|
870
|
+
const text = this.decoder.decode(value);
|
|
871
|
+
return this.getCodec(schema).decode(text);
|
|
872
|
+
}
|
|
873
|
+
if (typeof value === "string") return this.getCodec(schema).decode(value);
|
|
874
|
+
if (Array.isArray(value)) return this.reconstructObject(schema, value);
|
|
875
|
+
return value;
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Get a compiled codec for the given schema.
|
|
879
|
+
* Codecs are cached for reuse.
|
|
880
|
+
*/
|
|
881
|
+
getCodec(schema) {
|
|
882
|
+
let c = this.cache.get(schema);
|
|
883
|
+
if (!c) {
|
|
884
|
+
c = this.compile(schema);
|
|
885
|
+
this.cache.set(schema, c);
|
|
886
|
+
}
|
|
887
|
+
return c;
|
|
888
|
+
}
|
|
889
|
+
nextVar() {
|
|
890
|
+
return `_${this.varCounter++}`;
|
|
891
|
+
}
|
|
892
|
+
compile(schema) {
|
|
893
|
+
this.varCounter = 0;
|
|
894
|
+
const encBody = this.genEnc(schema, "v");
|
|
895
|
+
this.varCounter = 0;
|
|
896
|
+
const decBody = this.genDec(schema);
|
|
897
|
+
return {
|
|
898
|
+
encode: new Function("v", `return JSON.stringify(${encBody});`),
|
|
899
|
+
decode: new Function("s", `const a=JSON.parse(s);let i=0;${decBody.code}return ${decBody.result};`)
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
genEnc(schema, ve) {
|
|
903
|
+
if (t.schema.isString(schema) || t.schema.isNumber(schema) || t.schema.isInteger(schema) || t.schema.isBoolean(schema) || this.isEnum(schema)) return ve;
|
|
904
|
+
if (t.schema.isBigInt(schema)) return `${ve}+'n'`;
|
|
905
|
+
if (t.schema.isArray(schema)) {
|
|
906
|
+
const arrSchema = schema;
|
|
907
|
+
const itemEnc = this.genEnc(arrSchema.items, "e");
|
|
908
|
+
if (t.schema.isString(arrSchema.items) || t.schema.isNumber(arrSchema.items) || t.schema.isInteger(arrSchema.items) || t.schema.isBoolean(arrSchema.items)) return ve;
|
|
909
|
+
return `${ve}.map(e=>${itemEnc})`;
|
|
910
|
+
}
|
|
911
|
+
if (t.schema.isObject(schema)) {
|
|
912
|
+
const objSchema = schema;
|
|
913
|
+
const props = objSchema.properties;
|
|
914
|
+
const keys = Object.keys(props);
|
|
915
|
+
const req = new Set(objSchema.required || []);
|
|
916
|
+
const parts = [];
|
|
917
|
+
for (const k of keys) {
|
|
918
|
+
const ps = props[k];
|
|
919
|
+
const isOpt = !req.has(k) || t.schema.isOptional(ps);
|
|
920
|
+
const isNullable = this.isNullable(ps);
|
|
921
|
+
const inner = this.unwrap(ps);
|
|
922
|
+
const innerEnc = this.genEnc(inner, `${ve}.${k}`);
|
|
923
|
+
if (isOpt) parts.push(`${ve}.${k}!==undefined?${innerEnc}:null`);
|
|
924
|
+
else if (isNullable) parts.push(`${ve}.${k}!==null?${innerEnc}:null`);
|
|
925
|
+
else parts.push(innerEnc);
|
|
926
|
+
}
|
|
927
|
+
return `[${parts.join(",")}]`;
|
|
928
|
+
}
|
|
929
|
+
if (t.schema.isOptional(schema) || t.schema.isUnion(schema)) {
|
|
930
|
+
const inner = this.unwrap(schema);
|
|
931
|
+
const innerEnc = this.genEnc(inner, ve);
|
|
932
|
+
if (this.isNullable(schema)) return `${ve}!==null?${innerEnc}:null`;
|
|
933
|
+
return `${ve}!==undefined?${innerEnc}:null`;
|
|
934
|
+
}
|
|
935
|
+
return ve;
|
|
936
|
+
}
|
|
937
|
+
genDec(schema) {
|
|
938
|
+
const v = this.nextVar();
|
|
939
|
+
if (t.schema.isString(schema) || t.schema.isNumber(schema) || t.schema.isInteger(schema) || t.schema.isBoolean(schema) || this.isEnum(schema)) return {
|
|
940
|
+
code: "",
|
|
941
|
+
result: "a[i++]"
|
|
942
|
+
};
|
|
943
|
+
if (t.schema.isBigInt(schema)) return {
|
|
944
|
+
code: "",
|
|
945
|
+
result: "BigInt(a[i++].slice(0,-1))"
|
|
946
|
+
};
|
|
947
|
+
if (t.schema.isArray(schema)) {
|
|
948
|
+
const arrSchema = schema;
|
|
949
|
+
if (t.schema.isObject(arrSchema.items)) return {
|
|
950
|
+
code: "",
|
|
951
|
+
result: `a[i++].map(e=>${this.genDecFromValue(arrSchema.items, "e")})`
|
|
952
|
+
};
|
|
953
|
+
return {
|
|
954
|
+
code: "",
|
|
955
|
+
result: "a[i++]"
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
if (t.schema.isObject(schema)) {
|
|
959
|
+
const objSchema = schema;
|
|
960
|
+
const props = objSchema.properties;
|
|
961
|
+
const keys = Object.keys(props);
|
|
962
|
+
const req = new Set(objSchema.required || []);
|
|
963
|
+
let simple = true;
|
|
964
|
+
for (const k of keys) {
|
|
965
|
+
const ps = props[k];
|
|
966
|
+
const isOpt = !req.has(k) || t.schema.isOptional(ps);
|
|
967
|
+
const isNullable = this.isNullable(ps);
|
|
968
|
+
const inner = this.unwrap(ps);
|
|
969
|
+
if (isOpt || isNullable || t.schema.isObject(inner) || t.schema.isArray(inner)) {
|
|
970
|
+
simple = false;
|
|
971
|
+
break;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
if (simple) return {
|
|
975
|
+
code: "",
|
|
976
|
+
result: `{${keys.map((k) => `${k}:a[i++]`).join(",")}}`
|
|
977
|
+
};
|
|
978
|
+
let code = `const ${v}={};`;
|
|
979
|
+
for (const k of keys) {
|
|
980
|
+
const ps = props[k];
|
|
981
|
+
const isOpt = !req.has(k) || t.schema.isOptional(ps);
|
|
982
|
+
const isNullable = this.isNullable(ps);
|
|
983
|
+
const inner = this.unwrap(ps);
|
|
984
|
+
if (isOpt) {
|
|
985
|
+
const nested = this.genDecFromValue(inner, "t");
|
|
986
|
+
code += `{const t=a[i++];if(t!==null){${v}.${k}=${nested};}}`;
|
|
987
|
+
} else if (isNullable) {
|
|
988
|
+
const nested = this.genDecFromValue(inner, "t");
|
|
989
|
+
code += `{const t=a[i++];if(t===null){${v}.${k}=null;}else{${v}.${k}=${nested};}}`;
|
|
990
|
+
} else if (t.schema.isObject(inner)) {
|
|
991
|
+
const nested = this.genDecFromValue(inner, "a[i++]");
|
|
992
|
+
code += `${v}.${k}=${nested};`;
|
|
993
|
+
} else if (t.schema.isArray(inner)) {
|
|
994
|
+
const arrSchema = inner;
|
|
995
|
+
if (t.schema.isObject(arrSchema.items)) {
|
|
996
|
+
const itemTransform = this.genDecFromValue(arrSchema.items, "e");
|
|
997
|
+
code += `${v}.${k}=a[i++].map(e=>${itemTransform});`;
|
|
998
|
+
} else code += `${v}.${k}=a[i++];`;
|
|
999
|
+
} else code += `${v}.${k}=a[i++];`;
|
|
1000
|
+
}
|
|
1001
|
+
return {
|
|
1002
|
+
code,
|
|
1003
|
+
result: v
|
|
1004
|
+
};
|
|
1005
|
+
}
|
|
1006
|
+
if (t.schema.isOptional(schema) || t.schema.isUnion(schema)) {
|
|
1007
|
+
const inner = this.unwrap(schema);
|
|
1008
|
+
const innerDec = this.genDec(inner);
|
|
1009
|
+
return {
|
|
1010
|
+
code: `const ${v}t=a[i++];let ${v};if(${v}t===null){${v}=${this.isNullable(schema) ? "null" : "undefined"};}else{${innerDec.code.replace(/a\[i\+\+\]/g, `${v}t`)}${v}=${innerDec.result.replace(/a\[i\+\+\]/g, `${v}t`)};}`,
|
|
1011
|
+
result: v
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
return {
|
|
1015
|
+
code: "",
|
|
1016
|
+
result: "a[i++]"
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
genDecFromValue(schema, expr) {
|
|
1020
|
+
if (t.schema.isString(schema) || t.schema.isNumber(schema) || t.schema.isInteger(schema) || t.schema.isBoolean(schema) || this.isEnum(schema)) return expr;
|
|
1021
|
+
if (t.schema.isBigInt(schema)) return `BigInt(${expr}.slice(0,-1))`;
|
|
1022
|
+
if (t.schema.isArray(schema)) return expr;
|
|
1023
|
+
if (t.schema.isObject(schema)) {
|
|
1024
|
+
const props = schema.properties;
|
|
1025
|
+
const keys = Object.keys(props);
|
|
1026
|
+
const v = this.nextVar();
|
|
1027
|
+
return `((${v}=${expr})=>({${keys.map((k, idx) => {
|
|
1028
|
+
const inner = this.unwrap(props[k]);
|
|
1029
|
+
const innerExpr = `${v}[${idx}]`;
|
|
1030
|
+
if (t.schema.isObject(inner)) return `${k}:${this.genDecFromValue(inner, innerExpr)}`;
|
|
1031
|
+
if (t.schema.isBigInt(inner)) return `${k}:BigInt(${innerExpr}.slice(0,-1))`;
|
|
1032
|
+
return `${k}:${innerExpr}`;
|
|
1033
|
+
}).join(",")}}))()`;
|
|
1034
|
+
}
|
|
1035
|
+
return expr;
|
|
1036
|
+
}
|
|
1037
|
+
isEnum(schema) {
|
|
1038
|
+
return "enum" in schema && Array.isArray(schema.enum) && (schema.enum?.length ?? 0) > 0;
|
|
1039
|
+
}
|
|
1040
|
+
isNullable(schema) {
|
|
1041
|
+
if (!t.schema.isUnion(schema)) return false;
|
|
1042
|
+
return schema.anyOf?.some((s) => t.schema.isNull(s)) ?? false;
|
|
1043
|
+
}
|
|
1044
|
+
unwrap(schema) {
|
|
1045
|
+
if ("anyOf" in schema && Array.isArray(schema.anyOf)) return schema.anyOf.find((s) => !t.schema.isNull(s)) || schema;
|
|
1046
|
+
return schema;
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Reconstruct an object from a parsed array (for when input is already parsed).
|
|
1050
|
+
*/
|
|
1051
|
+
reconstructObject(schema, arr) {
|
|
1052
|
+
if (!t.schema.isObject(schema)) return arr;
|
|
1053
|
+
const props = schema.properties;
|
|
1054
|
+
const keys = Object.keys(props);
|
|
1055
|
+
const result = {};
|
|
1056
|
+
let i = 0;
|
|
1057
|
+
for (const k of keys) {
|
|
1058
|
+
const ps = props[k];
|
|
1059
|
+
const isOpt = t.schema.isOptional(ps);
|
|
1060
|
+
const isNullable = this.isNullable(ps);
|
|
1061
|
+
const inner = this.unwrap(ps);
|
|
1062
|
+
const val = arr[i++];
|
|
1063
|
+
if (isOpt) {
|
|
1064
|
+
if (val !== null) result[k] = t.schema.isObject(inner) ? this.reconstructObject(inner, val) : val;
|
|
1065
|
+
} else if (isNullable) result[k] = val === null ? null : t.schema.isObject(inner) ? this.reconstructObject(inner, val) : val;
|
|
1066
|
+
else result[k] = t.schema.isObject(inner) ? this.reconstructObject(inner, val) : val;
|
|
1067
|
+
}
|
|
1068
|
+
return result;
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
//#endregion
|
|
1073
|
+
//#region ../../src/core/errors/TypeBoxError.ts
|
|
1074
|
+
var TypeBoxError = class extends AlephaError {
|
|
1075
|
+
name = "TypeBoxError";
|
|
1076
|
+
cause;
|
|
1077
|
+
value;
|
|
1078
|
+
constructor(error) {
|
|
1079
|
+
super(`Invalid input: ${error.message}${error.instancePath ? ` at ${error.instancePath}` : ""}`, { cause: error });
|
|
1080
|
+
const params = error.params;
|
|
1081
|
+
if (params?.requiredProperties) this.value = {
|
|
1082
|
+
path: `/${params.requiredProperties[0]}`,
|
|
1083
|
+
message: "must be defined"
|
|
1084
|
+
};
|
|
1085
|
+
else this.value = {
|
|
1086
|
+
path: error.instancePath,
|
|
1087
|
+
message: error.message
|
|
1088
|
+
};
|
|
1089
|
+
this.cause = error;
|
|
1090
|
+
}
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
//#endregion
|
|
1094
|
+
//#region ../../src/core/primitives/$hook.ts
|
|
1095
|
+
/**
|
|
1096
|
+
* Registers a new hook.
|
|
1097
|
+
*
|
|
1098
|
+
* ```ts
|
|
1099
|
+
* import { $hook } from "alepha";
|
|
1100
|
+
*
|
|
1101
|
+
* class MyProvider {
|
|
1102
|
+
* onStart = $hook({
|
|
1103
|
+
* name: "start", // or "configure", "ready", "stop", ...
|
|
1104
|
+
* handler: async (app) => {
|
|
1105
|
+
* // await db.connect(); ...
|
|
1106
|
+
* }
|
|
1107
|
+
* });
|
|
1108
|
+
* }
|
|
1109
|
+
* ```
|
|
1110
|
+
*
|
|
1111
|
+
* Hooks are used to run async functions from all registered providers/services.
|
|
1112
|
+
*
|
|
1113
|
+
* You can't register a hook after the App has started.
|
|
1114
|
+
*
|
|
1115
|
+
* It's used under the hood by the `configure`, `start`, and `stop` methods.
|
|
1116
|
+
* Some modules also use hooks to run their own logic. (e.g. `alepha/server`).
|
|
1117
|
+
*
|
|
1118
|
+
* You can create your own hooks by using module augmentation:
|
|
1119
|
+
*
|
|
1120
|
+
* ```ts
|
|
1121
|
+
* declare module "alepha" {
|
|
1122
|
+
*
|
|
1123
|
+
* interface Hooks {
|
|
1124
|
+
* "my:custom:hook": {
|
|
1125
|
+
* arg1: string;
|
|
1126
|
+
* }
|
|
1127
|
+
* }
|
|
1128
|
+
* }
|
|
1129
|
+
*
|
|
1130
|
+
* await alepha.events.emit("my:custom:hook", { arg1: "value" });
|
|
1131
|
+
* ```
|
|
1132
|
+
*
|
|
1133
|
+
*/
|
|
1134
|
+
const $hook = (options) => createPrimitive(HookPrimitive, options);
|
|
1135
|
+
var HookPrimitive = class extends Primitive {
|
|
1136
|
+
called = 0;
|
|
1137
|
+
onInit() {
|
|
1138
|
+
const handler = this.options.handler;
|
|
1139
|
+
this.alepha.events.on(this.options.on, {
|
|
1140
|
+
caller: this.config.service,
|
|
1141
|
+
priority: this.options.priority,
|
|
1142
|
+
callback: (args) => {
|
|
1143
|
+
this.called += 1;
|
|
1144
|
+
return handler(args);
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
};
|
|
1149
|
+
$hook[KIND] = HookPrimitive;
|
|
1150
|
+
|
|
913
1151
|
//#endregion
|
|
914
1152
|
//#region ../../src/core/providers/SchemaValidator.ts
|
|
915
1153
|
var SchemaValidator = class {
|
|
@@ -1004,19 +1242,26 @@ var SchemaValidator = class {
|
|
|
1004
1242
|
var CodecManager = class {
|
|
1005
1243
|
codecs = /* @__PURE__ */ new Map();
|
|
1006
1244
|
jsonCodec = $inject(JsonSchemaCodec);
|
|
1245
|
+
keylessCodec = $inject(KeylessJsonSchemaCodec);
|
|
1007
1246
|
schemaValidator = $inject(SchemaValidator);
|
|
1008
1247
|
default = "json";
|
|
1009
1248
|
constructor() {
|
|
1010
|
-
this.register(
|
|
1249
|
+
this.register({
|
|
1250
|
+
name: "json",
|
|
1251
|
+
codec: this.jsonCodec,
|
|
1252
|
+
default: true
|
|
1253
|
+
});
|
|
1254
|
+
this.register({
|
|
1255
|
+
name: "keyless",
|
|
1256
|
+
codec: this.keylessCodec
|
|
1257
|
+
});
|
|
1011
1258
|
}
|
|
1012
1259
|
/**
|
|
1013
1260
|
* Register a new codec format.
|
|
1014
|
-
*
|
|
1015
|
-
* @param name - The name of the codec (e.g., 'json', 'protobuf')
|
|
1016
|
-
* @param codec - The codec implementation
|
|
1017
1261
|
*/
|
|
1018
|
-
register(
|
|
1019
|
-
this.codecs.set(name, codec);
|
|
1262
|
+
register(opts) {
|
|
1263
|
+
this.codecs.set(opts.name, opts.codec);
|
|
1264
|
+
if (opts.default) this.default = opts.name;
|
|
1020
1265
|
}
|
|
1021
1266
|
/**
|
|
1022
1267
|
* Get a specific codec by name.
|
|
@@ -1095,35 +1340,110 @@ var EventManager = class {
|
|
|
1095
1340
|
};
|
|
1096
1341
|
}
|
|
1097
1342
|
/**
|
|
1343
|
+
* Compiles an event into an optimized executor function.
|
|
1344
|
+
*
|
|
1345
|
+
* Call this after all hooks are registered (e.g., after Alepha.start()).
|
|
1346
|
+
* The returned function checks each hook's return value and awaits promises.
|
|
1347
|
+
* Returns undefined if all hooks are sync, or a Promise if any hook returns one.
|
|
1348
|
+
*
|
|
1349
|
+
* @example
|
|
1350
|
+
* ```ts
|
|
1351
|
+
* // At startup (after hooks are registered)
|
|
1352
|
+
* const onRequest = alepha.events.compile("server:onRequest", { catch: true });
|
|
1353
|
+
*
|
|
1354
|
+
* // In hot path - only await if promise returned
|
|
1355
|
+
* const result = onRequest({ request, route });
|
|
1356
|
+
* if (result) await result;
|
|
1357
|
+
* ```
|
|
1358
|
+
*/
|
|
1359
|
+
compile(event, options = {}) {
|
|
1360
|
+
const hooks = this.events[event];
|
|
1361
|
+
if (!hooks || hooks.length === 0) return () => {};
|
|
1362
|
+
const catchErrors = options.catch ?? false;
|
|
1363
|
+
const log = this.log;
|
|
1364
|
+
const runRemainingAsync = async (startIndex, payload) => {
|
|
1365
|
+
for (let i = startIndex; i < hooks.length; i++) {
|
|
1366
|
+
const hook = hooks[i];
|
|
1367
|
+
try {
|
|
1368
|
+
const result = hook.callback(payload);
|
|
1369
|
+
if (result && typeof result === "object" && "then" in result) if (catchErrors) await result.catch((error) => {
|
|
1370
|
+
log?.error(`${String(event)}(${hook.caller?.name ?? "unknown"}) ERROR`, error);
|
|
1371
|
+
});
|
|
1372
|
+
else await result;
|
|
1373
|
+
} catch (error) {
|
|
1374
|
+
if (catchErrors) log?.error(`${String(event)}(${hook.caller?.name ?? "unknown"}) ERROR`, error);
|
|
1375
|
+
else throw error;
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
};
|
|
1379
|
+
return (payload) => {
|
|
1380
|
+
for (let i = 0; i < hooks.length; i++) {
|
|
1381
|
+
const hook = hooks[i];
|
|
1382
|
+
try {
|
|
1383
|
+
const result = hook.callback(payload);
|
|
1384
|
+
if (result && typeof result === "object" && "then" in result) {
|
|
1385
|
+
if (catchErrors) return result.catch((error) => {
|
|
1386
|
+
log?.error(`${String(event)}(${hook.caller?.name ?? "unknown"}) ERROR`, error);
|
|
1387
|
+
}).then(() => runRemainingAsync(i + 1, payload));
|
|
1388
|
+
return result.then(() => runRemainingAsync(i + 1, payload));
|
|
1389
|
+
}
|
|
1390
|
+
} catch (error) {
|
|
1391
|
+
if (catchErrors) log?.error(`${String(event)}(${hook.caller?.name ?? "unknown"}) ERROR`, error);
|
|
1392
|
+
else throw error;
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1098
1398
|
* Emits the specified event with the given payload.
|
|
1399
|
+
*
|
|
1400
|
+
* For hot paths (like HTTP request handling), use compile() instead
|
|
1401
|
+
* to get an optimized executor.
|
|
1099
1402
|
*/
|
|
1100
1403
|
async emit(func, payload, options = {}) {
|
|
1404
|
+
const events = this.events[func];
|
|
1405
|
+
if (!events || events.length === 0) return;
|
|
1406
|
+
if (events.length === 1 && !options.log && !options.reverse) {
|
|
1407
|
+
const hook = events[0];
|
|
1408
|
+
try {
|
|
1409
|
+
const result = hook.callback(payload);
|
|
1410
|
+
if (result && typeof result === "object" && "then" in result) await result;
|
|
1411
|
+
} catch (error) {
|
|
1412
|
+
if (options.catch) {
|
|
1413
|
+
this.log?.error(`${String(func)}(${hook.caller?.name ?? "unknown"}) ERROR`, error);
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
throw error;
|
|
1417
|
+
}
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1101
1420
|
const ctx = {};
|
|
1102
1421
|
if (options.log) {
|
|
1103
|
-
ctx.now =
|
|
1104
|
-
this.log?.trace(`${func} ...`);
|
|
1422
|
+
ctx.now = performance.now();
|
|
1423
|
+
this.log?.trace(`${String(func)} ...`);
|
|
1105
1424
|
}
|
|
1106
|
-
let
|
|
1107
|
-
if (options.reverse)
|
|
1108
|
-
for (const hook of
|
|
1425
|
+
let eventList = events;
|
|
1426
|
+
if (options.reverse) eventList = events.toReversed();
|
|
1427
|
+
for (const hook of eventList) {
|
|
1109
1428
|
const name = hook.caller?.name ?? "unknown";
|
|
1110
1429
|
if (options.log) {
|
|
1111
|
-
ctx.now2 =
|
|
1112
|
-
this.log?.trace(`${func}(${name}) ...`);
|
|
1430
|
+
ctx.now2 = performance.now();
|
|
1431
|
+
this.log?.trace(`${String(func)}(${name}) ...`);
|
|
1113
1432
|
}
|
|
1114
1433
|
try {
|
|
1115
|
-
|
|
1434
|
+
const result = hook.callback(payload);
|
|
1435
|
+
if (result && typeof result === "object" && "then" in result) await result;
|
|
1116
1436
|
} catch (error) {
|
|
1117
1437
|
if (options.catch) {
|
|
1118
|
-
this.log?.error(`${func}(${name}) ERROR`, error);
|
|
1438
|
+
this.log?.error(`${String(func)}(${name}) ERROR`, error);
|
|
1119
1439
|
continue;
|
|
1120
1440
|
}
|
|
1121
|
-
if (options.log) throw new AlephaError(`Failed during '${func}()' hook for service: ${name}`, { cause: error });
|
|
1441
|
+
if (options.log) throw new AlephaError(`Failed during '${String(func)}()' hook for service: ${name}`, { cause: error });
|
|
1122
1442
|
throw error;
|
|
1123
1443
|
}
|
|
1124
|
-
if (options.log) this.log?.debug(`${func}(${name}) OK [${
|
|
1444
|
+
if (options.log) this.log?.debug(`${String(func)}(${name}) OK [${(performance.now() - ctx.now2).toFixed(1)}ms]`);
|
|
1125
1445
|
}
|
|
1126
|
-
if (options.log) this.log?.debug(`${func} OK [${
|
|
1446
|
+
if (options.log) this.log?.debug(`${String(func)} OK [${(performance.now() - ctx.now).toFixed(1)}ms]`);
|
|
1127
1447
|
}
|
|
1128
1448
|
};
|
|
1129
1449
|
|
|
@@ -2321,6 +2641,7 @@ const AlephaCore = $module({
|
|
|
2321
2641
|
AlsProvider,
|
|
2322
2642
|
Json,
|
|
2323
2643
|
JsonSchemaCodec,
|
|
2644
|
+
KeylessJsonSchemaCodec,
|
|
2324
2645
|
SchemaCodec,
|
|
2325
2646
|
SchemaValidator
|
|
2326
2647
|
],
|
|
@@ -2408,5 +2729,5 @@ const withCluster = (entry, opts) => {
|
|
|
2408
2729
|
};
|
|
2409
2730
|
|
|
2410
2731
|
//#endregion
|
|
2411
|
-
export { $atom, $context, $env, $hook, $inject, $module, $use, Alepha, AlephaCore, AlephaError, AlsProvider, AppNotStartedError, Atom, CircularDependencyError, CodecManager, ContainerLockedError, EventManager, Format, HookPrimitive, InjectPrimitive, JsonSchemaCodec, KIND, Module, OPTIONS, Primitive, SchemaCodec, StateManager, TooLateSubstitutionError, Type, TypeBoxError, TypeGuard, TypeProvider, Value, createPagination, createPrimitive, isClass, isFileLike, isTypeFile, isUUID, jsonSchemaToTypeBox, pageMetadataSchema, pageQuerySchema, pageSchema, run, t };
|
|
2732
|
+
export { $atom, $context, $env, $hook, $inject, $module, $use, Alepha, AlephaCore, AlephaError, AlsProvider, AppNotStartedError, Atom, CircularDependencyError, CodecManager, ContainerLockedError, EventManager, Format, HookPrimitive, InjectPrimitive, JsonSchemaCodec, KIND, KeylessJsonSchemaCodec, Module, OPTIONS, Primitive, SchemaCodec, StateManager, TooLateSubstitutionError, Type, TypeBoxError, TypeGuard, TypeProvider, Value, createPagination, createPrimitive, isClass, isFileLike, isTypeFile, isUUID, jsonSchemaToTypeBox, pageMetadataSchema, pageQuerySchema, pageSchema, run, t };
|
|
2412
2733
|
//# sourceMappingURL=index.js.map
|