@solidxai/core 0.1.10-beta.9 → 0.1.10

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 (1020) hide show
  1. package/CHANGELOG.md +415 -0
  2. package/MICROSOFT_ACTIVE_DIRECTORY_OAUTH_FLOW.md +616 -0
  3. package/ai-interaction-cleanup.sql +53 -0
  4. package/dist/commands/info.command.d.ts.map +1 -1
  5. package/dist/commands/info.command.js +0 -2
  6. package/dist/commands/info.command.js.map +1 -1
  7. package/dist/commands/refresh-model.command.d.ts +1 -7
  8. package/dist/commands/refresh-model.command.d.ts.map +1 -1
  9. package/dist/commands/refresh-model.command.js +4 -49
  10. package/dist/commands/refresh-model.command.js.map +1 -1
  11. package/dist/commands/refresh-module.command.d.ts +0 -2
  12. package/dist/commands/refresh-module.command.d.ts.map +1 -1
  13. package/dist/commands/refresh-module.command.js +3 -16
  14. package/dist/commands/refresh-module.command.js.map +1 -1
  15. package/dist/commands/test-data.command.d.ts +2 -0
  16. package/dist/commands/test-data.command.d.ts.map +1 -1
  17. package/dist/commands/test-data.command.js +32 -6
  18. package/dist/commands/test-data.command.js.map +1 -1
  19. package/dist/constants/error-messages.d.ts +1 -0
  20. package/dist/constants/error-messages.d.ts.map +1 -1
  21. package/dist/constants/error-messages.js +1 -0
  22. package/dist/constants/error-messages.js.map +1 -1
  23. package/dist/controllers/action-metadata.controller.d.ts +1 -20
  24. package/dist/controllers/action-metadata.controller.d.ts.map +1 -1
  25. package/dist/controllers/agent-event.controller.d.ts +1 -20
  26. package/dist/controllers/agent-event.controller.d.ts.map +1 -1
  27. package/dist/controllers/agent-session.controller.d.ts +1 -20
  28. package/dist/controllers/agent-session.controller.d.ts.map +1 -1
  29. package/dist/controllers/chatter-message-details.controller.d.ts +1 -20
  30. package/dist/controllers/chatter-message-details.controller.d.ts.map +1 -1
  31. package/dist/controllers/chatter-message.controller.d.ts +3 -20
  32. package/dist/controllers/chatter-message.controller.d.ts.map +1 -1
  33. package/dist/controllers/chatter-message.controller.js +17 -0
  34. package/dist/controllers/chatter-message.controller.js.map +1 -1
  35. package/dist/controllers/dashboard-user-layout.controller.d.ts +24 -0
  36. package/dist/controllers/dashboard-user-layout.controller.d.ts.map +1 -0
  37. package/dist/controllers/{dashboard-variable.controller.js → dashboard-user-layout.controller.js} +30 -30
  38. package/dist/controllers/dashboard-user-layout.controller.js.map +1 -0
  39. package/dist/controllers/dashboard.controller.d.ts +12 -42
  40. package/dist/controllers/dashboard.controller.d.ts.map +1 -1
  41. package/dist/controllers/dashboard.controller.js +71 -141
  42. package/dist/controllers/dashboard.controller.js.map +1 -1
  43. package/dist/controllers/email-template.controller.d.ts +1 -20
  44. package/dist/controllers/email-template.controller.d.ts.map +1 -1
  45. package/dist/controllers/export-template.controller.d.ts +1 -20
  46. package/dist/controllers/export-template.controller.d.ts.map +1 -1
  47. package/dist/controllers/export-transaction.controller.d.ts +1 -20
  48. package/dist/controllers/export-transaction.controller.d.ts.map +1 -1
  49. package/dist/controllers/gupshup-webhook.controller.d.ts +11 -0
  50. package/dist/controllers/gupshup-webhook.controller.d.ts.map +1 -0
  51. package/dist/controllers/gupshup-webhook.controller.js +87 -0
  52. package/dist/controllers/gupshup-webhook.controller.js.map +1 -0
  53. package/dist/controllers/import-transaction-error-log.controller.d.ts +1 -20
  54. package/dist/controllers/import-transaction-error-log.controller.d.ts.map +1 -1
  55. package/dist/controllers/import-transaction.controller.d.ts +1 -20
  56. package/dist/controllers/import-transaction.controller.d.ts.map +1 -1
  57. package/dist/controllers/list-of-values.controller.d.ts +1 -20
  58. package/dist/controllers/list-of-values.controller.d.ts.map +1 -1
  59. package/dist/controllers/locale.controller.d.ts +1 -20
  60. package/dist/controllers/locale.controller.d.ts.map +1 -1
  61. package/dist/controllers/mcp-audit-log.controller.d.ts +16 -0
  62. package/dist/controllers/mcp-audit-log.controller.d.ts.map +1 -0
  63. package/dist/controllers/{dashboard-question.controller.js → mcp-audit-log.controller.js} +44 -91
  64. package/dist/controllers/mcp-audit-log.controller.js.map +1 -0
  65. package/dist/controllers/media.controller.d.ts +1 -20
  66. package/dist/controllers/media.controller.d.ts.map +1 -1
  67. package/dist/controllers/menu-item-metadata.controller.d.ts +1 -20
  68. package/dist/controllers/menu-item-metadata.controller.d.ts.map +1 -1
  69. package/dist/controllers/meta-cloud-whatsapp-webhook.controller.d.ts +16 -0
  70. package/dist/controllers/meta-cloud-whatsapp-webhook.controller.d.ts.map +1 -0
  71. package/dist/controllers/meta-cloud-whatsapp-webhook.controller.js +133 -0
  72. package/dist/controllers/meta-cloud-whatsapp-webhook.controller.js.map +1 -0
  73. package/dist/controllers/microsoft-active-directory-authentication.controller.d.ts +28 -0
  74. package/dist/controllers/microsoft-active-directory-authentication.controller.d.ts.map +1 -0
  75. package/dist/controllers/microsoft-active-directory-authentication.controller.js +122 -0
  76. package/dist/controllers/microsoft-active-directory-authentication.controller.js.map +1 -0
  77. package/dist/controllers/model-metadata.controller.d.ts +11 -31
  78. package/dist/controllers/model-metadata.controller.d.ts.map +1 -1
  79. package/dist/controllers/model-metadata.controller.js +4 -4
  80. package/dist/controllers/model-metadata.controller.js.map +1 -1
  81. package/dist/controllers/model-sequence.controller.d.ts +1 -20
  82. package/dist/controllers/model-sequence.controller.d.ts.map +1 -1
  83. package/dist/controllers/module-metadata-explorer.controller.d.ts +171 -0
  84. package/dist/controllers/module-metadata-explorer.controller.d.ts.map +1 -0
  85. package/dist/controllers/module-metadata-explorer.controller.js +143 -0
  86. package/dist/controllers/module-metadata-explorer.controller.js.map +1 -0
  87. package/dist/controllers/module-metadata.controller.d.ts +5 -0
  88. package/dist/controllers/module-metadata.controller.d.ts.map +1 -1
  89. package/dist/controllers/module-metadata.controller.js +13 -1
  90. package/dist/controllers/module-metadata.controller.js.map +1 -1
  91. package/dist/controllers/module-package.controller.d.ts +622 -0
  92. package/dist/controllers/module-package.controller.d.ts.map +1 -0
  93. package/dist/controllers/module-package.controller.js +150 -0
  94. package/dist/controllers/module-package.controller.js.map +1 -0
  95. package/dist/controllers/mq-message-queue.controller.d.ts +1 -20
  96. package/dist/controllers/mq-message-queue.controller.d.ts.map +1 -1
  97. package/dist/controllers/mq-message.controller.d.ts +1 -20
  98. package/dist/controllers/mq-message.controller.d.ts.map +1 -1
  99. package/dist/controllers/permission-metadata.controller.d.ts +1 -20
  100. package/dist/controllers/permission-metadata.controller.d.ts.map +1 -1
  101. package/dist/controllers/role-metadata.controller.d.ts +1 -20
  102. package/dist/controllers/role-metadata.controller.d.ts.map +1 -1
  103. package/dist/controllers/saved-filters.controller.d.ts +1 -20
  104. package/dist/controllers/saved-filters.controller.d.ts.map +1 -1
  105. package/dist/controllers/scheduled-job.controller.d.ts +1 -20
  106. package/dist/controllers/scheduled-job.controller.d.ts.map +1 -1
  107. package/dist/controllers/security-rule.controller.d.ts +1 -20
  108. package/dist/controllers/security-rule.controller.d.ts.map +1 -1
  109. package/dist/controllers/service.controller.d.ts +1 -5
  110. package/dist/controllers/service.controller.d.ts.map +1 -1
  111. package/dist/controllers/service.controller.js +6 -11
  112. package/dist/controllers/service.controller.js.map +1 -1
  113. package/dist/controllers/sms-template.controller.d.ts +1 -20
  114. package/dist/controllers/sms-template.controller.d.ts.map +1 -1
  115. package/dist/controllers/test.controller.d.ts +1 -6
  116. package/dist/controllers/test.controller.d.ts.map +1 -1
  117. package/dist/controllers/test.controller.js +2 -20
  118. package/dist/controllers/test.controller.js.map +1 -1
  119. package/dist/controllers/user-activity-history.controller.d.ts +1 -20
  120. package/dist/controllers/user-activity-history.controller.d.ts.map +1 -1
  121. package/dist/controllers/user-view-metadata.controller.d.ts +1 -20
  122. package/dist/controllers/user-view-metadata.controller.d.ts.map +1 -1
  123. package/dist/controllers/user.controller.d.ts +1 -20
  124. package/dist/controllers/user.controller.d.ts.map +1 -1
  125. package/dist/controllers/view-metadata.controller.d.ts +1 -20
  126. package/dist/controllers/view-metadata.controller.d.ts.map +1 -1
  127. package/dist/decorators/dashboard-widget-data-provider.decorator.d.ts +3 -0
  128. package/dist/decorators/dashboard-widget-data-provider.decorator.d.ts.map +1 -0
  129. package/dist/decorators/dashboard-widget-data-provider.decorator.js +8 -0
  130. package/dist/decorators/dashboard-widget-data-provider.decorator.js.map +1 -0
  131. package/dist/dtos/confirm-module-package-import.dto.d.ts +4 -0
  132. package/dist/dtos/confirm-module-package-import.dto.d.ts.map +1 -0
  133. package/dist/dtos/confirm-module-package-import.dto.js +34 -0
  134. package/dist/dtos/confirm-module-package-import.dto.js.map +1 -0
  135. package/dist/dtos/create-dashboard-user-layout.dto.d.ts +10 -0
  136. package/dist/dtos/create-dashboard-user-layout.dto.d.ts.map +1 -0
  137. package/dist/dtos/create-dashboard-user-layout.dto.js +66 -0
  138. package/dist/dtos/create-dashboard-user-layout.dto.js.map +1 -0
  139. package/dist/dtos/create-mcp-audit-log.dto.d.ts +19 -0
  140. package/dist/dtos/create-mcp-audit-log.dto.d.ts.map +1 -0
  141. package/dist/dtos/create-mcp-audit-log.dto.js +118 -0
  142. package/dist/dtos/create-mcp-audit-log.dto.js.map +1 -0
  143. package/dist/dtos/create-model-metadata.dto.d.ts +2 -2
  144. package/dist/dtos/create-model-metadata.dto.d.ts.map +1 -1
  145. package/dist/dtos/create-model-metadata.dto.js +6 -11
  146. package/dist/dtos/create-model-metadata.dto.js.map +1 -1
  147. package/dist/dtos/create-permission-metadata.dto.d.ts.map +1 -1
  148. package/dist/dtos/create-permission-metadata.dto.js +2 -0
  149. package/dist/dtos/create-permission-metadata.dto.js.map +1 -1
  150. package/dist/dtos/create-role-metadata.dto.d.ts +2 -0
  151. package/dist/dtos/create-role-metadata.dto.d.ts.map +1 -1
  152. package/dist/dtos/create-role-metadata.dto.js +13 -1
  153. package/dist/dtos/create-role-metadata.dto.js.map +1 -1
  154. package/dist/dtos/dashboard-variable-options-query.dto.d.ts +7 -0
  155. package/dist/dtos/dashboard-variable-options-query.dto.d.ts.map +1 -0
  156. package/dist/dtos/dashboard-variable-options-query.dto.js +40 -0
  157. package/dist/dtos/dashboard-variable-options-query.dto.js.map +1 -0
  158. package/dist/dtos/dashboard-widget-data-request.dto.d.ts +12 -0
  159. package/dist/dtos/dashboard-widget-data-request.dto.d.ts.map +1 -0
  160. package/dist/dtos/dashboard-widget-data-request.dto.js +65 -0
  161. package/dist/dtos/dashboard-widget-data-request.dto.js.map +1 -0
  162. package/dist/dtos/import-instructions.dto.d.ts +2 -0
  163. package/dist/dtos/import-instructions.dto.d.ts.map +1 -1
  164. package/dist/dtos/import-instructions.dto.js +15 -1
  165. package/dist/dtos/import-instructions.dto.js.map +1 -1
  166. package/dist/dtos/metadata-explorer-references-query.dto.d.ts +10 -0
  167. package/dist/dtos/metadata-explorer-references-query.dto.d.ts.map +1 -0
  168. package/dist/dtos/metadata-explorer-references-query.dto.js +69 -0
  169. package/dist/dtos/metadata-explorer-references-query.dto.js.map +1 -0
  170. package/dist/dtos/metadata-explorer-search-query.dto.d.ts +8 -0
  171. package/dist/dtos/metadata-explorer-search-query.dto.d.ts.map +1 -0
  172. package/dist/dtos/metadata-explorer-search-query.dto.js +55 -0
  173. package/dist/dtos/metadata-explorer-search-query.dto.js.map +1 -0
  174. package/dist/dtos/metadata-explorer-write.dto.d.ts +4 -0
  175. package/dist/dtos/metadata-explorer-write.dto.d.ts.map +1 -0
  176. package/dist/dtos/{invoke-ai-prompt.dto.js → metadata-explorer-write.dto.js} +12 -12
  177. package/dist/dtos/metadata-explorer-write.dto.js.map +1 -0
  178. package/dist/dtos/run-module-package-build.dto.d.ts +5 -0
  179. package/dist/dtos/run-module-package-build.dto.d.ts.map +1 -0
  180. package/dist/dtos/run-module-package-build.dto.js +38 -0
  181. package/dist/dtos/run-module-package-build.dto.js.map +1 -0
  182. package/dist/dtos/run-module-package-seed.dto.d.ts +4 -0
  183. package/dist/dtos/run-module-package-seed.dto.d.ts.map +1 -0
  184. package/dist/dtos/run-module-package-seed.dto.js +34 -0
  185. package/dist/dtos/run-module-package-seed.dto.js.map +1 -0
  186. package/dist/dtos/update-chatter-note-message.dto.d.ts +5 -0
  187. package/dist/dtos/update-chatter-note-message.dto.d.ts.map +1 -0
  188. package/dist/dtos/update-chatter-note-message.dto.js +34 -0
  189. package/dist/dtos/update-chatter-note-message.dto.js.map +1 -0
  190. package/dist/dtos/update-dashboard-user-layout.dto.d.ts +11 -0
  191. package/dist/dtos/update-dashboard-user-layout.dto.d.ts.map +1 -0
  192. package/dist/dtos/{update-dashboard-layout.dto.js → update-dashboard-user-layout.dto.js} +34 -16
  193. package/dist/dtos/update-dashboard-user-layout.dto.js.map +1 -0
  194. package/dist/dtos/update-mcp-audit-log.dto.d.ts +19 -0
  195. package/dist/dtos/update-mcp-audit-log.dto.d.ts.map +1 -0
  196. package/dist/dtos/update-mcp-audit-log.dto.js +117 -0
  197. package/dist/dtos/update-mcp-audit-log.dto.js.map +1 -0
  198. package/dist/dtos/update-permission-metadata.dto.d.ts.map +1 -1
  199. package/dist/dtos/update-permission-metadata.dto.js +3 -1
  200. package/dist/dtos/update-permission-metadata.dto.js.map +1 -1
  201. package/dist/dtos/update-role-metadata.dto.d.ts +2 -0
  202. package/dist/dtos/update-role-metadata.dto.d.ts.map +1 -1
  203. package/dist/dtos/update-role-metadata.dto.js +13 -1
  204. package/dist/dtos/update-role-metadata.dto.js.map +1 -1
  205. package/dist/entities/action-metadata.entity.d.ts.map +1 -1
  206. package/dist/entities/action-metadata.entity.js +1 -0
  207. package/dist/entities/action-metadata.entity.js.map +1 -1
  208. package/dist/entities/agent-event.entity.d.ts.map +1 -1
  209. package/dist/entities/agent-event.entity.js +1 -0
  210. package/dist/entities/agent-event.entity.js.map +1 -1
  211. package/dist/entities/agent-session.entity.d.ts.map +1 -1
  212. package/dist/entities/agent-session.entity.js +1 -0
  213. package/dist/entities/agent-session.entity.js.map +1 -1
  214. package/dist/entities/chatter-message.entity.d.ts.map +1 -1
  215. package/dist/entities/chatter-message.entity.js +2 -0
  216. package/dist/entities/chatter-message.entity.js.map +1 -1
  217. package/dist/entities/dashboard-user-layout.entity.d.ts +11 -0
  218. package/dist/entities/dashboard-user-layout.entity.d.ts.map +1 -0
  219. package/dist/entities/dashboard-user-layout.entity.js +52 -0
  220. package/dist/entities/dashboard-user-layout.entity.js.map +1 -0
  221. package/dist/entities/email-template.entity.d.ts.map +1 -1
  222. package/dist/entities/email-template.entity.js +1 -0
  223. package/dist/entities/email-template.entity.js.map +1 -1
  224. package/dist/entities/field-metadata.entity.d.ts.map +1 -1
  225. package/dist/entities/field-metadata.entity.js +4 -0
  226. package/dist/entities/field-metadata.entity.js.map +1 -1
  227. package/dist/entities/legacy-common-with-id.entity.d.ts +2 -2
  228. package/dist/entities/legacy-common-with-id.entity.d.ts.map +1 -1
  229. package/dist/entities/legacy-common-with-id.entity.js +6 -6
  230. package/dist/entities/legacy-common-with-id.entity.js.map +1 -1
  231. package/dist/entities/legacy-common.entity.d.ts +1 -1
  232. package/dist/entities/legacy-common.entity.d.ts.map +1 -1
  233. package/dist/entities/legacy-common.entity.js +14 -14
  234. package/dist/entities/legacy-common.entity.js.map +1 -1
  235. package/dist/entities/list-of-values.entity.d.ts.map +1 -1
  236. package/dist/entities/list-of-values.entity.js +4 -0
  237. package/dist/entities/list-of-values.entity.js.map +1 -1
  238. package/dist/entities/locale.entity.d.ts.map +1 -1
  239. package/dist/entities/locale.entity.js +1 -0
  240. package/dist/entities/locale.entity.js.map +1 -1
  241. package/dist/entities/mcp-audit-log.entity.d.ts +19 -0
  242. package/dist/entities/mcp-audit-log.entity.d.ts.map +1 -0
  243. package/dist/entities/mcp-audit-log.entity.js +90 -0
  244. package/dist/entities/mcp-audit-log.entity.js.map +1 -0
  245. package/dist/entities/media.entity.d.ts.map +1 -1
  246. package/dist/entities/media.entity.js +1 -0
  247. package/dist/entities/media.entity.js.map +1 -1
  248. package/dist/entities/menu-item-metadata.entity.d.ts.map +1 -1
  249. package/dist/entities/menu-item-metadata.entity.js +2 -0
  250. package/dist/entities/menu-item-metadata.entity.js.map +1 -1
  251. package/dist/entities/model-metadata.entity.d.ts +2 -2
  252. package/dist/entities/model-metadata.entity.d.ts.map +1 -1
  253. package/dist/entities/model-metadata.entity.js +8 -8
  254. package/dist/entities/model-metadata.entity.js.map +1 -1
  255. package/dist/entities/module-metadata.entity.d.ts.map +1 -1
  256. package/dist/entities/module-metadata.entity.js +2 -0
  257. package/dist/entities/module-metadata.entity.js.map +1 -1
  258. package/dist/entities/permission-metadata.entity.d.ts.map +1 -1
  259. package/dist/entities/permission-metadata.entity.js.map +1 -1
  260. package/dist/entities/role-metadata.entity.d.ts +2 -0
  261. package/dist/entities/role-metadata.entity.d.ts.map +1 -1
  262. package/dist/entities/role-metadata.entity.js +10 -2
  263. package/dist/entities/role-metadata.entity.js.map +1 -1
  264. package/dist/entities/saved-filters.entity.d.ts.map +1 -1
  265. package/dist/entities/saved-filters.entity.js +3 -0
  266. package/dist/entities/saved-filters.entity.js.map +1 -1
  267. package/dist/entities/scheduled-job.entity.d.ts.map +1 -1
  268. package/dist/entities/scheduled-job.entity.js +2 -0
  269. package/dist/entities/scheduled-job.entity.js.map +1 -1
  270. package/dist/entities/security-rule.entity.d.ts.map +1 -1
  271. package/dist/entities/security-rule.entity.js +1 -0
  272. package/dist/entities/security-rule.entity.js.map +1 -1
  273. package/dist/entities/sms-template.entity.d.ts.map +1 -1
  274. package/dist/entities/sms-template.entity.js +2 -0
  275. package/dist/entities/sms-template.entity.js.map +1 -1
  276. package/dist/entities/user-activity-history.entity.d.ts.map +1 -1
  277. package/dist/entities/user-activity-history.entity.js +1 -0
  278. package/dist/entities/user-activity-history.entity.js.map +1 -1
  279. package/dist/entities/user.entity.d.ts +3 -0
  280. package/dist/entities/user.entity.d.ts.map +1 -1
  281. package/dist/entities/user.entity.js +15 -1
  282. package/dist/entities/user.entity.js.map +1 -1
  283. package/dist/entities/view-metadata.entity.d.ts.map +1 -1
  284. package/dist/entities/view-metadata.entity.js +2 -0
  285. package/dist/entities/view-metadata.entity.js.map +1 -1
  286. package/dist/enums/legacy-table-type.enum.d.ts +6 -0
  287. package/dist/enums/legacy-table-type.enum.d.ts.map +1 -0
  288. package/dist/enums/legacy-table-type.enum.js +10 -0
  289. package/dist/enums/legacy-table-type.enum.js.map +1 -0
  290. package/dist/factories/whatsapp.factory.d.ts.map +1 -1
  291. package/dist/factories/whatsapp.factory.js +13 -11
  292. package/dist/factories/whatsapp.factory.js.map +1 -1
  293. package/dist/helpers/bootstrap.helper.d.ts +1 -0
  294. package/dist/helpers/bootstrap.helper.d.ts.map +1 -1
  295. package/dist/helpers/bootstrap.helper.js +6 -3
  296. package/dist/helpers/bootstrap.helper.js.map +1 -1
  297. package/dist/helpers/command.service.d.ts +1 -0
  298. package/dist/helpers/command.service.d.ts.map +1 -1
  299. package/dist/helpers/command.service.js +2 -1
  300. package/dist/helpers/command.service.js.map +1 -1
  301. package/dist/helpers/microsoft-active-directory-oauth.helper.d.ts +34 -0
  302. package/dist/helpers/microsoft-active-directory-oauth.helper.d.ts.map +1 -0
  303. package/dist/helpers/microsoft-active-directory-oauth.helper.js +43 -0
  304. package/dist/helpers/microsoft-active-directory-oauth.helper.js.map +1 -0
  305. package/dist/helpers/model-metadata-helper.service.d.ts +2 -1
  306. package/dist/helpers/model-metadata-helper.service.d.ts.map +1 -1
  307. package/dist/helpers/model-metadata-helper.service.js +4 -3
  308. package/dist/helpers/model-metadata-helper.service.js.map +1 -1
  309. package/dist/helpers/module-metadata-helper.service.d.ts +2 -0
  310. package/dist/helpers/module-metadata-helper.service.d.ts.map +1 -1
  311. package/dist/helpers/module-metadata-helper.service.js +23 -10
  312. package/dist/helpers/module-metadata-helper.service.js.map +1 -1
  313. package/dist/helpers/module.helper.d.ts.map +1 -1
  314. package/dist/helpers/module.helper.js +6 -6
  315. package/dist/helpers/module.helper.js.map +1 -1
  316. package/dist/helpers/solid-registry.d.ts +5 -9
  317. package/dist/helpers/solid-registry.d.ts.map +1 -1
  318. package/dist/helpers/solid-registry.js +13 -28
  319. package/dist/helpers/solid-registry.js.map +1 -1
  320. package/dist/helpers/typeorm-migration-helpers.d.ts +12 -0
  321. package/dist/helpers/typeorm-migration-helpers.d.ts.map +1 -0
  322. package/dist/helpers/typeorm-migration-helpers.js +119 -0
  323. package/dist/helpers/typeorm-migration-helpers.js.map +1 -0
  324. package/dist/helpers/user-helper.d.ts.map +1 -1
  325. package/dist/helpers/user-helper.js +4 -0
  326. package/dist/helpers/user-helper.js.map +1 -1
  327. package/dist/index.d.ts +37 -10
  328. package/dist/index.d.ts.map +1 -1
  329. package/dist/index.js +37 -10
  330. package/dist/index.js.map +1 -1
  331. package/dist/interfaces.d.ts +23 -21
  332. package/dist/interfaces.d.ts.map +1 -1
  333. package/dist/interfaces.js.map +1 -1
  334. package/dist/listeners/user-registration.listener.d.ts +5 -2
  335. package/dist/listeners/user-registration.listener.d.ts.map +1 -1
  336. package/dist/listeners/user-registration.listener.js +37 -4
  337. package/dist/listeners/user-registration.listener.js.map +1 -1
  338. package/dist/passport-strategies/microsoft-active-directory-oauth.strategy.d.ts +14 -0
  339. package/dist/passport-strategies/microsoft-active-directory-oauth.strategy.d.ts.map +1 -0
  340. package/dist/passport-strategies/microsoft-active-directory-oauth.strategy.js +67 -0
  341. package/dist/passport-strategies/microsoft-active-directory-oauth.strategy.js.map +1 -0
  342. package/dist/{repository/dashboard-layout.repository.d.ts → repositories/dashboard-user-layout.repository.d.ts} +5 -5
  343. package/dist/repositories/dashboard-user-layout.repository.d.ts.map +1 -0
  344. package/dist/{repository/dashboard-question-sql-dataset-config.repository.js → repositories/dashboard-user-layout.repository.js} +15 -10
  345. package/dist/repositories/dashboard-user-layout.repository.js.map +1 -0
  346. package/dist/repository/{ai-interaction.repository.d.ts → mcp-audit-log.repository.d.ts} +3 -3
  347. package/dist/repository/mcp-audit-log.repository.d.ts.map +1 -0
  348. package/dist/repository/{ai-interaction.repository.js → mcp-audit-log.repository.js} +8 -8
  349. package/dist/repository/mcp-audit-log.repository.js.map +1 -0
  350. package/dist/seeders/module-metadata-seeder.service.d.ts +2 -6
  351. package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
  352. package/dist/seeders/module-metadata-seeder.service.js +58 -98
  353. package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
  354. package/dist/seeders/module-test-data.service.d.ts +2 -0
  355. package/dist/seeders/module-test-data.service.d.ts.map +1 -1
  356. package/dist/seeders/module-test-data.service.js +62 -1
  357. package/dist/seeders/module-test-data.service.js.map +1 -1
  358. package/dist/seeders/seed-data/solid-core-metadata.json +4992 -4287
  359. package/dist/seeders/system-fields-seeder.service.js +1 -1
  360. package/dist/seeders/system-fields-seeder.service.js.map +1 -1
  361. package/dist/services/authentication.service.d.ts +18 -1
  362. package/dist/services/authentication.service.d.ts.map +1 -1
  363. package/dist/services/authentication.service.js +208 -14
  364. package/dist/services/authentication.service.js.map +1 -1
  365. package/dist/services/chatter-message.service.d.ts +7 -1
  366. package/dist/services/chatter-message.service.d.ts.map +1 -1
  367. package/dist/services/chatter-message.service.js +94 -2
  368. package/dist/services/chatter-message.service.js.map +1 -1
  369. package/dist/services/crud-helper.service.d.ts +18 -0
  370. package/dist/services/crud-helper.service.d.ts.map +1 -1
  371. package/dist/services/crud-helper.service.js +76 -2
  372. package/dist/services/crud-helper.service.js.map +1 -1
  373. package/dist/services/crud.service.d.ts +1 -21
  374. package/dist/services/crud.service.d.ts.map +1 -1
  375. package/dist/services/crud.service.js +23 -87
  376. package/dist/services/crud.service.js.map +1 -1
  377. package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.d.ts +13 -0
  378. package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.d.ts.map +1 -0
  379. package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.js +55 -0
  380. package/dist/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.js.map +1 -0
  381. package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.d.ts +13 -0
  382. package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.d.ts.map +1 -0
  383. package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.js +52 -0
  384. package/dist/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.js.map +1 -0
  385. package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.d.ts +13 -0
  386. package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.d.ts.map +1 -0
  387. package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.js +52 -0
  388. package/dist/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.js.map +1 -0
  389. package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.d.ts +10 -0
  390. package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.d.ts.map +1 -0
  391. package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.js +62 -0
  392. package/dist/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.js.map +1 -0
  393. package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.d.ts +10 -0
  394. package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.d.ts.map +1 -0
  395. package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.js +82 -0
  396. package/dist/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.js.map +1 -0
  397. package/dist/services/dashboard-providers/mq-dashboard-provider-utils.d.ts +17 -0
  398. package/dist/services/dashboard-providers/mq-dashboard-provider-utils.d.ts.map +1 -0
  399. package/dist/services/dashboard-providers/mq-dashboard-provider-utils.js +130 -0
  400. package/dist/services/dashboard-providers/mq-dashboard-provider-utils.js.map +1 -0
  401. package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.d.ts +37 -0
  402. package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.d.ts.map +1 -0
  403. package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.js +112 -0
  404. package/dist/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.js.map +1 -0
  405. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.d.ts +10 -0
  406. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.d.ts.map +1 -0
  407. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.js +57 -0
  408. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.js.map +1 -0
  409. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.d.ts +10 -0
  410. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.d.ts.map +1 -0
  411. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.js +57 -0
  412. package/dist/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.js.map +1 -0
  413. package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.d.ts +10 -0
  414. package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.d.ts.map +1 -0
  415. package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.js +100 -0
  416. package/dist/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.js.map +1 -0
  417. package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.d.ts +10 -0
  418. package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.d.ts.map +1 -0
  419. package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.js +55 -0
  420. package/dist/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.js.map +1 -0
  421. package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.d.ts +13 -0
  422. package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.d.ts.map +1 -0
  423. package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.js +52 -0
  424. package/dist/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.js.map +1 -0
  425. package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.d.ts +15 -0
  426. package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.d.ts.map +1 -0
  427. package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.js +60 -0
  428. package/dist/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.js.map +1 -0
  429. package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.d.ts +13 -0
  430. package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.d.ts.map +1 -0
  431. package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.js +51 -0
  432. package/dist/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.js.map +1 -0
  433. package/dist/services/dashboard-runtime.service.d.ts +31 -0
  434. package/dist/services/dashboard-runtime.service.d.ts.map +1 -0
  435. package/dist/services/dashboard-runtime.service.js +408 -0
  436. package/dist/services/dashboard-runtime.service.js.map +1 -0
  437. package/dist/services/dashboard-user-layout.service.d.ts +12 -0
  438. package/dist/services/dashboard-user-layout.service.d.ts.map +1 -0
  439. package/dist/services/{dashboard-question-sql-dataset-config.service.js → dashboard-user-layout.service.js} +10 -10
  440. package/dist/services/dashboard-user-layout.service.js.map +1 -0
  441. package/dist/services/import-transaction.service.d.ts.map +1 -1
  442. package/dist/services/import-transaction.service.js +6 -0
  443. package/dist/services/import-transaction.service.js.map +1 -1
  444. package/dist/services/mcp-audit-log.service.d.ts +12 -0
  445. package/dist/services/mcp-audit-log.service.d.ts.map +1 -0
  446. package/dist/services/{dashboard-variable.service.js → mcp-audit-log.service.js} +9 -10
  447. package/dist/services/mcp-audit-log.service.js.map +1 -0
  448. package/dist/services/media.service.d.ts +1 -20
  449. package/dist/services/media.service.d.ts.map +1 -1
  450. package/dist/services/mediaStorageProviders/file-s3-storage-provider.d.ts +1 -0
  451. package/dist/services/mediaStorageProviders/file-s3-storage-provider.d.ts.map +1 -1
  452. package/dist/services/mediaStorageProviders/file-s3-storage-provider.js +51 -11
  453. package/dist/services/mediaStorageProviders/file-s3-storage-provider.js.map +1 -1
  454. package/dist/services/mediaStorageProviders/file-storage-provider.d.ts +1 -0
  455. package/dist/services/mediaStorageProviders/file-storage-provider.d.ts.map +1 -1
  456. package/dist/services/mediaStorageProviders/file-storage-provider.js +11 -1
  457. package/dist/services/mediaStorageProviders/file-storage-provider.js.map +1 -1
  458. package/dist/services/model-metadata.service.d.ts +20 -32
  459. package/dist/services/model-metadata.service.d.ts.map +1 -1
  460. package/dist/services/model-metadata.service.js +271 -42
  461. package/dist/services/model-metadata.service.js.map +1 -1
  462. package/dist/services/module-metadata-explorer.service.d.ts +161 -0
  463. package/dist/services/module-metadata-explorer.service.d.ts.map +1 -0
  464. package/dist/services/module-metadata-explorer.service.js +485 -0
  465. package/dist/services/module-metadata-explorer.service.js.map +1 -0
  466. package/dist/services/module-metadata.service.d.ts +11 -1
  467. package/dist/services/module-metadata.service.d.ts.map +1 -1
  468. package/dist/services/module-metadata.service.js +140 -4
  469. package/dist/services/module-metadata.service.js.map +1 -1
  470. package/dist/services/module-package.service.d.ts +266 -0
  471. package/dist/services/module-package.service.d.ts.map +1 -0
  472. package/dist/services/module-package.service.js +980 -0
  473. package/dist/services/module-package.service.js.map +1 -0
  474. package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.d.ts +11 -0
  475. package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.d.ts.map +1 -0
  476. package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.js +59 -0
  477. package/dist/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.js.map +1 -0
  478. package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.d.ts +11 -0
  479. package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.d.ts.map +1 -0
  480. package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.js +60 -0
  481. package/dist/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.js.map +1 -0
  482. package/dist/services/settings/default-settings-provider.service.d.ts +292 -0
  483. package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
  484. package/dist/services/settings/default-settings-provider.service.js +164 -0
  485. package/dist/services/settings/default-settings-provider.service.js.map +1 -1
  486. package/dist/services/solid-introspect.service.d.ts +1 -2
  487. package/dist/services/solid-introspect.service.d.ts.map +1 -1
  488. package/dist/services/solid-introspect.service.js +12 -24
  489. package/dist/services/solid-introspect.service.js.map +1 -1
  490. package/dist/services/user.service.d.ts +2 -0
  491. package/dist/services/user.service.d.ts.map +1 -1
  492. package/dist/services/user.service.js +47 -1
  493. package/dist/services/user.service.js.map +1 -1
  494. package/dist/services/whatsapp/GupshupOtpWhatsappService.d.ts +11 -0
  495. package/dist/services/whatsapp/GupshupOtpWhatsappService.d.ts.map +1 -0
  496. package/dist/services/whatsapp/GupshupOtpWhatsappService.js +127 -0
  497. package/dist/services/whatsapp/GupshupOtpWhatsappService.js.map +1 -0
  498. package/dist/services/whatsapp/MetaCloudWhatsappService.d.ts +17 -0
  499. package/dist/services/whatsapp/MetaCloudWhatsappService.d.ts.map +1 -0
  500. package/dist/services/whatsapp/MetaCloudWhatsappService.js +209 -0
  501. package/dist/services/whatsapp/MetaCloudWhatsappService.js.map +1 -0
  502. package/dist/solid-core.module.d.ts +2 -2
  503. package/dist/solid-core.module.d.ts.map +1 -1
  504. package/dist/solid-core.module.js +79 -103
  505. package/dist/solid-core.module.js.map +1 -1
  506. package/dist/subscribers/model-metadata.subscriber.d.ts.map +1 -1
  507. package/dist/subscribers/model-metadata.subscriber.js +1 -3
  508. package/dist/subscribers/model-metadata.subscriber.js.map +1 -1
  509. package/dist/subscribers/scheduled-job.subscriber.js +1 -1
  510. package/dist/subscribers/scheduled-job.subscriber.js.map +1 -1
  511. package/dist/subscribers/security-rule.subscriber.js +1 -1
  512. package/dist/subscribers/security-rule.subscriber.js.map +1 -1
  513. package/dist/testing/adapters/ui/playwright-adapter.d.ts +1 -0
  514. package/dist/testing/adapters/ui/playwright-adapter.d.ts.map +1 -1
  515. package/dist/testing/adapters/ui/playwright-adapter.js +3 -0
  516. package/dist/testing/adapters/ui/playwright-adapter.js.map +1 -1
  517. package/dist/testing/steps/ui/index.d.ts.map +1 -1
  518. package/dist/testing/steps/ui/index.js +2 -0
  519. package/dist/testing/steps/ui/index.js.map +1 -1
  520. package/dist/testing/steps/ui/manual.step.d.ts +3 -0
  521. package/dist/testing/steps/ui/manual.step.d.ts.map +1 -0
  522. package/dist/testing/steps/ui/manual.step.js +56 -0
  523. package/dist/testing/steps/ui/manual.step.js.map +1 -0
  524. package/dist/winston.logger.d.ts +5 -0
  525. package/dist/winston.logger.d.ts.map +1 -1
  526. package/dist/winston.logger.js +6 -4
  527. package/dist/winston.logger.js.map +1 -1
  528. package/package.json +5 -8
  529. package/src/commands/info.command.ts +0 -2
  530. package/src/commands/refresh-model.command.ts +6 -51
  531. package/src/commands/refresh-module.command.ts +3 -16
  532. package/src/commands/test-data.command.ts +29 -6
  533. package/src/constants/error-messages.ts +2 -1
  534. package/src/controllers/chatter-message.controller.ts +12 -0
  535. package/src/controllers/{dashboard-variable.controller.ts → dashboard-user-layout.controller.ts} +10 -10
  536. package/src/controllers/dashboard.controller.ts +70 -89
  537. package/src/controllers/gupshup-webhook.controller.ts +91 -0
  538. package/src/controllers/mcp-audit-log.controller.ts +70 -0
  539. package/src/controllers/meta-cloud-whatsapp-webhook.controller.ts +155 -0
  540. package/src/controllers/microsoft-active-directory-authentication.controller.ts +104 -0
  541. package/src/controllers/model-metadata.controller.ts +1 -1
  542. package/src/controllers/module-metadata-explorer.controller.ts +83 -0
  543. package/src/controllers/module-metadata.controller.ts +7 -1
  544. package/src/controllers/module-package.controller.ts +102 -0
  545. package/src/controllers/service.controller.ts +4 -7
  546. package/src/controllers/test.controller.ts +0 -9
  547. package/src/decorators/dashboard-widget-data-provider.decorator.ts +6 -0
  548. package/src/dtos/confirm-module-package-import.dto.ts +12 -0
  549. package/src/dtos/create-dashboard-user-layout.dto.ts +41 -0
  550. package/src/dtos/create-mcp-audit-log.dto.ts +84 -0
  551. package/src/dtos/create-model-metadata.dto.ts +5 -9
  552. package/src/dtos/create-permission-metadata.dto.ts +3 -0
  553. package/src/dtos/create-role-metadata.dto.ts +11 -1
  554. package/src/dtos/dashboard-variable-options-query.dto.ts +20 -0
  555. package/src/dtos/dashboard-widget-data-request.dto.ts +34 -0
  556. package/src/dtos/import-instructions.dto.ts +11 -1
  557. package/src/dtos/metadata-explorer-references-query.dto.ts +39 -0
  558. package/src/dtos/metadata-explorer-search-query.dto.ts +28 -0
  559. package/src/dtos/metadata-explorer-write.dto.ts +11 -0
  560. package/src/dtos/run-module-package-build.dto.ts +14 -0
  561. package/src/dtos/run-module-package-seed.dto.ts +12 -0
  562. package/src/dtos/update-chatter-note-message.dto.ts +14 -0
  563. package/src/dtos/update-dashboard-user-layout.dto.ts +45 -0
  564. package/src/dtos/update-mcp-audit-log.dto.ts +83 -0
  565. package/src/dtos/update-permission-metadata.dto.ts +4 -1
  566. package/src/dtos/update-role-metadata.dto.ts +21 -1
  567. package/src/entities/action-metadata.entity.ts +1 -0
  568. package/src/entities/agent-event.entity.ts +1 -0
  569. package/src/entities/agent-session.entity.ts +1 -0
  570. package/src/entities/chatter-message.entity.ts +2 -0
  571. package/src/entities/dashboard-user-layout.entity.ts +27 -0
  572. package/src/entities/email-template.entity.ts +1 -0
  573. package/src/entities/field-metadata.entity.ts +4 -1
  574. package/src/entities/legacy-common-with-id.entity.ts +2 -2
  575. package/src/entities/legacy-common.entity.ts +1 -1
  576. package/src/entities/list-of-values.entity.ts +5 -1
  577. package/src/entities/locale.entity.ts +1 -0
  578. package/src/entities/mcp-audit-log.entity.ts +55 -0
  579. package/src/entities/media.entity.ts +1 -0
  580. package/src/entities/menu-item-metadata.entity.ts +2 -0
  581. package/src/entities/model-metadata.entity.ts +6 -5
  582. package/src/entities/module-metadata.entity.ts +2 -0
  583. package/src/entities/permission-metadata.entity.ts +2 -2
  584. package/src/entities/role-metadata.entity.ts +11 -3
  585. package/src/entities/saved-filters.entity.ts +3 -0
  586. package/src/entities/scheduled-job.entity.ts +2 -0
  587. package/src/entities/security-rule.entity.ts +1 -0
  588. package/src/entities/sms-template.entity.ts +2 -0
  589. package/src/entities/user-activity-history.entity.ts +1 -0
  590. package/src/entities/user.entity.ts +15 -1
  591. package/src/entities/view-metadata.entity.ts +2 -0
  592. package/src/enums/legacy-table-type.enum.ts +5 -0
  593. package/src/factories/whatsapp.factory.ts +33 -32
  594. package/src/helpers/bootstrap.helper.ts +13 -6
  595. package/src/helpers/command.service.ts +3 -1
  596. package/src/helpers/field-crud-managers/field-quality-check-fixes.md +208 -0
  597. package/src/helpers/microsoft-active-directory-oauth.helper.ts +83 -0
  598. package/src/helpers/model-metadata-helper.service.ts +4 -3
  599. package/src/helpers/module-metadata-helper.service.ts +33 -20
  600. package/src/helpers/module.helper.ts +12 -9
  601. package/src/helpers/solid-registry.ts +15 -36
  602. package/src/helpers/typeorm-migration-helpers.ts +163 -0
  603. package/src/helpers/user-helper.ts +5 -1
  604. package/src/index.ts +37 -10
  605. package/src/interfaces.ts +32 -29
  606. package/src/listeners/user-registration.listener.ts +49 -6
  607. package/src/passport-strategies/microsoft-active-directory-oauth.strategy.ts +63 -0
  608. package/src/repositories/dashboard-user-layout.repository.ts +19 -0
  609. package/src/repository/mcp-audit-log.repository.ts +17 -0
  610. package/src/seeders/module-metadata-seeder.service.ts +63 -105
  611. package/src/seeders/module-test-data.service.ts +80 -3
  612. package/src/seeders/seed-data/solid-core-metadata.json +4994 -4289
  613. package/src/seeders/system-fields-seeder.service.ts +1 -1
  614. package/src/services/authentication.service.ts +359 -46
  615. package/src/services/chatter-message.service.ts +112 -2
  616. package/src/services/crud-helper.service.ts +86 -2
  617. package/src/services/crud.service.ts +26 -119
  618. package/src/services/dashboard-providers/README.md +603 -0
  619. package/src/services/dashboard-providers/mq-dashboard-avg-elapsed-kpi-provider.service.ts +49 -0
  620. package/src/services/dashboard-providers/mq-dashboard-failed-messages-kpi-provider.service.ts +45 -0
  621. package/src/services/dashboard-providers/mq-dashboard-inflight-messages-kpi-provider.service.ts +45 -0
  622. package/src/services/dashboard-providers/mq-dashboard-latency-trend-provider.service.ts +58 -0
  623. package/src/services/dashboard-providers/mq-dashboard-messages-over-time-provider.service.ts +79 -0
  624. package/src/services/dashboard-providers/mq-dashboard-provider-utils.ts +165 -0
  625. package/src/services/dashboard-providers/mq-dashboard-queue-sla-heatmap-provider.service.ts +155 -0
  626. package/src/services/dashboard-providers/mq-dashboard-queue-wise-avg-elapsed-provider.service.ts +51 -0
  627. package/src/services/dashboard-providers/mq-dashboard-queue-wise-failures-provider.service.ts +51 -0
  628. package/src/services/dashboard-providers/mq-dashboard-recent-failures-provider.service.ts +95 -0
  629. package/src/services/dashboard-providers/mq-dashboard-stage-distribution-provider.service.ts +49 -0
  630. package/src/services/dashboard-providers/mq-dashboard-succeeded-messages-kpi-provider.service.ts +45 -0
  631. package/src/services/dashboard-providers/mq-dashboard-success-rate-kpi-provider.service.ts +55 -0
  632. package/src/services/dashboard-providers/mq-dashboard-total-messages-kpi-provider.service.ts +44 -0
  633. package/src/services/dashboard-runtime.service.ts +488 -0
  634. package/src/services/dashboard-user-layout.service.ts +20 -0
  635. package/src/services/import-transaction.service.ts +11 -1
  636. package/src/services/mcp-audit-log.service.ts +19 -0
  637. package/src/services/mediaStorageProviders/file-s3-storage-provider.ts +60 -13
  638. package/src/services/mediaStorageProviders/file-storage-provider.ts +13 -2
  639. package/src/services/model-metadata.service.ts +318 -115
  640. package/src/services/module-metadata-explorer.service.ts +670 -0
  641. package/src/services/module-metadata.service.ts +148 -10
  642. package/src/services/module-package.service.ts +1171 -0
  643. package/src/services/selection-providers/mq-dashboard-message-broker-variable-options-provider.service.ts +52 -0
  644. package/src/services/selection-providers/mq-dashboard-queue-name-variable-options-provider.service.ts +51 -0
  645. package/src/services/settings/default-settings-provider.service.ts +167 -0
  646. package/src/services/solid-introspect.service.ts +19 -34
  647. package/src/services/user.service.ts +62 -1
  648. package/src/services/whatsapp/GupshupOtpWhatsappService.ts +174 -0
  649. package/src/services/whatsapp/MetaCloudWhatsappService.ts +253 -0
  650. package/src/solid-core.module.ts +251 -282
  651. package/src/subscribers/model-metadata.subscriber.ts +1 -3
  652. package/src/subscribers/scheduled-job.subscriber.ts +1 -1
  653. package/src/subscribers/security-rule.subscriber.ts +1 -1
  654. package/src/testing/README.md +55 -2
  655. package/src/testing/adapters/ui/playwright-adapter.ts +4 -0
  656. package/src/testing/steps/ui/index.ts +2 -0
  657. package/src/testing/steps/ui/manual.step.ts +80 -0
  658. package/src/winston.logger.ts +5 -7
  659. package/dist/commands/ingest.command.d.ts +0 -16
  660. package/dist/commands/ingest.command.d.ts.map +0 -1
  661. package/dist/commands/ingest.command.js +0 -50
  662. package/dist/commands/ingest.command.js.map +0 -1
  663. package/dist/controllers/ai-interaction.controller.d.ts +0 -48
  664. package/dist/controllers/ai-interaction.controller.d.ts.map +0 -1
  665. package/dist/controllers/ai-interaction.controller.js +0 -218
  666. package/dist/controllers/ai-interaction.controller.js.map +0 -1
  667. package/dist/controllers/dashboard-layout.controller.d.ts +0 -47
  668. package/dist/controllers/dashboard-layout.controller.d.ts.map +0 -1
  669. package/dist/controllers/dashboard-layout.controller.js +0 -204
  670. package/dist/controllers/dashboard-layout.controller.js.map +0 -1
  671. package/dist/controllers/dashboard-question-sql-dataset-config.controller.d.ts +0 -43
  672. package/dist/controllers/dashboard-question-sql-dataset-config.controller.d.ts.map +0 -1
  673. package/dist/controllers/dashboard-question-sql-dataset-config.controller.js +0 -179
  674. package/dist/controllers/dashboard-question-sql-dataset-config.controller.js.map +0 -1
  675. package/dist/controllers/dashboard-question.controller.d.ts +0 -45
  676. package/dist/controllers/dashboard-question.controller.d.ts.map +0 -1
  677. package/dist/controllers/dashboard-question.controller.js.map +0 -1
  678. package/dist/controllers/dashboard-variable.controller.d.ts +0 -43
  679. package/dist/controllers/dashboard-variable.controller.d.ts.map +0 -1
  680. package/dist/controllers/dashboard-variable.controller.js.map +0 -1
  681. package/dist/decorators/dashboard-question-data-provider.decorator.d.ts +0 -3
  682. package/dist/decorators/dashboard-question-data-provider.decorator.d.ts.map +0 -1
  683. package/dist/decorators/dashboard-question-data-provider.decorator.js +0 -11
  684. package/dist/decorators/dashboard-question-data-provider.decorator.js.map +0 -1
  685. package/dist/decorators/dashboard-selection-provider.decorator.d.ts +0 -3
  686. package/dist/decorators/dashboard-selection-provider.decorator.d.ts.map +0 -1
  687. package/dist/decorators/dashboard-selection-provider.decorator.js +0 -11
  688. package/dist/decorators/dashboard-selection-provider.decorator.js.map +0 -1
  689. package/dist/dtos/create-ai-interaction.dto.d.ts +0 -23
  690. package/dist/dtos/create-ai-interaction.dto.d.ts.map +0 -1
  691. package/dist/dtos/create-ai-interaction.dto.js +0 -149
  692. package/dist/dtos/create-ai-interaction.dto.js.map +0 -1
  693. package/dist/dtos/create-dashboard-layout.dto.d.ts +0 -8
  694. package/dist/dtos/create-dashboard-layout.dto.d.ts.map +0 -1
  695. package/dist/dtos/create-dashboard-layout.dto.js +0 -53
  696. package/dist/dtos/create-dashboard-layout.dto.js.map +0 -1
  697. package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.d.ts +0 -12
  698. package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.d.ts.map +0 -1
  699. package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.js +0 -77
  700. package/dist/dtos/create-dashboard-question-sql-dataset-config.dto.js.map +0 -1
  701. package/dist/dtos/create-dashboard-question.dto.d.ts +0 -17
  702. package/dist/dtos/create-dashboard-question.dto.d.ts.map +0 -1
  703. package/dist/dtos/create-dashboard-question.dto.js +0 -105
  704. package/dist/dtos/create-dashboard-question.dto.js.map +0 -1
  705. package/dist/dtos/create-dashboard-variable.dto.d.ts +0 -19
  706. package/dist/dtos/create-dashboard-variable.dto.d.ts.map +0 -1
  707. package/dist/dtos/create-dashboard-variable.dto.js +0 -103
  708. package/dist/dtos/create-dashboard-variable.dto.js.map +0 -1
  709. package/dist/dtos/create-dashboard.dto.d.ts +0 -17
  710. package/dist/dtos/create-dashboard.dto.d.ts.map +0 -1
  711. package/dist/dtos/create-dashboard.dto.js +0 -102
  712. package/dist/dtos/create-dashboard.dto.js.map +0 -1
  713. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts +0 -8
  714. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.d.ts.map +0 -1
  715. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js +0 -52
  716. package/dist/dtos/dashboard-variable-selection-dynamic-query.dto.js.map +0 -1
  717. package/dist/dtos/invoke-ai-prompt.dto.d.ts +0 -5
  718. package/dist/dtos/invoke-ai-prompt.dto.d.ts.map +0 -1
  719. package/dist/dtos/invoke-ai-prompt.dto.js.map +0 -1
  720. package/dist/dtos/update-ai-interaction.dto.d.ts +0 -24
  721. package/dist/dtos/update-ai-interaction.dto.d.ts.map +0 -1
  722. package/dist/dtos/update-ai-interaction.dto.js +0 -150
  723. package/dist/dtos/update-ai-interaction.dto.js.map +0 -1
  724. package/dist/dtos/update-dashboard-layout.dto.d.ts +0 -8
  725. package/dist/dtos/update-dashboard-layout.dto.d.ts.map +0 -1
  726. package/dist/dtos/update-dashboard-layout.dto.js.map +0 -1
  727. package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.d.ts +0 -13
  728. package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.d.ts.map +0 -1
  729. package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.js +0 -86
  730. package/dist/dtos/update-dashboard-question-sql-dataset-config.dto.js.map +0 -1
  731. package/dist/dtos/update-dashboard-question.dto.d.ts +0 -18
  732. package/dist/dtos/update-dashboard-question.dto.d.ts.map +0 -1
  733. package/dist/dtos/update-dashboard-question.dto.js +0 -112
  734. package/dist/dtos/update-dashboard-question.dto.js.map +0 -1
  735. package/dist/dtos/update-dashboard-variable.dto.d.ts +0 -16
  736. package/dist/dtos/update-dashboard-variable.dto.d.ts.map +0 -1
  737. package/dist/dtos/update-dashboard-variable.dto.js +0 -101
  738. package/dist/dtos/update-dashboard-variable.dto.js.map +0 -1
  739. package/dist/dtos/update-dashboard.dto.d.ts +0 -18
  740. package/dist/dtos/update-dashboard.dto.d.ts.map +0 -1
  741. package/dist/dtos/update-dashboard.dto.js +0 -108
  742. package/dist/dtos/update-dashboard.dto.js.map +0 -1
  743. package/dist/entities/ai-interaction.entity.d.ts +0 -24
  744. package/dist/entities/ai-interaction.entity.d.ts.map +0 -1
  745. package/dist/entities/ai-interaction.entity.js +0 -116
  746. package/dist/entities/ai-interaction.entity.js.map +0 -1
  747. package/dist/entities/dashboard-layout.entity.d.ts +0 -9
  748. package/dist/entities/dashboard-layout.entity.d.ts.map +0 -1
  749. package/dist/entities/dashboard-layout.entity.js +0 -41
  750. package/dist/entities/dashboard-layout.entity.js.map +0 -1
  751. package/dist/entities/dashboard-question-sql-dataset-config.entity.d.ts +0 -14
  752. package/dist/entities/dashboard-question-sql-dataset-config.entity.d.ts.map +0 -1
  753. package/dist/entities/dashboard-question-sql-dataset-config.entity.js +0 -66
  754. package/dist/entities/dashboard-question-sql-dataset-config.entity.js.map +0 -1
  755. package/dist/entities/dashboard-question.entity.d.ts +0 -17
  756. package/dist/entities/dashboard-question.entity.d.ts.map +0 -1
  757. package/dist/entities/dashboard-question.entity.js +0 -77
  758. package/dist/entities/dashboard-question.entity.js.map +0 -1
  759. package/dist/entities/dashboard-variable.entity.d.ts +0 -16
  760. package/dist/entities/dashboard-variable.entity.d.ts.map +0 -1
  761. package/dist/entities/dashboard-variable.entity.js +0 -79
  762. package/dist/entities/dashboard-variable.entity.js.map +0 -1
  763. package/dist/entities/dashboard.entity.d.ts +0 -16
  764. package/dist/entities/dashboard.entity.d.ts.map +0 -1
  765. package/dist/entities/dashboard.entity.js +0 -64
  766. package/dist/entities/dashboard.entity.js.map +0 -1
  767. package/dist/jobs/database/trigger-mcp-client-publisher-database.service.d.ts +0 -11
  768. package/dist/jobs/database/trigger-mcp-client-publisher-database.service.d.ts.map +0 -1
  769. package/dist/jobs/database/trigger-mcp-client-publisher-database.service.js +0 -39
  770. package/dist/jobs/database/trigger-mcp-client-publisher-database.service.js.map +0 -1
  771. package/dist/jobs/database/trigger-mcp-client-queue-options.d.ts +0 -8
  772. package/dist/jobs/database/trigger-mcp-client-queue-options.d.ts.map +0 -1
  773. package/dist/jobs/database/trigger-mcp-client-queue-options.js +0 -10
  774. package/dist/jobs/database/trigger-mcp-client-queue-options.js.map +0 -1
  775. package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts +0 -27
  776. package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts.map +0 -1
  777. package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js +0 -245
  778. package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js.map +0 -1
  779. package/dist/jobs/rabbitmq/trigger-mcp-client-publisher.service.d.ts +0 -11
  780. package/dist/jobs/rabbitmq/trigger-mcp-client-publisher.service.d.ts.map +0 -1
  781. package/dist/jobs/rabbitmq/trigger-mcp-client-publisher.service.js +0 -39
  782. package/dist/jobs/rabbitmq/trigger-mcp-client-publisher.service.js.map +0 -1
  783. package/dist/jobs/rabbitmq/trigger-mcp-client-queue-options.d.ts +0 -8
  784. package/dist/jobs/rabbitmq/trigger-mcp-client-queue-options.d.ts.map +0 -1
  785. package/dist/jobs/rabbitmq/trigger-mcp-client-queue-options.js +0 -10
  786. package/dist/jobs/rabbitmq/trigger-mcp-client-queue-options.js.map +0 -1
  787. package/dist/jobs/rabbitmq/trigger-mcp-client-subscriber.service.d.ts +0 -18
  788. package/dist/jobs/rabbitmq/trigger-mcp-client-subscriber.service.d.ts.map +0 -1
  789. package/dist/jobs/rabbitmq/trigger-mcp-client-subscriber.service.js +0 -103
  790. package/dist/jobs/rabbitmq/trigger-mcp-client-subscriber.service.js.map +0 -1
  791. package/dist/jobs/redis/trigger-mcp-client-publisher-redis.service.d.ts +0 -11
  792. package/dist/jobs/redis/trigger-mcp-client-publisher-redis.service.d.ts.map +0 -1
  793. package/dist/jobs/redis/trigger-mcp-client-publisher-redis.service.js +0 -39
  794. package/dist/jobs/redis/trigger-mcp-client-publisher-redis.service.js.map +0 -1
  795. package/dist/jobs/redis/trigger-mcp-client-queue-options-redis.d.ts +0 -8
  796. package/dist/jobs/redis/trigger-mcp-client-queue-options-redis.d.ts.map +0 -1
  797. package/dist/jobs/redis/trigger-mcp-client-queue-options-redis.js +0 -10
  798. package/dist/jobs/redis/trigger-mcp-client-queue-options-redis.js.map +0 -1
  799. package/dist/jobs/redis/trigger-mcp-client-subscriber-redis.service.d.ts +0 -18
  800. package/dist/jobs/redis/trigger-mcp-client-subscriber-redis.service.d.ts.map +0 -1
  801. package/dist/jobs/redis/trigger-mcp-client-subscriber-redis.service.js +0 -103
  802. package/dist/jobs/redis/trigger-mcp-client-subscriber-redis.service.js.map +0 -1
  803. package/dist/mappers/dashboard-mapper.d.ts +0 -6
  804. package/dist/mappers/dashboard-mapper.d.ts.map +0 -1
  805. package/dist/mappers/dashboard-mapper.js +0 -62
  806. package/dist/mappers/dashboard-mapper.js.map +0 -1
  807. package/dist/repository/ai-interaction.repository.d.ts.map +0 -1
  808. package/dist/repository/ai-interaction.repository.js.map +0 -1
  809. package/dist/repository/dashboard-layout.repository.d.ts.map +0 -1
  810. package/dist/repository/dashboard-layout.repository.js +0 -34
  811. package/dist/repository/dashboard-layout.repository.js.map +0 -1
  812. package/dist/repository/dashboard-question-sql-dataset-config.repository.d.ts +0 -12
  813. package/dist/repository/dashboard-question-sql-dataset-config.repository.d.ts.map +0 -1
  814. package/dist/repository/dashboard-question-sql-dataset-config.repository.js.map +0 -1
  815. package/dist/repository/dashboard-question.repository.d.ts +0 -12
  816. package/dist/repository/dashboard-question.repository.d.ts.map +0 -1
  817. package/dist/repository/dashboard-question.repository.js +0 -34
  818. package/dist/repository/dashboard-question.repository.js.map +0 -1
  819. package/dist/repository/dashboard-variable.repository.d.ts +0 -12
  820. package/dist/repository/dashboard-variable.repository.d.ts.map +0 -1
  821. package/dist/repository/dashboard-variable.repository.js +0 -34
  822. package/dist/repository/dashboard-variable.repository.js.map +0 -1
  823. package/dist/repository/dashboard.repository.d.ts +0 -13
  824. package/dist/repository/dashboard.repository.d.ts.map +0 -1
  825. package/dist/repository/dashboard.repository.js +0 -104
  826. package/dist/repository/dashboard.repository.js.map +0 -1
  827. package/dist/services/ai-interaction.service.d.ts +0 -23
  828. package/dist/services/ai-interaction.service.d.ts.map +0 -1
  829. package/dist/services/ai-interaction.service.js +0 -217
  830. package/dist/services/ai-interaction.service.js.map +0 -1
  831. package/dist/services/dashboard-layout.service.d.ts +0 -20
  832. package/dist/services/dashboard-layout.service.d.ts.map +0 -1
  833. package/dist/services/dashboard-layout.service.js +0 -120
  834. package/dist/services/dashboard-layout.service.js.map +0 -1
  835. package/dist/services/dashboard-question-sql-dataset-config.service.d.ts +0 -12
  836. package/dist/services/dashboard-question-sql-dataset-config.service.d.ts.map +0 -1
  837. package/dist/services/dashboard-question-sql-dataset-config.service.js.map +0 -1
  838. package/dist/services/dashboard-question.service.d.ts +0 -23
  839. package/dist/services/dashboard-question.service.d.ts.map +0 -1
  840. package/dist/services/dashboard-question.service.js +0 -135
  841. package/dist/services/dashboard-question.service.js.map +0 -1
  842. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts +0 -12
  843. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.d.ts.map +0 -1
  844. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js +0 -55
  845. package/dist/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.js.map +0 -1
  846. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts +0 -11
  847. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.d.ts.map +0 -1
  848. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js +0 -45
  849. package/dist/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.js.map +0 -1
  850. package/dist/services/dashboard-variable.service.d.ts +0 -13
  851. package/dist/services/dashboard-variable.service.d.ts.map +0 -1
  852. package/dist/services/dashboard-variable.service.js.map +0 -1
  853. package/dist/services/dashboard.service.d.ts +0 -29
  854. package/dist/services/dashboard.service.d.ts.map +0 -1
  855. package/dist/services/dashboard.service.js +0 -171
  856. package/dist/services/dashboard.service.js.map +0 -1
  857. package/dist/services/database/database-bootstrap.service.d.ts +0 -12
  858. package/dist/services/database/database-bootstrap.service.d.ts.map +0 -1
  859. package/dist/services/database/database-bootstrap.service.js +0 -115
  860. package/dist/services/database/database-bootstrap.service.js.map +0 -1
  861. package/dist/services/genai/ingest-metadata.service.d.ts +0 -38
  862. package/dist/services/genai/ingest-metadata.service.d.ts.map +0 -1
  863. package/dist/services/genai/ingest-metadata.service.js +0 -542
  864. package/dist/services/genai/ingest-metadata.service.js.map +0 -1
  865. package/dist/services/genai/mcp-handlers/mcp-handler-factory.service.d.ts +0 -9
  866. package/dist/services/genai/mcp-handlers/mcp-handler-factory.service.d.ts.map +0 -1
  867. package/dist/services/genai/mcp-handlers/mcp-handler-factory.service.js +0 -39
  868. package/dist/services/genai/mcp-handlers/mcp-handler-factory.service.js.map +0 -1
  869. package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.d.ts +0 -12
  870. package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.d.ts.map +0 -1
  871. package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.js +0 -41
  872. package/dist/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.js.map +0 -1
  873. package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.d.ts +0 -12
  874. package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.d.ts.map +0 -1
  875. package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.js +0 -42
  876. package/dist/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.js.map +0 -1
  877. package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.d.ts +0 -25
  878. package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.d.ts.map +0 -1
  879. package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.js +0 -116
  880. package/dist/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.js.map +0 -1
  881. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.d.ts +0 -12
  882. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.d.ts.map +0 -1
  883. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.js +0 -37
  884. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.js.map +0 -1
  885. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.d.ts +0 -12
  886. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.d.ts.map +0 -1
  887. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.js +0 -38
  888. package/dist/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.js.map +0 -1
  889. package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.d.ts +0 -12
  890. package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.d.ts.map +0 -1
  891. package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.js +0 -38
  892. package/dist/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.js.map +0 -1
  893. package/dist/services/genai/r2r-helper.service.d.ts +0 -9
  894. package/dist/services/genai/r2r-helper.service.d.ts.map +0 -1
  895. package/dist/services/genai/r2r-helper.service.js +0 -40
  896. package/dist/services/genai/r2r-helper.service.js.map +0 -1
  897. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts +0 -34
  898. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.d.ts.map +0 -1
  899. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js +0 -90
  900. package/dist/services/question-data-providers/chartjs-sql-data-provider.service.js.map +0 -1
  901. package/dist/services/question-data-providers/helpers.d.ts +0 -7
  902. package/dist/services/question-data-providers/helpers.d.ts.map +0 -1
  903. package/dist/services/question-data-providers/helpers.js +0 -25
  904. package/dist/services/question-data-providers/helpers.js.map +0 -1
  905. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts +0 -14
  906. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.d.ts.map +0 -1
  907. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js +0 -71
  908. package/dist/services/question-data-providers/prime-react-datatable-sql-data-provider.service.js.map +0 -1
  909. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts +0 -16
  910. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.d.ts.map +0 -1
  911. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js +0 -93
  912. package/dist/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.js.map +0 -1
  913. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts +0 -11
  914. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.d.ts.map +0 -1
  915. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js +0 -49
  916. package/dist/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.js.map +0 -1
  917. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts +0 -11
  918. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.d.ts.map +0 -1
  919. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js +0 -47
  920. package/dist/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.js.map +0 -1
  921. package/dist/services/sql-expression-resolver.service.d.ts +0 -12
  922. package/dist/services/sql-expression-resolver.service.d.ts.map +0 -1
  923. package/dist/services/sql-expression-resolver.service.js +0 -121
  924. package/dist/services/sql-expression-resolver.service.js.map +0 -1
  925. package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.d.ts +0 -16
  926. package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.d.ts.map +0 -1
  927. package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.js +0 -72
  928. package/dist/subscribers/dashboard-question-sql-dataset-config.subscriber.js.map +0 -1
  929. package/dist/subscribers/dashboard-question.subscriber.d.ts +0 -16
  930. package/dist/subscribers/dashboard-question.subscriber.d.ts.map +0 -1
  931. package/dist/subscribers/dashboard-question.subscriber.js +0 -72
  932. package/dist/subscribers/dashboard-question.subscriber.js.map +0 -1
  933. package/dist/subscribers/dashboard-variable.subscriber.d.ts +0 -16
  934. package/dist/subscribers/dashboard-variable.subscriber.d.ts.map +0 -1
  935. package/dist/subscribers/dashboard-variable.subscriber.js +0 -72
  936. package/dist/subscribers/dashboard-variable.subscriber.js.map +0 -1
  937. package/dist/subscribers/dashboard.subscriber.d.ts +0 -16
  938. package/dist/subscribers/dashboard.subscriber.d.ts.map +0 -1
  939. package/dist/subscribers/dashboard.subscriber.js +0 -71
  940. package/dist/subscribers/dashboard.subscriber.js.map +0 -1
  941. package/sql/default/mariadb/proc_CleanupModelMetadata.sql +0 -153
  942. package/sql/default/mariadb/proc_CleanupModuleMetadata.sql +0 -56
  943. package/sql/default/mssql/proc_CleanupModuleMetadata.sql +0 -78
  944. package/sql/default/mysql/proc_CleanupModelMetadata.sql +0 -153
  945. package/sql/default/mysql/proc_CleanupModuleMetadata.sql +0 -56
  946. package/sql/default/postgres/proc_CleanupModelMetadata.sql +0 -148
  947. package/sql/default/postgres/proc_CleanupModuleMetadata.sql +0 -50
  948. package/sql/default/postgres/scratchpad.sql.txt +0 -12
  949. package/src/commands/ingest.command.ts +0 -36
  950. package/src/controllers/ai-interaction.controller.ts +0 -112
  951. package/src/controllers/dashboard-layout.controller.ts +0 -106
  952. package/src/controllers/dashboard-question-sql-dataset-config.controller.ts +0 -93
  953. package/src/controllers/dashboard-question.controller.ts +0 -104
  954. package/src/decorators/dashboard-question-data-provider.decorator.ts +0 -7
  955. package/src/decorators/dashboard-selection-provider.decorator.ts +0 -7
  956. package/src/dtos/create-ai-interaction.dto.ts +0 -89
  957. package/src/dtos/create-dashboard-layout.dto.ts +0 -31
  958. package/src/dtos/create-dashboard-question-sql-dataset-config.dto.ts +0 -42
  959. package/src/dtos/create-dashboard-question.dto.ts +0 -62
  960. package/src/dtos/create-dashboard-variable.dto.ts +0 -60
  961. package/src/dtos/create-dashboard.dto.ts +0 -61
  962. package/src/dtos/dashboard-variable-selection-dynamic-query.dto.ts +0 -29
  963. package/src/dtos/invoke-ai-prompt.dto.ts +0 -10
  964. package/src/dtos/update-ai-interaction.dto.ts +0 -93
  965. package/src/dtos/update-dashboard-layout.dto.ts +0 -30
  966. package/src/dtos/update-dashboard-question-sql-dataset-config.dto.ts +0 -49
  967. package/src/dtos/update-dashboard-question.dto.ts +0 -67
  968. package/src/dtos/update-dashboard-variable.dto.ts +0 -58
  969. package/src/dtos/update-dashboard.dto.ts +0 -65
  970. package/src/entities/ai-interaction.entity.ts +0 -71
  971. package/src/entities/dashboard-layout.entity.ts +0 -18
  972. package/src/entities/dashboard-question-sql-dataset-config.entity.ts +0 -37
  973. package/src/entities/dashboard-question.entity.ts +0 -46
  974. package/src/entities/dashboard-variable.entity.ts +0 -44
  975. package/src/entities/dashboard.entity.ts +0 -36
  976. package/src/jobs/database/trigger-mcp-client-publisher-database.service.ts +0 -22
  977. package/src/jobs/database/trigger-mcp-client-queue-options.ts +0 -9
  978. package/src/jobs/database/trigger-mcp-client-subscriber-database.service.ts +0 -311
  979. package/src/jobs/rabbitmq/trigger-mcp-client-publisher.service.ts +0 -22
  980. package/src/jobs/rabbitmq/trigger-mcp-client-queue-options.ts +0 -9
  981. package/src/jobs/rabbitmq/trigger-mcp-client-subscriber.service.ts +0 -104
  982. package/src/jobs/redis/trigger-mcp-client-publisher-redis.service.ts +0 -23
  983. package/src/jobs/redis/trigger-mcp-client-queue-options-redis.ts +0 -9
  984. package/src/jobs/redis/trigger-mcp-client-subscriber-redis.service.ts +0 -98
  985. package/src/mappers/dashboard-mapper.ts +0 -53
  986. package/src/repository/ai-interaction.repository.ts +0 -17
  987. package/src/repository/dashboard-layout.repository.ts +0 -17
  988. package/src/repository/dashboard-question-sql-dataset-config.repository.ts +0 -17
  989. package/src/repository/dashboard-question.repository.ts +0 -17
  990. package/src/repository/dashboard-variable.repository.ts +0 -17
  991. package/src/repository/dashboard.repository.ts +0 -101
  992. package/src/services/ai-interaction.service.ts +0 -239
  993. package/src/services/dashboard-layout.service.ts +0 -111
  994. package/src/services/dashboard-question-sql-dataset-config.service.ts +0 -25
  995. package/src/services/dashboard-question.service.ts +0 -150
  996. package/src/services/dashboard-selection-providers/dashboard-variable-sql-dynamic-provider.service.ts +0 -56
  997. package/src/services/dashboard-selection-providers/dashboard-variable-test-dynamic-provider.service.ts +0 -37
  998. package/src/services/dashboard-variable.service.ts +0 -27
  999. package/src/services/dashboard.service.ts +0 -148
  1000. package/src/services/database/database-bootstrap.service.ts +0 -91
  1001. package/src/services/genai/ingest-metadata.service.ts +0 -798
  1002. package/src/services/genai/mcp-handlers/mcp-handler-factory.service.ts +0 -33
  1003. package/src/services/genai/mcp-handlers/solid-add-question-to-dashboard-mcp-handler.service.ts +0 -43
  1004. package/src/services/genai/mcp-handlers/solid-add-variable-to-dashboard-mcp-handler.service.ts +0 -44
  1005. package/src/services/genai/mcp-handlers/solid-create-dashboard-mcp-handler.service.ts +0 -114
  1006. package/src/services/genai/mcp-handlers/solid-create-dashboard-question-mcp-handler.service.ts +0 -38
  1007. package/src/services/genai/mcp-handlers/solid-create-dashboard-question-sql-dataset-config-mcp-handler.service.ts +0 -40
  1008. package/src/services/genai/mcp-handlers/solid-create-dashboard-widget-mcp-handler.service.ts +0 -39
  1009. package/src/services/genai/r2r-helper.service.ts +0 -37
  1010. package/src/services/question-data-providers/chartjs-sql-data-provider.service.ts +0 -121
  1011. package/src/services/question-data-providers/helpers.ts +0 -30
  1012. package/src/services/question-data-providers/prime-react-datatable-sql-data-provider.service.ts +0 -74
  1013. package/src/services/question-data-providers/prime-react-meter-group-sql-data-provider.service.ts +0 -115
  1014. package/src/services/selection-providers/list-of-dashboard-question-providers-selection-provider.service.ts +0 -44
  1015. package/src/services/selection-providers/list-of-dashboard-variable-providers-selection-provider.service.ts +0 -41
  1016. package/src/services/sql-expression-resolver.service.ts +0 -140
  1017. package/src/subscribers/dashboard-question-sql-dataset-config.subscriber.ts +0 -61
  1018. package/src/subscribers/dashboard-question.subscriber.ts +0 -62
  1019. package/src/subscribers/dashboard-variable.subscriber.ts +0 -63
  1020. package/src/subscribers/dashboard.subscriber.ts +0 -62
