@devbro/pashmak 0.1.19 → 0.1.21
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/app/console/queue/queue_migration.tpl +1 -1
- package/dist/bin/app/console/DefaultCommand.cjs +71 -78
- package/dist/bin/app/console/KeyGenerateCommand.cjs +71 -78
- package/dist/bin/app/console/StartCommand.cjs +71 -78
- package/dist/bin/app/console/generate/GenerateControllerCommand.cjs +71 -78
- package/dist/bin/app/console/generate/index.cjs +71 -78
- package/dist/bin/app/console/index.cjs +71 -78
- package/dist/bin/app/console/migrate/GenerateMigrateCommand.cjs +71 -78
- package/dist/bin/app/console/migrate/MigrateCommand.cjs +71 -78
- package/dist/bin/app/console/migrate/MigrateRollbackCommand.cjs +71 -78
- package/dist/bin/app/console/migrate/index.cjs +71 -78
- package/dist/bin/app/console/queue/GenerateQueueMigrateCommand.cjs +71 -78
- package/dist/bin/cache.cjs +71 -78
- package/dist/bin/facades.cjs +71 -78
- package/dist/bin/factories.cjs +73 -84
- package/dist/bin/index.cjs +76 -79
- package/dist/bin/middlewares.cjs +71 -78
- package/dist/bin/queue.cjs +69 -78
- package/dist/facades.mjs +15 -10
- package/dist/facades.mjs.map +1 -1
- package/dist/factories.d.mts +1 -13
- package/dist/factories.mjs +13 -34
- package/dist/factories.mjs.map +1 -1
- package/dist/queue.d.mts +11 -5
- package/dist/queue.mjs +52 -46
- package/dist/queue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/bin/index.cjs
CHANGED
|
@@ -561,6 +561,15 @@ var init_http = __esm({
|
|
|
561
561
|
}
|
|
562
562
|
});
|
|
563
563
|
|
|
564
|
+
// src/helper.mts
|
|
565
|
+
var helper_exports = {};
|
|
566
|
+
var init_helper = __esm({
|
|
567
|
+
"src/helper.mts"() {
|
|
568
|
+
"use strict";
|
|
569
|
+
__reExport(helper_exports, require("@devbro/neko-helper"));
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
|
|
564
573
|
// src/queue.mts
|
|
565
574
|
var queue_exports = {};
|
|
566
575
|
__export(queue_exports, {
|
|
@@ -572,11 +581,11 @@ var init_queue = __esm({
|
|
|
572
581
|
"use strict";
|
|
573
582
|
__reExport(queue_exports, require("@devbro/neko-queue"));
|
|
574
583
|
init_facades();
|
|
584
|
+
init_helper();
|
|
575
585
|
DatabaseTransport = class {
|
|
576
586
|
static {
|
|
577
587
|
__name(this, "DatabaseTransport");
|
|
578
588
|
}
|
|
579
|
-
activeIntervals = /* @__PURE__ */ new Set();
|
|
580
589
|
config = {
|
|
581
590
|
queue_table: "queue_messages",
|
|
582
591
|
db_connection: "default",
|
|
@@ -585,14 +594,48 @@ var init_queue = __esm({
|
|
|
585
594
|
message_limit: 10
|
|
586
595
|
// messages per each fetch
|
|
587
596
|
};
|
|
588
|
-
|
|
597
|
+
channels = /* @__PURE__ */ new Map();
|
|
598
|
+
messageQueues = [];
|
|
599
|
+
repeater;
|
|
600
|
+
processMessage = /* @__PURE__ */ __name(async () => {
|
|
601
|
+
const conn = db(this.config.db_connection);
|
|
602
|
+
try {
|
|
603
|
+
await conn.connect();
|
|
604
|
+
let q = conn.getQuery();
|
|
605
|
+
let messages = await q.table(this.config.queue_table).whereOp("channel", "in", Array.from(this.channels.keys())).whereOp("status", "in", ["pending", "failed"]).limit(this.config.message_limit).orderBy("last_tried_at", "asc").get();
|
|
606
|
+
for (let msg of messages) {
|
|
607
|
+
try {
|
|
608
|
+
let callback = this.channels.get(msg.channel);
|
|
609
|
+
await callback(msg.message);
|
|
610
|
+
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
611
|
+
status: "processed",
|
|
612
|
+
updated_at: /* @__PURE__ */ new Date(),
|
|
613
|
+
last_tried_at: /* @__PURE__ */ new Date(),
|
|
614
|
+
retried_count: (msg.retried_count || 0) + 1
|
|
615
|
+
});
|
|
616
|
+
} catch (error) {
|
|
617
|
+
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
618
|
+
status: "failed",
|
|
619
|
+
last_tried_at: /* @__PURE__ */ new Date(),
|
|
620
|
+
retried_count: (msg.retried_count || 0) + 1,
|
|
621
|
+
process_message: error.message || "Error processing message"
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
} catch (error) {
|
|
626
|
+
logger().error("Error in DatabaseTransport listen interval:", {
|
|
627
|
+
error
|
|
628
|
+
});
|
|
629
|
+
} finally {
|
|
630
|
+
await conn.disconnect();
|
|
631
|
+
}
|
|
632
|
+
}, "processMessage");
|
|
633
|
+
constructor(config10 = {}) {
|
|
589
634
|
this.config = { ...this.config, ...config10 };
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
setMessageLimit(limit) {
|
|
595
|
-
this.config.message_limit = limit;
|
|
635
|
+
this.repeater = (0, helper_exports.createRepeater)(
|
|
636
|
+
this.processMessage,
|
|
637
|
+
this.config.listen_interval * 1e3
|
|
638
|
+
);
|
|
596
639
|
}
|
|
597
640
|
async dispatch(channel, message) {
|
|
598
641
|
const conn = db(this.config.db_connection);
|
|
@@ -610,57 +653,29 @@ var init_queue = __esm({
|
|
|
610
653
|
created_at: /* @__PURE__ */ new Date(),
|
|
611
654
|
updated_at: /* @__PURE__ */ new Date(),
|
|
612
655
|
last_tried_at: null,
|
|
613
|
-
process_message: ""
|
|
656
|
+
process_message: "",
|
|
657
|
+
retried_count: 0,
|
|
658
|
+
status: "pending"
|
|
614
659
|
});
|
|
615
660
|
} finally {
|
|
616
661
|
await conn.disconnect();
|
|
617
662
|
}
|
|
618
663
|
}
|
|
619
|
-
async
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
await conn.connect();
|
|
625
|
-
let q = conn.getQuery();
|
|
626
|
-
let messages = await q.table(this.config.queue_table).whereOp("channel", "=", channel).whereOp("processed", "=", false).limit(this.config.message_limit).orderBy("last_tried_at", "asc").get();
|
|
627
|
-
for (let msg of messages) {
|
|
628
|
-
try {
|
|
629
|
-
await callback(msg.message);
|
|
630
|
-
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
631
|
-
processed: true,
|
|
632
|
-
updated_at: /* @__PURE__ */ new Date()
|
|
633
|
-
});
|
|
634
|
-
} catch (error) {
|
|
635
|
-
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
636
|
-
processed: false,
|
|
637
|
-
last_tried_at: /* @__PURE__ */ new Date(),
|
|
638
|
-
process_message: error.message || "Error processing message"
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
} catch (error) {
|
|
643
|
-
this.activeIntervals.delete(intervalId);
|
|
644
|
-
logger().error("Error in DatabaseTransport listen interval:", { error });
|
|
645
|
-
} finally {
|
|
646
|
-
await conn.disconnect();
|
|
647
|
-
}
|
|
648
|
-
}, this.config.listen_interval * 1e3);
|
|
649
|
-
this.activeIntervals.add(intervalId);
|
|
650
|
-
});
|
|
664
|
+
async registerListener(channel, callback) {
|
|
665
|
+
this.channels.set(channel, callback);
|
|
666
|
+
}
|
|
667
|
+
async startListening() {
|
|
668
|
+
this.repeater.start();
|
|
651
669
|
}
|
|
652
670
|
async stopListening() {
|
|
653
|
-
|
|
654
|
-
clearInterval(intervalId);
|
|
655
|
-
}
|
|
656
|
-
this.activeIntervals.clear();
|
|
671
|
+
this.repeater.stop();
|
|
657
672
|
}
|
|
658
673
|
};
|
|
659
674
|
}
|
|
660
675
|
});
|
|
661
676
|
|
|
662
677
|
// src/factories.mts
|
|
663
|
-
var import_neko_mailer, import_neko_queue, import_neko_queue2, import_neko_cache, import_neko_storage, FlexibleFactory,
|
|
678
|
+
var import_neko_mailer, import_neko_queue, import_neko_queue2, import_neko_cache, import_neko_storage, FlexibleFactory, CacheProviderFactory;
|
|
664
679
|
var init_factories = __esm({
|
|
665
680
|
"src/factories.mts"() {
|
|
666
681
|
"use strict";
|
|
@@ -687,19 +702,7 @@ var init_factories = __esm({
|
|
|
687
702
|
return ctor(...args);
|
|
688
703
|
}
|
|
689
704
|
};
|
|
690
|
-
|
|
691
|
-
static {
|
|
692
|
-
__name(this, "MailerFactory");
|
|
693
|
-
}
|
|
694
|
-
static instance = new FlexibleFactory();
|
|
695
|
-
static register(key, factory) {
|
|
696
|
-
_MailerFactory.instance.register(key, factory);
|
|
697
|
-
}
|
|
698
|
-
static create(key, ...args) {
|
|
699
|
-
return _MailerFactory.instance.create(key, ...args);
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
|
-
MailerFactory.register("logger", (opt) => {
|
|
705
|
+
import_neko_mailer.MailerProviderFactory.register("logger", (opt) => {
|
|
703
706
|
return new import_neko_mailer.FunctionProvider((mail) => {
|
|
704
707
|
logger().info({
|
|
705
708
|
msg: "Sending email",
|
|
@@ -707,32 +710,20 @@ var init_factories = __esm({
|
|
|
707
710
|
});
|
|
708
711
|
});
|
|
709
712
|
});
|
|
710
|
-
|
|
713
|
+
import_neko_mailer.MailerProviderFactory.register("ses", (opt) => {
|
|
711
714
|
return new import_neko_mailer.SESProvider(opt);
|
|
712
715
|
});
|
|
713
|
-
|
|
716
|
+
import_neko_mailer.MailerProviderFactory.register("smtp", (opt) => {
|
|
714
717
|
return new import_neko_mailer.SMTPProvider(opt);
|
|
715
718
|
});
|
|
716
|
-
|
|
719
|
+
import_neko_mailer.MailerProviderFactory.register("memory", (opt) => {
|
|
717
720
|
return new import_neko_mailer.MemoryProvider();
|
|
718
721
|
});
|
|
719
|
-
QueueTransportFactory
|
|
720
|
-
static {
|
|
721
|
-
__name(this, "QueueTransportFactory");
|
|
722
|
-
}
|
|
723
|
-
static instance = new FlexibleFactory();
|
|
724
|
-
static register(key, factory) {
|
|
725
|
-
_QueueTransportFactory.instance.register(key, factory);
|
|
726
|
-
}
|
|
727
|
-
static create(key, ...args) {
|
|
728
|
-
return _QueueTransportFactory.instance.create(key, ...args);
|
|
729
|
-
}
|
|
730
|
-
};
|
|
731
|
-
QueueTransportFactory.register("database", (opt) => {
|
|
722
|
+
import_neko_queue2.QueueTransportFactory.register("database", (opt) => {
|
|
732
723
|
let transport = new DatabaseTransport(opt);
|
|
733
724
|
return new import_neko_queue.QueueConnection(transport);
|
|
734
725
|
});
|
|
735
|
-
QueueTransportFactory.register("memory", (opt) => {
|
|
726
|
+
import_neko_queue2.QueueTransportFactory.register("memory", (opt) => {
|
|
736
727
|
let transport = new import_neko_queue2.MemoryTransport(opt);
|
|
737
728
|
return new import_neko_queue.QueueConnection(transport);
|
|
738
729
|
});
|
|
@@ -804,7 +795,10 @@ var init_facades = __esm({
|
|
|
804
795
|
db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context2.ctx)().getOrThrow(["database", label]), "db");
|
|
805
796
|
storage = (0, import_neko_helper.createSingleton)((label = "default") => {
|
|
806
797
|
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
807
|
-
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
798
|
+
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
799
|
+
storage_config.provider,
|
|
800
|
+
storage_config.config
|
|
801
|
+
);
|
|
808
802
|
return new import_neko_storage2.Storage(provider);
|
|
809
803
|
});
|
|
810
804
|
cli = (0, import_neko_helper.createSingleton)(() => {
|
|
@@ -861,7 +855,7 @@ var init_facades = __esm({
|
|
|
861
855
|
});
|
|
862
856
|
mailer = (0, import_neko_helper.createSingleton)((label) => {
|
|
863
857
|
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
864
|
-
const provider =
|
|
858
|
+
const provider = import_neko_mailer2.MailerProviderFactory.create(
|
|
865
859
|
mailer_config.provider,
|
|
866
860
|
mailer_config.config
|
|
867
861
|
);
|
|
@@ -873,7 +867,10 @@ var init_facades = __esm({
|
|
|
873
867
|
if (!queue_config) {
|
|
874
868
|
throw new Error(`Queue configuration for '${label}' not found`);
|
|
875
869
|
}
|
|
876
|
-
const provider = QueueTransportFactory.create(
|
|
870
|
+
const provider = import_neko_queue3.QueueTransportFactory.create(
|
|
871
|
+
queue_config.provider,
|
|
872
|
+
queue_config.config
|
|
873
|
+
);
|
|
877
874
|
const rc = new import_neko_queue3.QueueConnection(provider);
|
|
878
875
|
return rc;
|
|
879
876
|
});
|
package/dist/bin/middlewares.cjs
CHANGED
|
@@ -481,11 +481,16 @@ __export(queue_exports, {
|
|
|
481
481
|
DatabaseTransport: () => DatabaseTransport
|
|
482
482
|
});
|
|
483
483
|
__reExport(queue_exports, require("@devbro/neko-queue"));
|
|
484
|
+
|
|
485
|
+
// src/helper.mts
|
|
486
|
+
var helper_exports = {};
|
|
487
|
+
__reExport(helper_exports, require("@devbro/neko-helper"));
|
|
488
|
+
|
|
489
|
+
// src/queue.mts
|
|
484
490
|
var DatabaseTransport = class {
|
|
485
491
|
static {
|
|
486
492
|
__name(this, "DatabaseTransport");
|
|
487
493
|
}
|
|
488
|
-
activeIntervals = /* @__PURE__ */ new Set();
|
|
489
494
|
config = {
|
|
490
495
|
queue_table: "queue_messages",
|
|
491
496
|
db_connection: "default",
|
|
@@ -494,14 +499,48 @@ var DatabaseTransport = class {
|
|
|
494
499
|
message_limit: 10
|
|
495
500
|
// messages per each fetch
|
|
496
501
|
};
|
|
497
|
-
|
|
502
|
+
channels = /* @__PURE__ */ new Map();
|
|
503
|
+
messageQueues = [];
|
|
504
|
+
repeater;
|
|
505
|
+
processMessage = /* @__PURE__ */ __name(async () => {
|
|
506
|
+
const conn = db(this.config.db_connection);
|
|
507
|
+
try {
|
|
508
|
+
await conn.connect();
|
|
509
|
+
let q = conn.getQuery();
|
|
510
|
+
let messages = await q.table(this.config.queue_table).whereOp("channel", "in", Array.from(this.channels.keys())).whereOp("status", "in", ["pending", "failed"]).limit(this.config.message_limit).orderBy("last_tried_at", "asc").get();
|
|
511
|
+
for (let msg of messages) {
|
|
512
|
+
try {
|
|
513
|
+
let callback = this.channels.get(msg.channel);
|
|
514
|
+
await callback(msg.message);
|
|
515
|
+
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
516
|
+
status: "processed",
|
|
517
|
+
updated_at: /* @__PURE__ */ new Date(),
|
|
518
|
+
last_tried_at: /* @__PURE__ */ new Date(),
|
|
519
|
+
retried_count: (msg.retried_count || 0) + 1
|
|
520
|
+
});
|
|
521
|
+
} catch (error) {
|
|
522
|
+
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
523
|
+
status: "failed",
|
|
524
|
+
last_tried_at: /* @__PURE__ */ new Date(),
|
|
525
|
+
retried_count: (msg.retried_count || 0) + 1,
|
|
526
|
+
process_message: error.message || "Error processing message"
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
} catch (error) {
|
|
531
|
+
logger().error("Error in DatabaseTransport listen interval:", {
|
|
532
|
+
error
|
|
533
|
+
});
|
|
534
|
+
} finally {
|
|
535
|
+
await conn.disconnect();
|
|
536
|
+
}
|
|
537
|
+
}, "processMessage");
|
|
538
|
+
constructor(config2 = {}) {
|
|
498
539
|
this.config = { ...this.config, ...config2 };
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
setMessageLimit(limit) {
|
|
504
|
-
this.config.message_limit = limit;
|
|
540
|
+
this.repeater = (0, helper_exports.createRepeater)(
|
|
541
|
+
this.processMessage,
|
|
542
|
+
this.config.listen_interval * 1e3
|
|
543
|
+
);
|
|
505
544
|
}
|
|
506
545
|
async dispatch(channel, message) {
|
|
507
546
|
const conn = db(this.config.db_connection);
|
|
@@ -519,50 +558,22 @@ var DatabaseTransport = class {
|
|
|
519
558
|
created_at: /* @__PURE__ */ new Date(),
|
|
520
559
|
updated_at: /* @__PURE__ */ new Date(),
|
|
521
560
|
last_tried_at: null,
|
|
522
|
-
process_message: ""
|
|
561
|
+
process_message: "",
|
|
562
|
+
retried_count: 0,
|
|
563
|
+
status: "pending"
|
|
523
564
|
});
|
|
524
565
|
} finally {
|
|
525
566
|
await conn.disconnect();
|
|
526
567
|
}
|
|
527
568
|
}
|
|
528
|
-
async
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
await conn.connect();
|
|
534
|
-
let q = conn.getQuery();
|
|
535
|
-
let messages = await q.table(this.config.queue_table).whereOp("channel", "=", channel).whereOp("processed", "=", false).limit(this.config.message_limit).orderBy("last_tried_at", "asc").get();
|
|
536
|
-
for (let msg of messages) {
|
|
537
|
-
try {
|
|
538
|
-
await callback(msg.message);
|
|
539
|
-
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
540
|
-
processed: true,
|
|
541
|
-
updated_at: /* @__PURE__ */ new Date()
|
|
542
|
-
});
|
|
543
|
-
} catch (error) {
|
|
544
|
-
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
545
|
-
processed: false,
|
|
546
|
-
last_tried_at: /* @__PURE__ */ new Date(),
|
|
547
|
-
process_message: error.message || "Error processing message"
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
} catch (error) {
|
|
552
|
-
this.activeIntervals.delete(intervalId);
|
|
553
|
-
logger().error("Error in DatabaseTransport listen interval:", { error });
|
|
554
|
-
} finally {
|
|
555
|
-
await conn.disconnect();
|
|
556
|
-
}
|
|
557
|
-
}, this.config.listen_interval * 1e3);
|
|
558
|
-
this.activeIntervals.add(intervalId);
|
|
559
|
-
});
|
|
569
|
+
async registerListener(channel, callback) {
|
|
570
|
+
this.channels.set(channel, callback);
|
|
571
|
+
}
|
|
572
|
+
async startListening() {
|
|
573
|
+
this.repeater.start();
|
|
560
574
|
}
|
|
561
575
|
async stopListening() {
|
|
562
|
-
|
|
563
|
-
clearInterval(intervalId);
|
|
564
|
-
}
|
|
565
|
-
this.activeIntervals.clear();
|
|
576
|
+
this.repeater.stop();
|
|
566
577
|
}
|
|
567
578
|
};
|
|
568
579
|
|
|
@@ -585,19 +596,7 @@ var FlexibleFactory = class {
|
|
|
585
596
|
return ctor(...args);
|
|
586
597
|
}
|
|
587
598
|
};
|
|
588
|
-
|
|
589
|
-
static {
|
|
590
|
-
__name(this, "MailerFactory");
|
|
591
|
-
}
|
|
592
|
-
static instance = new FlexibleFactory();
|
|
593
|
-
static register(key, factory) {
|
|
594
|
-
_MailerFactory.instance.register(key, factory);
|
|
595
|
-
}
|
|
596
|
-
static create(key, ...args) {
|
|
597
|
-
return _MailerFactory.instance.create(key, ...args);
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
MailerFactory.register("logger", (opt) => {
|
|
599
|
+
import_neko_mailer.MailerProviderFactory.register("logger", (opt) => {
|
|
601
600
|
return new import_neko_mailer.FunctionProvider((mail) => {
|
|
602
601
|
logger().info({
|
|
603
602
|
msg: "Sending email",
|
|
@@ -605,32 +604,20 @@ MailerFactory.register("logger", (opt) => {
|
|
|
605
604
|
});
|
|
606
605
|
});
|
|
607
606
|
});
|
|
608
|
-
|
|
607
|
+
import_neko_mailer.MailerProviderFactory.register("ses", (opt) => {
|
|
609
608
|
return new import_neko_mailer.SESProvider(opt);
|
|
610
609
|
});
|
|
611
|
-
|
|
610
|
+
import_neko_mailer.MailerProviderFactory.register("smtp", (opt) => {
|
|
612
611
|
return new import_neko_mailer.SMTPProvider(opt);
|
|
613
612
|
});
|
|
614
|
-
|
|
613
|
+
import_neko_mailer.MailerProviderFactory.register("memory", (opt) => {
|
|
615
614
|
return new import_neko_mailer.MemoryProvider();
|
|
616
615
|
});
|
|
617
|
-
|
|
618
|
-
static {
|
|
619
|
-
__name(this, "QueueTransportFactory");
|
|
620
|
-
}
|
|
621
|
-
static instance = new FlexibleFactory();
|
|
622
|
-
static register(key, factory) {
|
|
623
|
-
_QueueTransportFactory.instance.register(key, factory);
|
|
624
|
-
}
|
|
625
|
-
static create(key, ...args) {
|
|
626
|
-
return _QueueTransportFactory.instance.create(key, ...args);
|
|
627
|
-
}
|
|
628
|
-
};
|
|
629
|
-
QueueTransportFactory.register("database", (opt) => {
|
|
616
|
+
import_neko_queue2.QueueTransportFactory.register("database", (opt) => {
|
|
630
617
|
let transport = new DatabaseTransport(opt);
|
|
631
618
|
return new import_neko_queue.QueueConnection(transport);
|
|
632
619
|
});
|
|
633
|
-
QueueTransportFactory.register("memory", (opt) => {
|
|
620
|
+
import_neko_queue2.QueueTransportFactory.register("memory", (opt) => {
|
|
634
621
|
let transport = new import_neko_queue2.MemoryTransport(opt);
|
|
635
622
|
return new import_neko_queue.QueueConnection(transport);
|
|
636
623
|
});
|
|
@@ -683,7 +670,10 @@ var scheduler = (0, import_neko_helper.createSingleton)(() => {
|
|
|
683
670
|
var db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context2.ctx)().getOrThrow(["database", label]), "db");
|
|
684
671
|
var storage = (0, import_neko_helper.createSingleton)((label = "default") => {
|
|
685
672
|
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
686
|
-
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
673
|
+
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
674
|
+
storage_config.provider,
|
|
675
|
+
storage_config.config
|
|
676
|
+
);
|
|
687
677
|
return new import_neko_storage2.Storage(provider);
|
|
688
678
|
});
|
|
689
679
|
var cli = (0, import_neko_helper.createSingleton)(() => {
|
|
@@ -740,7 +730,7 @@ var logger = (0, import_neko_helper.createSingleton)((label) => {
|
|
|
740
730
|
});
|
|
741
731
|
var mailer = (0, import_neko_helper.createSingleton)((label) => {
|
|
742
732
|
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
743
|
-
const provider =
|
|
733
|
+
const provider = import_neko_mailer2.MailerProviderFactory.create(
|
|
744
734
|
mailer_config.provider,
|
|
745
735
|
mailer_config.config
|
|
746
736
|
);
|
|
@@ -752,7 +742,10 @@ var queue = (0, import_neko_helper.createSingleton)((label) => {
|
|
|
752
742
|
if (!queue_config) {
|
|
753
743
|
throw new Error(`Queue configuration for '${label}' not found`);
|
|
754
744
|
}
|
|
755
|
-
const provider = QueueTransportFactory.create(
|
|
745
|
+
const provider = import_neko_queue3.QueueTransportFactory.create(
|
|
746
|
+
queue_config.provider,
|
|
747
|
+
queue_config.config
|
|
748
|
+
);
|
|
756
749
|
const rc = new import_neko_queue3.QueueConnection(provider);
|
|
757
750
|
return rc;
|
|
758
751
|
});
|