@messenger-box/platform-server 10.0.3-alpha.7 → 10.0.3-alpha.72
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/containers/containers.js +4 -1
- package/lib/containers/containers.js.map +1 -1
- package/lib/containers/context-services-from-container.d.ts +1 -1
- package/lib/containers/context-services-from-container.js +1 -1
- package/lib/containers/context-services-from-container.js.map +1 -1
- package/lib/graphql/resolvers/channel-member.d.ts +3 -2
- 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 -2
- package/lib/graphql/resolvers/channel.js +279 -53
- package/lib/graphql/resolvers/channel.js.map +1 -1
- package/lib/graphql/resolvers/extended-token-account.d.ts +3 -2
- 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/index.d.ts +1 -1
- package/lib/graphql/resolvers/post-thread.d.ts +1 -1
- 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 +696 -234
- package/lib/graphql/resolvers/post.js.map +1 -1
- package/lib/graphql/resolvers/reaction.d.ts +3 -2
- package/lib/graphql/resolvers/reaction.js +96 -14
- package/lib/graphql/resolvers/reaction.js.map +1 -1
- 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 +337 -38
- package/lib/graphql/schema/channel.graphql.js +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 +284 -40
- package/lib/graphql/schema/post.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 +2 -0
- package/lib/graphql/schema/users.graphql +76 -13
- package/lib/graphql/schema/users.graphql.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interfaces/index.d.ts +0 -1
- package/lib/interfaces/services.d.ts +1 -1
- 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 +1 -0
- package/lib/migrations/index.d.ts +1 -0
- package/lib/migrations/mail-template-migration.js +1 -1
- package/lib/migrations/message-notification-template-migration.d.ts +1 -1
- package/lib/migrations/message-notification-template-migration.js +1 -1
- package/lib/plugins/channel-moleculer-service.d.ts +21 -1
- package/lib/plugins/channel-moleculer-service.js +417 -115
- package/lib/plugins/channel-moleculer-service.js.map +1 -1
- package/lib/plugins/extended-token-account-moleculer-service.d.ts +25 -1
- package/lib/plugins/extended-token-account-moleculer-service.js +348 -22
- package/lib/plugins/extended-token-account-moleculer-service.js.map +1 -1
- package/lib/plugins/messenger-notification-moleculer-service.d.ts +27 -3
- package/lib/plugins/messenger-notification-moleculer-service.js +404 -58
- package/lib/plugins/messenger-notification-moleculer-service.js.map +1 -1
- package/lib/plugins/post-moleculer-service.d.ts +85 -21
- package/lib/plugins/post-moleculer-service.js +986 -256
- package/lib/plugins/post-moleculer-service.js.map +1 -1
- package/lib/plugins/post-thread-moleculer-service.d.ts +33 -1
- package/lib/plugins/post-thread-moleculer-service.js +326 -8
- package/lib/plugins/post-thread-moleculer-service.js.map +1 -1
- package/lib/plugins/reaction-moleculer-service.js +1 -1
- package/lib/plugins/reaction-moleculer-service.js.map +1 -1
- package/lib/preferences/settings/post-settings.d.ts +2 -0
- package/lib/preferences/settings/post-settings.js +47 -9
- package/lib/preferences/settings/post-settings.js.map +1 -1
- package/lib/services/channel-service.d.ts +179 -33
- package/lib/services/channel-service.js +821 -274
- package/lib/services/channel-service.js.map +1 -1
- package/lib/services/extended-token-account-service.d.ts +130 -14
- package/lib/services/extended-token-account-service.js +462 -52
- package/lib/services/extended-token-account-service.js.map +1 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/messenger-notification-service.d.ts +106 -13
- package/lib/services/messenger-notification-service.js +824 -442
- package/lib/services/messenger-notification-service.js.map +1 -1
- package/lib/services/post-service.d.ts +182 -16
- package/lib/services/post-service.js +731 -115
- package/lib/services/post-service.js.map +1 -1
- package/lib/services/post-thread-service.d.ts +114 -5
- package/lib/services/post-thread-service.js +400 -13
- package/lib/services/post-thread-service.js.map +1 -1
- package/lib/services/proxy-services/channel-microservice.d.ts +5 -3
- package/lib/services/proxy-services/channel-microservice.js +19 -10
- package/lib/services/proxy-services/channel-microservice.js.map +1 -1
- package/lib/services/proxy-services/messenger-notification-microservice.d.ts +128 -8
- package/lib/services/proxy-services/messenger-notification-microservice.js +324 -29
- package/lib/services/proxy-services/messenger-notification-microservice.js.map +1 -1
- package/lib/services/proxy-services/post-microservice.d.ts +186 -12
- package/lib/services/proxy-services/post-microservice.js +543 -54
- package/lib/services/proxy-services/post-microservice.js.map +1 -1
- package/lib/services/proxy-services/post-thread-microservice.d.ts +134 -3
- package/lib/services/proxy-services/post-thread-microservice.js +388 -6
- package/lib/services/proxy-services/post-thread-microservice.js.map +1 -1
- package/lib/services/proxy-services/reaction-microservice.d.ts +161 -3
- package/lib/services/proxy-services/reaction-microservice.js +474 -2
- package/lib/services/proxy-services/reaction-microservice.js.map +1 -1
- package/lib/services/reaction-service.d.ts +124 -4
- package/lib/services/reaction-service.js +415 -3
- package/lib/services/reaction-service.js.map +1 -1
- package/lib/services/redis-cache-manager.d.ts +18 -0
- package/lib/services/redis-cache-manager.js +83 -0
- package/lib/services/redis-cache-manager.js.map +1 -0
- 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 +181 -72
- 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/templates/constants/SERVER_TYPES.ts.template +0 -3
- 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 +280 -39
- package/lib/templates/services/ExtendedTokenAccountService.ts.template +104 -9
- package/lib/templates/services/MessengerNotificationService.ts.template +94 -19
- package/lib/templates/services/PostService.ts.template +184 -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 +6 -5
- package/lib/interfaces/context.d.ts +0 -14
- package/lib/store/models/common-options.js +0 -20
- package/lib/store/models/common-options.js.map +0 -1
|
@@ -1,9 +1,167 @@
|
|
|
1
1
|
import { ServiceBroker } from 'moleculer';
|
|
2
|
-
import {
|
|
2
|
+
import { CdmLogger } from '@cdm-logger/core';
|
|
3
|
+
import { Disposable, DisposableCollection } from '@adminide-stack/core';
|
|
4
|
+
import { MoleculerTopics as MoleculerTopics, IReaction, IReactionModel, IReactionInput, IReactionService, IReactionServiceInput, AsDomainType } from 'common/server';
|
|
3
5
|
import { BaseProxyService } from '@common-stack/store-mongo';
|
|
4
6
|
import { ILogger } from '@cdm-logger/core/lib/interface';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Reaction Microservice Proxy Implementation
|
|
9
|
+
*
|
|
10
|
+
* This service provides a comprehensive proxy layer for reaction management
|
|
11
|
+
* within the messenger platform, delegating operations to the reaction microservice
|
|
12
|
+
* while providing enhanced local functionality and error handling.
|
|
13
|
+
*
|
|
14
|
+
* Key capabilities:
|
|
15
|
+
* - Complete reaction lifecycle management (add, remove, update)
|
|
16
|
+
* - Content-based reaction retrieval and aggregation
|
|
17
|
+
* - User reaction tracking and analytics
|
|
18
|
+
* - Reaction statistics and trending analysis
|
|
19
|
+
* - Bulk reaction operations and content cleanup
|
|
20
|
+
* - Cross-platform reaction synchronization
|
|
21
|
+
* - Performance optimization through microservice delegation
|
|
22
|
+
* - Comprehensive error handling and logging
|
|
23
|
+
* - Type-safe reaction data management
|
|
24
|
+
*
|
|
25
|
+
* The service acts as a local proxy to the distributed reaction microservice,
|
|
26
|
+
* providing seamless integration while maintaining the full feature set
|
|
27
|
+
* and ensuring consistent reaction behavior across the platform.
|
|
28
|
+
*/
|
|
29
|
+
export declare class ReactionMicroservice extends BaseProxyService<IReaction, IReactionServiceInput, Partial<IReactionInput>> implements IReactionService, Disposable {
|
|
30
|
+
protected readonly toDispose: DisposableCollection;
|
|
31
|
+
protected logger: CdmLogger.ILogger;
|
|
7
32
|
topic: MoleculerTopics;
|
|
8
33
|
constructor(broker: ServiceBroker, logger: ILogger);
|
|
34
|
+
/**
|
|
35
|
+
* Disposes of resources used by the service
|
|
36
|
+
*/
|
|
37
|
+
dispose(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Adds a reaction to a post or message
|
|
40
|
+
*
|
|
41
|
+
* @description Creates a new reaction entry for a specific content item,
|
|
42
|
+
* handling duplicate detection and user validation through microservice call.
|
|
43
|
+
*
|
|
44
|
+
* @param {IReactionServiceInput} data - Reaction creation data including user and reaction type
|
|
45
|
+
* @returns {Promise<AsDomainType<IReactionModel> | Error>} - Created reaction or error
|
|
46
|
+
*/
|
|
47
|
+
addReaction(data: IReactionServiceInput): Promise<AsDomainType<IReactionModel> | Error>;
|
|
48
|
+
/**
|
|
49
|
+
* Removes a reaction from a post or message
|
|
50
|
+
*
|
|
51
|
+
* @description Deletes an existing reaction entry through microservice,
|
|
52
|
+
* ensuring proper user authorization and content validation.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} reactionId - The unique identifier of the reaction to remove
|
|
55
|
+
* @param {string} userId - The identifier of the user removing the reaction
|
|
56
|
+
* @returns {Promise<boolean | Error>} - Success status or error
|
|
57
|
+
*/
|
|
58
|
+
removeReaction(reactionId: string, userId: string): Promise<boolean | Error>;
|
|
59
|
+
/**
|
|
60
|
+
* Retrieves all reactions for a specific content item
|
|
61
|
+
*
|
|
62
|
+
* @description Fetches reaction data with aggregation and user information
|
|
63
|
+
* for display in the user interface through microservice call.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} contentId - The identifier of the content (post, message, etc.)
|
|
66
|
+
* @param {string} contentType - The type of content being reacted to
|
|
67
|
+
* @returns {Promise<Array<AsDomainType<IReactionModel>> | Error>} - Array of reactions or error
|
|
68
|
+
*/
|
|
69
|
+
getReactionsByContent(contentId: string, contentType: string): Promise<Array<AsDomainType<IReactionModel>> | Error>;
|
|
70
|
+
/**
|
|
71
|
+
* Retrieves reaction statistics for content
|
|
72
|
+
*
|
|
73
|
+
* @description Provides aggregated reaction counts and statistics
|
|
74
|
+
* for analytics and display purposes through microservice call.
|
|
75
|
+
*
|
|
76
|
+
* @param {string} contentId - The identifier of the content
|
|
77
|
+
* @param {string} contentType - The type of content
|
|
78
|
+
* @returns {Promise<any | Error>} - Reaction statistics or error
|
|
79
|
+
*/
|
|
80
|
+
getReactionStats(contentId: string, contentType: string): Promise<any | Error>;
|
|
81
|
+
/**
|
|
82
|
+
* Checks if a user has reacted to specific content
|
|
83
|
+
*
|
|
84
|
+
* @description Determines whether a user has already reacted to
|
|
85
|
+
* a piece of content through microservice call, useful for UI state management.
|
|
86
|
+
*
|
|
87
|
+
* @param {string} contentId - The identifier of the content
|
|
88
|
+
* @param {string} userId - The identifier of the user
|
|
89
|
+
* @param {string} reactionType - The type of reaction to check
|
|
90
|
+
* @returns {Promise<boolean | Error>} - True if user has reacted, or error
|
|
91
|
+
*/
|
|
92
|
+
hasUserReacted(contentId: string, userId: string, reactionType: string): Promise<boolean | Error>;
|
|
93
|
+
/**
|
|
94
|
+
* Updates an existing reaction
|
|
95
|
+
*
|
|
96
|
+
* @description Modifies an existing reaction through microservice call,
|
|
97
|
+
* typically changing the reaction type while maintaining the same user and content association.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} reactionId - The unique identifier of the reaction
|
|
100
|
+
* @param {Partial<IReactionInput>} updates - The reaction updates to apply
|
|
101
|
+
* @returns {Promise<AsDomainType<IReactionModel> | Error>} - Updated reaction or error
|
|
102
|
+
*/
|
|
103
|
+
updateReaction(reactionId: string, updates: Partial<IReactionInput>): Promise<AsDomainType<IReactionModel> | Error>;
|
|
104
|
+
/**
|
|
105
|
+
* Removes all reactions from specific content
|
|
106
|
+
*
|
|
107
|
+
* @description Bulk removes all reactions from a content item through microservice,
|
|
108
|
+
* typically used during content deletion or moderation.
|
|
109
|
+
*
|
|
110
|
+
* @param {string} contentId - The identifier of the content
|
|
111
|
+
* @param {string} contentType - The type of content
|
|
112
|
+
* @returns {Promise<number | Error>} - Number of reactions removed or error
|
|
113
|
+
*/
|
|
114
|
+
removeAllReactionsByContent(contentId: string, contentType: string): Promise<number | Error>;
|
|
115
|
+
/**
|
|
116
|
+
* Retrieves reactions by user across all content
|
|
117
|
+
*
|
|
118
|
+
* @description Gets all reactions created by a specific user through microservice call,
|
|
119
|
+
* useful for user activity tracking and analytics.
|
|
120
|
+
*
|
|
121
|
+
* @param {string} userId - The identifier of the user
|
|
122
|
+
* @param {number} limit - Maximum number of reactions to return
|
|
123
|
+
* @param {number} offset - Number of reactions to skip
|
|
124
|
+
* @returns {Promise<Array<AsDomainType<IReactionModel>> | Error>} - Array of user reactions or error
|
|
125
|
+
*/
|
|
126
|
+
getUserReactions(userId: string, limit?: number, offset?: number): Promise<Array<AsDomainType<IReactionModel>> | Error>;
|
|
127
|
+
/**
|
|
128
|
+
* Gets the most popular reactions across the platform
|
|
129
|
+
*
|
|
130
|
+
* @description Retrieves aggregated data about the most used reactions
|
|
131
|
+
* through microservice call for analytics and trending features.
|
|
132
|
+
*
|
|
133
|
+
* @param {number} limit - Maximum number of popular reactions to return
|
|
134
|
+
* @param {Date} since - Optional date to filter reactions since
|
|
135
|
+
* @returns {Promise<Array<{ type: string; count: number; users: number }> | Error>} - Popular reactions or error
|
|
136
|
+
*/
|
|
137
|
+
getPopularReactions(limit?: number, since?: Date): Promise<Array<{
|
|
138
|
+
type: string;
|
|
139
|
+
count: number;
|
|
140
|
+
users: number;
|
|
141
|
+
}> | Error>;
|
|
142
|
+
/**
|
|
143
|
+
* Toggles a reaction for a user on content
|
|
144
|
+
*
|
|
145
|
+
* @description Convenience method that adds a reaction if it doesn't exist,
|
|
146
|
+
* or removes it if it does exist, through microservice delegation.
|
|
147
|
+
*
|
|
148
|
+
* @param {string} contentId - The identifier of the content
|
|
149
|
+
* @param {string} userId - The identifier of the user
|
|
150
|
+
* @param {string} reactionType - The type of reaction to toggle
|
|
151
|
+
* @returns {Promise<{ added: boolean; reaction?: AsDomainType<IReactionModel> } | Error>} - Toggle result or error
|
|
152
|
+
*/
|
|
153
|
+
toggleReaction(contentId: string, userId: string, reactionType: string): Promise<{
|
|
154
|
+
added: boolean;
|
|
155
|
+
reaction?: AsDomainType<IReactionModel>;
|
|
156
|
+
} | Error>;
|
|
157
|
+
/**
|
|
158
|
+
* Validates reaction data before processing
|
|
159
|
+
*
|
|
160
|
+
* @description Helper method to validate reaction input data
|
|
161
|
+
* to ensure consistency and prevent invalid operations.
|
|
162
|
+
*
|
|
163
|
+
* @param {IReactionServiceInput} data - Reaction data to validate
|
|
164
|
+
* @returns {Promise<boolean | Error>} - Validation result or error
|
|
165
|
+
*/
|
|
166
|
+
validateReactionData(data: IReactionServiceInput): Promise<boolean | Error>;
|
|
9
167
|
}
|
|
@@ -1,10 +1,482 @@
|
|
|
1
|
-
import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import {ServiceBroker}from'moleculer';import {CommonType}from'@common-stack/core';import {MoleculerTopics}from'common';import {BaseProxyService}from'@common-stack/store-mongo'
|
|
1
|
+
import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import {ServiceBroker}from'moleculer';import {CommonType}from'@common-stack/core';import {DisposableCollection}from'@adminide-stack/core';import {MoleculerTopics}from'common/server';import {BaseProxyService}from'@common-stack/store-mongo';/**
|
|
2
|
+
* Reaction Microservice Proxy Implementation
|
|
3
|
+
*
|
|
4
|
+
* This service provides a comprehensive proxy layer for reaction management
|
|
5
|
+
* within the messenger platform, delegating operations to the reaction microservice
|
|
6
|
+
* while providing enhanced local functionality and error handling.
|
|
7
|
+
*
|
|
8
|
+
* Key capabilities:
|
|
9
|
+
* - Complete reaction lifecycle management (add, remove, update)
|
|
10
|
+
* - Content-based reaction retrieval and aggregation
|
|
11
|
+
* - User reaction tracking and analytics
|
|
12
|
+
* - Reaction statistics and trending analysis
|
|
13
|
+
* - Bulk reaction operations and content cleanup
|
|
14
|
+
* - Cross-platform reaction synchronization
|
|
15
|
+
* - Performance optimization through microservice delegation
|
|
16
|
+
* - Comprehensive error handling and logging
|
|
17
|
+
* - Type-safe reaction data management
|
|
18
|
+
*
|
|
19
|
+
* The service acts as a local proxy to the distributed reaction microservice,
|
|
20
|
+
* providing seamless integration while maintaining the full feature set
|
|
21
|
+
* and ensuring consistent reaction behavior across the platform.
|
|
22
|
+
*/
|
|
23
|
+
let ReactionMicroservice = class ReactionMicroservice extends BaseProxyService {
|
|
24
|
+
toDispose = new DisposableCollection();
|
|
2
25
|
logger;
|
|
3
26
|
topic = MoleculerTopics.ReactionService;
|
|
4
27
|
constructor(broker, logger) {
|
|
5
28
|
super(broker, logger.child({
|
|
6
29
|
className: 'ReactionMicroservice'
|
|
7
30
|
}));
|
|
31
|
+
this.logger = logger.child({
|
|
32
|
+
className: 'ReactionMicroservice'
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Disposes of resources used by the service
|
|
37
|
+
*/
|
|
38
|
+
dispose() {
|
|
39
|
+
this.toDispose.dispose();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Adds a reaction to a post or message
|
|
43
|
+
*
|
|
44
|
+
* @description Creates a new reaction entry for a specific content item,
|
|
45
|
+
* handling duplicate detection and user validation through microservice call.
|
|
46
|
+
*
|
|
47
|
+
* @param {IReactionServiceInput} data - Reaction creation data including user and reaction type
|
|
48
|
+
* @returns {Promise<AsDomainType<IReactionModel> | Error>} - Created reaction or error
|
|
49
|
+
*/
|
|
50
|
+
async addReaction(data) {
|
|
51
|
+
try {
|
|
52
|
+
if (!data.user) {
|
|
53
|
+
return new Error('User is required for reaction creation');
|
|
54
|
+
}
|
|
55
|
+
if (!data.post) {
|
|
56
|
+
return new Error('Post ID is required');
|
|
57
|
+
}
|
|
58
|
+
if (!data.reaction) {
|
|
59
|
+
return new Error('Reaction content is required');
|
|
60
|
+
}
|
|
61
|
+
this.logger.debug('Adding reaction via microservice', {
|
|
62
|
+
user: data.user,
|
|
63
|
+
contentId: data.post,
|
|
64
|
+
reactionType: data.reaction
|
|
65
|
+
});
|
|
66
|
+
const result = await this.broker.call(`${this.topic}.addReaction`, data);
|
|
67
|
+
if (!result) {
|
|
68
|
+
return new Error('Failed to create reaction');
|
|
69
|
+
}
|
|
70
|
+
this.logger.debug('Reaction added successfully via microservice', {
|
|
71
|
+
reactionId: result.id || 'unknown',
|
|
72
|
+
user: data.user,
|
|
73
|
+
contentId: data.post
|
|
74
|
+
});
|
|
75
|
+
return result;
|
|
76
|
+
} catch (error) {
|
|
77
|
+
this.logger.error('Error adding reaction via microservice: %o', error);
|
|
78
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while adding reaction');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Removes a reaction from a post or message
|
|
83
|
+
*
|
|
84
|
+
* @description Deletes an existing reaction entry through microservice,
|
|
85
|
+
* ensuring proper user authorization and content validation.
|
|
86
|
+
*
|
|
87
|
+
* @param {string} reactionId - The unique identifier of the reaction to remove
|
|
88
|
+
* @param {string} userId - The identifier of the user removing the reaction
|
|
89
|
+
* @returns {Promise<boolean | Error>} - Success status or error
|
|
90
|
+
*/
|
|
91
|
+
async removeReaction(reactionId, userId) {
|
|
92
|
+
try {
|
|
93
|
+
if (!reactionId) {
|
|
94
|
+
return new Error('Reaction ID is required');
|
|
95
|
+
}
|
|
96
|
+
if (!userId) {
|
|
97
|
+
return new Error('User ID is required');
|
|
98
|
+
}
|
|
99
|
+
this.logger.debug('Removing reaction via microservice', {
|
|
100
|
+
reactionId,
|
|
101
|
+
userId
|
|
102
|
+
});
|
|
103
|
+
const result = await this.broker.call(`${this.topic}.removeReaction`, {
|
|
104
|
+
reactionId,
|
|
105
|
+
userId
|
|
106
|
+
});
|
|
107
|
+
this.logger.debug('Reaction removal completed via microservice', {
|
|
108
|
+
reactionId,
|
|
109
|
+
userId,
|
|
110
|
+
success: !!result
|
|
111
|
+
});
|
|
112
|
+
return !!result;
|
|
113
|
+
} catch (error) {
|
|
114
|
+
this.logger.error('Error removing reaction via microservice: %o', error);
|
|
115
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while removing reaction');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Retrieves all reactions for a specific content item
|
|
120
|
+
*
|
|
121
|
+
* @description Fetches reaction data with aggregation and user information
|
|
122
|
+
* for display in the user interface through microservice call.
|
|
123
|
+
*
|
|
124
|
+
* @param {string} contentId - The identifier of the content (post, message, etc.)
|
|
125
|
+
* @param {string} contentType - The type of content being reacted to
|
|
126
|
+
* @returns {Promise<Array<AsDomainType<IReactionModel>> | Error>} - Array of reactions or error
|
|
127
|
+
*/
|
|
128
|
+
async getReactionsByContent(contentId, contentType) {
|
|
129
|
+
try {
|
|
130
|
+
if (!contentId) {
|
|
131
|
+
return new Error('Content ID is required');
|
|
132
|
+
}
|
|
133
|
+
if (!contentType) {
|
|
134
|
+
return new Error('Content type is required');
|
|
135
|
+
}
|
|
136
|
+
this.logger.debug('Retrieving reactions for content via microservice', {
|
|
137
|
+
contentId,
|
|
138
|
+
contentType
|
|
139
|
+
});
|
|
140
|
+
const reactions = await this.broker.call(`${this.topic}.getReactionsByContent`, {
|
|
141
|
+
contentId,
|
|
142
|
+
contentType
|
|
143
|
+
});
|
|
144
|
+
if (!Array.isArray(reactions)) {
|
|
145
|
+
return new Error('Invalid response from microservice');
|
|
146
|
+
}
|
|
147
|
+
this.logger.debug('Retrieved reactions for content via microservice', {
|
|
148
|
+
contentId,
|
|
149
|
+
contentType,
|
|
150
|
+
count: reactions.length
|
|
151
|
+
});
|
|
152
|
+
return reactions;
|
|
153
|
+
} catch (error) {
|
|
154
|
+
this.logger.error('Error getting reactions by content via microservice: %o', error);
|
|
155
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while getting reactions');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Retrieves reaction statistics for content
|
|
160
|
+
*
|
|
161
|
+
* @description Provides aggregated reaction counts and statistics
|
|
162
|
+
* for analytics and display purposes through microservice call.
|
|
163
|
+
*
|
|
164
|
+
* @param {string} contentId - The identifier of the content
|
|
165
|
+
* @param {string} contentType - The type of content
|
|
166
|
+
* @returns {Promise<any | Error>} - Reaction statistics or error
|
|
167
|
+
*/
|
|
168
|
+
async getReactionStats(contentId, contentType) {
|
|
169
|
+
try {
|
|
170
|
+
if (!contentId) {
|
|
171
|
+
return new Error('Content ID is required');
|
|
172
|
+
}
|
|
173
|
+
if (!contentType) {
|
|
174
|
+
return new Error('Content type is required');
|
|
175
|
+
}
|
|
176
|
+
this.logger.debug('Retrieving reaction stats via microservice', {
|
|
177
|
+
contentId,
|
|
178
|
+
contentType
|
|
179
|
+
});
|
|
180
|
+
const stats = await this.broker.call(`${this.topic}.getReactionStats`, {
|
|
181
|
+
contentId,
|
|
182
|
+
contentType
|
|
183
|
+
});
|
|
184
|
+
if (!stats) {
|
|
185
|
+
return new Error('Failed to retrieve reaction statistics');
|
|
186
|
+
}
|
|
187
|
+
this.logger.debug('Retrieved reaction statistics via microservice', {
|
|
188
|
+
contentId,
|
|
189
|
+
contentType,
|
|
190
|
+
totalReactions: stats.totalReactions || 0
|
|
191
|
+
});
|
|
192
|
+
return stats;
|
|
193
|
+
} catch (error) {
|
|
194
|
+
this.logger.error('Error getting reaction stats via microservice: %o', error);
|
|
195
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while getting reaction stats');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Checks if a user has reacted to specific content
|
|
200
|
+
*
|
|
201
|
+
* @description Determines whether a user has already reacted to
|
|
202
|
+
* a piece of content through microservice call, useful for UI state management.
|
|
203
|
+
*
|
|
204
|
+
* @param {string} contentId - The identifier of the content
|
|
205
|
+
* @param {string} userId - The identifier of the user
|
|
206
|
+
* @param {string} reactionType - The type of reaction to check
|
|
207
|
+
* @returns {Promise<boolean | Error>} - True if user has reacted, or error
|
|
208
|
+
*/
|
|
209
|
+
async hasUserReacted(contentId, userId, reactionType) {
|
|
210
|
+
try {
|
|
211
|
+
if (!contentId || !userId || !reactionType) {
|
|
212
|
+
return new Error('Content ID, user ID, and reaction type are required');
|
|
213
|
+
}
|
|
214
|
+
this.logger.debug('Checking if user has reacted via microservice', {
|
|
215
|
+
contentId,
|
|
216
|
+
userId,
|
|
217
|
+
reactionType
|
|
218
|
+
});
|
|
219
|
+
const hasReacted = await this.broker.call(`${this.topic}.hasUserReacted`, {
|
|
220
|
+
contentId,
|
|
221
|
+
userId,
|
|
222
|
+
reactionType
|
|
223
|
+
});
|
|
224
|
+
return !!hasReacted;
|
|
225
|
+
} catch (error) {
|
|
226
|
+
this.logger.error('Error checking if user has reacted via microservice: %o', error);
|
|
227
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while checking user reaction');
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Updates an existing reaction
|
|
232
|
+
*
|
|
233
|
+
* @description Modifies an existing reaction through microservice call,
|
|
234
|
+
* typically changing the reaction type while maintaining the same user and content association.
|
|
235
|
+
*
|
|
236
|
+
* @param {string} reactionId - The unique identifier of the reaction
|
|
237
|
+
* @param {Partial<IReactionInput>} updates - The reaction updates to apply
|
|
238
|
+
* @returns {Promise<AsDomainType<IReactionModel> | Error>} - Updated reaction or error
|
|
239
|
+
*/
|
|
240
|
+
async updateReaction(reactionId, updates) {
|
|
241
|
+
try {
|
|
242
|
+
if (!reactionId) {
|
|
243
|
+
return new Error('Reaction ID is required');
|
|
244
|
+
}
|
|
245
|
+
if (!updates || Object.keys(updates).length === 0) {
|
|
246
|
+
return new Error('Updates are required');
|
|
247
|
+
}
|
|
248
|
+
this.logger.debug('Updating reaction via microservice', {
|
|
249
|
+
reactionId,
|
|
250
|
+
updates: Object.keys(updates)
|
|
251
|
+
});
|
|
252
|
+
const updatedReaction = await this.broker.call(`${this.topic}.updateReaction`, {
|
|
253
|
+
reactionId,
|
|
254
|
+
updates
|
|
255
|
+
});
|
|
256
|
+
if (!updatedReaction) {
|
|
257
|
+
return new Error('Failed to update reaction');
|
|
258
|
+
}
|
|
259
|
+
this.logger.debug('Reaction updated successfully via microservice', {
|
|
260
|
+
reactionId,
|
|
261
|
+
updates: Object.keys(updates)
|
|
262
|
+
});
|
|
263
|
+
return updatedReaction;
|
|
264
|
+
} catch (error) {
|
|
265
|
+
this.logger.error('Error updating reaction via microservice: %o', error);
|
|
266
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while updating reaction');
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Removes all reactions from specific content
|
|
271
|
+
*
|
|
272
|
+
* @description Bulk removes all reactions from a content item through microservice,
|
|
273
|
+
* typically used during content deletion or moderation.
|
|
274
|
+
*
|
|
275
|
+
* @param {string} contentId - The identifier of the content
|
|
276
|
+
* @param {string} contentType - The type of content
|
|
277
|
+
* @returns {Promise<number | Error>} - Number of reactions removed or error
|
|
278
|
+
*/
|
|
279
|
+
async removeAllReactionsByContent(contentId, contentType) {
|
|
280
|
+
try {
|
|
281
|
+
if (!contentId) {
|
|
282
|
+
return new Error('Content ID is required');
|
|
283
|
+
}
|
|
284
|
+
if (!contentType) {
|
|
285
|
+
return new Error('Content type is required');
|
|
286
|
+
}
|
|
287
|
+
this.logger.debug('Bulk removing reactions from content via microservice', {
|
|
288
|
+
contentId,
|
|
289
|
+
contentType
|
|
290
|
+
});
|
|
291
|
+
const deletedCount = await this.broker.call(`${this.topic}.removeAllReactionsByContent`, {
|
|
292
|
+
contentId,
|
|
293
|
+
contentType
|
|
294
|
+
});
|
|
295
|
+
const count = typeof deletedCount === 'number' ? deletedCount : 0;
|
|
296
|
+
this.logger.debug('Bulk removed reactions from content via microservice', {
|
|
297
|
+
contentId,
|
|
298
|
+
contentType,
|
|
299
|
+
deletedCount: count
|
|
300
|
+
});
|
|
301
|
+
return count;
|
|
302
|
+
} catch (error) {
|
|
303
|
+
this.logger.error('Error removing all reactions by content via microservice: %o', error);
|
|
304
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while removing reactions');
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Retrieves reactions by user across all content
|
|
309
|
+
*
|
|
310
|
+
* @description Gets all reactions created by a specific user through microservice call,
|
|
311
|
+
* useful for user activity tracking and analytics.
|
|
312
|
+
*
|
|
313
|
+
* @param {string} userId - The identifier of the user
|
|
314
|
+
* @param {number} limit - Maximum number of reactions to return
|
|
315
|
+
* @param {number} offset - Number of reactions to skip
|
|
316
|
+
* @returns {Promise<Array<AsDomainType<IReactionModel>> | Error>} - Array of user reactions or error
|
|
317
|
+
*/
|
|
318
|
+
async getUserReactions(userId, limit = 50, offset = 0) {
|
|
319
|
+
try {
|
|
320
|
+
if (!userId) {
|
|
321
|
+
return new Error('User ID is required');
|
|
322
|
+
}
|
|
323
|
+
this.logger.debug('Retrieving user reactions via microservice', {
|
|
324
|
+
userId,
|
|
325
|
+
limit,
|
|
326
|
+
offset
|
|
327
|
+
});
|
|
328
|
+
const reactions = await this.broker.call(`${this.topic}.getUserReactions`, {
|
|
329
|
+
userId,
|
|
330
|
+
limit,
|
|
331
|
+
offset
|
|
332
|
+
});
|
|
333
|
+
if (!Array.isArray(reactions)) {
|
|
334
|
+
return new Error('Invalid response from microservice');
|
|
335
|
+
}
|
|
336
|
+
this.logger.debug('Retrieved user reactions via microservice', {
|
|
337
|
+
userId,
|
|
338
|
+
count: reactions.length,
|
|
339
|
+
limit,
|
|
340
|
+
offset
|
|
341
|
+
});
|
|
342
|
+
return reactions;
|
|
343
|
+
} catch (error) {
|
|
344
|
+
this.logger.error('Error getting user reactions via microservice: %o', error);
|
|
345
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while getting user reactions');
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Gets the most popular reactions across the platform
|
|
350
|
+
*
|
|
351
|
+
* @description Retrieves aggregated data about the most used reactions
|
|
352
|
+
* through microservice call for analytics and trending features.
|
|
353
|
+
*
|
|
354
|
+
* @param {number} limit - Maximum number of popular reactions to return
|
|
355
|
+
* @param {Date} since - Optional date to filter reactions since
|
|
356
|
+
* @returns {Promise<Array<{ type: string; count: number; users: number }> | Error>} - Popular reactions or error
|
|
357
|
+
*/
|
|
358
|
+
async getPopularReactions(limit = 10, since) {
|
|
359
|
+
try {
|
|
360
|
+
this.logger.debug('Retrieving popular reactions via microservice', {
|
|
361
|
+
limit,
|
|
362
|
+
since: since?.toISOString()
|
|
363
|
+
});
|
|
364
|
+
const popularReactions = await this.broker.call(`${this.topic}.getPopularReactions`, {
|
|
365
|
+
limit,
|
|
366
|
+
since: since?.toISOString()
|
|
367
|
+
});
|
|
368
|
+
if (!Array.isArray(popularReactions)) {
|
|
369
|
+
return new Error('Invalid response from microservice');
|
|
370
|
+
}
|
|
371
|
+
this.logger.debug('Retrieved popular reactions via microservice', {
|
|
372
|
+
count: popularReactions.length,
|
|
373
|
+
limit,
|
|
374
|
+
since: since?.toISOString()
|
|
375
|
+
});
|
|
376
|
+
return popularReactions;
|
|
377
|
+
} catch (error) {
|
|
378
|
+
this.logger.error('Error getting popular reactions via microservice: %o', error);
|
|
379
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while getting popular reactions');
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Toggles a reaction for a user on content
|
|
384
|
+
*
|
|
385
|
+
* @description Convenience method that adds a reaction if it doesn't exist,
|
|
386
|
+
* or removes it if it does exist, through microservice delegation.
|
|
387
|
+
*
|
|
388
|
+
* @param {string} contentId - The identifier of the content
|
|
389
|
+
* @param {string} userId - The identifier of the user
|
|
390
|
+
* @param {string} reactionType - The type of reaction to toggle
|
|
391
|
+
* @returns {Promise<{ added: boolean; reaction?: AsDomainType<IReactionModel> } | Error>} - Toggle result or error
|
|
392
|
+
*/
|
|
393
|
+
async toggleReaction(contentId, userId, reactionType) {
|
|
394
|
+
try {
|
|
395
|
+
if (!contentId || !userId || !reactionType) {
|
|
396
|
+
return new Error('Content ID, user ID, and reaction type are required');
|
|
397
|
+
}
|
|
398
|
+
this.logger.debug('Toggling reaction via microservice', {
|
|
399
|
+
contentId,
|
|
400
|
+
userId,
|
|
401
|
+
reactionType
|
|
402
|
+
});
|
|
403
|
+
// Check if user has already reacted
|
|
404
|
+
const hasReacted = await this.hasUserReacted(contentId, userId, reactionType);
|
|
405
|
+
if (hasReacted instanceof Error) {
|
|
406
|
+
return hasReacted;
|
|
407
|
+
}
|
|
408
|
+
if (hasReacted) {
|
|
409
|
+
// Find and remove the existing reaction
|
|
410
|
+
const userReactions = await this.getUserReactions(userId);
|
|
411
|
+
if (userReactions instanceof Error) {
|
|
412
|
+
return userReactions;
|
|
413
|
+
}
|
|
414
|
+
const existingReaction = userReactions.find(r => r.post === contentId && r.reaction === reactionType);
|
|
415
|
+
if (existingReaction) {
|
|
416
|
+
const removeResult = await this.removeReaction(existingReaction.id, userId);
|
|
417
|
+
if (removeResult instanceof Error) {
|
|
418
|
+
return removeResult;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return {
|
|
422
|
+
added: false
|
|
423
|
+
};
|
|
424
|
+
} else {
|
|
425
|
+
// Add new reaction
|
|
426
|
+
const reactionData = {
|
|
427
|
+
user: userId,
|
|
428
|
+
post: contentId,
|
|
429
|
+
reaction: reactionType
|
|
430
|
+
};
|
|
431
|
+
const addResult = await this.addReaction(reactionData);
|
|
432
|
+
if (addResult instanceof Error) {
|
|
433
|
+
return addResult;
|
|
434
|
+
}
|
|
435
|
+
return {
|
|
436
|
+
added: true,
|
|
437
|
+
reaction: addResult
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
} catch (error) {
|
|
441
|
+
this.logger.error('Error toggling reaction via microservice: %o', error);
|
|
442
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while toggling reaction');
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Validates reaction data before processing
|
|
447
|
+
*
|
|
448
|
+
* @description Helper method to validate reaction input data
|
|
449
|
+
* to ensure consistency and prevent invalid operations.
|
|
450
|
+
*
|
|
451
|
+
* @param {IReactionServiceInput} data - Reaction data to validate
|
|
452
|
+
* @returns {Promise<boolean | Error>} - Validation result or error
|
|
453
|
+
*/
|
|
454
|
+
async validateReactionData(data) {
|
|
455
|
+
try {
|
|
456
|
+
if (!data) {
|
|
457
|
+
return new Error('Reaction data is required');
|
|
458
|
+
}
|
|
459
|
+
if (!data.user) {
|
|
460
|
+
return new Error('User is required');
|
|
461
|
+
}
|
|
462
|
+
if (!data.post) {
|
|
463
|
+
return new Error('Post ID is required');
|
|
464
|
+
}
|
|
465
|
+
if (!data.reaction) {
|
|
466
|
+
return new Error('Reaction type is required');
|
|
467
|
+
}
|
|
468
|
+
// Additional validation can be added here
|
|
469
|
+
const validReactionTypes = ['like', 'love', 'laugh', 'wow', 'sad', 'angry', 'care'];
|
|
470
|
+
if (!validReactionTypes.includes(data.reaction.toLowerCase())) {
|
|
471
|
+
return new Error(`Invalid reaction type: ${data.reaction}`);
|
|
472
|
+
}
|
|
473
|
+
return true;
|
|
474
|
+
} catch (error) {
|
|
475
|
+
this.logger.error('Error validating reaction data: %o', error);
|
|
476
|
+
return error instanceof Error ? error : new Error('Unknown error occurred while validating reaction data');
|
|
477
|
+
}
|
|
8
478
|
}
|
|
9
479
|
};
|
|
10
|
-
ReactionMicroservice = __decorate([injectable()
|
|
480
|
+
ReactionMicroservice = __decorate([injectable()
|
|
481
|
+
// @ts-ignore - Type compatibility issue between BaseProxyService and IReactionService
|
|
482
|
+
, __param(0, inject(CommonType.MOLECULER_BROKER)), __param(1, inject('Logger')), __metadata("design:paramtypes", [ServiceBroker, Object])], ReactionMicroservice);export{ReactionMicroservice};//# sourceMappingURL=reaction-microservice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reaction-microservice.js","sources":["../../../src/services/proxy-services/reaction-microservice.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reaction-microservice.js","sources":["../../../src/services/proxy-services/reaction-microservice.ts"],"sourcesContent":[null],"names":[],"mappings":"2UAiBA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAGI,IAAM,oBAAoB,GAA1B,MAAM,oBACT,SAAQ,gBAA2E,CAAA;AAGhE,EAAA,SAAA,GAAY,IAAA,oBAAwB,EAAA;AAC7C,EAAA,MAAA;AAEV,EAAA,KAAA,GAAQ,eAAA,CAAA,eAAgB;aAIpB,CAAA,MAAA,EAAqB,MAEN,EAAA;AAEf,IAAA,KAAA,CAAA,MAAM,EAAA,MAAQ,CAAA,KAAY,CAAA;AAC1B,MAAA,SAAK,EAAA;KACR,CAAA,CAAA;AAED,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA,CAAA,KAAA,CAAA;;AAEG,KAAA,CAAA;;AAEC;;AAGJ;;;;;;;;AAQG;;AAEC;AACI;AACI;mBACH,CAAA,IAAA,EAAA;AAED,IAAA,IAAA;AACI,MAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA;eACH,IAAA,KAAA,CAAA,wCAAA,CAAA;AAED;AACI,MAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA;eACH,IAAA,KAAA,CAAA,qBAAA,CAAA;AAED;gBACI,QAAU,EAAA;mBACD,KAAA,CAAA,8BAAW,CAAA;;AAEvB,MAAA,IAAA,CAAA,MAAE,CAAA,KAAA,CAAA,kCAAA,EAAA;AAEH,QAAA,IAAA,EAAA,IAAM;iBAED,EAAM,IAAA,CAAA,IAAG;AACV,QAAA,YAAA,EAAA,IAAW,CAAA;;AAGf,MAAA,MAAA,MAAW,GAAA,MAAM,kDAAiD,CAAA;AAC9D,MAAA,IAAA,CAAA,MAAA,EAAA;mBACI,KAAM,CAAA,2BAAK,CAAA;;AAElB,MAAA,IAAA,CAAA,MAAE,CAAA,KAAA,CAAA,8CAAA,EAAA;AAEH,QAAA,UAAA,QAA8C,CAAA,EA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