@messenger-box/platform-server 10.0.3-alpha.7 → 10.0.3-alpha.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/lib/config/env-config.d.ts +7 -0
  2. package/lib/config/env-config.js +20 -0
  3. package/lib/config/env-config.js.map +1 -1
  4. package/lib/containers/containers.js +9 -1
  5. package/lib/containers/containers.js.map +1 -1
  6. package/lib/containers/context-services-from-container.d.ts +1 -1
  7. package/lib/containers/context-services-from-container.js +4 -2
  8. package/lib/containers/context-services-from-container.js.map +1 -1
  9. package/lib/graphql/resolvers/ai-fragment.d.ts +3 -0
  10. package/lib/graphql/resolvers/ai-fragment.js +276 -0
  11. package/lib/graphql/resolvers/ai-fragment.js.map +1 -0
  12. package/lib/graphql/resolvers/channel-member.d.ts +3 -2
  13. package/lib/graphql/resolvers/channel-member.js +30 -5
  14. package/lib/graphql/resolvers/channel-member.js.map +1 -1
  15. package/lib/graphql/resolvers/channel.d.ts +3 -2
  16. package/lib/graphql/resolvers/channel.js +308 -53
  17. package/lib/graphql/resolvers/channel.js.map +1 -1
  18. package/lib/graphql/resolvers/extended-token-account.d.ts +3 -2
  19. package/lib/graphql/resolvers/extended-token-account.js +90 -23
  20. package/lib/graphql/resolvers/extended-token-account.js.map +1 -1
  21. package/lib/graphql/resolvers/index.d.ts +1 -1
  22. package/lib/graphql/resolvers/index.js +1 -1
  23. package/lib/graphql/resolvers/index.js.map +1 -1
  24. package/lib/graphql/resolvers/post-thread.d.ts +1 -1
  25. package/lib/graphql/resolvers/post-thread.js +294 -132
  26. package/lib/graphql/resolvers/post-thread.js.map +1 -1
  27. package/lib/graphql/resolvers/post.d.ts +2 -3
  28. package/lib/graphql/resolvers/post.js +874 -239
  29. package/lib/graphql/resolvers/post.js.map +1 -1
  30. package/lib/graphql/resolvers/reaction.d.ts +3 -2
  31. package/lib/graphql/resolvers/reaction.js +96 -14
  32. package/lib/graphql/resolvers/reaction.js.map +1 -1
  33. package/lib/graphql/schema/ai-fragment.graphql +311 -0
  34. package/lib/graphql/schema/ai-fragment.graphql.js +1 -0
  35. package/lib/graphql/schema/ai-fragment.graphql.js.map +1 -0
  36. package/lib/graphql/schema/channel-member.graphql +110 -21
  37. package/lib/graphql/schema/channel-member.graphql.js +1 -1
  38. package/lib/graphql/schema/channel.graphql +356 -38
  39. package/lib/graphql/schema/channel.graphql.js +1 -1
  40. package/lib/graphql/schema/index.js +2 -2
  41. package/lib/graphql/schema/index.js.map +1 -1
  42. package/lib/graphql/schema/post-thread.graphql +167 -21
  43. package/lib/graphql/schema/post-thread.graphql.js +1 -1
  44. package/lib/graphql/schema/post.graphql +360 -40
  45. package/lib/graphql/schema/post.graphql.js +1 -1
  46. package/lib/graphql/schema/reaction.graphql +71 -13
  47. package/lib/graphql/schema/reaction.graphql.js +1 -1
  48. package/lib/graphql/schema/services.graphql +21 -0
  49. package/lib/graphql/schema/users.graphql +76 -13
  50. package/lib/graphql/schema/users.graphql.js +1 -1
  51. package/lib/index.js +1 -1
  52. package/lib/index.js.map +1 -1
  53. package/lib/inngest/factory.d.ts +20 -0
  54. package/lib/inngest/factory.js +4 -0
  55. package/lib/inngest/factory.js.map +1 -0
  56. package/lib/inngest/functions.d.ts +235 -0
  57. package/lib/inngest/functions.js +1385 -0
  58. package/lib/inngest/functions.js.map +1 -0
  59. package/lib/inngest/index.d.ts +3 -0
  60. package/lib/inngest/prompt.d.ts +6 -0
  61. package/lib/inngest/prompt.js +871 -0
  62. package/lib/inngest/prompt.js.map +1 -0
  63. package/lib/inngest/utils.d.ts +5 -0
  64. package/lib/inngest/utils.js +32 -0
  65. package/lib/inngest/utils.js.map +1 -0
  66. package/lib/interfaces/index.d.ts +0 -1
  67. package/lib/interfaces/services.d.ts +1 -1
  68. package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.d.ts +17 -0
  69. package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.js +44 -0
  70. package/lib/migrations/dbMigrations/AddPostsConfigurationsMigration.js.map +1 -0
  71. package/lib/migrations/dbMigrations/index.d.ts +1 -0
  72. package/lib/migrations/index.d.ts +1 -0
  73. package/lib/migrations/mail-template-migration.js +1 -1
  74. package/lib/migrations/message-notification-template-migration.d.ts +1 -1
  75. package/lib/migrations/message-notification-template-migration.js +1 -1
  76. package/lib/module.js +10 -3
  77. package/lib/module.js.map +1 -1
  78. package/lib/plugins/ai-fragment-moleculer-service.d.ts +29 -0
  79. package/lib/plugins/ai-fragment-moleculer-service.js +516 -0
  80. package/lib/plugins/ai-fragment-moleculer-service.js.map +1 -0
  81. package/lib/plugins/channel-moleculer-service.d.ts +21 -1
  82. package/lib/plugins/channel-moleculer-service.js +426 -115
  83. package/lib/plugins/channel-moleculer-service.js.map +1 -1
  84. package/lib/plugins/extended-token-account-moleculer-service.d.ts +25 -1
  85. package/lib/plugins/extended-token-account-moleculer-service.js +348 -22
  86. package/lib/plugins/extended-token-account-moleculer-service.js.map +1 -1
  87. package/lib/plugins/index.d.ts +1 -0
  88. package/lib/plugins/messenger-notification-moleculer-service.d.ts +27 -3
  89. package/lib/plugins/messenger-notification-moleculer-service.js +404 -58
  90. package/lib/plugins/messenger-notification-moleculer-service.js.map +1 -1
  91. package/lib/plugins/post-moleculer-service.d.ts +85 -21
  92. package/lib/plugins/post-moleculer-service.js +1102 -256
  93. package/lib/plugins/post-moleculer-service.js.map +1 -1
  94. package/lib/plugins/post-thread-moleculer-service.d.ts +33 -1
  95. package/lib/plugins/post-thread-moleculer-service.js +326 -8
  96. package/lib/plugins/post-thread-moleculer-service.js.map +1 -1
  97. package/lib/plugins/reaction-moleculer-service.js +1 -1
  98. package/lib/plugins/reaction-moleculer-service.js.map +1 -1
  99. package/lib/preferences/settings/post-settings.d.ts +2 -0
  100. package/lib/preferences/settings/post-settings.js +47 -9
  101. package/lib/preferences/settings/post-settings.js.map +1 -1
  102. package/lib/services/ai-fragment-service.d.ts +195 -0
  103. package/lib/services/ai-fragment-service.js +631 -0
  104. package/lib/services/ai-fragment-service.js.map +1 -0
  105. package/lib/services/channel-service.d.ts +181 -33
  106. package/lib/services/channel-service.js +842 -273
  107. package/lib/services/channel-service.js.map +1 -1
  108. package/lib/services/extended-token-account-service.d.ts +130 -14
  109. package/lib/services/extended-token-account-service.js +462 -52
  110. package/lib/services/extended-token-account-service.js.map +1 -1
  111. package/lib/services/index.d.ts +3 -0
  112. package/lib/services/messenger-notification-service.d.ts +106 -13
  113. package/lib/services/messenger-notification-service.js +824 -442
  114. package/lib/services/messenger-notification-service.js.map +1 -1
  115. package/lib/services/post-service.d.ts +189 -16
  116. package/lib/services/post-service.js +949 -113
  117. package/lib/services/post-service.js.map +1 -1
  118. package/lib/services/post-thread-service.d.ts +114 -5
  119. package/lib/services/post-thread-service.js +400 -13
  120. package/lib/services/post-thread-service.js.map +1 -1
  121. package/lib/services/proxy-services/ai-fragment-microservice.d.ts +23 -0
  122. package/lib/services/proxy-services/ai-fragment-microservice.js +78 -0
  123. package/lib/services/proxy-services/ai-fragment-microservice.js.map +1 -0
  124. package/lib/services/proxy-services/channel-microservice.d.ts +6 -3
  125. package/lib/services/proxy-services/channel-microservice.js +25 -10
  126. package/lib/services/proxy-services/channel-microservice.js.map +1 -1
  127. package/lib/services/proxy-services/index.d.ts +1 -0
  128. package/lib/services/proxy-services/messenger-notification-microservice.d.ts +128 -8
  129. package/lib/services/proxy-services/messenger-notification-microservice.js +324 -29
  130. package/lib/services/proxy-services/messenger-notification-microservice.js.map +1 -1
  131. package/lib/services/proxy-services/post-microservice.d.ts +207 -12
  132. package/lib/services/proxy-services/post-microservice.js +623 -54
  133. package/lib/services/proxy-services/post-microservice.js.map +1 -1
  134. package/lib/services/proxy-services/post-thread-microservice.d.ts +134 -3
  135. package/lib/services/proxy-services/post-thread-microservice.js +388 -6
  136. package/lib/services/proxy-services/post-thread-microservice.js.map +1 -1
  137. package/lib/services/proxy-services/reaction-microservice.d.ts +161 -3
  138. package/lib/services/proxy-services/reaction-microservice.js +474 -2
  139. package/lib/services/proxy-services/reaction-microservice.js.map +1 -1
  140. package/lib/services/reaction-service.d.ts +124 -4
  141. package/lib/services/reaction-service.js +415 -3
  142. package/lib/services/reaction-service.js.map +1 -1
  143. package/lib/services/redis-cache-manager.d.ts +18 -0
  144. package/lib/services/redis-cache-manager.js +83 -0
  145. package/lib/services/redis-cache-manager.js.map +1 -0
  146. package/lib/services/sandbox-error-service.d.ts +23 -0
  147. package/lib/services/sandbox-error-service.js +422 -0
  148. package/lib/services/sandbox-error-service.js.map +1 -0
  149. package/lib/store/models/account-token-store.d.ts +1 -1
  150. package/lib/store/models/account-token-store.js.map +1 -1
  151. package/lib/store/models/ai-fragment.d.ts +4 -0
  152. package/lib/store/models/ai-fragment.js +125 -0
  153. package/lib/store/models/ai-fragment.js.map +1 -0
  154. package/lib/store/models/channel.d.ts +2 -3
  155. package/lib/store/models/channel.js +185 -71
  156. package/lib/store/models/channel.js.map +1 -1
  157. package/lib/store/models/index.d.ts +1 -0
  158. package/lib/store/models/post-thread.d.ts +3 -3
  159. package/lib/store/models/post-thread.js +96 -14
  160. package/lib/store/models/post-thread.js.map +1 -1
  161. package/lib/store/models/post.d.ts +2 -3
  162. package/lib/store/models/post.js +143 -23
  163. package/lib/store/models/post.js.map +1 -1
  164. package/lib/store/models/reaction.d.ts +2 -3
  165. package/lib/store/models/reaction.js +67 -8
  166. package/lib/store/models/reaction.js.map +1 -1
  167. package/lib/store/repositories/__tests__/__fixtures__/team-repository.d.ts +3 -3
  168. package/lib/store/repositories/ai-fragment-repository.d.ts +15 -0
  169. package/lib/store/repositories/ai-fragment-repository.js +69 -0
  170. package/lib/store/repositories/ai-fragment-repository.js.map +1 -0
  171. package/lib/store/repositories/channel-repository.d.ts +6 -6
  172. package/lib/store/repositories/channel-repository.js +5 -2
  173. package/lib/store/repositories/channel-repository.js.map +1 -1
  174. package/lib/store/repositories/index.d.ts +1 -0
  175. package/lib/store/repositories/post-repository.d.ts +6 -6
  176. package/lib/store/repositories/post-repository.js +5 -2
  177. package/lib/store/repositories/post-repository.js.map +1 -1
  178. package/lib/store/repositories/post-thread-repository.d.ts +6 -6
  179. package/lib/store/repositories/post-thread-repository.js +5 -2
  180. package/lib/store/repositories/post-thread-repository.js.map +1 -1
  181. package/lib/store/repositories/reaction-repository.d.ts +6 -6
  182. package/lib/store/repositories/reaction-repository.js +5 -2
  183. package/lib/store/repositories/reaction-repository.js.map +1 -1
  184. package/lib/templates/constants/SERVER_TYPES.ts.template +4 -4
  185. package/lib/templates/repositories/AiFragmentRepository.ts.template +4 -0
  186. package/lib/templates/repositories/ChannelRepository.ts.template +3 -3
  187. package/lib/templates/repositories/PostRepository.ts.template +3 -3
  188. package/lib/templates/repositories/PostThreadRepository.ts.template +3 -3
  189. package/lib/templates/repositories/ReactionRepository.ts.template +3 -4
  190. package/lib/templates/services/AiFragmentService.ts.template +123 -0
  191. package/lib/templates/services/ChannelService.ts.template +290 -39
  192. package/lib/templates/services/ExtendedTokenAccountService.ts.template +104 -9
  193. package/lib/templates/services/MessengerNotificationService.ts.template +94 -19
  194. package/lib/templates/services/PostService.ts.template +265 -20
  195. package/lib/templates/services/PostThreadService.ts.template +151 -6
  196. package/lib/templates/services/ReactionService.ts.template +129 -3
  197. package/lib/templates/services/RedisCacheManager.ts.template +22 -0
  198. package/lib/templates/services/SandboxErrorService.ts.template +125 -0
  199. package/package.json +14 -7
  200. package/lib/interfaces/context.d.ts +0 -14
  201. package/lib/store/models/common-options.js +0 -20
  202. package/lib/store/models/common-options.js.map +0 -1
