@adminide-stack/marketplace-module-server 12.0.4-alpha.44 → 12.0.4-alpha.441

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 (185) hide show
  1. package/Readme.md +321 -0
  2. package/lib/containers/module.d.ts +8 -0
  3. package/lib/containers/module.d.ts.map +1 -1
  4. package/lib/containers/module.js +15 -5
  5. package/lib/containers/module.js.map +1 -1
  6. package/lib/dataloaders/index.d.ts +1 -0
  7. package/lib/dataloaders/index.d.ts.map +1 -0
  8. package/lib/demo/test-graphql-examples.d.ts +73 -0
  9. package/lib/demo/test-graphql-examples.d.ts.map +1 -0
  10. package/lib/graphql/resolvers/form-templates-resolver.d.ts +220 -0
  11. package/lib/graphql/resolvers/form-templates-resolver.d.ts.map +1 -0
  12. package/lib/graphql/resolvers/form-templates-resolver.js +170 -0
  13. package/lib/graphql/resolvers/form-templates-resolver.js.map +1 -0
  14. package/lib/graphql/resolvers/gallery-resolver.d.ts +15 -0
  15. package/lib/graphql/resolvers/gallery-resolver.d.ts.map +1 -0
  16. package/lib/graphql/resolvers/gallery-resolver.js +35 -0
  17. package/lib/graphql/resolvers/gallery-resolver.js.map +1 -0
  18. package/lib/graphql/resolvers/index.d.ts +247 -1
  19. package/lib/graphql/resolvers/index.d.ts.map +1 -1
  20. package/lib/graphql/resolvers/index.js +1 -0
  21. package/lib/graphql/resolvers/index.js.map +1 -0
  22. package/lib/graphql/resolvers/installed-extension-resolver.d.ts +5 -0
  23. package/lib/graphql/resolvers/installed-extension-resolver.d.ts.map +1 -0
  24. package/lib/graphql/resolvers/installed-extension-resolver.js +309 -0
  25. package/lib/graphql/resolvers/installed-extension-resolver.js.map +1 -0
  26. package/lib/graphql/resolvers/marketplace-form-resolver.d.ts +13 -0
  27. package/lib/graphql/resolvers/marketplace-form-resolver.d.ts.map +1 -0
  28. package/lib/graphql/resolvers/marketplace-form-resolver.js +90 -0
  29. package/lib/graphql/resolvers/marketplace-form-resolver.js.map +1 -0
  30. package/lib/graphql/resolvers/publisher-analytics-resolver.d.ts +14 -0
  31. package/lib/graphql/resolvers/publisher-analytics-resolver.d.ts.map +1 -0
  32. package/lib/graphql/resolvers/publisher-analytics-resolver.js +221 -0
  33. package/lib/graphql/resolvers/publisher-analytics-resolver.js.map +1 -0
  34. package/lib/graphql/resolvers/publisher-resolver.d.ts +5 -0
  35. package/lib/graphql/resolvers/publisher-resolver.d.ts.map +1 -0
  36. package/lib/graphql/resolvers/publisher-resolver.js +176 -0
  37. package/lib/graphql/resolvers/publisher-resolver.js.map +1 -0
  38. package/lib/graphql/resolvers/registry-extension-resolver.d.ts +5 -0
  39. package/lib/graphql/resolvers/registry-extension-resolver.d.ts.map +1 -0
  40. package/lib/graphql/resolvers/registry-extension-resolver.js +46 -0
  41. package/lib/graphql/resolvers/registry-extension-resolver.js.map +1 -0
  42. package/lib/graphql/schemas/extension-pricing.graphql +546 -0
  43. package/lib/graphql/schemas/extension-pricing.graphql.js +1 -0
  44. package/lib/graphql/schemas/extension-pricing.graphql.js.map +1 -0
  45. package/lib/graphql/schemas/extension-registry.graphql +107 -0
  46. package/lib/graphql/schemas/extension-registry.graphql.js +1 -0
  47. package/lib/graphql/schemas/extension-registry.graphql.js.map +1 -0
  48. package/lib/graphql/schemas/form-templates.graphql +269 -0
  49. package/lib/graphql/schemas/form-templates.graphql.js +1 -0
  50. package/lib/graphql/schemas/form-templates.graphql.js.map +1 -0
  51. package/lib/graphql/schemas/gallery-schema.graphql +247 -0
  52. package/lib/graphql/schemas/gallery-schema.graphql.js +1 -0
  53. package/lib/graphql/schemas/gallery-schema.graphql.js.map +1 -0
  54. package/lib/graphql/schemas/index.d.ts.map +1 -1
  55. package/lib/graphql/schemas/index.js +3 -4
  56. package/lib/graphql/schemas/index.js.map +1 -1
  57. package/lib/graphql/schemas/installed-extension.graphql +324 -0
  58. package/lib/graphql/schemas/installed-extension.graphql.js +1 -0
  59. package/lib/graphql/schemas/installed-extension.graphql.js.map +1 -0
  60. package/lib/graphql/schemas/publisher-analytics.graphql +305 -0
  61. package/lib/graphql/schemas/publisher-analytics.graphql.js +1 -0
  62. package/lib/graphql/schemas/publisher-analytics.graphql.js.map +1 -0
  63. package/lib/graphql/schemas/publisher.graphql +376 -0
  64. package/lib/graphql/schemas/publisher.graphql.js +1 -0
  65. package/lib/graphql/schemas/publisher.graphql.js.map +1 -0
  66. package/lib/graphql/schemas/service.graphql +196 -0
  67. package/lib/index.d.ts +3 -1
  68. package/lib/index.d.ts.map +1 -1
  69. package/lib/index.js +1 -1
  70. package/lib/index.js.map +1 -1
  71. package/lib/module.d.ts +1 -1
  72. package/lib/module.d.ts.map +1 -1
  73. package/lib/module.js +10 -23
  74. package/lib/module.js.map +1 -1
  75. package/lib/plugins/extension-moleculer-service.d.ts +86 -0
  76. package/lib/plugins/extension-moleculer-service.d.ts.map +1 -0
  77. package/lib/plugins/index.d.ts +2 -0
  78. package/lib/plugins/index.d.ts.map +1 -0
  79. package/lib/services/extension-gallery-repository.d.ts +17 -0
  80. package/lib/services/extension-gallery-repository.d.ts.map +1 -0
  81. package/lib/services/extension-gallery-repository.js +192 -0
  82. package/lib/services/extension-gallery-repository.js.map +1 -0
  83. package/lib/services/extension-gallery-service-new.d.ts +39 -0
  84. package/lib/services/extension-gallery-service-new.d.ts.map +1 -0
  85. package/lib/services/extension-gallery-service.d.ts +30 -0
  86. package/lib/services/extension-gallery-service.d.ts.map +1 -0
  87. package/lib/services/extension-gallery-service.js +311 -0
  88. package/lib/services/extension-gallery-service.js.map +1 -0
  89. package/lib/services/index.d.ts +6 -1
  90. package/lib/services/index.d.ts.map +1 -1
  91. package/lib/services/installed-extension-service-ext.d.ts +16 -0
  92. package/lib/services/installed-extension-service-ext.d.ts.map +1 -0
  93. package/lib/services/installed-extension-service-ext.js +518 -0
  94. package/lib/services/installed-extension-service-ext.js.map +1 -0
  95. package/lib/services/installed-extension-service.d.ts +105 -0
  96. package/lib/services/installed-extension-service.d.ts.map +1 -0
  97. package/lib/services/installed-extension-service.js +600 -0
  98. package/lib/services/installed-extension-service.js.map +1 -0
  99. package/lib/services/installed-extension-service.test.d.ts +1 -0
  100. package/lib/services/installed-extension-service.test.d.ts.map +1 -0
  101. package/lib/services/publisher-analytics-service.d.ts +128 -0
  102. package/lib/services/publisher-analytics-service.d.ts.map +1 -0
  103. package/lib/services/publisher-event-service.d.ts +48 -0
  104. package/lib/services/publisher-event-service.d.ts.map +1 -0
  105. package/lib/services/publisher-event-service.js +296 -0
  106. package/lib/services/publisher-event-service.js.map +1 -0
  107. package/lib/services/publisher-service-context.d.ts +1 -0
  108. package/lib/services/publisher-service-context.d.ts.map +1 -0
  109. package/lib/services/publisher-service.d.ts +60 -0
  110. package/lib/services/publisher-service.d.ts.map +1 -0
  111. package/lib/services/publisher-service.js +134 -0
  112. package/lib/services/publisher-service.js.map +1 -0
  113. package/lib/store/index.d.ts +1 -1
  114. package/lib/store/index.d.ts.map +1 -1
  115. package/lib/store/models/index.d.ts +2 -1
  116. package/lib/store/models/index.d.ts.map +1 -1
  117. package/lib/store/models/installed-extension-model.d.ts +4 -0
  118. package/lib/store/models/installed-extension-model.d.ts.map +1 -0
  119. package/lib/store/models/installed-extension-model.js +269 -0
  120. package/lib/store/models/installed-extension-model.js.map +1 -0
  121. package/lib/store/models/publisher-event-model.d.ts +11 -0
  122. package/lib/store/models/publisher-event-model.d.ts.map +1 -0
  123. package/lib/store/models/publisher-model.d.ts +5 -0
  124. package/lib/store/models/publisher-model.d.ts.map +1 -0
  125. package/lib/store/models/publisher-model.js +103 -0
  126. package/lib/store/models/publisher-model.js.map +1 -0
  127. package/lib/store/models/publisher-stats-model.d.ts +1 -0
  128. package/lib/store/models/publisher-stats-model.d.ts.map +1 -0
  129. package/lib/store/repositories/index.d.ts +3 -0
  130. package/lib/store/repositories/index.d.ts.map +1 -0
  131. package/lib/store/repositories/installed-extension-repository.d.ts +73 -0
  132. package/lib/store/repositories/installed-extension-repository.d.ts.map +1 -0
  133. package/lib/store/repositories/installed-extension-repository.js +442 -0
  134. package/lib/store/repositories/installed-extension-repository.js.map +1 -0
  135. package/lib/store/repositories/publisher-analytics-repository.d.ts +1 -0
  136. package/lib/store/repositories/publisher-analytics-repository.d.ts.map +1 -0
  137. package/lib/store/repositories/publisher-repository.d.ts +19 -0
  138. package/lib/store/repositories/publisher-repository.d.ts.map +1 -0
  139. package/lib/store/repositories/publisher-repository.js +87 -0
  140. package/lib/store/repositories/publisher-repository.js.map +1 -0
  141. package/lib/templates/constants/DB_COLL_NAMES.ts.template +5 -0
  142. package/lib/templates/constants/SERVER_TYPES.ts.template +10 -4
  143. package/lib/templates/repositories/ExtensionGalleryRepository.ts.template +44 -0
  144. package/lib/templates/repositories/InstalledExtensionRepository.ts.template +94 -0
  145. package/lib/templates/repositories/MarketplacePublisherRepository.ts.template +24 -0
  146. package/lib/templates/repositories/RegistryExtensionRepository.ts.template +10 -15
  147. package/lib/templates/services/ExtensionGalleryDataLoader.ts.template +2 -0
  148. package/lib/templates/services/ExtensionGalleryService.ts.template +79 -0
  149. package/lib/templates/services/InstalledExtensionDataLoader.ts.template +2 -0
  150. package/lib/templates/services/InstalledExtensionService.ts.template +193 -0
  151. package/lib/templates/services/MarketplacePublisherService.ts.template +49 -0
  152. package/lib/templates/services/PublisherEventService.ts.template +56 -0
  153. package/lib/templates/services/RegistryExtensionService.ts.template +62 -18
  154. package/lib/tests/extension-integration.test.d.ts +1 -0
  155. package/lib/tests/extension-integration.test.d.ts.map +1 -0
  156. package/lib/tests/install-extension-graphql.test.d.ts +2 -0
  157. package/lib/tests/install-extension-graphql.test.d.ts.map +1 -0
  158. package/lib/tests/test-extension-services.d.ts +1 -0
  159. package/lib/tests/test-extension-services.d.ts.map +1 -0
  160. package/lib/utils/publisherValidation.d.ts +23 -0
  161. package/lib/utils/publisherValidation.d.ts.map +1 -0
  162. package/lib/utils/publisherValidation.js +144 -0
  163. package/lib/utils/publisherValidation.js.map +1 -0
  164. package/package.json +15 -7
  165. package/lib/graphql/resolvers/resolvers.d.ts +0 -2
  166. package/lib/graphql/resolvers/resolvers.d.ts.map +0 -1
  167. package/lib/graphql/resolvers/resolvers.js +0 -167
  168. package/lib/graphql/resolvers/resolvers.js.map +0 -1
  169. package/lib/graphql/schemas/extension.graphql +0 -57
  170. package/lib/graphql/schemas/extension.graphql.js +0 -1
  171. package/lib/graphql/schemas/extension.graphql.js.map +0 -1
  172. package/lib/services/extension-service.d.ts +0 -54
  173. package/lib/services/extension-service.d.ts.map +0 -1
  174. package/lib/services/extension-service.js +0 -42
  175. package/lib/services/extension-service.js.map +0 -1
  176. package/lib/store/models/registry-extension-model.d.ts +0 -10
  177. package/lib/store/models/registry-extension-model.d.ts.map +0 -1
  178. package/lib/store/models/registry-extension-model.js +0 -62
  179. package/lib/store/models/registry-extension-model.js.map +0 -1
  180. package/lib/store/repository/index.d.ts +0 -2
  181. package/lib/store/repository/index.d.ts.map +0 -1
  182. package/lib/store/repository/registry-extension-repository.d.ts +0 -31
  183. package/lib/store/repository/registry-extension-repository.d.ts.map +0 -1
  184. package/lib/store/repository/registry-extension-repository.js +0 -135
  185. package/lib/store/repository/registry-extension-repository.js.map +0 -1
