fiberx-backend-toolkit 0.0.71 → 0.0.73

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.
@@ -18,7 +18,7 @@ const GENERATE_NOTIFICATION_CODE_TYPE = (interface_name, static_obj, db_obj, cod
18
18
  * @generated-notification-code: ${code}
19
19
  */
20
20
  export interface ${interface_name} {
21
- static_content: {
21
+ static_content?: {
22
22
  ${objectToType(static_obj, 8)}
23
23
  };
24
24
  db_content: {
@@ -30,29 +30,29 @@ ${objectToType(db_obj, 8)}
30
30
  exports.GENERATE_NOTIFICATION_CODE_TYPE = GENERATE_NOTIFICATION_CODE_TYPE;
31
31
  const GENERATE_UTIL_METHOD_CODE = (interface_name, method_name, code) => {
32
32
  return `
33
- /**
34
- * @generated-notification-code: ${code}
35
- */
36
- public static async ${method_name}(params: {
37
- recipient_email: string;
38
- created_by?: number | null;
39
- payload: Types.${interface_name};
40
- }): Promise<boolean> {
41
- try {
42
- const enqueued = await this.email_enqueue_processor.enqueue<Types.${interface_name}>({
43
- notification_code: "${code}",
44
- recipient_email: params.recipient_email,
45
- created_by: params.created_by ?? null,
46
- payload: params.payload,
47
- });
33
+ /**
34
+ * @generated-notification-code: ${code}
35
+ */
36
+ public static async ${method_name}(params: {
37
+ recipient_email: string;
38
+ created_by?: number | null;
39
+ payload: Types.${interface_name};
40
+ }): Promise<boolean> {
41
+ try {
42
+ const enqueued = await EmailEnqueueProcessor?.getInstance()?.enqueue<Types.${interface_name}>({
43
+ notification_code: "${code}",
44
+ recipient_email: params.recipient_email,
45
+ created_by: params.created_by ?? null,
46
+ payload: params.payload,
47
+ });
48
48
 
49
- return (!enqueued);
50
- }
51
- catch(error: any) {
52
- this.logger.error("Failed to enqueue email in method ${method_name}", { error });
53
- throw error;
49
+ return (!enqueued);
50
+ }
51
+ catch(error: any) {
52
+ this.logger.error("Failed to enqueue email in method ${method_name}", { error });
53
+ throw error;
54
+ }
54
55
  }
55
- }
56
56
  `;
57
57
  };
58
58
  exports.GENERATE_UTIL_METHOD_CODE = GENERATE_UTIL_METHOD_CODE;
@@ -65,10 +65,9 @@ import * as Types from "@/${types_file_name.replace(".ts", "")}";
65
65
  class GeneratedEmailEnqueueUtil {
66
66
  private static readonly name: string = "generated_email_enqueue_util";
67
67
  private static readonly logger: LoggerUtil = new LoggerUtil(this.name);
68
- private static readonly email_enqueue_processor = EmailEnqueueProcessor.getInstance();
69
68
 
70
69
 
71
- ${generated_content}
70
+ ${generated_content}
72
71
  }
73
72
 
74
73
  export default GeneratedEmailEnqueueUtil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiberx-backend-toolkit",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "description": "A TypeScript backend toolkit providing shared domain logic, infrastructure helpers, and utilities for FiberX server-side applications and services.",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",