@hed-hog/core 0.0.295 → 0.0.297

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 (146) hide show
  1. package/dist/auth/auth.controller.d.ts +5 -5
  2. package/dist/auth/auth.service.d.ts +5 -5
  3. package/dist/challenge/challenge.service.d.ts +2 -2
  4. package/dist/core.module.d.ts.map +1 -1
  5. package/dist/core.module.js +4 -1
  6. package/dist/core.module.js.map +1 -1
  7. package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +1 -1
  8. package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +2 -2
  9. package/dist/index.d.ts +13 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +14 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/integration/index.d.ts +4 -0
  14. package/dist/integration/index.d.ts.map +1 -0
  15. package/dist/integration/index.js +20 -0
  16. package/dist/integration/index.js.map +1 -0
  17. package/dist/integration/integration-api.validation.d.ts +2 -0
  18. package/dist/integration/integration-api.validation.d.ts.map +1 -0
  19. package/dist/integration/integration-api.validation.js +126 -0
  20. package/dist/integration/integration-api.validation.js.map +1 -0
  21. package/dist/integration/integration.module.d.ts +3 -0
  22. package/dist/integration/integration.module.d.ts.map +1 -0
  23. package/dist/integration/integration.module.js +54 -0
  24. package/dist/integration/integration.module.js.map +1 -0
  25. package/dist/integration/services/domain-event.publisher.d.ts +31 -0
  26. package/dist/integration/services/domain-event.publisher.d.ts.map +1 -0
  27. package/dist/integration/services/domain-event.publisher.js +79 -0
  28. package/dist/integration/services/domain-event.publisher.js.map +1 -0
  29. package/dist/integration/services/event-subscriber.registry.d.ts +37 -0
  30. package/dist/integration/services/event-subscriber.registry.d.ts.map +1 -0
  31. package/dist/integration/services/event-subscriber.registry.js +86 -0
  32. package/dist/integration/services/event-subscriber.registry.js.map +1 -0
  33. package/dist/integration/services/inbox.service.d.ts +55 -0
  34. package/dist/integration/services/inbox.service.d.ts.map +1 -0
  35. package/dist/integration/services/inbox.service.js +173 -0
  36. package/dist/integration/services/inbox.service.js.map +1 -0
  37. package/dist/integration/services/index.d.ts +12 -0
  38. package/dist/integration/services/index.d.ts.map +1 -0
  39. package/dist/integration/services/index.js +28 -0
  40. package/dist/integration/services/index.js.map +1 -0
  41. package/dist/integration/services/integration-developer-api.service.d.ts +30 -0
  42. package/dist/integration/services/integration-developer-api.service.d.ts.map +1 -0
  43. package/dist/integration/services/integration-developer-api.service.js +55 -0
  44. package/dist/integration/services/integration-developer-api.service.js.map +1 -0
  45. package/dist/integration/services/integration-link.service.d.ts +52 -0
  46. package/dist/integration/services/integration-link.service.d.ts.map +1 -0
  47. package/dist/integration/services/integration-link.service.js +128 -0
  48. package/dist/integration/services/integration-link.service.js.map +1 -0
  49. package/dist/integration/services/integration-settings.service.d.ts +23 -0
  50. package/dist/integration/services/integration-settings.service.d.ts.map +1 -0
  51. package/dist/integration/services/integration-settings.service.js +81 -0
  52. package/dist/integration/services/integration-settings.service.js.map +1 -0
  53. package/dist/integration/services/outbox-polling.coordinator.d.ts +45 -0
  54. package/dist/integration/services/outbox-polling.coordinator.d.ts.map +1 -0
  55. package/dist/integration/services/outbox-polling.coordinator.js +143 -0
  56. package/dist/integration/services/outbox-polling.coordinator.js.map +1 -0
  57. package/dist/integration/services/outbox.notifier.d.ts +30 -0
  58. package/dist/integration/services/outbox.notifier.d.ts.map +1 -0
  59. package/dist/integration/services/outbox.notifier.js +57 -0
  60. package/dist/integration/services/outbox.notifier.js.map +1 -0
  61. package/dist/integration/services/outbox.processor.d.ts +42 -0
  62. package/dist/integration/services/outbox.processor.d.ts.map +1 -0
  63. package/dist/integration/services/outbox.processor.job.d.ts +43 -0
  64. package/dist/integration/services/outbox.processor.job.d.ts.map +1 -0
  65. package/dist/integration/services/outbox.processor.job.js +100 -0
  66. package/dist/integration/services/outbox.processor.job.js.map +1 -0
  67. package/dist/integration/services/outbox.processor.js +208 -0
  68. package/dist/integration/services/outbox.processor.js.map +1 -0
  69. package/dist/integration/services/outbox.service.d.ts +53 -0
  70. package/dist/integration/services/outbox.service.d.ts.map +1 -0
  71. package/dist/integration/services/outbox.service.js +149 -0
  72. package/dist/integration/services/outbox.service.js.map +1 -0
  73. package/dist/integration/types/event.types.d.ts +88 -0
  74. package/dist/integration/types/event.types.d.ts.map +1 -0
  75. package/dist/integration/types/event.types.js +35 -0
  76. package/dist/integration/types/event.types.js.map +1 -0
  77. package/dist/integration/types/index.d.ts +3 -0
  78. package/dist/integration/types/index.d.ts.map +1 -0
  79. package/dist/integration/types/index.js +19 -0
  80. package/dist/integration/types/index.js.map +1 -0
  81. package/dist/integration/types/subscriber.types.d.ts +31 -0
  82. package/dist/integration/types/subscriber.types.d.ts.map +1 -0
  83. package/dist/integration/types/subscriber.types.js +3 -0
  84. package/dist/integration/types/subscriber.types.js.map +1 -0
  85. package/dist/oauth/oauth.controller.js.map +1 -1
  86. package/dist/oauth/oauth.service.d.ts +3 -3
  87. package/dist/oauth/oauth.service.d.ts.map +1 -1
  88. package/dist/oauth/oauth.service.js.map +1 -1
  89. package/dist/profile/profile.controller.d.ts +6 -6
  90. package/dist/profile/profile.service.d.ts +6 -6
  91. package/dist/session/session.controller.d.ts +2 -2
  92. package/dist/session/session.service.d.ts +3 -3
  93. package/dist/setting/setting.controller.d.ts +13 -9
  94. package/dist/setting/setting.controller.d.ts.map +1 -1
  95. package/dist/setting/setting.service.d.ts +14 -10
  96. package/dist/setting/setting.service.d.ts.map +1 -1
  97. package/dist/setting/setting.service.js +21 -1
  98. package/dist/setting/setting.service.js.map +1 -1
  99. package/dist/user/user.controller.d.ts +6 -6
  100. package/dist/user/user.service.d.ts +12 -12
  101. package/hedhog/data/dashboard_component_role.yaml +223 -223
  102. package/hedhog/data/dashboard_role.yaml +18 -18
  103. package/hedhog/data/route.yaml +2 -0
  104. package/hedhog/data/setting_group.yaml +955 -470
  105. package/hedhog/data/setting_subgroup.yaml +303 -0
  106. package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +44 -18
  107. package/hedhog/frontend/app/configurations/[slug]/page.tsx.ejs +134 -27
  108. package/hedhog/frontend/app/configurations/layout.tsx.ejs +84 -23
  109. package/hedhog/frontend/app/dashboard/components/widgets/permissions-chart.tsx.ejs +62 -62
  110. package/hedhog/frontend/app/dashboard/page.tsx.ejs +29 -29
  111. package/hedhog/frontend/app/preferences/page.tsx.ejs +2 -5
  112. package/hedhog/table/inbox_event.yaml +40 -0
  113. package/hedhog/table/integration_link.yaml +33 -0
  114. package/hedhog/table/outbox_event.yaml +45 -0
  115. package/hedhog/table/setting.yaml +7 -0
  116. package/hedhog/table/setting_subgroup.yaml +19 -0
  117. package/package.json +8 -8
  118. package/src/ai/ai.service.ts +3 -3
  119. package/src/auth/auth.controller.ts +11 -11
  120. package/src/auth/auth.service.ts +8 -8
  121. package/src/core.module.ts +4 -1
  122. package/src/index.ts +15 -0
  123. package/src/integration/README.md +397 -0
  124. package/src/integration/USAGE_EXAMPLE.md +279 -0
  125. package/src/integration/index.ts +4 -0
  126. package/src/integration/integration-api.validation.ts +154 -0
  127. package/src/integration/integration.module.ts +53 -0
  128. package/src/integration/services/domain-event.publisher.ts +136 -0
  129. package/src/integration/services/event-subscriber.registry.ts +89 -0
  130. package/src/integration/services/inbox.service.ts +218 -0
  131. package/src/integration/services/index.ts +12 -0
  132. package/src/integration/services/integration-developer-api.service.ts +96 -0
  133. package/src/integration/services/integration-link.service.ts +154 -0
  134. package/src/integration/services/integration-settings.service.ts +128 -0
  135. package/src/integration/services/outbox-polling.coordinator.ts +146 -0
  136. package/src/integration/services/outbox.notifier.ts +48 -0
  137. package/src/integration/services/outbox.processor.job.ts +97 -0
  138. package/src/integration/services/outbox.processor.ts +266 -0
  139. package/src/integration/services/outbox.service.ts +209 -0
  140. package/src/integration/types/event.types.ts +93 -0
  141. package/src/integration/types/index.ts +3 -0
  142. package/src/integration/types/subscriber.types.ts +37 -0
  143. package/src/oauth/oauth.controller.ts +17 -17
  144. package/src/oauth/oauth.service.ts +20 -20
  145. package/src/setting/setting.service.ts +27 -2
  146. package/src/task/task.service.ts +5 -5
