@edusight/notification-widget 1.0.8 → 1.0.10
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/README.md +6 -1
- package/dist/hooks/useNotificationCenter.d.ts.map +1 -1
- package/dist/hooks/useNotifications.d.ts +3 -2
- package/dist/hooks/useNotifications.d.ts.map +1 -1
- package/dist/index.cjs.js +18 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +869 -855
- package/dist/index.esm.js.map +1 -1
- package/dist/services/notification-service.d.ts +9 -0
- package/dist/services/notification-service.d.ts.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -16,7 +16,9 @@ import { NotificationClient } from '@edusight/notification-sdk';
|
|
|
16
16
|
|
|
17
17
|
const client = new NotificationClient({
|
|
18
18
|
apiKey: 'your-api-key',
|
|
19
|
-
|
|
19
|
+
apiUrl: 'https://api.example.com',
|
|
20
|
+
apiScope: 'api', // defaults to 'api'
|
|
21
|
+
apiVersion: 'v1', // defaults to 'v1'
|
|
20
22
|
tenantId: 'your-tenant-id',
|
|
21
23
|
environmentId: 'dev',
|
|
22
24
|
});
|
|
@@ -35,6 +37,8 @@ function App() {
|
|
|
35
37
|
}
|
|
36
38
|
```
|
|
37
39
|
|
|
40
|
+
This widget expects the `NotificationClient` you pass to already carry the matching `tenantId`, `environmentId`, and API version (`apiScope`/`apiVersion`). The SDK builds both HTTP and WebSocket URLs as `https://host/{apiScope}/{apiVersion}` and automatically injects `x-tenant-id`/`x-environment-id`, so no additional headers or manual URL concatenation are necessary.
|
|
41
|
+
|
|
38
42
|
## Features
|
|
39
43
|
|
|
40
44
|
- **Real-time Updates**: WebSocket integration with automatic reconnection and acknowledgement persistence
|
|
@@ -44,6 +48,7 @@ function App() {
|
|
|
44
48
|
- **Actions**: Mark as read, delete notifications
|
|
45
49
|
- **Filtering**: Filter by all/unread
|
|
46
50
|
- **Customizable**: Position, theme, max notifications
|
|
51
|
+
- **Tenant-aware**: Uses the SDK client’s tenant/environment context + versioned URL so every request passes `TenantGuard`.
|
|
47
52
|
|
|
48
53
|
## Components
|
|
49
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotificationCenter.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotificationCenter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAsB,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"useNotificationCenter.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotificationCenter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAsB,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAKlG,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,kBAAkB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,2BAA2B,CA2E7B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Notification, NotificationFilters } from '@edusight/notification-sdk';
|
|
2
|
+
import { NotificationService } from '../services/notification-service';
|
|
2
3
|
export interface UseNotificationsOptions {
|
|
3
|
-
|
|
4
|
+
service: NotificationService;
|
|
4
5
|
tenantId: string;
|
|
5
6
|
subscriberId?: string;
|
|
6
7
|
filters?: NotificationFilters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,kBAAkB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,sBAAsB,CAoFzF"}
|