@@ -1,7 +1,133 @@
1
- import { IReaction, IReactionInput } from 'common';
2
- import { IBaseService } from '@common-stack/store-mongo';
1
+ /**
2
+ * Reaction Service Interface
3
+ * --------------------------
4
+ *
5
+ * This interface defines the business logic layer for reaction management
6
+ * within the messenger platform. It provides comprehensive operations for handling
7
+ * emoji reactions, sentiment tracking, and user engagement features across
8
+ * posts, messages, and other interactive content.
9
+ *
10
+ * Key capabilities:
11
+ * - Reaction lifecycle management (addition, removal, updates)
12
+ * - Emoji and custom reaction support
13
+ * - User reaction tracking and analytics
14
+ * - Reaction aggregation and statistics
15
+ * - Cross-platform reaction synchronization
16
+ * - Reaction notification management
17
+ * - Bulk reaction operations
18
+ * - Reaction validation and moderation
19
+ *
20
+ * The service layer abstracts reaction operations and provides a cohesive API
21
+ * for engagement-related functionality throughout the messaging platform,
22
+ * handling user interactions, emotion tracking, and social engagement metrics.
23
+ */
3
24
 
25
+ import { IBaseService, IReactionModel, IReactionInput, Disposable, AsDomainType } from 'common/server';
26
+
27
+ /**
28
+ * Reaction Service Input Interface
29
+ *
30
+ * @description Input parameters for reaction creation and management operations,
31
+ * including user context and reaction metadata.
32
+ */
4
33
  export interface IReactionServiceInput extends IReactionInput {
34
+ /** User identifier who is creating or managing the reaction */
5
35
  user: string;
6
36
  }
