@voltro/plugin-notifications 0.80.0 → 0.82.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/rpc.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { MutationProcedureDescriptor } from '@voltro/protocol';
2
2
  import { PluginRpcClientDescriptor } from '@voltro/protocol';
3
3
  import { QueryProcedureDescriptor } from '@voltro/protocol';
4
+ import { ReactivityChannel } from '@voltro/protocol';
4
5
  import { Schema } from 'effect';
5
6
 
6
7
  export declare const archiveDescriptor: MutationProcedureDescriptor<"notifications.archive", Schema.Struct<{
@@ -30,6 +31,10 @@ export declare const inboxDescriptor: QueryProcedureDescriptor<"notifications.in
30
31
  limit: Schema.optional<typeof Schema.Number>;
31
32
  }>, Schema.Array$<Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.Never>;
32
33
 
34
+ /** One push channel for the inbox: every in-app delivery and read-state
35
+ * change publishes, and `inbox` / `unreadCount` re-run for subscribers. */
36
+ export declare const inboxFeed: ReactivityChannel;
37
+
33
38
  export declare const markAllReadDescriptor: MutationProcedureDescriptor<"notifications.markAllRead", Schema.Struct<{}>, Schema.Struct<{
34
39
  count: typeof Schema.Number;
35
40
  }>, typeof Schema.Never>;
package/dist/rpc.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { Schema as e } from "effect";
2
- import { defineMutation as t, defineQuery as n } from "@voltro/protocol";
2
+ import { defineMutation as t, defineQuery as n, reactivityChannel as r } from "@voltro/protocol";
3
3
  //#region src/rpc.ts