@@ -0,0 +1,1171 @@
1
+ import {
2
+ BadRequestException,
3
+ Injectable,
4
+ Logger,
5
+ NotFoundException,
6
+ } from '@nestjs/common';
7
+ import { createHash } from 'crypto';
8
+ import archiver from 'archiver';
9
+ import { createWriteStream } from 'fs';
10
+ import { DisallowInProduction } from 'src/decorators/disallow-in-production.decorator';
11
+ import { ConfirmModulePackageImportDto } from 'src/dtos/confirm-module-package-import.dto';
12
+ import { RunModulePackageBuildDto } from 'src/dtos/run-module-package-build.dto';
13
+ import { RunModulePackageSeedDto } from 'src/dtos/run-module-package-seed.dto';
14
+ import { CommandService } from 'src/helpers/command.service';
15
+ import { ModuleMetadataHelperService } from 'src/helpers/module-metadata-helper.service';
16
+ import * as fs from 'fs/promises';
17
+ import * as path from 'path';
18
+ import { v4 as uuidv4 } from 'uuid';
19
+
20
+ type ModulePackageManifest = {
21
+ schemaVersion: string;
22
+ packageType: string;
23
+ exportedAt?: string;
24
+ generatedBy?: {
25
+ name: string;
26
+ version?: string;
27
+ };
28
+ module: {
29
+ name: string;
30
+ displayName?: string;
31
+ description?: string;
32
+ };
33
+ contents: {
34
+ metadataPath: string;
35
+ apiModulePath: string;
36
+ uiModulePath: string;
37
+ };
38
+ compatibility?: Record<string, unknown>;
39
+ postImport?: Record<string, unknown>;
40
+ checksums?: Record<string, string>;
41
+ };
42
+
43
+ type ValidationPayload = {
44
+ valid: boolean;
45
+ errors: string[];
46
+ warnings: string[];
47
+ };
48
+
49
+ type PreviewPayload = {
50
+ module: {
51
+ name: string;
52
+ displayName?: string;
53
+ description?: string;
54
+ };
55
+ manifest: ModulePackageManifest;
56
+ contentsSummary: {
57
+ totalEntries: number;
58
+ solidApiEntries: number;
59
+ solidUiEntries: number;
60
+ };
61
+ requiredPaths: {
62
+ metadataPath: string;
63
+ apiModulePath: string;
64
+ uiModulePath: string;
65
+ };
66
+ conflicts: string[];
67
+ fileTree: string[];
68
+ nextActions: string[];
69
+ };
70
+
71
+ type ParsedArchive = {
72
+ entries: string[];
73
+ archiveRootPrefix: string | null;
74
+ manifest: ModulePackageManifest;
75
+ metadataDocument: any;
76
+ validation: ValidationPayload;
77
+ preview: PreviewPayload;
78
+ };
79
+
80
+ type ModulePackageStatusFile = {
81
+ transactionKey: string;
82
+ status: string;
83
+ currentStep: string;
84
+ moduleName: string | null;
85
+ moduleDisplayName: string | null;
86
+ archiveFileName: string | null;
87
+ archiveFilePath: string | null;
88
+ extractDirPath: string | null;
89
+ archiveRootPrefix: string | null;
90
+ manifest: ModulePackageManifest | null;
91
+ metadataDocument: any;
92
+ preview: PreviewPayload | null;
93
+ validation: ValidationPayload | null;
94
+ conflicts: string[];
95
+ outputs: {
96
+ import: string | null;
97
+ build: string | null;
98
+ seed: string | null;
99
+ };
100
+ errorMessage: string | null;
101
+ createdAt: string;
102
+ updatedAt: string;
103
+ };
104
+
105
+ type ModulePackageExportFile = {
106
+ fileName: string;
107
+ filePath: string;
108
+ mimeType: string;
109
+ };
110
+
111
+ type ModulePackageRuntimeCleanupResult = {
112
+ runtimeRoot: string;
113
+ removedImportTransactions: number;
114
+ removedExportTransactions: number;
115
+ removedImportLooseEntries: number;
116
+ removedExportLooseEntries: number;
117
+ clearedActiveTransactionPointer: boolean;
118
+ clearedAt: string;
119
+ };
120
+
121
+ type ModulePackageActiveTransactionFile = {
122
+ transactionKey: string;
123
+ updatedAt: string;
124
+ };
125
+
126
+ enum ModulePackageStatus {
127
+ uploaded = 'uploaded',
128
+ validated = 'validated',
129
+ awaiting_confirmation = 'awaiting_confirmation',
130
+ import_running = 'import_running',
131
+ awaiting_restart = 'awaiting_restart',
132
+ build_running = 'build_running',
133
+ build_failed = 'build_failed',
134
+ build_succeeded = 'build_succeeded',
135
+ seed_running = 'seed_running',
136
+ seed_failed = 'seed_failed',
137
+ completed = 'completed',
138
+ failed = 'failed',
139
+ }
140
+
141
+ @Injectable()
142
+ export class ModulePackageService {
143
+ private readonly logger = new Logger(ModulePackageService.name);
144
+ private static readonly SUPPORTED_SCHEMA_VERSION = '1.0';
145
+ private static readonly SUPPORTED_PACKAGE_TYPE = 'solidx-module';
146
+
147
+ constructor(
148
+ private readonly commandService: CommandService,
149
+ private readonly moduleMetadataHelperService: ModuleMetadataHelperService,
150
+ ) { }
151
+
152
+ @DisallowInProduction()
153
+ async validateUpload(file: Express.Multer.File) {
154
+ if (!file) {
155
+ throw new BadRequestException('A .sldx archive file is required.');
156
+ }
157
+
158
+ await this.cleanupModulePackageTransactions();
159
+
160
+ const transactionKey = uuidv4();
161
+ const workingDir = await this.createWorkingDir(transactionKey);
162
+ const archiveFileName = file.originalname || path.basename(file.path);
163
+ const archiveFilePath = path.join(workingDir, archiveFileName);
164
+ const extractDirPath = path.join(workingDir, 'extract');
165
+
166
+ await fs.mkdir(extractDirPath, { recursive: true });
167
+ await fs.rename(file.path, archiveFilePath);
168
+
169
+ const parsed = await this.parseArchive(archiveFilePath);
170
+ await this.extractArchive(archiveFilePath, extractDirPath);
171
+
172
+ const transaction: ModulePackageStatusFile = {
173
+ transactionKey,
174
+ status: parsed.validation.valid ? ModulePackageStatus.awaiting_confirmation : ModulePackageStatus.failed,
175
+ currentStep: 'preview',
176
+ moduleName: parsed.manifest.module.name,
177
+ moduleDisplayName: parsed.manifest.module.displayName ?? null,
178
+ archiveFileName,
179
+ archiveFilePath,
180
+ extractDirPath,
181
+ archiveRootPrefix: parsed.archiveRootPrefix,
182
+ manifest: parsed.manifest,
183
+ metadataDocument: parsed.metadataDocument,
184
+ preview: parsed.preview,
185
+ validation: parsed.validation,
186
+ conflicts: parsed.preview.conflicts,
187
+ outputs: {
188
+ import: null,
189
+ build: null,
190
+ seed: null,
191
+ },
192
+ errorMessage: parsed.validation.valid ? null : parsed.validation.errors.join('\n'),
193
+ createdAt: new Date().toISOString(),
194
+ updatedAt: new Date().toISOString(),
195
+ };
196
+
197
+ await this.writeStatusFile(transactionKey, transaction);
198
+ return this.toStatusResponse(transaction);
199
+ }
200
+
201
+ async getStatus(transactionKey: string) {
202
+ const transaction = await this.loadTransaction(transactionKey);
203
+ return this.toStatusResponse(transaction);
204
+ }
205
+
206
+ @DisallowInProduction()
207
+ async getLatestResumableImport() {
208
+ await this.cleanupModulePackageTransactions();
209
+ const transaction = await this.resolveLatestResumableTransaction();
210
+ return transaction ? this.toStatusResponse(transaction) : null;
211
+ }
212
+
213
+ @DisallowInProduction()
214
+ async dismissImport(transactionKey: string) {
215
+ const transaction = await this.loadTransaction(transactionKey);
216
+ await this.clearActiveTransactionIfMatches(transaction.transactionKey);
217
+ return this.toStatusResponse(transaction);
218
+ }
219
+
220
+ @DisallowInProduction()
221
+ async clearPackageRuntime(): Promise<ModulePackageRuntimeCleanupResult> {
222
+ const runtimeRoot = this.getModulePackageRuntimeRoot();
223
+ const importsRoot = this.getModulePackageImportsRoot();
224
+ const exportsRoot = this.getModulePackageExportsRoot();
225
+ const snapshot = await this.collectRuntimeCleanupSnapshot();
226
+
227
+ await fs.rm(runtimeRoot, { recursive: true, force: true });
228
+ await fs.mkdir(importsRoot, { recursive: true });
229
+ await fs.mkdir(exportsRoot, { recursive: true });
230
+
231
+ return {
232
+ runtimeRoot,
233
+ ...snapshot,
234
+ clearedAt: new Date().toISOString(),
235
+ };
236
+ }
237
+
238
+ @DisallowInProduction()
239
+ async exportModulePackage(moduleNameInput: string): Promise<ModulePackageExportFile> {
240
+ const moduleName = (moduleNameInput ?? '').trim();
241
+ if (!moduleName) {
242
+ throw new BadRequestException('A module name is required to export a module package.');
243
+ }
244
+
245
+ const solidApiModulePath = this.getSolidApiModuleTargetPath(moduleName);
246
+ const solidUiModulePath = this.getSolidUiModuleTargetPath(moduleName);
247
+ const metadataFilePath = await this.moduleMetadataHelperService.getModuleMetadataFilePath(moduleName);
248
+
249
+ await this.assertPathExists(solidApiModulePath, 'solid-api module path');
250
+ await this.assertPathExists(solidUiModulePath, 'solid-ui module path');
251
+ await this.assertPathExists(metadataFilePath, 'module metadata file');
252
+
253
+ const metadataDocument = this.parseMetadataDocument(
254
+ await fs.readFile(metadataFilePath, 'utf-8'),
255
+ [],
256
+ );
257
+
258
+ const transactionKey = uuidv4();
259
+ const exportRoot = path.join(this.getModulePackageExportsRoot(), transactionKey);
260
+ const stagingDir = path.join(exportRoot, 'staging');
261
+ const archiveFileName = `${moduleName}.sldx`;
262
+ const archiveFilePath = path.join(exportRoot, archiveFileName);
263
+
264
+ await fs.mkdir(path.join(stagingDir, 'solid-api', 'src'), { recursive: true });
265
+ await fs.mkdir(path.join(stagingDir, 'solid-ui', 'src'), { recursive: true });
266
+
267
+ await fs.cp(solidApiModulePath, path.join(stagingDir, 'solid-api', 'src', moduleName), { recursive: true });
268
+ await fs.cp(solidUiModulePath, path.join(stagingDir, 'solid-ui', 'src', moduleName), { recursive: true });
269
+
270
+ const manifest = await this.buildExportManifest(moduleName, metadataDocument, stagingDir);
271
+ await fs.writeFile(
272
+ path.join(stagingDir, 'manifest.json'),
273
+ JSON.stringify(manifest, null, 2),
274
+ 'utf-8',
275
+ );
276
+
277
+ await this.createArchiveFromDirectory(stagingDir, archiveFilePath);
278
+
279
+ return {
280
+ fileName: archiveFileName,
281
+ filePath: archiveFilePath,
282
+ mimeType: 'application/zip',
283
+ };
284
+ }
285
+
286
+ @DisallowInProduction()
287
+ async confirmImport(transactionKey: string, dto: ConfirmModulePackageImportDto = {}) {
288
+ const transaction = await this.loadTransaction(transactionKey);
289
+ const preview = transaction.preview;
290
+ const validation = transaction.validation;
291
+
292
+ if (!preview || !validation) {
293
+ throw new BadRequestException('The module package transaction is missing preview or validation data.');
294
+ }
295
+
296
+ if (!validation.valid) {
297
+ throw new BadRequestException({
298
+ message: 'The uploaded module package is invalid and cannot be imported.',
299
+ validation,
300
+ });
301
+ }
302
+
303
+ const overwriteExisting = dto.overwriteExisting ?? false;
304
+ if (preview.conflicts.length > 0 && !overwriteExisting) {
305
+ throw new BadRequestException({
306
+ message: 'Conflicts were detected. Re-submit with overwriteExisting=true to continue.',
307
+ conflicts: preview.conflicts,
308
+ });
309
+ }
310
+
311
+ transaction.status = ModulePackageStatus.import_running;
312
+ transaction.currentStep = 'import';
313
+ transaction.errorMessage = null;
314
+ await this.writeStatusFile(transactionKey, transaction);
315
+
316
+ try {
317
+ const moduleName = preview.module.name;
318
+ const solidApiTarget = this.getSolidApiModuleTargetPath(moduleName);
319
+ const solidUiTarget = this.getSolidUiModuleTargetPath(moduleName);
320
+ const extractRoot = transaction.archiveRootPrefix
321
+ ? path.join(transaction.extractDirPath as string, transaction.archiveRootPrefix.replace(/\/$/, ''))
322
+ : transaction.extractDirPath as string;
323
+ const solidApiSource = path.join(extractRoot, 'solid-api', 'src', moduleName);
324
+ const solidUiSource = path.join(extractRoot, 'solid-ui', 'src', moduleName);
325
+
326
+ await this.assertPathExists(solidApiSource, 'solid-api module source');
327
+ await this.assertPathExists(solidUiSource, 'solid-ui module source');
328
+
329
+ if (overwriteExisting) {
330
+ await fs.rm(solidApiTarget, { recursive: true, force: true });
331
+ await fs.rm(solidUiTarget, { recursive: true, force: true });
332
+ }
333
+
334
+ await fs.mkdir(path.dirname(solidApiTarget), { recursive: true });
335
+ await fs.mkdir(path.dirname(solidUiTarget), { recursive: true });
336
+
337
+ await fs.cp(solidApiSource, solidApiTarget, { recursive: true, force: overwriteExisting });
338
+ await fs.cp(solidUiSource, solidUiTarget, { recursive: true, force: overwriteExisting });
339
+
340
+ if (transaction.extractDirPath) {
341
+ await fs.rm(transaction.extractDirPath, { recursive: true, force: true });
342
+ transaction.extractDirPath = null;
343
+ }
344
+
345
+ transaction.status = ModulePackageStatus.awaiting_restart;
346
+ transaction.currentStep = 'restart';
347
+ transaction.outputs.import = [
348
+ `Placed solid-api module at ${solidApiTarget}`,
349
+ `Placed solid-ui module at ${solidUiTarget}`,
350
+ `Metadata file placed at ${preview.requiredPaths.metadataPath}`,
351
+ ].join('\n');
352
+ await this.writeStatusFile(transactionKey, transaction);
353
+ await this.syncActiveTransactionPointer(transaction);
354
+
355
+ return this.toStatusResponse(transaction);
356
+ } catch (error: any) {
357
+ transaction.status = ModulePackageStatus.failed;
358
+ transaction.currentStep = 'import';
359
+ transaction.errorMessage = error.message ?? 'Failed to import the module package.';
360
+ await this.writeStatusFile(transactionKey, transaction);
361
+ await this.syncActiveTransactionPointer(transaction);
362
+ throw error;
363
+ }
364
+ }
365
+
366
+ @DisallowInProduction()
367
+ async runBuild(transactionKey: string, dto: RunModulePackageBuildDto = {}) {
368
+ const transaction = await this.loadTransaction(transactionKey);
369
+ transaction.status = ModulePackageStatus.build_running;
370
+ transaction.currentStep = 'build';
371
+ transaction.errorMessage = null;
372
+ await this.writeStatusFile(transactionKey, transaction);
373
+
374
+ try {
375
+ const buildSolidApi = dto.buildSolidApi ?? true;
376
+ const buildSolidUi = dto.buildSolidUi ?? true;
377
+ const outputs: string[] = [];
378
+ const failedTargets: string[] = [];
379
+ const projectRoot = this.getProjectRoot();
380
+
381
+ if (buildSolidApi) {
382
+ try {
383
+ const output = await this.commandService.executeCommandWithArgs({
384
+ command: 'npx',
385
+ args: ['-y', '@solidxai/solidctl@latest', 'build'],
386
+ cwd: projectRoot,
387
+ });
388
+ outputs.push(`solidctl build [success]\n${output}`.trim());
389
+ } catch (error: any) {
390
+ failedTargets.push('solidctl build');
391
+ outputs.push(`solidctl build [failed]\n${error?.message ?? 'Build failed.'}`.trim());
392
+ }
393
+ }
394
+
395
+ if (buildSolidUi) {
396
+ try {
397
+ const output = await this.commandService.executeCommandWithArgs({
398
+ command: 'npx',
399
+ args: ['-y', '@solidxai/solidctl@latest', 'build', '--ui-only'],
400
+ cwd: projectRoot,
401
+ });
402
+ outputs.push(`solidctl build --ui-only [success]\n${output}`.trim());
403
+ } catch (error: any) {
404
+ failedTargets.push('solidctl build --ui-only');
405
+ outputs.push(`solidctl build --ui-only [failed]\n${error?.message ?? 'Build failed.'}`.trim());
406
+ }
407
+ }
408
+
409
+ transaction.status = failedTargets.length > 0
410
+ ? ModulePackageStatus.build_failed
411
+ : ModulePackageStatus.build_succeeded;
412
+ transaction.currentStep = 'build';
413
+ transaction.outputs.build = outputs.join('\n\n');
414
+ transaction.errorMessage = failedTargets.length > 0
415
+ ? `Build completed with errors in: ${failedTargets.join(', ')}`
416
+ : null;
417
+ await this.writeStatusFile(transactionKey, transaction);
418
+ await this.syncActiveTransactionPointer(transaction);
419
+
420
+ return this.toStatusResponse(transaction);
421
+ } catch (error: any) {
422
+ transaction.status = ModulePackageStatus.build_failed;
423
+ transaction.currentStep = 'build';
424
+ transaction.errorMessage = error.message ?? 'Build failed.';
425
+ transaction.outputs.build = error.message ?? '';
426
+ await this.writeStatusFile(transactionKey, transaction);
427
+ await this.syncActiveTransactionPointer(transaction);
428
+ throw error;
429
+ }
430
+ }
431
+
432
+ @DisallowInProduction()
433
+ async runSeed(transactionKey: string, dto: RunModulePackageSeedDto = {}) {
434
+ const transaction = await this.loadTransaction(transactionKey);
435
+ const moduleName = transaction.moduleName;
436
+
437
+ if (!moduleName) {
438
+ throw new BadRequestException('Unable to seed because the transaction is missing moduleName.');
439
+ }
440
+
441
+ transaction.status = ModulePackageStatus.seed_running;
442
+ transaction.currentStep = 'seed';
443
+ transaction.errorMessage = null;
444
+ await this.writeStatusFile(transactionKey, transaction);
445
+
446
+ try {
447
+ const output = await this.commandService.executeCommandWithArgs({
448
+ command: 'npx',
449
+ args: ['-y', '@solidxai/solidctl@latest', 'seed', '--modules-to-seed', moduleName],
450
+ cwd: this.getProjectRoot(),
451
+ });
452
+ transaction.status = ModulePackageStatus.completed;
453
+ transaction.currentStep = 'done';
454
+ transaction.outputs.seed = [
455
+ `solidctl seed --modules-to-seed ${moduleName} [success]`,
456
+ output,
457
+ ].filter(Boolean).join('\n');
458
+ await this.writeStatusFile(transactionKey, transaction);
459
+ await this.syncActiveTransactionPointer(transaction);
460
+
461
+ return this.toStatusResponse(transaction);
462
+ } catch (error: any) {
463
+ transaction.status = ModulePackageStatus.seed_failed;
464
+ transaction.currentStep = 'seed';
465
+ transaction.errorMessage = error.message ?? 'Seed failed.';
466
+ transaction.outputs.seed = error.message ?? '';
467
+ await this.writeStatusFile(transactionKey, transaction);
468
+ await this.syncActiveTransactionPointer(transaction);
469
+ return this.toStatusResponse(transaction);
470
+ }
471
+ }
472
+
473
+ private async parseArchive(archiveFilePath: string): Promise<ParsedArchive> {
474
+ const entries = await this.listArchiveEntries(archiveFilePath);
475
+ const archiveRootPrefix = this.detectArchiveRootPrefix(entries);
476
+ const normalizedEntries = this.normalizeArchiveEntries(entries, archiveRootPrefix);
477
+ const validationErrors: string[] = [];
478
+ const validationWarnings: string[] = [];
479
+
480
+ if (path.extname(archiveFilePath).toLowerCase() !== '.sldx') {
481
+ validationErrors.push('Only .sldx archives are supported.');
482
+ }
483
+
484
+ const unsafeEntries = normalizedEntries.filter((entry) => this.isUnsafeArchivePath(entry));
485
+ if (unsafeEntries.length > 0) {
486
+ validationErrors.push(`Archive contains unsafe paths: ${unsafeEntries.join(', ')}`);
487
+ }
488
+
489
+ if (!normalizedEntries.includes('manifest.json')) {
490
+ validationErrors.push('Archive is missing manifest.json at the root.');
491
+ }
492
+
493
+ const manifestArchivePath = this.toArchiveEntryPath(archiveRootPrefix, 'manifest.json');
494
+ const manifestText = normalizedEntries.includes('manifest.json')
495
+ ? await this.readArchiveEntry(archiveFilePath, manifestArchivePath)
496
+ : '';
497
+ const manifest = this.parseManifest(manifestText, validationErrors);
498
+
499
+ if (!manifest) {
500
+ return {
501
+ entries: normalizedEntries,
502
+ archiveRootPrefix,
503
+ manifest: this.getFallbackManifest(),
504
+ metadataDocument: null,
505
+ validation: {
506
+ valid: false,
507
+ errors: validationErrors,
508
+ warnings: validationWarnings,
509
+ },
510
+ preview: {
511
+ module: { name: '', displayName: '' },
512
+ manifest: this.getFallbackManifest(),
513
+ contentsSummary: {
514
+ totalEntries: normalizedEntries.length,
515
+ solidApiEntries: normalizedEntries.filter((entry) => entry.startsWith('solid-api/')).length,
516
+ solidUiEntries: normalizedEntries.filter((entry) => entry.startsWith('solid-ui/')).length,
517
+ },
518
+ requiredPaths: {
519
+ metadataPath: '',
520
+ apiModulePath: '',
521
+ uiModulePath: '',
522
+ },
523
+ conflicts: [],
524
+ fileTree: normalizedEntries,
525
+ nextActions: ['Fix archive structure and upload again.'],
526
+ },
527
+ };
528
+ }
529
+
530
+ if (manifest.packageType !== ModulePackageService.SUPPORTED_PACKAGE_TYPE) {
531
+ validationErrors.push(`manifest.json packageType must be "${ModulePackageService.SUPPORTED_PACKAGE_TYPE}".`);
532
+ }
533
+ if (manifest.schemaVersion !== ModulePackageService.SUPPORTED_SCHEMA_VERSION) {
534
+ validationErrors.push(`manifest.json schemaVersion must be "${ModulePackageService.SUPPORTED_SCHEMA_VERSION}".`);
535
+ }
536
+ if (!manifest.module?.name) {
537
+ validationErrors.push('manifest.json module.name is required.');
538
+ }
539
+
540
+ const moduleName = manifest.module?.name ?? '';
541
+ const expectedPaths = this.buildExpectedPaths(moduleName);
542
+
543
+ if (manifest.contents?.metadataPath !== expectedPaths.metadataPath) {
544
+ validationErrors.push(`manifest.json contents.metadataPath must be "${expectedPaths.metadataPath}".`);
545
+ }
546
+ if (manifest.contents?.apiModulePath !== expectedPaths.apiModulePath) {
547
+ validationErrors.push(`manifest.json contents.apiModulePath must be "${expectedPaths.apiModulePath}".`);
548
+ }
549
+ if (manifest.contents?.uiModulePath !== expectedPaths.uiModulePath) {
550
+ validationErrors.push(`manifest.json contents.uiModulePath must be "${expectedPaths.uiModulePath}".`);
551
+ }
552
+
553
+ if (!normalizedEntries.includes(expectedPaths.metadataPath)) {
554
+ validationErrors.push(`Archive is missing ${expectedPaths.metadataPath}.`);
555
+ }
556
+ if (!normalizedEntries.includes(expectedPaths.apiModulePath)) {
557
+ validationErrors.push(`Archive is missing ${expectedPaths.apiModulePath}.`);
558
+ }
559
+ if (!normalizedEntries.includes(expectedPaths.uiModulePath)) {
560
+ validationErrors.push(`Archive is missing ${expectedPaths.uiModulePath}.`);
561
+ }
562
+
563
+ const metadataDocument = normalizedEntries.includes(expectedPaths.metadataPath)
564
+ ? this.parseMetadataDocument(
565
+ await this.readArchiveEntry(archiveFilePath, this.toArchiveEntryPath(archiveRootPrefix, expectedPaths.metadataPath)),
566
+ validationErrors,
567
+ )
568
+ : null;
569
+
570
+ const metadataModuleName = metadataDocument?.moduleMetadata?.name;
571
+ if (metadataModuleName && metadataModuleName !== moduleName) {
572
+ validationErrors.push(`Metadata module name "${metadataModuleName}" does not match manifest module name "${moduleName}".`);
573
+ }
574
+
575
+ if (!manifest.checksums || Object.keys(manifest.checksums).length === 0) {
576
+ validationWarnings.push('manifest.json does not include checksums. Checksums are recommended.');
577
+ }
578
+
579
+ const conflicts = await this.detectConflicts(moduleName);
580
+ if (conflicts.length > 0) {
581
+ validationWarnings.push('The target module already exists locally and will require overwrite confirmation.');
582
+ }
583
+
584
+ const validation: ValidationPayload = {
585
+ valid: validationErrors.length === 0,
586
+ errors: validationErrors,
587
+ warnings: validationWarnings,
588
+ };
589
+
590
+ const preview: PreviewPayload = {
591
+ module: manifest.module,
592
+ manifest,
593
+ contentsSummary: {
594
+ totalEntries: normalizedEntries.length,
595
+ solidApiEntries: normalizedEntries.filter((entry) => entry.startsWith('solid-api/')).length,
596
+ solidUiEntries: normalizedEntries.filter((entry) => entry.startsWith('solid-ui/')).length,
597
+ },
598
+ requiredPaths: expectedPaths,
599
+ conflicts,
600
+ fileTree: normalizedEntries,
601
+ nextActions: [
602
+ 'Review archive preview.',
603
+ 'Confirm import to place files locally.',
604
+ 'Wait for service restart, then run build and seed.',
605
+ ],
606
+ };
607
+
608
+ return {
609
+ entries: normalizedEntries,
610
+ archiveRootPrefix,
611
+ manifest,
612
+ metadataDocument,
613
+ validation,
614
+ preview,
615
+ };
616
+ }
617
+
618
+ private parseManifest(manifestText: string, validationErrors: string[]): ModulePackageManifest | null {
619
+ if (!manifestText) {
620
+ return null;
621
+ }
622
+
623
+ try {
624
+ return JSON.parse(manifestText) as ModulePackageManifest;
625
+ } catch (error) {
626
+ validationErrors.push('manifest.json is not valid JSON.');
627
+ return null;
628
+ }
629
+ }
630
+
631
+ private parseMetadataDocument(documentText: string, validationErrors: string[]) {
632
+ try {
633
+ return JSON.parse(documentText);
634
+ } catch (error) {
635
+ validationErrors.push('Module metadata JSON is not valid JSON.');
636
+ return null;
637
+ }
638
+ }
639
+
640
+ private async listArchiveEntries(archiveFilePath: string): Promise<string[]> {
641
+ const output = await this.commandService.executeCommandWithArgs({
642
+ command: 'unzip',
643
+ args: ['-Z1', archiveFilePath],
644
+ });
645
+
646
+ return output
647
+ .split(/\r?\n/)
648
+ .map((entry) => entry.trim())
649
+ .filter(Boolean);
650
+ }
651
+
652
+ private async readArchiveEntry(archiveFilePath: string, entryPath: string): Promise<string> {
653
+ return this.commandService.executeCommandWithArgs({
654
+ command: 'unzip',
655
+ args: ['-p', archiveFilePath, entryPath],
656
+ });
657
+ }
658
+
659
+ private async extractArchive(archiveFilePath: string, extractDirPath: string) {
660
+ await this.commandService.executeCommandWithArgs({
661
+ command: 'unzip',
662
+ args: ['-o', archiveFilePath, '-d', extractDirPath],
663
+ });
664
+ }
665
+
666
+ private async detectConflicts(moduleName: string): Promise<string[]> {
667
+ const conflicts: string[] = [];
668
+ const solidApiTarget = this.getSolidApiModuleTargetPath(moduleName);
669
+ const solidUiTarget = this.getSolidUiModuleTargetPath(moduleName);
670
+ const metadataFilePath = await this.moduleMetadataHelperService.getModuleMetadataFilePath(moduleName);
671
+
672
+ if (await this.pathExists(solidApiTarget)) {
673
+ conflicts.push(`solid-api module already exists at ${solidApiTarget}`);
674
+ }
675
+ if (await this.pathExists(solidUiTarget)) {
676
+ conflicts.push(`solid-ui module already exists at ${solidUiTarget}`);
677
+ }
678
+ if (await this.pathExists(metadataFilePath)) {
679
+ conflicts.push(`module metadata already exists at ${metadataFilePath}`);
680
+ }
681
+
682
+ return conflicts;
683
+ }
684
+
685
+ private buildExpectedPaths(moduleName: string) {
686
+ return {
687
+ metadataPath: `solid-api/src/${moduleName}/metadata/${moduleName}-metadata.json`,
688
+ apiModulePath: `solid-api/src/${moduleName}/${moduleName}.module.ts`,
689
+ uiModulePath: `solid-ui/src/${moduleName}/${moduleName}.ui-module.ts`,
690
+ };
691
+ }
692
+
693
+ private detectArchiveRootPrefix(entries: string[]): string | null {
694
+ const normalized = entries
695
+ .map((entry) => entry.trim())
696
+ .filter(Boolean)
697
+ .filter((entry) => !this.isMacOsMetadataEntry(entry));
698
+
699
+ if (normalized.length === 0) {
700
+ return null;
701
+ }
702
+
703
+ const topLevelSegments = normalized
704
+ .map((entry) => entry.split('/')[0])
705
+ .filter(Boolean);
706
+
707
+ const uniqueTopLevelSegments = Array.from(new Set(topLevelSegments));
708
+ if (uniqueTopLevelSegments.length !== 1) {
709
+ return null;
710
+ }
711
+
712
+ const onlySegment = uniqueTopLevelSegments[0];
713
+ const hasNestedEntries = normalized.some((entry) => entry.startsWith(`${onlySegment}/`));
714
+ return hasNestedEntries ? `${onlySegment}/` : null;
715
+ }
716
+
717
+ private normalizeArchiveEntries(entries: string[], archiveRootPrefix: string | null) {
718
+ const filteredEntries = entries.filter((entry) => !this.isMacOsMetadataEntry(entry));
719
+
720
+ if (!archiveRootPrefix) {
721
+ return filteredEntries;
722
+ }
723
+
724
+ return filteredEntries
725
+ .map((entry) => entry.startsWith(archiveRootPrefix) ? entry.slice(archiveRootPrefix.length) : entry)
726
+ .filter(Boolean);
727
+ }
728
+
729
+ private toArchiveEntryPath(archiveRootPrefix: string | null, normalizedEntryPath: string) {
730
+ return archiveRootPrefix ? `${archiveRootPrefix}${normalizedEntryPath}` : normalizedEntryPath;
731
+ }
732
+
733
+ private isUnsafeArchivePath(entry: string) {
734
+ return entry.startsWith('/') || entry.includes('..') || /^[A-Za-z]:/.test(entry);
735
+ }
736
+
737
+ private isMacOsMetadataEntry(entry: string) {
738
+ const normalizedEntry = entry.trim();
739
+ if (!normalizedEntry) {
740
+ return false;
741
+ }
742
+
743
+ const segments = normalizedEntry.split('/').filter(Boolean);
744
+ return segments.some((segment) => segment === '__MACOSX' || segment.startsWith('._'));
745
+ }
746
+
747
+ private getFallbackManifest(): ModulePackageManifest {
748
+ return {
749
+ schemaVersion: ModulePackageService.SUPPORTED_SCHEMA_VERSION,
750
+ packageType: ModulePackageService.SUPPORTED_PACKAGE_TYPE,
751
+ module: { name: '', displayName: '' },
752
+ contents: {
753
+ metadataPath: '',
754
+ apiModulePath: '',
755
+ uiModulePath: '',
756
+ },
757
+ };
758
+ }
759
+
760
+ private async loadTransaction(transactionKey: string) {
761
+ this.assertSafeTransactionKey(transactionKey);
762
+ const statusFilePath = this.getStatusFilePath(transactionKey);
763
+
764
+ if (!(await this.pathExists(statusFilePath))) {
765
+ throw new NotFoundException(`Module package transaction ${transactionKey} was not found.`);
766
+ }
767
+
768
+ return JSON.parse(await fs.readFile(statusFilePath, 'utf-8')) as ModulePackageStatusFile;
769
+ }
770
+
771
+ private isResumableStatus(status: string | null | undefined) {
772
+ return [
773
+ ModulePackageStatus.import_running,
774
+ ModulePackageStatus.awaiting_restart,
775
+ ModulePackageStatus.build_running,
776
+ ModulePackageStatus.build_failed,
777
+ ModulePackageStatus.build_succeeded,
778
+ ModulePackageStatus.seed_running,
779
+ ModulePackageStatus.seed_failed,
780
+ ].includes(status as ModulePackageStatus);
781
+ }
782
+
783
+ private async createWorkingDir(transactionKey: string) {
784
+ const baseDir = path.join(
785
+ this.getModulePackageImportsRoot(),
786
+ transactionKey,
787
+ );
788
+
789
+ await fs.mkdir(baseDir, { recursive: true });
790
+ return baseDir;
791
+ }
792
+
793
+ private getSolidApiRoot() {
794
+ return process.cwd();
795
+ }
796
+
797
+ private getProjectRoot() {
798
+ return path.resolve(this.getSolidApiRoot(), '..');
799
+ }
800
+
801
+ private getSolidUiRoot() {
802
+ return path.join(this.getProjectRoot(), 'solid-ui');
803
+ }
804
+
805
+ private getModulePackageImportsRoot() {
806
+ return path.join(
807
+ this.getModulePackageRuntimeRoot(),
808
+ 'module-package-imports',
809
+ );
810
+ }
811
+
812
+ private getModulePackageExportsRoot() {
813
+ return path.join(
814
+ this.getModulePackageRuntimeRoot(),
815
+ 'module-package-exports',
816
+ );
817
+ }
818
+
819
+ private getModulePackageRuntimeRoot() {
820
+ const configuredRuntimeRoot = process.env.SOLIDX_MODULE_PACKAGE_RUNTIME_DIR?.trim();
821
+
822
+ if (configuredRuntimeRoot) {
823
+ return path.resolve(configuredRuntimeRoot);
824
+ }
825
+
826
+ return path.join(
827
+ this.getProjectRoot(),
828
+ '.solidx-runtime',
829
+ );
830
+ }
831
+
832
+ private getSolidApiModuleTargetPath(moduleName: string) {
833
+ return path.join(this.getSolidApiRoot(), 'src', moduleName);
834
+ }
835
+
836
+ private getSolidUiModuleTargetPath(moduleName: string) {
837
+ return path.join(this.getSolidUiRoot(), 'src', moduleName);
838
+ }
839
+
840
+ private async pathExists(targetPath: string) {
841
+ try {
842
+ await fs.access(targetPath);
843
+ return true;
844
+ } catch (error) {
845
+ return false;
846
+ }
847
+ }
848
+
849
+ private async assertPathExists(targetPath: string, label: string) {
850
+ if (!(await this.pathExists(targetPath))) {
851
+ throw new BadRequestException(`Expected ${label} at ${targetPath}, but it was not found in the extracted archive.`);
852
+ }
853
+ }
854
+
855
+ private async readDirSafe(targetPath: string) {
856
+ try {
857
+ return await fs.readdir(targetPath, { withFileTypes: true });
858
+ } catch (error) {
859
+ return [];
860
+ }
861
+ }
862
+
863
+ private assertSafeTransactionKey(transactionKey: string) {
864
+ if (!/^[a-zA-Z0-9-]+$/.test(transactionKey)) {
865
+ throw new BadRequestException('Invalid module package transaction key.');
866
+ }
867
+ }
868
+
869
+ private getStatusFilePath(transactionKey: string) {
870
+ this.assertSafeTransactionKey(transactionKey);
871
+ return path.join(this.getModulePackageImportsRoot(), transactionKey, 'status.json');
872
+ }
873
+
874
+ private getActiveTransactionFilePath() {
875
+ return path.join(this.getModulePackageImportsRoot(), 'active-transaction.json');
876
+ }
877
+
878
+ private async writeStatusFile(transactionKey: string, payload: ModulePackageStatusFile) {
879
+ payload.updatedAt = new Date().toISOString();
880
+ const statusFilePath = this.getStatusFilePath(transactionKey);
881
+ await fs.mkdir(path.dirname(statusFilePath), { recursive: true });
882
+ await fs.writeFile(statusFilePath, JSON.stringify(payload, null, 2));
883
+ }
884
+
885
+ private async markActiveTransaction(transactionKey: string) {
886
+ const activeTransactionFilePath = this.getActiveTransactionFilePath();
887
+ await fs.mkdir(path.dirname(activeTransactionFilePath), { recursive: true });
888
+ const payload: ModulePackageActiveTransactionFile = {
889
+ transactionKey,
890
+ updatedAt: new Date().toISOString(),
891
+ };
892
+ await fs.writeFile(activeTransactionFilePath, JSON.stringify(payload, null, 2));
893
+ }
894
+
895
+ private async clearActiveTransactionIfMatches(transactionKey: string) {
896
+ const activeTransaction = await this.loadActiveTransactionPointer();
897
+ if (!activeTransaction || activeTransaction.transactionKey !== transactionKey) {
898
+ return;
899
+ }
900
+
901
+ await fs.rm(this.getActiveTransactionFilePath(), { force: true });
902
+ }
903
+
904
+ private async loadActiveTransactionPointer(): Promise<ModulePackageActiveTransactionFile | null> {
905
+ try {
906
+ return JSON.parse(await fs.readFile(this.getActiveTransactionFilePath(), 'utf-8')) as ModulePackageActiveTransactionFile;
907
+ } catch (error) {
908
+ return null;
909
+ }
910
+ }
911
+
912
+ private async syncActiveTransactionPointer(transaction: ModulePackageStatusFile) {
913
+ if (this.isResumableStatus(transaction.status)) {
914
+ await this.markActiveTransaction(transaction.transactionKey);
915
+ return;
916
+ }
917
+
918
+ await this.clearActiveTransactionIfMatches(transaction.transactionKey);
919
+ }
920
+
921
+ private async collectRuntimeCleanupSnapshot() {
922
+ const importEntries = await this.readDirSafe(this.getModulePackageImportsRoot());
923
+ const exportEntries = await this.readDirSafe(this.getModulePackageExportsRoot());
924
+
925
+ const importTransactionEntries = importEntries.filter(
926
+ (entry) => entry.isDirectory() && /^[a-zA-Z0-9-]+$/.test(entry.name),
927
+ );
928
+ const exportTransactionEntries = exportEntries.filter(
929
+ (entry) => entry.isDirectory() && /^[a-zA-Z0-9-]+$/.test(entry.name),
930
+ );
931
+
932
+ const importLooseEntries = importEntries.filter(
933
+ (entry) => !(entry.isDirectory() && /^[a-zA-Z0-9-]+$/.test(entry.name)),
934
+ );
935
+ const exportLooseEntries = exportEntries.filter(
936
+ (entry) => !(entry.isDirectory() && /^[a-zA-Z0-9-]+$/.test(entry.name)),
937
+ );
938
+
939
+ return {
940
+ removedImportTransactions: importTransactionEntries.length,
941
+ removedExportTransactions: exportTransactionEntries.length,
942
+ removedImportLooseEntries: importLooseEntries.length,
943
+ removedExportLooseEntries: exportLooseEntries.length,
944
+ clearedActiveTransactionPointer: importEntries.some((entry) => entry.name === 'active-transaction.json'),
945
+ };
946
+ }
947
+
948
+ private getCompletedTransactionRetentionMs() {
949
+ const retentionDays = Number(process.env.SOLIDX_MODULE_PACKAGE_RETENTION_DAYS ?? 7);
950
+ const safeDays = Number.isFinite(retentionDays) && retentionDays > 0 ? retentionDays : 7;
951
+ return safeDays * 24 * 60 * 60 * 1000;
952
+ }
953
+
954
+ private getPendingTransactionRetentionMs() {
955
+ const retentionHours = Number(process.env.SOLIDX_MODULE_PACKAGE_PENDING_RETENTION_HOURS ?? 24);
956
+ const safeHours = Number.isFinite(retentionHours) && retentionHours > 0 ? retentionHours : 24;
957
+ return safeHours * 60 * 60 * 1000;
958
+ }
959
+
960
+ private async cleanupModulePackageTransactions() {
961
+ const importsRoot = this.getModulePackageImportsRoot();
962
+ const activePointer = await this.loadActiveTransactionPointer();
963
+ const now = Date.now();
964
+
965
+ try {
966
+ await fs.mkdir(importsRoot, { recursive: true });
967
+ const entries = await fs.readdir(importsRoot, { withFileTypes: true });
968
+
969
+ for (const entry of entries) {
970
+ if (!entry.isDirectory()) {
971
+ continue;
972
+ }
973
+
974
+ const transactionKey = entry.name;
975
+ if (!/^[a-zA-Z0-9-]+$/.test(transactionKey)) {
976
+ continue;
977
+ }
978
+
979
+ const statusFilePath = this.getStatusFilePath(transactionKey);
980
+ let transaction: ModulePackageStatusFile | null = null;
981
+
982
+ try {
983
+ transaction = JSON.parse(await fs.readFile(statusFilePath, 'utf-8')) as ModulePackageStatusFile;
984
+ } catch (error) {
985
+ continue;
986
+ }
987
+
988
+ const updatedAtMs = transaction.updatedAt ? new Date(transaction.updatedAt).getTime() : 0;
989
+ const ageMs = updatedAtMs > 0 ? now - updatedAtMs : Number.MAX_SAFE_INTEGER;
990
+ const isResumable = this.isResumableStatus(transaction.status);
991
+ const maxAgeMs = isResumable
992
+ ? this.getPendingTransactionRetentionMs()
993
+ : this.getCompletedTransactionRetentionMs();
994
+ const shouldDelete = ageMs > maxAgeMs;
995
+
996
+ if (!shouldDelete) {
997
+ continue;
998
+ }
999
+
1000
+ await fs.rm(path.join(importsRoot, transactionKey), { recursive: true, force: true });
1001
+
1002
+ if (activePointer?.transactionKey === transactionKey) {
1003
+ await fs.rm(this.getActiveTransactionFilePath(), { force: true });
1004
+ }
1005
+ }
1006
+ } catch (error) {
1007
+ this.logger.warn(`Failed to clean up module package transactions: ${String(error)}`);
1008
+ }
1009
+ }
1010
+
1011
+ private async resolveLatestResumableTransaction(): Promise<ModulePackageStatusFile | null> {
1012
+ const activePointer = await this.loadActiveTransactionPointer();
1013
+ if (activePointer?.transactionKey) {
1014
+ try {
1015
+ const activeTransaction = await this.loadTransaction(activePointer.transactionKey);
1016
+ if (this.isResumableStatus(activeTransaction.status)) {
1017
+ return activeTransaction;
1018
+ }
1019
+
1020
+ await this.clearActiveTransactionIfMatches(activePointer.transactionKey);
1021
+ } catch (error) {
1022
+ await this.clearActiveTransactionIfMatches(activePointer.transactionKey);
1023
+ }
1024
+ }
1025
+
1026
+ const importsRoot = this.getModulePackageImportsRoot();
1027
+ const candidates: ModulePackageStatusFile[] = [];
1028
+
1029
+ try {
1030
+ const entries = await fs.readdir(importsRoot, { withFileTypes: true });
1031
+
1032
+ for (const entry of entries) {
1033
+ if (!entry.isDirectory()) {
1034
+ continue;
1035
+ }
1036
+
1037
+ const transactionKey = entry.name;
1038
+ if (!/^[a-zA-Z0-9-]+$/.test(transactionKey)) {
1039
+ continue;
1040
+ }
1041
+
1042
+ try {
1043
+ const transaction = await this.loadTransaction(transactionKey);
1044
+ if (this.isResumableStatus(transaction.status)) {
1045
+ candidates.push(transaction);
1046
+ }
1047
+ } catch (error) {
1048
+ continue;
1049
+ }
1050
+ }
1051
+ } catch (error) {
1052
+ return null;
1053
+ }
1054
+
1055
+ candidates.sort((left, right) => {
1056
+ const leftUpdatedAt = new Date(left.updatedAt ?? left.createdAt ?? 0).getTime();
1057
+ const rightUpdatedAt = new Date(right.updatedAt ?? right.createdAt ?? 0).getTime();
1058
+ return rightUpdatedAt - leftUpdatedAt;
1059
+ });
1060
+
1061
+ const latest = candidates[0] ?? null;
1062
+ if (latest) {
1063
+ await this.markActiveTransaction(latest.transactionKey);
1064
+ }
1065
+ return latest;
1066
+ }
1067
+
1068
+ private toStatusResponse(transaction: ModulePackageStatusFile) {
1069
+ return {
1070
+ transactionKey: transaction.transactionKey,
1071
+ status: transaction.status,
1072
+ currentStep: transaction.currentStep,
1073
+ moduleName: transaction.moduleName,
1074
+ moduleDisplayName: transaction.moduleDisplayName,
1075
+ archiveFileName: transaction.archiveFileName,
1076
+ manifest: transaction.manifest,
1077
+ preview: transaction.preview,
1078
+ validation: transaction.validation,
1079
+ conflicts: transaction.conflicts,
1080
+ outputs: transaction.outputs,
1081
+ errorMessage: transaction.errorMessage,
1082
+ createdAt: transaction.createdAt,
1083
+ updatedAt: transaction.updatedAt,
1084
+ };
1085
+ }
1086
+
1087
+ private async buildExportManifest(moduleName: string, metadataDocument: any, stagingDir: string): Promise<ModulePackageManifest> {
1088
+ const expectedPaths = this.buildExpectedPaths(moduleName);
1089
+ const checksums = await this.computeDirectoryChecksums(stagingDir, ['manifest.json']);
1090
+
1091
+ return {
1092
+ schemaVersion: ModulePackageService.SUPPORTED_SCHEMA_VERSION,
1093
+ packageType: ModulePackageService.SUPPORTED_PACKAGE_TYPE,
1094
+ exportedAt: new Date().toISOString(),
1095
+ generatedBy: {
1096
+ name: '@solidxai/core',
1097
+ },
1098
+ module: {
1099
+ name: moduleName,
1100
+ displayName: metadataDocument?.moduleMetadata?.displayName,
1101
+ description: metadataDocument?.moduleMetadata?.description,
1102
+ },
1103
+ contents: expectedPaths,
1104
+ postImport: {
1105
+ recommendedSteps: ['restart', 'build', 'seed'],
1106
+ },
1107
+ checksums,
1108
+ };
1109
+ }
1110
+
1111
+ private async computeDirectoryChecksums(rootDir: string, excludedRelativePaths: string[] = []): Promise<Record<string, string>> {
1112
+ const excludedPaths = new Set(excludedRelativePaths.map((entry) => entry.replace(/\\/g, '/')));
1113
+ const filePaths = await this.collectFilePathsRecursively(rootDir);
1114
+ const checksums: Record<string, string> = {};
1115
+
1116
+ for (const filePath of filePaths) {
1117
+ const relativePath = path.relative(rootDir, filePath).replace(/\\/g, '/');
1118
+ if (excludedPaths.has(relativePath)) {
1119
+ continue;
1120
+ }
1121
+
1122
+ checksums[relativePath] = await this.computeSha256(filePath);
1123
+ }
1124
+
1125
+ return checksums;
1126
+ }
1127
+
1128
+ private async collectFilePathsRecursively(rootDir: string): Promise<string[]> {
1129
+ const entries = await fs.readdir(rootDir, { withFileTypes: true });
1130
+ const nestedPaths = await Promise.all(entries.map(async (entry) => {
1131
+ const entryPath = path.join(rootDir, entry.name);
1132
+ if (entry.isDirectory()) {
1133
+ return this.collectFilePathsRecursively(entryPath);
1134
+ }
1135
+
1136
+ return [entryPath];
1137
+ }));
1138
+
1139
+ return nestedPaths.flat();
1140
+ }
1141
+
1142
+ private async createArchiveFromDirectory(sourceDir: string, archiveFilePath: string): Promise<void> {
1143
+ await fs.mkdir(path.dirname(archiveFilePath), { recursive: true });
1144
+
1145
+ await new Promise<void>((resolve, reject) => {
1146
+ const output = createWriteStream(archiveFilePath);
1147
+ const archive = archiver('zip', {
1148
+ zlib: { level: 9 },
1149
+ });
1150
+
1151
+ const rejectOnce = (error: Error) => {
1152
+ output.destroy();
1153
+ reject(error);
1154
+ };
1155
+
1156
+ output.on('close', () => resolve());
1157
+ output.on('error', rejectOnce);
1158
+ archive.on('warning', rejectOnce);
1159
+ archive.on('error', rejectOnce);
1160
+
1161
+ archive.pipe(output);
1162
+ archive.directory(sourceDir, false);
1163
+ void archive.finalize();
1164
+ });
1165
+ }
1166
+
1167
+ private async computeSha256(filePath: string): Promise<string> {
1168
+ const fileBuffer = await fs.readFile(filePath);
1169
+ return createHash('sha256').update(fileBuffer).digest('hex');
1170
+ }
1171
+ }