hazo_notify 1.0.1 → 1.0.2

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 (53) hide show
  1. package/dist/emailer/emailer.d.ts +19 -0
  2. package/dist/emailer/emailer.d.ts.map +1 -0
  3. package/dist/emailer/emailer.js +224 -0
  4. package/dist/emailer/emailer.js.map +1 -0
  5. package/dist/emailer/index.d.ts +11 -0
  6. package/dist/emailer/index.d.ts.map +1 -0
  7. package/dist/emailer/index.js +34 -0
  8. package/dist/emailer/index.js.map +1 -0
  9. package/dist/emailer/providers/index.d.ts +15 -0
  10. package/dist/emailer/providers/index.d.ts.map +1 -0
  11. package/dist/emailer/providers/index.js +36 -0
  12. package/dist/emailer/providers/index.js.map +1 -0
  13. package/dist/emailer/providers/pop3_provider.d.ts +15 -0
  14. package/dist/emailer/providers/pop3_provider.d.ts.map +1 -0
  15. package/dist/emailer/providers/pop3_provider.js +29 -0
  16. package/dist/emailer/providers/pop3_provider.js.map +1 -0
  17. package/dist/emailer/providers/smtp_provider.d.ts +15 -0
  18. package/dist/emailer/providers/smtp_provider.d.ts.map +1 -0
  19. package/dist/emailer/providers/smtp_provider.js +29 -0
  20. package/dist/emailer/providers/smtp_provider.js.map +1 -0
  21. package/dist/emailer/providers/zeptomail_provider.d.ts +15 -0
  22. package/dist/emailer/providers/zeptomail_provider.d.ts.map +1 -0
  23. package/dist/emailer/providers/zeptomail_provider.js +255 -0
  24. package/dist/emailer/providers/zeptomail_provider.js.map +1 -0
  25. package/dist/emailer/types.d.ts +94 -0
  26. package/dist/emailer/types.d.ts.map +1 -0
  27. package/dist/emailer/types.js +6 -0
  28. package/dist/emailer/types.js.map +1 -0
  29. package/dist/emailer/utils/constants.d.ts +15 -0
  30. package/dist/emailer/utils/constants.d.ts.map +1 -0
  31. package/dist/emailer/utils/constants.js +22 -0
  32. package/dist/emailer/utils/constants.js.map +1 -0
  33. package/dist/emailer/utils/index.d.ts +8 -0
  34. package/dist/emailer/utils/index.d.ts.map +1 -0
  35. package/dist/emailer/utils/index.js +24 -0
  36. package/dist/emailer/utils/index.js.map +1 -0
  37. package/dist/emailer/utils/logger.d.ts +40 -0
  38. package/dist/emailer/utils/logger.d.ts.map +1 -0
  39. package/dist/emailer/utils/logger.js +60 -0
  40. package/dist/emailer/utils/logger.js.map +1 -0
  41. package/dist/emailer/utils/validation.d.ts +37 -0
  42. package/dist/emailer/utils/validation.d.ts.map +1 -0
  43. package/dist/emailer/utils/validation.js +81 -0
  44. package/dist/emailer/utils/validation.js.map +1 -0
  45. package/dist/index.d.ts +6 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +22 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/utils.d.ts +12 -0
  50. package/dist/utils.d.ts.map +1 -0
  51. package/dist/utils.js +18 -0
  52. package/dist/utils.js.map +1 -0
  53. package/package.json +3 -1
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ /**
3
+ * Validation utilities for emailer service
4
+ * Provides email validation, sanitization, and input validation functions
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.validate_email_address = validate_email_address;
8
+ exports.sanitize_email_header = sanitize_email_header;
9
+ exports.validate_subject_length = validate_subject_length;
10
+ exports.validate_body_length = validate_body_length;
11
+ exports.validate_attachment_size = validate_attachment_size;
12
+ const constants_1 = require("./constants");
13
+ /**
14
+ * Validate email address format
15
+ * @param email - Email address to validate
16
+ * @returns boolean indicating if email is valid
17
+ */
18
+ function validate_email_address(email) {
19
+ if (!email || typeof email !== 'string') {
20
+ return false;
21
+ }
22
+ // RFC 5322 compliant regex (simplified)
23
+ const email_regex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
24
+ return email_regex.test(email) && email.length <= constants_1.MAX_EMAIL_LENGTH;
25
+ }
26
+ /**
27
+ * Sanitize email header to prevent injection attacks
28
+ * Removes newlines, carriage returns, and other control characters
29
+ * @param value - Header value to sanitize
30
+ * @returns Sanitized header value
31
+ */
32
+ function sanitize_email_header(value) {
33
+ if (!value || typeof value !== 'string') {
34
+ return '';
35
+ }
36
+ // Remove newlines, carriage returns, and other control characters
37
+ return value.replace(/[\r\n\t\0\x08\x0B\x0C\x1F]/g, '').trim();
38
+ }
39
+ /**
40
+ * Validate subject length
41
+ * @param subject - Email subject to validate
42
+ * @returns boolean indicating if subject is valid
43
+ */
44
+ function validate_subject_length(subject) {
45
+ if (!subject || typeof subject !== 'string') {
46
+ return false;
47
+ }
48
+ return subject.length <= constants_1.MAX_SUBJECT_LENGTH;
49
+ }
50
+ /**
51
+ * Validate body length
52
+ * @param body - Email body to validate
53
+ * @returns boolean indicating if body is valid
54
+ */
55
+ function validate_body_length(body) {
56
+ if (!body || typeof body !== 'string') {
57
+ return false;
58
+ }
59
+ // Calculate byte length (UTF-8 encoding)
60
+ const byte_length = Buffer.from(body, 'utf8').length;
61
+ return byte_length <= constants_1.MAX_BODY_LENGTH;
62
+ }
63
+ /**
64
+ * Validate attachment size
65
+ * @param content - Base64 encoded attachment content
66
+ * @param max_size - Maximum size in bytes
67
+ * @returns boolean indicating if attachment size is valid
68
+ */
69
+ function validate_attachment_size(content, max_size) {
70
+ if (!content || typeof content !== 'string') {
71
+ return false;
72
+ }
73
+ try {
74
+ const size = Buffer.from(content, 'base64').length;
75
+ return size <= max_size;
76
+ }
77
+ catch (error) {
78
+ return false;
79
+ }
80
+ }
81
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/lib/emailer/utils/validation.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AASH,wDAOC;AAQD,sDAMC;AAOD,0DAKC;AAOD,oDAOC;AAQD,4DAUC;AAxED,2CAAoF;AAEpF;;;;GAIG;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AAC;IACD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC;QACnD,OAAO,IAAI,IAAI,QAAQ,CAAC;IAC1B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Main library exports
3
+ * Entry point for the hazo_notify library
4
+ */
5
+ export * from './emailer';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Main library exports
4
+ * Entry point for the hazo_notify library
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./emailer"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,4CAA0B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Utility functions for UI components
3
+ * Provides className merging with Tailwind CSS support
4
+ */
5
+ import { type ClassValue } from 'clsx';
6
+ /**
7
+ * Merge class names with Tailwind CSS conflict resolution
8
+ * @param inputs - Class names to merge
9
+ * @returns Merged class name string
10
+ */
11
+ export declare function cn(...inputs: ClassValue[]): string;
12
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C;;;;GAIG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
package/dist/utils.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * Utility functions for UI components
4
+ * Provides className merging with Tailwind CSS support
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.cn = cn;
8
+ const clsx_1 = require("clsx");
9
+ const tailwind_merge_1 = require("tailwind-merge");
10
+ /**
11
+ * Merge class names with Tailwind CSS conflict resolution
12
+ * @param inputs - Class names to merge
13
+ * @returns Merged class name string
14
+ */
15
+ function cn(...inputs) {
16
+ return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
17
+ }
18
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/lib/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAUH,gBAEC;AAVD,+BAA6C;AAC7C,mDAAyC;AAEzC;;;;GAIG;AACH,SAAgB,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,IAAA,wBAAO,EAAC,IAAA,WAAI,EAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hazo_notify",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Email that acts as a notification center as well for schedules too",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
@@ -53,6 +53,8 @@
53
53
  "@lexical/rich-text": "^0.38.2",
54
54
  "@lexical/selection": "^0.38.2",
55
55
  "@lexical/utils": "^0.38.2",
56
+ "@radix-ui/react-label": "^2.1.8",
57
+ "@radix-ui/react-slot": "^1.2.4",
56
58
  "@radix-ui/react-tooltip": "^1.2.8",
57
59
  "class-variance-authority": "^0.7.0",
58
60
  "clsx": "^2.1.0",