hazo_notify 1.0.2 → 1.1.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.
Files changed (153) hide show
  1. package/README.md +1 -5
  2. package/data/templates/email_signature.html +11 -0
  3. package/data/templates/email_signature.txt +4 -0
  4. package/data/templates/email_verification.html +64 -0
  5. package/data/templates/email_verification.txt +11 -0
  6. package/data/templates/forgot_password.html +64 -0
  7. package/data/templates/forgot_password.txt +11 -0
  8. package/data/templates/manifest.json +86 -0
  9. package/data/templates/welcome_email.html +54 -0
  10. package/data/templates/welcome_email.txt +8 -0
  11. package/dist/emailer/emailer.d.ts +1 -1
  12. package/dist/emailer/emailer.d.ts.map +1 -1
  13. package/dist/emailer/emailer.js +19 -9
  14. package/dist/emailer/emailer.js.map +1 -1
  15. package/dist/emailer/index.d.ts +1 -0
  16. package/dist/emailer/index.d.ts.map +1 -1
  17. package/dist/emailer/index.js +5 -1
  18. package/dist/emailer/index.js.map +1 -1
  19. package/dist/emailer/providers/pop3_provider.d.ts +3 -2
  20. package/dist/emailer/providers/pop3_provider.d.ts.map +1 -1
  21. package/dist/emailer/providers/pop3_provider.js +2 -1
  22. package/dist/emailer/providers/pop3_provider.js.map +1 -1
  23. package/dist/emailer/providers/smtp_provider.d.ts +3 -2
  24. package/dist/emailer/providers/smtp_provider.d.ts.map +1 -1
  25. package/dist/emailer/providers/smtp_provider.js +2 -1
  26. package/dist/emailer/providers/smtp_provider.js.map +1 -1
  27. package/dist/emailer/providers/zeptomail_provider.d.ts +3 -2
  28. package/dist/emailer/providers/zeptomail_provider.d.ts.map +1 -1
  29. package/dist/emailer/providers/zeptomail_provider.js +24 -11
  30. package/dist/emailer/providers/zeptomail_provider.js.map +1 -1
  31. package/dist/emailer/types.d.ts +13 -1
  32. package/dist/emailer/types.d.ts.map +1 -1
  33. package/dist/emailer/utils/logger.d.ts +22 -14
  34. package/dist/emailer/utils/logger.d.ts.map +1 -1
  35. package/dist/emailer/utils/logger.js +51 -13
  36. package/dist/emailer/utils/logger.js.map +1 -1
  37. package/dist/index.d.ts +2 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/template_manager/config/config_loader.d.ts +48 -0
  42. package/dist/template_manager/config/config_loader.d.ts.map +1 -0
  43. package/dist/template_manager/config/config_loader.js +161 -0
  44. package/dist/template_manager/config/config_loader.js.map +1 -0
  45. package/dist/template_manager/config/constants.d.ts +101 -0
  46. package/dist/template_manager/config/constants.d.ts.map +1 -0
  47. package/dist/template_manager/config/constants.js +163 -0
  48. package/dist/template_manager/config/constants.js.map +1 -0
  49. package/dist/template_manager/config/index.d.ts +6 -0
  50. package/dist/template_manager/config/index.d.ts.map +1 -0
  51. package/dist/{lib/emailer/utils → template_manager/config}/index.js +4 -4
  52. package/dist/template_manager/config/index.js.map +1 -0
  53. package/dist/template_manager/db/category_repository.d.ts +57 -0
  54. package/dist/template_manager/db/category_repository.d.ts.map +1 -0
  55. package/dist/template_manager/db/category_repository.js +326 -0
  56. package/dist/template_manager/db/category_repository.js.map +1 -0
  57. package/dist/template_manager/db/index.d.ts +6 -0
  58. package/dist/template_manager/db/index.d.ts.map +1 -0
  59. package/dist/template_manager/db/index.js +23 -0
  60. package/dist/template_manager/db/index.js.map +1 -0
  61. package/dist/template_manager/db/template_repository.d.ts +76 -0
  62. package/dist/template_manager/db/template_repository.d.ts.map +1 -0
  63. package/dist/template_manager/db/template_repository.js +684 -0
  64. package/dist/template_manager/db/template_repository.js.map +1 -0
  65. package/dist/template_manager/engine/handlebars_engine.d.ts +52 -0
  66. package/dist/template_manager/engine/handlebars_engine.d.ts.map +1 -0
  67. package/dist/template_manager/engine/handlebars_engine.js +175 -0
  68. package/dist/template_manager/engine/handlebars_engine.js.map +1 -0
  69. package/dist/template_manager/engine/index.d.ts +6 -0
  70. package/dist/template_manager/engine/index.d.ts.map +1 -0
  71. package/dist/template_manager/engine/index.js +19 -0
  72. package/dist/template_manager/engine/index.js.map +1 -0
  73. package/dist/template_manager/engine/variable_resolver.d.ts +48 -0
  74. package/dist/template_manager/engine/variable_resolver.d.ts.map +1 -0
  75. package/dist/template_manager/engine/variable_resolver.js +223 -0
  76. package/dist/template_manager/engine/variable_resolver.js.map +1 -0
  77. package/dist/template_manager/index.d.ts +32 -0
  78. package/dist/template_manager/index.d.ts.map +1 -0
  79. package/dist/template_manager/index.js +88 -0
  80. package/dist/template_manager/index.js.map +1 -0
  81. package/dist/template_manager/template_manager.d.ts +69 -0
  82. package/dist/template_manager/template_manager.d.ts.map +1 -0
  83. package/dist/template_manager/template_manager.js +335 -0
  84. package/dist/template_manager/template_manager.js.map +1 -0
  85. package/dist/template_manager/types.d.ts +255 -0
  86. package/dist/template_manager/types.d.ts.map +1 -0
  87. package/dist/template_manager/types.js +12 -0
  88. package/dist/template_manager/types.js.map +1 -0
  89. package/dist/template_manager/utils/index.d.ts +6 -0
  90. package/dist/template_manager/utils/index.d.ts.map +1 -0
  91. package/dist/template_manager/utils/index.js +21 -0
  92. package/dist/template_manager/utils/index.js.map +1 -0
  93. package/dist/template_manager/utils/system_variables.d.ts +28 -0
  94. package/dist/template_manager/utils/system_variables.d.ts.map +1 -0
  95. package/dist/template_manager/utils/system_variables.js +209 -0
  96. package/dist/template_manager/utils/system_variables.js.map +1 -0
  97. package/dist/template_manager/utils/validation.d.ts +74 -0
  98. package/dist/template_manager/utils/validation.d.ts.map +1 -0
  99. package/dist/template_manager/utils/validation.js +163 -0
  100. package/dist/template_manager/utils/validation.js.map +1 -0
  101. package/hazo_notify_config.ini +39 -0
  102. package/package.json +69 -21
  103. package/dist/lib/emailer/emailer.d.ts +0 -19
  104. package/dist/lib/emailer/emailer.d.ts.map +0 -1
  105. package/dist/lib/emailer/emailer.js +0 -220
  106. package/dist/lib/emailer/emailer.js.map +0 -1
  107. package/dist/lib/emailer/index.d.ts +0 -11
  108. package/dist/lib/emailer/index.d.ts.map +0 -1
  109. package/dist/lib/emailer/index.js +0 -34
  110. package/dist/lib/emailer/index.js.map +0 -1
  111. package/dist/lib/emailer/providers/index.d.ts +0 -15
  112. package/dist/lib/emailer/providers/index.d.ts.map +0 -1
  113. package/dist/lib/emailer/providers/index.js +0 -36
  114. package/dist/lib/emailer/providers/index.js.map +0 -1
  115. package/dist/lib/emailer/providers/pop3_provider.d.ts +0 -15
  116. package/dist/lib/emailer/providers/pop3_provider.d.ts.map +0 -1
  117. package/dist/lib/emailer/providers/pop3_provider.js +0 -29
  118. package/dist/lib/emailer/providers/pop3_provider.js.map +0 -1
  119. package/dist/lib/emailer/providers/smtp_provider.d.ts +0 -15
  120. package/dist/lib/emailer/providers/smtp_provider.d.ts.map +0 -1
  121. package/dist/lib/emailer/providers/smtp_provider.js +0 -29
  122. package/dist/lib/emailer/providers/smtp_provider.js.map +0 -1
  123. package/dist/lib/emailer/providers/zeptomail_provider.d.ts +0 -15
  124. package/dist/lib/emailer/providers/zeptomail_provider.d.ts.map +0 -1
  125. package/dist/lib/emailer/providers/zeptomail_provider.js +0 -250
  126. package/dist/lib/emailer/providers/zeptomail_provider.js.map +0 -1
  127. package/dist/lib/emailer/types.d.ts +0 -94
  128. package/dist/lib/emailer/types.d.ts.map +0 -1
  129. package/dist/lib/emailer/types.js +0 -6
  130. package/dist/lib/emailer/types.js.map +0 -1
  131. package/dist/lib/emailer/utils/constants.d.ts +0 -14
  132. package/dist/lib/emailer/utils/constants.d.ts.map +0 -1
  133. package/dist/lib/emailer/utils/constants.js +0 -22
  134. package/dist/lib/emailer/utils/constants.js.map +0 -1
  135. package/dist/lib/emailer/utils/index.d.ts +0 -8
  136. package/dist/lib/emailer/utils/index.d.ts.map +0 -1
  137. package/dist/lib/emailer/utils/index.js.map +0 -1
  138. package/dist/lib/emailer/utils/logger.d.ts +0 -37
  139. package/dist/lib/emailer/utils/logger.d.ts.map +0 -1
  140. package/dist/lib/emailer/utils/logger.js +0 -60
  141. package/dist/lib/emailer/utils/logger.js.map +0 -1
  142. package/dist/lib/emailer/utils/validation.d.ts +0 -37
  143. package/dist/lib/emailer/utils/validation.d.ts.map +0 -1
  144. package/dist/lib/emailer/utils/validation.js +0 -81
  145. package/dist/lib/emailer/utils/validation.js.map +0 -1
  146. package/dist/lib/index.d.ts +0 -6
  147. package/dist/lib/index.d.ts.map +0 -1
  148. package/dist/lib/index.js +0 -22
  149. package/dist/lib/index.js.map +0 -1
  150. package/dist/lib/utils.d.ts +0 -3
  151. package/dist/lib/utils.d.ts.map +0 -1
  152. package/dist/lib/utils.js +0 -9
  153. package/dist/lib/utils.js.map +0 -1
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Constants for the template manager service
3
+ *
4
+ * Default values, table names, and validation limits
5
+ */
6
+ export declare const TABLE_TEMPLATE_CATEGORY = "hazo_notify_template_cat";
7
+ export declare const TABLE_TEMPLATES = "hazo_notify_templates";
8
+ export declare const DEFAULT_TEMPLATE_NAMES: readonly ["welcome_email", "email_verification", "forgot_password", "email_signature"];
9
+ export type DefaultTemplateName = (typeof DEFAULT_TEMPLATE_NAMES)[number];
10
+ export declare const DEFAULT_CATEGORY_NAMES: {
11
+ readonly SYSTEM: "System";
12
+ readonly USER: "Custom";
13
+ };
14
+ /** Maximum length for template name */
15
+ export declare const MAX_TEMPLATE_NAME_LENGTH = 100;
16
+ /** Maximum length for category name */
17
+ export declare const MAX_CATEGORY_NAME_LENGTH = 100;
18
+ /** Maximum size for template HTML content (1MB) */
19
+ export declare const MAX_TEMPLATE_HTML_SIZE: number;
20
+ /** Maximum size for template text content (500KB) */
21
+ export declare const MAX_TEMPLATE_TEXT_SIZE: number;
22
+ /** Maximum number of variables per template */
23
+ export declare const MAX_VARIABLES_PER_TEMPLATE = 50;
24
+ /** Maximum depth for @template references to prevent infinite loops */
25
+ export declare const MAX_TEMPLATE_REFERENCE_DEPTH = 5;
26
+ /** Regex pattern for {{variable_name}} */
27
+ export declare const VARIABLE_PATTERN: RegExp;
28
+ /** Regex pattern for @template_name */
29
+ export declare const TEMPLATE_REFERENCE_PATTERN: RegExp;
30
+ /** Valid variable name pattern (lowercase alphanumeric with underscores) */
31
+ export declare const VALID_VARIABLE_NAME_PATTERN: RegExp;
32
+ export declare const DEFAULT_EMAIL_TEMPLATE_VARIABLE_TYPES: readonly [{
33
+ readonly template_name: "welcome_email";
34
+ readonly template_label: "Welcome Email";
35
+ readonly variables: readonly [{
36
+ readonly variable_name: "user_name";
37
+ readonly variable_description: "Recipient's full name";
38
+ }, {
39
+ readonly variable_name: "login_url";
40
+ readonly variable_description: "URL to login page";
41
+ }];
42
+ }, {
43
+ readonly template_name: "email_verification";
44
+ readonly template_label: "Email Verification";
45
+ readonly variables: readonly [{
46
+ readonly variable_name: "user_name";
47
+ readonly variable_description: "Recipient's name";
48
+ }, {
49
+ readonly variable_name: "verification_link";
50
+ readonly variable_description: "Email verification URL";
51
+ }, {
52
+ readonly variable_name: "expiry_hours";
53
+ readonly variable_description: "Hours until link expires";
54
+ }];
55
+ }, {
56
+ readonly template_name: "forgot_password";
57
+ readonly template_label: "Forgot Password";
58
+ readonly variables: readonly [{
59
+ readonly variable_name: "user_name";
60
+ readonly variable_description: "Recipient's name";
61
+ }, {
62
+ readonly variable_name: "reset_link";
63
+ readonly variable_description: "Password reset URL";
64
+ }, {
65
+ readonly variable_name: "expiry_minutes";
66
+ readonly variable_description: "Minutes until link expires";
67
+ }];
68
+ }, {
69
+ readonly template_name: "email_signature";
70
+ readonly template_label: "Email Signature";
71
+ readonly variables: readonly [{
72
+ readonly variable_name: "sender_name";
73
+ readonly variable_description: "Sender's name";
74
+ }, {
75
+ readonly variable_name: "sender_title";
76
+ readonly variable_description: "Sender's job title";
77
+ }, {
78
+ readonly variable_name: "company_name";
79
+ readonly variable_description: "Company name";
80
+ }];
81
+ }];
82
+ export declare const SYSTEM_VARIABLE_NAMES: readonly ["date_yyyy_mm_dd", "date_mmm_dd", "date_mmmm_dd_yyyy", "date_dd_mm_yyyy", "date_dd_mmm_yyyy", "time_hh_mm", "time_hh_mm_ss", "datetime_full", "year", "month_name", "day_of_week"];
83
+ export type SystemVariableName = (typeof SYSTEM_VARIABLE_NAMES)[number];
84
+ export declare const ERROR_MESSAGES: {
85
+ readonly TEMPLATE_NOT_FOUND: "Template not found";
86
+ readonly CATEGORY_NOT_FOUND: "Category not found";
87
+ readonly INVALID_TEMPLATE_NAME: "Invalid template name";
88
+ readonly INVALID_CATEGORY_NAME: "Invalid category name";
89
+ readonly INVALID_VARIABLE_NAME: "Invalid variable name";
90
+ readonly TEMPLATE_NAME_TOO_LONG: "Template name exceeds maximum length of 100 characters";
91
+ readonly CATEGORY_NAME_TOO_LONG: "Category name exceeds maximum length of 100 characters";
92
+ readonly TEMPLATE_HTML_TOO_LARGE: "Template HTML exceeds maximum size of 1024KB";
93
+ readonly TEMPLATE_TEXT_TOO_LARGE: "Template text exceeds maximum size of 512KB";
94
+ readonly CANNOT_DELETE_SYSTEM_TEMPLATE: "Cannot delete system templates";
95
+ readonly CIRCULAR_REFERENCE_DETECTED: "Circular template reference detected";
96
+ readonly MAX_REFERENCE_DEPTH_EXCEEDED: "Maximum template reference depth of 5 exceeded";
97
+ readonly MISSING_REQUIRED_VARIABLE: "Missing required variable";
98
+ readonly CONFIG_NOT_LOADED: "Template manager configuration not loaded";
99
+ readonly DB_CONNECTION_REQUIRED: "Database connection instance required";
100
+ };
101
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/template_manager/config/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAMvD,eAAO,MAAM,sBAAsB,wFAKzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAM1E,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC;AAMX,uCAAuC;AACvC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,uCAAuC;AACvC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,mDAAmD;AACnD,eAAO,MAAM,sBAAsB,QAAc,CAAC;AAElD,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,QAAa,CAAC;AAEjD,+CAA+C;AAC/C,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,uEAAuE;AACvE,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAM9C,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,QAA+B,CAAC;AAE7D,uCAAuC;AACvC,eAAO,MAAM,0BAA0B,QAAwB,CAAC;AAEhE,4EAA4E;AAC5E,eAAO,MAAM,2BAA2B,QAAsB,CAAC;AAM/D,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqExC,CAAC;AAMX,eAAO,MAAM,qBAAqB,8LAYxB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAMxE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;CAgBjB,CAAC"}
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ /**
3
+ * Constants for the template manager service
4
+ *
5
+ * Default values, table names, and validation limits
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ERROR_MESSAGES = exports.SYSTEM_VARIABLE_NAMES = exports.DEFAULT_EMAIL_TEMPLATE_VARIABLE_TYPES = exports.VALID_VARIABLE_NAME_PATTERN = exports.TEMPLATE_REFERENCE_PATTERN = exports.VARIABLE_PATTERN = exports.MAX_TEMPLATE_REFERENCE_DEPTH = exports.MAX_VARIABLES_PER_TEMPLATE = exports.MAX_TEMPLATE_TEXT_SIZE = exports.MAX_TEMPLATE_HTML_SIZE = exports.MAX_CATEGORY_NAME_LENGTH = exports.MAX_TEMPLATE_NAME_LENGTH = exports.DEFAULT_CATEGORY_NAMES = exports.DEFAULT_TEMPLATE_NAMES = exports.TABLE_TEMPLATES = exports.TABLE_TEMPLATE_CATEGORY = void 0;
9
+ // ============================================================
10
+ // Database Table Names
11
+ // ============================================================
12
+ exports.TABLE_TEMPLATE_CATEGORY = 'hazo_notify_template_cat';
13
+ exports.TABLE_TEMPLATES = 'hazo_notify_templates';
14
+ // ============================================================
15
+ // Default Template Names
16
+ // ============================================================
17
+ exports.DEFAULT_TEMPLATE_NAMES = [
18
+ 'welcome_email',
19
+ 'email_verification',
20
+ 'forgot_password',
21
+ 'email_signature',
22
+ ];
23
+ // ============================================================
24
+ // Default Category Names
25
+ // ============================================================
26
+ exports.DEFAULT_CATEGORY_NAMES = {
27
+ SYSTEM: 'System',
28
+ USER: 'Custom',
29
+ };
30
+ // ============================================================
31
+ // Validation Limits
32
+ // ============================================================
33
+ /** Maximum length for template name */
34
+ exports.MAX_TEMPLATE_NAME_LENGTH = 100;
35
+ /** Maximum length for category name */
36
+ exports.MAX_CATEGORY_NAME_LENGTH = 100;
37
+ /** Maximum size for template HTML content (1MB) */
38
+ exports.MAX_TEMPLATE_HTML_SIZE = 1024 * 1024;
39
+ /** Maximum size for template text content (500KB) */
40
+ exports.MAX_TEMPLATE_TEXT_SIZE = 512 * 1024;
41
+ /** Maximum number of variables per template */
42
+ exports.MAX_VARIABLES_PER_TEMPLATE = 50;
43
+ /** Maximum depth for @template references to prevent infinite loops */
44
+ exports.MAX_TEMPLATE_REFERENCE_DEPTH = 5;
45
+ // ============================================================
46
+ // Variable Patterns
47
+ // ============================================================
48
+ /** Regex pattern for {{variable_name}} */
49
+ exports.VARIABLE_PATTERN = /\{\{([a-z][a-z0-9_]*)\}\}/g;
50
+ /** Regex pattern for @template_name */
51
+ exports.TEMPLATE_REFERENCE_PATTERN = /@([a-z][a-z0-9_]*)/g;
52
+ /** Valid variable name pattern (lowercase alphanumeric with underscores) */
53
+ exports.VALID_VARIABLE_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
54
+ // ============================================================
55
+ // Default Template Variable Types
56
+ // ============================================================
57
+ exports.DEFAULT_EMAIL_TEMPLATE_VARIABLE_TYPES = [
58
+ {
59
+ template_name: 'welcome_email',
60
+ template_label: 'Welcome Email',
61
+ variables: [
62
+ {
63
+ variable_name: 'user_name',
64
+ variable_description: "Recipient's full name",
65
+ },
66
+ {
67
+ variable_name: 'login_url',
68
+ variable_description: 'URL to login page',
69
+ },
70
+ ],
71
+ },
72
+ {
73
+ template_name: 'email_verification',
74
+ template_label: 'Email Verification',
75
+ variables: [
76
+ {
77
+ variable_name: 'user_name',
78
+ variable_description: "Recipient's name",
79
+ },
80
+ {
81
+ variable_name: 'verification_link',
82
+ variable_description: 'Email verification URL',
83
+ },
84
+ {
85
+ variable_name: 'expiry_hours',
86
+ variable_description: 'Hours until link expires',
87
+ },
88
+ ],
89
+ },
90
+ {
91
+ template_name: 'forgot_password',
92
+ template_label: 'Forgot Password',
93
+ variables: [
94
+ {
95
+ variable_name: 'user_name',
96
+ variable_description: "Recipient's name",
97
+ },
98
+ {
99
+ variable_name: 'reset_link',
100
+ variable_description: 'Password reset URL',
101
+ },
102
+ {
103
+ variable_name: 'expiry_minutes',
104
+ variable_description: 'Minutes until link expires',
105
+ },
106
+ ],
107
+ },
108
+ {
109
+ template_name: 'email_signature',
110
+ template_label: 'Email Signature',
111
+ variables: [
112
+ {
113
+ variable_name: 'sender_name',
114
+ variable_description: "Sender's name",
115
+ },
116
+ {
117
+ variable_name: 'sender_title',
118
+ variable_description: "Sender's job title",
119
+ },
120
+ {
121
+ variable_name: 'company_name',
122
+ variable_description: 'Company name',
123
+ },
124
+ ],
125
+ },
126
+ ];
127
+ // ============================================================
128
+ // System Variable Names
129
+ // ============================================================
130
+ exports.SYSTEM_VARIABLE_NAMES = [
131
+ 'date_yyyy_mm_dd',
132
+ 'date_mmm_dd',
133
+ 'date_mmmm_dd_yyyy',
134
+ 'date_dd_mm_yyyy',
135
+ 'date_dd_mmm_yyyy',
136
+ 'time_hh_mm',
137
+ 'time_hh_mm_ss',
138
+ 'datetime_full',
139
+ 'year',
140
+ 'month_name',
141
+ 'day_of_week',
142
+ ];
143
+ // ============================================================
144
+ // Error Messages
145
+ // ============================================================
146
+ exports.ERROR_MESSAGES = {
147
+ TEMPLATE_NOT_FOUND: 'Template not found',
148
+ CATEGORY_NOT_FOUND: 'Category not found',
149
+ INVALID_TEMPLATE_NAME: 'Invalid template name',
150
+ INVALID_CATEGORY_NAME: 'Invalid category name',
151
+ INVALID_VARIABLE_NAME: 'Invalid variable name',
152
+ TEMPLATE_NAME_TOO_LONG: `Template name exceeds maximum length of ${exports.MAX_TEMPLATE_NAME_LENGTH} characters`,
153
+ CATEGORY_NAME_TOO_LONG: `Category name exceeds maximum length of ${exports.MAX_CATEGORY_NAME_LENGTH} characters`,
154
+ TEMPLATE_HTML_TOO_LARGE: `Template HTML exceeds maximum size of ${exports.MAX_TEMPLATE_HTML_SIZE / 1024}KB`,
155
+ TEMPLATE_TEXT_TOO_LARGE: `Template text exceeds maximum size of ${exports.MAX_TEMPLATE_TEXT_SIZE / 1024}KB`,
156
+ CANNOT_DELETE_SYSTEM_TEMPLATE: 'Cannot delete system templates',
157
+ CIRCULAR_REFERENCE_DETECTED: 'Circular template reference detected',
158
+ MAX_REFERENCE_DEPTH_EXCEEDED: `Maximum template reference depth of ${exports.MAX_TEMPLATE_REFERENCE_DEPTH} exceeded`,
159
+ MISSING_REQUIRED_VARIABLE: 'Missing required variable',
160
+ CONFIG_NOT_LOADED: 'Template manager configuration not loaded',
161
+ DB_CONNECTION_REQUIRED: 'Database connection instance required',
162
+ };
163
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/lib/template_manager/config/constants.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+DAA+D;AAC/D,uBAAuB;AACvB,+DAA+D;AAElD,QAAA,uBAAuB,G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AuB;IAC9C,qBAAqB,EAAE,uBAAuB;IAC9C,qBAAqB,EAAE,uBAAuB;IAC9C,sBAAsB,EAAE,2CAA2C,gCAAwB,aAAa;IACxG,sBAAsB,EAAE,2CAA2C,gCAAwB,aAAa;IACxG,uBAAuB,EAAE,yCAAyC,8BAAsB,GAAG,IAAI,IAAI;IACnG,uBAAuB,EAAE,yCAAyC,8BAAsB,GAAG,IAAI,IAAI;IACnG,6BAA6B,EAAE,gCAAgC;IAC/D,2BAA2B,EAAE,sCAAsC;IACnE,4BAA4B,EAAE,uCAAuC,oCAA4B,WAAW;IAC5G,yBAAyB,EAAE,2BAA2B;IACtD,iBAAiB,EAAE,2CAA2C;IAC9D,sBAAsB,EAAE,uCAAuC;CACvD,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Config barrel export for template manager
3
+ */
4
+ export * from './constants';
5
+ export { load_template_config } from './config_loader';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/template_manager/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Utility functions for emailer service
4
- * Centralized exports for validation, logging, and constants
3
+ * Config barrel export for template manager
5
4
  */