@@ -0,0 +1,518 @@
1
+ import {__decorate,__param,__metadata}from'tslib';import {injectable,inject}from'inversify';import {ServiceBroker}from'moleculer';import {CommonType}from'@common-stack/core';import'@cdm-logger/core';import {SERVER_TYPES,ContributionFragmentName,ConfigurationSchemaId,SystemContributionExtensionNames,ExtensionServiceAction,MoleculerServiceName}from'common/server';import {InstalledExtensionService}from'./installed-extension-service.js';/**
2
+ * Convert scope string values from package.json to ConfigurationScope enum numbers
3
+ * Maps: "application" -> 1, "machine" -> 2, "window" -> 3, "resource" -> 4
4
+ */
5
+ function convertScopeStringToNumber(scope) {
6
+ if (typeof scope === 'number') {
7
+ return scope; // Already a number
8
+ }
9
+ if (typeof scope === 'string') {
10
+ const scopeMap = {
11
+ application: 1 /* ConfigurationScope.APPLICATION */,
12
+ machine: 2 /* ConfigurationScope.MACHINE */,
13
+ window: 3 /* ConfigurationScope.WINDOW */,
14
+ resource: 4 /* ConfigurationScope.RESOURCE */
15
+ };
16
+ const normalizedScope = scope.toLowerCase();
17
+ if (normalizedScope in scopeMap) {
18
+ return scopeMap[normalizedScope];
19
+ }
20
+ console.warn(`Unknown scope string: "${scope}", defaulting to WINDOW`);
21
+ }
22
+ // Default to WINDOW scope if undefined or unknown
23
+ return 3 /* ConfigurationScope.WINDOW */;
24
+ }
25
+ /**
26
+ * Recursively process configuration properties to convert scope strings to numbers
27
+ */
28
+ function processConfigurationProperties(properties) {
29
+ if (!properties || typeof properties !== 'object') {
30
+ return properties;
31
+ }
32
+ const processedProperties = {
33
+ ...properties
34
+ };
35
+ for (const [key, value] of Object.entries(processedProperties)) {
36
+ if (value && typeof value === 'object') {
37
+ const objectValue = value;
38
+ // If this property has a scope, convert it
39
+ if ('scope' in objectValue) {
40
+ objectValue.scope = convertScopeStringToNumber(objectValue.scope);
41
+ }
42
+ // Recursively process nested properties
43
+ processedProperties[key] = processConfigurationProperties(objectValue);
44
+ }
45
+ }
46
+ return processedProperties;
47
+ }
48
+ /**
49
+ * Extended InstalledExtensionService that handles Moleculer event broadcasting
50
+ * Follows the pattern of AccountService/AccountServiceExt
51
+ */
52
+ let InstalledExtensionServiceExt = class InstalledExtensionServiceExt extends InstalledExtensionService {
53
+ slugService;
54
+ redisCacheManager;
55
+ constructor(repository, registryService, slugService, redisCacheManager, broker, logger) {
56
+ super(repository, registryService, slugService, broker, logger);
57
+ this.slugService = slugService;
58
+ this.redisCacheManager = redisCacheManager;
59
+ this.setupEventListeners();
60
+ }
61
+ setupEventListeners() {
62
+ // Listen to extension installed events
63
+ this.onExtensionInstalled.event(async event => {
64
+ console.log('_____>>>>>>> EXTENSION INSTALLLED EVENT IS GETTIN CALLED');
65
+ try {
66
+ // Get full extension data with metadata to extract contributions
67
+ const registryExtension = await this.registryExtensionService.findExtension(event.extensionSlug);
68
+ let configurationNodes = [];
69
+ let configurationDefaults = [];
70
+ if (registryExtension) {
71
+ console.log('Extension found:', event.extensionSlug);
72
+ // Get the current release to access the manifest
73
+ // The manifest is stored in the release, not directly in the registry extension
74
+ const currentRelease = registryExtension.releases?.find(release => release.version === registryExtension.version);
75
+ if (currentRelease && currentRelease.manifest) {
76
+ console.log('Found current release with manifest:', registryExtension.version);
77
+ let contributes = null;
78
+ let parsedManifest = null;
79
+ try {
80
+ // Parse the manifest from the release (stored as JSON string)
81
+ parsedManifest = typeof currentRelease.manifest === 'string' ? JSON.parse(currentRelease.manifest) : currentRelease.manifest;
82
+ console.log('Parsed manifest keys:', Object.keys(parsedManifest));
83
+ contributes = parsedManifest.contributes;
84
+ if (contributes) {
85
+ console.log('Contributes keys:', Object.keys(contributes));
86
+ console.log('Configuration exists:', !!contributes.configuration);
87
+ if (contributes.configuration) {
88
+ console.log('Configuration data:', JSON.stringify(contributes.configuration, null, 2));
89
+ }
90
+ }
91
+ } catch (error) {
92
+ console.warn('Failed to parse release manifest:', error);
93
+ }
94
+ // Extract configuration contributions if they exist
95
+ if (contributes && contributes.configuration) {
96
+ console.log('Configuration contributions found, processing...');
97
+ const configurations = Array.isArray(contributes.configuration) ? contributes.configuration : [contributes.configuration];
98
+ // Format contributions for configuration registry
99
+ configurationNodes = configurations.map(config => {
100
+ // Process properties to convert scope strings to numbers
101
+ const processedProperties = processConfigurationProperties(config.properties || {});
102
+ return {
103
+ id: ContributionFragmentName.Settings,
104
+ title: config.title || registryExtension.name,
105
+ description: config.description,
106
+ properties: processedProperties,
107
+ type: config.type || ['object']
108
+ };
109
+ });
110
+ // Create configuration defaults
111
+ configurationDefaults = [{
112
+ source: {
113
+ id: event.extensionSlug,
114
+ displayName: registryExtension.name
115
+ },
116
+ overrides: {} // Default empty overrides
117
+ }];
118
+ console.log(`Processed ${configurationNodes.length} configuration nodes`);
119
+ } else {
120
+ console.log('No configuration contributions found in manifest');
121
+ }
122
+ console.log('CONTRIBUTES========>', JSON.stringify(contributes));
123
+ // Extract UILayout contributions if they exist (same structure as configuration)
124
+ if (contributes && contributes.uiLayout) {
125
+ console.log('UILayout contributions found, processing...');
126
+ const uiLayoutContributions = Array.isArray(contributes.uiLayout) ? contributes.uiLayout : [contributes.uiLayout];
127
+ console.log(`Found ${uiLayoutContributions.length} UILayout contribution(s) in manifest`);
128
+ // Format UILayout contributions (same structure as configuration)
129
+ const uiLayoutNodes = uiLayoutContributions.map(uiLayout => {
130
+ // Process properties to convert scope strings to numbers (same as configuration)
131
+ const processedProperties = processConfigurationProperties(uiLayout.properties || {});
132
+ return {
133
+ id: ContributionFragmentName.Settings,
134
+ title: uiLayout.title || registryExtension.name,
135
+ description: uiLayout.description,
136
+ properties: processedProperties,
137
+ type: uiLayout.type || ['object']
138
+ };
139
+ });
140
+ if (uiLayoutNodes.length > 0) {
141
+ console.log(`Registering ${uiLayoutNodes.length} UILayout configuration nodes`);
142
+ try {
143
+ // Register UILayout contributions (exact same as configuration, just different schema)
144
+ await this.broker.call('ConfigurationRegistryService.registerUILayoutContributions', {
145
+ tenantId: event.tenantId,
146
+ extensionID: event.extensionSlug,
147
+ uiLayoutNodes
148
+ });
149
+ console.log(`✅ UILayout contributions registered successfully for ${event.extensionSlug}`);
150
+ } catch (uiLayoutError) {
151
+ console.error('❌ Failed to register UILayout contributions:', uiLayoutError);
152
+ // This is not fatal, log and continue
153
+ }
154
+ }
155
+ } else {
156
+ console.log('No UILayout contributions found in manifest');
157
+ }
158
+ } else {
159
+ console.log('No current release or manifest found for version:', registryExtension.version);
160
+ }
161
+ } else {
162
+ console.log('No extension found for:', event.extensionSlug);
163
+ }
164
+ // Create the configuration node data that configuration registry expects
165
+ const configurationNode = {
166
+ schemaId: ConfigurationSchemaId.Configuration,
167
+ tenantId: event.tenantId,
168
+ extensionName: event.extensionSlug,
169
+ policyConfigs: event.policies || null,
170
+ configurationNodes,
171
+ configurationDefaults
172
+ };
173
+ const context = {
174
+ schemaId: ConfigurationSchemaId.Configuration,
175
+ tenantId: event.tenantId,
176
+ extensionName: event.extensionSlug,
177
+ accountId: event.installedBy
178
+ // Add other context fields as needed
179
+ };
180
+ console.log('Broadcasting configuration registry event with data:', {
181
+ configurationNode: {
182
+ ...configurationNode,
183
+ configurationNodes: `${configurationNodes.length} nodes`
184
+ },
185
+ context
186
+ });
187
+ // STEP 1: MANDATORY - Register extension in system_extension FIRST (REQUIRED FOR ALL EXTENSIONS)
188
+ console.log('\n🔧 STEP 1: Registering extension in SYSTEM_EXTENSION (MANDATORY)');
189
+ const systemContext = {
190
+ schemaId: ConfigurationSchemaId.Configuration,
191
+ tenantId: event.tenantId,
192
+ extensionName: SystemContributionExtensionNames.SystemExtension,
193
+ accountId: event.installedBy
194
+ };
195
+ let systemExtensionRegistered = false;
196
+ try {
197
+ console.log('Fetching current system_extension document...');
198
+ // Get existing system_extension document
199
+ const existingSystemDoc = await this.broker.call('ConfigurationRegistryService.getConfigurationNodeRegistry', {
200
+ context: systemContext
201
+ });
202
+ // Prepare the merged configuration node
203
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
204
+ const mergedNode = {
205
+ id: ContributionFragmentName.Settings,
206
+ type: ['object'],
207
+ properties: {},
208
+ restrictedProperties: []
209
+ };
210
+ // If document exists, merge existing properties
211
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
212
+ if (existingSystemDoc && existingSystemDoc.configurationNodes) {
213
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
214
+ const existingNodes = existingSystemDoc.configurationNodes || [];
215
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
216
+ const existingSettingsNode = existingNodes.find(
217
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
218
+ node => node.id === ContributionFragmentName.Settings);
219
+ if (existingSettingsNode?.properties) {
220
+ mergedNode.properties = {
221
+ ...existingSettingsNode.properties
222
+ };
223
+ const existingCount = Object.keys(existingSettingsNode.properties).length;
224
+ console.log(`📝 Merging with ${existingCount} existing properties`);
225
+ }
226
+ } else {
227
+ console.log('📝 Creating new system_extension document');
228
+ }
229
+ // Add/update the property for this extension
230
+ mergedNode.properties[`extensions.${event.extensionSlug}`] = {
231
+ type: 'boolean',
232
+ default: true,
233
+ description: `Enable/disable ${event.extensionSlug} extension`,
234
+ scope: 3 /* ConfigurationScope.WINDOW */
235
+ };
236
+ // Prepare final data
237
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
238
+ const finalSystemExtensionNode = {
239
+ schemaId: ConfigurationSchemaId.Configuration,
240
+ tenantId: event.tenantId,
241
+ extensionName: SystemContributionExtensionNames.SystemExtension,
242
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
243
+ policyConfigs: existingSystemDoc?.policyConfigs || null,
244
+ configurationNodes: [mergedNode],
245
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
246
+ configurationDefaults: existingSystemDoc?.configurationDefaults || []
247
+ };
248
+ // Use update if exists, create if new
249
+ const serviceMethod = existingSystemDoc ? 'ConfigurationRegistryService.updateConfigurationNodeRegistry' : 'ConfigurationRegistryService.createConfigurationNodeRegistry';
250
+ await this.broker.call(serviceMethod, {
251
+ data: finalSystemExtensionNode,
252
+ context: systemContext
253
+ });
254
+ systemExtensionRegistered = true;
255
+ const totalExtensions = Object.keys(mergedNode.properties).length;
256
+ console.log(`✅ STEP 1 SUCCESS: Extension registered (total: ${totalExtensions} extensions)`);
257
+ } catch (systemError) {
258
+ console.error('❌ STEP 1 FAILED: System extension registration failed:', systemError);
259
+ throw new Error(`Extension installation failed: Could not register in system (${systemError.message})`);
260
+ }
261
+ // STEP 2: CONDITIONAL - Create extension configuration ONLY IF CONTRIBUTIONS EXIST
262
+ let extensionConfigCreated = false;
263
+ if (configurationNodes.length > 0) {
264
+ console.log('\n📝 STEP 2: Creating extension configuration (contributions exist)');
265
+ try {
266
+ console.log('Broadcasting extension configuration registry...');
267
+ await this.broker.call('ConfigurationRegistryService.createConfigurationNodeRegistry', {
268
+ data: configurationNode,
269
+ context
270
+ });
271
+ extensionConfigCreated = true;
272
+ console.log('✅ STEP 2 SUCCESS: Extension configuration created');
273
+ } catch (configError) {
274
+ console.error('❌ STEP 2 FAILED: Extension configuration creation failed:', configError);
275
+ // This is not fatal since system extension is already registered
276
+ console.warn('⚠️ Extension is registered in system but configuration creation failed');
277
+ }
278
+ } else {
279
+ console.log('\nℹ️ STEP 2: Skipping extension configuration (no contributions found)');
280
+ }
281
+ await this.dropCache();
282
+ console.log('\n=== EXTENSION INSTALLATION COMPLETED ===');
283
+ console.log('System Extension Registered:', systemExtensionRegistered ? '✅' : '❌');
284
+ console.log('Extension Config Created:', extensionConfigCreated ? '✅' : 'ℹ️ Not needed');
285
+ console.log('Overall Installation:', systemExtensionRegistered ? '✅ SUCCESS' : '❌ FAILED');
286
+ } catch (error) {
287
+ console.error('Error processing extension installed event:', error);
288
+ }
289
+ });
290
+ // Listen to extension uninstalled events
291
+ this.onExtensionUninstalled.event(async event => {
292
+ console.log('=== EXTENSION UNINSTALLATION STARTED ===');
293
+ console.log('Extension slug:', event.extensionSlug);
294
+ console.log('Tenant:', event.tenantId);
295
+ let uninstallationSuccessful = false;
296
+ let extensionConfigRemoved = false;
297
+ let systemExtensionUpdated = false;
298
+ try {
299
+ // STEP 1: Remove the extension's own configuration registry entry (if it exists)
300
+ console.log('\n🗑️ STEP 1: Removing extension configuration registry');
301
+ const context = {
302
+ schemaId: ConfigurationSchemaId.Configuration,
303
+ tenantId: event.tenantId,
304
+ extensionName: event.extensionSlug,
305
+ accountId: event.uninstalledBy
306
+ };
307
+ try {
308
+ console.log('Removing extension configuration document...');
309
+ await this.broker.call('ConfigurationRegistryService.removeConfigurationNodeRegistry', {
310
+ context
311
+ });
312
+ extensionConfigRemoved = true;
313
+ console.log('✅ STEP 1 SUCCESS: Extension configuration removed');
314
+ } catch (configError) {
315
+ console.warn('⚠️ STEP 1 WARNING: Extension configuration removal failed (may not exist):', configError);
316
+ // This is not fatal - extension might not have had configuration
317
+ }
318
+ // STEP 1.5: Remove UILayout contributions (if any exist)
319
+ console.log('\n🗑️ STEP 1.5: Removing UILayout contributions (if exist)');
320
+ try {
321
+ console.log('Attempting to remove UILayout contributions...');
322
+ await this.broker.call('ConfigurationRegistryService.removeUILayoutContributions', {
323
+ tenantId: event.tenantId,
324
+ extensionID: event.extensionSlug
325
+ });
326
+ console.log('✅ STEP 1.5 SUCCESS: UILayout contributions removed');
327
+ } catch (uiLayoutError) {
328
+ console.warn('⚠️ STEP 1.5 WARNING: UILayout contributions removal failed (may not exist):', uiLayoutError);
329
+ // This is not fatal - extension might not have had UILayout contributions
330
+ }
331
+ // STEP 2: MANDATORY - Remove extension node from system_extension document
332
+ console.log('\n🔧 STEP 2: Unregistering extension from SYSTEM_EXTENSION (MANDATORY)');
333
+ try {
334
+ // First, get the current system_extension document
335
+ const systemContext = {
336
+ schemaId: ConfigurationSchemaId.Configuration,
337
+ tenantId: event.tenantId,
338
+ extensionName: SystemContributionExtensionNames.SystemExtension,
339
+ accountId: event.uninstalledBy
340
+ };
341
+ console.log('Fetching current system_extension document...');
342
+ const currentSystemDoc = await this.broker.call('ConfigurationRegistryService.getConfigurationNodeRegistry', {
343
+ context: systemContext
344
+ });
345
+ if (currentSystemDoc && currentSystemDoc.configurationNodes) {
346
+ const systemDoc = currentSystemDoc;
347
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
348
+ const configurationNodes = systemDoc.configurationNodes;
349
+ // Find the settings node and remove the extension property
350
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
351
+ const settingsNode = configurationNodes.find(
352
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
353
+ node => node.id === ContributionFragmentName.Settings);
354
+ if (settingsNode?.properties) {
355
+ const propertyKey = `extensions.${event.extensionSlug}`;
356
+ delete settingsNode.properties[propertyKey];
357
+ console.log(`Removing extension property: ${propertyKey}`);
358
+ console.log(`Remaining properties: ${Object.keys(settingsNode.properties).length}`);
359
+ }
360
+ const updatedConfigurationNodes = configurationNodes;
361
+ // Update the system_extension document with the updated nodes
362
+ const updatedSystemExtensionNode = {
363
+ schemaId: ConfigurationSchemaId.Configuration,
364
+ tenantId: event.tenantId,
365
+ extensionName: SystemContributionExtensionNames.SystemExtension,
366
+ policyConfigs: systemDoc.policyConfigs || null,
367
+ configurationNodes: updatedConfigurationNodes,
368
+ configurationDefaults: systemDoc.configurationDefaults || []
369
+ };
370
+ console.log('Updating system_extension document...');
371
+ await this.broker.call('ConfigurationRegistryService.updateConfigurationNodeRegistry', {
372
+ data: updatedSystemExtensionNode,
373
+ context: systemContext
374
+ });
375
+ systemExtensionUpdated = true;
376
+ console.log('✅ STEP 2 SUCCESS: Extension unregistered from system_extension');
377
+ } else {
378
+ console.warn('⚠️ STEP 2 WARNING: No system_extension document found or no configuration nodes');
379
+ systemExtensionUpdated = true; // Consider it successful if document doesn't exist
380
+ }
381
+ } catch (systemError) {
382
+ console.error('❌ STEP 2 FAILED: System extension unregistration failed:', systemError);
383
+ throw new Error(`Extension uninstallation failed: Could not unregister from system (${systemError.message})`);
384
+ }
385
+ // Uninstallation is successful if system extension is updated
386
+ uninstallationSuccessful = systemExtensionUpdated;
387
+ await this.dropCache();
388
+ console.log('\n=== EXTENSION UNINSTALLATION COMPLETED ===');
389
+ console.log('Extension Config Removed:', extensionConfigRemoved ? '✅' : 'ℹ️ Not found');
390
+ console.log('System Extension Updated:', systemExtensionUpdated ? '✅' : '❌');
391
+ console.log('Overall Uninstallation:', uninstallationSuccessful ? '✅ SUCCESS' : '❌ FAILED');
392
+ } catch (error) {
393
+ console.error('❌ EXTENSION UNINSTALLATION FAILED:', error);
394
+ console.error('Error details:', {
395
+ message: error.message,
396
+ stack: error.stack,
397
+ extensionSlug: event.extensionSlug,
398
+ tenantId: event.tenantId,
399
+ extensionConfigRemoved,
400
+ systemExtensionUpdated
401
+ });
402
+ throw error; // Re-throw to ensure calling code knows uninstallation failed
403
+ }
404
+ // Notify other services about the uninstallation
405
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionUninstalled, {
406
+ event
407
+ }, [MoleculerServiceName.ConfigurationService, 'WorkbenchService',
408
+ // Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
409
+ MoleculerServiceName.MailService // Using MailService instead of NotificationService
410
+ ]);
411
+ });
412
+ // Listen to extension enabled events
413
+ this.onExtensionEnabled.event(event => {
414
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionEnabled, {
415
+ event
416
+ }, [MoleculerServiceName.ConfigurationService, 'WorkbenchService' // Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
417
+ ]);
418
+ });
419
+ // Listen to extension disabled events
420
+ this.onExtensionDisabled.event(event => {
421
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionDisabled, {
422
+ event
423
+ }, [MoleculerServiceName.ConfigurationService, 'WorkbenchService' // Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
424
+ ]);
425
+ });
426
+ // Listen to extension updated events
427
+ this.onExtensionUpdated.event(event => {
428
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionUpdated, {
429
+ event
430
+ }, [MoleculerServiceName.ConfigurationService]);
431
+ });
432
+ // Listen to extension version updated events
433
+ this.onExtensionVersionUpdated.event(event => {
434
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionVersionUpdated, {
435
+ event
436
+ }, [MoleculerServiceName.ConfigurationService, 'WorkbenchService',
437
+ // Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
438
+ MoleculerServiceName.MailService // Using MailService instead of NotificationService
439
+ ]);
440
+ });
441
+ // Listen to extension configuration updated events
442
+ this.onExtensionConfigurationUpdated.event(event => {
443
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionConfigurationUpdated, {
444
+ event
445
+ }, [MoleculerServiceName.ConfigurationService, 'WorkbenchService' // Using string literal as MoleculerServiceName.WorkbenchService doesn't exist
446
+ ]);
447
+ });
448
+ // Listen to extension sync completed events
449
+ this.onExtensionSyncCompleted.event(event => {
450
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionSyncCompleted, {
451
+ event
452
+ }, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
453
+ ]);
454
+ });
455
+ // Listen to extension cleanup completed events
456
+ this.onExtensionCleanupCompleted.event(e => {
457
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionCleanupCompleted, {
458
+ event: e
459
+ }, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
460
+ ]);
461
+ });
462
+ // Listen to extension activation failed events
463
+ this.onExtensionActivationFailed.event(event => {
464
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionActivationFailed, {
465
+ event
466
+ }, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
467
+ ]);
468
+ });
469
+ // Listen to extension deprecated events
470
+ this.onExtensionDeprecated.event(event => {
471
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionDeprecated, {
472
+ event
473
+ }, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
474
+ ]);
475
+ });
476
+ // Listen to extension orphaned events
477
+ this.onExtensionOrphaned.event(event => {
478
+ this.broker.broadcast(ExtensionServiceAction.OnExtensionOrphaned, {
479
+ event
480
+ }, [MoleculerServiceName.MailService // Using MailService instead of NotificationService
481
+ ]);
482
+ });
483
+ }
484
+ async dropCache() {
485
+ console.log('Start dropping GraphQL query cache keys');
486
+ try {
487
+ // Get Redis client from redisCacheManager
488
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
489
+ const {
490
+ redisClient
491
+ } = this.redisCacheManager;
492
+ if (!redisClient) {
493
+ console.error('❌ Redis client not found in redisCacheManager');
494
+ return;
495
+ }
496
+ const appName = process.env.APP_NAME || 'adminide-stack';
497
+ // Only delete GraphQL query caches, not session/auth data
498
+ // These are the specific queries we want to invalidate
499
+ const queryPatterns = [`${appName}*pageSettings*`, `${appName}*GetPageSettings*`, `${appName}*CurrentPagePermissions*`, `${appName}*IntegrationConfigurations*`, `${appName}*ContributionRoles*`];
500
+ let totalDeleted = 0;
501
+ for (const pattern of queryPatterns) {
502
+ console.log(`🔍 Searching for keys matching: ${pattern}`);
503
+ const keys = await redisClient.keys(pattern);
504
+ if (keys.length > 0) {
505
+ console.log(`📋 Found ${keys.length} keys for pattern: ${pattern}`);
506
+ console.log(`📝 Sample keys:`, keys.slice(0, 3));
507
+ await redisClient.del(...keys);
508
+ totalDeleted += keys.length;
509
+ }
510
+ }
511
+ console.log(`✅ Successfully deleted ${totalDeleted} query cache keys`);
512
+ } catch (error) {
513
+ console.error('❌ Failed to drop cache:', error);
514
+ // Don't throw - cache clearing failure shouldn't break extension installation
515
+ }
516
+ }
517
+ };
518
+ InstalledExtensionServiceExt = __decorate([injectable(), __param(0, inject(SERVER_TYPES.IInstalledExtensionRepository)), __param(1, inject(SERVER_TYPES.IRegistryExtensionService)), __param(2, inject(SERVER_TYPES.SlugService)), __param(3, inject(SERVER_TYPES.IRedisCacheManager)), __param(4, inject(CommonType.MOLECULER_BROKER)), __param(5, inject(CommonType.LOGGER)), __metadata("design:paramtypes", [Object, Object, Object, Object, ServiceBroker, Object])], InstalledExtensionServiceExt);export{InstalledExtensionServiceExt};//# sourceMappingURL=installed-extension-service-ext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installed-extension-service-ext.js","sources":["../../src/services/installed-extension-service-ext.ts"],"sourcesContent":[null],"names":[],"mappings":"qbA4FG;AACH;;AAQQ;;AAQJ,EAAA,IAAA,OAAQ,KAAA,KAAA,QAAmB,EAAA;gBA6gBb,CAAA;AA8CjB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,105 @@
1
+ import { CdmLogger } from '@cdm-logger/core';
2
+ import { ServiceBroker } from 'moleculer';
3
+ import { Disposable, DisposableCollection, Emitter } from '@adminide-stack/core';
4
+ import { BaseService2 } from '@common-stack/store-mongo';
5
+ import { IInstalledExtensionModel, ICreateInstalledExtensionInput, IUpdateInstalledExtensionInput, IRegistryExtensionService, IInstalledExtensionFilter, IInstalledExtensionService, IInstalledExtensionRepository, IExtensionInstalledEvent, IExtensionUninstalledEvent, IExtensionEnabledEvent, IExtensionDisabledEvent, IExtensionUpdatedEvent, IExtensionVersionUpdatedEvent, IExtensionStatusChangedEvent, IExtensionActivationFailedEvent, IExtensionDeprecatedEvent, IExtensionOrphanedEvent, IExtensionConfigurationUpdatedEvent, IExtensionSyncCompletedEvent, IExtensionCleanupCompletedEvent, AsDomainType, ISlugService } from 'common/server';
6
+ export declare class InstalledExtensionService extends BaseService2<IInstalledExtensionModel> implements IInstalledExtensionService, Disposable {
7
+ private installedExtensionRepository;
8
+ protected registryExtensionService: IRegistryExtensionService;
9
+ protected slugService: ISlugService;
10
+ protected broker: ServiceBroker;
11
+ protected readonly onExtensionInstalled: Emitter<IExtensionInstalledEvent>;
12
+ protected readonly onExtensionUninstalled: Emitter<IExtensionUninstalledEvent>;
13
+ protected readonly onExtensionEnabled: Emitter<IExtensionEnabledEvent>;
14
+ protected readonly onExtensionDisabled: Emitter<IExtensionDisabledEvent>;
15
+ protected readonly onExtensionUpdated: Emitter<IExtensionUpdatedEvent>;
16
+ protected readonly onExtensionVersionUpdated: Emitter<IExtensionVersionUpdatedEvent>;
17
+ protected readonly onExtensionConfigurationUpdated: Emitter<IExtensionConfigurationUpdatedEvent>;
18
+ protected readonly onExtensionSyncCompleted: Emitter<IExtensionSyncCompletedEvent>;
19
+ protected readonly onExtensionCleanupCompleted: Emitter<IExtensionCleanupCompletedEvent>;
20
+ protected readonly onExtensionStatusChanged: Emitter<IExtensionStatusChangedEvent>;
21
+ protected readonly onExtensionActivationFailed: Emitter<IExtensionActivationFailedEvent>;
22
+ protected readonly onExtensionDeprecated: Emitter<IExtensionDeprecatedEvent>;
23
+ protected readonly onExtensionOrphaned: Emitter<IExtensionOrphanedEvent>;
24
+ protected readonly toDispose: DisposableCollection;
25
+ private logger;
26
+ constructor(installedExtensionRepository: IInstalledExtensionRepository, registryExtensionService: IRegistryExtensionService, slugService: ISlugService, broker: ServiceBroker, logger: CdmLogger.ILogger);
27
+ dispose(): void;
28
+ private resolveExtensionSlug;
29
+ /**
30
+ * Install a new extension from the registry
31
+ */
32
+ installExtension(input: ICreateInstalledExtensionInput, tenantId: string): Promise<AsDomainType<IInstalledExtensionModel>>;
33
+ /**
34
+ * Internal method to perform the actual installation after validation
35
+ */
36
+ private doInstallExtension;
37
+ /**
38
+ * Uninstall an extension
39
+ */
40
+ uninstallExtension(orgId: string, extensionSlug: string, uninstalledBy: string, tenantId: any): Promise<boolean>;
41
+ /**
42
+ * Update an installed extension's configuration or status
43
+ */
44
+ updateInstalledExtension(orgId: string, extensionSlug: string, update: IUpdateInstalledExtensionInput, tenantId: string): Promise<AsDomainType<IInstalledExtensionModel>>;
45
+ /**
46
+ * Get a specific installed extension
47
+ */
48
+ getInstalledExtension(orgId: string, extensionSlug: string): Promise<AsDomainType<IInstalledExtensionModel> | null>;
49
+ /**
50
+ * Get all installed extensions for a tenant with optional filtering
51
+ */
52
+ getInstalledExtensions(filter: IInstalledExtensionFilter): Promise<AsDomainType<IInstalledExtensionModel>[]>;
53
+ /**
54
+ * Enable/disable an installed extension
55
+ */
56
+ toggleExtension(orgId: string, extensionSlug: string, enabled: boolean, toggledBy: string, tenantId: string): Promise<AsDomainType<IInstalledExtensionModel>>;
57
+ /**
58
+ * Update extension settings/configuration
59
+ */
60
+ updateExtensionSettings(orgId: string, extensionSlug: string, userConfig: Record<string, unknown>, updatedBy: string, tenantId: string): Promise<AsDomainType<IInstalledExtensionModel>>;
61
+ /**
62
+ * Check for extension updates and return available updates
63
+ */
64
+ checkForUpdates(orgId: string, extensionSlug?: string): Promise<Array<{
65
+ extensionId: string;
66
+ extensionSlug: string;
67
+ currentVersion: string;
68
+ availableVersion: string;
69
+ isSecurityUpdate: boolean;
70
+ }>>;
71
+ /**
72
+ * Update an extension to a newer version
73
+ */
74
+ updateExtensionVersion(orgId: string, extensionSlug: string, targetVersion: string, updatedBy: string, tenantId: any): Promise<AsDomainType<IInstalledExtensionModel>>;
75
+ /**
76
+ * Sync installed extensions with registry status
77
+ */
78
+ syncWithRegistry(orgId: string, tenantId: string): Promise<void>;
79
+ /**
80
+ * Get extensions that need attention
81
+ */
82
+ getExtensionsNeedingAttention(orgId: string): Promise<AsDomainType<IInstalledExtensionModel>[]>;
83
+ /**
84
+ * Clean up deprecated or removed extensions based on policies
85
+ */
86
+ cleanupExtensions(orgId: string, tenantId: string, dryRun?: boolean): Promise<{
87
+ removed: string[];
88
+ deprecated: string[];
89
+ warnings: string[];
90
+ }>;
91
+ /**
92
+ * Sync installed_extensions with system_extension registry
93
+ * Removes extensions from installed_extensions and configuration_registries
94
+ * if they are not present in system_extension registry
95
+ */
96
+ cleanupOrphanedExtensions(orgId: string, tenantId: string, dryRun?: boolean): Promise<{
97
+ removed: string[];
98
+ warnings: string[];
99
+ }>;
100
+ /**
101
+ * Check if update is a security update (simplified logic)
102
+ */
103
+ private isSecurityUpdate;
104
+ }
105
+ //# sourceMappingURL=installed-extension-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installed-extension-service.d.ts","sourceRoot":"","sources":["../../src/services/installed-extension-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAA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