@messenger-box/platform-server 10.0.3-alpha.2 → 10.0.3-alpha.201

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 (303) hide show
  1. package/lib/channels/ack-reactions.d.ts +46 -0
  2. package/lib/channels/ack-reactions.js +48 -0
  3. package/lib/channels/ack-reactions.js.map +1 -0
  4. package/lib/channels/allowlist-match.d.ts +38 -0
  5. package/lib/channels/allowlist-match.js +67 -0
  6. package/lib/channels/allowlist-match.js.map +1 -0
  7. package/lib/channels/channel-config.d.ts +46 -0
  8. package/lib/channels/channel-config.js +63 -0
  9. package/lib/channels/channel-config.js.map +1 -0
  10. package/lib/channels/command-gating.d.ts +47 -0
  11. package/lib/channels/command-gating.js +52 -0
  12. package/lib/channels/command-gating.js.map +1 -0
  13. package/lib/channels/conversation-label.d.ts +23 -0
  14. package/lib/channels/conversation-label.js +43 -0
  15. package/lib/channels/conversation-label.js.map +1 -0
  16. package/lib/channels/index.d.ts +18 -0
  17. package/lib/channels/mention-gating.d.ts +50 -0
  18. package/lib/channels/mention-gating.js +72 -0
  19. package/lib/channels/mention-gating.js.map +1 -0
  20. package/lib/channels/registry.d.ts +23 -0
  21. package/lib/channels/registry.js +282 -0
  22. package/lib/channels/registry.js.map +1 -0
  23. package/lib/channels/sender-identity.d.ts +11 -0
  24. package/lib/channels/sender-identity.js +48 -0
  25. package/lib/channels/sender-identity.js.map +1 -0
  26. package/lib/channels/session.d.ts +63 -0
  27. package/lib/channels/session.js +29 -0
  28. package/lib/channels/session.js.map +1 -0
  29. package/lib/channels/types.d.ts +147 -0
  30. package/lib/channels/types.js +28 -0
  31. package/lib/channels/types.js.map +1 -0
  32. package/lib/channels/typing.d.ts +62 -0
  33. package/lib/channels/typing.js +37 -0
  34. package/lib/channels/typing.js.map +1 -0
  35. package/lib/channels/typing.test.d.ts +1 -0
  36. package/lib/config/env-config.d.ts +7 -0
  37. package/lib/config/env-config.js +21 -1
  38. package/lib/config/env-config.js.map +1 -1
  39. package/lib/constants/default-channel-props.d.ts +11 -0
  40. package/lib/constants/default-channel-props.js +32 -0
  41. package/lib/constants/default-channel-props.js.map +1 -0
  42. package/lib/constants/default-notify-props.js.map +1 -1
  43. package/lib/constants/index.d.ts +1 -0
  44. package/lib/constants/query.constants.js.map +1 -1
  45. package/lib/containers/containers.js +13 -7
  46. package/lib/containers/containers.js.map +1 -1
  47. package/lib/containers/context-services-from-container.d.ts +2 -2
  48. package/lib/containers/context-services-from-container.js +7 -7
  49. package/lib/containers/context-services-from-container.js.map +1 -1
  50. package/lib/gateway/channel-registry.d.ts +10 -0
  51. package/lib/gateway/gateway-service.d.ts +23 -0
  52. package/lib/gateway/index.d.ts +4 -0
  53. package/lib/gateway/message-router.d.ts +20 -0
  54. package/lib/gateway/types.d.ts +270 -0
  55. package/lib/graphql/resolvers/channel-capabilities.d.ts +13 -0
  56. package/lib/graphql/resolvers/channel-capabilities.js +179 -0
  57. package/lib/graphql/resolvers/channel-capabilities.js.map +1 -0
  58. package/lib/graphql/resolvers/channel-member.d.ts +3 -3
  59. package/lib/graphql/resolvers/channel-member.js +30 -5
  60. package/lib/graphql/resolvers/channel-member.js.map +1 -1
  61. package/lib/graphql/resolvers/channel.d.ts +3 -3
  62. package/lib/graphql/resolvers/channel.js +348 -55
  63. package/lib/graphql/resolvers/channel.js.map +1 -1
  64. package/lib/graphql/resolvers/chat-configuration.d.ts +59 -0
  65. package/lib/graphql/resolvers/chat-configuration.js +89 -0
  66. package/lib/graphql/resolvers/chat-configuration.js.map +1 -0
  67. package/lib/graphql/resolvers/extended-token-account.d.ts +3 -32
  68. package/lib/graphql/resolvers/extended-token-account.js +90 -23
  69. package/lib/graphql/resolvers/extended-token-account.js.map +1 -1
  70. package/lib/graphql/resolvers/gateway.d.ts +18 -0
  71. package/lib/graphql/resolvers/index.d.ts +47 -26
  72. package/lib/graphql/resolvers/index.js +1 -1
  73. package/lib/graphql/resolvers/index.js.map +1 -1
  74. package/lib/graphql/resolvers/post-thread.d.ts +2 -3
  75. package/lib/graphql/resolvers/post-thread.js +294 -132
  76. package/lib/graphql/resolvers/post-thread.js.map +1 -1
  77. package/lib/graphql/resolvers/post.d.ts +2 -3
  78. package/lib/graphql/resolvers/post.js +764 -237
  79. package/lib/graphql/resolvers/post.js.map +1 -1
  80. package/lib/graphql/resolvers/reaction.d.ts +3 -3
  81. package/lib/graphql/resolvers/reaction.js +96 -14
  82. package/lib/graphql/resolvers/reaction.js.map +1 -1
  83. package/lib/graphql/resolvers/streaming.d.ts +20 -0
  84. package/lib/graphql/resolvers/streaming.js +147 -0
  85. package/lib/graphql/resolvers/streaming.js.map +1 -0
  86. package/lib/graphql/schema/channel-capabilities.graphql +492 -0
  87. package/lib/graphql/schema/channel-capabilities.graphql.js +1 -0
  88. package/lib/graphql/schema/channel-capabilities.graphql.js.map +1 -0
  89. package/lib/graphql/schema/channel-member.graphql +110 -21
  90. package/lib/graphql/schema/channel-member.graphql.js +1 -1
  91. package/lib/graphql/schema/channel.graphql +465 -24
  92. package/lib/graphql/schema/channel.graphql.js +1 -1
  93. package/lib/graphql/schema/chat-configuration.graphql +77 -0
  94. package/lib/graphql/schema/chat-configuration.graphql.js +1 -0
  95. package/lib/graphql/schema/chat-configuration.graphql.js.map +1 -0
  96. package/lib/graphql/schema/gateway.graphql +363 -0
  97. package/lib/graphql/schema/index.js +2 -2
  98. package/lib/graphql/schema/index.js.map +1 -1
  99. package/lib/graphql/schema/post-thread.graphql +167 -21
  100. package/lib/graphql/schema/post-thread.graphql.js +1 -1
  101. package/lib/graphql/schema/post.graphql +433 -36
  102. package/lib/graphql/schema/post.graphql.js +1 -1
  103. package/lib/graphql/schema/preferences.graphql +190 -3
  104. package/lib/graphql/schema/preferences.graphql.js +1 -1
  105. package/lib/graphql/schema/reaction.graphql +71 -13
  106. package/lib/graphql/schema/reaction.graphql.js +1 -1
  107. package/lib/graphql/schema/services.graphql +18 -0
  108. package/lib/graphql/schema/streaming.graphql +224 -0
  109. package/lib/graphql/schema/streaming.graphql.js +1 -0
  110. package/lib/graphql/schema/streaming.graphql.js.map +1 -0
  111. package/lib/graphql/schema/users.graphql +76 -13
  112. package/lib/graphql/schema/users.graphql.js +1 -1
  113. package/lib/graphql/schema/workflow-service.graphql +82 -0
  114. package/lib/index.d.ts +3 -1
  115. package/lib/index.js +1 -1
  116. package/lib/index.js.map +1 -1
  117. package/lib/interfaces/index.d.ts +0 -2
  118. package/lib/interfaces/services.d.ts +1 -3
  119. package/lib/migrations/dbMigrations/AddChannelConfigurationsMigration.d.ts +42 -0
  120. package/lib/migrations/dbMigrations/AddChannelConfigurationsMigration.js +60 -0
  121. package/lib/migrations/dbMigrations/AddChannelConfigurationsMigration.js.map +1 -0
  122. package/lib/migrations/dbMigrations/AddChatConfigurationsMigration.d.ts +21 -0
  123. package/lib/migrations/dbMigrations/AddChatConfigurationsMigration.js +30 -0
  124. package/lib/migrations/dbMigrations/AddChatConfigurationsMigration.js.map +1 -0
  125. package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.d.ts +17 -0
  126. package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.js +44 -0
  127. package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.js.map +1 -0
  128. package/lib/migrations/dbMigrations/index.d.ts +3 -0
  129. package/lib/migrations/index.d.ts +1 -0
  130. package/lib/migrations/mail-template-migration.d.ts +3 -6
  131. package/lib/migrations/mail-template-migration.js +8 -21
  132. package/lib/migrations/mail-template-migration.js.map +1 -1
  133. package/lib/migrations/message-notification-template-migration.d.ts +4 -7
  134. package/lib/migrations/message-notification-template-migration.js +8 -25
  135. package/lib/migrations/message-notification-template-migration.js.map +1 -1
  136. package/lib/module.d.ts +1 -1
  137. package/lib/module.js +3 -10
  138. package/lib/module.js.map +1 -1
  139. package/lib/plugins/ChannelMoleculerService.d.ts +39 -0
  140. package/lib/plugins/ChannelMoleculerService.js +58 -0
  141. package/lib/plugins/ChannelMoleculerService.js.map +1 -0
  142. package/lib/plugins/ExtendedTokenAccountMoleculerService.d.ts +65 -0
  143. package/lib/plugins/ExtendedTokenAccountMoleculerService.js +88 -0
  144. package/lib/plugins/ExtendedTokenAccountMoleculerService.js.map +1 -0
  145. package/lib/plugins/MessengerNotificationMoleculerService.d.ts +52 -0
  146. package/lib/plugins/MessengerNotificationMoleculerService.js +84 -0
  147. package/lib/plugins/MessengerNotificationMoleculerService.js.map +1 -0
  148. package/lib/plugins/PostMoleculerService.d.ts +65 -0
  149. package/lib/plugins/PostMoleculerService.js +87 -0
  150. package/lib/plugins/PostMoleculerService.js.map +1 -0
  151. package/lib/plugins/PostThreadMoleculerService.d.ts +40 -0
  152. package/lib/plugins/PostThreadMoleculerService.js +59 -0
  153. package/lib/plugins/PostThreadMoleculerService.js.map +1 -0
  154. package/lib/plugins/ReactionMoleculerService.d.ts +37 -0
  155. package/lib/plugins/ReactionMoleculerService.js +56 -0
  156. package/lib/plugins/ReactionMoleculerService.js.map +1 -0
  157. package/lib/plugins/index.d.ts +18 -6
  158. package/lib/preferences/permissions/inbox-permission-contribution.js +58 -97
  159. package/lib/preferences/permissions/inbox-permission-contribution.js.map +1 -1
  160. package/lib/preferences/permissions/inbox-roles-permission-overwrite.js +144 -144
  161. package/lib/preferences/permissions/inbox-roles-permission-overwrite.js.map +1 -1
  162. package/lib/preferences/settings/channel-settings.d.ts +39 -0
  163. package/lib/preferences/settings/channel-settings.js +180 -0
  164. package/lib/preferences/settings/channel-settings.js.map +1 -0
  165. package/lib/preferences/settings/chat-settings.d.ts +248 -0
  166. package/lib/preferences/settings/chat-settings.js +1152 -0
  167. package/lib/preferences/settings/chat-settings.js.map +1 -0
  168. package/lib/preferences/settings/index.d.ts +3 -0
  169. package/lib/preferences/settings/messenger-channels-contribution.d.ts +39 -0
  170. package/lib/preferences/settings/messenger-channels-contribution.js +355 -0
  171. package/lib/preferences/settings/messenger-channels-contribution.js.map +1 -0
  172. package/lib/preferences/settings/post-settings.d.ts +16 -0
  173. package/lib/preferences/settings/post-settings.js +75 -3
  174. package/lib/preferences/settings/post-settings.js.map +1 -1
  175. package/lib/services/channel-service.d.ts +215 -34
  176. package/lib/services/channel-service.js +1058 -273
  177. package/lib/services/channel-service.js.map +1 -1
  178. package/lib/services/extended-token-account-service.d.ts +175 -20
  179. package/lib/services/extended-token-account-service.js +636 -56
  180. package/lib/services/extended-token-account-service.js.map +1 -1
  181. package/lib/services/messenger-notification-service.d.ts +177 -17
  182. package/lib/services/messenger-notification-service.js +975 -421
  183. package/lib/services/messenger-notification-service.js.map +1 -1
  184. package/lib/services/post-service.d.ts +245 -18
  185. package/lib/services/post-service.js +1027 -113
  186. package/lib/services/post-service.js.map +1 -1
  187. package/lib/services/post-thread-service.d.ts +153 -6
  188. package/lib/services/post-thread-service.js +475 -9
  189. package/lib/services/post-thread-service.js.map +1 -1
  190. package/lib/services/proxy-services/ChannelProxyService.d.ts +27 -0
  191. package/lib/services/proxy-services/ChannelProxyService.js +31 -0
  192. package/lib/services/proxy-services/ChannelProxyService.js.map +1 -0
  193. package/lib/services/proxy-services/ExtendedTokenAccountProxyService.d.ts +42 -0
  194. package/lib/services/proxy-services/ExtendedTokenAccountProxyService.js +46 -0
  195. package/lib/services/proxy-services/ExtendedTokenAccountProxyService.js.map +1 -0
  196. package/lib/services/proxy-services/MessengerNotificationProxyService.d.ts +44 -0
  197. package/lib/services/proxy-services/MessengerNotificationProxyService.js +54 -0
  198. package/lib/services/proxy-services/MessengerNotificationProxyService.js.map +1 -0
  199. package/lib/services/proxy-services/PostProxyService.d.ts +42 -0
  200. package/lib/services/proxy-services/PostProxyService.js +46 -0
  201. package/lib/services/proxy-services/PostProxyService.js.map +1 -0
  202. package/lib/services/proxy-services/PostThreadProxyService.d.ts +32 -0
  203. package/lib/services/proxy-services/PostThreadProxyService.js +36 -0
  204. package/lib/services/proxy-services/PostThreadProxyService.js.map +1 -0
  205. package/lib/services/proxy-services/ReactionProxyService.d.ts +41 -0
  206. package/lib/services/proxy-services/ReactionProxyService.js +45 -0
  207. package/lib/services/proxy-services/ReactionProxyService.js.map +1 -0
  208. package/lib/services/proxy-services/index.d.ts +17 -5
  209. package/lib/services/reaction-service.d.ts +124 -4
  210. package/lib/services/reaction-service.js +413 -3
  211. package/lib/services/reaction-service.js.map +1 -1
  212. package/lib/store/models/account-token-store.d.ts +1 -1
  213. package/lib/store/models/account-token-store.js.map +1 -1
  214. package/lib/store/models/channel.d.ts +2 -3
  215. package/lib/store/models/channel.js +216 -70
  216. package/lib/store/models/channel.js.map +1 -1
  217. package/lib/store/models/post-thread.d.ts +3 -3
  218. package/lib/store/models/post-thread.js +96 -14
  219. package/lib/store/models/post-thread.js.map +1 -1
  220. package/lib/store/models/post.d.ts +2 -3
  221. package/lib/store/models/post.js +143 -23
  222. package/lib/store/models/post.js.map +1 -1
  223. package/lib/store/models/reaction.d.ts +2 -3
  224. package/lib/store/models/reaction.js +67 -8
  225. package/lib/store/models/reaction.js.map +1 -1
  226. package/lib/store/repositories/__tests__/__fixtures__/team-repository.d.ts +3 -3
  227. package/lib/store/repositories/channel-repository.d.ts +6 -6
  228. package/lib/store/repositories/channel-repository.js +5 -2
  229. package/lib/store/repositories/channel-repository.js.map +1 -1
  230. package/lib/store/repositories/post-repository.d.ts +6 -6
  231. package/lib/store/repositories/post-repository.js +5 -2
  232. package/lib/store/repositories/post-repository.js.map +1 -1
  233. package/lib/store/repositories/post-thread-repository.d.ts +6 -6
  234. package/lib/store/repositories/post-thread-repository.js +5 -2
  235. package/lib/store/repositories/post-thread-repository.js.map +1 -1
  236. package/lib/store/repositories/reaction-repository.d.ts +6 -6
  237. package/lib/store/repositories/reaction-repository.js +5 -2
  238. package/lib/store/repositories/reaction-repository.js.map +1 -1
  239. package/lib/streaming/block-chunker.d.ts +40 -0
  240. package/lib/streaming/block-chunker.js +103 -0
  241. package/lib/streaming/block-chunker.js.map +1 -0
  242. package/lib/streaming/block-chunker.test.d.ts +1 -0
  243. package/lib/streaming/index.d.ts +4 -0
  244. package/lib/streaming/stream-service.d.ts +71 -0
  245. package/lib/streaming/stream-service.js +325 -0
  246. package/lib/streaming/stream-service.js.map +1 -0
  247. package/lib/streaming/stream-service.test.d.ts +16 -0
  248. package/lib/streaming/streaming-post.integration.test.d.ts +10 -0
  249. package/lib/streaming/types.d.ts +33 -0
  250. package/lib/streaming/types.js +37 -0
  251. package/lib/streaming/types.js.map +1 -0
  252. package/lib/templates/constants/CONTRIBUTION_POINTS.ts.template +78 -0
  253. package/lib/templates/constants/SERVER_TYPES.ts.template +1 -4
  254. package/lib/templates/constants/WorkflowNamespace.ts.template +10 -0
  255. package/lib/templates/repositories/ChannelRepository.ts.template +3 -3
  256. package/lib/templates/repositories/PostRepository.ts.template +3 -3
  257. package/lib/templates/repositories/PostThreadRepository.ts.template +3 -3
  258. package/lib/templates/repositories/ReactionRepository.ts.template +3 -4
  259. package/lib/templates/services/ChannelService.ts.template +290 -39
  260. package/lib/templates/services/ExtendedTokenAccountService.ts.template +107 -3
  261. package/lib/templates/services/MessengerNotificationService.ts.template +94 -19
  262. package/lib/templates/services/MessengerStreamService.ts.template +131 -0
  263. package/lib/templates/services/PostService.ts.template +228 -20
  264. package/lib/templates/services/PostThreadService.ts.template +151 -6
  265. package/lib/templates/services/ReactionService.ts.template +129 -3
  266. package/lib/templates/services/RedisCacheManager.ts.template +22 -0
  267. package/package.json +10 -6
  268. package/lib/interfaces/context.d.ts +0 -14
  269. package/lib/plugins/channel-moleculer-service.d.ts +0 -8
  270. package/lib/plugins/channel-moleculer-service.js +0 -129
  271. package/lib/plugins/channel-moleculer-service.js.map +0 -1
  272. package/lib/plugins/extended-token-account-moleculer-service.d.ts +0 -8
  273. package/lib/plugins/extended-token-account-moleculer-service.js +0 -47
  274. package/lib/plugins/extended-token-account-moleculer-service.js.map +0 -1
  275. package/lib/plugins/messenger-notification-moleculer-service.d.ts +0 -9
  276. package/lib/plugins/messenger-notification-moleculer-service.js +0 -116
  277. package/lib/plugins/messenger-notification-moleculer-service.js.map +0 -1
  278. package/lib/plugins/post-moleculer-service.d.ts +0 -35
  279. package/lib/plugins/post-moleculer-service.js +0 -393
  280. package/lib/plugins/post-moleculer-service.js.map +0 -1
  281. package/lib/plugins/post-thread-moleculer-service.d.ts +0 -8
  282. package/lib/plugins/post-thread-moleculer-service.js +0 -33
  283. package/lib/plugins/post-thread-moleculer-service.js.map +0 -1
  284. package/lib/plugins/reaction-moleculer-service.d.ts +0 -8
  285. package/lib/plugins/reaction-moleculer-service.js +0 -20
  286. package/lib/plugins/reaction-moleculer-service.js.map +0 -1
  287. package/lib/services/proxy-services/channel-microservice.d.ts +0 -44
  288. package/lib/services/proxy-services/channel-microservice.js +0 -199
  289. package/lib/services/proxy-services/channel-microservice.js.map +0 -1
  290. package/lib/services/proxy-services/messenger-notification-microservice.d.ts +0 -16
  291. package/lib/services/proxy-services/messenger-notification-microservice.js +0 -54
  292. package/lib/services/proxy-services/messenger-notification-microservice.js.map +0 -1
  293. package/lib/services/proxy-services/post-microservice.d.ts +0 -22
  294. package/lib/services/proxy-services/post-microservice.js +0 -64
  295. package/lib/services/proxy-services/post-microservice.js.map +0 -1
  296. package/lib/services/proxy-services/post-thread-microservice.d.ts +0 -10
  297. package/lib/services/proxy-services/post-thread-microservice.js +0 -15
  298. package/lib/services/proxy-services/post-thread-microservice.js.map +0 -1
  299. package/lib/services/proxy-services/reaction-microservice.d.ts +0 -9
  300. package/lib/services/proxy-services/reaction-microservice.js +0 -10
  301. package/lib/services/proxy-services/reaction-microservice.js.map +0 -1
  302. package/lib/store/models/common-options.js +0 -20
  303. package/lib/store/models/common-options.js.map +0 -1
