@strav/signal 0.1.0 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strav/signal",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "Communication layer for the Strav framework — mail, notifications, and broadcasting",
6
6
  "license": "MIT",
@@ -30,11 +30,11 @@
30
30
  "./providers/*": "./src/providers/*.ts"
31
31
  },
32
32
  "peerDependencies": {
33
- "@strav/kernel": "0.1.0",
34
- "@strav/http": "0.1.0",
35
- "@strav/view": "0.1.0",
36
- "@strav/database": "0.1.0",
37
- "@strav/queue": "0.1.0"
33
+ "@strav/kernel": "0.1.4",
34
+ "@strav/http": "0.1.4",
35
+ "@strav/view": "0.1.4",
36
+ "@strav/database": "0.1.4",
37
+ "@strav/queue": "0.1.4"
38
38
  },
39
39
  "dependencies": {
40
40
  "nodemailer": "^6.10.0",
@@ -1,9 +1,9 @@
1
1
  import type { ServerWebSocket } from 'bun'
2
- import Context from '@stravigor/http/http/context'
3
- import { compose } from '@stravigor/http/http/middleware'
4
- import type { Middleware } from '@stravigor/http/http/middleware'
5
- import type Router from '@stravigor/http/http/router'
6
- import type { WebSocketData } from '@stravigor/http/http/router'
2
+ import Context from '@strav/http/http/context'
3
+ import { compose } from '@strav/http/http/middleware'
4
+ import type { Middleware } from '@strav/http/http/middleware'
5
+ import type Router from '@strav/http/http/router'
6
+ import type { WebSocketData } from '@strav/http/http/router'
7
7
 
8
8
  // ---------------------------------------------------------------------------
9
9
  // Types
@@ -8,7 +8,7 @@
8
8
  * Zero dependencies — works in any browser.
9
9
  *
10
10
  * @example
11
- * import { Broadcast } from '@stravigor/signal/broadcast/client'
11
+ * import { Broadcast } from '@strav/signal/broadcast/client'
12
12
  *
13
13
  * const bc = new Broadcast()
14
14
  *
@@ -11,13 +11,13 @@ export type { BroadcastOptions } from './client.ts'
11
11
 
12
12
  import BroadcastManager from './broadcast_manager.ts'
13
13
  import type { AuthorizeCallback, ChannelConfig, BootOptions } from './broadcast_manager.ts'
14
- import type Router from '@stravigor/http/http/router'
14
+ import type Router from '@strav/http/http/router'
15
15
 
16
16
  /**
17
17
  * Broadcast helper — convenience object that delegates to `BroadcastManager`.
18
18
  *
19
19
  * @example
20
- * import { broadcast } from '@stravigor/signal/broadcast'
20
+ * import { broadcast } from '@strav/signal/broadcast'
21
21
  *
22
22
  * // Bootstrap
23
23
  * broadcast.boot(router, { middleware: [session()] })
@@ -1,7 +1,7 @@
1
1
  import MailManager from './mail_manager.ts'
2
- import { ViewEngine } from '@stravigor/view'
2
+ import { ViewEngine } from '@strav/view'
3
3
  import { inlineCss } from './css_inliner.ts'
4
- import Queue from '@stravigor/queue/queue/queue'
4
+ import Queue from '@strav/queue/queue/queue'
5
5
  import type { MailMessage, MailResult, MailAttachment } from './types.ts'
6
6
 
7
7
  /**
@@ -133,7 +133,7 @@ export class PendingMail {
133
133
  * Mail helper object — the primary API for sending emails.
134
134
  *
135
135
  * @example
136
- * import { mail } from '@stravigor/signal/mail'
136
+ * import { mail } from '@strav/signal/mail'
137
137
  *
138
138
  * // Fluent builder
139
139
  * await mail.to('user@example.com').subject('Hello').template('welcome', { name }).send()
@@ -1,6 +1,6 @@
1
- import { inject } from '@stravigor/kernel/core/inject'
2
- import { ConfigurationError } from '@stravigor/kernel/exceptions/errors'
3
- import Configuration from '@stravigor/kernel/config/configuration'
1
+ import { inject } from '@strav/kernel/core/inject'
2
+ import { ConfigurationError } from '@strav/kernel/exceptions/errors'
3
+ import Configuration from '@strav/kernel/config/configuration'
4
4
  import { SmtpTransport } from './transports/smtp_transport.ts'
5
5
  import { ResendTransport } from './transports/resend_transport.ts'
6
6
  import { SendGridTransport } from './transports/sendgrid_transport.ts'
@@ -1,5 +1,5 @@
1
1
  import crypto from 'node:crypto'
2
- import { ExternalServiceError } from '@stravigor/kernel/exceptions/errors'
2
+ import { ExternalServiceError } from '@strav/kernel/exceptions/errors'
3
3
  import type { MailTransport, MailMessage, MailResult, AlibabaConfig } from '../types.ts'
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { ExternalServiceError } from '@stravigor/kernel/exceptions/errors'
1
+ import { ExternalServiceError } from '@strav/kernel/exceptions/errors'
2
2
  import type { MailTransport, MailMessage, MailResult, MailgunConfig } from '../types.ts'
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { ExternalServiceError } from '@stravigor/kernel/exceptions/errors'
1
+ import { ExternalServiceError } from '@strav/kernel/exceptions/errors'
2
2
  import type { MailTransport, MailMessage, MailResult, ResendConfig } from '../types.ts'
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { ExternalServiceError } from '@stravigor/kernel/exceptions/errors'
1
+ import { ExternalServiceError } from '@strav/kernel/exceptions/errors'
2
2
  import type { MailTransport, MailMessage, MailResult, SendGridConfig } from '../types.ts'
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import type { NotificationChannel, Notifiable, NotificationPayload } from '../types.ts'
2
- import Database from '@stravigor/database/database/database'
2
+ import Database from '@strav/database/database/database'
3
3
 
4
4
  /**
5
5
  * Stores notifications in the `_strav_notifications` table.
@@ -1,4 +1,4 @@
1
- import { ExternalServiceError } from '@stravigor/kernel/exceptions/errors'
1
+ import { ExternalServiceError } from '@strav/kernel/exceptions/errors'
2
2
  import type {
3
3
  NotificationChannel,
4
4
  Notifiable,
@@ -1,4 +1,4 @@
1
- import { ExternalServiceError } from '@stravigor/kernel/exceptions/errors'
1
+ import { ExternalServiceError } from '@strav/kernel/exceptions/errors'
2
2
  import type {
3
3
  NotificationChannel,
4
4
  Notifiable,
@@ -1,15 +1,15 @@
1
1
  import NotificationManager from './notification_manager.ts'
2
2
  import type { BaseNotification } from './base_notification.ts'
3
3
  import type { Notifiable, NotificationRecord } from './types.ts'
4
- import Queue from '@stravigor/queue/queue/queue'
5
- import Emitter from '@stravigor/kernel/events/emitter'
6
- import Database from '@stravigor/database/database/database'
4
+ import Queue from '@strav/queue/queue/queue'
5
+ import Emitter from '@strav/kernel/events/emitter'
6
+ import Database from '@strav/database/database/database'
7
7
 
8
8
  /**
9
9
  * Send a notification to one or more recipients.
10
10
  *
11
11
  * @example
12
- * import { notify } from '@stravigor/signal/notification'
12
+ * import { notify } from '@strav/signal/notification'
13
13
  *
14
14
  * await notify(user, new TaskAssignedNotification(task, assigner))
15
15
  * await notify([user1, user2], new InvoicePaidNotification(invoice))
@@ -70,7 +70,7 @@ async function sendNow(notifiable: Notifiable, notification: BaseNotification):
70
70
  * Notification query helper — convenience API for in-app notification reads.
71
71
  *
72
72
  * @example
73
- * import { notifications } from '@stravigor/signal/notification'
73
+ * import { notifications } from '@strav/signal/notification'
74
74
  *
75
75
  * const unread = await notifications.unread('user', userId)
76
76
  * await notifications.markAsRead(notificationId)
@@ -1,12 +1,12 @@
1
- import { inject } from '@stravigor/kernel/core/inject'
2
- import Configuration from '@stravigor/kernel/config/configuration'
3
- import Database from '@stravigor/database/database/database'
1
+ import { inject } from '@strav/kernel/core/inject'
2
+ import Configuration from '@strav/kernel/config/configuration'
3
+ import Database from '@strav/database/database/database'
4
4
  import type { NotificationChannel, NotificationConfig, EventNotificationBinding } from './types.ts'
5
5
  import { EmailChannel } from './channels/email_channel.ts'
6
6
  import { DatabaseChannel } from './channels/database_channel.ts'
7
7
  import { WebhookChannel } from './channels/webhook_channel.ts'
8
8
  import { DiscordChannel } from './channels/discord_channel.ts'
9
- import { ConfigurationError } from '@stravigor/kernel/exceptions/errors'
9
+ import { ConfigurationError } from '@strav/kernel/exceptions/errors'
10
10
 
11
11
  /**
12
12
  * Central notification configuration hub.
@@ -1,8 +1,8 @@
1
- import ServiceProvider from '@stravigor/kernel/core/service_provider'
2
- import type Application from '@stravigor/kernel/core/application'
1
+ import ServiceProvider from '@strav/kernel/core/service_provider'
2
+ import type Application from '@strav/kernel/core/application'
3
3
  import BroadcastManager from '../broadcast/broadcast_manager.ts'
4
4
  import type { BootOptions } from '../broadcast/broadcast_manager.ts'
5
- import Router from '@stravigor/http/http/router'
5
+ import Router from '@strav/http/http/router'
6
6
 
7
7
  export default class BroadcastProvider extends ServiceProvider {
8
8
  readonly name = 'broadcast'
@@ -1,5 +1,5 @@
1
- import ServiceProvider from '@stravigor/kernel/core/service_provider'
2
- import type Application from '@stravigor/kernel/core/application'
1
+ import ServiceProvider from '@strav/kernel/core/service_provider'
2
+ import type Application from '@strav/kernel/core/application'
3
3
  import MailManager from '../mail/mail_manager.ts'
4
4
 
5
5
  export default class MailProvider extends ServiceProvider {
@@ -1,5 +1,5 @@
1
- import ServiceProvider from '@stravigor/kernel/core/service_provider'
2
- import type Application from '@stravigor/kernel/core/application'
1
+ import ServiceProvider from '@strav/kernel/core/service_provider'
2
+ import type Application from '@strav/kernel/core/application'
3
3
  import NotificationManager from '../notification/notification_manager.ts'
4
4
 
5
5
  export interface NotificationProviderOptions {