@strav/notification 1.0.0-alpha.30 → 1.0.0-alpha.33

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/notification",
3
- "version": "1.0.0-alpha.30",
3
+ "version": "1.0.0-alpha.33",
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"
30
+ "@strav/kernel": "1.0.0-alpha.33"
31
31
  },
32
32
  "devDependencies": {
33
- "@strav/broadcast": "1.0.0-alpha.30",
34
- "@strav/database": "1.0.0-alpha.30",
35
- "@strav/http": "1.0.0-alpha.30",
36
- "@strav/mail": "1.0.0-alpha.30"
33
+ "@strav/broadcast": "1.0.0-alpha.33",
34
+ "@strav/database": "1.0.0-alpha.33",
35
+ "@strav/http": "1.0.0-alpha.33",
36
+ "@strav/mail": "1.0.0-alpha.33"
37
37
  },
38
38
  "peerDependencies": {
39
- "@strav/broadcast": "1.0.0-alpha.30",
40
- "@strav/database": "1.0.0-alpha.30",
41
- "@strav/http": "1.0.0-alpha.30",
42
- "@strav/mail": "1.0.0-alpha.30",
39
+ "@strav/broadcast": "1.0.0-alpha.33",
40
+ "@strav/database": "1.0.0-alpha.33",
41
+ "@strav/http": "1.0.0-alpha.33",
42
+ "@strav/mail": "1.0.0-alpha.33",
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,8 @@
1
+ /**
2
+ * Vendor-specific config shape for the database channel.
3
+ * Discriminator `driver: 'database'` selects this factory.
4
+ */
5
+
1
6
  import type { ChannelConfig } from '../../notification_config.ts'
2
7
 
3
8
  export interface DatabaseChannelConfig extends ChannelConfig {
@@ -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,8 @@
1
+ /**
2
+ * Vendor-specific config shape for the mail channel.
3
+ * Discriminator `driver: 'mail'` selects this factory.
4
+ */
5
+
1
6
  import type { ChannelConfig } from '../../notification_config.ts'
2
7
 
3
8
  export interface MailChannelConfig extends ChannelConfig {
@@ -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'