@@ -1,17 +1,15 @@
1
- import {__decorate,__param,__metadata}from'tslib';import'@cdm-logger/core';import {Connection}from'mongoose';import {MailTemplateId,MailServiceAction,MoleculerServiceName}from'common';import {injectable,inject,tagged}from'inversify';import {CommonType,TaggedType}from'@common-stack/core';import {ServiceBroker}from'moleculer';import {config}from'../config/env-config.js';var MessageNotificationTemplateMigration_1;
1
+ import {__decorate,__param,__metadata}from'tslib';import'@cdm-logger/core';import {Connection}from'mongoose';import {SERVER_TYPES,MailTemplateId}from'common/server';import {injectable,inject}from'inversify';import {config}from'../config/env-config.js';var MessageNotificationTemplateMigration_1;
2
2
  let MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_1 = class MessageNotificationTemplateMigration {
3
3
  logger;
4
4
  db;
5
- broker;
6
- settings;
5
+ mailerService;
7
6
  DEFAULT = 'default';
8
7
  VERSION = '20230719';
9
8
  name = MailTemplateId.MessageNotificationServiceId;
10
- constructor(logger, db, broker, settings) {
9
+ constructor(logger, db, mailerService) {
11
10
  this.logger = logger;
12
11
  this.db = db;
13
- this.broker = broker;
14
- this.settings = settings;
12
+ this.mailerService = mailerService;
15
13
  this.logger = logger.child({
16
14
  className: MessageNotificationTemplateMigration_1.name
17
15
  });
@@ -25,7 +23,6 @@ let MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_
25
23
  // }
26
24
  async up() {
27
25
  await this.down();
28
- // const name = MailTemplateId.MessageNotificationServiceId;
29
26
  const requestData = {
30
27
  engine: 'ejs',
31
28
  name: this.name,
@@ -33,31 +30,20 @@ let MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_
33
30
  namespace: config.NAMESPACE,
34
31
  version: this.VERSION,
35
32
  code: this.name,
36
- // templateId: name,
37
33
  description: 'Payment',
38
34
  html: '<%= text %>',
39
35
  text: '<%= text %>',
40
- // name,
41
36
  topic: '<%= subject %>'
42
37
  };
43
- if (config.isDev) {
44
- await this.broker.waitForServices('MailService');
45
- }
46
- return this.callAction(MailServiceAction.SaveTemplate, {
47
- request: requestData
48
- }, MoleculerServiceName.MailService);
38
+ await this.mailerService.createTemplate(requestData);
49
39
  }
50
40
  async down() {
51
- if (config.isDev) {
52
- await this.broker.waitForServices('MailService');
53
- }
54
41
  try {
55
- // const name = MailTemplateId.MessageNotificationServiceId;
56
42
  this.logger.trace(`Trying to down ${this.name}`);
57
- const droppedResponse = await this.callAction(MailServiceAction.DropTemplate, {
43
+ const droppedResponse = await this.mailerService.dropTemplate({
58
44
  name: this.name,
59
45
  namespace: config.NAMESPACE
60
- }, MoleculerServiceName.MailService);
46
+ });
61
47
  if (droppedResponse) {
62
48
  this.logger.info(`${this.name} dropped!`);
63
49
  } else {
@@ -67,11 +53,8 @@ let MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_
67
53
  this.logger.error(e.message, e.stack);
68
54
  }
69
55
  }
70
- async callAction(command, params, topic, opts) {
71
- return this.broker.call(`${topic}.${command}@${this.settings.adminApiNamespace}`, params, opts);
72
- }
73
56
  };
74
- MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_1 = __decorate([injectable(), __param(0, inject('Logger')), __param(1, inject('MongoDBConnection')), __param(2, inject(CommonType.MOLECULER_BROKER)), __param(3, inject('Settings')), __param(3, tagged(TaggedType.MICROSERVICE, true)), __metadata("design:paramtypes", [Object, Connection, ServiceBroker, Object])], MessageNotificationTemplateMigration);
57
+ MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_1 = __decorate([injectable(), __param(0, inject('Logger')), __param(1, inject('MongoDBConnection')), __param(2, inject(SERVER_TYPES.MailerService)), __metadata("design:paramtypes", [Object, Connection, Object])], MessageNotificationTemplateMigration);
75
58
  // import { MailTemplateMigration } from './mail-template-migration';
76
59
  // const template = require('./mail-templates/alert-post-notification-template.ejs');
77
60
  // export class MessageNotificationTemplateMigration extends MailTemplateMigration {
@@ -1 +1 @@
1
- {"version":3,"file":"message-notification-template-migration.js","sources":["../../src/migrations/message-notification-template-migration.ts"],"sourcesContent":[null],"names":[],"mappings":";AAWa,IAAA,oCAAoC,GAA1C,sCAAA,GAAA,MAAM,oCAAoC,CAAA;AAMf,EAAA,MAAA;AACW,EAAA,EAAA;AAE3B,EAAA,MAAA;AAGF,EAAA,QAAA;SAXK,GAAA;SACA,GAAA;AACP,EAAA,IAAA,GAAO,cAAA,CAAA,4BAAe;AAEhC,EAAA,WAAA,CAAA,QACuD,EACd,EAAc,MAEzC,EAAqB,Q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,CAAA;;yBAEH,EAAA;mBAAO,CAAA,IAAA,CAAA,CAAA,EAAA,IAAA,CAAA,IAAA,CAAA,SAAA,CAAA,CAAA;;YAER,CAAC,MAAA,CAAA,KAAA,CAAA,CAAA,EAAA,IAAA,CAAA,IAAA,CAAA,6BAAA,CAAA,CAAA;;aACH,CAAA,EAAQ;AACN,MAAA,IAAA,CAAA,MAAK,CAAA,KAAM,CAAC,CAAA,CAAA,OAAQ,EAAA,CAAA,CAAA,KAAU,CAAC;;;;AAtD9B,oCAAoC,GAAA,sCAAA,GAAA,UAAA,CAAA,CAAA,UAAA,EAAA,EAAA,OAAA,CAAA,CAAA,EAAA,MAAA,CAAA,QAAA,CAAA,CAAA,EAAA,OAAA,CAAA,CAAA,EAAA,MAAA,CAAA,mBAAA,CAAA,CAAA,EAAA,OAAA,CAAA,CAAA,EAAA,MAAA,CAAA,YAAA,CAAA,aAAA,CAAA,CAAA,EAAA,UAAA,CAAA,mBAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,MAAA,CAAA,CAAA,CAAA,EAAA,oCAAA,CAAA;AAMxC;AACA;AACA;;AARI;;AA2Db;AAEA;AAEA;AACA;AAEA;AAEA;AAEA;"}
package/lib/module.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { Feature } from '@common-stack/server-core';
2
- declare const _default: Feature<import("common").ConfigurationScope, any>;
2
+ declare const _default: Feature<any, any>;
3
3
  export default _default;
package/lib/module.js CHANGED
@@ -1,15 +1,8 @@
1
- import {Feature}from'@common-stack/server-core';import {schema}from'./graphql/schema/index.js';import {messengerResolvers}from'./graphql/resolvers/index.js';import {proxyServiceContainerModule,serviceContainerModule}from'./containers/containers.js';import {contextServicesFromContainer}from'./containers/context-services-from-container.js';import {ChannelMoleculerService}from'./plugins/channel-moleculer-service.js';import {PostMoleculerService}from'./plugins/post-moleculer-service.js';import {PostThreadMoleculerService}from'./plugins/post-thread-moleculer-service.js';import {ReactionMoleculerService}from'./plugins/reaction-moleculer-service.js';import {ExtendedTokenAccountMoleculerService}from'./plugins/extended-token-account-moleculer-service.js';import {MessengerNotificationMoleculerService}from'./plugins/messenger-notification-moleculer-service.js';import'./preferences/settings/post-settings.js';import {InboxRolesContribution}from'./preferences/permissions/inbox-permission-contribution.js';import {InboxRolesPermissionOverwrite}from'./preferences/permissions/inbox-roles-permission-overwrite.js';var MessengerModule = new Feature({
1
+ import {Feature}from'@common-stack/server-core';import {schema}from'./graphql/schema/index.js';import {messengerResolvers}from'./graphql/resolvers/index.js';import {serviceContainerModule,proxyServiceContainerModule}from'./containers/containers.js';import {contextServicesFromContainer}from'./containers/context-services-from-container.js';import {ChannelMoleculerService}from'./plugins/ChannelMoleculerService.js';import {PostMoleculerService}from'./plugins/PostMoleculerService.js';import {PostThreadMoleculerService}from'./plugins/PostThreadMoleculerService.js';import {ReactionMoleculerService}from'./plugins/ReactionMoleculerService.js';import {MessengerNotificationMoleculerService}from'./plugins/MessengerNotificationMoleculerService.js';import {ExtendedTokenAccountMoleculerService}from'./plugins/ExtendedTokenAccountMoleculerService.js';var MessengerModule = new Feature({
2
2
  schema,
3
3
  createContainerFunc: [proxyServiceContainerModule],
4
- createHemeraContainerFunc: [serviceContainerModule],
4
+ createMicroServiceContainerFunc: [serviceContainerModule],
5
5
  createResolversFunc: messengerResolvers,
6
6
  createServiceFunc: contextServicesFromContainer,
7
- addPermissions: {
8
- createPermissions: [InboxRolesContribution]
9
- },
10
- rolesUpdate: {
11
- overwriteRolesPermissions: InboxRolesPermissionOverwrite
12
- },
13
- addBrokerClientServiceClass: [ChannelMoleculerService, PostMoleculerService, PostThreadMoleculerService, ReactionMoleculerService, MessengerNotificationMoleculerService, ExtendedTokenAccountMoleculerService],
14
- addBrokerMainServiceClass: []
7
+ addMicroserviceBrokerServiceClass: [ChannelMoleculerService, PostMoleculerService, PostThreadMoleculerService, ReactionMoleculerService, MessengerNotificationMoleculerService, ExtendedTokenAccountMoleculerService]
15
8
  });export{MessengerModule as default};//# sourceMappingURL=module.js.map
package/lib/module.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":[null],"names":[],"mappings":"wlCAaA,sBAAe,IAAI,OAAO,CAAC;QACjB;qBACa,EAAA,CAAA,2BAAG,CAAA;2BACG,EAAA,CAAA,sBAAG,CAAA;AAC5B,EAAA,mBAAA,EAAmB,kBAAoB;AACvC,EAAA,iBAAA,EAAiB,4BAA8B;AAC/C,EAAA,cAAA,EAAc;qBACO,EAAA,CAAA,sBAAG;AACvB,GAAA;AACD,EAAA,WAAA,EAAW;AACP,IAAA,yBAAA,EAAA;AACH,GAAA;AACD,EAAA,2BAAA,EAA2B,CAAE,uBAAA,EAAA,oBAAA,EAAA,0BAAA,EAAA,wBAAA,EAAA,qCAAA,EAAA,oCAAA,CAAA;2BACF,EAAA;"}
1
+ {"version":3,"file":"module.js","sources":["../src/module.ts"],"sourcesContent":[null],"names":[],"mappings":"80BAYA,sBAAe,IAAI,OAAO,CAAC;QACvB;qBACA,EAAmB,CAAA,2BAAG,CAAA;iCACtB,EAA+B,CAAA,sBAAG,CAAA;AAClC,EAAA,mBAAA,EAAmB,kBAAE;AACrB,EAAA,iBAAA,EAAiB,4BAAE;AACnB,EAAA,iCAAA,EAAiC,CAAA,uBAAE,EAAA,oBAAA,EAAA,0BAAA,EAAA,wBAAA,EAAA,qCAAA,EAAA,oCAAA;"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Channel Moleculer Service
3
+ * -------------------------
4
+ *
5
+ * This Moleculer service provides comprehensive channel management capabilities
6
+ * within the messenger platform ecosystem. It acts as a distributed service layer
7
+ * for handling channel lifecycle operations, member management, and cross-service
8
+ * communication.
9
+ *
10
+ * Key capabilities:
11
+ * - Channel lifecycle management (creation, updates, deletion)
12
+ * - Member management and permissions
13
+ * - Direct and group channel operations
14
+ * - Channel statistics and counting
15
+ * - Event-driven architecture with auto-generated event handlers
16
+ * - Distributed service communication via Moleculer
17
+ * - Comprehensive error handling and logging
18
+ *
19
+ * Pattern: Uses Pattern 1 Auto-Generation
20
+ * - Actions: Auto-generated from IChannelService using Moleculer.generateActionsAndEvents()
21
+ * - Events: Auto-detected from @Moleculer.EventHandler() decorated methods in ChannelService
22
+ * - Validation: Zod schemas from ChannelServiceSchemas
23
+ */
24
+ import { Service, ServiceBroker } from 'moleculer';
25
+ import { Container } from 'inversify';
26
+ /**
27
+ * ChannelMoleculerService Class
28
+ *
29
+ * Comprehensive Moleculer service for distributed channel management operations.
30
+ * Provides event-driven architecture, real-time communication, and seamless
31
+ * integration with other platform services.
32
+ */
33
+ export declare class ChannelMoleculerService extends Service {
34
+ private readonly channelService;
35
+ private readonly container;
36
+ constructor(broker: ServiceBroker, { container }: {
37
+ container: Container;
38
+ });
39
+ }
@@ -0,0 +1,58 @@
1
+ import {Service}from'moleculer';import {Moleculer,zodSchemasToMoleculer}from'@common-stack/codegen-zod';import {ChannelServiceSchemas,SERVER_TYPES}from'common/server';import {logger}from'@common-stack/server-core';/**
2
+ * Channel Moleculer Service
3
+ * -------------------------
4
+ *
5
+ * This Moleculer service provides comprehensive channel management capabilities
6
+ * within the messenger platform ecosystem. It acts as a distributed service layer
7
+ * for handling channel lifecycle operations, member management, and cross-service
8
+ * communication.
9
+ *
10
+ * Key capabilities:
11
+ * - Channel lifecycle management (creation, updates, deletion)
12
+ * - Member management and permissions
13
+ * - Direct and group channel operations
14
+ * - Channel statistics and counting
15
+ * - Event-driven architecture with auto-generated event handlers
16
+ * - Distributed service communication via Moleculer
17
+ * - Comprehensive error handling and logging
18
+ *
19
+ * Pattern: Uses Pattern 1 Auto-Generation
20
+ * - Actions: Auto-generated from IChannelService using Moleculer.generateActionsAndEvents()
21
+ * - Events: Auto-detected from @Moleculer.EventHandler() decorated methods in ChannelService
22
+ * - Validation: Zod schemas from ChannelServiceSchemas
23
+ */
24
+ /**
25
+ * ChannelMoleculerService Class
26
+ *
27
+ * Comprehensive Moleculer service for distributed channel management operations.
28
+ * Provides event-driven architecture, real-time communication, and seamless
29
+ * integration with other platform services.
30
+ */
31
+ class ChannelMoleculerService extends Service {
32
+ channelService;
33
+ container;
34
+ constructor(broker, {
35
+ container
36
+ }) {
37
+ super(broker);
38
+ this.container = container;
39
+ const {
40
+ topic
41
+ } = ChannelServiceSchemas;
42
+ this.channelService = container.get(SERVER_TYPES.ChannelService);
43
+ logger.info(`Initializing ChannelMoleculerService with topic: ${topic}`);
44
+ // Auto-generate actions and events from service interface
45
+ const {
46
+ actions,
47
+ events
48
+ } = Moleculer.generateActionsAndEvents(this.channelService, {
49
+ paramOverrides: zodSchemasToMoleculer(ChannelServiceSchemas)
50
+ });
51
+ this.parseServiceSchema({
52
+ name: topic,
53
+ actions,
54
+ events
55
+ });
56
+ logger.info(`ChannelMoleculerService initialized successfully with topic: ${topic}`);
57
+ }
58
+ }export{ChannelMoleculerService};//# sourceMappingURL=ChannelMoleculerService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelMoleculerService.js","sources":["../../src/plugins/ChannelMoleculerService.ts"],"sourcesContent":[null],"names":[],"mappings":"sNAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAQH;;;;;;AAMG;AACG,MAAO,uBAAwB,SAAQ,OAAO,CAAA;AAC/B,EAAA,cAAA;AACA,EAAA,SAAA;AAEjB,EAAA,WAAA,CAAA,MAAY,EAAqB;;AAE7B,GAAA,EAAA;AACA,IAAA,KAAA,CAAA,MAAQ,CAAA;QACR,CAAA,SAAK,GAAA,SAAiB;AAEtB,IAAA,MAAA;;AAGA,KAAA,GAAA,qBAAiB;AACb,IAAA,IAAA,CAAA,cAAA,GAAc,SAAE,CAAA,GAAA,CAAA,YAAsB,CAAA,cAAA,CAAA;AACzC,IAAA,MAAC,CAAC,IAAA,CAAA,CAAA,iDAAA,EAAA,KAAA,CAAA,CAAA,CAAA;;AAGC,IAAA,MAAA;aACA;;AAEH,KAAA,GAAA,SAAE,CAAA,wBAAA,CAAA,IAAA,CAAA,cAAA,EAAA;AAEH,MAAA,cAAY;KACf,CAAA;AACJ,IAAA,IAAA,CAAA,kBAAA,CAAA;;;;;;;"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Extended Token Account Moleculer Service - Pattern 1 Auto-Generation
3
+ * =====================================================================
4
+ *
5
+ * This Moleculer service provides a comprehensive microservice interface for device token
6
+ * management and account operations within the messenger platform using PURE AUTO-GENERATION.
7
+ *
8
+ * 🎉 FULLY AUTOMATIC: Zero boilerplate, all actions/events auto-generated!
9
+ *
10
+ * ✅ NO MIXINS: Pure auto-generation without ApolloClientMixin
11
+ * ✅ NO SETTINGS: No configuration dependencies
12
+ * ✅ TYPE-SAFE: Full TypeScript inference from IExtendedTokenAccountService
13
+ * ✅ VALIDATED: Zod schemas for all parameters
14
+ * ✅ EVENT-DRIVEN: Auto-detects @Moleculer.EventHandler() from ExtendedTokenAccountService
15
+ *
16
+ * Key capabilities:
17
+ * - User session lifecycle management (login, logout, initialization)
18
+ * - Device token registration and cleanup
19
+ * - Expo notification token management
20
+ * - Auth0 integration and user lookup
21
+ * - Cross-service communication and event handling
22
+ * - Bulk token operations and cleanup
23
+ * - Error handling and recovery mechanisms
24
+ * - Performance monitoring and logging
25
+ *
26
+ * Pattern:
27
+ * - Uses Moleculer.generateActionsAndEvents() from @common-stack/codegen-zod
28
+ * - All IExtendedTokenAccountService methods automatically converted to Moleculer actions
29
+ * - All @Moleculer.EventHandler() decorated methods in ExtendedTokenAccountService automatically registered as events
30
+ * - Parameters validated using ExtendedTokenAccountServiceSchemas
31
+ * - Topic automatically extracted from schemas
32
+ *
33
+ * Events handled (auto-detected from ExtendedTokenAccountService):
34
+ * - OnUserSessionRevoked: Cleans up all device tokens when a user logs out
35
+ * - OnUserSessionInitialized: Processes new user sessions and prepares token management
36
+ * - device.token.register: Processes device token registration from mobile apps
37
+ * - tokens.bulk.cleanup: Processes bulk token cleanup operations
38
+ *
39
+ * @see ExtendedTokenAccountService for actual implementation and event handlers
40
+ * @see ExtendedTokenAccountProxyService for client-side proxy
41
+ */
42
+ import { Service, ServiceBroker } from 'moleculer';
43
+ import { Container } from 'inversify';
44
+ /**
45
+ * ExtendedTokenAccountMoleculerService Class
46
+ *
47
+ * Pure Pattern 1 auto-generation Moleculer service.
48
+ * Zero manual action/event definitions - everything is auto-generated.
49
+ */
50
+ export declare class ExtendedTokenAccountMoleculerService extends Service {
51
+ private readonly extendedTokenAccountService;
52
+ constructor(broker: ServiceBroker, { container }: {
53
+ container: Container;
54
+ });
55
+ /**
56
+ * Service started lifecycle hook
57
+ * Initializes any service-specific resources
58
+ */
59
+ started(): Promise<void>;
60
+ /**
61
+ * Service stopped lifecycle hook
62
+ * Cleanup any service-specific resources
63
+ */
64
+ stopped(): Promise<void>;
65
+ }
@@ -0,0 +1,88 @@
1
+ import {Service}from'moleculer';import {Moleculer,zodSchemasToMoleculer}from'@common-stack/codegen-zod';import {ExtendedTokenAccountServiceSchemas,SERVER_TYPES,AccountServiceSchemas}from'common/server';import {logger}from'@common-stack/server-core';/**
2
+ * Extended Token Account Moleculer Service - Pattern 1 Auto-Generation
3
+ * =====================================================================
4
+ *
5
+ * This Moleculer service provides a comprehensive microservice interface for device token
6
+ * management and account operations within the messenger platform using PURE AUTO-GENERATION.
7
+ *
8
+ * 🎉 FULLY AUTOMATIC: Zero boilerplate, all actions/events auto-generated!
9
+ *
10
+ * ✅ NO MIXINS: Pure auto-generation without ApolloClientMixin
11
+ * ✅ NO SETTINGS: No configuration dependencies
12
+ * ✅ TYPE-SAFE: Full TypeScript inference from IExtendedTokenAccountService
13
+ * ✅ VALIDATED: Zod schemas for all parameters
14
+ * ✅ EVENT-DRIVEN: Auto-detects @Moleculer.EventHandler() from ExtendedTokenAccountService
15
+ *
16
+ * Key capabilities:
17
+ * - User session lifecycle management (login, logout, initialization)
18
+ * - Device token registration and cleanup
19
+ * - Expo notification token management
20
+ * - Auth0 integration and user lookup
21
+ * - Cross-service communication and event handling
22
+ * - Bulk token operations and cleanup
23
+ * - Error handling and recovery mechanisms
24
+ * - Performance monitoring and logging
25
+ *
26
+ * Pattern:
27
+ * - Uses Moleculer.generateActionsAndEvents() from @common-stack/codegen-zod
28
+ * - All IExtendedTokenAccountService methods automatically converted to Moleculer actions
29
+ * - All @Moleculer.EventHandler() decorated methods in ExtendedTokenAccountService automatically registered as events
30
+ * - Parameters validated using ExtendedTokenAccountServiceSchemas
31
+ * - Topic automatically extracted from schemas
32
+ *
33
+ * Events handled (auto-detected from ExtendedTokenAccountService):
34
+ * - OnUserSessionRevoked: Cleans up all device tokens when a user logs out
35
+ * - OnUserSessionInitialized: Processes new user sessions and prepares token management
36
+ * - device.token.register: Processes device token registration from mobile apps
37
+ * - tokens.bulk.cleanup: Processes bulk token cleanup operations
38
+ *
39
+ * @see ExtendedTokenAccountService for actual implementation and event handlers
40
+ * @see ExtendedTokenAccountProxyService for client-side proxy
41
+ */
42
+ const {
43
+ topic
44
+ } = ExtendedTokenAccountServiceSchemas;
45
+ /**
46
+ * ExtendedTokenAccountMoleculerService Class
47
+ *
48
+ * Pure Pattern 1 auto-generation Moleculer service.
49
+ * Zero manual action/event definitions - everything is auto-generated.
50
+ */
51
+ class ExtendedTokenAccountMoleculerService extends Service {
52
+ extendedTokenAccountService;
53
+ constructor(broker, {
54
+ container
55
+ }) {
56
+ super(broker);
57
+ logger.info(`Initializing ExtendedTokenAccountMoleculerService with topic: ${topic}`);
58
+ this.extendedTokenAccountService = container.get(SERVER_TYPES.ExtendedTokenAccountService);
59
+ // ⚡ PURE AUTO-GENERATION: One call generates ALL actions and events
60
+ const {
61
+ actions,
62
+ events
63
+ } = Moleculer.generateActionsAndEvents(this.extendedTokenAccountService, {
64
+ paramOverrides: zodSchemasToMoleculer(ExtendedTokenAccountServiceSchemas)
65
+ });
66
+ this.parseServiceSchema({
67
+ name: topic,
68
+ dependencies: [AccountServiceSchemas.topic],
69
+ actions,
70
+ events
71
+ });
72
+ logger.info(`ExtendedTokenAccountMoleculerService initialized with ${Object.keys(actions).length} actions and ${Object.keys(events).length} events`);
73
+ }
74
+ /**
75
+ * Service started lifecycle hook
76
+ * Initializes any service-specific resources
77
+ */
78
+ async started() {
79
+ logger.info(`ExtendedTokenAccountMoleculerService (${topic}) started successfully`);
80
+ }
81
+ /**
82
+ * Service stopped lifecycle hook
83
+ * Cleanup any service-specific resources
84
+ */
85
+ async stopped() {
86
+ logger.info(`ExtendedTokenAccountMoleculerService (${topic}) stopped`);
87
+ }
88
+ }export{ExtendedTokenAccountMoleculerService};//# sourceMappingURL=ExtendedTokenAccountMoleculerService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtendedTokenAccountMoleculerService.js","sources":["../../src/plugins/ExtendedTokenAccountMoleculerService.ts"],"sourcesContent":[null],"names":[],"mappings":"yPAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;AAaH,MAAM;AAEN,EAAA;;;;;AAKG;AACH;AACqB;AAEjB,MAAA,oCAA0E,SAAA,OAAA,CAAA;6BACxD;AAEd,EAAA,WAAA,CAAM,MAAM;;;AAOZ,IAAA,KAAA,CAAA,MAAQ,CAAA;AAGA,IAAA,MAAA,CAAA,IAAA,CAAA,CAAA,8DAAsC,EAAA,KAAmC,CAAA,CAAA,CAAA;AAC5E,IAAA,IAAA,CAAA,2BACH,GAAA,SAAA,CAAA,GAAA,CAAA,YAAA,CAAA,2BAAA,CAAA;;AAGE,IAAA,MAAA;AACA,MAAA,OAAA;;iBAEA,CAAM,wBAAA,CAAA,IAAA,CAAA,2BAAA,EAAA;AACT,MAAA,cAAE,EAAA,qBAAA,CAAA,kCAAA;;IAOP,IAAC,CAAA,kBAAA,CAAA;AAED,MAAA,IAAA,EAAA,KAAA;;;AAGG,MAAA;AACH,KAAA,CAAA;AACI,IAAA,MAAA,CAAA,IAAO,CAAA,CAAA,sDAAmD,EAAA,MAAA,CAAA,IAAA,CAAA,OAA0B,CAAA,CAAA,MAAA,CAAA,aAAA,EAAA,MAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA;;AAGxF;;;AAGG;AACH,EAAA,MAAA,OAAM,GAAO;AACT,IAAA,MAAA,CAAA,IAAO,CAAA,CAAA,6CAA8C,CAAA,sBAAkB,CAAA,CAAA;;AAE9E;;;;;;;"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Messenger Notification Moleculer Service - Pattern 1 Auto-Generation
3
+ * =====================================================================
4
+ *
5
+ * This Moleculer service provides comprehensive notification management capabilities
6
+ * within the messenger platform ecosystem using PURE AUTO-GENERATION.
7
+ *
8
+ * 🎉 FULLY AUTOMATIC: Zero boilerplate, all actions/events auto-generated!
9
+ *
10
+ * ✅ TYPE-SAFE: Full TypeScript inference from IMessengerNotificationService
11
+ * ✅ VALIDATED: Zod schemas for all parameters
12
+ * ✅ EVENT-DRIVEN: Auto-detects @Moleculer.EventHandler() from MessengerNotificationService
13
+ *
14
+ * Key capabilities:
15
+ * - Multi-channel notification delivery (email, SMS, push, Expo)
16
+ * - Unread message notification scheduling and management
17
+ * - Post-based notification triggering and routing
18
+ * - Alert message notification broadcasting
19
+ * - Support service notification handling
20
+ * - Cross-service communication and event handling
21
+ * - Template-based notification customization
22
+ * - User preference-based notification filtering
23
+ * - Comprehensive error handling and monitoring
24
+ *
25
+ * Pattern:
26
+ * - Uses Moleculer.generateActionsAndEvents() from @common-stack/codegen-zod
27
+ * - All IMessengerNotificationService methods automatically converted to Moleculer actions
28
+ * - All @Moleculer.EventHandler() decorated methods in MessengerNotificationService automatically registered as events
29
+ * - Parameters validated using MessengerNotificationServiceSchemas
30
+ * - Topic automatically extracted from schemas
31
+ *
32
+ * @see MessengerNotificationService for actual implementation and event handlers
33
+ * @see MessengerNotificationProxyService for client-side proxy
34
+ */
35
+ import { Service, ServiceBroker } from 'moleculer';
36
+ import { Container } from 'inversify';
37
+ export declare class MessengerNotificationMoleculerService extends Service {
38
+ private readonly messengerNotificationService;
39
+ constructor(broker: ServiceBroker, { container }: {
40
+ container: Container;
41
+ });
42
+ /**
43
+ * Service started lifecycle hook
44
+ * Initializes notification service resources
45
+ */
46
+ started(): Promise<void>;
47
+ /**
48
+ * Service stopped lifecycle hook
49
+ * Cleanup notification service resources
50
+ */
51
+ stopped(): Promise<void>;
52
+ }
@@ -0,0 +1,84 @@
1
+ import {Service}from'moleculer';import {Moleculer}from'@common-stack/codegen-zod';import {SERVER_TYPES}from'common/server';import {logger}from'@common-stack/server-core';/**
2
+ * Messenger Notification Moleculer Service - Pattern 1 Auto-Generation
3
+ * =====================================================================
4
+ *
5
+ * This Moleculer service provides comprehensive notification management capabilities
6
+ * within the messenger platform ecosystem using PURE AUTO-GENERATION.
7
+ *
8
+ * 🎉 FULLY AUTOMATIC: Zero boilerplate, all actions/events auto-generated!
9
+ *
10
+ * ✅ TYPE-SAFE: Full TypeScript inference from IMessengerNotificationService
11
+ * ✅ VALIDATED: Zod schemas for all parameters
12
+ * ✅ EVENT-DRIVEN: Auto-detects @Moleculer.EventHandler() from MessengerNotificationService
13
+ *
14
+ * Key capabilities:
15
+ * - Multi-channel notification delivery (email, SMS, push, Expo)
16
+ * - Unread message notification scheduling and management
17
+ * - Post-based notification triggering and routing
18
+ * - Alert message notification broadcasting
19
+ * - Support service notification handling
20
+ * - Cross-service communication and event handling
21
+ * - Template-based notification customization
22
+ * - User preference-based notification filtering
23
+ * - Comprehensive error handling and monitoring
24
+ *
25
+ * Pattern:
26
+ * - Uses Moleculer.generateActionsAndEvents() from @common-stack/codegen-zod
27
+ * - All IMessengerNotificationService methods automatically converted to Moleculer actions
28
+ * - All @Moleculer.EventHandler() decorated methods in MessengerNotificationService automatically registered as events
29
+ * - Parameters validated using MessengerNotificationServiceSchemas
30
+ * - Topic automatically extracted from schemas
31
+ *
32
+ * @see MessengerNotificationService for actual implementation and event handlers
33
+ * @see MessengerNotificationProxyService for client-side proxy
34
+ */
35
+ /**
36
+ * MessengerNotificationMoleculerService Class
37
+ *
38
+ * Comprehensive Moleculer service for distributed notification management operations.
39
+ * Provides event-driven architecture, real-time communication, and seamless
40
+ * integration with other platform services.
41
+ *
42
+ * NOTE: Topic follows convention: IMessengerNotificationService → MessengerNotificationService
43
+ */
44
+ const topic = 'MessengerNotificationService';
45
+ class MessengerNotificationMoleculerService extends Service {
46
+ messengerNotificationService;
47
+ constructor(broker, {
48
+ container
49
+ }) {
50
+ super(broker);
51
+ logger.info(`Initializing MessengerNotificationMoleculerService with topic: ${topic}`);
52
+ this.messengerNotificationService = container.get(SERVER_TYPES.MessengerNotificationService);
53
+ // ⚡ PURE AUTO-GENERATION: One call generates ALL actions and events
54
+ const {
55
+ actions,
56
+ events
57
+ } = Moleculer.generateActionsAndEvents(this.messengerNotificationService);
58
+ this.parseServiceSchema({
59
+ name: topic,
60
+ actions,
61
+ events
62
+ });
63
+ logger.info(`MessengerNotificationMoleculerService initialized with ${Object.keys(actions).length} actions and ${Object.keys(events).length} events`);
64
+ }
65
+ /**
66
+ * Service started lifecycle hook
67
+ * Initializes notification service resources
68
+ */
69
+ async started() {
70
+ logger.info(`MessengerNotificationMoleculerService (${topic}) started successfully`);
71
+ // Emit service ready event
72
+ this.broker.emit('service.notification.ready', {
73
+ serviceName: topic,
74
+ timestamp: new Date()
75
+ });
76
+ }
77
+ /**
78
+ * Service stopped lifecycle hook
79
+ * Cleanup notification service resources
80
+ */
81
+ async stopped() {
82
+ logger.info(`MessengerNotificationMoleculerService (${topic}) stopped`);
83
+ }
84
+ }export{MessengerNotificationMoleculerService};//# sourceMappingURL=MessengerNotificationMoleculerService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessengerNotificationMoleculerService.js","sources":["../../src/plugins/MessengerNotificationMoleculerService.ts"],"sourcesContent":[null],"names":[],"mappings":"0KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;AAQH;;;;;;;;AAQG;AACH,MAAM,KAAK,GAAG,8BAAuC;AAE/C,MAAO,qCAAsC,SAAQ,OAAO,CAAA;AAC7C,EAAA,4BAAA;AAEjB,EAAA,WAAA,CAAA,MAAY,EAAqB;;AAG7B,GAAA,EAAA;SAEA,CAAA,MAAK,CAAA;UAIL,CAAA,IAAA,CAAA,CAAA,+DAAoE,EAAA,KAAA,CAAA,CAAA,CAAA;AACpE,IAAA,IAAA,CAAA,4BAA4B,GAAA,SAAU,CAAA,GAAA,CAAA,YAAA,CAAA,4BAC7B,CAAA;;AAIL,IAAA,MAAA;aACA;;AAEH,KAAA,GAAA,SAAE,CAAA,wBAAA,CAAA,IAAA,CAAA,4BAAA,CAAA;QAEH,CAAA,kBACI,CAAA;MAIP,IAAA,EAAA,KAAA;AAED,MAAA,OAAA;;;AAGG,IAAA,MAAA,CAAA,IAAA,CAAA,CAAA,uDAAA,EAAA,MAAA,CAAA,IAAA,CAAA,OAAA,CAAA,CAAA,MAAA,CAAA,aAAA,EAAA,MAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA;AACH,EAAA;AACI;;AAGA;AACI;eACA,GAAA;AACH,IAAA,MAAC,CAAC,IAAA,CAAA,CAAA,uCAAA,EAAA,KAAA,CAAA,sBAAA,CAAA,CAAA;;AAGP,IAAA,IAAA,CAAA,MAAA,CAAA,IAAA,CAAA,4BAAA,EAAA;;;AAGG,KAAA,CAAA;AACH,EAAA;AACI;;AAEP;;;;;"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Post Moleculer Service - Pattern 1 Auto-Generation
3
+ * ===================================================
4
+ *
5
+ * This Moleculer service provides comprehensive post management capabilities within
6
+ * the messenger platform ecosystem using PURE AUTO-GENERATION.
7
+ *
8
+ * 🎉 FULLY AUTOMATIC: Zero boilerplate, all actions/events auto-generated!
9
+ *
10
+ * ✅ NO MIXINS: Pure auto-generation without ApolloClientMixin
11
+ * ✅ NO SETTINGS: No configuration dependencies
12
+ * ✅ TYPE-SAFE: Full TypeScript inference from IPostService
13
+ * ✅ VALIDATED: Zod schemas for all parameters
14
+ * ✅ EVENT-DRIVEN: Auto-detects @Moleculer.EventHandler() from PostService
15
+ *
16
+ * Key capabilities:
17
+ * - Post lifecycle management with threading support
18
+ * - File attachment and upload link generation
19
+ * - Real-time message delivery and read receipts
20
+ * - Post thread creation and management
21
+ * - Channel integration and message counting
22
+ * - Event-driven architecture for real-time updates
23
+ * - Distributed service communication via Moleculer
24
+ * - Code agent result persistence and sandbox file management
25
+ *
26
+ * Pattern:
27
+ * - Uses Moleculer.generateActionsAndEvents() from @common-stack/codegen-zod
28
+ * - All IPostService methods automatically converted to Moleculer actions
29
+ * - All @Moleculer.EventHandler() decorated methods in PostService automatically registered as events
30
+ * - Parameters validated using PostServiceSchemas
31
+ * - Topic automatically extracted from schemas
32
+ *
33
+ * Events handled (auto-detected from PostService):
34
+ * - post-thread.created: Publishes real-time updates when post threads are created
35
+ * - post-thread.updated: Updates thread participants and publishes updates
36
+ * - post.created: Triggers channel updates on post creation
37
+ * - post.bulk.process: Processes multiple posts in batch operations
38
+ *
39
+ * @see PostService for actual implementation and event handlers
40
+ * @see PostProxyService for client-side proxy
41
+ */
42
+ import { Service, ServiceBroker } from 'moleculer';
43
+ import { Container } from 'inversify';
44
+ /**
45
+ * PostMoleculerService Class
46
+ *
47
+ * Pure Pattern 1 auto-generation Moleculer service.
48
+ * Zero manual action/event definitions - everything is auto-generated.
49
+ */
50
+ export declare class PostMoleculerService extends Service {
51
+ private readonly postService;
52
+ constructor(broker: ServiceBroker, { container }: {
53
+ container: Container;
54
+ });
55
+ /**
56
+ * Service started lifecycle hook
57
+ * Initializes any service-specific resources
58
+ */
59
+ started(): Promise<void>;
60
+ /**
61
+ * Service stopped lifecycle hook
62
+ * Cleanup any service-specific resources
63
+ */
64
+ stopped(): Promise<void>;
65
+ }