@develit-services/notification 0.3.0 → 0.4.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 +7 -3
- package/dist/export/worker.mjs +7 -3
- package/dist/export/wrangler.cjs +12 -4
- package/dist/export/wrangler.d.cts +4 -2
- package/dist/export/wrangler.d.mts +4 -2
- package/dist/export/wrangler.d.ts +4 -2
- package/dist/export/wrangler.mjs +12 -4
- package/package.json +3 -3
package/dist/export/worker.cjs
CHANGED
|
@@ -6,9 +6,9 @@ const backendSdk = require('@develit-io/backend-sdk');
|
|
|
6
6
|
const database_schema = require('../shared/notification.4b3eUEIG.cjs');
|
|
7
7
|
require('drizzle-orm');
|
|
8
8
|
require('drizzle-orm/sqlite-core');
|
|
9
|
+
const slack_connector = require('../shared/notification.Dk_5TX9v.cjs');
|
|
9
10
|
const cloudflare_workers = require('cloudflare:workers');
|
|
10
11
|
const d1 = require('drizzle-orm/d1');
|
|
11
|
-
const slack_connector = require('../shared/notification.Dk_5TX9v.cjs');
|
|
12
12
|
require('zod');
|
|
13
13
|
require('zod/v4');
|
|
14
14
|
require('twilio');
|
|
@@ -149,7 +149,9 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
|
|
|
149
149
|
if (!this.emailConnector) {
|
|
150
150
|
this.emailConnector = await initiateEmailConnector(
|
|
151
151
|
this.env.EMAIL_PROVIDER,
|
|
152
|
-
this.env.
|
|
152
|
+
(await this.env.SECRETS_STORE.get({
|
|
153
|
+
secretName: "NOTIFICATION_SERVICE_EMAIL_API_KEY"
|
|
154
|
+
})).data?.secretValue || "",
|
|
153
155
|
this.env.EMAIL_SMTP_HOST,
|
|
154
156
|
this.env.EMAIL_SENDER_EMAIL,
|
|
155
157
|
this.env.EMAIL_SENDER_NAME
|
|
@@ -190,7 +192,9 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
|
|
|
190
192
|
this.smsConnector = await initiateSmsConnector(
|
|
191
193
|
this.env.SMS_PROVIDER,
|
|
192
194
|
this.env.SMS_ACCOUNT_ID,
|
|
193
|
-
this.env.
|
|
195
|
+
(await this.env.SECRETS_STORE.get({
|
|
196
|
+
secretName: "NOTIFICATION_SERVICE_SMS_AUTH_TOKEN"
|
|
197
|
+
})).data?.secretValue || "",
|
|
194
198
|
this.env.SMS_SERVICE_ID
|
|
195
199
|
);
|
|
196
200
|
}
|
package/dist/export/worker.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import { createInternalError, uuidv4, develitWorker, cloudflareQueue, action, se
|
|
|
2
2
|
import { s as schema } from '../shared/notification.C0X8Orrh.mjs';
|
|
3
3
|
import 'drizzle-orm';
|
|
4
4
|
import 'drizzle-orm/sqlite-core';
|
|
5
|
+
import { E as EcomailConnector, T as TwilioConnector, S as SlackConnector, s as sendEmailInputSchema, a as sendSmsInputSchema, b as sendSlackInputSchema } from '../shared/notification.DkjmuyrV.mjs';
|
|
5
6
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
6
7
|
import { drizzle } from 'drizzle-orm/d1';
|
|
7
|
-
import { E as EcomailConnector, T as TwilioConnector, S as SlackConnector, s as sendEmailInputSchema, a as sendSmsInputSchema, b as sendSlackInputSchema } from '../shared/notification.DkjmuyrV.mjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
import 'zod/v4';
|
|
10
10
|
import 'twilio';
|
|
@@ -145,7 +145,9 @@ let NotificationServiceBase = class extends develitWorker(
|
|
|
145
145
|
if (!this.emailConnector) {
|
|
146
146
|
this.emailConnector = await initiateEmailConnector(
|
|
147
147
|
this.env.EMAIL_PROVIDER,
|
|
148
|
-
this.env.
|
|
148
|
+
(await this.env.SECRETS_STORE.get({
|
|
149
|
+
secretName: "NOTIFICATION_SERVICE_EMAIL_API_KEY"
|
|
150
|
+
})).data?.secretValue || "",
|
|
149
151
|
this.env.EMAIL_SMTP_HOST,
|
|
150
152
|
this.env.EMAIL_SENDER_EMAIL,
|
|
151
153
|
this.env.EMAIL_SENDER_NAME
|
|
@@ -186,7 +188,9 @@ let NotificationServiceBase = class extends develitWorker(
|
|
|
186
188
|
this.smsConnector = await initiateSmsConnector(
|
|
187
189
|
this.env.SMS_PROVIDER,
|
|
188
190
|
this.env.SMS_ACCOUNT_ID,
|
|
189
|
-
this.env.
|
|
191
|
+
(await this.env.SECRETS_STORE.get({
|
|
192
|
+
secretName: "NOTIFICATION_SERVICE_SMS_AUTH_TOKEN"
|
|
193
|
+
})).data?.secretValue || "",
|
|
190
194
|
this.env.SMS_SERVICE_ID
|
|
191
195
|
);
|
|
192
196
|
}
|
package/dist/export/wrangler.cjs
CHANGED
|
@@ -10,13 +10,15 @@ function defineNotificationServiceWrangler(config) {
|
|
|
10
10
|
name
|
|
11
11
|
}),
|
|
12
12
|
vars: {
|
|
13
|
-
// Secrets
|
|
14
|
-
EMAIL_API_KEY: "[SECRET]",
|
|
15
|
-
SMS_AUTH_TOKEN: "[SECRET]",
|
|
16
|
-
// Variables
|
|
17
13
|
...envs.local.vars,
|
|
18
14
|
ENVIRONMENT: "localhost"
|
|
19
15
|
},
|
|
16
|
+
services: [
|
|
17
|
+
{
|
|
18
|
+
binding: "SECRETS_STORE",
|
|
19
|
+
service: `${project}-secrets-store`
|
|
20
|
+
}
|
|
21
|
+
],
|
|
20
22
|
d1_databases: [
|
|
21
23
|
{
|
|
22
24
|
binding: "NOTIFICATION_D1",
|
|
@@ -51,6 +53,12 @@ function defineNotificationServiceWrangler(config) {
|
|
|
51
53
|
...envCfg.vars,
|
|
52
54
|
ENVIRONMENT: envName
|
|
53
55
|
},
|
|
56
|
+
services: [
|
|
57
|
+
{
|
|
58
|
+
binding: "SECRETS_STORE",
|
|
59
|
+
service: `${project}-secrets-store-${envName}`
|
|
60
|
+
}
|
|
61
|
+
],
|
|
54
62
|
d1_databases: [
|
|
55
63
|
{
|
|
56
64
|
binding: "NOTIFICATION_D1",
|
|
@@ -11,9 +11,11 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
|
|
|
11
11
|
SMS_ACCOUNT_ID: string;
|
|
12
12
|
SMS_SERVICE_ID: string | number;
|
|
13
13
|
SLACK_WEBHOOK: string;
|
|
14
|
-
EMAIL_API_KEY: string;
|
|
15
|
-
SMS_AUTH_TOKEN: string;
|
|
16
14
|
};
|
|
15
|
+
services: {
|
|
16
|
+
binding: string;
|
|
17
|
+
service: string;
|
|
18
|
+
}[];
|
|
17
19
|
d1_databases: {
|
|
18
20
|
binding: string;
|
|
19
21
|
database_name: string;
|
|
@@ -11,9 +11,11 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
|
|
|
11
11
|
SMS_ACCOUNT_ID: string;
|
|
12
12
|
SMS_SERVICE_ID: string | number;
|
|
13
13
|
SLACK_WEBHOOK: string;
|
|
14
|
-
EMAIL_API_KEY: string;
|
|
15
|
-
SMS_AUTH_TOKEN: string;
|
|
16
14
|
};
|
|
15
|
+
services: {
|
|
16
|
+
binding: string;
|
|
17
|
+
service: string;
|
|
18
|
+
}[];
|
|
17
19
|
d1_databases: {
|
|
18
20
|
binding: string;
|
|
19
21
|
database_name: string;
|
|
@@ -11,9 +11,11 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
|
|
|
11
11
|
SMS_ACCOUNT_ID: string;
|
|
12
12
|
SMS_SERVICE_ID: string | number;
|
|
13
13
|
SLACK_WEBHOOK: string;
|
|
14
|
-
EMAIL_API_KEY: string;
|
|
15
|
-
SMS_AUTH_TOKEN: string;
|
|
16
14
|
};
|
|
15
|
+
services: {
|
|
16
|
+
binding: string;
|
|
17
|
+
service: string;
|
|
18
|
+
}[];
|
|
17
19
|
d1_databases: {
|
|
18
20
|
binding: string;
|
|
19
21
|
database_name: string;
|
package/dist/export/wrangler.mjs
CHANGED
|
@@ -8,13 +8,15 @@ function defineNotificationServiceWrangler(config) {
|
|
|
8
8
|
name
|
|
9
9
|
}),
|
|
10
10
|
vars: {
|
|
11
|
-
// Secrets
|
|
12
|
-
EMAIL_API_KEY: "[SECRET]",
|
|
13
|
-
SMS_AUTH_TOKEN: "[SECRET]",
|
|
14
|
-
// Variables
|
|
15
11
|
...envs.local.vars,
|
|
16
12
|
ENVIRONMENT: "localhost"
|
|
17
13
|
},
|
|
14
|
+
services: [
|
|
15
|
+
{
|
|
16
|
+
binding: "SECRETS_STORE",
|
|
17
|
+
service: `${project}-secrets-store`
|
|
18
|
+
}
|
|
19
|
+
],
|
|
18
20
|
d1_databases: [
|
|
19
21
|
{
|
|
20
22
|
binding: "NOTIFICATION_D1",
|
|
@@ -49,6 +51,12 @@ function defineNotificationServiceWrangler(config) {
|
|
|
49
51
|
...envCfg.vars,
|
|
50
52
|
ENVIRONMENT: envName
|
|
51
53
|
},
|
|
54
|
+
services: [
|
|
55
|
+
{
|
|
56
|
+
binding: "SECRETS_STORE",
|
|
57
|
+
service: `${project}-secrets-store-${envName}`
|
|
58
|
+
}
|
|
59
|
+
],
|
|
52
60
|
d1_databases: [
|
|
53
61
|
{
|
|
54
62
|
binding: "NOTIFICATION_D1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@develit-services/notification",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"author": "Develit.io s.r.o.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"./dist"
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
|
-
"dev": "wrangler dev --port 9236 --persist-to ../../.wrangler/state",
|
|
33
|
+
"dev": "wrangler dev --port 9236 --persist-to ../../.wrangler/state -c ./wrangler.jsonc -c ../../apps/secrets-store/wrangler.jsonc",
|
|
34
34
|
"wrangler:generate": "bunx develit wrangler:generate --types",
|
|
35
35
|
"db:init": "wrangler d1 execute develit-notification --local --persist-to ../../.wrangler/state --command=\"SELECT 'Creating database...' AS status;\"",
|
|
36
36
|
"db:generate": "drizzle-kit generate",
|
|
37
37
|
"db:migrate": "drizzle-kit migrate",
|
|
38
38
|
"db:explore": "drizzle-kit studio",
|
|
39
|
-
"types": "
|
|
39
|
+
"types": "bash typegen.sh",
|
|
40
40
|
"lint": "biome check",
|
|
41
41
|
"lint:fix": "biome check --fix",
|
|
42
42
|
"test": "vitest",
|