@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/facades.cjs
CHANGED
|
@@ -489,11 +489,16 @@ __export(queue_exports, {
|
|
|
489
489
|
DatabaseTransport: () => DatabaseTransport
|
|
490
490
|
});
|
|
491
491
|
__reExport(queue_exports, require("@devbro/neko-queue"));
|
|
492
|
+
|
|
493
|
+
// src/helper.mts
|
|
494
|
+
var helper_exports = {};
|
|
495
|
+
__reExport(helper_exports, require("@devbro/neko-helper"));
|
|
496
|
+
|
|
497
|
+
// src/queue.mts
|
|
492
498
|
var DatabaseTransport = class {
|
|
493
499
|
static {
|
|
494
500
|
__name(this, "DatabaseTransport");
|
|
495
501
|
}
|
|
496
|
-
activeIntervals = /* @__PURE__ */ new Set();
|
|
497
502
|
config = {
|
|
498
503
|
queue_table: "queue_messages",
|
|
499
504
|
db_connection: "default",
|
|
@@ -502,14 +507,48 @@ var DatabaseTransport = class {
|
|
|
502
507
|
message_limit: 10
|
|
503
508
|
// messages per each fetch
|
|
504
509
|
};
|
|
505
|
-
|
|
510
|
+
channels = /* @__PURE__ */ new Map();
|
|
511
|
+
messageQueues = [];
|
|
512
|
+
repeater;
|
|
513
|
+
processMessage = /* @__PURE__ */ __name(async () => {
|
|
514
|
+
const conn = db(this.config.db_connection);
|
|
515
|
+
try {
|
|
516
|
+
await conn.connect();
|
|
517
|
+
let q = conn.getQuery();
|
|
518
|
+
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();
|
|
519
|
+
for (let msg of messages) {
|
|
520
|
+
try {
|
|
521
|
+
let callback = this.channels.get(msg.channel);
|
|
522
|
+
await callback(msg.message);
|
|
523
|
+
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
524
|
+
status: "processed",
|
|
525
|
+
updated_at: /* @__PURE__ */ new Date(),
|
|
526
|
+
last_tried_at: /* @__PURE__ */ new Date(),
|
|
527
|
+
retried_count: (msg.retried_count || 0) + 1
|
|
528
|
+
});
|
|
529
|
+
} catch (error) {
|
|
530
|
+
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
531
|
+
status: "failed",
|
|
532
|
+
last_tried_at: /* @__PURE__ */ new Date(),
|
|
533
|
+
retried_count: (msg.retried_count || 0) + 1,
|
|
534
|
+
process_message: error.message || "Error processing message"
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
} catch (error) {
|
|
539
|
+
logger().error("Error in DatabaseTransport listen interval:", {
|
|
540
|
+
error
|
|
541
|
+
});
|
|
542
|
+
} finally {
|
|
543
|
+
await conn.disconnect();
|
|
544
|
+
}
|
|
545
|
+
}, "processMessage");
|
|
546
|
+
constructor(config2 = {}) {
|
|
506
547
|
this.config = { ...this.config, ...config2 };
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
setMessageLimit(limit) {
|
|
512
|
-
this.config.message_limit = limit;
|
|
548
|
+
this.repeater = (0, helper_exports.createRepeater)(
|
|
549
|
+
this.processMessage,
|
|
550
|
+
this.config.listen_interval * 1e3
|
|
551
|
+
);
|
|
513
552
|
}
|
|
514
553
|
async dispatch(channel, message) {
|
|
515
554
|
const conn = db(this.config.db_connection);
|
|
@@ -527,50 +566,22 @@ var DatabaseTransport = class {
|
|
|
527
566
|
created_at: /* @__PURE__ */ new Date(),
|
|
528
567
|
updated_at: /* @__PURE__ */ new Date(),
|
|
529
568
|
last_tried_at: null,
|
|
530
|
-
process_message: ""
|
|
569
|
+
process_message: "",
|
|
570
|
+
retried_count: 0,
|
|
571
|
+
status: "pending"
|
|
531
572
|
});
|
|
532
573
|
} finally {
|
|
533
574
|
await conn.disconnect();
|
|
534
575
|
}
|
|
535
576
|
}
|
|
536
|
-
async
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
await conn.connect();
|
|
542
|
-
let q = conn.getQuery();
|
|
543
|
-
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();
|
|
544
|
-
for (let msg of messages) {
|
|
545
|
-
try {
|
|
546
|
-
await callback(msg.message);
|
|
547
|
-
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
548
|
-
processed: true,
|
|
549
|
-
updated_at: /* @__PURE__ */ new Date()
|
|
550
|
-
});
|
|
551
|
-
} catch (error) {
|
|
552
|
-
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
553
|
-
processed: false,
|
|
554
|
-
last_tried_at: /* @__PURE__ */ new Date(),
|
|
555
|
-
process_message: error.message || "Error processing message"
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
} catch (error) {
|
|
560
|
-
this.activeIntervals.delete(intervalId);
|
|
561
|
-
logger().error("Error in DatabaseTransport listen interval:", { error });
|
|
562
|
-
} finally {
|
|
563
|
-
await conn.disconnect();
|
|
564
|
-
}
|
|
565
|
-
}, this.config.listen_interval * 1e3);
|
|
566
|
-
this.activeIntervals.add(intervalId);
|
|
567
|
-
});
|
|
577
|
+
async registerListener(channel, callback) {
|
|
578
|
+
this.channels.set(channel, callback);
|
|
579
|
+
}
|
|
580
|
+
async startListening() {
|
|
581
|
+
this.repeater.start();
|
|
568
582
|
}
|
|
569
583
|
async stopListening() {
|
|
570
|
-
|
|
571
|
-
clearInterval(intervalId);
|
|
572
|
-
}
|
|
573
|
-
this.activeIntervals.clear();
|
|
584
|
+
this.repeater.stop();
|
|
574
585
|
}
|
|
575
586
|
};
|
|
576
587
|
|
|
@@ -593,19 +604,7 @@ var FlexibleFactory = class {
|
|
|
593
604
|
return ctor(...args);
|
|
594
605
|
}
|
|
595
606
|
};
|
|
596
|
-
|
|
597
|
-
static {
|
|
598
|
-
__name(this, "MailerFactory");
|
|
599
|
-
}
|
|
600
|
-
static instance = new FlexibleFactory();
|
|
601
|
-
static register(key, factory) {
|
|
602
|
-
_MailerFactory.instance.register(key, factory);
|
|
603
|
-
}
|
|
604
|
-
static create(key, ...args) {
|
|
605
|
-
return _MailerFactory.instance.create(key, ...args);
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
MailerFactory.register("logger", (opt) => {
|
|
607
|
+
import_neko_mailer.MailerProviderFactory.register("logger", (opt) => {
|
|
609
608
|
return new import_neko_mailer.FunctionProvider((mail) => {
|
|
610
609
|
logger().info({
|
|
611
610
|
msg: "Sending email",
|
|
@@ -613,32 +612,20 @@ MailerFactory.register("logger", (opt) => {
|
|
|
613
612
|
});
|
|
614
613
|
});
|
|
615
614
|
});
|
|
616
|
-
|
|
615
|
+
import_neko_mailer.MailerProviderFactory.register("ses", (opt) => {
|
|
617
616
|
return new import_neko_mailer.SESProvider(opt);
|
|
618
617
|
});
|
|
619
|
-
|
|
618
|
+
import_neko_mailer.MailerProviderFactory.register("smtp", (opt) => {
|
|
620
619
|
return new import_neko_mailer.SMTPProvider(opt);
|
|
621
620
|
});
|
|
622
|
-
|
|
621
|
+
import_neko_mailer.MailerProviderFactory.register("memory", (opt) => {
|
|
623
622
|
return new import_neko_mailer.MemoryProvider();
|
|
624
623
|
});
|
|
625
|
-
|
|
626
|
-
static {
|
|
627
|
-
__name(this, "QueueTransportFactory");
|
|
628
|
-
}
|
|
629
|
-
static instance = new FlexibleFactory();
|
|
630
|
-
static register(key, factory) {
|
|
631
|
-
_QueueTransportFactory.instance.register(key, factory);
|
|
632
|
-
}
|
|
633
|
-
static create(key, ...args) {
|
|
634
|
-
return _QueueTransportFactory.instance.create(key, ...args);
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
QueueTransportFactory.register("database", (opt) => {
|
|
624
|
+
import_neko_queue2.QueueTransportFactory.register("database", (opt) => {
|
|
638
625
|
let transport = new DatabaseTransport(opt);
|
|
639
626
|
return new import_neko_queue.QueueConnection(transport);
|
|
640
627
|
});
|
|
641
|
-
QueueTransportFactory.register("memory", (opt) => {
|
|
628
|
+
import_neko_queue2.QueueTransportFactory.register("memory", (opt) => {
|
|
642
629
|
let transport = new import_neko_queue2.MemoryTransport(opt);
|
|
643
630
|
return new import_neko_queue.QueueConnection(transport);
|
|
644
631
|
});
|
|
@@ -691,7 +678,10 @@ var scheduler = (0, import_neko_helper.createSingleton)(() => {
|
|
|
691
678
|
var db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context2.ctx)().getOrThrow(["database", label]), "db");
|
|
692
679
|
var storage = (0, import_neko_helper.createSingleton)((label = "default") => {
|
|
693
680
|
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
694
|
-
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
681
|
+
const provider = import_neko_storage2.StorageProviderFactory.create(
|
|
682
|
+
storage_config.provider,
|
|
683
|
+
storage_config.config
|
|
684
|
+
);
|
|
695
685
|
return new import_neko_storage2.Storage(provider);
|
|
696
686
|
});
|
|
697
687
|
var cli = (0, import_neko_helper.createSingleton)(() => {
|
|
@@ -748,7 +738,7 @@ var logger = (0, import_neko_helper.createSingleton)((label) => {
|
|
|
748
738
|
});
|
|
749
739
|
var mailer = (0, import_neko_helper.createSingleton)((label) => {
|
|
750
740
|
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
751
|
-
const provider =
|
|
741
|
+
const provider = import_neko_mailer2.MailerProviderFactory.create(
|
|
752
742
|
mailer_config.provider,
|
|
753
743
|
mailer_config.config
|
|
754
744
|
);
|
|
@@ -760,7 +750,10 @@ var queue = (0, import_neko_helper.createSingleton)((label) => {
|
|
|
760
750
|
if (!queue_config) {
|
|
761
751
|
throw new Error(`Queue configuration for '${label}' not found`);
|
|
762
752
|
}
|
|
763
|
-
const provider = QueueTransportFactory.create(
|
|
753
|
+
const provider = import_neko_queue3.QueueTransportFactory.create(
|
|
754
|
+
queue_config.provider,
|
|
755
|
+
queue_config.config
|
|
756
|
+
);
|
|
764
757
|
const rc = new import_neko_queue3.QueueConnection(provider);
|
|
765
758
|
return rc;
|
|
766
759
|
});
|
package/dist/bin/factories.cjs
CHANGED
|
@@ -33,9 +33,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
33
33
|
var factories_exports = {};
|
|
34
34
|
__export(factories_exports, {
|
|
35
35
|
CacheProviderFactory: () => CacheProviderFactory,
|
|
36
|
-
FlexibleFactory: () => FlexibleFactory
|
|
37
|
-
MailerFactory: () => MailerFactory,
|
|
38
|
-
QueueTransportFactory: () => QueueTransportFactory
|
|
36
|
+
FlexibleFactory: () => FlexibleFactory
|
|
39
37
|
});
|
|
40
38
|
module.exports = __toCommonJS(factories_exports);
|
|
41
39
|
var import_neko_mailer2 = require("@devbro/neko-mailer");
|
|
@@ -489,7 +487,10 @@ var scheduler = (0, import_neko_helper.createSingleton)(() => {
|
|
|
489
487
|
var db = /* @__PURE__ */ __name((label = "default") => (0, import_neko_context2.ctx)().getOrThrow(["database", label]), "db");
|
|
490
488
|
var storage = (0, import_neko_helper.createSingleton)((label = "default") => {
|
|
491
489
|
let storage_config = import_neko_config.config.get(["storages", label].join("."));
|
|
492
|
-
const provider = import_neko_storage.StorageProviderFactory.create(
|
|
490
|
+
const provider = import_neko_storage.StorageProviderFactory.create(
|
|
491
|
+
storage_config.provider,
|
|
492
|
+
storage_config.config
|
|
493
|
+
);
|
|
493
494
|
return new import_neko_storage.Storage(provider);
|
|
494
495
|
});
|
|
495
496
|
var cli = (0, import_neko_helper.createSingleton)(() => {
|
|
@@ -546,7 +547,7 @@ var logger = (0, import_neko_helper.createSingleton)((label) => {
|
|
|
546
547
|
});
|
|
547
548
|
var mailer = (0, import_neko_helper.createSingleton)((label) => {
|
|
548
549
|
const mailer_config = import_neko_config.config.get(["mailer", label].join("."));
|
|
549
|
-
const provider =
|
|
550
|
+
const provider = import_neko_mailer.MailerProviderFactory.create(
|
|
550
551
|
mailer_config.provider,
|
|
551
552
|
mailer_config.config
|
|
552
553
|
);
|
|
@@ -558,7 +559,10 @@ var queue = (0, import_neko_helper.createSingleton)((label) => {
|
|
|
558
559
|
if (!queue_config) {
|
|
559
560
|
throw new Error(`Queue configuration for '${label}' not found`);
|
|
560
561
|
}
|
|
561
|
-
const provider = QueueTransportFactory.create(
|
|
562
|
+
const provider = import_neko_queue.QueueTransportFactory.create(
|
|
563
|
+
queue_config.provider,
|
|
564
|
+
queue_config.config
|
|
565
|
+
);
|
|
562
566
|
const rc = new import_neko_queue.QueueConnection(provider);
|
|
563
567
|
return rc;
|
|
564
568
|
});
|
|
@@ -584,11 +588,16 @@ __export(queue_exports, {
|
|
|
584
588
|
DatabaseTransport: () => DatabaseTransport
|
|
585
589
|
});
|
|
586
590
|
__reExport(queue_exports, require("@devbro/neko-queue"));
|
|
591
|
+
|
|
592
|
+
// src/helper.mts
|
|
593
|
+
var helper_exports = {};
|
|
594
|
+
__reExport(helper_exports, require("@devbro/neko-helper"));
|
|
595
|
+
|
|
596
|
+
// src/queue.mts
|
|
587
597
|
var DatabaseTransport = class {
|
|
588
598
|
static {
|
|
589
599
|
__name(this, "DatabaseTransport");
|
|
590
600
|
}
|
|
591
|
-
activeIntervals = /* @__PURE__ */ new Set();
|
|
592
601
|
config = {
|
|
593
602
|
queue_table: "queue_messages",
|
|
594
603
|
db_connection: "default",
|
|
@@ -597,14 +606,48 @@ var DatabaseTransport = class {
|
|
|
597
606
|
message_limit: 10
|
|
598
607
|
// messages per each fetch
|
|
599
608
|
};
|
|
600
|
-
|
|
609
|
+
channels = /* @__PURE__ */ new Map();
|
|
610
|
+
messageQueues = [];
|
|
611
|
+
repeater;
|
|
612
|
+
processMessage = /* @__PURE__ */ __name(async () => {
|
|
613
|
+
const conn = db(this.config.db_connection);
|
|
614
|
+
try {
|
|
615
|
+
await conn.connect();
|
|
616
|
+
let q = conn.getQuery();
|
|
617
|
+
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();
|
|
618
|
+
for (let msg of messages) {
|
|
619
|
+
try {
|
|
620
|
+
let callback = this.channels.get(msg.channel);
|
|
621
|
+
await callback(msg.message);
|
|
622
|
+
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
623
|
+
status: "processed",
|
|
624
|
+
updated_at: /* @__PURE__ */ new Date(),
|
|
625
|
+
last_tried_at: /* @__PURE__ */ new Date(),
|
|
626
|
+
retried_count: (msg.retried_count || 0) + 1
|
|
627
|
+
});
|
|
628
|
+
} catch (error) {
|
|
629
|
+
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
630
|
+
status: "failed",
|
|
631
|
+
last_tried_at: /* @__PURE__ */ new Date(),
|
|
632
|
+
retried_count: (msg.retried_count || 0) + 1,
|
|
633
|
+
process_message: error.message || "Error processing message"
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
} catch (error) {
|
|
638
|
+
logger().error("Error in DatabaseTransport listen interval:", {
|
|
639
|
+
error
|
|
640
|
+
});
|
|
641
|
+
} finally {
|
|
642
|
+
await conn.disconnect();
|
|
643
|
+
}
|
|
644
|
+
}, "processMessage");
|
|
645
|
+
constructor(config2 = {}) {
|
|
601
646
|
this.config = { ...this.config, ...config2 };
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
setMessageLimit(limit) {
|
|
607
|
-
this.config.message_limit = limit;
|
|
647
|
+
this.repeater = (0, helper_exports.createRepeater)(
|
|
648
|
+
this.processMessage,
|
|
649
|
+
this.config.listen_interval * 1e3
|
|
650
|
+
);
|
|
608
651
|
}
|
|
609
652
|
async dispatch(channel, message) {
|
|
610
653
|
const conn = db(this.config.db_connection);
|
|
@@ -622,50 +665,22 @@ var DatabaseTransport = class {
|
|
|
622
665
|
created_at: /* @__PURE__ */ new Date(),
|
|
623
666
|
updated_at: /* @__PURE__ */ new Date(),
|
|
624
667
|
last_tried_at: null,
|
|
625
|
-
process_message: ""
|
|
668
|
+
process_message: "",
|
|
669
|
+
retried_count: 0,
|
|
670
|
+
status: "pending"
|
|
626
671
|
});
|
|
627
672
|
} finally {
|
|
628
673
|
await conn.disconnect();
|
|
629
674
|
}
|
|
630
675
|
}
|
|
631
|
-
async
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
await conn.connect();
|
|
637
|
-
let q = conn.getQuery();
|
|
638
|
-
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();
|
|
639
|
-
for (let msg of messages) {
|
|
640
|
-
try {
|
|
641
|
-
await callback(msg.message);
|
|
642
|
-
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
643
|
-
processed: true,
|
|
644
|
-
updated_at: /* @__PURE__ */ new Date()
|
|
645
|
-
});
|
|
646
|
-
} catch (error) {
|
|
647
|
-
await q.table(this.config.queue_table).whereOp("id", "=", msg.id).update({
|
|
648
|
-
processed: false,
|
|
649
|
-
last_tried_at: /* @__PURE__ */ new Date(),
|
|
650
|
-
process_message: error.message || "Error processing message"
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
} catch (error) {
|
|
655
|
-
this.activeIntervals.delete(intervalId);
|
|
656
|
-
logger().error("Error in DatabaseTransport listen interval:", { error });
|
|
657
|
-
} finally {
|
|
658
|
-
await conn.disconnect();
|
|
659
|
-
}
|
|
660
|
-
}, this.config.listen_interval * 1e3);
|
|
661
|
-
this.activeIntervals.add(intervalId);
|
|
662
|
-
});
|
|
676
|
+
async registerListener(channel, callback) {
|
|
677
|
+
this.channels.set(channel, callback);
|
|
678
|
+
}
|
|
679
|
+
async startListening() {
|
|
680
|
+
this.repeater.start();
|
|
663
681
|
}
|
|
664
682
|
async stopListening() {
|
|
665
|
-
|
|
666
|
-
clearInterval(intervalId);
|
|
667
|
-
}
|
|
668
|
-
this.activeIntervals.clear();
|
|
683
|
+
this.repeater.stop();
|
|
669
684
|
}
|
|
670
685
|
};
|
|
671
686
|
|
|
@@ -688,19 +703,7 @@ var FlexibleFactory = class {
|
|
|
688
703
|
return ctor(...args);
|
|
689
704
|
}
|
|
690
705
|
};
|
|
691
|
-
|
|
692
|
-
static {
|
|
693
|
-
__name(this, "MailerFactory");
|
|
694
|
-
}
|
|
695
|
-
static instance = new FlexibleFactory();
|
|
696
|
-
static register(key, factory) {
|
|
697
|
-
_MailerFactory.instance.register(key, factory);
|
|
698
|
-
}
|
|
699
|
-
static create(key, ...args) {
|
|
700
|
-
return _MailerFactory.instance.create(key, ...args);
|
|
701
|
-
}
|
|
702
|
-
};
|
|
703
|
-
MailerFactory.register("logger", (opt) => {
|
|
706
|
+
import_neko_mailer2.MailerProviderFactory.register("logger", (opt) => {
|
|
704
707
|
return new import_neko_mailer2.FunctionProvider((mail) => {
|
|
705
708
|
logger().info({
|
|
706
709
|
msg: "Sending email",
|
|
@@ -708,32 +711,20 @@ MailerFactory.register("logger", (opt) => {
|
|
|
708
711
|
});
|
|
709
712
|
});
|
|
710
713
|
});
|
|
711
|
-
|
|
714
|
+
import_neko_mailer2.MailerProviderFactory.register("ses", (opt) => {
|
|
712
715
|
return new import_neko_mailer2.SESProvider(opt);
|
|
713
716
|
});
|
|
714
|
-
|
|
717
|
+
import_neko_mailer2.MailerProviderFactory.register("smtp", (opt) => {
|
|
715
718
|
return new import_neko_mailer2.SMTPProvider(opt);
|
|
716
719
|
});
|
|
717
|
-
|
|
720
|
+
import_neko_mailer2.MailerProviderFactory.register("memory", (opt) => {
|
|
718
721
|
return new import_neko_mailer2.MemoryProvider();
|
|
719
722
|
});
|
|
720
|
-
|
|
721
|
-
static {
|
|
722
|
-
__name(this, "QueueTransportFactory");
|
|
723
|
-
}
|
|
724
|
-
static instance = new FlexibleFactory();
|
|
725
|
-
static register(key, factory) {
|
|
726
|
-
_QueueTransportFactory.instance.register(key, factory);
|
|
727
|
-
}
|
|
728
|
-
static create(key, ...args) {
|
|
729
|
-
return _QueueTransportFactory.instance.create(key, ...args);
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
QueueTransportFactory.register("database", (opt) => {
|
|
723
|
+
import_neko_queue3.QueueTransportFactory.register("database", (opt) => {
|
|
733
724
|
let transport = new DatabaseTransport(opt);
|
|
734
725
|
return new import_neko_queue2.QueueConnection(transport);
|
|
735
726
|
});
|
|
736
|
-
QueueTransportFactory.register("memory", (opt) => {
|
|
727
|
+
import_neko_queue3.QueueTransportFactory.register("memory", (opt) => {
|
|
737
728
|
let transport = new import_neko_queue3.MemoryTransport(opt);
|
|
738
729
|
return new import_neko_queue2.QueueConnection(transport);
|
|
739
730
|
});
|
|
@@ -770,7 +761,5 @@ import_neko_storage2.StorageProviderFactory.register("s3", (opt) => {
|
|
|
770
761
|
// Annotate the CommonJS export names for ESM import in node:
|
|
771
762
|
0 && (module.exports = {
|
|
772
763
|
CacheProviderFactory,
|
|
773
|
-
FlexibleFactory
|
|
774
|
-
MailerFactory,
|
|
775
|
-
QueueTransportFactory
|
|
764
|
+
FlexibleFactory
|
|
776
765
|
});
|