7
- export type IReactionService = IBaseService<IReaction, IReactionServiceInput, Partial<IReactionInput>>;
37
+
38
+ /**
39
+ * Reaction Service Interface
40
+ *
41
+ * @description Provides comprehensive reaction management capabilities
42
+ * including emoji reactions, user engagement tracking, and reaction analytics.
43
+ */
44
+ export interface IReactionService extends IBaseService<IReactionModel, IReactionServiceInput, Partial<IReactionInput>>, Disposable {
45
+ /**
46
+ * Adds a reaction to a post or message
47
+ *
48
+ * @description Creates a new reaction entry for a specific content item,
49
+ * handling duplicate detection and user validation.
50
+ *
51
+ * @param {IReactionServiceInput} data - Reaction creation data including user and reaction type
52
+ * @returns {Promise<AsDomainType<IReactionModel> | Error>} - Created reaction or error
53
+ */
54
+ addReaction(data: IReactionServiceInput): Promise<AsDomainType<IReactionModel> | Error>;
55
+
56
+ /**
57
+ * Removes a reaction from a post or message
58
+ *
59
+ * @description Deletes an existing reaction entry, ensuring proper user
60
+ * authorization and content validation.
61
+ *
62
+ * @param {string} reactionId - The unique identifier of the reaction to remove
63
+ * @param {string} userId - The identifier of the user removing the reaction
64
+ * @returns {Promise<boolean | Error>} - Success status or error
65
+ */
66
+ removeReaction(reactionId: string, userId: string): Promise<boolean | Error>;
67
+
68
+ /**
69
+ * Retrieves all reactions for a specific content item
70
+ *
71
+ * @description Fetches reaction data with aggregation and user information
72
+ * for display in the user interface.
73
+ *
74
+ * @param {string} contentId - The identifier of the content (post, message, etc.)
75
+ * @param {string} contentType - The type of content being reacted to
76
+ * @returns {Promise<Array<AsDomainType<IReactionModel>> | Error>} - Array of reactions or error
77
+ */
78
+ getReactionsByContent(contentId: string, contentType: string): Promise<Array<AsDomainType<IReactionModel>> | Error>;
79
+
80
+ /**
81
+ * Retrieves reaction statistics for content
82
+ *
83
+ * @description Provides aggregated reaction counts and statistics
84
+ * for analytics and display purposes.
85
+ *
86
+ * @param {string} contentId - The identifier of the content
87
+ * @param {string} contentType - The type of content
88
+ * @returns {Promise<Record<string, any> | Error>} - Reaction statistics or error
89
+ */
90
+ getReactionStats(contentId: string, contentType: string): Promise<Record<string, any> | Error>;
91
+
92
+ /**
93
+ * Checks if a user has reacted to specific content
94
+ *
95
+ * @description Determines whether a user has already reacted to
96
+ * a piece of content, useful for UI state management.
97
+ *
98
+ * @param {string} contentId - The identifier of the content
99
+ * @param {string} userId - The identifier of the user
100
+ * @param {string} reactionType - The type of reaction to check
101
+ * @returns {Promise<boolean | Error>} - True if user has reacted, or error
102
+ */
103
+ hasUserReacted(contentId: string, userId: string, reactionType: string): Promise<boolean | Error>;
104
+
105
+ /**
106
+ * Updates an existing reaction
107
+ *
108
+ * @description Modifies an existing reaction, typically changing
109
+ * the reaction type while maintaining the same user and content association.
110
+ *
111
+ * @param {string} reactionId - The unique identifier of the reaction
112
+ * @param {Partial<IReactionInput>} updates - The reaction updates to apply
113
+ * @returns {Promise<AsDomainType<IReactionModel> | Error>} - Updated reaction or error
114
+ */
115
+ updateReaction(reactionId: string, updates: Partial<IReactionInput>): Promise<AsDomainType<IReactionModel> | Error>;
116
+
117
+ /**
118
+ * Removes all reactions from specific content
119
+ *
120
+ * @description Bulk removes all reactions from a content item,
121
+ * typically used during content deletion or moderation.
122
+ *
123
+ * @param {string} contentId - The identifier of the content
124
+ * @param {string} contentType - The type of content
125
+ * @returns {Promise<number | Error>} - Number of reactions removed or error
126
+ */
127
+ removeAllReactionsByContent(contentId: string, contentType: string): Promise<number | Error>;
128
+
129
+ /**
130
+ * Disposes of resources used by the service
131
+ */
132
+ dispose(): void;
133
+ }
@@ -0,0 +1,22 @@
1
+ import { DocumentNode } from '@apollo/client/index.js';
2
+
3
+ export interface CacheContext {
4
+ userId?: string;
5
+ tenantId?: string;
6
+ }
7
+ export interface IRedisCacheManager {
8
+ get<T>(query: string | DocumentNode, variables: Record<string, any>, ctx?: CacheContext): Promise<T | null>;
9
+ set<T>(
10
+ query: string | DocumentNode,
11
+ variables: Record<string, any>,
12
+ data: T,
13
+ ctx?: CacheContext,
14
+ cachePolicy?: { maxAge: number; scope: string },
15
+ ): Promise<void>;
16
+ del(
17
+ query: string | DocumentNode,
18
+ variables?: Record<string, unknown>,
19
+ ctx?: CacheContext,
20
+ shouldRemoveAll?: boolean,
21
+ ): Promise<void>;
22
+ }
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Sandbox Error Service Interface
3
+ * --------------------------------
4
+ *
5
+ * This interface defines the monitoring and reporting layer for sandbox runtime,
6
+ * build, and compilation errors during ephemeral development sessions.
7
+ *
8
+ * Key capabilities:
9
+ * - Start/stop intensive error monitoring for a sandbox
10
+ * - Detect compilation, build, server start, and runtime errors
11
+ * - Deduplicate and publish structured error events
12
+ * - Manual error reporting and test error generation
13
+ */
14
+
15
+ /**
16
+ * Structured error payload captured from a sandbox
17
+ */
18
+ // export interface ISandboxError {
19
+ // /** Unique error id */
20
+ // id: string;
21
+ // /** Project identifier that owns the sandbox */
22
+ // projectId: string;
23
+ // /** Sandbox identifier */
24
+ // sandboxId: string;
25
+ // /** Error classification, e.g. COMPILATION_ERROR, BUILD_ERROR */
26
+ // errorType: string;
27
+ // /** Human-readable error message */
28
+ // message: string;
29
+ // /** Optional stack trace if available */
30
+ // stack?: string;
31
+ // /** ISO timestamp when the error was observed */
32
+ // timestamp: string;
33
+ // /** Optional URL referencing the sandbox */
34
+ // url?: string;
35
+ // /** Whether the error appears programmatically fixable */
36
+ // fixable: boolean;
37
+ // }
38
+
39
+ /**
40
+ * Alias to align with implementation naming where needed
41
+ */
42
+ // export type SandboxError = ISandboxError;
43
+
44
+ /**
45
+ * Common sandbox error categories
46
+ */
47
+ export enum SandboxErrorType {
48
+ COMPILATION_ERROR = 'COMPILATION_ERROR',
49
+ BUILD_ERROR = 'BUILD_ERROR',
50
+ SERVER_START_ERROR = 'SERVER_START_ERROR',
51
+ SANDBOX_DISCONNECTED = 'SANDBOX_DISCONNECTED',
52
+ UNCAUGHT_EXCEPTION = 'UNCAUGHT_EXCEPTION',
53
+ UNHANDLED_REJECTION = 'UNHANDLED_REJECTION',
54
+ RUNTIME_ERROR = 'RUNTIME_ERROR',
55
+ DEPENDENCY_ERROR = 'DEPENDENCY_ERROR',
56
+ TEST_ERROR = 'TEST_ERROR',
57
+ }
58
+
59
+ /**
60
+ * PubSub topic for sandbox error events
61
+ */
62
+ export const SANDBOX_ERROR_TOPIC = 'SANDBOX_ERROR';
63
+
64
+ /**
65
+ * PubSub payload for sandbox error events
66
+ */
67
+ // export interface ISandboxErrorEventPayload {
68
+ // sandboxError: {
69
+ // projectId: string;
70
+ // sandboxId: string;
71
+ // error: ISandboxError;
72
+ // };
73
+ // }
74
+
75
+ /**
76
+ * Sandbox Error Service contract
77
+ */
78
+ export interface ISandboxErrorService {
79
+ /**
80
+ * Starts intensive error monitoring for the given sandbox.
81
+ *
82
+ * @param {string} projectId - Project identifier
83
+ * @param {string} sandboxId - Sandbox identifier
84
+ * @param {string} url - Optional friendly URL for the sandbox
85
+ * @returns {Promise<void>}
86
+ */
87
+ startErrorMonitoring(projectId: string, sandboxId: string, url: string,id?:string): Promise<void>;
88
+
89
+ /**
90
+ * Stops error monitoring for the given sandbox and clears any state.
91
+ *
92
+ * @param {string} sandboxId - Sandbox identifier
93
+ * @returns {Promise<void>}
94
+ */
95
+ stopErrorMonitoring(sandboxId: string): Promise<void>;
96
+
97
+ /**
98
+ * Manually reports an error for a sandbox.
99
+ *
100
+ * @param {string} projectId - Project identifier
101
+ * @param {string} sandboxId - Sandbox identifier
102
+ * @param {string} errorType - Error classification
103
+ * @param {string} message - Error message
104
+ * @param {string} [stack] - Optional stack trace
105
+ * @param {string} [url] - Optional sandbox URL
106
+ * @returns {Promise<void>}
107
+ */
108
+ reportError(
109
+ projectId: string,
110
+ sandboxId: string,
111
+ errorType: string,
112
+ message: string,
113
+ stack?: string,
114
+ url?: string,
115
+ id?:string
116
+ ): Promise<void>;
117
+
118
+ /**
119
+ * Triggers a test error publication for diagnostics.
120
+ *
121
+ * @param {string} projectId - Project identifier
122
+ * @returns {Promise<void>}
123
+ */
124
+ triggerTestError(projectId: string,id?:string): Promise<void>;
125
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messenger-box/platform-server",
3
- "version": "10.0.3-alpha.7",
3
+ "version": "10.0.3-alpha.74",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -19,10 +19,13 @@
19
19
  "watch": "yarn build:lib:watch"
20
20
  },