@@ -21,14 +21,14 @@ export declare class AuthController {
21
21
  requires_password_reset: boolean;
22
22
  user_account: {
23
23
  id: number;
24
- provider: import(".prisma/client").$Enums.user_account_provider_enum;
24
+ provider: import("@prisma/client").$Enums.user_account_provider_52222e2ecb_enum;
25
25
  created_at: Date;
26
26
  updated_at: Date;
27
27
  email: string | null;
28
28
  user_id: number;
29
29
  provider_user_id: string;
30
30
  scopes: string | null;
31
- refresh_token: import(".prisma/client/runtime/library").Bytes | null;
31
+ refresh_token: import("@prisma/client/runtime/library").Bytes | null;
32
32
  token_expires_at: Date | null;
33
33
  }[];
34
34
  user_activity: {
@@ -39,7 +39,7 @@ export declare class AuthController {
39
39
  user_id: number;
40
40
  }[];
41
41
  user_credential: {
42
- type: import(".prisma/client").$Enums.user_credential_type_enum;
42
+ type: import("@prisma/client").$Enums.user_credential_type_4466d7f008_enum;
43
43
  id: number;
44
44
  hash: string;
45
45
  created_at: Date;
@@ -51,7 +51,7 @@ export declare class AuthController {
51
51
  }[];
52
52
  user_identifier: {
53
53
  value: string;
54
- type: import(".prisma/client").$Enums.user_identifier_type_enum;
54
+ type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
55
55
  id: number;
56
56
  created_at: Date;
57
57
  updated_at: Date;
@@ -110,7 +110,7 @@ export declare class AuthController {
110
110
  requiresMfa: boolean;
111
111
  mfaToken: string;
112
112
  mfaMethods: {
113
- type: import(".prisma/client").$Enums.user_mfa_type_enum;
113
+ type: import("@prisma/client").$Enums.user_mfa_type_4ce08a626e_enum;
114
114
  id: number;
115
115
  }[];
116
116
  }>;
@@ -72,7 +72,7 @@ export declare class AuthService {
72
72
  requiresMfa: boolean;
73
73
  mfaToken: string;
74
74
  mfaMethods: {
75
- type: import(".prisma/client").$Enums.user_mfa_type_enum;
75
+ type: import("@prisma/client").$Enums.user_mfa_type_4ce08a626e_enum;
76
76
  id: number;
77
77
  }[];
78
78
  }>;
@@ -83,14 +83,14 @@ export declare class AuthService {
83
83
  requires_password_reset: boolean;
84
84
  user_account: {
85
85
  id: number;
86
- provider: import(".prisma/client").$Enums.user_account_provider_enum;
86
+ provider: import("@prisma/client").$Enums.user_account_provider_52222e2ecb_enum;
87
87
  created_at: Date;
88
88
  updated_at: Date;
89
89
  email: string | null;
90
90
  user_id: number;
91
91
  provider_user_id: string;
92
92
  scopes: string | null;
93
- refresh_token: import(".prisma/client/runtime/library").Bytes | null;
93
+ refresh_token: import("@prisma/client/runtime/library").Bytes | null;
94
94
  token_expires_at: Date | null;
95
95
  }[];
96
96
  user_activity: {
@@ -101,7 +101,7 @@ export declare class AuthService {
101
101
  user_id: number;
102
102
  }[];
103
103
  user_credential: {
104
- type: import(".prisma/client").$Enums.user_credential_type_enum;
104
+ type: import("@prisma/client").$Enums.user_credential_type_4466d7f008_enum;
105
105
  id: number;
106
106
  hash: string;
107
107
  created_at: Date;
@@ -113,7 +113,7 @@ export declare class AuthService {
113
113
  }[];
114
114
  user_identifier: {
115
115
  value: string;
116
- type: import(".prisma/client").$Enums.user_identifier_type_enum;
116
+ type: import("@prisma/client").$Enums.user_identifier_type_e66d505520_enum;
117
117
  id: number;
118
118
  created_at: Date;
119
119
  updated_at: Date;
@@ -44,7 +44,7 @@ export declare class ChallengeService {
44
44
  };
45
45
  } & {
46
46
  name: string;
47
- type: import(".prisma/client").$Enums.user_mfa_type_enum;
47
+ type: import("@prisma/client").$Enums.user_mfa_type_4ce08a626e_enum;
48
48
  id: number;
49
49
  created_at: Date;
50
50
  updated_at: Date;
@@ -64,7 +64,7 @@ export declare class ChallengeService {
64
64
  }>;
65
65
  verifyCode(locale: string, userId: number, code: string, providedHash: string, name?: string, email?: string): Promise<{
66
66
  name: string;
67
- type: import(".prisma/client").$Enums.user_mfa_type_enum;
67
+ type: import("@prisma/client").$Enums.user_mfa_type_4ce08a626e_enum;
68
68
  id: number;
69
69
  created_at: Date;
70
70
  updated_at: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"core.module.d.ts","sourceRoot":"","sources":["../src/core.module.ts"],"names":[],"mappings":"AAMA,OAAO,EAA8B,kBAAkB,EAAU,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAqBlH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,qBA4Da,UAAW,YAAW,UAAU,EAAE,YAAY;IAGvD,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IAGjD,YAAY;IAKZ,SAAS,CAAC,QAAQ,EAAE,kBAAkB;CAKvC"}
1
+ {"version":3,"file":"core.module.d.ts","sourceRoot":"","sources":["../src/core.module.ts"],"names":[],"mappings":"AAMA,OAAO,EAA8B,kBAAkB,EAAU,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAsBlH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,qBA8Da,UAAW,YAAW,UAAU,EAAE,YAAY;IAGvD,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IAGjD,YAAY;IAKZ,SAAS,CAAC,QAAQ,EAAE,kBAAkB;CAKvC"}
@@ -28,6 +28,7 @@ const system_module_1 = require("./core/system.module");
28
28
  const dashboard_module_1 = require("./dashboard/dashboard.module");
29
29
  const file_module_1 = require("./file/file.module");
30
30
  const install_module_1 = require("./install/install.module");
31
+ const integration_module_1 = require("./integration/integration.module");
31
32
  const mail_sent_module_1 = require("./mail-sent/mail-sent.module");
32
33
  const mail_module_1 = require("./mail/mail.module");
33
34
  const menu_module_1 = require("./menu/menu.module");
@@ -90,7 +91,8 @@ exports.CoreModule = CoreModule = __decorate([
90
91
  (0, common_1.forwardRef)(() => security_module_1.SecurityModule),
91
92
  (0, common_1.forwardRef)(() => profile_module_1.ProfileModule),
92
93
  (0, common_1.forwardRef)(() => session_module_1.SessionModule),
93
- (0, common_1.forwardRef)(() => oauth_module_1.OAuthModule)
94
+ (0, common_1.forwardRef)(() => oauth_module_1.OAuthModule),
95
+ (0, common_1.forwardRef)(() => integration_module_1.IntegrationModule),
94
96
  ],
95
97
  exports: [
96
98
  user_module_1.UserModule,
@@ -105,6 +107,7 @@ exports.CoreModule = CoreModule = __decorate([
105
107
  file_module_1.FileModule,
106
108
  session_module_1.SessionModule,
107
109
  ai_module_1.AiModule,
110
+ integration_module_1.IntegrationModule,
108
111
  is_strong_password_with_settings_validator_1.IsStrongPasswordWithSettingsConstraint,
109
112
  is_email_with_settings_validator_1.IsEmailWithSettingsConstraint,
110
113
  is_pin_code_with_setting_validator_1.IsPinCodeWithSettingConstraint,
@@ -1 +1 @@
1
- {"version":3,"file":"core.module.js","sourceRoot":"","sources":["../src/core.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA8C;AAC9C,oDAAmD;AACnD,gDAAiE;AACjE,4DAA2D;AAC3D,oDAAkE;AAClE,yCAA2C;AAC3C,2CAAkH;AAClH,2CAA8C;AAC9C,uCAA0D;AAC1D,8CAA0C;AAC1C,oDAAgD;AAChD,wDAAoD;AACpD,mEAA+D;AAC/D,oDAAgD;AAChD,6DAAyD;AACzD,mEAA8D;AAC9D,oDAAgD;AAChD,oDAAgD;AAChD,2FAAsF;AACtF,uDAAmD;AACnD,6DAAyD;AACzD,oDAAgD;AAChD,uDAAmD;AACnD,0DAAsD;AACtD,gEAA4D;AAC5D,6DAAyD;AACzD,6DAAyD;AACzD,+DAA2D;AAC3D,oDAAgD;AAChD,oDAAgD;AAChD,oGAA8F;AAC9F,wGAAiG;AACjG,wHAAiH;AACjH,kEAAuE;AA8DhE,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,YAEmB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAC9C,CAAC;IAEJ,YAAY;QACV,gDAAgD;QAChD,yCAAuB,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC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B;YAC7B,mEAA8B;SAC/B;QACD,SAAS,EAAE;YACT,gBAAS;YACT,mFAAsC;YACtC,gEAA6B;YAC7B,mEAA8B;YAC9B;gBACE,OAAO,EAAE,sBAAe;gBACxB,UAAU,EAAE,CAAC,SAAoB,EAAE,aAA4B,EAAE,EAAE;oBACjE,OAAO,IAAI,oBAAc,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;gBACtD,CAAC;gBACD,MAAM,EAAE,CAAC,gBAAS,EAAE,0BAAa,CAAC;aACnC;SACF;KACF,CAAC;IAGG,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,gCAAc,CAAC,CAAC,CAAA;qCACR,gCAAc;GAHtC,UAAU,CAgBtB"}
@@ -79,7 +79,7 @@ export declare class DashboardCoreController {
79
79
  labelKey: string;
80
80
  descriptionKey: string;
81
81
  enabled: boolean;
82
- mfaTypes: import(".prisma/client").$Enums.user_mfa_type_enum[];
82
+ mfaTypes: import("@prisma/client").$Enums.user_mfa_type_4ce08a626e_enum[];
83
83
  })[];
84
84
  };
85
85
  activityTimeline: {
@@ -174,7 +174,7 @@ export declare class DashboardCoreService {
174
174
  labelKey: string;
175
175
  descriptionKey: string;
176
176
  enabled: boolean;
177
- mfaTypes: import(".prisma/client").$Enums.user_mfa_type_enum[];
177
+ mfaTypes: import("@prisma/client").$Enums.user_mfa_type_4ce08a626e_enum[];
178
178
  })[];
179
179
  }>;
180
180
  getActivityTimeline(userId: number): Promise<{
@@ -223,7 +223,7 @@ export declare class DashboardCoreService {
223
223
  labelKey: string;
224
224
  descriptionKey: string;
225
225
  enabled: boolean;
226
- mfaTypes: import(".prisma/client").$Enums.user_mfa_type_enum[];
226
+ mfaTypes: import("@prisma/client").$Enums.user_mfa_type_4ce08a626e_enum[];
227
227
  })[];
228
228
  };
229
229
  activityTimeline: {
package/dist/index.d.ts CHANGED
@@ -14,6 +14,19 @@ export * from './file/file.service';
14
14
  export * from './setting/setting.service';
15
15
  export * from './ai/ai.module';
16
16
  export * from './ai/ai.service';
17
+ export * from './integration/integration.module';
18
+ export * from './integration/services/domain-event.publisher';
19
+ export * from './integration/services/event-subscriber.registry';
20
+ export * from './integration/services/inbox.service';
21
+ export * from './integration/services/integration-developer-api.service';
22
+ export * from './integration/services/integration-link.service';
23
+ export * from './integration/services/integration-settings.service';
24
+ export * from './integration/services/outbox-polling.coordinator';
25
+ export * from './integration/services/outbox.notifier';
26
+ export * from './integration/services/outbox.processor';
27
+ export * from './integration/services/outbox.processor.job';
28
+ export * from './integration/services/outbox.service';
29
+ export * from './integration/types';
17
30
  export * from './validators/is-email-with-settings.validator';
18
31
  export * from './validators/is-pin-code-with-setting.validator';
19
32
  export * from './validators/is-strong-password-with-settings.validator';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAG9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AAEpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yDAAyD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAG9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AAEpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kCAAkC,CAAC;AACjD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,0DAA0D,CAAC;AACzE,cAAc,iDAAiD,CAAC;AAChE,cAAc,qDAAqD,CAAC;AACpE,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uCAAuC,CAAC;AACtD,cAAc,qBAAqB,CAAC;AAGpC,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yDAAyD,CAAC"}
package/dist/index.js CHANGED
@@ -36,6 +36,20 @@ __exportStar(require("./file/file.service"), exports);
36
36
  __exportStar(require("./setting/setting.service"), exports);
37
37
  __exportStar(require("./ai/ai.module"), exports);
38
38
  __exportStar(require("./ai/ai.service"), exports);
39
+ // Integration Module
40
+ __exportStar(require("./integration/integration.module"), exports);
41
+ __exportStar(require("./integration/services/domain-event.publisher"), exports);
42
+ __exportStar(require("./integration/services/event-subscriber.registry"), exports);
43
+ __exportStar(require("./integration/services/inbox.service"), exports);
44
+ __exportStar(require("./integration/services/integration-developer-api.service"), exports);
45
+ __exportStar(require("./integration/services/integration-link.service"), exports);
46
+ __exportStar(require("./integration/services/integration-settings.service"), exports);
47
+ __exportStar(require("./integration/services/outbox-polling.coordinator"), exports);
48
+ __exportStar(require("./integration/services/outbox.notifier"), exports);
49
+ __exportStar(require("./integration/services/outbox.processor"), exports);
50
+ __exportStar(require("./integration/services/outbox.processor.job"), exports);
51
+ __exportStar(require("./integration/services/outbox.service"), exports);
52
+ __exportStar(require("./integration/types"), exports);
39
53
  // Validators
40
54
  __exportStar(require("./validators/is-email-with-settings.validator"), exports);
41
55
  __exportStar(require("./validators/is-pin-code-with-setting.validator"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,cAAc;AACd,gDAA8B;AAE9B,cAAc;AACd,sDAAoC;AACpC,2DAAyC;AAEzC,cAAc;AACd,sDAAoC;AAEpC,oBAAoB;AACpB,2DAAyC;AACzC,sDAAoC;AAEpC,gBAAgB;AAChB,0DAAwC;AAExC,cAAc;AACd,kEAAgD;AAChD,sDAAoC;AAEpC,qDAAmC;AACnC,sDAAoC;AAEpC,qDAAmC;AACnC,sDAAoC;AACpC,4DAA0C;AAE1C,iDAA+B;AAC/B,kDAAgC;AAEhC,aAAa;AACb,gFAA8D;AAC9D,kFAAgE;AAChE,0FAAwE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,cAAc;AACd,gDAA8B;AAE9B,cAAc;AACd,sDAAoC;AACpC,2DAAyC;AAEzC,cAAc;AACd,sDAAoC;AAEpC,oBAAoB;AACpB,2DAAyC;AACzC,sDAAoC;AAEpC,gBAAgB;AAChB,0DAAwC;AAExC,cAAc;AACd,kEAAgD;AAChD,sDAAoC;AAEpC,qDAAmC;AACnC,sDAAoC;AAEpC,qDAAmC;AACnC,sDAAoC;AACpC,4DAA0C;AAE1C,iDAA+B;AAC/B,kDAAgC;AAEhC,qBAAqB;AACrB,mEAAiD;AACjD,gFAA8D;AAC9D,mFAAiE;AACjE,uEAAqD;AACrD,2FAAyE;AACzE,kFAAgE;AAChE,sFAAoE;AACpE,oFAAkE;AAClE,yEAAuD;AACvD,0EAAwD;AACxD,8EAA4D;AAC5D,wEAAsD;AACtD,sDAAoC;AAEpC,aAAa;AACb,gFAA8D;AAC9D,kFAAgE;AAChE,0FAAwE"}
@@ -0,0 +1,4 @@
1
+ export * from './integration.module';
2
+ export * from './services';
3
+ export * from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integration/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./integration.module"), exports);
18
+ __exportStar(require("./services"), exports);
19
+ __exportStar(require("./types"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,6CAA2B;AAC3B,0CAAwB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=integration-api.validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-api.validation.d.ts","sourceRoot":"","sources":["../../src/integration/integration-api.validation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const assert_1 = require("assert");
4
+ const domain_event_publisher_1 = require("./services/domain-event.publisher");
5
+ const event_subscriber_registry_1 = require("./services/event-subscriber.registry");
6
+ const inbox_service_1 = require("./services/inbox.service");
7
+ const integration_link_service_1 = require("./services/integration-link.service");
8
+ const types_1 = require("./types");
9
+ async function validatePublisher() {
10
+ const createdEvent = {
11
+ id: 'evt-1',
12
+ eventName: 'operations.project.billing_ready',
13
+ sourceModule: 'operations',
14
+ aggregateType: 'project',
15
+ aggregateId: 'prj-1',
16
+ payload: { projectId: 'prj-1' },
17
+ status: 'pending',
18
+ attemptCount: 0,
19
+ lastError: null,
20
+ availableAt: new Date(),
21
+ processedAt: null,
22
+ createdAt: new Date(),
23
+ updatedAt: new Date(),
24
+ };
25
+ const outboxService = {
26
+ createEvent: async () => createdEvent,
27
+ };
28
+ let notified = 0;
29
+ const notifier = {
30
+ notifyEventWritten: () => {
31
+ notified += 1;
32
+ },
33
+ };
34
+ const publisher = new domain_event_publisher_1.DomainEventPublisher(outboxService, notifier);
35
+ const result = await publisher.publishEvent({
36
+ eventName: 'operations.project.billing_ready',
37
+ sourceModule: 'operations',
38
+ aggregateType: 'project',
39
+ aggregateId: 'prj-1',
40
+ payload: { projectId: 'prj-1' },
41
+ });
42
+ assert_1.strict.equal(result.id, 'evt-1');
43
+ assert_1.strict.equal(notified, 1);
44
+ }
45
+ async function validateRegistry() {
46
+ const registry = new event_subscriber_registry_1.EventSubscriberRegistry();
47
+ registry.subscribe('operations.contract.payable_generated', 'consumer-low', async () => undefined, 1);
48
+ registry.subscribe('operations.contract.payable_generated', 'consumer-high', async () => undefined, 10);
49
+ const handlers = registry.getHandlers('operations.contract.payable_generated');
50
+ assert_1.strict.equal(handlers.length, 2);
51
+ const firstHandler = handlers[0];
52
+ assert_1.strict.ok(firstHandler);
53
+ assert_1.strict.equal(firstHandler.consumerName, 'consumer-high');
54
+ }
55
+ async function validateLinks() {
56
+ const link = {
57
+ id: 'link-1',
58
+ sourceModule: 'operations',
59
+ sourceEntityType: 'project',
60
+ sourceEntityId: 'prj-1',
61
+ targetModule: 'finance',
62
+ targetEntityType: 'payable',
63
+ targetEntityId: 'pay-1',
64
+ linkType: types_1.LinkType.REFERENCE,
65
+ metadata: null,
66
+ createdAt: new Date(),
67
+ updatedAt: new Date(),
68
+ };
69
+ const prisma = {
70
+ integrationLink: {
71
+ create: async () => link,
72
+ findMany: async () => [link],
73
+ },
74
+ };
75
+ const service = new integration_link_service_1.IntegrationLinkService(prisma);
76
+ const created = await service.createLink({
77
+ sourceModule: 'operations',
78
+ sourceEntityType: 'project',
79
+ sourceEntityId: 'prj-1',
80
+ targetModule: 'finance',
81
+ targetEntityType: 'payable',
82
+ targetEntityId: 'pay-1',
83
+ linkType: types_1.LinkType.REFERENCE,
84
+ });
85
+ const outbound = await service.findOutbound('operations', 'project', 'prj-1');
86
+ assert_1.strict.equal(created.id, 'link-1');
87
+ assert_1.strict.equal(outbound.length, 1);
88
+ }
89
+ async function validateInboxIdempotency() {
90
+ const existing = {
91
+ id: 1,
92
+ outbox_event_id: 1,
93
+ consumer_name: 'finance-module',
94
+ status: 'processed',
95
+ attempt_count: 1,
96
+ last_error: null,
97
+ processed_at: new Date(),
98
+ created_at: new Date(),
99
+ updated_at: new Date(),
100
+ };
101
+ const prisma = {
102
+ inbox_event: {
103
+ findFirst: async () => existing,
104
+ create: async () => {
105
+ throw new Error('create should not be called for existing inbox item');
106
+ },
107
+ },
108
+ };
109
+ const inbox = new inbox_service_1.InboxService(prisma);
110
+ const result = await inbox.getOrCreate('1', 'finance-module');
111
+ assert_1.strict.equal(result.id, '1');
112
+ }
113
+ async function main() {
114
+ await validatePublisher();
115
+ await validateRegistry();
116
+ await validateLinks();
117
+ await validateInboxIdempotency();
118
+ // eslint-disable-next-line no-console
119
+ console.log('Integration API validation passed');
120
+ }
121
+ main().catch((error) => {
122
+ // eslint-disable-next-line no-console
123
+ console.error('Integration API validation failed', error);
124
+ process.exit(1);
125
+ });
126
+ //# sourceMappingURL=integration-api.validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-api.validation.js","sourceRoot":"","sources":["../../src/integration/integration-api.validation.ts"],"names":[],"mappings":";;AAAA,mCAA0C;AAC1C,8EAAyE;AACzE,oFAA+E;AAC/E,4DAAwD;AACxD,kFAA6E;AAC7E,mCAAmC;AAEnC,KAAK,UAAU,iBAAiB;IAC9B,MAAM,YAAY,GAAG;QACnB,EAAE,EAAE,OAAO;QACX,SAAS,EAAE,kCAAkC;QAC7C,YAAY,EAAE,YAAY;QAC1B,aAAa,EAAE,SAAS;QACxB,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;QAC/B,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI,IAAI,EAAE;QACvB,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,SAAS,EAAE,IAAI,IAAI,EAAE;KACtB,CAAC;IAEF,MAAM,aAAa,GAAG;QACpB,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY;KACtC,CAAC;IAEF,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,MAAM,QAAQ,GAAG;QACf,kBAAkB,EAAE,GAAG,EAAE;YACvB,QAAQ,IAAI,CAAC,CAAC;QAChB,CAAC;KACF,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,6CAAoB,CACxC,aAAoB,EACpB,QAAe,CAChB,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC;QAC1C,SAAS,EAAE,kCAAkC;QAC7C,YAAY,EAAE,Y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EAAE;gBACjB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;YACzE,CAAC;SACF;KACF,CAAC;IAEF,MAAM,KAAK,GAAG,IAAI,4BAAY,CAAC,MAAa,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC9D,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,iBAAiB,EAAE,CAAC;IAC1B,MAAM,gBAAgB,EAAE,CAAC;IACzB,MAAM,aAAa,EAAE,CAAC;IACtB,MAAM,wBAAwB,EAAE,CAAC;IACjC,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AACnD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare class IntegrationModule {
2
+ }
3
+ //# sourceMappingURL=integration.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.module.d.ts","sourceRoot":"","sources":["../../src/integration/integration.module.ts"],"names":[],"mappings":"AAkBA,qBAkCa,iBAAiB;CAAG"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.IntegrationModule = void 0;
10
+ const api_prisma_1 = require("@hed-hog/api-prisma");
11
+ const common_1 = require("@nestjs/common");
12
+ const schedule_1 = require("@nestjs/schedule");
13
+ const setting_module_1 = require("../setting/setting.module");
14
+ const services_1 = require("./services");
15
+ let IntegrationModule = class IntegrationModule {
16
+ };
17
+ exports.IntegrationModule = IntegrationModule;
18
+ exports.IntegrationModule = IntegrationModule = __decorate([
19
+ (0, common_1.Global)(),
20
+ (0, common_1.Module)({
21
+ imports: [
22
+ schedule_1.ScheduleModule.forRoot(),
23
+ api_prisma_1.PrismaModule,
24
+ (0, common_1.forwardRef)(() => setting_module_1.SettingModule),
25
+ ],
26
+ providers: [
27
+ services_1.OutboxNotifier,
28
+ services_1.OutboxService,
29
+ services_1.InboxService,
30
+ services_1.IntegrationLinkService,
31
+ services_1.EventSubscriberRegistry,
32
+ services_1.IntegrationDeveloperApiService,
33
+ services_1.IntegrationSettingsService,
34
+ services_1.DomainEventPublisher,
35
+ services_1.OutboxProcessor,
36
+ services_1.OutboxPollingCoordinator,
37
+ services_1.OutboxProcessorJob,
38
+ ],
39
+ exports: [
40
+ services_1.OutboxNotifier,
41
+ services_1.OutboxService,
42
+ services_1.InboxService,
43
+ services_1.IntegrationLinkService,
44
+ services_1.EventSubscriberRegistry,
45
+ services_1.IntegrationDeveloperApiService,
46
+ services_1.IntegrationSettingsService,
47
+ services_1.DomainEventPublisher,
48
+ services_1.OutboxProcessor,
49
+ services_1.OutboxPollingCoordinator,
50
+ services_1.OutboxProcessorJob,
51
+ ],
52
+ })
53
+ ], IntegrationModule);
54
+ //# sourceMappingURL=integration.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.module.js","sourceRoot":"","sources":["../../src/integration/integration.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAmD;AACnD,2CAA4D;AAC5D,+CAAkD;AAClD,8DAA0D;AAC1D,yCAYoB;AAoCb,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAlC7B,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAc,CAAC,OAAO,EAAE;YACxB,yBAAY;YACZ,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC;SAChC;QACD,SAAS,EAAE;YACT,yBAAc;YACd,wBAAa;YACb,uBAAY;YACZ,iCAAsB;YACtB,kCAAuB;YACvB,yCAA8B;YAC9B,qCAA0B;YAC1B,+BAAoB;YACpB,0BAAe;YACf,mCAAwB;YACxB,6BAAkB;SACnB;QACD,OAAO,EAAE;YACP,yBAAc;YACd,wBAAa;YACb,uBAAY;YACZ,iCAAsB;YACtB,kCAAuB;YACvB,yCAA8B;YAC9B,qCAA0B;YAC1B,+BAAoB;YACpB,0BAAe;YACf,mCAAwB;YACxB,6BAAkB;SACnB;KACF,CAAC;GACW,iBAAiB,CAAG"}
@@ -0,0 +1,31 @@
1
+ import { DomainEvent, OutboxEvent } from '../types';
2
+ import { OutboxNotifier } from './outbox.notifier';
3
+ import { OutboxEventPersistenceClient, OutboxService } from './outbox.service';
4
+ export interface PublishDomainEventInput {
5
+ eventName: string;
6
+ sourceModule: string;
7
+ aggregateType: string;
8
+ aggregateId: string;
9
+ payload?: Record<string, any>;
10
+ metadata?: Record<string, any>;
11
+ }
12
+ export interface PublishDomainEventOptions {
13
+ persistenceClient?: OutboxEventPersistenceClient;
14
+ }
15
+ export declare class DomainEventPublisher {
16
+ private readonly outboxService;
17
+ private readonly outboxNotifier;
18
+ constructor(outboxService: OutboxService, outboxNotifier: OutboxNotifier);
19
+ /**
20
+ * Publish a domain event
21
+ * Writes to durable outbox and notifies processor for immediate wakeup
22
+ */
23
+ publishEvent(input: PublishDomainEventInput, options?: PublishDomainEventOptions): Promise<OutboxEvent>;
24
+ publishEvent(eventName: string, sourceModule: string, aggregateType: string, aggregateId: string, payload?: Record<string, any>, metadata?: Record<string, any>, options?: PublishDomainEventOptions): Promise<OutboxEvent>;
25
+ /**
26
+ * Publish multiple events in sequence
27
+ */
28
+ publishEvents(events: Array<DomainEvent | PublishDomainEventInput>, options?: PublishDomainEventOptions): Promise<OutboxEvent[]>;
29
+ private enrichPayloadWithMetadata;
30
+ }
31
+ //# sourceMappingURL=domain-event.publisher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-event.publisher.d.ts","sourceRoot":"","sources":["../../../src/integration/services/domain-event.publisher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,4BAA4B,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/E,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,CAAC,EAAE,4BAA4B,CAAC;CAClD;AAED,qBACa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,cAAc;gBADd,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc;IAGjD;;;OAGG;IACG,YAAY,CAChB,KAAK,EAAE,uBAAuB,EAC9B,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,WAAW,CAAC;IAEjB,YAAY,CAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,WAAW,CAAC;IAoDvB;;OAEG;IACG,aAAa,CACjB,MAAM,EAAE,KAAK,CAAC,WAAW,GAAG,uBAAuB,CAAC,EACpD,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,WAAW,EAAE,CAAC;IAsBzB,OAAO,CAAC,yBAAyB;CAalC"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DomainEventPublisher = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const outbox_notifier_1 = require("./outbox.notifier");
15
+ const outbox_service_1 = require("./outbox.service");
16
+ let DomainEventPublisher = class DomainEventPublisher {
17
+ constructor(outboxService, outboxNotifier) {
18
+ this.outboxService = outboxService;
19
+ this.outboxNotifier = outboxNotifier;
20
+ }
21
+ async publishEvent(eventOrName, sourceModuleOrOptions, aggregateType, aggregateId, payload, metadata, options) {
22
+ const payloadData = payload || {};
23
+ const input = typeof eventOrName === 'string'
24
+ ? {
25
+ eventName: eventOrName,
26
+ sourceModule: sourceModuleOrOptions,
27
+ aggregateType: aggregateType,
28
+ aggregateId: aggregateId,
29
+ payload: payloadData,
30
+ metadata,
31
+ }
32
+ : eventOrName;
33
+ const publishOptions = typeof eventOrName === 'string'
34
+ ? options
35
+ : sourceModuleOrOptions;
36
+ const persistedPayload = this.enrichPayloadWithMetadata(input.payload || {}, input.metadata);
37
+ // Write to outbox (durable, authoritative)
38
+ const outboxEvent = await this.outboxService.createEvent({
39
+ eventName: input.eventName,
40
+ sourceModule: input.sourceModule,
41
+ aggregateType: input.aggregateType,
42
+ aggregateId: input.aggregateId,
43
+ payload: persistedPayload,
44
+ }, publishOptions === null || publishOptions === void 0 ? void 0 : publishOptions.persistenceClient);
45
+ // Notify processor for immediate wakeup (best-effort, not guaranteed)
46
+ this.outboxNotifier.notifyEventWritten();
47
+ return outboxEvent;
48
+ }
49
+ /**
50
+ * Publish multiple events in sequence
51
+ */
52
+ async publishEvents(events, options) {
53
+ const published = [];
54
+ for (const event of events) {
55
+ published.push(await this.publishEvent({
56
+ eventName: event.eventName,
57
+ sourceModule: event.sourceModule,
58
+ aggregateType: event.aggregateType,
59
+ aggregateId: event.aggregateId,
60
+ payload: event.payload,
61
+ metadata: event.metadata,
62
+ }, options));
63
+ }
64
+ return published;
65
+ }
66
+ enrichPayloadWithMetadata(payload, metadata) {
67
+ if (!metadata) {
68
+ return payload;
69
+ }
70
+ return Object.assign(Object.assign({}, payload), { _integrationMeta: metadata });
71
+ }
72
+ };
73
+ exports.DomainEventPublisher = DomainEventPublisher;
74
+ exports.DomainEventPublisher = DomainEventPublisher = __decorate([
75
+ (0, common_1.Injectable)(),
76
+ __metadata("design:paramtypes", [outbox_service_1.OutboxService,
77
+ outbox_notifier_1.OutboxNotifier])
78
+ ], DomainEventPublisher);
79
+ //# sourceMappingURL=domain-event.publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-event.publisher.js","sourceRoot":"","sources":["../../../src/integration/services/domain-event.publisher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,uDAAmD;AACnD,qDAA+E;AAgBxE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YACmB,aAA4B,EAC5B,cAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAe;QAC5B,mBAAc,GAAd,cAAc,CAAgB;IAC9C,CAAC;IAqBJ,KAAK,CAAC,YAAY,CAChB,WAA6C,EAC7C,qBAA0D,EAC1D,aAAsB,EACtB,WAAoB,EACpB,OAA6B,EAC7B,QAA8B,EAC9B,OAAmC;QAEnC,MAAM,WAAW,GAAG,OAAO,IAAI,EAAE,CAAC;QAClC,MAAM,KAAK,GACT,OAAO,WAAW,KAAK,QAAQ;YAC7B,CAAC,CAAC;gBACE,SAAS,EAAE,WAAW;gBACtB,YAAY,EAAE,qBAA+B;gBAC7C,aAAa,EAAE,aAAuB;gBACtC,WAAW,EAAE,WAAqB;gBAClC,OAAO,EAAE,WAAW;gBACpB,QAAQ;aACT;YACH,CAAC,CAAC,WAAW,CAAC;QAElB,MAAM,cAAc,GAClB,OAAO,WAAW,KAAK,QAAQ;YAC7B,CAAC,CAAC,OAAO;YACT,CAAC,CAAE,qBAA+D,CAAC;QAEvE,MAAM,gBAAgB,GAAG,IAAI,CAAC,yBAAyB,CACrD,KAAK,CAAC,OAAO,IAAI,EAAE,EACnB,KAAK,CAAC,QAAQ,CACf,CAAC;QAEF,2CAA2C;QAC3C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CACtD;YACE,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,OA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