@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
|
@@ -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/migrate/MigrateCommand.mts
|
|
767
806
|
var import_clipanion2 = require("clipanion");
|
|
@@ -1842,27 +1842,58 @@ import_neko_storage.StorageProviderFactory.register("sftp", (opt) => {
|
|
|
1842
1842
|
// src/facades.mts
|
|
1843
1843
|
var import_neko_cache2 = require("@devbro/neko-cache");
|
|
1844
1844
|
var import_neko_queue2 = require("@devbro/neko-queue");
|
|
1845
|
+
function wrapSingletonWithAccessors(singletonFn) {
|
|
1846
|
+
let methodsInitialized = false;
|
|
1847
|
+
const initializeMethods = /* @__PURE__ */ __name(() => {
|
|
1848
|
+
if (methodsInitialized) return;
|
|
1849
|
+
const defaultInstance = singletonFn();
|
|
1850
|
+
const prototype = Object.getPrototypeOf(defaultInstance);
|
|
1851
|
+
const methodNames = Object.getOwnPropertyNames(prototype).filter(
|
|
1852
|
+
(name) => name !== "constructor" && typeof prototype[name] === "function"
|
|
1853
|
+
);
|
|
1854
|
+
for (const methodName of methodNames) {
|
|
1855
|
+
singletonFn[methodName] = (...args) => {
|
|
1856
|
+
const instance = singletonFn();
|
|
1857
|
+
return instance[methodName](...args);
|
|
1858
|
+
};
|
|
1859
|
+
}
|
|
1860
|
+
methodsInitialized = true;
|
|
1861
|
+
}, "initializeMethods");
|
|
1862
|
+
return new Proxy(singletonFn, {
|
|
1863
|
+
get(target, prop, receiver) {
|
|
1864
|
+
if (typeof prop === "string" && !Reflect.has(target, prop)) {
|
|
1865
|
+
initializeMethods();
|
|
1866
|
+
}
|
|
1867
|
+
return Reflect.get(target, prop, receiver);
|
|
1868
|
+
}
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
__name(wrapSingletonWithAccessors, "wrapSingletonWithAccessors");
|
|
1845
1872
|
var router = (0, import_neko_helper3.createSingleton)(() => new Router());
|
|
1846
|
-
var scheduler = (
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1873
|
+
var scheduler = wrapSingletonWithAccessors(
|
|
1874
|
+
(0, import_neko_helper3.createSingleton)(() => {
|
|
1875
|
+
const rc = new import_neko_scheduler.Scheduler();
|
|
1876
|
+
rc.setErrorHandler((err, job) => {
|
|
1877
|
+
logger().error({
|
|
1878
|
+
msg: "Scheduled job error",
|
|
1879
|
+
err,
|
|
1880
|
+
job_name: job.getName()
|
|
1881
|
+
});
|
|
1853
1882
|
});
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1883
|
+
return rc;
|
|
1884
|
+
})
|
|
1885
|
+
);
|
|
1857
1886
|
var db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context3.ctx)().getOrThrow(["database", label]), "db");
|
|
1858
|
-
var storage = (
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1887
|
+
var storage = wrapSingletonWithAccessors(
|
|
1888
|
+
(0, import_neko_helper3.createSingleton)((label = "default") => {
|
|
1889
|
+
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
1890
|
+
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
1891
|
+
storage_config.provider,
|
|
1892
|
+
storage_config.config
|
|
1893
|
+
);
|
|
1894
|
+
return new import_neko_storage2.Storage(provider);
|
|
1895
|
+
})
|
|
1896
|
+
);
|
|
1866
1897
|
var cli = (0, import_neko_helper3.createSingleton)(() => {
|
|
1867
1898
|
const [node, app, ...args] = process.argv;
|
|
1868
1899
|
return new import_clipanion.Cli({
|
|
@@ -1877,46 +1908,54 @@ var httpServer = (0, import_neko_helper3.createSingleton)(() => {
|
|
|
1877
1908
|
server.setRouter(router());
|
|
1878
1909
|
return server;
|
|
1879
1910
|
});
|
|
1880
|
-
var logger = (
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
mailer_config.config
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
queue_config.
|
|
1905
|
-
queue_config
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
});
|
|
1911
|
+
var logger = wrapSingletonWithAccessors(
|
|
1912
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
1913
|
+
const logger_config = import_neko_config.config.get(["loggers", label].join("."));
|
|
1914
|
+
const rc = new import_neko_logger.Logger(logger_config);
|
|
1915
|
+
rc.setExtrasFunction((message) => {
|
|
1916
|
+
message.requestId = (0, import_neko_context3.ctxSafe)()?.get("requestId") || "N/A";
|
|
1917
|
+
return message;
|
|
1918
|
+
});
|
|
1919
|
+
return rc;
|
|
1920
|
+
})
|
|
1921
|
+
);
|
|
1922
|
+
var mailer = wrapSingletonWithAccessors(
|
|
1923
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
1924
|
+
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
1925
|
+
const provider = import_neko_mailer2.MailerProviderFactory.create(
|
|
1926
|
+
mailer_config.provider,
|
|
1927
|
+
mailer_config.config
|
|
1928
|
+
);
|
|
1929
|
+
const rc = new import_neko_mailer2.Mailer(provider);
|
|
1930
|
+
return rc;
|
|
1931
|
+
})
|
|
1932
|
+
);
|
|
1933
|
+
var queue = wrapSingletonWithAccessors(
|
|
1934
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
1935
|
+
const queue_config = import_neko_config.config.get(["queues", label].join("."));
|
|
1936
|
+
if (!queue_config) {
|
|
1937
|
+
throw new Error(`Queue configuration for '${label}' not found`);
|
|
1938
|
+
}
|
|
1939
|
+
const provider = import_neko_queue2.QueueTransportFactory.create(
|
|
1940
|
+
queue_config.provider,
|
|
1941
|
+
queue_config.config
|
|
1942
|
+
);
|
|
1943
|
+
return new import_neko_queue2.QueueConnection(provider);
|
|
1944
|
+
})
|
|
1945
|
+
);
|
|
1946
|
+
var cache = wrapSingletonWithAccessors(
|
|
1947
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
1948
|
+
const cache_config = import_neko_config.config.get(["caches", label].join("."));
|
|
1949
|
+
if (!cache_config) {
|
|
1950
|
+
throw new Error(`Cache configuration for '${label}' not found`);
|
|
1951
|
+
}
|
|
1952
|
+
const provider = CacheProviderFactory.create(
|
|
1953
|
+
cache_config.provider,
|
|
1954
|
+
cache_config.config
|
|
1955
|
+
);
|
|
1956
|
+
return new import_neko_cache2.Cache(provider);
|
|
1957
|
+
})
|
|
1958
|
+
);
|
|
1920
1959
|
|
|
1921
1960
|
// src/app/console/migrate/MigrateRollbackCommand.mts
|
|
1922
1961
|
var import_clipanion2 = require("clipanion");
|
|
@@ -1844,27 +1844,58 @@ import_neko_storage.StorageProviderFactory.register("sftp", (opt) => {
|
|
|
1844
1844
|
// src/facades.mts
|
|
1845
1845
|
var import_neko_cache2 = require("@devbro/neko-cache");
|
|
1846
1846
|
var import_neko_queue2 = require("@devbro/neko-queue");
|
|
1847
|
+
function wrapSingletonWithAccessors(singletonFn) {
|
|
1848
|
+
let methodsInitialized = false;
|
|
1849
|
+
const initializeMethods = /* @__PURE__ */ __name(() => {
|
|
1850
|
+
if (methodsInitialized) return;
|
|
1851
|
+
const defaultInstance = singletonFn();
|
|
1852
|
+
const prototype = Object.getPrototypeOf(defaultInstance);
|
|
1853
|
+
const methodNames = Object.getOwnPropertyNames(prototype).filter(
|
|
1854
|
+
(name) => name !== "constructor" && typeof prototype[name] === "function"
|
|
1855
|
+
);
|
|
1856
|
+
for (const methodName of methodNames) {
|
|
1857
|
+
singletonFn[methodName] = (...args) => {
|
|
1858
|
+
const instance = singletonFn();
|
|
1859
|
+
return instance[methodName](...args);
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1862
|
+
methodsInitialized = true;
|
|
1863
|
+
}, "initializeMethods");
|
|
1864
|
+
return new Proxy(singletonFn, {
|
|
1865
|
+
get(target, prop, receiver) {
|
|
1866
|
+
if (typeof prop === "string" && !Reflect.has(target, prop)) {
|
|
1867
|
+
initializeMethods();
|
|
1868
|
+
}
|
|
1869
|
+
return Reflect.get(target, prop, receiver);
|
|
1870
|
+
}
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
__name(wrapSingletonWithAccessors, "wrapSingletonWithAccessors");
|
|
1847
1874
|
var router = (0, import_neko_helper3.createSingleton)(() => new Router());
|
|
1848
|
-
var scheduler = (
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1875
|
+
var scheduler = wrapSingletonWithAccessors(
|
|
1876
|
+
(0, import_neko_helper3.createSingleton)(() => {
|
|
1877
|
+
const rc = new import_neko_scheduler.Scheduler();
|
|
1878
|
+
rc.setErrorHandler((err, job) => {
|
|
1879
|
+
logger().error({
|
|
1880
|
+
msg: "Scheduled job error",
|
|
1881
|
+
err,
|
|
1882
|
+
job_name: job.getName()
|
|
1883
|
+
});
|
|
1855
1884
|
});
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1885
|
+
return rc;
|
|
1886
|
+
})
|
|
1887
|
+
);
|
|
1859
1888
|
var db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context3.ctx)().getOrThrow(["database", label]), "db");
|
|
1860
|
-
var storage = (
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1889
|
+
var storage = wrapSingletonWithAccessors(
|
|
1890
|
+
(0, import_neko_helper3.createSingleton)((label = "default") => {
|
|
1891
|
+
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
1892
|
+
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
1893
|
+
storage_config.provider,
|
|
1894
|
+
storage_config.config
|
|
1895
|
+
);
|
|
1896
|
+
return new import_neko_storage2.Storage(provider);
|
|
1897
|
+
})
|
|
1898
|
+
);
|
|
1868
1899
|
var cli = (0, import_neko_helper3.createSingleton)(() => {
|
|
1869
1900
|
const [node, app, ...args] = process.argv;
|
|
1870
1901
|
return new import_clipanion.Cli({
|
|
@@ -1879,46 +1910,54 @@ var httpServer = (0, import_neko_helper3.createSingleton)(() => {
|
|
|
1879
1910
|
server.setRouter(router());
|
|
1880
1911
|
return server;
|
|
1881
1912
|
});
|
|
1882
|
-
var logger = (
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
mailer_config.config
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
queue_config.
|
|
1907
|
-
queue_config
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
});
|
|
1913
|
+
var logger = wrapSingletonWithAccessors(
|
|
1914
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
1915
|
+
const logger_config = import_neko_config.config.get(["loggers", label].join("."));
|
|
1916
|
+
const rc = new import_neko_logger.Logger(logger_config);
|
|
1917
|
+
rc.setExtrasFunction((message) => {
|
|
1918
|
+
message.requestId = (0, import_neko_context3.ctxSafe)()?.get("requestId") || "N/A";
|
|
1919
|
+
return message;
|
|
1920
|
+
});
|
|
1921
|
+
return rc;
|
|
1922
|
+
})
|
|
1923
|
+
);
|
|
1924
|
+
var mailer = wrapSingletonWithAccessors(
|
|
1925
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
1926
|
+
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
1927
|
+
const provider = import_neko_mailer2.MailerProviderFactory.create(
|
|
1928
|
+
mailer_config.provider,
|
|
1929
|
+
mailer_config.config
|
|
1930
|
+
);
|
|
1931
|
+
const rc = new import_neko_mailer2.Mailer(provider);
|
|
1932
|
+
return rc;
|
|
1933
|
+
})
|
|
1934
|
+
);
|
|
1935
|
+
var queue = wrapSingletonWithAccessors(
|
|
1936
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
1937
|
+
const queue_config = import_neko_config.config.get(["queues", label].join("."));
|
|
1938
|
+
if (!queue_config) {
|
|
1939
|
+
throw new Error(`Queue configuration for '${label}' not found`);
|
|
1940
|
+
}
|
|
1941
|
+
const provider = import_neko_queue2.QueueTransportFactory.create(
|
|
1942
|
+
queue_config.provider,
|
|
1943
|
+
queue_config.config
|
|
1944
|
+
);
|
|
1945
|
+
return new import_neko_queue2.QueueConnection(provider);
|
|
1946
|
+
})
|
|
1947
|
+
);
|
|
1948
|
+
var cache = wrapSingletonWithAccessors(
|
|
1949
|
+
(0, import_neko_helper3.createSingleton)((label) => {
|
|
1950
|
+
const cache_config = import_neko_config.config.get(["caches", label].join("."));
|
|
1951
|
+
if (!cache_config) {
|
|
1952
|
+
throw new Error(`Cache configuration for '${label}' not found`);
|
|
1953
|
+
}
|
|
1954
|
+
const provider = CacheProviderFactory.create(
|
|
1955
|
+
cache_config.provider,
|
|
1956
|
+
cache_config.config
|
|
1957
|
+
);
|
|
1958
|
+
return new import_neko_cache2.Cache(provider);
|
|
1959
|
+
})
|
|
1960
|
+
);
|
|
1922
1961
|
|
|
1923
1962
|
// src/app/console/migrate/MigrateCommand.mts
|
|
1924
1963
|
var import_clipanion2 = require("clipanion");
|