6
5
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
6
  if (k2 === undefined) k2 = k;
@@ -18,7 +17,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
17
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
18
  };
20
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.load_template_config = void 0;
21
21
  __exportStar(require("./constants"), exports);
22
- __exportStar(require("./validation"), exports);
23
- __exportStar(require("./logger"), exports);
22
+ var config_loader_1 = require("./config_loader");
23
+ Object.defineProperty(exports, "load_template_config", { enumerable: true, get: function () { return config_loader_1.load_template_config; } });
24
24
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/template_manager/config/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,iDAAuD;AAA9C,qHAAA,oBAAoB,OAAA"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Category repository for template manager
3
+ *
4
+ * CRUD operations for template categories using hazo_connect
5
+ */
6
+ import type { HazoConnectInstance, TemplateCategory, TemplateCategoryInput, TemplateCategoryUpdate, TemplateOperationResponse } from '../types';
7
+ /**
8
+ * List all template categories for an organization
9
+ *
10
+ * @param hazo_connect - Database connection instance
11
+ * @param org_id - Organization ID
12
+ * @returns Response with array of categories
13
+ */
14
+ export declare function list_categories(hazo_connect: HazoConnectInstance, org_id: string): Promise<TemplateOperationResponse<TemplateCategory[]>>;
15
+ /**
16
+ * Get a single template category by ID
17
+ *
18
+ * @param hazo_connect - Database connection instance
19
+ * @param id - Category ID
20
+ * @returns Response with category data
21
+ */
22
+ export declare function get_category(hazo_connect: HazoConnectInstance, id: string): Promise<TemplateOperationResponse<TemplateCategory>>;
23
+ /**
24
+ * Create a new template category
25
+ *
26
+ * @param hazo_connect - Database connection instance
27
+ * @param data - Category input data
28
+ * @returns Response with created category
29
+ */
30
+ export declare function create_category(hazo_connect: HazoConnectInstance, data: TemplateCategoryInput): Promise<TemplateOperationResponse<TemplateCategory>>;
31
+ /**
32
+ * Update an existing template category
33
+ *
34
+ * @param hazo_connect - Database connection instance
35
+ * @param id - Category ID
36
+ * @param data - Update data
37
+ * @returns Response with updated category
38
+ */
39
+ export declare function update_category(hazo_connect: HazoConnectInstance, id: string, data: TemplateCategoryUpdate): Promise<TemplateOperationResponse<TemplateCategory>>;
40
+ /**
41
+ * Delete a template category and all its templates
42
+ *
43
+ * @param hazo_connect - Database connection instance
44
+ * @param id - Category ID
45
+ * @returns Response with deletion result
46
+ */
47
+ export declare function delete_category(hazo_connect: HazoConnectInstance, id: string): Promise<TemplateOperationResponse<boolean>>;
48
+ /**
49
+ * Find a category by name within an organization
50
+ *
51
+ * @param hazo_connect - Database connection instance
52
+ * @param org_id - Organization ID
53
+ * @param name - Category name
54
+ * @returns Response with category if found
55
+ */
56
+ export declare function find_category_by_name(hazo_connect: HazoConnectInstance, org_id: string, name: string): Promise<TemplateOperationResponse<TemplateCategory | null>>;
57
+ //# sourceMappingURL=category_repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category_repository.d.ts","sourceRoot":"","sources":["../../../src/lib/template_manager/db/category_repository.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAQlB;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,YAAY,EAAE,mBAAmB,EACjC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,yBAAyB,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAyCxD;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,YAAY,EAAE,mBAAmB,EACjC,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAC,CA6CtD;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,YAAY,EAAE,mBAAmB,EACjC,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAC,CAyDtD;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,YAAY,EAAE,mBAAmB,EACjC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAC,CAuEtD;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,YAAY,EAAE,mBAAmB,EACjC,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC,CA+D7C;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,mBAAmB,EACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,yBAAyB,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAiC7D"}