@develit-services/notification 0.0.22 → 0.0.24
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/@types.cjs +1 -1
- package/dist/@types.d.cts +6 -5
- package/dist/@types.d.mts +6 -5
- package/dist/@types.d.ts +6 -5
- package/dist/@types.mjs +1 -1
- package/dist/export/worker.cjs +12 -5
- package/dist/export/worker.d.cts +2 -2
- package/dist/export/worker.d.mts +2 -2
- package/dist/export/worker.d.ts +2 -2
- package/dist/export/worker.mjs +12 -5
- package/dist/export/wrangler.d.cts +3 -5
- package/dist/export/wrangler.d.mts +3 -5
- package/dist/export/wrangler.d.ts +3 -5
- package/dist/shared/{notification.Cqu8_iNk.cjs → notification.8VrnX6x5.cjs} +8 -5
- package/dist/shared/{notification.CDgVHdh3.d.mts → notification.CI6gLJsN.d.mts} +6 -4
- package/dist/shared/{notification.B2I1pTPy.d.cts → notification.CNBJ5Beq.d.cts} +2 -4
- package/dist/shared/{notification.B2I1pTPy.d.mts → notification.CNBJ5Beq.d.mts} +2 -4
- package/dist/shared/{notification.B2I1pTPy.d.ts → notification.CNBJ5Beq.d.ts} +2 -4
- package/dist/shared/{notification.DCazEi4Y.mjs → notification.DaWIyo2j.mjs} +8 -5
- package/dist/shared/{notification.-hsQiolw.d.ts → notification.Dme_B9k_.d.ts} +6 -4
- package/dist/shared/{notification.CNZwNhWN.d.cts → notification.YN3G-lx3.d.cts} +6 -4
- package/package.json +13 -17
package/dist/@types.cjs
CHANGED
package/dist/@types.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as IEmailConnector, g as
|
|
2
|
-
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.
|
|
1
|
+
import { I as IEmailConnector, g as IEmail, h as IContact, a as ISmsConnector, i as ISms, t as tables } from './shared/notification.YN3G-lx3.cjs';
|
|
2
|
+
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.YN3G-lx3.cjs';
|
|
3
3
|
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
4
|
import twilio from 'twilio';
|
|
5
5
|
import { InferSelectModel, InferInsertModel } from 'drizzle-orm';
|
|
6
|
-
export { b as NotificationServiceEnv, a as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.
|
|
6
|
+
export { b as NotificationServiceEnv, a as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.CNBJ5Beq.cjs';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'zod/v4';
|
|
9
9
|
import './shared/notification.BJyMXKGH.cjs';
|
|
@@ -11,10 +11,11 @@ import 'drizzle-orm/sqlite-core';
|
|
|
11
11
|
|
|
12
12
|
declare class EcomailConnector extends IEmailConnector {
|
|
13
13
|
static providerName: string;
|
|
14
|
-
constructor({ API_KEY, SMTP_HOST,
|
|
14
|
+
constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
15
15
|
API_KEY: string;
|
|
16
16
|
SMTP_HOST: string;
|
|
17
|
-
|
|
17
|
+
SENDER_EMAIL: string;
|
|
18
|
+
SENDER_NAME: string;
|
|
18
19
|
});
|
|
19
20
|
sendEmail(email: IEmail): Promise<void>;
|
|
20
21
|
protected convertEmail(email: IEmail): EMEmail;
|
package/dist/@types.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as IEmailConnector, g as
|
|
2
|
-
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.
|
|
1
|
+
import { I as IEmailConnector, g as IEmail, h as IContact, a as ISmsConnector, i as ISms, t as tables } from './shared/notification.CI6gLJsN.mjs';
|
|
2
|
+
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.CI6gLJsN.mjs';
|
|
3
3
|
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
4
|
import twilio from 'twilio';
|
|
5
5
|
import { InferSelectModel, InferInsertModel } from 'drizzle-orm';
|
|
6
|
-
export { b as NotificationServiceEnv, a as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.
|
|
6
|
+
export { b as NotificationServiceEnv, a as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.CNBJ5Beq.mjs';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'zod/v4';
|
|
9
9
|
import './shared/notification.BJyMXKGH.mjs';
|
|
@@ -11,10 +11,11 @@ import 'drizzle-orm/sqlite-core';
|
|
|
11
11
|
|
|
12
12
|
declare class EcomailConnector extends IEmailConnector {
|
|
13
13
|
static providerName: string;
|
|
14
|
-
constructor({ API_KEY, SMTP_HOST,
|
|
14
|
+
constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
15
15
|
API_KEY: string;
|
|
16
16
|
SMTP_HOST: string;
|
|
17
|
-
|
|
17
|
+
SENDER_EMAIL: string;
|
|
18
|
+
SENDER_NAME: string;
|
|
18
19
|
});
|
|
19
20
|
sendEmail(email: IEmail): Promise<void>;
|
|
20
21
|
protected convertEmail(email: IEmail): EMEmail;
|
package/dist/@types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as IEmailConnector, g as
|
|
2
|
-
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification
|
|
1
|
+
import { I as IEmailConnector, g as IEmail, h as IContact, a as ISmsConnector, i as ISms, t as tables } from './shared/notification.Dme_B9k_.js';
|
|
2
|
+
export { n as IPushNotification, o as ISlack, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, e as SendSlackInput, f as SendSlackOutput, c as SendSmsInput, d as SendSmsOutput, j as iContactSchema, k as iEmailSchema, s as sendEmailInputSchema, l as sendSlackInputSchema, m as sendSmsInputSchema } from './shared/notification.Dme_B9k_.js';
|
|
3
3
|
import { InternalError } from '@develit-io/backend-sdk';
|
|
4
4
|
import twilio from 'twilio';
|
|
5
5
|
import { InferSelectModel, InferInsertModel } from 'drizzle-orm';
|
|
6
|
-
export { b as NotificationServiceEnv, a as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.
|
|
6
|
+
export { b as NotificationServiceEnv, a as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.CNBJ5Beq.js';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'zod/v4';
|
|
9
9
|
import './shared/notification.BJyMXKGH.js';
|
|
@@ -11,10 +11,11 @@ import 'drizzle-orm/sqlite-core';
|
|
|
11
11
|
|
|
12
12
|
declare class EcomailConnector extends IEmailConnector {
|
|
13
13
|
static providerName: string;
|
|
14
|
-
constructor({ API_KEY, SMTP_HOST,
|
|
14
|
+
constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
15
15
|
API_KEY: string;
|
|
16
16
|
SMTP_HOST: string;
|
|
17
|
-
|
|
17
|
+
SENDER_EMAIL: string;
|
|
18
|
+
SENDER_NAME: string;
|
|
18
19
|
});
|
|
19
20
|
sendEmail(email: IEmail): Promise<void>;
|
|
20
21
|
protected convertEmail(email: IEmail): EMEmail;
|
package/dist/@types.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as EcomailConnector, I as IEmailConnector, d as ISmsConnector, T as TwilioConnector, i as iContactSchema, c as iEmailSchema, s as sendEmailInputSchema, b as sendSlackInputSchema, a as sendSmsInputSchema } from './shared/notification.
|
|
1
|
+
export { E as EcomailConnector, I as IEmailConnector, d as ISmsConnector, T as TwilioConnector, i as iContactSchema, c as iEmailSchema, s as sendEmailInputSchema, b as sendSlackInputSchema, a as sendSmsInputSchema } from './shared/notification.DaWIyo2j.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '@develit-io/backend-sdk';
|
|
4
4
|
import 'zod/v4';
|
package/dist/export/worker.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
|
-
const twilio_connector = require('../shared/notification.
|
|
6
|
+
const twilio_connector = require('../shared/notification.8VrnX6x5.cjs');
|
|
7
7
|
const database_schema = require('../shared/notification.4b3eUEIG.cjs');
|
|
8
8
|
require('drizzle-orm');
|
|
9
9
|
require('drizzle-orm/sqlite-core');
|
|
@@ -15,7 +15,7 @@ require('twilio');
|
|
|
15
15
|
|
|
16
16
|
const tables = database_schema.schema;
|
|
17
17
|
|
|
18
|
-
const initiateEmailConnector = async (provider, apiKey, smtpHost,
|
|
18
|
+
const initiateEmailConnector = async (provider, apiKey, smtpHost, senderEmail, senderName) => {
|
|
19
19
|
const connector = [twilio_connector.EcomailConnector].find(
|
|
20
20
|
(conn) => conn.providerName === provider
|
|
21
21
|
);
|
|
@@ -24,7 +24,12 @@ const initiateEmailConnector = async (provider, apiKey, smtpHost, sender) => {
|
|
|
24
24
|
message: "Unsupported email provider",
|
|
25
25
|
status: 404
|
|
26
26
|
});
|
|
27
|
-
return new connector({
|
|
27
|
+
return new connector({
|
|
28
|
+
API_KEY: apiKey,
|
|
29
|
+
SMTP_HOST: smtpHost,
|
|
30
|
+
SENDER_EMAIL: senderEmail,
|
|
31
|
+
SENDER_NAME: senderName
|
|
32
|
+
});
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
const createAuditLogCommand = async ({
|
|
@@ -121,7 +126,8 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
121
126
|
this.env.EMAIL_PROVIDER,
|
|
122
127
|
this.env.EMAIL_API_KEY,
|
|
123
128
|
this.env.EMAIL_SMTP_HOST,
|
|
124
|
-
this.env.
|
|
129
|
+
this.env.EMAIL_SENDER_EMAIL,
|
|
130
|
+
this.env.EMAIL_SENDER_NAME
|
|
125
131
|
)
|
|
126
132
|
);
|
|
127
133
|
if (error2) {
|
|
@@ -201,7 +207,8 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
201
207
|
this.env.EMAIL_PROVIDER,
|
|
202
208
|
this.env.EMAIL_API_KEY,
|
|
203
209
|
this.env.EMAIL_SMTP_HOST,
|
|
204
|
-
this.env.
|
|
210
|
+
this.env.EMAIL_SENDER_EMAIL,
|
|
211
|
+
this.env.EMAIL_SENDER_NAME
|
|
205
212
|
);
|
|
206
213
|
}
|
|
207
214
|
await this.emailConnector.sendEmail(email);
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -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 { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.
|
|
3
|
+
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.YN3G-lx3.cjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
|
@@ -14,7 +14,7 @@ declare class SlackConnector {
|
|
|
14
14
|
sendNotificationToAllSlack(message: string): Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
17
|
+
declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
18
18
|
declare class NotificationServiceBase extends NotificationServiceBase_base {
|
|
19
19
|
readonly name: string;
|
|
20
20
|
readonly slackConnector: SlackConnector;
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -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 { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.
|
|
3
|
+
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.CI6gLJsN.mjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
|
@@ -14,7 +14,7 @@ declare class SlackConnector {
|
|
|
14
14
|
sendNotificationToAllSlack(message: string): Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
17
|
+
declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
18
18
|
declare class NotificationServiceBase extends NotificationServiceBase_base {
|
|
19
19
|
readonly name: string;
|
|
20
20
|
readonly slackConnector: SlackConnector;
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -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 { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification
|
|
3
|
+
import { I as IEmailConnector, a as ISmsConnector, t as tables, N as NotificationQueueMessage, S as SendEmailInput, b as SendEmailOutput, c as SendSmsInput, d as SendSmsOutput, e as SendSlackInput, f as SendSlackOutput } from '../shared/notification.Dme_B9k_.js';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
|
@@ -14,7 +14,7 @@ declare class SlackConnector {
|
|
|
14
14
|
sendNotificationToAllSlack(message: string): Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
17
|
+
declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
|
|
18
18
|
declare class NotificationServiceBase extends NotificationServiceBase_base {
|
|
19
19
|
readonly name: string;
|
|
20
20
|
readonly slackConnector: SlackConnector;
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createInternalError, uuidv4, develitWorker, useResult, cloudflareQueue, action } from '@develit-io/backend-sdk';
|
|
2
|
-
import { E as EcomailConnector, T as TwilioConnector, s as sendEmailInputSchema, a as sendSmsInputSchema, b as sendSlackInputSchema } from '../shared/notification.
|
|
2
|
+
import { E as EcomailConnector, T as TwilioConnector, s as sendEmailInputSchema, a as sendSmsInputSchema, b as sendSlackInputSchema } from '../shared/notification.DaWIyo2j.mjs';
|
|
3
3
|
import { s as schema } from '../shared/notification.C0X8Orrh.mjs';
|
|
4
4
|
import 'drizzle-orm';
|
|
5
5
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -11,7 +11,7 @@ import 'twilio';
|
|
|
11
11
|
|
|
12
12
|
const tables = schema;
|
|
13
13
|
|
|
14
|
-
const initiateEmailConnector = async (provider, apiKey, smtpHost,
|
|
14
|
+
const initiateEmailConnector = async (provider, apiKey, smtpHost, senderEmail, senderName) => {
|
|
15
15
|
const connector = [EcomailConnector].find(
|
|
16
16
|
(conn) => conn.providerName === provider
|
|
17
17
|
);
|
|
@@ -20,7 +20,12 @@ const initiateEmailConnector = async (provider, apiKey, smtpHost, sender) => {
|
|
|
20
20
|
message: "Unsupported email provider",
|
|
21
21
|
status: 404
|
|
22
22
|
});
|
|
23
|
-
return new connector({
|
|
23
|
+
return new connector({
|
|
24
|
+
API_KEY: apiKey,
|
|
25
|
+
SMTP_HOST: smtpHost,
|
|
26
|
+
SENDER_EMAIL: senderEmail,
|
|
27
|
+
SENDER_NAME: senderName
|
|
28
|
+
});
|
|
24
29
|
};
|
|
25
30
|
|
|
26
31
|
const createAuditLogCommand = async ({
|
|
@@ -117,7 +122,8 @@ class NotificationServiceBase extends develitWorker(
|
|
|
117
122
|
this.env.EMAIL_PROVIDER,
|
|
118
123
|
this.env.EMAIL_API_KEY,
|
|
119
124
|
this.env.EMAIL_SMTP_HOST,
|
|
120
|
-
this.env.
|
|
125
|
+
this.env.EMAIL_SENDER_EMAIL,
|
|
126
|
+
this.env.EMAIL_SENDER_NAME
|
|
121
127
|
)
|
|
122
128
|
);
|
|
123
129
|
if (error2) {
|
|
@@ -197,7 +203,8 @@ class NotificationServiceBase extends develitWorker(
|
|
|
197
203
|
this.env.EMAIL_PROVIDER,
|
|
198
204
|
this.env.EMAIL_API_KEY,
|
|
199
205
|
this.env.EMAIL_SMTP_HOST,
|
|
200
|
-
this.env.
|
|
206
|
+
this.env.EMAIL_SENDER_EMAIL,
|
|
207
|
+
this.env.EMAIL_SENDER_NAME
|
|
201
208
|
);
|
|
202
209
|
}
|
|
203
210
|
await this.emailConnector.sendEmail(email);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NotificationServiceWranglerConfig } from '../shared/notification.
|
|
1
|
+
import { N as NotificationServiceWranglerConfig } from '../shared/notification.CNBJ5Beq.cjs';
|
|
2
2
|
|
|
3
3
|
/** biome-ignore-all lint/suspicious/noExplicitAny: allow any */
|
|
4
4
|
|
|
@@ -19,10 +19,8 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
|
|
|
19
19
|
vars: {
|
|
20
20
|
ENVIRONMENT: string;
|
|
21
21
|
EMAIL_PROVIDER: "ecomail";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
email: string;
|
|
25
|
-
};
|
|
22
|
+
EMAIL_SENDER_EMAIL: string;
|
|
23
|
+
EMAIL_SENDER_NAME: string;
|
|
26
24
|
EMAIL_SMTP_HOST: string;
|
|
27
25
|
SMS_PROVIDER: "twilio";
|
|
28
26
|
SMS_ACCOUNT_ID: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NotificationServiceWranglerConfig } from '../shared/notification.
|
|
1
|
+
import { N as NotificationServiceWranglerConfig } from '../shared/notification.CNBJ5Beq.mjs';
|
|
2
2
|
|
|
3
3
|
/** biome-ignore-all lint/suspicious/noExplicitAny: allow any */
|
|
4
4
|
|
|
@@ -19,10 +19,8 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
|
|
|
19
19
|
vars: {
|
|
20
20
|
ENVIRONMENT: string;
|
|
21
21
|
EMAIL_PROVIDER: "ecomail";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
email: string;
|
|
25
|
-
};
|
|
22
|
+
EMAIL_SENDER_EMAIL: string;
|
|
23
|
+
EMAIL_SENDER_NAME: string;
|
|
26
24
|
EMAIL_SMTP_HOST: string;
|
|
27
25
|
SMS_PROVIDER: "twilio";
|
|
28
26
|
SMS_ACCOUNT_ID: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NotificationServiceWranglerConfig } from '../shared/notification.
|
|
1
|
+
import { N as NotificationServiceWranglerConfig } from '../shared/notification.CNBJ5Beq.js';
|
|
2
2
|
|
|
3
3
|
/** biome-ignore-all lint/suspicious/noExplicitAny: allow any */
|
|
4
4
|
|
|
@@ -19,10 +19,8 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
|
|
|
19
19
|
vars: {
|
|
20
20
|
ENVIRONMENT: string;
|
|
21
21
|
EMAIL_PROVIDER: "ecomail";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
email: string;
|
|
25
|
-
};
|
|
22
|
+
EMAIL_SENDER_EMAIL: string;
|
|
23
|
+
EMAIL_SENDER_NAME: string;
|
|
26
24
|
EMAIL_SMTP_HOST: string;
|
|
27
25
|
SMS_PROVIDER: "twilio";
|
|
28
26
|
SMS_ACCOUNT_ID: string;
|
|
@@ -34,11 +34,13 @@ class IEmailConnector {
|
|
|
34
34
|
constructor({
|
|
35
35
|
API_KEY,
|
|
36
36
|
SMTP_HOST,
|
|
37
|
-
|
|
37
|
+
SENDER_EMAIL,
|
|
38
|
+
SENDER_NAME
|
|
38
39
|
}) {
|
|
39
40
|
this.API_KEY = API_KEY;
|
|
40
41
|
this.SMTP_HOST = SMTP_HOST;
|
|
41
|
-
this.
|
|
42
|
+
this.SENDER_EMAIL = SENDER_EMAIL;
|
|
43
|
+
this.SENDER_NAME = SENDER_NAME;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -49,9 +51,10 @@ class EcomailConnector extends IEmailConnector {
|
|
|
49
51
|
constructor({
|
|
50
52
|
API_KEY,
|
|
51
53
|
SMTP_HOST,
|
|
52
|
-
|
|
54
|
+
SENDER_EMAIL,
|
|
55
|
+
SENDER_NAME
|
|
53
56
|
}) {
|
|
54
|
-
super({ API_KEY, SMTP_HOST,
|
|
57
|
+
super({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME });
|
|
55
58
|
}
|
|
56
59
|
async sendEmail(email) {
|
|
57
60
|
if (email.templateVariables) {
|
|
@@ -78,7 +81,7 @@ class EcomailConnector extends IEmailConnector {
|
|
|
78
81
|
const ccContacts = email.cc ? this.convertContacts(email.cc) : [];
|
|
79
82
|
const bccContacts = email.bcc ? this.convertContacts(email.bcc) : [];
|
|
80
83
|
const replyTo = email.replyTo ? this.convertContacts(email.replyTo)[0] : void 0;
|
|
81
|
-
const from = this.convertContact(email.from || this.
|
|
84
|
+
const from = this.convertContact(email.from || this.SENDER_EMAIL);
|
|
82
85
|
const subject = email.subject;
|
|
83
86
|
const attachments = [];
|
|
84
87
|
const contacts = toContacts.flatMap((to) => {
|
|
@@ -53,11 +53,13 @@ declare abstract class IEmailConnector {
|
|
|
53
53
|
static providerName: string;
|
|
54
54
|
API_KEY: string;
|
|
55
55
|
SMTP_HOST: string;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
SENDER_EMAIL: string;
|
|
57
|
+
SENDER_NAME: string;
|
|
58
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
58
59
|
API_KEY: string;
|
|
59
60
|
SMTP_HOST: string;
|
|
60
|
-
|
|
61
|
+
SENDER_EMAIL: string;
|
|
62
|
+
SENDER_NAME: string;
|
|
61
63
|
});
|
|
62
64
|
abstract sendEmail(email: IEmail): Promise<void>;
|
|
63
65
|
}
|
|
@@ -199,4 +201,4 @@ interface ISlack {
|
|
|
199
201
|
declare const tables: typeof schema;
|
|
200
202
|
|
|
201
203
|
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s, tables as t };
|
|
202
|
-
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f,
|
|
204
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IEmail as g, IContact as h, ISms as i, IPushNotification as n, ISlack as o };
|
|
@@ -8,10 +8,8 @@ interface NotificationServiceEnvironmentConfig {
|
|
|
8
8
|
};
|
|
9
9
|
vars: {
|
|
10
10
|
EMAIL_PROVIDER: 'ecomail';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
email: string;
|
|
14
|
-
};
|
|
11
|
+
EMAIL_SENDER_EMAIL: string;
|
|
12
|
+
EMAIL_SENDER_NAME: string;
|
|
15
13
|
EMAIL_SMTP_HOST: string;
|
|
16
14
|
SMS_PROVIDER: 'twilio';
|
|
17
15
|
SMS_ACCOUNT_ID: string;
|
|
@@ -8,10 +8,8 @@ interface NotificationServiceEnvironmentConfig {
|
|
|
8
8
|
};
|
|
9
9
|
vars: {
|
|
10
10
|
EMAIL_PROVIDER: 'ecomail';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
email: string;
|
|
14
|
-
};
|
|
11
|
+
EMAIL_SENDER_EMAIL: string;
|
|
12
|
+
EMAIL_SENDER_NAME: string;
|
|
15
13
|
EMAIL_SMTP_HOST: string;
|
|
16
14
|
SMS_PROVIDER: 'twilio';
|
|
17
15
|
SMS_ACCOUNT_ID: string;
|
|
@@ -8,10 +8,8 @@ interface NotificationServiceEnvironmentConfig {
|
|
|
8
8
|
};
|
|
9
9
|
vars: {
|
|
10
10
|
EMAIL_PROVIDER: 'ecomail';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
email: string;
|
|
14
|
-
};
|
|
11
|
+
EMAIL_SENDER_EMAIL: string;
|
|
12
|
+
EMAIL_SENDER_NAME: string;
|
|
15
13
|
EMAIL_SMTP_HOST: string;
|
|
16
14
|
SMS_PROVIDER: 'twilio';
|
|
17
15
|
SMS_ACCOUNT_ID: string;
|
|
@@ -27,11 +27,13 @@ class IEmailConnector {
|
|
|
27
27
|
constructor({
|
|
28
28
|
API_KEY,
|
|
29
29
|
SMTP_HOST,
|
|
30
|
-
|
|
30
|
+
SENDER_EMAIL,
|
|
31
|
+
SENDER_NAME
|
|
31
32
|
}) {
|
|
32
33
|
this.API_KEY = API_KEY;
|
|
33
34
|
this.SMTP_HOST = SMTP_HOST;
|
|
34
|
-
this.
|
|
35
|
+
this.SENDER_EMAIL = SENDER_EMAIL;
|
|
36
|
+
this.SENDER_NAME = SENDER_NAME;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
|
|
@@ -42,9 +44,10 @@ class EcomailConnector extends IEmailConnector {
|
|
|
42
44
|
constructor({
|
|
43
45
|
API_KEY,
|
|
44
46
|
SMTP_HOST,
|
|
45
|
-
|
|
47
|
+
SENDER_EMAIL,
|
|
48
|
+
SENDER_NAME
|
|
46
49
|
}) {
|
|
47
|
-
super({ API_KEY, SMTP_HOST,
|
|
50
|
+
super({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME });
|
|
48
51
|
}
|
|
49
52
|
async sendEmail(email) {
|
|
50
53
|
if (email.templateVariables) {
|
|
@@ -71,7 +74,7 @@ class EcomailConnector extends IEmailConnector {
|
|
|
71
74
|
const ccContacts = email.cc ? this.convertContacts(email.cc) : [];
|
|
72
75
|
const bccContacts = email.bcc ? this.convertContacts(email.bcc) : [];
|
|
73
76
|
const replyTo = email.replyTo ? this.convertContacts(email.replyTo)[0] : void 0;
|
|
74
|
-
const from = this.convertContact(email.from || this.
|
|
77
|
+
const from = this.convertContact(email.from || this.SENDER_EMAIL);
|
|
75
78
|
const subject = email.subject;
|
|
76
79
|
const attachments = [];
|
|
77
80
|
const contacts = toContacts.flatMap((to) => {
|
|
@@ -53,11 +53,13 @@ declare abstract class IEmailConnector {
|
|
|
53
53
|
static providerName: string;
|
|
54
54
|
API_KEY: string;
|
|
55
55
|
SMTP_HOST: string;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
SENDER_EMAIL: string;
|
|
57
|
+
SENDER_NAME: string;
|
|
58
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
58
59
|
API_KEY: string;
|
|
59
60
|
SMTP_HOST: string;
|
|
60
|
-
|
|
61
|
+
SENDER_EMAIL: string;
|
|
62
|
+
SENDER_NAME: string;
|
|
61
63
|
});
|
|
62
64
|
abstract sendEmail(email: IEmail): Promise<void>;
|
|
63
65
|
}
|
|
@@ -199,4 +201,4 @@ interface ISlack {
|
|
|
199
201
|
declare const tables: typeof schema;
|
|
200
202
|
|
|
201
203
|
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s, tables as t };
|
|
202
|
-
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f,
|
|
204
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IEmail as g, IContact as h, ISms as i, IPushNotification as n, ISlack as o };
|
|
@@ -53,11 +53,13 @@ declare abstract class IEmailConnector {
|
|
|
53
53
|
static providerName: string;
|
|
54
54
|
API_KEY: string;
|
|
55
55
|
SMTP_HOST: string;
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
SENDER_EMAIL: string;
|
|
57
|
+
SENDER_NAME: string;
|
|
58
|
+
protected constructor({ API_KEY, SMTP_HOST, SENDER_EMAIL, SENDER_NAME, }: {
|
|
58
59
|
API_KEY: string;
|
|
59
60
|
SMTP_HOST: string;
|
|
60
|
-
|
|
61
|
+
SENDER_EMAIL: string;
|
|
62
|
+
SENDER_NAME: string;
|
|
61
63
|
});
|
|
62
64
|
abstract sendEmail(email: IEmail): Promise<void>;
|
|
63
65
|
}
|
|
@@ -199,4 +201,4 @@ interface ISlack {
|
|
|
199
201
|
declare const tables: typeof schema;
|
|
200
202
|
|
|
201
203
|
export { IEmailConnector as I, ISmsConnector as a, iContactSchema as j, iEmailSchema as k, sendSlackInputSchema as l, sendSmsInputSchema as m, sendEmailInputSchema as s, tables as t };
|
|
202
|
-
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f,
|
|
204
|
+
export type { NotificationQueueMessage as N, SendEmailInput as S, SendEmailOutput as b, SendSmsInput as c, SendSmsOutput as d, SendSlackInput as e, SendSlackOutput as f, IEmail as g, IContact as h, ISms as i, IPushNotification as n, ISlack as o };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develit-services/notification",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"author": "Develit.io s.r.o.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -30,37 +30,33 @@
|
|
|
30
30
|
"./dist"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
-
"
|
|
33
|
+
"dev": "wrangler dev --port 9232",
|
|
34
34
|
"wrangler:generate": "bunx develit wrangler:generate",
|
|
35
|
-
"
|
|
36
|
-
"dev": "bun wrangler:generate && wrangler dev --port 9234",
|
|
37
|
-
"lint": "biome check",
|
|
38
|
-
"lint:fix": "biome check --fix",
|
|
39
|
-
"typecheck": "tsc",
|
|
40
|
-
"db:init": "wrangler d1 execute notification-db --local --persist-to ../../.wrangler/state --command=\"SELECT 'creating sqlite...' AS status;\"",
|
|
35
|
+
"db:init": "wrangler d1 execute notification --local --persist-to ../../.wrangler/state --command=\"SELECT 'Creating database...' AS status;\"",
|
|
41
36
|
"db:generate": "drizzle-kit generate",
|
|
42
37
|
"db:migrate": "drizzle-kit migrate",
|
|
43
38
|
"db:explore": "drizzle-kit studio",
|
|
39
|
+
"types": "wrangler types --env-interface NotificationEnv --include-runtime false",
|
|
40
|
+
"typecheck": "tsc",
|
|
41
|
+
"lint": "biome check",
|
|
42
|
+
"lint:fix": "biome check --fix",
|
|
44
43
|
"test": "vitest",
|
|
45
44
|
"test:cov": "vitest run --coverage",
|
|
46
45
|
"test:unit": "vitest unit fixtures",
|
|
47
46
|
"test:int": "vitest integration",
|
|
48
|
-
"changelogen": "bunx changelogen@latest --bump",
|
|
49
47
|
"build": "unbuild",
|
|
48
|
+
"changelogen": "bunx changelogen@latest --bump",
|
|
50
49
|
"release": "bun run build && bunx changelogen@latest --release --push && npm publish --access public"
|
|
51
50
|
},
|
|
52
51
|
"peerDependencies": {
|
|
53
52
|
"@develit-io/backend-sdk": "5.14.1",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"cloudflare": "^5.0.0",
|
|
57
|
-
"drizzle-kit": "^0.31.4",
|
|
58
|
-
"drizzle-orm": "^0.44.4",
|
|
53
|
+
"drizzle-kit": "^0.31.5",
|
|
54
|
+
"drizzle-orm": "^0.44.6",
|
|
59
55
|
"drizzle-seed": "^0.3.1",
|
|
60
|
-
"wrangler": "^4.
|
|
61
|
-
"zod": "^4.1.
|
|
56
|
+
"wrangler": "^4.42.2",
|
|
57
|
+
"zod": "^4.1.12"
|
|
62
58
|
},
|
|
63
59
|
"dependencies": {
|
|
64
|
-
"twilio": "^5.
|
|
60
|
+
"twilio": "^5.10.3"
|
|
65
61
|
}
|
|
66
62
|
}
|