@develit-services/notification 4.0.0 → 5.1.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/dist/{export/worker.cjs → base.cjs} +18 -18
- package/dist/{export/worker.d.ts → base.d.cts} +2 -2
- package/dist/{export/worker.d.mts → base.d.mts} +2 -2
- package/dist/{export/worker.d.cts → base.d.ts} +2 -2
- package/dist/{export/worker.mjs → base.mjs} +2 -2
- package/dist/service.cjs +35 -0
- package/dist/service.d.cts +105 -0
- package/dist/service.d.mts +105 -0
- package/dist/service.d.ts +105 -0
- package/dist/service.mjs +30 -0
- package/dist/types.d.cts +0 -1
- package/dist/types.d.mts +0 -1
- package/dist/types.d.ts +0 -1
- package/package.json +13 -12
- package/dist/export/wrangler.cjs +0 -52
- package/dist/export/wrangler.d.cts +0 -53
- package/dist/export/wrangler.d.mts +0 -53
- package/dist/export/wrangler.d.ts +0 -53
- package/dist/export/wrangler.mjs +0 -50
- package/dist/shared/notification.DW8VtyNo.d.cts +0 -23
- package/dist/shared/notification.DW8VtyNo.d.mts +0 -23
- package/dist/shared/notification.DW8VtyNo.d.ts +0 -23
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
const webhook_connector = require('
|
|
4
|
+
const webhook_connector = require('./shared/notification.BLPB8Ib2.cjs');
|
|
5
5
|
require('@develit-io/backend-sdk/signature');
|
|
6
6
|
const cloudflare_workers = require('cloudflare:workers');
|
|
7
7
|
require('zod');
|
|
@@ -57,7 +57,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
57
57
|
if (kind && result) __defProp(target, key, result);
|
|
58
58
|
return result;
|
|
59
59
|
};
|
|
60
|
-
|
|
60
|
+
exports.NotificationServiceBase = class NotificationServiceBase extends backendSdk.develitWorker(
|
|
61
61
|
cloudflare_workers.WorkerEntrypoint
|
|
62
62
|
) {
|
|
63
63
|
constructor(ctx, env) {
|
|
@@ -520,48 +520,48 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
|
|
|
520
520
|
};
|
|
521
521
|
__decorateClass([
|
|
522
522
|
backendSdk.cloudflareQueue({ baseDelay: 60 })
|
|
523
|
-
], NotificationServiceBase.prototype, "queue", 1);
|
|
523
|
+
], exports.NotificationServiceBase.prototype, "queue", 1);
|
|
524
524
|
__decorateClass([
|
|
525
525
|
backendSdk.action("private-send-email")
|
|
526
|
-
], NotificationServiceBase.prototype, "_sendEmail", 1);
|
|
526
|
+
], exports.NotificationServiceBase.prototype, "_sendEmail", 1);
|
|
527
527
|
__decorateClass([
|
|
528
528
|
backendSdk.action("private-send-sms")
|
|
529
|
-
], NotificationServiceBase.prototype, "_sendSms", 1);
|
|
529
|
+
], exports.NotificationServiceBase.prototype, "_sendSms", 1);
|
|
530
530
|
__decorateClass([
|
|
531
531
|
backendSdk.action("send-email")
|
|
532
|
-
], NotificationServiceBase.prototype, "sendEmail", 1);
|
|
532
|
+
], exports.NotificationServiceBase.prototype, "sendEmail", 1);
|
|
533
533
|
__decorateClass([
|
|
534
534
|
backendSdk.action("send-email-sync")
|
|
535
|
-
], NotificationServiceBase.prototype, "sendEmailSync", 1);
|
|
535
|
+
], exports.NotificationServiceBase.prototype, "sendEmailSync", 1);
|
|
536
536
|
__decorateClass([
|
|
537
537
|
backendSdk.action("send-sms")
|
|
538
|
-
], NotificationServiceBase.prototype, "sendSms", 1);
|
|
538
|
+
], exports.NotificationServiceBase.prototype, "sendSms", 1);
|
|
539
539
|
__decorateClass([
|
|
540
540
|
backendSdk.action("send-push-notification")
|
|
541
|
-
], NotificationServiceBase.prototype, "_sendPushNotification", 1);
|
|
541
|
+
], exports.NotificationServiceBase.prototype, "_sendPushNotification", 1);
|
|
542
542
|
__decorateClass([
|
|
543
543
|
backendSdk.action("send-slack-notification")
|
|
544
|
-
], NotificationServiceBase.prototype, "sendSlackNotification", 1);
|
|
544
|
+
], exports.NotificationServiceBase.prototype, "sendSlackNotification", 1);
|
|
545
545
|
__decorateClass([
|
|
546
546
|
backendSdk.action("send-webhook")
|
|
547
|
-
], NotificationServiceBase.prototype, "sendWebhook", 1);
|
|
547
|
+
], exports.NotificationServiceBase.prototype, "sendWebhook", 1);
|
|
548
548
|
__decorateClass([
|
|
549
549
|
backendSdk.action("private-send-webhook")
|
|
550
|
-
], NotificationServiceBase.prototype, "_sendWebhook", 1);
|
|
550
|
+
], exports.NotificationServiceBase.prototype, "_sendWebhook", 1);
|
|
551
551
|
__decorateClass([
|
|
552
552
|
backendSdk.action("get-received-emails")
|
|
553
|
-
], NotificationServiceBase.prototype, "getReceivedEmails", 1);
|
|
553
|
+
], exports.NotificationServiceBase.prototype, "getReceivedEmails", 1);
|
|
554
554
|
__decorateClass([
|
|
555
555
|
backendSdk.action("wait-for-email")
|
|
556
|
-
], NotificationServiceBase.prototype, "waitForEmail", 1);
|
|
556
|
+
], exports.NotificationServiceBase.prototype, "waitForEmail", 1);
|
|
557
557
|
__decorateClass([
|
|
558
558
|
backendSdk.action("clear-received-emails")
|
|
559
|
-
], NotificationServiceBase.prototype, "clearReceivedEmails", 1);
|
|
560
|
-
NotificationServiceBase = __decorateClass([
|
|
559
|
+
], exports.NotificationServiceBase.prototype, "clearReceivedEmails", 1);
|
|
560
|
+
exports.NotificationServiceBase = __decorateClass([
|
|
561
561
|
backendSdk.service("notification")
|
|
562
|
-
], NotificationServiceBase);
|
|
562
|
+
], exports.NotificationServiceBase);
|
|
563
563
|
function defineNotificationService() {
|
|
564
|
-
return class NotificationService extends NotificationServiceBase {
|
|
564
|
+
return class NotificationService extends exports.NotificationServiceBase {
|
|
565
565
|
constructor(ctx, env) {
|
|
566
566
|
super(ctx, env);
|
|
567
567
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { S as SlackConnector, W as WebhookConnector, I as IEmailConnector, a as ISmsConnector, N as NotificationQueueMessage, b as SendEmailInput, c as SendEmailOutput, d as SendSmsInput, e as SendSmsOutput, f as SendSlackInput, g as SendSlackOutput, h as SendWebhookInput, i as SendWebhookOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, k as WaitForEmailInput, l as WaitForEmailOutput, C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput } from '
|
|
3
|
+
import { S as SlackConnector, W as WebhookConnector, I as IEmailConnector, a as ISmsConnector, N as NotificationQueueMessage, b as SendEmailInput, c as SendEmailOutput, d as SendSmsInput, e as SendSmsOutput, f as SendSlackInput, g as SendSlackOutput, h as SendWebhookInput, i as SendWebhookOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, k as WaitForEmailInput, l as WaitForEmailOutput, C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput } from './shared/notification.BiG4Q650.cjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'zod/v4';
|
|
@@ -43,4 +43,4 @@ declare class NotificationServiceBase extends NotificationServiceBase_base {
|
|
|
43
43
|
}
|
|
44
44
|
declare function defineNotificationService(): typeof NotificationServiceBase;
|
|
45
45
|
|
|
46
|
-
export { defineNotificationService };
|
|
46
|
+
export { NotificationServiceBase, defineNotificationService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { S as SlackConnector, W as WebhookConnector, I as IEmailConnector, a as ISmsConnector, N as NotificationQueueMessage, b as SendEmailInput, c as SendEmailOutput, d as SendSmsInput, e as SendSmsOutput, f as SendSlackInput, g as SendSlackOutput, h as SendWebhookInput, i as SendWebhookOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, k as WaitForEmailInput, l as WaitForEmailOutput, C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput } from '
|
|
3
|
+
import { S as SlackConnector, W as WebhookConnector, I as IEmailConnector, a as ISmsConnector, N as NotificationQueueMessage, b as SendEmailInput, c as SendEmailOutput, d as SendSmsInput, e as SendSmsOutput, f as SendSlackInput, g as SendSlackOutput, h as SendWebhookInput, i as SendWebhookOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, k as WaitForEmailInput, l as WaitForEmailOutput, C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput } from './shared/notification.BiG4Q650.mjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'zod/v4';
|
|
@@ -43,4 +43,4 @@ declare class NotificationServiceBase extends NotificationServiceBase_base {
|
|
|
43
43
|
}
|
|
44
44
|
declare function defineNotificationService(): typeof NotificationServiceBase;
|
|
45
45
|
|
|
46
|
-
export { defineNotificationService };
|
|
46
|
+
export { NotificationServiceBase, defineNotificationService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { S as SlackConnector, W as WebhookConnector, I as IEmailConnector, a as ISmsConnector, N as NotificationQueueMessage, b as SendEmailInput, c as SendEmailOutput, d as SendSmsInput, e as SendSmsOutput, f as SendSlackInput, g as SendSlackOutput, h as SendWebhookInput, i as SendWebhookOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, k as WaitForEmailInput, l as WaitForEmailOutput, C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput } from '
|
|
3
|
+
import { S as SlackConnector, W as WebhookConnector, I as IEmailConnector, a as ISmsConnector, N as NotificationQueueMessage, b as SendEmailInput, c as SendEmailOutput, d as SendSmsInput, e as SendSmsOutput, f as SendSlackInput, g as SendSlackOutput, h as SendWebhookInput, i as SendWebhookOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, k as WaitForEmailInput, l as WaitForEmailOutput, C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput } from './shared/notification.BiG4Q650.js';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'zod/v4';
|
|
@@ -43,4 +43,4 @@ declare class NotificationServiceBase extends NotificationServiceBase_base {
|
|
|
43
43
|
}
|
|
44
44
|
declare function defineNotificationService(): typeof NotificationServiceBase;
|
|
45
45
|
|
|
46
|
-
export { defineNotificationService };
|
|
46
|
+
export { NotificationServiceBase, defineNotificationService };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createInternalError, develitWorker, uuidv4, cloudflareQueue, action, service } from '@develit-io/backend-sdk';
|
|
2
|
-
import { E as EcomailConnector, T as TwilioConnector, S as SlackConnector, s as sendEmailInputSchema, f as sendSmsInputSchema, e as sendSlackInputSchema, h as sendWebhookInputSchema, W as WebhookConnector, g as getReceivedEmailsInputSchema, w as waitForEmailInputSchema, c as clearReceivedEmailsInputSchema } from '
|
|
2
|
+
import { E as EcomailConnector, T as TwilioConnector, S as SlackConnector, s as sendEmailInputSchema, f as sendSmsInputSchema, e as sendSlackInputSchema, h as sendWebhookInputSchema, W as WebhookConnector, g as getReceivedEmailsInputSchema, w as waitForEmailInputSchema, c as clearReceivedEmailsInputSchema } from './shared/notification.CP_hFlNt.mjs';
|
|
3
3
|
import '@develit-io/backend-sdk/signature';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import 'zod';
|
|
@@ -566,4 +566,4 @@ function defineNotificationService() {
|
|
|
566
566
|
};
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
-
export { defineNotificationService };
|
|
569
|
+
export { NotificationServiceBase, defineNotificationService };
|
package/dist/service.cjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const serviceConfig = require('@develit-io/platform-sdk/service-config');
|
|
4
|
+
|
|
5
|
+
const NOTIFICATION_SERVICE_BINDINGS = {
|
|
6
|
+
SECRETS_STORE: { kind: "service", target: "secrets-store" },
|
|
7
|
+
RECEIVED_EMAILS_KV: { kind: "kv", suffix: "received-emails" },
|
|
8
|
+
NOTIFICATIONS_QUEUE: { kind: "queueProducer", suffix: "notifications" },
|
|
9
|
+
AUDIT_LOGS_QUEUE: { kind: "queueProducer", suffix: "audit-logs" }
|
|
10
|
+
};
|
|
11
|
+
const NOTIFICATION_SERVICE_QUEUE_CONSUMERS = [
|
|
12
|
+
{
|
|
13
|
+
suffix: "notifications",
|
|
14
|
+
maxBatchSize: 1,
|
|
15
|
+
maxBatchTimeout: 5,
|
|
16
|
+
deadLetterQueueSuffix: "notifications-dlq"
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
const notificationServiceConfig = serviceConfig.createTypedServiceConfigFactory()(
|
|
20
|
+
NOTIFICATION_SERVICE_BINDINGS,
|
|
21
|
+
NOTIFICATION_SERVICE_QUEUE_CONSUMERS
|
|
22
|
+
);
|
|
23
|
+
function createNotificationService(config) {
|
|
24
|
+
return (deployment, bindings) => ({
|
|
25
|
+
resourceName: "notification",
|
|
26
|
+
variables: config.vars[serviceConfig.configKeyFor(deployment.environment)],
|
|
27
|
+
bindings,
|
|
28
|
+
crons: config.triggers.crons[serviceConfig.configKeyFor(deployment.environment)]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.NOTIFICATION_SERVICE_BINDINGS = NOTIFICATION_SERVICE_BINDINGS;
|
|
33
|
+
exports.NOTIFICATION_SERVICE_QUEUE_CONSUMERS = NOTIFICATION_SERVICE_QUEUE_CONSUMERS;
|
|
34
|
+
exports.createNotificationService = createNotificationService;
|
|
35
|
+
exports.notificationServiceConfig = notificationServiceConfig;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as _develit_io_platform_sdk from '@develit-io/platform-sdk';
|
|
2
|
+
import { Deployment } from '@develit-io/platform-sdk';
|
|
3
|
+
import { BindingsFromDescriptor } from '@develit-io/platform-sdk/service-config';
|
|
4
|
+
|
|
5
|
+
interface NotificationServiceVariables {
|
|
6
|
+
EMAIL_PROVIDER: string;
|
|
7
|
+
EMAIL_SENDER_EMAIL: string;
|
|
8
|
+
EMAIL_SENDER_NAME: string;
|
|
9
|
+
EMAIL_SMTP_HOST: string;
|
|
10
|
+
SMS_PROVIDER: string;
|
|
11
|
+
SLACK_WEBHOOK: string;
|
|
12
|
+
EMAIL_WHITELIST: string;
|
|
13
|
+
EMAIL_WHITELIST_FALLBACK: string;
|
|
14
|
+
[key: string]: string | number | boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const NOTIFICATION_SERVICE_BINDINGS: {
|
|
17
|
+
readonly SECRETS_STORE: {
|
|
18
|
+
readonly kind: "service";
|
|
19
|
+
readonly target: "secrets-store";
|
|
20
|
+
};
|
|
21
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
22
|
+
readonly kind: "kv";
|
|
23
|
+
readonly suffix: "received-emails";
|
|
24
|
+
};
|
|
25
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
26
|
+
readonly kind: "queueProducer";
|
|
27
|
+
readonly suffix: "notifications";
|
|
28
|
+
};
|
|
29
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
30
|
+
readonly kind: "queueProducer";
|
|
31
|
+
readonly suffix: "audit-logs";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
declare const NOTIFICATION_SERVICE_QUEUE_CONSUMERS: readonly [{
|
|
35
|
+
readonly suffix: "notifications";
|
|
36
|
+
readonly maxBatchSize: 1;
|
|
37
|
+
readonly maxBatchTimeout: 5;
|
|
38
|
+
readonly deadLetterQueueSuffix: "notifications-dlq";
|
|
39
|
+
}];
|
|
40
|
+
declare const notificationServiceConfig: (project: string, version: string, options?: _develit_io_platform_sdk.ServiceConfigOptions<NotificationServiceVariables, _develit_io_platform_sdk.MiniflareIds<{
|
|
41
|
+
readonly SECRETS_STORE: {
|
|
42
|
+
readonly kind: "service";
|
|
43
|
+
readonly target: "secrets-store";
|
|
44
|
+
};
|
|
45
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
46
|
+
readonly kind: "kv";
|
|
47
|
+
readonly suffix: "received-emails";
|
|
48
|
+
};
|
|
49
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
50
|
+
readonly kind: "queueProducer";
|
|
51
|
+
readonly suffix: "notifications";
|
|
52
|
+
};
|
|
53
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
54
|
+
readonly kind: "queueProducer";
|
|
55
|
+
readonly suffix: "audit-logs";
|
|
56
|
+
};
|
|
57
|
+
}>> | undefined) => _develit_io_platform_sdk.ServiceConfigWithBindings<NotificationServiceVariables, {
|
|
58
|
+
readonly SECRETS_STORE: {
|
|
59
|
+
readonly kind: "service";
|
|
60
|
+
readonly target: "secrets-store";
|
|
61
|
+
};
|
|
62
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
63
|
+
readonly kind: "kv";
|
|
64
|
+
readonly suffix: "received-emails";
|
|
65
|
+
};
|
|
66
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
67
|
+
readonly kind: "queueProducer";
|
|
68
|
+
readonly suffix: "notifications";
|
|
69
|
+
};
|
|
70
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
71
|
+
readonly kind: "queueProducer";
|
|
72
|
+
readonly suffix: "audit-logs";
|
|
73
|
+
};
|
|
74
|
+
}, readonly [{
|
|
75
|
+
readonly suffix: "notifications";
|
|
76
|
+
readonly maxBatchSize: 1;
|
|
77
|
+
readonly maxBatchTimeout: 5;
|
|
78
|
+
readonly deadLetterQueueSuffix: "notifications-dlq";
|
|
79
|
+
}]>;
|
|
80
|
+
declare function createNotificationService(config: ReturnType<typeof notificationServiceConfig>): (deployment: Deployment, bindings: BindingsFromDescriptor<typeof NOTIFICATION_SERVICE_BINDINGS>) => {
|
|
81
|
+
resourceName: "notification";
|
|
82
|
+
variables: NotificationServiceVariables;
|
|
83
|
+
bindings: BindingsFromDescriptor<{
|
|
84
|
+
readonly SECRETS_STORE: {
|
|
85
|
+
readonly kind: "service";
|
|
86
|
+
readonly target: "secrets-store";
|
|
87
|
+
};
|
|
88
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
89
|
+
readonly kind: "kv";
|
|
90
|
+
readonly suffix: "received-emails";
|
|
91
|
+
};
|
|
92
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
93
|
+
readonly kind: "queueProducer";
|
|
94
|
+
readonly suffix: "notifications";
|
|
95
|
+
};
|
|
96
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
97
|
+
readonly kind: "queueProducer";
|
|
98
|
+
readonly suffix: "audit-logs";
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
101
|
+
crons: string[];
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { NOTIFICATION_SERVICE_BINDINGS, NOTIFICATION_SERVICE_QUEUE_CONSUMERS, createNotificationService, notificationServiceConfig };
|
|
105
|
+
export type { NotificationServiceVariables };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as _develit_io_platform_sdk from '@develit-io/platform-sdk';
|
|
2
|
+
import { Deployment } from '@develit-io/platform-sdk';
|
|
3
|
+
import { BindingsFromDescriptor } from '@develit-io/platform-sdk/service-config';
|
|
4
|
+
|
|
5
|
+
interface NotificationServiceVariables {
|
|
6
|
+
EMAIL_PROVIDER: string;
|
|
7
|
+
EMAIL_SENDER_EMAIL: string;
|
|
8
|
+
EMAIL_SENDER_NAME: string;
|
|
9
|
+
EMAIL_SMTP_HOST: string;
|
|
10
|
+
SMS_PROVIDER: string;
|
|
11
|
+
SLACK_WEBHOOK: string;
|
|
12
|
+
EMAIL_WHITELIST: string;
|
|
13
|
+
EMAIL_WHITELIST_FALLBACK: string;
|
|
14
|
+
[key: string]: string | number | boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const NOTIFICATION_SERVICE_BINDINGS: {
|
|
17
|
+
readonly SECRETS_STORE: {
|
|
18
|
+
readonly kind: "service";
|
|
19
|
+
readonly target: "secrets-store";
|
|
20
|
+
};
|
|
21
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
22
|
+
readonly kind: "kv";
|
|
23
|
+
readonly suffix: "received-emails";
|
|
24
|
+
};
|
|
25
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
26
|
+
readonly kind: "queueProducer";
|
|
27
|
+
readonly suffix: "notifications";
|
|
28
|
+
};
|
|
29
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
30
|
+
readonly kind: "queueProducer";
|
|
31
|
+
readonly suffix: "audit-logs";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
declare const NOTIFICATION_SERVICE_QUEUE_CONSUMERS: readonly [{
|
|
35
|
+
readonly suffix: "notifications";
|
|
36
|
+
readonly maxBatchSize: 1;
|
|
37
|
+
readonly maxBatchTimeout: 5;
|
|
38
|
+
readonly deadLetterQueueSuffix: "notifications-dlq";
|
|
39
|
+
}];
|
|
40
|
+
declare const notificationServiceConfig: (project: string, version: string, options?: _develit_io_platform_sdk.ServiceConfigOptions<NotificationServiceVariables, _develit_io_platform_sdk.MiniflareIds<{
|
|
41
|
+
readonly SECRETS_STORE: {
|
|
42
|
+
readonly kind: "service";
|
|
43
|
+
readonly target: "secrets-store";
|
|
44
|
+
};
|
|
45
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
46
|
+
readonly kind: "kv";
|
|
47
|
+
readonly suffix: "received-emails";
|
|
48
|
+
};
|
|
49
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
50
|
+
readonly kind: "queueProducer";
|
|
51
|
+
readonly suffix: "notifications";
|
|
52
|
+
};
|
|
53
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
54
|
+
readonly kind: "queueProducer";
|
|
55
|
+
readonly suffix: "audit-logs";
|
|
56
|
+
};
|
|
57
|
+
}>> | undefined) => _develit_io_platform_sdk.ServiceConfigWithBindings<NotificationServiceVariables, {
|
|
58
|
+
readonly SECRETS_STORE: {
|
|
59
|
+
readonly kind: "service";
|
|
60
|
+
readonly target: "secrets-store";
|
|
61
|
+
};
|
|
62
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
63
|
+
readonly kind: "kv";
|
|
64
|
+
readonly suffix: "received-emails";
|
|
65
|
+
};
|
|
66
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
67
|
+
readonly kind: "queueProducer";
|
|
68
|
+
readonly suffix: "notifications";
|
|
69
|
+
};
|
|
70
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
71
|
+
readonly kind: "queueProducer";
|
|
72
|
+
readonly suffix: "audit-logs";
|
|
73
|
+
};
|
|
74
|
+
}, readonly [{
|
|
75
|
+
readonly suffix: "notifications";
|
|
76
|
+
readonly maxBatchSize: 1;
|
|
77
|
+
readonly maxBatchTimeout: 5;
|
|
78
|
+
readonly deadLetterQueueSuffix: "notifications-dlq";
|
|
79
|
+
}]>;
|
|
80
|
+
declare function createNotificationService(config: ReturnType<typeof notificationServiceConfig>): (deployment: Deployment, bindings: BindingsFromDescriptor<typeof NOTIFICATION_SERVICE_BINDINGS>) => {
|
|
81
|
+
resourceName: "notification";
|
|
82
|
+
variables: NotificationServiceVariables;
|
|
83
|
+
bindings: BindingsFromDescriptor<{
|
|
84
|
+
readonly SECRETS_STORE: {
|
|
85
|
+
readonly kind: "service";
|
|
86
|
+
readonly target: "secrets-store";
|
|
87
|
+
};
|
|
88
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
89
|
+
readonly kind: "kv";
|
|
90
|
+
readonly suffix: "received-emails";
|
|
91
|
+
};
|
|
92
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
93
|
+
readonly kind: "queueProducer";
|
|
94
|
+
readonly suffix: "notifications";
|
|
95
|
+
};
|
|
96
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
97
|
+
readonly kind: "queueProducer";
|
|
98
|
+
readonly suffix: "audit-logs";
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
101
|
+
crons: string[];
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { NOTIFICATION_SERVICE_BINDINGS, NOTIFICATION_SERVICE_QUEUE_CONSUMERS, createNotificationService, notificationServiceConfig };
|
|
105
|
+
export type { NotificationServiceVariables };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as _develit_io_platform_sdk from '@develit-io/platform-sdk';
|
|
2
|
+
import { Deployment } from '@develit-io/platform-sdk';
|
|
3
|
+
import { BindingsFromDescriptor } from '@develit-io/platform-sdk/service-config';
|
|
4
|
+
|
|
5
|
+
interface NotificationServiceVariables {
|
|
6
|
+
EMAIL_PROVIDER: string;
|
|
7
|
+
EMAIL_SENDER_EMAIL: string;
|
|
8
|
+
EMAIL_SENDER_NAME: string;
|
|
9
|
+
EMAIL_SMTP_HOST: string;
|
|
10
|
+
SMS_PROVIDER: string;
|
|
11
|
+
SLACK_WEBHOOK: string;
|
|
12
|
+
EMAIL_WHITELIST: string;
|
|
13
|
+
EMAIL_WHITELIST_FALLBACK: string;
|
|
14
|
+
[key: string]: string | number | boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const NOTIFICATION_SERVICE_BINDINGS: {
|
|
17
|
+
readonly SECRETS_STORE: {
|
|
18
|
+
readonly kind: "service";
|
|
19
|
+
readonly target: "secrets-store";
|
|
20
|
+
};
|
|
21
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
22
|
+
readonly kind: "kv";
|
|
23
|
+
readonly suffix: "received-emails";
|
|
24
|
+
};
|
|
25
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
26
|
+
readonly kind: "queueProducer";
|
|
27
|
+
readonly suffix: "notifications";
|
|
28
|
+
};
|
|
29
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
30
|
+
readonly kind: "queueProducer";
|
|
31
|
+
readonly suffix: "audit-logs";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
declare const NOTIFICATION_SERVICE_QUEUE_CONSUMERS: readonly [{
|
|
35
|
+
readonly suffix: "notifications";
|
|
36
|
+
readonly maxBatchSize: 1;
|
|
37
|
+
readonly maxBatchTimeout: 5;
|
|
38
|
+
readonly deadLetterQueueSuffix: "notifications-dlq";
|
|
39
|
+
}];
|
|
40
|
+
declare const notificationServiceConfig: (project: string, version: string, options?: _develit_io_platform_sdk.ServiceConfigOptions<NotificationServiceVariables, _develit_io_platform_sdk.MiniflareIds<{
|
|
41
|
+
readonly SECRETS_STORE: {
|
|
42
|
+
readonly kind: "service";
|
|
43
|
+
readonly target: "secrets-store";
|
|
44
|
+
};
|
|
45
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
46
|
+
readonly kind: "kv";
|
|
47
|
+
readonly suffix: "received-emails";
|
|
48
|
+
};
|
|
49
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
50
|
+
readonly kind: "queueProducer";
|
|
51
|
+
readonly suffix: "notifications";
|
|
52
|
+
};
|
|
53
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
54
|
+
readonly kind: "queueProducer";
|
|
55
|
+
readonly suffix: "audit-logs";
|
|
56
|
+
};
|
|
57
|
+
}>> | undefined) => _develit_io_platform_sdk.ServiceConfigWithBindings<NotificationServiceVariables, {
|
|
58
|
+
readonly SECRETS_STORE: {
|
|
59
|
+
readonly kind: "service";
|
|
60
|
+
readonly target: "secrets-store";
|
|
61
|
+
};
|
|
62
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
63
|
+
readonly kind: "kv";
|
|
64
|
+
readonly suffix: "received-emails";
|
|
65
|
+
};
|
|
66
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
67
|
+
readonly kind: "queueProducer";
|
|
68
|
+
readonly suffix: "notifications";
|
|
69
|
+
};
|
|
70
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
71
|
+
readonly kind: "queueProducer";
|
|
72
|
+
readonly suffix: "audit-logs";
|
|
73
|
+
};
|
|
74
|
+
}, readonly [{
|
|
75
|
+
readonly suffix: "notifications";
|
|
76
|
+
readonly maxBatchSize: 1;
|
|
77
|
+
readonly maxBatchTimeout: 5;
|
|
78
|
+
readonly deadLetterQueueSuffix: "notifications-dlq";
|
|
79
|
+
}]>;
|
|
80
|
+
declare function createNotificationService(config: ReturnType<typeof notificationServiceConfig>): (deployment: Deployment, bindings: BindingsFromDescriptor<typeof NOTIFICATION_SERVICE_BINDINGS>) => {
|
|
81
|
+
resourceName: "notification";
|
|
82
|
+
variables: NotificationServiceVariables;
|
|
83
|
+
bindings: BindingsFromDescriptor<{
|
|
84
|
+
readonly SECRETS_STORE: {
|
|
85
|
+
readonly kind: "service";
|
|
86
|
+
readonly target: "secrets-store";
|
|
87
|
+
};
|
|
88
|
+
readonly RECEIVED_EMAILS_KV: {
|
|
89
|
+
readonly kind: "kv";
|
|
90
|
+
readonly suffix: "received-emails";
|
|
91
|
+
};
|
|
92
|
+
readonly NOTIFICATIONS_QUEUE: {
|
|
93
|
+
readonly kind: "queueProducer";
|
|
94
|
+
readonly suffix: "notifications";
|
|
95
|
+
};
|
|
96
|
+
readonly AUDIT_LOGS_QUEUE: {
|
|
97
|
+
readonly kind: "queueProducer";
|
|
98
|
+
readonly suffix: "audit-logs";
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
101
|
+
crons: string[];
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { NOTIFICATION_SERVICE_BINDINGS, NOTIFICATION_SERVICE_QUEUE_CONSUMERS, createNotificationService, notificationServiceConfig };
|
|
105
|
+
export type { NotificationServiceVariables };
|
package/dist/service.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createTypedServiceConfigFactory, configKeyFor } from '@develit-io/platform-sdk/service-config';
|
|
2
|
+
|
|
3
|
+
const NOTIFICATION_SERVICE_BINDINGS = {
|
|
4
|
+
SECRETS_STORE: { kind: "service", target: "secrets-store" },
|
|
5
|
+
RECEIVED_EMAILS_KV: { kind: "kv", suffix: "received-emails" },
|
|
6
|
+
NOTIFICATIONS_QUEUE: { kind: "queueProducer", suffix: "notifications" },
|
|
7
|
+
AUDIT_LOGS_QUEUE: { kind: "queueProducer", suffix: "audit-logs" }
|
|
8
|
+
};
|
|
9
|
+
const NOTIFICATION_SERVICE_QUEUE_CONSUMERS = [
|
|
10
|
+
{
|
|
11
|
+
suffix: "notifications",
|
|
12
|
+
maxBatchSize: 1,
|
|
13
|
+
maxBatchTimeout: 5,
|
|
14
|
+
deadLetterQueueSuffix: "notifications-dlq"
|
|
15
|
+
}
|
|
16
|
+
];
|
|
17
|
+
const notificationServiceConfig = createTypedServiceConfigFactory()(
|
|
18
|
+
NOTIFICATION_SERVICE_BINDINGS,
|
|
19
|
+
NOTIFICATION_SERVICE_QUEUE_CONSUMERS
|
|
20
|
+
);
|
|
21
|
+
function createNotificationService(config) {
|
|
22
|
+
return (deployment, bindings) => ({
|
|
23
|
+
resourceName: "notification",
|
|
24
|
+
variables: config.vars[configKeyFor(deployment.environment)],
|
|
25
|
+
bindings,
|
|
26
|
+
crons: config.triggers.crons[configKeyFor(deployment.environment)]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { NOTIFICATION_SERVICE_BINDINGS, NOTIFICATION_SERVICE_QUEUE_CONSUMERS, createNotificationService, notificationServiceConfig };
|
package/dist/types.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { I as IEmailConnector, n as IEmail, o as IContact, a as ISmsConnector, p as ISms } from './shared/notification.BiG4Q650.cjs';
|
|
2
2
|
export { C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, q as IAttachment, r as IPushNotification, s as ISlack, t as IWebhook, N as NotificationQueueMessage, R as ReceivedEmail, b as SendEmailInput, c as SendEmailOutput, f as SendSlackInput, g as SendSlackOutput, d as SendSmsInput, e as SendSmsOutput, h as SendWebhookInput, i as SendWebhookOutput, S as SlackConnector, k as WaitForEmailInput, l as WaitForEmailOutput, W as WebhookConnector, u as clearReceivedEmailsInputSchema, v as getReceivedEmailsInputSchema, w as iAttachmentSchema, x as iContactSchema, y as iEmailSchema, z as sendEmailInputSchema, A as sendSlackInputSchema, B as sendSmsInputSchema, D as sendWebhookInputSchema, E as waitForEmailInputSchema } from './shared/notification.BiG4Q650.cjs';
|
|
3
3
|
import twilio from 'twilio';
|
|
4
|
-
export { a as NotificationServiceEnv, N as NotificationServiceWranglerConfig } from './shared/notification.DW8VtyNo.cjs';
|
|
5
4
|
import 'zod';
|
|
6
5
|
import 'zod/v4';
|
|
7
6
|
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { I as IEmailConnector, n as IEmail, o as IContact, a as ISmsConnector, p as ISms } from './shared/notification.BiG4Q650.mjs';
|
|
2
2
|
export { C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, q as IAttachment, r as IPushNotification, s as ISlack, t as IWebhook, N as NotificationQueueMessage, R as ReceivedEmail, b as SendEmailInput, c as SendEmailOutput, f as SendSlackInput, g as SendSlackOutput, d as SendSmsInput, e as SendSmsOutput, h as SendWebhookInput, i as SendWebhookOutput, S as SlackConnector, k as WaitForEmailInput, l as WaitForEmailOutput, W as WebhookConnector, u as clearReceivedEmailsInputSchema, v as getReceivedEmailsInputSchema, w as iAttachmentSchema, x as iContactSchema, y as iEmailSchema, z as sendEmailInputSchema, A as sendSlackInputSchema, B as sendSmsInputSchema, D as sendWebhookInputSchema, E as waitForEmailInputSchema } from './shared/notification.BiG4Q650.mjs';
|
|
3
3
|
import twilio from 'twilio';
|
|
4
|
-
export { a as NotificationServiceEnv, N as NotificationServiceWranglerConfig } from './shared/notification.DW8VtyNo.mjs';
|
|
5
4
|
import 'zod';
|
|
6
5
|
import 'zod/v4';
|
|
7
6
|
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { I as IEmailConnector, n as IEmail, o as IContact, a as ISmsConnector, p as ISms } from './shared/notification.BiG4Q650.js';
|
|
2
2
|
export { C as ClearReceivedEmailsInput, m as ClearReceivedEmailsOutput, G as GetReceivedEmailsInput, j as GetReceivedEmailsOutput, q as IAttachment, r as IPushNotification, s as ISlack, t as IWebhook, N as NotificationQueueMessage, R as ReceivedEmail, b as SendEmailInput, c as SendEmailOutput, f as SendSlackInput, g as SendSlackOutput, d as SendSmsInput, e as SendSmsOutput, h as SendWebhookInput, i as SendWebhookOutput, S as SlackConnector, k as WaitForEmailInput, l as WaitForEmailOutput, W as WebhookConnector, u as clearReceivedEmailsInputSchema, v as getReceivedEmailsInputSchema, w as iAttachmentSchema, x as iContactSchema, y as iEmailSchema, z as sendEmailInputSchema, A as sendSlackInputSchema, B as sendSmsInputSchema, D as sendWebhookInputSchema, E as waitForEmailInputSchema } from './shared/notification.BiG4Q650.js';
|
|
3
3
|
import twilio from 'twilio';
|
|
4
|
-
export { a as NotificationServiceEnv, N as NotificationServiceWranglerConfig } from './shared/notification.DW8VtyNo.js';
|
|
5
4
|
import 'zod';
|
|
6
5
|
import 'zod/v4';
|
|
7
6
|
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develit-services/notification",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"author": "Develit.io s.r.o.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
"./
|
|
8
|
-
"types": "./dist/
|
|
9
|
-
"import": "./dist/
|
|
10
|
-
"require": "./dist/
|
|
11
|
-
},
|
|
12
|
-
"./worker": {
|
|
13
|
-
"types": "./dist/export/worker.d.ts",
|
|
14
|
-
"import": "./dist/export/worker.mjs",
|
|
15
|
-
"require": "./dist/export/worker.cjs"
|
|
7
|
+
"./base": {
|
|
8
|
+
"types": "./dist/base.d.ts",
|
|
9
|
+
"import": "./dist/base.mjs",
|
|
10
|
+
"require": "./dist/base.cjs"
|
|
16
11
|
},
|
|
17
12
|
"./@types": {
|
|
18
13
|
"types": "./dist/types.d.ts",
|
|
19
14
|
"import": "./dist/types.mjs",
|
|
20
15
|
"require": "./dist/types.cjs"
|
|
21
16
|
},
|
|
22
|
-
"./package.json": "./package.json"
|
|
17
|
+
"./package.json": "./package.json",
|
|
18
|
+
"./service": {
|
|
19
|
+
"types": "./dist/service.d.ts",
|
|
20
|
+
"import": "./dist/service.mjs",
|
|
21
|
+
"require": "./dist/service.cjs"
|
|
22
|
+
}
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"./dist"
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@develit-io/backend-sdk": "^11.0.2",
|
|
44
|
-
"zod": "^4.1.13"
|
|
44
|
+
"zod": "^4.1.13",
|
|
45
|
+
"@develit-io/platform-sdk": "^4.1.1"
|
|
45
46
|
}
|
|
46
47
|
}
|
package/dist/export/wrangler.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
-
|
|
5
|
-
function defineNotificationServiceWrangler(config) {
|
|
6
|
-
const { project, name, vars, kv } = config;
|
|
7
|
-
const base = {
|
|
8
|
-
...backendSdk.composeWranglerBase({
|
|
9
|
-
project,
|
|
10
|
-
name
|
|
11
|
-
}),
|
|
12
|
-
vars: {
|
|
13
|
-
ENVIRONMENT: "localhost",
|
|
14
|
-
...vars
|
|
15
|
-
},
|
|
16
|
-
services: [
|
|
17
|
-
{
|
|
18
|
-
binding: "SECRETS_STORE",
|
|
19
|
-
service: `${project}-secrets-store`
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
kv_namespaces: kv ? [
|
|
23
|
-
{
|
|
24
|
-
binding: "RECEIVED_EMAILS_KV",
|
|
25
|
-
id: kv.id
|
|
26
|
-
}
|
|
27
|
-
] : [],
|
|
28
|
-
queues: {
|
|
29
|
-
producers: [
|
|
30
|
-
{
|
|
31
|
-
binding: "NOTIFICATIONS_QUEUE",
|
|
32
|
-
queue: `${project}-notifications`
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
binding: "AUDIT_LOGS_QUEUE",
|
|
36
|
-
queue: `${project}-audit-logs`
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
consumers: [
|
|
40
|
-
{
|
|
41
|
-
queue: `${project}-notifications`,
|
|
42
|
-
max_batch_size: 1,
|
|
43
|
-
max_batch_timeout: 5,
|
|
44
|
-
dead_letter_queue: `${project}-notifications-dlq`
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
return base;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
exports.defineNotificationServiceWrangler = defineNotificationServiceWrangler;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { N as NotificationServiceWranglerConfig } from '../shared/notification.DW8VtyNo.cjs';
|
|
2
|
-
|
|
3
|
-
declare function defineNotificationServiceWrangler(config: NotificationServiceWranglerConfig): {
|
|
4
|
-
vars: {
|
|
5
|
-
VERSION: string;
|
|
6
|
-
EMAIL_PROVIDER: "ecomail";
|
|
7
|
-
EMAIL_SENDER_EMAIL: string;
|
|
8
|
-
EMAIL_SENDER_NAME: string;
|
|
9
|
-
EMAIL_SMTP_HOST: string;
|
|
10
|
-
SMS_PROVIDER: "twilio";
|
|
11
|
-
SLACK_WEBHOOK: string;
|
|
12
|
-
EMAIL_WHITELIST?: string;
|
|
13
|
-
EMAIL_WHITELIST_FALLBACK?: string;
|
|
14
|
-
ENVIRONMENT: string;
|
|
15
|
-
};
|
|
16
|
-
services: {
|
|
17
|
-
binding: string;
|
|
18
|
-
service: string;
|
|
19
|
-
}[];
|
|
20
|
-
kv_namespaces: {
|
|
21
|
-
binding: string;
|
|
22
|
-
id: string;
|
|
23
|
-
}[];
|
|
24
|
-
queues: {
|
|
25
|
-
producers: {
|
|
26
|
-
binding: string;
|
|
27
|
-
queue: string;
|
|
28
|
-
}[];
|
|
29
|
-
consumers: {
|
|
30
|
-
queue: string;
|
|
31
|
-
max_batch_size: number;
|
|
32
|
-
max_batch_timeout: number;
|
|
33
|
-
dead_letter_queue: string;
|
|
34
|
-
}[];
|
|
35
|
-
};
|
|
36
|
-
$schema: string;
|
|
37
|
-
name: string;
|
|
38
|
-
main: string;
|
|
39
|
-
compatibility_date: string;
|
|
40
|
-
compatibility_flags: string[];
|
|
41
|
-
observability: {
|
|
42
|
-
enabled: boolean;
|
|
43
|
-
head_sampling_rate: number;
|
|
44
|
-
logs: {
|
|
45
|
-
enabled: boolean;
|
|
46
|
-
invocation_logs: boolean;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
workers_dev: boolean;
|
|
50
|
-
keep_vars: boolean;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export { defineNotificationServiceWrangler };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { N as NotificationServiceWranglerConfig } from '../shared/notification.DW8VtyNo.mjs';
|
|
2
|
-
|
|
3
|
-
declare function defineNotificationServiceWrangler(config: NotificationServiceWranglerConfig): {
|
|
4
|
-
vars: {
|
|
5
|
-
VERSION: string;
|
|
6
|
-
EMAIL_PROVIDER: "ecomail";
|
|
7
|
-
EMAIL_SENDER_EMAIL: string;
|
|
8
|
-
EMAIL_SENDER_NAME: string;
|
|
9
|
-
EMAIL_SMTP_HOST: string;
|
|
10
|
-
SMS_PROVIDER: "twilio";
|
|
11
|
-
SLACK_WEBHOOK: string;
|
|
12
|
-
EMAIL_WHITELIST?: string;
|
|
13
|
-
EMAIL_WHITELIST_FALLBACK?: string;
|
|
14
|
-
ENVIRONMENT: string;
|
|
15
|
-
};
|
|
16
|
-
services: {
|
|
17
|
-
binding: string;
|
|
18
|
-
service: string;
|
|
19
|
-
}[];
|
|
20
|
-
kv_namespaces: {
|
|
21
|
-
binding: string;
|
|
22
|
-
id: string;
|
|
23
|
-
}[];
|
|
24
|
-
queues: {
|
|
25
|
-
producers: {
|
|
26
|
-
binding: string;
|
|
27
|
-
queue: string;
|
|
28
|
-
}[];
|
|
29
|
-
consumers: {
|
|
30
|
-
queue: string;
|
|
31
|
-
max_batch_size: number;
|
|
32
|
-
max_batch_timeout: number;
|
|
33
|
-
dead_letter_queue: string;
|
|
34
|
-
}[];
|
|
35
|
-
};
|
|
36
|
-
$schema: string;
|
|
37
|
-
name: string;
|
|
38
|
-
main: string;
|
|
39
|
-
compatibility_date: string;
|
|
40
|
-
compatibility_flags: string[];
|
|
41
|
-
observability: {
|
|
42
|
-
enabled: boolean;
|
|
43
|
-
head_sampling_rate: number;
|
|
44
|
-
logs: {
|
|
45
|
-
enabled: boolean;
|
|
46
|
-
invocation_logs: boolean;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
workers_dev: boolean;
|
|
50
|
-
keep_vars: boolean;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export { defineNotificationServiceWrangler };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { N as NotificationServiceWranglerConfig } from '../shared/notification.DW8VtyNo.js';
|
|
2
|
-
|
|
3
|
-
declare function defineNotificationServiceWrangler(config: NotificationServiceWranglerConfig): {
|
|
4
|
-
vars: {
|
|
5
|
-
VERSION: string;
|
|
6
|
-
EMAIL_PROVIDER: "ecomail";
|
|
7
|
-
EMAIL_SENDER_EMAIL: string;
|
|
8
|
-
EMAIL_SENDER_NAME: string;
|
|
9
|
-
EMAIL_SMTP_HOST: string;
|
|
10
|
-
SMS_PROVIDER: "twilio";
|
|
11
|
-
SLACK_WEBHOOK: string;
|
|
12
|
-
EMAIL_WHITELIST?: string;
|
|
13
|
-
EMAIL_WHITELIST_FALLBACK?: string;
|
|
14
|
-
ENVIRONMENT: string;
|
|
15
|
-
};
|
|
16
|
-
services: {
|
|
17
|
-
binding: string;
|
|
18
|
-
service: string;
|
|
19
|
-
}[];
|
|
20
|
-
kv_namespaces: {
|
|
21
|
-
binding: string;
|
|
22
|
-
id: string;
|
|
23
|
-
}[];
|
|
24
|
-
queues: {
|
|
25
|
-
producers: {
|
|
26
|
-
binding: string;
|
|
27
|
-
queue: string;
|
|
28
|
-
}[];
|
|
29
|
-
consumers: {
|
|
30
|
-
queue: string;
|
|
31
|
-
max_batch_size: number;
|
|
32
|
-
max_batch_timeout: number;
|
|
33
|
-
dead_letter_queue: string;
|
|
34
|
-
}[];
|
|
35
|
-
};
|
|
36
|
-
$schema: string;
|
|
37
|
-
name: string;
|
|
38
|
-
main: string;
|
|
39
|
-
compatibility_date: string;
|
|
40
|
-
compatibility_flags: string[];
|
|
41
|
-
observability: {
|
|
42
|
-
enabled: boolean;
|
|
43
|
-
head_sampling_rate: number;
|
|
44
|
-
logs: {
|
|
45
|
-
enabled: boolean;
|
|
46
|
-
invocation_logs: boolean;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
workers_dev: boolean;
|
|
50
|
-
keep_vars: boolean;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export { defineNotificationServiceWrangler };
|
package/dist/export/wrangler.mjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { composeWranglerBase } from '@develit-io/backend-sdk';
|
|
2
|
-
|
|
3
|
-
function defineNotificationServiceWrangler(config) {
|
|
4
|
-
const { project, name, vars, kv } = config;
|
|
5
|
-
const base = {
|
|
6
|
-
...composeWranglerBase({
|
|
7
|
-
project,
|
|
8
|
-
name
|
|
9
|
-
}),
|
|
10
|
-
vars: {
|
|
11
|
-
ENVIRONMENT: "localhost",
|
|
12
|
-
...vars
|
|
13
|
-
},
|
|
14
|
-
services: [
|
|
15
|
-
{
|
|
16
|
-
binding: "SECRETS_STORE",
|
|
17
|
-
service: `${project}-secrets-store`
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
kv_namespaces: kv ? [
|
|
21
|
-
{
|
|
22
|
-
binding: "RECEIVED_EMAILS_KV",
|
|
23
|
-
id: kv.id
|
|
24
|
-
}
|
|
25
|
-
] : [],
|
|
26
|
-
queues: {
|
|
27
|
-
producers: [
|
|
28
|
-
{
|
|
29
|
-
binding: "NOTIFICATIONS_QUEUE",
|
|
30
|
-
queue: `${project}-notifications`
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
binding: "AUDIT_LOGS_QUEUE",
|
|
34
|
-
queue: `${project}-audit-logs`
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
consumers: [
|
|
38
|
-
{
|
|
39
|
-
queue: `${project}-notifications`,
|
|
40
|
-
max_batch_size: 1,
|
|
41
|
-
max_batch_timeout: 5,
|
|
42
|
-
dead_letter_queue: `${project}-notifications-dlq`
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return base;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { defineNotificationServiceWrangler };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
interface NotificationServiceWranglerConfig {
|
|
2
|
-
project: string;
|
|
3
|
-
name: string;
|
|
4
|
-
vars: {
|
|
5
|
-
VERSION: string;
|
|
6
|
-
EMAIL_PROVIDER: 'ecomail';
|
|
7
|
-
EMAIL_SENDER_EMAIL: string;
|
|
8
|
-
EMAIL_SENDER_NAME: string;
|
|
9
|
-
EMAIL_SMTP_HOST: string;
|
|
10
|
-
SMS_PROVIDER: 'twilio';
|
|
11
|
-
SLACK_WEBHOOK: string;
|
|
12
|
-
EMAIL_WHITELIST?: string;
|
|
13
|
-
EMAIL_WHITELIST_FALLBACK?: string;
|
|
14
|
-
[key: string]: string | boolean | undefined;
|
|
15
|
-
};
|
|
16
|
-
kv?: {
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
interface NotificationServiceEnv extends NotificationEnv {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type { NotificationServiceWranglerConfig as N, NotificationServiceEnv as a };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
interface NotificationServiceWranglerConfig {
|
|
2
|
-
project: string;
|
|
3
|
-
name: string;
|
|
4
|
-
vars: {
|
|
5
|
-
VERSION: string;
|
|
6
|
-
EMAIL_PROVIDER: 'ecomail';
|
|
7
|
-
EMAIL_SENDER_EMAIL: string;
|
|
8
|
-
EMAIL_SENDER_NAME: string;
|
|
9
|
-
EMAIL_SMTP_HOST: string;
|
|
10
|
-
SMS_PROVIDER: 'twilio';
|
|
11
|
-
SLACK_WEBHOOK: string;
|
|
12
|
-
EMAIL_WHITELIST?: string;
|
|
13
|
-
EMAIL_WHITELIST_FALLBACK?: string;
|
|
14
|
-
[key: string]: string | boolean | undefined;
|
|
15
|
-
};
|
|
16
|
-
kv?: {
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
interface NotificationServiceEnv extends NotificationEnv {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type { NotificationServiceWranglerConfig as N, NotificationServiceEnv as a };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
interface NotificationServiceWranglerConfig {
|
|
2
|
-
project: string;
|
|
3
|
-
name: string;
|
|
4
|
-
vars: {
|
|
5
|
-
VERSION: string;
|
|
6
|
-
EMAIL_PROVIDER: 'ecomail';
|
|
7
|
-
EMAIL_SENDER_EMAIL: string;
|
|
8
|
-
EMAIL_SENDER_NAME: string;
|
|
9
|
-
EMAIL_SMTP_HOST: string;
|
|
10
|
-
SMS_PROVIDER: 'twilio';
|
|
11
|
-
SLACK_WEBHOOK: string;
|
|
12
|
-
EMAIL_WHITELIST?: string;
|
|
13
|
-
EMAIL_WHITELIST_FALLBACK?: string;
|
|
14
|
-
[key: string]: string | boolean | undefined;
|
|
15
|
-
};
|
|
16
|
-
kv?: {
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
interface NotificationServiceEnv extends NotificationEnv {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type { NotificationServiceWranglerConfig as N, NotificationServiceEnv as a };
|