@devbro/pashmak 0.1.49 → 0.1.52
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/DatabaseServiceProvider.d.mts +2 -2
- package/dist/DatabaseServiceProvider.mjs +5 -1
- package/dist/DatabaseServiceProvider.mjs.map +1 -1
- package/dist/app/console/generate/GenerateApiDocsCommand.mjs +5 -5
- package/dist/app/console/generate/GenerateApiDocsCommand.mjs.map +1 -1
- package/dist/app/console/project/base_project/src/config/default.mts.tpl +16 -1
- package/dist/bin/DatabaseServiceProvider.cjs +4 -0
- package/dist/bin/app/console/DefaultCommand.cjs +97 -58
- package/dist/bin/app/console/KeyGenerateCommand.cjs +97 -58
- package/dist/bin/app/console/StartCommand.cjs +97 -58
- package/dist/bin/app/console/generate/GenerateApiDocsCommand.cjs +102 -63
- package/dist/bin/app/console/generate/GenerateControllerCommand.cjs +97 -58
- package/dist/bin/app/console/generate/index.cjs +102 -63
- package/dist/bin/app/console/index.cjs +102 -63
- package/dist/bin/app/console/migrate/GenerateMigrateCommand.cjs +97 -58
- package/dist/bin/app/console/migrate/MigrateCommand.cjs +97 -58
- package/dist/bin/app/console/migrate/MigrateRollbackCommand.cjs +97 -58
- package/dist/bin/app/console/migrate/index.cjs +97 -58
- package/dist/bin/app/console/queue/GenerateQueueMigrateCommand.cjs +97 -58
- package/dist/bin/cache.cjs +97 -58
- package/dist/bin/facades.cjs +97 -58
- package/dist/bin/factories.cjs +97 -58
- package/dist/bin/http.cjs +97 -58
- package/dist/bin/index.cjs +106 -63
- package/dist/bin/middlewares.cjs +97 -58
- package/dist/bin/queue.cjs +97 -58
- package/dist/facades.d.mts +6 -6
- package/dist/facades.mjs +97 -58
- package/dist/facades.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -689,27 +689,58 @@ import_neko_storage.StorageProviderFactory.register("sftp", (opt) => {
|
|
|
689
689
|
// src/facades.mts
|
|
690
690
|
var import_neko_cache2 = require("@devbro/neko-cache");
|
|
691
691
|
var import_neko_queue2 = require("@devbro/neko-queue");
|
|
692
|
+
function wrapSingletonWithAccessors(singletonFn) {
|
|
693
|
+
let methodsInitialized = false;
|
|
694
|
+
const initializeMethods = /* @__PURE__ */ __name(() => {
|
|
695
|
+
if (methodsInitialized) return;
|
|
696
|
+
const defaultInstance = singletonFn();
|
|
697
|
+
const prototype = Object.getPrototypeOf(defaultInstance);
|
|
698
|
+
const methodNames = Object.getOwnPropertyNames(prototype).filter(
|
|
699
|
+
(name) => name !== "constructor" && typeof prototype[name] === "function"
|
|
700
|
+
);
|
|
701
|
+
for (const methodName of methodNames) {
|
|
702
|
+
singletonFn[methodName] = (...args) => {
|
|
703
|
+
const instance = singletonFn();
|
|
704
|
+
return instance[methodName](...args);
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
methodsInitialized = true;
|
|
708
|
+
}, "initializeMethods");
|
|
709
|
+
return new Proxy(singletonFn, {
|
|
710
|
+
get(target, prop, receiver) {
|
|
711
|
+
if (typeof prop === "string" && !Reflect.has(target, prop)) {
|
|
712
|
+
initializeMethods();
|
|
713
|
+
}
|
|
714
|
+
return Reflect.get(target, prop, receiver);
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
__name(wrapSingletonWithAccessors, "wrapSingletonWithAccessors");
|
|
692
719
|
var router = (0, import_neko_helper3.createSingleton)(() => new Router());
|
|
693
|
-
var scheduler = (
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
720
|
+
var scheduler = wrapSingletonWithAccessors(
|
|
721
|
+
(0, import_neko_helper3.createSingleton)(() => {
|
|
722
|
+
const rc = new import_neko_scheduler.Scheduler();
|
|
723
|
+
rc.setErrorHandler((err, job) => {
|
|
724
|
+
logger().error({
|
|
725
|
+
msg: "Scheduled job error",
|
|
726
|
+
err,
|
|
727
|
+
job_name: job.getName()
|
|
728
|
+
});
|
|
700
729
|
});
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
730
|
+
return rc;
|
|
731
|
+
})
|
|
732
|
+
);
|
|
704
733
|
var db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context3.ctx)().getOrThrow(["database", label]), "db");
|
|
705
|
-
var storage = (
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
734
|
+
var storage = wrapSingletonWithAccessors(
|
|
735
|
+
(0, import_neko_helper3.createSingleton)((label = "default") => {
|
|
736
|
+
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
737
|
+
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
738
|
+
storage_config.provider,
|
|
739
|
+
storage_config.config
|
|
740
|
+
);
|
|
741
|
+
return new import_neko_storage2.Storage(provider);
|
|
742
|
+
})
|
|
743
|
+
);
|
|
713
744
|
var cli = (0, import_neko_helper3.createSingleton)(() => {
|
|
714
745
|
const [node, app, ...args] = process.argv;
|
|
715
746
|
return new import_clipanion.Cli({
|
|
@@ -724,46 +755,54 @@ var httpServer = (0, import_neko_helper3.createSingleton)(() => {
|
|
|
724
755
|
server.setRouter(router());
|
|
725
756
|
return server;
|
|
726
757
|
});
|
|
727
|
-
var logger = (
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
mailer_config.config
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
queue_config.
|
|
752
|
-
queue_config
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
});
|
|
758
|
+
var logger = wrapSingletonWithAccessors(
|
|
759
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
760
|
+
const logger_config = import_neko_config.config.get(["loggers", label].join("."));
|
|
761
|
+
const rc = new import_neko_logger.Logger(logger_config);
|
|
762
|
+
rc.setExtrasFunction((message) => {
|
|
763
|
+
message.requestId = (0, import_neko_context3.ctxSafe)()?.get("requestId") || "N/A";
|
|
764
|
+
return message;
|
|
765
|
+
});
|
|
766
|
+
return rc;
|
|
767
|
+
})
|
|
768
|
+
);
|
|
769
|
+
var mailer = wrapSingletonWithAccessors(
|
|
770
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
771
|
+
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
772
|
+
const provider = import_neko_mailer2.MailerProviderFactory.create(
|
|
773
|
+
mailer_config.provider,
|
|
774
|
+
mailer_config.config
|
|
775
|
+
);
|
|
776
|
+
const rc = new import_neko_mailer2.Mailer(provider);
|
|
777
|
+
return rc;
|
|
778
|
+
})
|
|
779
|
+
);
|
|
780
|
+
var queue = wrapSingletonWithAccessors(
|
|
781
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
782
|
+
const queue_config = import_neko_config.config.get(["queues", label].join("."));
|
|
783
|
+
if (!queue_config) {
|
|
784
|
+
throw new Error(`Queue configuration for '${label}' not found`);
|
|
785
|
+
}
|
|
786
|
+
const provider = import_neko_queue2.QueueTransportFactory.create(
|
|
787
|
+
queue_config.provider,
|
|
788
|
+
queue_config.config
|
|
789
|
+
);
|
|
790
|
+
return new import_neko_queue2.QueueConnection(provider);
|
|
791
|
+
})
|
|
792
|
+
);
|
|
793
|
+
var cache = wrapSingletonWithAccessors(
|
|
794
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
795
|
+
const cache_config = import_neko_config.config.get(["caches", label].join("."));
|
|
796
|
+
if (!cache_config) {
|
|
797
|
+
throw new Error(`Cache configuration for '${label}' not found`);
|
|
798
|
+
}
|
|
799
|
+
const provider = CacheProviderFactory.create(
|
|
800
|
+
cache_config.provider,
|
|
801
|
+
cache_config.config
|
|
802
|
+
);
|
|
803
|
+
return new import_neko_cache2.Cache(provider);
|
|
804
|
+
})
|
|
805
|
+
);
|
|
767
806
|
|
|
768
807
|
// src/app/console/StartCommand.mts
|
|
769
808
|
var import_neko_sql = require("@devbro/neko-sql");
|
|
@@ -687,27 +687,58 @@ import_neko_storage.StorageProviderFactory.register("sftp", (opt) => {
|
|
|
687
687
|
// src/facades.mts
|
|
688
688
|
var import_neko_cache2 = require("@devbro/neko-cache");
|
|
689
689
|
var import_neko_queue2 = require("@devbro/neko-queue");
|
|
690
|
+
function wrapSingletonWithAccessors(singletonFn) {
|
|
691
|
+
let methodsInitialized = false;
|
|
692
|
+
const initializeMethods = /* @__PURE__ */ __name(() => {
|
|
693
|
+
if (methodsInitialized) return;
|
|
694
|
+
const defaultInstance = singletonFn();
|
|
695
|
+
const prototype = Object.getPrototypeOf(defaultInstance);
|
|
696
|
+
const methodNames = Object.getOwnPropertyNames(prototype).filter(
|
|
697
|
+
(name) => name !== "constructor" && typeof prototype[name] === "function"
|
|
698
|
+
);
|
|
699
|
+
for (const methodName of methodNames) {
|
|
700
|
+
singletonFn[methodName] = (...args) => {
|
|
701
|
+
const instance = singletonFn();
|
|
702
|
+
return instance[methodName](...args);
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
methodsInitialized = true;
|
|
706
|
+
}, "initializeMethods");
|
|
707
|
+
return new Proxy(singletonFn, {
|
|
708
|
+
get(target, prop, receiver) {
|
|
709
|
+
if (typeof prop === "string" && !Reflect.has(target, prop)) {
|
|
710
|
+
initializeMethods();
|
|
711
|
+
}
|
|
712
|
+
return Reflect.get(target, prop, receiver);
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
__name(wrapSingletonWithAccessors, "wrapSingletonWithAccessors");
|
|
690
717
|
var router = (0, import_neko_helper3.createSingleton)(() => new Router());
|
|
691
|
-
var scheduler = (
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
718
|
+
var scheduler = wrapSingletonWithAccessors(
|
|
719
|
+
(0, import_neko_helper3.createSingleton)(() => {
|
|
720
|
+
const rc = new import_neko_scheduler.Scheduler();
|
|
721
|
+
rc.setErrorHandler((err, job) => {
|
|
722
|
+
logger().error({
|
|
723
|
+
msg: "Scheduled job error",
|
|
724
|
+
err,
|
|
725
|
+
job_name: job.getName()
|
|
726
|
+
});
|
|
698
727
|
});
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
728
|
+
return rc;
|
|
729
|
+
})
|
|
730
|
+
);
|
|
702
731
|
var db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context3.ctx)().getOrThrow(["database", label]), "db");
|
|
703
|
-
var storage = (
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
732
|
+
var storage = wrapSingletonWithAccessors(
|
|
733
|
+
(0, import_neko_helper3.createSingleton)((label = "default") => {
|
|
734
|
+
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
735
|
+
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
736
|
+
storage_config.provider,
|
|
737
|
+
storage_config.config
|
|
738
|
+
);
|
|
739
|
+
return new import_neko_storage2.Storage(provider);
|
|
740
|
+
})
|
|
741
|
+
);
|
|
711
742
|
var cli = (0, import_neko_helper3.createSingleton)(() => {
|
|
712
743
|
const [node, app, ...args] = process.argv;
|
|
713
744
|
return new import_clipanion.Cli({
|
|
@@ -722,46 +753,54 @@ var httpServer = (0, import_neko_helper3.createSingleton)(() => {
|
|
|
722
753
|
server.setRouter(router());
|
|
723
754
|
return server;
|
|
724
755
|
});
|
|
725
|
-
var logger = (
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
mailer_config.config
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
queue_config.
|
|
750
|
-
queue_config
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
});
|
|
756
|
+
var logger = wrapSingletonWithAccessors(
|
|
757
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
758
|
+
const logger_config = import_neko_config.config.get(["loggers", label].join("."));
|
|
759
|
+
const rc = new import_neko_logger.Logger(logger_config);
|
|
760
|
+
rc.setExtrasFunction((message) => {
|
|
761
|
+
message.requestId = (0, import_neko_context3.ctxSafe)()?.get("requestId") || "N/A";
|
|
762
|
+
return message;
|
|
763
|
+
});
|
|
764
|
+
return rc;
|
|
765
|
+
})
|
|
766
|
+
);
|
|
767
|
+
var mailer = wrapSingletonWithAccessors(
|
|
768
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
769
|
+
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
770
|
+
const provider = import_neko_mailer2.MailerProviderFactory.create(
|
|
771
|
+
mailer_config.provider,
|
|
772
|
+
mailer_config.config
|
|
773
|
+
);
|
|
774
|
+
const rc = new import_neko_mailer2.Mailer(provider);
|
|
775
|
+
return rc;
|
|
776
|
+
})
|
|
777
|
+
);
|
|
778
|
+
var queue = wrapSingletonWithAccessors(
|
|
779
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
780
|
+
const queue_config = import_neko_config.config.get(["queues", label].join("."));
|
|
781
|
+
if (!queue_config) {
|
|
782
|
+
throw new Error(`Queue configuration for '${label}' not found`);
|
|
783
|
+
}
|
|
784
|
+
const provider = import_neko_queue2.QueueTransportFactory.create(
|
|
785
|
+
queue_config.provider,
|
|
786
|
+
queue_config.config
|
|
787
|
+
);
|
|
788
|
+
return new import_neko_queue2.QueueConnection(provider);
|
|
789
|
+
})
|
|
790
|
+
);
|
|
791
|
+
var cache = wrapSingletonWithAccessors(
|
|
792
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
793
|
+
const cache_config = import_neko_config.config.get(["caches", label].join("."));
|
|
794
|
+
if (!cache_config) {
|
|
795
|
+
throw new Error(`Cache configuration for '${label}' not found`);
|
|
796
|
+
}
|
|
797
|
+
const provider = CacheProviderFactory.create(
|
|
798
|
+
cache_config.provider,
|
|
799
|
+
cache_config.config
|
|
800
|
+
);
|
|
801
|
+
return new import_neko_cache2.Cache(provider);
|
|
802
|
+
})
|
|
803
|
+
);
|
|
765
804
|
|
|
766
805
|
// src/app/console/generate/GenerateApiDocsCommand.mts
|
|
767
806
|
var import_clipanion2 = require("clipanion");
|
|
@@ -778,7 +817,7 @@ var GenerateApiDocsCommand = class extends import_clipanion2.Command {
|
|
|
778
817
|
static {
|
|
779
818
|
__name(this, "GenerateApiDocsCommand");
|
|
780
819
|
}
|
|
781
|
-
static paths = [[`generate`, `
|
|
820
|
+
static paths = [[`generate`, `apidocs`]];
|
|
782
821
|
static usage = import_clipanion2.Command.Usage({
|
|
783
822
|
category: `Generate`,
|
|
784
823
|
description: `Generate OpenAPI documentation from routes`,
|
|
@@ -818,14 +857,14 @@ api_docs: {
|
|
|
818
857
|
examples: [
|
|
819
858
|
[
|
|
820
859
|
`Generate from routes`,
|
|
821
|
-
`$0 generate
|
|
860
|
+
`$0 generate apidocs generate-from-routes --output path/to/output.json`
|
|
822
861
|
],
|
|
823
862
|
[
|
|
824
863
|
`Generate base spec`,
|
|
825
|
-
`$0 generate
|
|
864
|
+
`$0 generate apidocs generate-base --output path/to/output.json`
|
|
826
865
|
],
|
|
827
|
-
[`Merge files`, `$0 generate
|
|
828
|
-
[`Show help`, `$0 generate
|
|
866
|
+
[`Merge files`, `$0 generate apidocs merge-files`],
|
|
867
|
+
[`Show help`, `$0 generate apidocs --help`]
|
|
829
868
|
]
|
|
830
869
|
});
|
|
831
870
|
subcommand = import_clipanion2.Option.String({ required: false });
|
|
@@ -687,27 +687,58 @@ import_neko_storage.StorageProviderFactory.register("sftp", (opt) => {
|
|
|
687
687
|
// src/facades.mts
|
|
688
688
|
var import_neko_cache2 = require("@devbro/neko-cache");
|
|
689
689
|
var import_neko_queue2 = require("@devbro/neko-queue");
|
|
690
|
+
function wrapSingletonWithAccessors(singletonFn) {
|
|
691
|
+
let methodsInitialized = false;
|
|
692
|
+
const initializeMethods = /* @__PURE__ */ __name(() => {
|
|
693
|
+
if (methodsInitialized) return;
|
|
694
|
+
const defaultInstance = singletonFn();
|
|
695
|
+
const prototype = Object.getPrototypeOf(defaultInstance);
|
|
696
|
+
const methodNames = Object.getOwnPropertyNames(prototype).filter(
|
|
697
|
+
(name) => name !== "constructor" && typeof prototype[name] === "function"
|
|
698
|
+
);
|
|
699
|
+
for (const methodName of methodNames) {
|
|
700
|
+
singletonFn[methodName] = (...args) => {
|
|
701
|
+
const instance = singletonFn();
|
|
702
|
+
return instance[methodName](...args);
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
methodsInitialized = true;
|
|
706
|
+
}, "initializeMethods");
|
|
707
|
+
return new Proxy(singletonFn, {
|
|
708
|
+
get(target, prop, receiver) {
|
|
709
|
+
if (typeof prop === "string" && !Reflect.has(target, prop)) {
|
|
710
|
+
initializeMethods();
|
|
711
|
+
}
|
|
712
|
+
return Reflect.get(target, prop, receiver);
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
__name(wrapSingletonWithAccessors, "wrapSingletonWithAccessors");
|
|
690
717
|
var router = (0, import_neko_helper3.createSingleton)(() => new Router());
|
|
691
|
-
var scheduler = (
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
718
|
+
var scheduler = wrapSingletonWithAccessors(
|
|
719
|
+
(0, import_neko_helper3.createSingleton)(() => {
|
|
720
|
+
const rc = new import_neko_scheduler.Scheduler();
|
|
721
|
+
rc.setErrorHandler((err, job) => {
|
|
722
|
+
logger().error({
|
|
723
|
+
msg: "Scheduled job error",
|
|
724
|
+
err,
|
|
725
|
+
job_name: job.getName()
|
|
726
|
+
});
|
|
698
727
|
});
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
728
|
+
return rc;
|
|
729
|
+
})
|
|
730
|
+
);
|
|
702
731
|
var db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context3.ctx)().getOrThrow(["database", label]), "db");
|
|
703
|
-
var storage = (
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
732
|
+
var storage = wrapSingletonWithAccessors(
|
|
733
|
+
(0, import_neko_helper3.createSingleton)((label = "default") => {
|
|
734
|
+
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
735
|
+
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
736
|
+
storage_config.provider,
|
|
737
|
+
storage_config.config
|
|
738
|
+
);
|
|
739
|
+
return new import_neko_storage2.Storage(provider);
|
|
740
|
+
})
|
|
741
|
+
);
|
|
711
742
|
var cli = (0, import_neko_helper3.createSingleton)(() => {
|
|
712
743
|
const [node, app, ...args] = process.argv;
|
|
713
744
|
return new import_clipanion.Cli({
|
|
@@ -722,46 +753,54 @@ var httpServer = (0, import_neko_helper3.createSingleton)(() => {
|
|
|
722
753
|
server.setRouter(router());
|
|
723
754
|
return server;
|
|
724
755
|
});
|
|
725
|
-
var logger = (
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
mailer_config.config
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
queue_config.
|
|
750
|
-
queue_config
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
});
|
|
756
|
+
var logger = wrapSingletonWithAccessors(
|
|
757
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
758
|
+
const logger_config = import_neko_config.config.get(["loggers", label].join("."));
|
|
759
|
+
const rc = new import_neko_logger.Logger(logger_config);
|
|
760
|
+
rc.setExtrasFunction((message) => {
|
|
761
|
+
message.requestId = (0, import_neko_context3.ctxSafe)()?.get("requestId") || "N/A";
|
|
762
|
+
return message;
|
|
763
|
+
});
|
|
764
|
+
return rc;
|
|
765
|
+
})
|
|
766
|
+
);
|
|
767
|
+
var mailer = wrapSingletonWithAccessors(
|
|
768
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
769
|
+
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
770
|
+
const provider = import_neko_mailer2.MailerProviderFactory.create(
|
|
771
|
+
mailer_config.provider,
|
|
772
|
+
mailer_config.config
|
|
773
|
+
);
|
|
774
|
+
const rc = new import_neko_mailer2.Mailer(provider);
|
|
775
|
+
return rc;
|
|
776
|
+
})
|
|
777
|
+
);
|
|
778
|
+
var queue = wrapSingletonWithAccessors(
|
|
779
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
780
|
+
const queue_config = import_neko_config.config.get(["queues", label].join("."));
|
|
781
|
+
if (!queue_config) {
|
|
782
|
+
throw new Error(`Queue configuration for '${label}' not found`);
|
|
783
|
+
}
|
|
784
|
+
const provider = import_neko_queue2.QueueTransportFactory.create(
|
|
785
|
+
queue_config.provider,
|
|
786
|
+
queue_config.config
|
|
787
|
+
);
|
|
788
|
+
return new import_neko_queue2.QueueConnection(provider);
|
|
789
|
+
})
|
|
790
|
+
);
|
|
791
|
+
var cache = wrapSingletonWithAccessors(
|
|
792
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
793
|
+
const cache_config = import_neko_config.config.get(["caches", label].join("."));
|
|
794
|
+
if (!cache_config) {
|
|
795
|
+
throw new Error(`Cache configuration for '${label}' not found`);
|
|
796
|
+
}
|
|
797
|
+
const provider = CacheProviderFactory.create(
|
|
798
|
+
cache_config.provider,
|
|
799
|
+
cache_config.config
|
|
800
|
+
);
|
|
801
|
+
return new import_neko_cache2.Cache(provider);
|
|
802
|
+
})
|
|
803
|
+
);
|
|
765
804
|
|
|
766
805
|
// src/app/console/generate/GenerateControllerCommand.mts
|
|
767
806
|
var import_clipanion2 = require("clipanion");
|