@develit-services/notification 0.6.1 → 0.6.2

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.
@@ -3,19 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const backendSdk = require('@develit-io/backend-sdk');
6
- const database_schema = require('../database/schema.cjs');
7
- require('drizzle-orm');
8
- require('drizzle-orm/sqlite-core');
9
6
  const webhook_connector = require('../shared/notification.BLPB8Ib2.cjs');
10
7
  require('@develit-io/backend-sdk/signature');
11
8
  const cloudflare_workers = require('cloudflare:workers');
12
- const d1 = require('drizzle-orm/d1');
13
9
  require('zod');
14
10
  require('zod/v4');
15
11
  require('twilio');
16
12
 
17
- const tables = database_schema.schema;
18
-
19
13
  const initiateEmailConnector = async (provider, apiKey, smtpHost, senderEmail, senderName) => {
20
14
  const connector = [webhook_connector.EcomailConnector].find(
21
15
  (conn) => conn.providerName === provider
@@ -71,7 +65,6 @@ let NotificationServiceBase = class extends backendSdk.develitWorker(
71
65
  constructor(ctx, env) {
72
66
  super(ctx, env);
73
67
  this.slackConnector = new webhook_connector.SlackConnector(this.env.SLACK_WEBHOOK);
74
- this.db = d1.drizzle(this.env.NOTIFICATION_D1, { schema: tables });
75
68
  }
76
69
  async queue(batch) {
77
70
  for (const message of batch.messages) {
@@ -1,21 +1,16 @@
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 schema } from '../database/schema.cjs';
4
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';
5
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
6
- import { DrizzleD1Database } from 'drizzle-orm/d1';
7
5
  import 'zod';
8
6
  import 'zod/v4';
9
7
 
10
- declare const tables: typeof schema;
11
-
12
8
  declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
13
9
  declare class NotificationServiceBase extends NotificationServiceBase_base {
14
10
  readonly slackConnector: SlackConnector;
15
11
  protected webhookConnector: WebhookConnector;
16
12
  protected emailConnector: IEmailConnector;
17
13
  protected smsConnector: ISmsConnector;
18
- readonly db: DrizzleD1Database<typeof tables>;
19
14
  constructor(ctx: ExecutionContext, env: NotificationEnv);
20
15
  queue(batch: MessageBatch<NotificationQueueMessage>): Promise<void>;
21
16
  protected _sendEmail(input: SendEmailInput): Promise<IRPCResponse<SendEmailOutput>>;
@@ -1,21 +1,16 @@
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 schema } from '../database/schema.mjs';
4
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';
5
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
6
- import { DrizzleD1Database } from 'drizzle-orm/d1';
7
5
  import 'zod';
8
6
  import 'zod/v4';
9
7
 
10
- declare const tables: typeof schema;
11
-
12
8
  declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
13
9
  declare class NotificationServiceBase extends NotificationServiceBase_base {
14
10
  readonly slackConnector: SlackConnector;
15
11
  protected webhookConnector: WebhookConnector;
16
12
  protected emailConnector: IEmailConnector;
17
13
  protected smsConnector: ISmsConnector;
18
- readonly db: DrizzleD1Database<typeof tables>;
19
14
  constructor(ctx: ExecutionContext, env: NotificationEnv);
20
15
  queue(batch: MessageBatch<NotificationQueueMessage>): Promise<void>;
21
16
  protected _sendEmail(input: SendEmailInput): Promise<IRPCResponse<SendEmailOutput>>;
@@ -1,21 +1,16 @@
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 schema } from '../database/schema.js';
4
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';
5
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
6
- import { DrizzleD1Database } from 'drizzle-orm/d1';
7
5
  import 'zod';
8
6
  import 'zod/v4';
9
7
 
10
- declare const tables: typeof schema;
11
-
12
8
  declare const NotificationServiceBase_base: (abstract new (ctx: ExecutionContext, env: NotificationEnv) => WorkerEntrypoint<NotificationEnv, {}>) & (abstract new (...args: any[]) => _develit_io_backend_sdk.DevelitWorkerMethods);
13
9
  declare class NotificationServiceBase extends NotificationServiceBase_base {
14
10
  readonly slackConnector: SlackConnector;
15
11
  protected webhookConnector: WebhookConnector;
16
12
  protected emailConnector: IEmailConnector;
17
13
  protected smsConnector: ISmsConnector;
18
- readonly db: DrizzleD1Database<typeof tables>;
19
14
  constructor(ctx: ExecutionContext, env: NotificationEnv);
20
15
  queue(batch: MessageBatch<NotificationQueueMessage>): Promise<void>;
21
16
  protected _sendEmail(input: SendEmailInput): Promise<IRPCResponse<SendEmailOutput>>;
@@ -1,17 +1,11 @@
1
1
  import { createInternalError, develitWorker, uuidv4, cloudflareQueue, action, service } from '@develit-io/backend-sdk';
2
- import { s as schema } from '../database/schema.mjs';
3
- import 'drizzle-orm';
4
- import 'drizzle-orm/sqlite-core';
5
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';
6
3
  import '@develit-io/backend-sdk/signature';
7
4
  import { WorkerEntrypoint } from 'cloudflare:workers';
8
- import { drizzle } from 'drizzle-orm/d1';
9
5
  import 'zod';
10
6
  import 'zod/v4';
11
7
  import 'twilio';
12
8
 
13
- const tables = schema;
14
-
15
9
  const initiateEmailConnector = async (provider, apiKey, smtpHost, senderEmail, senderName) => {
16
10
  const connector = [EcomailConnector].find(
17
11
  (conn) => conn.providerName === provider
@@ -67,7 +61,6 @@ let NotificationServiceBase = class extends develitWorker(
67
61
  constructor(ctx, env) {
68
62
  super(ctx, env);
69
63
  this.slackConnector = new SlackConnector(this.env.SLACK_WEBHOOK);
70
- this.db = drizzle(this.env.NOTIFICATION_D1, { schema: tables });
71
64
  }
72
65
  async queue(batch) {
73
66
  for (const message of batch.messages) {
@@ -19,14 +19,6 @@ function defineNotificationServiceWrangler(config) {
19
19
  service: `${project}-secrets-store`
20
20
  }
21
21
  ],
22
- d1_databases: [
23
- {
24
- binding: "NOTIFICATION_D1",
25
- database_name: `${project}-notification`,
26
- database_id: envs.local.d1.id,
27
- migrations_dir: "./src/database/migrations"
28
- }
29
- ],
30
22
  kv_namespaces: envs.local.kv ? [
31
23
  {
32
24
  binding: "RECEIVED_EMAILS_KV",
@@ -63,14 +55,6 @@ function defineNotificationServiceWrangler(config) {
63
55
  ...envCfg.vars,
64
56
  ENVIRONMENT: envName
65
57
  },
66
- d1_databases: [
67
- {
68
- binding: "NOTIFICATION_D1",
69
- database_name: `${project}-notification-${envName}`,
70
- database_id: envCfg.d1.id,
71
- migrations_dir: "./src/database/migrations"
72
- }
73
- ],
74
58
  ...envCfg.kv && {
75
59
  kv_namespaces: [
76
60
  {
@@ -1,4 +1,4 @@
1
- import { N as NotificationServiceWranglerConfig } from '../shared/notification.CdlaOUd0.cjs';
1
+ import { N as NotificationServiceWranglerConfig } from '../shared/notification.Csi9Hg5K.cjs';
2
2
 
3
3
  declare function defineNotificationServiceWrangler(config: NotificationServiceWranglerConfig): {
4
4
  vars: {
@@ -14,12 +14,6 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
14
14
  binding: string;
15
15
  service: string;
16
16
  }[];
17
- d1_databases: {
18
- binding: string;
19
- database_name: string;
20
- database_id: string;
21
- migrations_dir: string;
22
- }[];
23
17
  kv_namespaces: {
24
18
  binding: string;
25
19
  id: string;
@@ -1,4 +1,4 @@
1
- import { N as NotificationServiceWranglerConfig } from '../shared/notification.CdlaOUd0.mjs';
1
+ import { N as NotificationServiceWranglerConfig } from '../shared/notification.Csi9Hg5K.mjs';
2
2
 
3
3
  declare function defineNotificationServiceWrangler(config: NotificationServiceWranglerConfig): {
4
4
  vars: {
@@ -14,12 +14,6 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
14
14
  binding: string;
15
15
  service: string;
16
16
  }[];
17
- d1_databases: {
18
- binding: string;
19
- database_name: string;
20
- database_id: string;
21
- migrations_dir: string;
22
- }[];
23
17
  kv_namespaces: {
24
18
  binding: string;
25
19
  id: string;
@@ -1,4 +1,4 @@
1
- import { N as NotificationServiceWranglerConfig } from '../shared/notification.CdlaOUd0.js';
1
+ import { N as NotificationServiceWranglerConfig } from '../shared/notification.Csi9Hg5K.js';
2
2
 
3
3
  declare function defineNotificationServiceWrangler(config: NotificationServiceWranglerConfig): {
4
4
  vars: {
@@ -14,12 +14,6 @@ declare function defineNotificationServiceWrangler(config: NotificationServiceWr
14
14
  binding: string;
15
15
  service: string;
16
16
  }[];
17
- d1_databases: {
18
- binding: string;
19
- database_name: string;
20
- database_id: string;
21
- migrations_dir: string;
22
- }[];
23
17
  kv_namespaces: {
24
18
  binding: string;
25
19
  id: string;
@@ -17,14 +17,6 @@ function defineNotificationServiceWrangler(config) {
17
17
  service: `${project}-secrets-store`
18
18
  }
19
19
  ],
20
- d1_databases: [
21
- {
22
- binding: "NOTIFICATION_D1",
23
- database_name: `${project}-notification`,
24
- database_id: envs.local.d1.id,
25
- migrations_dir: "./src/database/migrations"
26
- }
27
- ],
28
20
  kv_namespaces: envs.local.kv ? [
29
21
  {
30
22
  binding: "RECEIVED_EMAILS_KV",
@@ -61,14 +53,6 @@ function defineNotificationServiceWrangler(config) {
61
53
  ...envCfg.vars,
62
54
  ENVIRONMENT: envName
63
55
  },
64
- d1_databases: [
65
- {
66
- binding: "NOTIFICATION_D1",
67
- database_name: `${project}-notification-${envName}`,
68
- database_id: envCfg.d1.id,
69
- migrations_dir: "./src/database/migrations"
70
- }
71
- ],
72
56
  ...envCfg.kv && {
73
57
  kv_namespaces: [
74
58
  {
@@ -3,9 +3,6 @@ interface NotificationServiceEnvironmentConfig {
3
3
  max_batch_size?: number;
4
4
  max_batch_timeout?: number;
5
5
  };
6
- d1: {
7
- id: string;
8
- };
9
6
  kv?: {
10
7
  id: string;
11
8
  };
@@ -3,9 +3,6 @@ interface NotificationServiceEnvironmentConfig {
3
3
  max_batch_size?: number;
4
4
  max_batch_timeout?: number;
5
5
  };
6
- d1: {
7
- id: string;
8
- };
9
6
  kv?: {
10
7
  id: string;
11
8
  };
@@ -3,9 +3,6 @@ interface NotificationServiceEnvironmentConfig {
3
3
  max_batch_size?: number;
4
4
  max_batch_timeout?: number;
5
5
  };
6
- d1: {
7
- id: string;
8
- };
9
6
  kv?: {
10
7
  id: string;
11
8
  };
package/dist/types.d.cts CHANGED
@@ -1,7 +1,7 @@
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, b as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.CdlaOUd0.cjs';
4
+ export { a as NotificationServiceEnv, b as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.Csi9Hg5K.cjs';
5
5
  import 'zod';
6
6
  import 'zod/v4';
7
7
 
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
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, b as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.CdlaOUd0.mjs';
4
+ export { a as NotificationServiceEnv, b as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.Csi9Hg5K.mjs';
5
5
  import 'zod';
6
6
  import 'zod/v4';
7
7
 
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
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, b as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.CdlaOUd0.js';
4
+ export { a as NotificationServiceEnv, b as NotificationServiceEnvironmentConfig, N as NotificationServiceWranglerConfig } from './shared/notification.Csi9Hg5K.js';
5
5
  import 'zod';
6
6
  import 'zod/v4';
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/notification",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -14,11 +14,6 @@
14
14
  "import": "./dist/export/worker.mjs",
15
15
  "require": "./dist/export/worker.cjs"
16
16
  },
17
- "./db-schema": {
18
- "types": "./dist/database/schema.d.ts",
19
- "import": "./dist/database/schema.mjs",
20
- "require": "./dist/database/schema.cjs"
21
- },
22
17
  "./@types": {
23
18
  "types": "./dist/types.d.ts",
24
19
  "import": "./dist/types.mjs",
@@ -32,10 +27,6 @@
32
27
  "scripts": {
33
28
  "dev": "wrangler dev --port 9236 --persist-to ../../.wrangler/state -c ./wrangler.jsonc -c ../../apps/secrets-store/wrangler.jsonc",
34
29
  "wrangler:generate": "bunx develit wrangler:generate --types",
35
- "db:init": "wrangler d1 execute develit-notification --local --persist-to ../../.wrangler/state --command=\"SELECT 'Creating database...' AS status;\"",
36
- "db:generate": "NODE_OPTIONS='--import tsx' drizzle-kit generate",
37
- "db:migrate": "NODE_OPTIONS='--import tsx' drizzle-kit migrate",
38
- "db:explore": "NODE_OPTIONS='--import tsx' drizzle-kit studio",
39
30
  "types": "bash typegen.sh",
40
31
  "lint": "biome check",
41
32
  "lint:fix": "biome check --fix",
@@ -50,7 +41,6 @@
50
41
  },
51
42
  "peerDependencies": {
52
43
  "@develit-io/backend-sdk": "^9.10.3",
53
- "drizzle-orm": "^0.45.0",
54
44
  "zod": "^4.1.13"
55
45
  }
56
46
  }
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- const schema = {
4
- __proto__: null
5
- };
6
-
7
- exports.schema = schema;
@@ -1,6 +0,0 @@
1
- declare namespace schema {
2
- export {
3
- };
4
- }
5
-
6
- export { schema as s };
@@ -1,6 +0,0 @@
1
- declare namespace schema {
2
- export {
3
- };
4
- }
5
-
6
- export { schema as s };
@@ -1,6 +0,0 @@
1
- declare namespace schema {
2
- export {
3
- };
4
- }
5
-
6
- export { schema as s };
@@ -1,5 +0,0 @@
1
- const schema = {
2
- __proto__: null
3
- };
4
-
5
- export { schema as s };