21
21
  "dependencies": {
22
- "@container-stack/mailing-api": "5.4.1-alpha.2",
23
- "@messenger-box/core": "10.0.3-alpha.7",
22
+ "@container-stack/mailing-api": "5.4.1-alpha.9",
23
+ "@e2b/code-interpreter": "^1.5.1",
24
+ "@inngest/agent-kit": "^0.8.3",
25
+ "@messenger-box/core": "10.0.3-alpha.74",
24
26
  "@skoropletov/moleculer-cron-tasks": "~0.0.8",
25
- "date-fns": "^4.1.0"
27
+ "date-fns": "^4.1.0",
28
+ "inngest": "^3.39.2"
26
29
  },
27
30
  "peerDependencies": {
28
31
  "@adminide-stack/account-api-server": "*",
@@ -56,18 +59,22 @@
56
59
  "./${libDir}/templates/services/MessengerNotificationService.ts.template",
57
60
  "./${libDir}/templates/services/PostService.ts.template",
58
61
  "./${libDir}/templates/services/PostThreadService.ts.template",
59
- "./${libDir}/templates/services/ReactionService.ts.template"
62
+ "./${libDir}/templates/services/ReactionService.ts.template",
63
+ "./${libDir}/templates/services/RedisCacheManager.ts.template",
64
+ "./${libDir}/templates/services/SandboxErrorService.ts.template",
65
+ "./${libDir}/templates/services/AiFragmentService.ts.template"
60
66
  ],
