@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.
- package/lib/channels/ack-reactions.d.ts +46 -0
- package/lib/channels/ack-reactions.js +48 -0
- package/lib/channels/ack-reactions.js.map +1 -0
- package/lib/channels/allowlist-match.d.ts +38 -0
- package/lib/channels/allowlist-match.js +67 -0
- package/lib/channels/allowlist-match.js.map +1 -0
- package/lib/channels/channel-config.d.ts +46 -0
- package/lib/channels/channel-config.js +63 -0
- package/lib/channels/channel-config.js.map +1 -0
- package/lib/channels/command-gating.d.ts +47 -0
- package/lib/channels/command-gating.js +52 -0
- package/lib/channels/command-gating.js.map +1 -0
- package/lib/channels/conversation-label.d.ts +23 -0
- package/lib/channels/conversation-label.js +43 -0
- package/lib/channels/conversation-label.js.map +1 -0
- package/lib/channels/index.d.ts +18 -0
- package/lib/channels/mention-gating.d.ts +50 -0
- package/lib/channels/mention-gating.js +72 -0
- package/lib/channels/mention-gating.js.map +1 -0
- package/lib/channels/registry.d.ts +23 -0
- package/lib/channels/registry.js +282 -0
- package/lib/channels/registry.js.map +1 -0
- package/lib/channels/sender-identity.d.ts +11 -0
- package/lib/channels/sender-identity.js +48 -0
- package/lib/channels/sender-identity.js.map +1 -0
- package/lib/channels/session.d.ts +63 -0
- package/lib/channels/session.js +29 -0
- package/lib/channels/session.js.map +1 -0
- package/lib/channels/types.d.ts +147 -0
- package/lib/channels/types.js +28 -0
- package/lib/channels/types.js.map +1 -0
- package/lib/channels/typing.d.ts +62 -0
- package/lib/channels/typing.js +37 -0
- package/lib/channels/typing.js.map +1 -0
- package/lib/channels/typing.test.d.ts +1 -0
- package/lib/config/env-config.d.ts +7 -0
- package/lib/config/env-config.js +21 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/constants/default-channel-props.d.ts +11 -0
- package/lib/constants/default-channel-props.js +32 -0
- package/lib/constants/default-channel-props.js.map +1 -0
- package/lib/constants/default-notify-props.js.map +1 -1
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/query.constants.js.map +1 -1
- package/lib/containers/containers.js +13 -7
- package/lib/containers/containers.js.map +1 -1
- package/lib/containers/context-services-from-container.d.ts +2 -2
- package/lib/containers/context-services-from-container.js +7 -7
- package/lib/containers/context-services-from-container.js.map +1 -1
- package/lib/gateway/channel-registry.d.ts +10 -0
- package/lib/gateway/gateway-service.d.ts +23 -0
- package/lib/gateway/index.d.ts +4 -0
- package/lib/gateway/message-router.d.ts +20 -0
- package/lib/gateway/types.d.ts +270 -0
- package/lib/graphql/resolvers/channel-capabilities.d.ts +13 -0
- package/lib/graphql/resolvers/channel-capabilities.js +179 -0
- package/lib/graphql/resolvers/channel-capabilities.js.map +1 -0
- package/lib/graphql/resolvers/channel-member.d.ts +3 -3
- package/lib/graphql/resolvers/channel-member.js +30 -5
- package/lib/graphql/resolvers/channel-member.js.map +1 -1
- package/lib/graphql/resolvers/channel.d.ts +3 -3
- package/lib/graphql/resolvers/channel.js +348 -55
- package/lib/graphql/resolvers/channel.js.map +1 -1
- package/lib/graphql/resolvers/chat-configuration.d.ts +59 -0
- package/lib/graphql/resolvers/chat-configuration.js +89 -0
- package/lib/graphql/resolvers/chat-configuration.js.map +1 -0
- package/lib/graphql/resolvers/extended-token-account.d.ts +3 -32
- package/lib/graphql/resolvers/extended-token-account.js +90 -23
- package/lib/graphql/resolvers/extended-token-account.js.map +1 -1
- package/lib/graphql/resolvers/gateway.d.ts +18 -0
- package/lib/graphql/resolvers/index.d.ts +47 -26
- package/lib/graphql/resolvers/index.js +1 -1
- package/lib/graphql/resolvers/index.js.map +1 -1
- package/lib/graphql/resolvers/post-thread.d.ts +2 -3
- package/lib/graphql/resolvers/post-thread.js +294 -132
- package/lib/graphql/resolvers/post-thread.js.map +1 -1
- package/lib/graphql/resolvers/post.d.ts +2 -3
- package/lib/graphql/resolvers/post.js +764 -237
- package/lib/graphql/resolvers/post.js.map +1 -1
- package/lib/graphql/resolvers/reaction.d.ts +3 -3
- package/lib/graphql/resolvers/reaction.js +96 -14
- package/lib/graphql/resolvers/reaction.js.map +1 -1
- package/lib/graphql/resolvers/streaming.d.ts +20 -0
- package/lib/graphql/resolvers/streaming.js +147 -0
- package/lib/graphql/resolvers/streaming.js.map +1 -0
- package/lib/graphql/schema/channel-capabilities.graphql +492 -0
- package/lib/graphql/schema/channel-capabilities.graphql.js +1 -0
- package/lib/graphql/schema/channel-capabilities.graphql.js.map +1 -0
- package/lib/graphql/schema/channel-member.graphql +110 -21
- package/lib/graphql/schema/channel-member.graphql.js +1 -1
- package/lib/graphql/schema/channel.graphql +465 -24
- package/lib/graphql/schema/channel.graphql.js +1 -1
- package/lib/graphql/schema/chat-configuration.graphql +77 -0
- package/lib/graphql/schema/chat-configuration.graphql.js +1 -0
- package/lib/graphql/schema/chat-configuration.graphql.js.map +1 -0
- package/lib/graphql/schema/gateway.graphql +363 -0
- package/lib/graphql/schema/index.js +2 -2
- package/lib/graphql/schema/index.js.map +1 -1
- package/lib/graphql/schema/post-thread.graphql +167 -21
- package/lib/graphql/schema/post-thread.graphql.js +1 -1
- package/lib/graphql/schema/post.graphql +433 -36
- package/lib/graphql/schema/post.graphql.js +1 -1
- package/lib/graphql/schema/preferences.graphql +190 -3
- package/lib/graphql/schema/preferences.graphql.js +1 -1
- package/lib/graphql/schema/reaction.graphql +71 -13
- package/lib/graphql/schema/reaction.graphql.js +1 -1
- package/lib/graphql/schema/services.graphql +18 -0
- package/lib/graphql/schema/streaming.graphql +224 -0
- package/lib/graphql/schema/streaming.graphql.js +1 -0
- package/lib/graphql/schema/streaming.graphql.js.map +1 -0
- package/lib/graphql/schema/users.graphql +76 -13
- package/lib/graphql/schema/users.graphql.js +1 -1
- package/lib/graphql/schema/workflow-service.graphql +82 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interfaces/index.d.ts +0 -2
- package/lib/interfaces/services.d.ts +1 -3
- package/lib/migrations/dbMigrations/AddChannelConfigurationsMigration.d.ts +42 -0
- package/lib/migrations/dbMigrations/AddChannelConfigurationsMigration.js +60 -0
- package/lib/migrations/dbMigrations/AddChannelConfigurationsMigration.js.map +1 -0
- package/lib/migrations/dbMigrations/AddChatConfigurationsMigration.d.ts +21 -0
- package/lib/migrations/dbMigrations/AddChatConfigurationsMigration.js +30 -0
- package/lib/migrations/dbMigrations/AddChatConfigurationsMigration.js.map +1 -0
- package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.d.ts +17 -0
- package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.js +44 -0
- package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.js.map +1 -0
- package/lib/migrations/dbMigrations/index.d.ts +3 -0
- package/lib/migrations/index.d.ts +1 -0
- package/lib/migrations/mail-template-migration.d.ts +3 -6
- package/lib/migrations/mail-template-migration.js +8 -21
- package/lib/migrations/mail-template-migration.js.map +1 -1
- package/lib/migrations/message-notification-template-migration.d.ts +4 -7
- package/lib/migrations/message-notification-template-migration.js +8 -25
- package/lib/migrations/message-notification-template-migration.js.map +1 -1
- package/lib/module.d.ts +1 -1
- package/lib/module.js +3 -10
- package/lib/module.js.map +1 -1
- package/lib/plugins/ChannelMoleculerService.d.ts +39 -0
- package/lib/plugins/ChannelMoleculerService.js +58 -0
- package/lib/plugins/ChannelMoleculerService.js.map +1 -0
- package/lib/plugins/ExtendedTokenAccountMoleculerService.d.ts +65 -0
- package/lib/plugins/ExtendedTokenAccountMoleculerService.js +88 -0
- package/lib/plugins/ExtendedTokenAccountMoleculerService.js.map +1 -0
- package/lib/plugins/MessengerNotificationMoleculerService.d.ts +52 -0
- package/lib/plugins/MessengerNotificationMoleculerService.js +84 -0
- package/lib/plugins/MessengerNotificationMoleculerService.js.map +1 -0
- package/lib/plugins/PostMoleculerService.d.ts +65 -0
- package/lib/plugins/PostMoleculerService.js +87 -0
- package/lib/plugins/PostMoleculerService.js.map +1 -0
- package/lib/plugins/PostThreadMoleculerService.d.ts +40 -0
- package/lib/plugins/PostThreadMoleculerService.js +59 -0
- package/lib/plugins/PostThreadMoleculerService.js.map +1 -0
- package/lib/plugins/ReactionMoleculerService.d.ts +37 -0
- package/lib/plugins/ReactionMoleculerService.js +56 -0
- package/lib/plugins/ReactionMoleculerService.js.map +1 -0
- package/lib/plugins/index.d.ts +18 -6
- package/lib/preferences/permissions/inbox-permission-contribution.js +58 -97
- package/lib/preferences/permissions/inbox-permission-contribution.js.map +1 -1
- package/lib/preferences/permissions/inbox-roles-permission-overwrite.js +144 -144
- package/lib/preferences/permissions/inbox-roles-permission-overwrite.js.map +1 -1
- package/lib/preferences/settings/channel-settings.d.ts +39 -0
- package/lib/preferences/settings/channel-settings.js +180 -0
- package/lib/preferences/settings/channel-settings.js.map +1 -0
- package/lib/preferences/settings/chat-settings.d.ts +248 -0
- package/lib/preferences/settings/chat-settings.js +1152 -0
- package/lib/preferences/settings/chat-settings.js.map +1 -0
- package/lib/preferences/settings/index.d.ts +3 -0
- package/lib/preferences/settings/messenger-channels-contribution.d.ts +39 -0
- package/lib/preferences/settings/messenger-channels-contribution.js +355 -0
- package/lib/preferences/settings/messenger-channels-contribution.js.map +1 -0
- package/lib/preferences/settings/post-settings.d.ts +16 -0
- package/lib/preferences/settings/post-settings.js +75 -3
- package/lib/preferences/settings/post-settings.js.map +1 -1
- package/lib/services/channel-service.d.ts +215 -34
- package/lib/services/channel-service.js +1058 -273
- package/lib/services/channel-service.js.map +1 -1
- package/lib/services/extended-token-account-service.d.ts +175 -20
- package/lib/services/extended-token-account-service.js +636 -56
- package/lib/services/extended-token-account-service.js.map +1 -1
- package/lib/services/messenger-notification-service.d.ts +177 -17
- package/lib/services/messenger-notification-service.js +975 -421
- package/lib/services/messenger-notification-service.js.map +1 -1
- package/lib/services/post-service.d.ts +245 -18
- package/lib/services/post-service.js +1027 -113
- package/lib/services/post-service.js.map +1 -1
- package/lib/services/post-thread-service.d.ts +153 -6
- package/lib/services/post-thread-service.js +475 -9
- package/lib/services/post-thread-service.js.map +1 -1
- package/lib/services/proxy-services/ChannelProxyService.d.ts +27 -0
- package/lib/services/proxy-services/ChannelProxyService.js +31 -0
- package/lib/services/proxy-services/ChannelProxyService.js.map +1 -0
- package/lib/services/proxy-services/ExtendedTokenAccountProxyService.d.ts +42 -0
- package/lib/services/proxy-services/ExtendedTokenAccountProxyService.js +46 -0
- package/lib/services/proxy-services/ExtendedTokenAccountProxyService.js.map +1 -0
- package/lib/services/proxy-services/MessengerNotificationProxyService.d.ts +44 -0
- package/lib/services/proxy-services/MessengerNotificationProxyService.js +54 -0
- package/lib/services/proxy-services/MessengerNotificationProxyService.js.map +1 -0
- package/lib/services/proxy-services/PostProxyService.d.ts +42 -0
- package/lib/services/proxy-services/PostProxyService.js +46 -0
- package/lib/services/proxy-services/PostProxyService.js.map +1 -0
- package/lib/services/proxy-services/PostThreadProxyService.d.ts +32 -0
- package/lib/services/proxy-services/PostThreadProxyService.js +36 -0
- package/lib/services/proxy-services/PostThreadProxyService.js.map +1 -0
- package/lib/services/proxy-services/ReactionProxyService.d.ts +41 -0
- package/lib/services/proxy-services/ReactionProxyService.js +45 -0
- package/lib/services/proxy-services/ReactionProxyService.js.map +1 -0
- package/lib/services/proxy-services/index.d.ts +17 -5
- package/lib/services/reaction-service.d.ts +124 -4
- package/lib/services/reaction-service.js +413 -3
- package/lib/services/reaction-service.js.map +1 -1
- package/lib/store/models/account-token-store.d.ts +1 -1
- package/lib/store/models/account-token-store.js.map +1 -1
- package/lib/store/models/channel.d.ts +2 -3
- package/lib/store/models/channel.js +216 -70
- package/lib/store/models/channel.js.map +1 -1
- package/lib/store/models/post-thread.d.ts +3 -3
- package/lib/store/models/post-thread.js +96 -14
- package/lib/store/models/post-thread.js.map +1 -1
- package/lib/store/models/post.d.ts +2 -3
- package/lib/store/models/post.js +143 -23
- package/lib/store/models/post.js.map +1 -1
- package/lib/store/models/reaction.d.ts +2 -3
- package/lib/store/models/reaction.js +67 -8
- package/lib/store/models/reaction.js.map +1 -1
- package/lib/store/repositories/__tests__/__fixtures__/team-repository.d.ts +3 -3
- package/lib/store/repositories/channel-repository.d.ts +6 -6
- package/lib/store/repositories/channel-repository.js +5 -2
- package/lib/store/repositories/channel-repository.js.map +1 -1
- package/lib/store/repositories/post-repository.d.ts +6 -6
- package/lib/store/repositories/post-repository.js +5 -2
- package/lib/store/repositories/post-repository.js.map +1 -1
- package/lib/store/repositories/post-thread-repository.d.ts +6 -6
- package/lib/store/repositories/post-thread-repository.js +5 -2
- package/lib/store/repositories/post-thread-repository.js.map +1 -1
- package/lib/store/repositories/reaction-repository.d.ts +6 -6
- package/lib/store/repositories/reaction-repository.js +5 -2
- package/lib/store/repositories/reaction-repository.js.map +1 -1
- package/lib/streaming/block-chunker.d.ts +40 -0
- package/lib/streaming/block-chunker.js +103 -0
- package/lib/streaming/block-chunker.js.map +1 -0
- package/lib/streaming/block-chunker.test.d.ts +1 -0
- package/lib/streaming/index.d.ts +4 -0
- package/lib/streaming/stream-service.d.ts +71 -0
- package/lib/streaming/stream-service.js +325 -0
- package/lib/streaming/stream-service.js.map +1 -0
- package/lib/streaming/stream-service.test.d.ts +16 -0
- package/lib/streaming/streaming-post.integration.test.d.ts +10 -0
- package/lib/streaming/types.d.ts +33 -0
- package/lib/streaming/types.js +37 -0
- package/lib/streaming/types.js.map +1 -0
- package/lib/templates/constants/CONTRIBUTION_POINTS.ts.template +78 -0
- package/lib/templates/constants/SERVER_TYPES.ts.template +1 -4
- package/lib/templates/constants/WorkflowNamespace.ts.template +10 -0
- package/lib/templates/repositories/ChannelRepository.ts.template +3 -3
- package/lib/templates/repositories/PostRepository.ts.template +3 -3
- package/lib/templates/repositories/PostThreadRepository.ts.template +3 -3
- package/lib/templates/repositories/ReactionRepository.ts.template +3 -4
- package/lib/templates/services/ChannelService.ts.template +290 -39
- package/lib/templates/services/ExtendedTokenAccountService.ts.template +107 -3
- package/lib/templates/services/MessengerNotificationService.ts.template +94 -19
- package/lib/templates/services/MessengerStreamService.ts.template +131 -0
- package/lib/templates/services/PostService.ts.template +228 -20
- package/lib/templates/services/PostThreadService.ts.template +151 -6
- package/lib/templates/services/ReactionService.ts.template +129 -3
- package/lib/templates/services/RedisCacheManager.ts.template +22 -0
- package/package.json +10 -6
- package/lib/interfaces/context.d.ts +0 -14
- package/lib/plugins/channel-moleculer-service.d.ts +0 -8
- package/lib/plugins/channel-moleculer-service.js +0 -129
- package/lib/plugins/channel-moleculer-service.js.map +0 -1
- package/lib/plugins/extended-token-account-moleculer-service.d.ts +0 -8
- package/lib/plugins/extended-token-account-moleculer-service.js +0 -47
- package/lib/plugins/extended-token-account-moleculer-service.js.map +0 -1
- package/lib/plugins/messenger-notification-moleculer-service.d.ts +0 -9
- package/lib/plugins/messenger-notification-moleculer-service.js +0 -116
- package/lib/plugins/messenger-notification-moleculer-service.js.map +0 -1
- package/lib/plugins/post-moleculer-service.d.ts +0 -35
- package/lib/plugins/post-moleculer-service.js +0 -393
- package/lib/plugins/post-moleculer-service.js.map +0 -1
- package/lib/plugins/post-thread-moleculer-service.d.ts +0 -8
- package/lib/plugins/post-thread-moleculer-service.js +0 -33
- package/lib/plugins/post-thread-moleculer-service.js.map +0 -1
- package/lib/plugins/reaction-moleculer-service.d.ts +0 -8
- package/lib/plugins/reaction-moleculer-service.js +0 -20
- package/lib/plugins/reaction-moleculer-service.js.map +0 -1
- package/lib/services/proxy-services/channel-microservice.d.ts +0 -44
- package/lib/services/proxy-services/channel-microservice.js +0 -199
- package/lib/services/proxy-services/channel-microservice.js.map +0 -1
- package/lib/services/proxy-services/messenger-notification-microservice.d.ts +0 -16
- package/lib/services/proxy-services/messenger-notification-microservice.js +0 -54
- package/lib/services/proxy-services/messenger-notification-microservice.js.map +0 -1
- package/lib/services/proxy-services/post-microservice.d.ts +0 -22
- package/lib/services/proxy-services/post-microservice.js +0 -64
- package/lib/services/proxy-services/post-microservice.js.map +0 -1
- package/lib/services/proxy-services/post-thread-microservice.d.ts +0 -10
- package/lib/services/proxy-services/post-thread-microservice.js +0 -15
- package/lib/services/proxy-services/post-thread-microservice.js.map +0 -1
- package/lib/services/proxy-services/reaction-microservice.d.ts +0 -9
- package/lib/services/proxy-services/reaction-microservice.js +0 -10
- package/lib/services/proxy-services/reaction-microservice.js.map +0 -1
- package/lib/store/models/common-options.js +0 -20
- 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
|
|
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
|
-
|
|
6
|
-
settings;
|
|
5
|
+
mailerService;
|
|
7
6
|
DEFAULT = 'default';
|
|
8
7
|
VERSION = '20230719';
|
|
9
8
|
name = MailTemplateId.MessageNotificationServiceId;
|
|
10
|
-
constructor(logger, db,
|
|
9
|
+
constructor(logger, db, mailerService) {
|
|
11
10
|
this.logger = logger;
|
|
12
11
|
this.db = db;
|
|
13
|
-
this.
|
|
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
|
-
|
|
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.
|
|
43
|
+
const droppedResponse = await this.mailerService.dropTemplate({
|
|
58
44
|
name: this.name,
|
|
59
45
|
namespace: config.NAMESPACE
|
|
60
|
-
}
|
|
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(
|
|
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":";
|
|
1
|
+
{"version":3,"file":"message-notification-template-migration.js","sources":["../../src/migrations/message-notification-template-migration.ts"],"sourcesContent":[null],"names":[],"mappings":";AAQO,IAAM,oCAAoC,GAAA,sCAAA,GAA1C,MAAM,oCAAoC,CAAA;AAMf,EAAA,MAAA;AACW,EAAA,EAAA;AAEpB,EAAA,aAAA;SARX,GAAO;SACP,GAAO;AACP,EAAA,IAAA,GAAI,cAAG,CAAA,4BAAe;AAEhC,EAAA,WAAA,CAAA,MAC8B,EAAyB,EACd,EAAc,aAElC,EAA6B;QAHpB,CAAA,MAAA,GAAA;QACW,CAAA,EAAA,GAAA,EAAE;QAEtB,CAAA,aAAA,GAAA;AAEjB,IAAA,IAAA,CAAA,MAAK,GAAA,MAAS,CAAA,KAAO,CAAA;MACxB,SAAA,EAAA,sCAAA,CAAA;AAED,KAAA,CAAA;;MAEC,EAAA,GAAA;IAED,OAAA,CAAA,EAAA,IAAA,CAAA,WAAqB,CAAA,IAAA,CAAA,CAAA,EAAA,IAAA,CAAA,OAAA,CAAA,CAAA;;;;AAKd;AACH;AACA,EAAA,MAAA,EAAA,GAAA;AACI,IAAA,MAAA,IAAA,CAAA,MAAQ;qBACF,GAAK;YACX,EAAA,KAAA;YACA,IAAA,CAAA,IAAS;gBACT,EAAA,IAAS,CAAA,IAAK;eACd,EAAI,MAAO,CAAA,SAAI;AACf,MAAA,OAAA,EAAA,IAAA,CAAA,OAAa;AACb,MAAA,IAAA,EAAA,IAAI,KAAE;AACN,MAAA,aAAM,SAAA;AACN,MAAA,IAAA,EAAA,aAAO;UACT,EAAA,aAAA;WAEF,EAAA;KACH;AAEM,IAAA,MAAM,IAAI,CAAA,aAAA,CAAA,cAAA,CAAA,WAAA,CAAA;AACb,EAAA;YACI,GAAA;;iBAEI,CAAA,KAAM,CAAA,CAAA,eAAS,EAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;2BACJ,GAAA,MAAO,IAAA,CAAA,aAAS,CAAA,YAAA,CAAA;AAC9B,QAAA,IAAA,EAAC,IAAC,CAAA,IAAA;iBACC,EAAA,MAAA,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
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
|
|
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
|
-
|
|
4
|
+
createMicroServiceContainerFunc: [serviceContainerModule],
|
|
5
5
|
createResolversFunc: messengerResolvers,
|
|
6
6
|
createServiceFunc: contextServicesFromContainer,
|
|
7
|
-
|
|
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":"
|
|
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
|
+
}
|