@strav/notification 1.0.0-alpha.29 → 1.0.0-alpha.31
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 +10 -10
- package/src/drivers/broadcast/broadcast_notification_provider.ts +9 -0
- package/src/drivers/database/database_config.ts +5 -0
- package/src/drivers/database/tenanted/apply_tenanted_notification_migration.ts +9 -0
- package/src/drivers/database/tenanted/tenanted_notification_record.ts +7 -0
- package/src/drivers/mail/mail_config.ts +5 -0
- package/src/drivers/mail/mail_notification_provider.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strav/notification",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.31",
|
|
4
4
|
"description": "Strav multi-channel notifications — NotificationManager fan-out across channel drivers (mail / database / log / webhook / broadcast / discord / sse). Manager+drivers shape; new channels register via `manager.extend(name, factory)`.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@strav/kernel": "1.0.0-alpha.
|
|
30
|
+
"@strav/kernel": "1.0.0-alpha.31"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@strav/broadcast": "1.0.0-alpha.
|
|
34
|
-
"@strav/database": "1.0.0-alpha.
|
|
35
|
-
"@strav/http": "1.0.0-alpha.
|
|
36
|
-
"@strav/mail": "1.0.0-alpha.
|
|
33
|
+
"@strav/broadcast": "1.0.0-alpha.31",
|
|
34
|
+
"@strav/database": "1.0.0-alpha.31",
|
|
35
|
+
"@strav/http": "1.0.0-alpha.31",
|
|
36
|
+
"@strav/mail": "1.0.0-alpha.31"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@strav/broadcast": "1.0.0-alpha.
|
|
40
|
-
"@strav/database": "1.0.0-alpha.
|
|
41
|
-
"@strav/http": "1.0.0-alpha.
|
|
42
|
-
"@strav/mail": "1.0.0-alpha.
|
|
39
|
+
"@strav/broadcast": "1.0.0-alpha.31",
|
|
40
|
+
"@strav/database": "1.0.0-alpha.31",
|
|
41
|
+
"@strav/http": "1.0.0-alpha.31",
|
|
42
|
+
"@strav/mail": "1.0.0-alpha.31",
|
|
43
43
|
"@types/bun": ">=1.3.14"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ServiceProvider that registers the broadcast-channel factory on the
|
|
3
|
+
* `NotificationManager`. Each instance fans out via the resolved
|
|
4
|
+
* `Broadcaster` — routing per-notification is decided by
|
|
5
|
+
* `toBroadcast(notifiable)`'s returned `channel` field.
|
|
6
|
+
*
|
|
7
|
+
* Include AFTER `NotificationProvider` + `BroadcastProvider`.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
import { Broadcaster } from '@strav/broadcast'
|
|
2
11
|
import { type Application, ServiceProvider } from '@strav/kernel'
|
|
3
12
|
import { NotificationManager } from '../../notification_manager.ts'
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `applyTenantedNotificationMigration` — emit DDL for the per-tenant
|
|
3
|
+
* `notification` table plus a `(tenant_id, notifiable_id, read_at)`
|
|
4
|
+
* lookup index used by the tenanted `NotificationRepository.unread(...)`.
|
|
5
|
+
*
|
|
6
|
+
* Apps that don't need per-tenant scoping use the non-tenanted
|
|
7
|
+
* `applyNotificationMigration` from `@strav/notification` instead.
|
|
8
|
+
*/
|
|
9
|
+
|
|
1
10
|
import { type DatabaseExecutor, emitCreateTable, type SchemaRegistry } from '@strav/database'
|
|
2
11
|
import { tenantedNotificationSchema } from './schemas/tenanted_notification_schema.ts'
|
|
3
12
|
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `TenantedNotificationRecord` — typed row of the per-tenant
|
|
3
|
+
* `notification` ledger. Mirrors `NotificationRecord` with a
|
|
4
|
+
* `tenant_id` column; apps subclass when they want a per-notifiable
|
|
5
|
+
* model.
|
|
6
|
+
*/
|
|
7
|
+
|
|
1
8
|
import { Model } from '@strav/database'
|
|
2
9
|
import { tenantedNotificationSchema } from './schemas/tenanted_notification_schema.ts'
|
|
3
10
|
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ServiceProvider that registers the mail-channel factory on the
|
|
3
|
+
* `NotificationManager`. Each instance delegates to `MailManager.via(transport)`
|
|
4
|
+
* — apps select the transport via the channel's `transport` config field.
|
|
5
|
+
*
|
|
6
|
+
* Include AFTER `NotificationProvider` + `MailProvider`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
import { type Application, ServiceProvider } from '@strav/kernel'
|
|
2
10
|
import { MailManager } from '@strav/mail'
|
|
3
11
|
import { NotificationManager } from '../../notification_manager.ts'
|