61
67
  "repositories": [
62
68
  "./${libDir}/templates/repositories/ChannelRepository.ts.template",
63
69
  "./${libDir}/templates/repositories/PostRepository.ts.template",
64
70
  "./${libDir}/templates/repositories/PostThreadRepository.ts.template",
65
- "./${libDir}/templates/repositories/ReactionRepository.ts.template"
71
+ "./${libDir}/templates/repositories/ReactionRepository.ts.template",
72
+ "./${libDir}/templates/repositories/AiFragmentRepository.ts.template"
66
73
  ]
67
74
  }
68
75
  },
69
76
  "typescript": {
70
77
  "definition": "lib/index.d.ts"
71
78
  },
72
- "gitHead": "6c95ed48d37a8f95b0c3db71c1922c0e9e76bcfe"
79
+ "gitHead": "2bfc901f9f0a9da1919294e1ebd8246edec0a3b0"
73
80
  }
@@ -1,14 +0,0 @@
1
- import { ServerContext as AdminIdeServerContext, IConfigurationServerService } from '@adminide-stack/core';
2
- import { IUserProfile, IBaseAccountService, IUserAccount, IConfigurationModel } from 'common';
3
- import { IServices } from './services';
4
- export interface IServerContext extends AdminIdeServerContext {
5
- user: IUserProfile;
6
- accountService?: {
7
- findAccountById: (id: string) => IUserAccount | undefined;
8
- findAccountByUser: (id: string) => IUserAccount | undefined;
9
- } & IBaseAccountService;
10
- configurationService: IConfigurationServerService & {
11
- parser(resource: string, value: string): IConfigurationModel | Error;
12
- };
13
- }
14
- export type IContext = IServerContext & IServices;
@@ -1,20 +0,0 @@
1
- const commonModeSchemaOptions = {
2
- timestamps: true,
3
- toJSON: {
4
- virtuals: true
5
- },
6
- toObject: {
7
- virtuals: true,
8
- getters: true,
9
- transform(doc, ret) {
10
- delete ret.__v;
11
- delete ret._id;
12
- }
13
- }
14
- };
15
- const addIdVirtualFields = schema => {
16
- schema.set('toJSON', {
17
- virtuals: true
18
- });
19
- return schema;
20
- };export{addIdVirtualFields,commonModeSchemaOptions};//# sourceMappingURL=common-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common-options.js","sources":["../../../src/store/models/common-options.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGa,MAAA,uBAAuB,GAAG;AACnC,EAAA,UAAA,EAAU,IAAM;AAChB,EAAA,MAAA,EAAM;AACF,IAAA,QAAA,EAAA;AACH,GAAA;AACD,EAAA,QAAA,EAAQ;AACJ,IAAA,QAAA,EAAA,IAAU;AACV,IAAA,OAAA,EAAA,IAAS;aACA,CAAA,GAAA,EAAI,GAAA,EAAK;aACP,GAAA,CAAA,GAAA;aACA,GAAA,CAAA,GAAA;;AAEd;;AAGQ,MAAA,kBAAkB,GAAG,MAAC,IAAkB;AACjD,EAAA,MAAA,CAAA,GAAO,CAAA,QAAI,EAAQ;AACf,IAAA,QAAA,EAAA;AACH,GAAA,CAAA;AACD,EAAA,OAAA;AACJ"}