4
- var r = "@voltro/plugin-notifications", i = n({
4
+ var i = "@voltro/plugin-notifications", a = r("notifications-inbox"), o = n({
5
5
  name: "notifications.inbox",
6
+ source: a,
6
7
  input: e.Struct({
7
8
  unreadOnly: e.optional(e.Boolean),
8
9
  limit: e.optional(e.Number)
@@ -12,37 +13,38 @@ var r = "@voltro/plugin-notifications", i = n({
12
13
  value: e.Unknown
13
14
  })),
14
15
  openAccess: "self-scoped read: returns only the calling subject's own inbox items"
15
- }), a = n({
16
+ }), s = n({
16
17
  name: "notifications.unreadCount",
18
+ source: a,
17
19
  input: e.Struct({}),
18
20
  output: e.Struct({ count: e.Number }),
19
21
  openAccess: "self-scoped read: counts only the calling subject's own unread items"
20
- }), o = t({
22
+ }), c = t({
21
23
  name: "notifications.markRead",
22
24
  input: e.Struct({ id: e.String }),
23
25
  output: e.Struct({ ok: e.Boolean }),
24
26
  openAccess: "self-scoped write: marks an item read only within the calling subject's own inbox"
25
- }), s = t({
27
+ }), l = t({
26
28
  name: "notifications.markUnread",
27
29
  input: e.Struct({ id: e.String }),
28
30
  output: e.Struct({ ok: e.Boolean }),
29
31
  openAccess: "self-scoped write: marks an item unread only within the calling subject's own inbox"
30
- }), c = t({
32
+ }), u = t({
31
33
  name: "notifications.markAllRead",
32
34
  input: e.Struct({}),
33
35
  output: e.Struct({ count: e.Number }),
34
36
  openAccess: "self-scoped write: clears unread state only in the calling subject's own inbox"
35
- }), l = t({
37
+ }), d = t({
36
38
  name: "notifications.archive",
37
39
  input: e.Struct({ id: e.String }),
38
40
  output: e.Struct({ ok: e.Boolean }),
39
41
  openAccess: "self-scoped write: archives an item only within the calling subject's own inbox"
40
- }), u = t({
42
+ }), f = t({
41
43
  name: "notifications.unarchive",
42
44
  input: e.Struct({ id: e.String }),
43
45
  output: e.Struct({ ok: e.Boolean }),
44
46
  openAccess: "self-scoped write: unarchives an item only within the calling subject's own inbox"
45
- }), d = n({
47
+ }), p = n({
46
48
  name: "notifications.preferences",
47
49
  input: e.Struct({}),
48
50
  output: e.Array(e.Record({
@@ -50,7 +52,7 @@ var r = "@voltro/plugin-notifications", i = n({
50
52
  value: e.Unknown
51
53
  })),
52
54
  openAccess: "self-scoped read: returns only the calling subject's own channel preferences"
53
- }), f = t({
55
+ }), m = t({
54
56
  name: "notifications.setPreference",
55
57
  input: e.Struct({
56
58
  category: e.String,
@@ -59,17 +61,17 @@ var r = "@voltro/plugin-notifications", i = n({
59
61
  }),
60
62
  output: e.Struct({ ok: e.Boolean }),
61
63
  openAccess: "self-scoped write: toggles a channel only on the calling subject's own preferences"
62
- }), p = t({
64
+ }), h = t({
63
65
  name: "notifications.subscribe",
64
66
  input: e.Struct({ topic: e.String }),
65
67
  output: e.Struct({ ok: e.Boolean }),
66
68
  openAccess: "self-service: subscribes the calling subject itself to a topic (the subject is never caller-supplied)"
67
- }), m = t({
69
+ }), g = t({
68
70
  name: "notifications.unsubscribe",
69
71
  input: e.Struct({ topic: e.String }),
70
72
  output: e.Struct({ ok: e.Boolean }),
71
73
  openAccess: "self-service: unsubscribes the calling subject itself from a topic"
72
- }), h = t({
74
+ }), _ = t({
73
75
  name: "notifications.setQuietHours",
74
76
  input: e.Struct({
75
77
  startMinute: e.Number,
@@ -79,17 +81,17 @@ var r = "@voltro/plugin-notifications", i = n({
79
81
  }),
80
82
  output: e.Struct({ ok: e.Boolean }),
81
83
  openAccess: "self-scoped write: sets only the calling subject's own quiet-hours window"
82
- }), g = t({
84
+ }), v = t({
83
85
  name: "notifications.clearQuietHours",
84
86
  input: e.Struct({}),
85
87
  output: e.Struct({ ok: e.Boolean }),
86
88
  openAccess: "self-scoped write: clears only the calling subject's own quiet-hours window"
87
- }), _ = n({
89
+ }), y = n({
88
90
  name: "notifications.webPushPublicKey",
89
91
  input: e.Struct({}),
90
92
  output: e.Struct({ key: e.String }),
91
93
  openAccess: "public application-server key — the value every subscribing browser is handed by design"
92
- }), v = t({
94
+ }), b = t({
93
95
  name: "notifications.webPushSubscribe",
94
96
  input: e.Struct({
95
97
  endpoint: e.String,
@@ -99,17 +101,17 @@ var r = "@voltro/plugin-notifications", i = n({
99
101
  }),
100
102
  output: e.Struct({ ok: e.Boolean }),
101
103
  openAccess: "self-scoped write: registers the calling subject's own browser subscription (the subject is never caller-supplied)"
102
- }), y = t({
104
+ }), x = t({
103
105
  name: "notifications.webPushUnsubscribe",
104
106
  input: e.Struct({ endpoint: e.String }),
105
107
  output: e.Struct({ ok: e.Boolean }),
106
108
  openAccess: "self-scoped write: removes only a subscription the calling subject owns"
107
- }), b = n({
109
+ }), S = n({
108
110
  name: "notifications.webPushStatus",
109
111
  input: e.Struct({}),
110
112
  output: e.Struct({ endpoints: e.Number }),
111
113
  openAccess: "self-scoped read: counts only the calling subject's own subscriptions"
112
- }), x = [
114
+ }), C = [
113
115
  {
114
116
  tag: "notifications.webPushPublicKey",
115
117
  kind: "query",
@@ -142,7 +144,7 @@ var r = "@voltro/plugin-notifications", i = n({
142
144
  name: "webPushStatusDescriptor"
143
145
  }
144
146
  }
145
- ], S = [
147
+ ], w = [
146
148
  {
147
149
  tag: "notifications.inbox",
148
150
  kind: "query",
@@ -249,4 +251,4 @@ var r = "@voltro/plugin-notifications", i = n({
249
251
  }
250
252
  ];
251
253
  //#endregion
252
- export { r as BASE_NAME, l as archiveDescriptor, g as clearQuietHoursDescriptor, i as inboxDescriptor, c as markAllReadDescriptor, o as markReadDescriptor, s as markUnreadDescriptor, S as notificationsRpcClientImports, d as preferencesDescriptor, f as setPreferenceDescriptor, h as setQuietHoursDescriptor, p as subscribeDescriptor, u as unarchiveDescriptor, a as unreadCountDescriptor, m as unsubscribeDescriptor, _ as webPushPublicKeyDescriptor, x as webPushRpcClientImports, b as webPushStatusDescriptor, v as webPushSubscribeDescriptor, y as webPushUnsubscribeDescriptor };
254
+ export { i as BASE_NAME, d as archiveDescriptor, v as clearQuietHoursDescriptor, o as inboxDescriptor, a as inboxFeed, u as markAllReadDescriptor, c as markReadDescriptor, l as markUnreadDescriptor, w as notificationsRpcClientImports, p as preferencesDescriptor, m as setPreferenceDescriptor, _ as setQuietHoursDescriptor, h as subscribeDescriptor, f as unarchiveDescriptor, s as unreadCountDescriptor, g as unsubscribeDescriptor, y as webPushPublicKeyDescriptor, C as webPushRpcClientImports, S as webPushStatusDescriptor, b as webPushSubscribeDescriptor, x as webPushUnsubscribeDescriptor };
package/dist/web.d.ts CHANGED
@@ -13,8 +13,8 @@ declare interface InboxItem {
13
13
  readonly tenantId: string | null;
14
14
  }
15
15
 
16
- /** The caller's in-app inbox. (Plugin query route — re-reads on reconnect; for
17
- * a fully live feed, mirror the inbox into a `source`-backed app query.) */
16
+ /** The caller's in-app inbox — live: every delivery and read-state change
17
+ * re-runs it for subscribers (`source: inboxFeed`). */
18
18
  export declare const useInbox: (opts?: {
19
19
  unreadOnly?: boolean;
20
20
  limit?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-notifications",
3
- "version": "0.80.0",
3
+ "version": "0.82.0",
4
4
  "description": "One unified notification surface — email, Slack/webhook, SMS, push, in-app — with per-subject preference routing, an in-app inbox, and a delivery log. NotificationService + typed routes + useInbox/useUnreadCount hooks.",
5
5
  "keywords": [
6
6
  "voltro",
@@ -34,7 +34,12 @@
34
34
  "default": "./dist/rpc.js"
35
35
  },
36
36
  "./package.json": "./package.json",
37
- "./sw.js": "./sw.js"
37
+ "./sw.js": "./sw.js",
38
+ "./define": {
39
+ "types": "./dist/define.d.ts",
40
+ "import": "./dist/define.js",
41
+ "default": "./dist/define.js"
42
+ }
38
43
  },
39
44
  "main": "./dist/index.js",
40
45
  "module": "./dist/index.js",
@@ -44,9 +49,9 @@
44
49
  "node": ">=24.0.0"
45
50
  },
46
51
  "dependencies": {
47
- "@voltro/client": "0.80.0",
48
- "@voltro/database": "0.80.0",
49
- "@voltro/protocol": "0.80.0"
52
+ "@voltro/client": "0.82.0",
53
+ "@voltro/database": "0.82.0",
54
+ "@voltro/protocol": "0.82.0"
50
55
  },
51
56
  "peerDependencies": {
52
57
  "effect": "^3.22.2",