@node-in-layers/notifications 0.0.0-stage → 1.0.1

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.
Files changed (56) hide show
  1. package/README.md +605 -2
  2. package/backend/features.d.ts +5 -0
  3. package/backend/features.js +350 -0
  4. package/backend/features.js.map +1 -0
  5. package/backend/index.d.ts +6 -0
  6. package/backend/index.js +7 -0
  7. package/backend/index.js.map +1 -0
  8. package/backend/internal-libs.d.ts +63 -0
  9. package/backend/internal-libs.js +100 -0
  10. package/backend/internal-libs.js.map +1 -0
  11. package/backend/libs.d.ts +23 -0
  12. package/backend/libs.js +48 -0
  13. package/backend/libs.js.map +1 -0
  14. package/backend/services.d.ts +4 -0
  15. package/backend/services.js +57 -0
  16. package/backend/services.js.map +1 -0
  17. package/backend/types.d.ts +36 -0
  18. package/backend/types.js +2 -0
  19. package/backend/types.js.map +1 -0
  20. package/core/features.d.ts +4 -0
  21. package/core/features.js +6 -0
  22. package/core/features.js.map +1 -0
  23. package/core/index.d.ts +7 -0
  24. package/core/index.js +8 -0
  25. package/core/index.js.map +1 -0
  26. package/core/internal-libs.d.ts +5 -0
  27. package/core/internal-libs.js +34 -0
  28. package/core/internal-libs.js.map +1 -0
  29. package/core/libs.d.ts +28 -0
  30. package/core/libs.js +57 -0
  31. package/core/libs.js.map +1 -0
  32. package/core/models/NotificationConfigs.d.ts +13 -0
  33. package/core/models/NotificationConfigs.js +44 -0
  34. package/core/models/NotificationConfigs.js.map +1 -0
  35. package/core/models/NotificationTemplates.d.ts +11 -0
  36. package/core/models/NotificationTemplates.js +40 -0
  37. package/core/models/NotificationTemplates.js.map +1 -0
  38. package/core/models/Notifications.d.ts +49 -0
  39. package/core/models/Notifications.js +94 -0
  40. package/core/models/Notifications.js.map +1 -0
  41. package/core/models/index.d.ts +3 -0
  42. package/core/models/index.js +4 -0
  43. package/core/models/index.js.map +1 -0
  44. package/core/services.d.ts +4 -0
  45. package/core/services.js +6 -0
  46. package/core/services.js.map +1 -0
  47. package/core/types.d.ts +323 -0
  48. package/core/types.js +220 -0
  49. package/core/types.js.map +1 -0
  50. package/index.d.ts +4 -0
  51. package/index.js +5 -0
  52. package/index.js.map +1 -0
  53. package/package.json +99 -4
  54. package/types.d.ts +55 -0
  55. package/types.js +6 -0
  56. package/types.js.map +1 -0
package/types.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ import { Config, XOR } from '@node-in-layers/core';
2
+ import type { NotificationChannel } from './core/types.js';
3
+ export declare enum NotificationsNamespace {
4
+ Core = "@node-in-layers/notifications",
5
+ Backend = "@node-in-layers/notifications/backend"
6
+ }
7
+ export type EmailTemplateSource = Readonly<{
8
+ subject?: string;
9
+ text?: string;
10
+ html?: string;
11
+ }>;
12
+ export type NotificationTemplateSource = XOR<string, EmailTemplateSource>;
13
+ export type NotificationTemplatesConfig = Readonly<Record<string, Readonly<Record<string, NotificationTemplateSource>>>>;
14
+ export type SmtpEmailConfig = Readonly<{
15
+ host: string;
16
+ port: number;
17
+ secure?: boolean;
18
+ auth?: Readonly<{
19
+ user: string;
20
+ pass: string;
21
+ }>;
22
+ from: string;
23
+ defaultTo?: readonly string[];
24
+ subjectPrefix?: string;
25
+ transportOptions?: Readonly<Record<string, unknown>>;
26
+ }>;
27
+ export type CoreNotificationsConfig = Readonly<{
28
+ defaultTtl?: number;
29
+ noTTL?: boolean;
30
+ }>;
31
+ export type BackendNotificationsConfig = Readonly<{
32
+ adminUrl?: string;
33
+ adminEmails?: readonly string[];
34
+ email?: SmtpEmailConfig;
35
+ notifiers?: Readonly<Record<string, string>>;
36
+ defaultChannels?: readonly (NotificationChannel | string)[];
37
+ templates?: NotificationTemplatesConfig;
38
+ persistNotifications?: boolean;
39
+ useDatabaseConfig?: boolean;
40
+ databaseConfigKey?: string;
41
+ useDatabaseTemplates?: boolean;
42
+ userResolution?: Readonly<{
43
+ userModel?: string;
44
+ userResolverFeature?: string;
45
+ defaultChannels?: readonly (NotificationChannel | string)[];
46
+ }>;
47
+ tasks?: Readonly<{
48
+ enabled?: boolean;
49
+ }>;
50
+ }>;
51
+ export type NotificationsConfig = Readonly<{
52
+ [NotificationsNamespace.Core]?: CoreNotificationsConfig;
53
+ [NotificationsNamespace.Backend]?: BackendNotificationsConfig;
54
+ }>;
55
+ export type ConfigWithNotifications = Config & NotificationsConfig;
package/types.js ADDED
@@ -0,0 +1,6 @@
1
+ export var NotificationsNamespace;
2
+ (function (NotificationsNamespace) {
3
+ NotificationsNamespace["Core"] = "@node-in-layers/notifications";
4
+ NotificationsNamespace["Backend"] = "@node-in-layers/notifications/backend";
5
+ })(NotificationsNamespace || (NotificationsNamespace = {}));
6
+ //# sourceMappingURL=types.js.map
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,gEAAsC,CAAA;IACtC,2EAAiD,CAAA;AACnD,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC"}