@rayanmustafa/discord-chat-exporter 1.0.0

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.

Potentially problematic release.


This version of @rayanmustafa/discord-chat-exporter might be problematic. Click here for more details.

Files changed (575) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +370 -0
  3. package/dist/ai/providers.d.ts +57 -0
  4. package/dist/ai/providers.d.ts.map +1 -0
  5. package/dist/ai/providers.js +297 -0
  6. package/dist/ai/providers.js.map +1 -0
  7. package/dist/analytics/report.d.ts +3 -0
  8. package/dist/analytics/report.d.ts.map +1 -0
  9. package/dist/analytics/report.js +264 -0
  10. package/dist/analytics/report.js.map +1 -0
  11. package/dist/cli.d.ts +2 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +2 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/contracts/public-types-contract.d.ts +2 -0
  16. package/dist/contracts/public-types-contract.d.ts.map +1 -0
  17. package/dist/contracts/public-types-contract.js +2 -0
  18. package/dist/contracts/public-types-contract.js.map +1 -0
  19. package/dist/core/attachments.d.ts +12 -0
  20. package/dist/core/attachments.d.ts.map +1 -0
  21. package/dist/core/attachments.js +130 -0
  22. package/dist/core/attachments.js.map +1 -0
  23. package/dist/core/batch-export.d.ts +7 -0
  24. package/dist/core/batch-export.d.ts.map +1 -0
  25. package/dist/core/batch-export.js +129 -0
  26. package/dist/core/batch-export.js.map +1 -0
  27. package/dist/core/collector.d.ts +16 -0
  28. package/dist/core/collector.d.ts.map +1 -0
  29. package/dist/core/collector.js +88 -0
  30. package/dist/core/collector.js.map +1 -0
  31. package/dist/core/compliance.d.ts +17 -0
  32. package/dist/core/compliance.d.ts.map +1 -0
  33. package/dist/core/compliance.js +130 -0
  34. package/dist/core/compliance.js.map +1 -0
  35. package/dist/core/database-delivery.d.ts +14 -0
  36. package/dist/core/database-delivery.d.ts.map +1 -0
  37. package/dist/core/database-delivery.js +448 -0
  38. package/dist/core/database-delivery.js.map +1 -0
  39. package/dist/core/delta.d.ts +18 -0
  40. package/dist/core/delta.d.ts.map +1 -0
  41. package/dist/core/delta.js +110 -0
  42. package/dist/core/delta.js.map +1 -0
  43. package/dist/core/discord-api.d.ts +27 -0
  44. package/dist/core/discord-api.d.ts.map +1 -0
  45. package/dist/core/discord-api.js +88 -0
  46. package/dist/core/discord-api.js.map +1 -0
  47. package/dist/core/discord-delivery.d.ts +7 -0
  48. package/dist/core/discord-delivery.d.ts.map +1 -0
  49. package/dist/core/discord-delivery.js +103 -0
  50. package/dist/core/discord-delivery.js.map +1 -0
  51. package/dist/core/errors.d.ts +2 -0
  52. package/dist/core/errors.d.ts.map +1 -0
  53. package/dist/core/errors.js +2 -0
  54. package/dist/core/errors.js.map +1 -0
  55. package/dist/core/exporter.d.ts +25 -0
  56. package/dist/core/exporter.d.ts.map +1 -0
  57. package/dist/core/exporter.js +390 -0
  58. package/dist/core/exporter.js.map +1 -0
  59. package/dist/core/filter-engine.d.ts +9 -0
  60. package/dist/core/filter-engine.d.ts.map +1 -0
  61. package/dist/core/filter-engine.js +242 -0
  62. package/dist/core/filter-engine.js.map +1 -0
  63. package/dist/core/hash.d.ts +6 -0
  64. package/dist/core/hash.d.ts.map +1 -0
  65. package/dist/core/hash.js +21 -0
  66. package/dist/core/hash.js.map +1 -0
  67. package/dist/core/monitoring.d.ts +8 -0
  68. package/dist/core/monitoring.d.ts.map +1 -0
  69. package/dist/core/monitoring.js +19 -0
  70. package/dist/core/monitoring.js.map +1 -0
  71. package/dist/core/normalize.d.ts +18 -0
  72. package/dist/core/normalize.d.ts.map +1 -0
  73. package/dist/core/normalize.js +208 -0
  74. package/dist/core/normalize.js.map +1 -0
  75. package/dist/core/redaction.d.ts +6 -0
  76. package/dist/core/redaction.d.ts.map +1 -0
  77. package/dist/core/redaction.js +209 -0
  78. package/dist/core/redaction.js.map +1 -0
  79. package/dist/core/storage-delivery.d.ts +10 -0
  80. package/dist/core/storage-delivery.d.ts.map +1 -0
  81. package/dist/core/storage-delivery.js +209 -0
  82. package/dist/core/storage-delivery.js.map +1 -0
  83. package/dist/core/webhook-delivery.d.ts +14 -0
  84. package/dist/core/webhook-delivery.d.ts.map +1 -0
  85. package/dist/core/webhook-delivery.js +244 -0
  86. package/dist/core/webhook-delivery.js.map +1 -0
  87. package/dist/features/export/application/validate-request.d.ts +4 -0
  88. package/dist/features/export/application/validate-request.d.ts.map +1 -0
  89. package/dist/features/export/application/validate-request.js +53 -0
  90. package/dist/features/export/application/validate-request.js.map +1 -0
  91. package/dist/features/export/infrastructure/output-plan.d.ts +8 -0
  92. package/dist/features/export/infrastructure/output-plan.d.ts.map +1 -0
  93. package/dist/features/export/infrastructure/output-plan.js +21 -0
  94. package/dist/features/export/infrastructure/output-plan.js.map +1 -0
  95. package/dist/features/rendering/infrastructure/html/client-script.d.ts +2 -0
  96. package/dist/features/rendering/infrastructure/html/client-script.d.ts.map +1 -0
  97. package/dist/features/rendering/infrastructure/html/client-script.js +134 -0
  98. package/dist/features/rendering/infrastructure/html/client-script.js.map +1 -0
  99. package/dist/features/rendering/infrastructure/html/escape-html.d.ts +2 -0
  100. package/dist/features/rendering/infrastructure/html/escape-html.d.ts.map +1 -0
  101. package/dist/features/rendering/infrastructure/html/escape-html.js +9 -0
  102. package/dist/features/rendering/infrastructure/html/escape-html.js.map +1 -0
  103. package/dist/features/rendering/infrastructure/html/styles.d.ts +3 -0
  104. package/dist/features/rendering/infrastructure/html/styles.d.ts.map +1 -0
  105. package/dist/features/rendering/infrastructure/html/styles.js +424 -0
  106. package/dist/features/rendering/infrastructure/html/styles.js.map +1 -0
  107. package/dist/features/rendering/infrastructure/html/template-engine.d.ts +16 -0
  108. package/dist/features/rendering/infrastructure/html/template-engine.d.ts.map +1 -0
  109. package/dist/features/rendering/infrastructure/html/template-engine.js +138 -0
  110. package/dist/features/rendering/infrastructure/html/template-engine.js.map +1 -0
  111. package/dist/features/rendering/infrastructure/html/types.d.ts +60 -0
  112. package/dist/features/rendering/infrastructure/html/types.d.ts.map +1 -0
  113. package/dist/features/rendering/infrastructure/html/types.js +2 -0
  114. package/dist/features/rendering/infrastructure/html/types.js.map +1 -0
  115. package/dist/features/rendering/infrastructure/html/view-data.d.ts +5 -0
  116. package/dist/features/rendering/infrastructure/html/view-data.d.ts.map +1 -0
  117. package/dist/features/rendering/infrastructure/html/view-data.js +129 -0
  118. package/dist/features/rendering/infrastructure/html/view-data.js.map +1 -0
  119. package/dist/index.d.ts +11 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.js +10 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/integrations/ticket-close-advanced.d.ts +6 -0
  124. package/dist/integrations/ticket-close-advanced.d.ts.map +1 -0
  125. package/dist/integrations/ticket-close-advanced.js +79 -0
  126. package/dist/integrations/ticket-close-advanced.js.map +1 -0
  127. package/dist/integrations/ticket-close.d.ts +6 -0
  128. package/dist/integrations/ticket-close.d.ts.map +1 -0
  129. package/dist/integrations/ticket-close.js +42 -0
  130. package/dist/integrations/ticket-close.js.map +1 -0
  131. package/dist/interfaces/cli/build-request.d.ts +15 -0
  132. package/dist/interfaces/cli/build-request.d.ts.map +1 -0
  133. package/dist/interfaces/cli/build-request.js +340 -0
  134. package/dist/interfaces/cli/build-request.js.map +1 -0
  135. package/dist/interfaces/cli/loaders.d.ts +4 -0
  136. package/dist/interfaces/cli/loaders.d.ts.map +1 -0
  137. package/dist/interfaces/cli/loaders.js +33 -0
  138. package/dist/interfaces/cli/loaders.js.map +1 -0
  139. package/dist/interfaces/cli/providers.d.ts +3 -0
  140. package/dist/interfaces/cli/providers.d.ts.map +1 -0
  141. package/dist/interfaces/cli/providers.js +31 -0
  142. package/dist/interfaces/cli/providers.js.map +1 -0
  143. package/dist/interfaces/cli/schemas.d.ts +198 -0
  144. package/dist/interfaces/cli/schemas.d.ts.map +1 -0
  145. package/dist/interfaces/cli/schemas.js +211 -0
  146. package/dist/interfaces/cli/schemas.js.map +1 -0
  147. package/dist/modules/ai/index.d.ts +3 -0
  148. package/dist/modules/ai/index.d.ts.map +1 -0
  149. package/dist/modules/ai/index.js +2 -0
  150. package/dist/modules/ai/index.js.map +1 -0
  151. package/dist/modules/ai/providers.d.ts +57 -0
  152. package/dist/modules/ai/providers.d.ts.map +1 -0
  153. package/dist/modules/ai/providers.js +297 -0
  154. package/dist/modules/ai/providers.js.map +1 -0
  155. package/dist/modules/analytics/index.d.ts +2 -0
  156. package/dist/modules/analytics/index.d.ts.map +1 -0
  157. package/dist/modules/analytics/index.js +2 -0
  158. package/dist/modules/analytics/index.js.map +1 -0
  159. package/dist/modules/analytics/report.d.ts +3 -0
  160. package/dist/modules/analytics/report.d.ts.map +1 -0
  161. package/dist/modules/analytics/report.js +264 -0
  162. package/dist/modules/analytics/report.js.map +1 -0
  163. package/dist/modules/cli/build-request.d.ts +15 -0
  164. package/dist/modules/cli/build-request.d.ts.map +1 -0
  165. package/dist/modules/cli/build-request.js +340 -0
  166. package/dist/modules/cli/build-request.js.map +1 -0
  167. package/dist/modules/cli/index.d.ts +6 -0
  168. package/dist/modules/cli/index.d.ts.map +1 -0
  169. package/dist/modules/cli/index.js +5 -0
  170. package/dist/modules/cli/index.js.map +1 -0
  171. package/dist/modules/cli/loaders.d.ts +4 -0
  172. package/dist/modules/cli/loaders.d.ts.map +1 -0
  173. package/dist/modules/cli/loaders.js +33 -0
  174. package/dist/modules/cli/loaders.js.map +1 -0
  175. package/dist/modules/cli/providers.d.ts +3 -0
  176. package/dist/modules/cli/providers.d.ts.map +1 -0
  177. package/dist/modules/cli/providers.js +31 -0
  178. package/dist/modules/cli/providers.js.map +1 -0
  179. package/dist/modules/cli/schemas.d.ts +198 -0
  180. package/dist/modules/cli/schemas.d.ts.map +1 -0
  181. package/dist/modules/cli/schemas.js +211 -0
  182. package/dist/modules/cli/schemas.js.map +1 -0
  183. package/dist/modules/compliance/index.d.ts +17 -0
  184. package/dist/modules/compliance/index.d.ts.map +1 -0
  185. package/dist/modules/compliance/index.js +130 -0
  186. package/dist/modules/compliance/index.js.map +1 -0
  187. package/dist/modules/delivery/database-delivery.d.ts +14 -0
  188. package/dist/modules/delivery/database-delivery.d.ts.map +1 -0
  189. package/dist/modules/delivery/database-delivery.js +424 -0
  190. package/dist/modules/delivery/database-delivery.js.map +1 -0
  191. package/dist/modules/delivery/discord-delivery.d.ts +7 -0
  192. package/dist/modules/delivery/discord-delivery.d.ts.map +1 -0
  193. package/dist/modules/delivery/discord-delivery.js +103 -0
  194. package/dist/modules/delivery/discord-delivery.js.map +1 -0
  195. package/dist/modules/delivery/index.d.ts +5 -0
  196. package/dist/modules/delivery/index.d.ts.map +1 -0
  197. package/dist/modules/delivery/index.js +5 -0
  198. package/dist/modules/delivery/index.js.map +1 -0
  199. package/dist/modules/delivery/storage-delivery.d.ts +10 -0
  200. package/dist/modules/delivery/storage-delivery.d.ts.map +1 -0
  201. package/dist/modules/delivery/storage-delivery.js +195 -0
  202. package/dist/modules/delivery/storage-delivery.js.map +1 -0
  203. package/dist/modules/delivery/webhook-delivery.d.ts +14 -0
  204. package/dist/modules/delivery/webhook-delivery.d.ts.map +1 -0
  205. package/dist/modules/delivery/webhook-delivery.js +245 -0
  206. package/dist/modules/delivery/webhook-delivery.js.map +1 -0
  207. package/dist/modules/discord/collector.d.ts +18 -0
  208. package/dist/modules/discord/collector.d.ts.map +1 -0
  209. package/dist/modules/discord/collector.js +29 -0
  210. package/dist/modules/discord/collector.js.map +1 -0
  211. package/dist/modules/discord/discord-api.d.ts +89 -0
  212. package/dist/modules/discord/discord-api.d.ts.map +1 -0
  213. package/dist/modules/discord/discord-api.js +78 -0
  214. package/dist/modules/discord/discord-api.js.map +1 -0
  215. package/dist/modules/discord/index.d.ts +3 -0
  216. package/dist/modules/discord/index.d.ts.map +1 -0
  217. package/dist/modules/discord/index.js +3 -0
  218. package/dist/modules/discord/index.js.map +1 -0
  219. package/dist/modules/export/application/ai-summary.d.ts +7 -0
  220. package/dist/modules/export/application/ai-summary.d.ts.map +1 -0
  221. package/dist/modules/export/application/ai-summary.js +27 -0
  222. package/dist/modules/export/application/ai-summary.js.map +1 -0
  223. package/dist/modules/export/application/delivery-resolver.d.ts +20 -0
  224. package/dist/modules/export/application/delivery-resolver.d.ts.map +1 -0
  225. package/dist/modules/export/application/delivery-resolver.js +79 -0
  226. package/dist/modules/export/application/delivery-resolver.js.map +1 -0
  227. package/dist/modules/export/application/incremental-state.d.ts +5 -0
  228. package/dist/modules/export/application/incremental-state.d.ts.map +1 -0
  229. package/dist/modules/export/application/incremental-state.js +56 -0
  230. package/dist/modules/export/application/incremental-state.js.map +1 -0
  231. package/dist/modules/export/application/recorder-merge.d.ts +3 -0
  232. package/dist/modules/export/application/recorder-merge.d.ts.map +1 -0
  233. package/dist/modules/export/application/recorder-merge.js +69 -0
  234. package/dist/modules/export/application/recorder-merge.js.map +1 -0
  235. package/dist/modules/export/application/transcript-chunking.d.ts +8 -0
  236. package/dist/modules/export/application/transcript-chunking.d.ts.map +1 -0
  237. package/dist/modules/export/application/transcript-chunking.js +50 -0
  238. package/dist/modules/export/application/transcript-chunking.js.map +1 -0
  239. package/dist/modules/export/application/validate-request.d.ts +4 -0
  240. package/dist/modules/export/application/validate-request.d.ts.map +1 -0
  241. package/dist/modules/export/application/validate-request.js +53 -0
  242. package/dist/modules/export/application/validate-request.js.map +1 -0
  243. package/dist/modules/export/batch-export.d.ts +7 -0
  244. package/dist/modules/export/batch-export.d.ts.map +1 -0
  245. package/dist/modules/export/batch-export.js +129 -0
  246. package/dist/modules/export/batch-export.js.map +1 -0
  247. package/dist/modules/export/index.d.ts +6 -0
  248. package/dist/modules/export/index.d.ts.map +1 -0
  249. package/dist/modules/export/index.js +6 -0
  250. package/dist/modules/export/index.js.map +1 -0
  251. package/dist/modules/export/infrastructure/output-plan.d.ts +8 -0
  252. package/dist/modules/export/infrastructure/output-plan.d.ts.map +1 -0
  253. package/dist/modules/export/infrastructure/output-plan.js +21 -0
  254. package/dist/modules/export/infrastructure/output-plan.js.map +1 -0
  255. package/dist/modules/export/monitoring.d.ts +8 -0
  256. package/dist/modules/export/monitoring.d.ts.map +1 -0
  257. package/dist/modules/export/monitoring.js +20 -0
  258. package/dist/modules/export/monitoring.js.map +1 -0
  259. package/dist/modules/integrations/index.d.ts +3 -0
  260. package/dist/modules/integrations/index.d.ts.map +1 -0
  261. package/dist/modules/integrations/index.js +3 -0
  262. package/dist/modules/integrations/index.js.map +1 -0
  263. package/dist/modules/integrations/ticket-close-advanced.d.ts +6 -0
  264. package/dist/modules/integrations/ticket-close-advanced.d.ts.map +1 -0
  265. package/dist/modules/integrations/ticket-close-advanced.js +79 -0
  266. package/dist/modules/integrations/ticket-close-advanced.js.map +1 -0
  267. package/dist/modules/integrations/ticket-close.d.ts +6 -0
  268. package/dist/modules/integrations/ticket-close.d.ts.map +1 -0
  269. package/dist/modules/integrations/ticket-close.js +42 -0
  270. package/dist/modules/integrations/ticket-close.js.map +1 -0
  271. package/dist/modules/recorder/index.d.ts +2 -0
  272. package/dist/modules/recorder/index.d.ts.map +1 -0
  273. package/dist/modules/recorder/index.js +2 -0
  274. package/dist/modules/recorder/index.js.map +1 -0
  275. package/dist/modules/recorder/live-recorder.d.ts +3 -0
  276. package/dist/modules/recorder/live-recorder.d.ts.map +1 -0
  277. package/dist/modules/recorder/live-recorder.js +118 -0
  278. package/dist/modules/recorder/live-recorder.js.map +1 -0
  279. package/dist/modules/rendering/analytics.d.ts +3 -0
  280. package/dist/modules/rendering/analytics.d.ts.map +1 -0
  281. package/dist/modules/rendering/analytics.js +8 -0
  282. package/dist/modules/rendering/analytics.js.map +1 -0
  283. package/dist/modules/rendering/csv.d.ts +3 -0
  284. package/dist/modules/rendering/csv.d.ts.map +1 -0
  285. package/dist/modules/rendering/csv.js +39 -0
  286. package/dist/modules/rendering/csv.js.map +1 -0
  287. package/dist/modules/rendering/docx.d.ts +3 -0
  288. package/dist/modules/rendering/docx.d.ts.map +1 -0
  289. package/dist/modules/rendering/docx.js +65 -0
  290. package/dist/modules/rendering/docx.js.map +1 -0
  291. package/dist/modules/rendering/html.d.ts +4 -0
  292. package/dist/modules/rendering/html.d.ts.map +1 -0
  293. package/dist/modules/rendering/html.js +44 -0
  294. package/dist/modules/rendering/html.js.map +1 -0
  295. package/dist/modules/rendering/index.d.ts +13 -0
  296. package/dist/modules/rendering/index.d.ts.map +1 -0
  297. package/dist/modules/rendering/index.js +13 -0
  298. package/dist/modules/rendering/index.js.map +1 -0
  299. package/dist/modules/rendering/infrastructure/html/client-script.d.ts +2 -0
  300. package/dist/modules/rendering/infrastructure/html/client-script.d.ts.map +1 -0
  301. package/dist/modules/rendering/infrastructure/html/client-script.js +134 -0
  302. package/dist/modules/rendering/infrastructure/html/client-script.js.map +1 -0
  303. package/dist/modules/rendering/infrastructure/html/escape-html.d.ts +2 -0
  304. package/dist/modules/rendering/infrastructure/html/escape-html.d.ts.map +1 -0
  305. package/dist/modules/rendering/infrastructure/html/escape-html.js +9 -0
  306. package/dist/modules/rendering/infrastructure/html/escape-html.js.map +1 -0
  307. package/dist/modules/rendering/infrastructure/html/styles.d.ts +3 -0
  308. package/dist/modules/rendering/infrastructure/html/styles.d.ts.map +1 -0
  309. package/dist/modules/rendering/infrastructure/html/styles.js +424 -0
  310. package/dist/modules/rendering/infrastructure/html/styles.js.map +1 -0
  311. package/dist/modules/rendering/infrastructure/html/template-engine.d.ts +16 -0
  312. package/dist/modules/rendering/infrastructure/html/template-engine.d.ts.map +1 -0
  313. package/dist/modules/rendering/infrastructure/html/template-engine.js +138 -0
  314. package/dist/modules/rendering/infrastructure/html/template-engine.js.map +1 -0
  315. package/dist/modules/rendering/infrastructure/html/types.d.ts +60 -0
  316. package/dist/modules/rendering/infrastructure/html/types.d.ts.map +1 -0
  317. package/dist/modules/rendering/infrastructure/html/types.js +2 -0
  318. package/dist/modules/rendering/infrastructure/html/types.js.map +1 -0
  319. package/dist/modules/rendering/infrastructure/html/view-data.d.ts +5 -0
  320. package/dist/modules/rendering/infrastructure/html/view-data.d.ts.map +1 -0
  321. package/dist/modules/rendering/infrastructure/html/view-data.js +129 -0
  322. package/dist/modules/rendering/infrastructure/html/view-data.js.map +1 -0
  323. package/dist/modules/rendering/json.d.ts +4 -0
  324. package/dist/modules/rendering/json.d.ts.map +1 -0
  325. package/dist/modules/rendering/json.js +42 -0
  326. package/dist/modules/rendering/json.js.map +1 -0
  327. package/dist/modules/rendering/markdown.d.ts +3 -0
  328. package/dist/modules/rendering/markdown.d.ts.map +1 -0
  329. package/dist/modules/rendering/markdown.js +61 -0
  330. package/dist/modules/rendering/markdown.js.map +1 -0
  331. package/dist/modules/rendering/pdf.d.ts +3 -0
  332. package/dist/modules/rendering/pdf.d.ts.map +1 -0
  333. package/dist/modules/rendering/pdf.js +44 -0
  334. package/dist/modules/rendering/pdf.js.map +1 -0
  335. package/dist/modules/rendering/registry.d.ts +8 -0
  336. package/dist/modules/rendering/registry.d.ts.map +1 -0
  337. package/dist/modules/rendering/registry.js +13 -0
  338. package/dist/modules/rendering/registry.js.map +1 -0
  339. package/dist/modules/rendering/sqlite.d.ts +3 -0
  340. package/dist/modules/rendering/sqlite.d.ts.map +1 -0
  341. package/dist/modules/rendering/sqlite.js +130 -0
  342. package/dist/modules/rendering/sqlite.js.map +1 -0
  343. package/dist/modules/rendering/text.d.ts +3 -0
  344. package/dist/modules/rendering/text.d.ts.map +1 -0
  345. package/dist/modules/rendering/text.js +35 -0
  346. package/dist/modules/rendering/text.js.map +1 -0
  347. package/dist/modules/rendering/types.d.ts +3 -0
  348. package/dist/modules/rendering/types.d.ts.map +1 -0
  349. package/dist/modules/rendering/types.js +16 -0
  350. package/dist/modules/rendering/types.js.map +1 -0
  351. package/dist/modules/rendering/xml.d.ts +3 -0
  352. package/dist/modules/rendering/xml.d.ts.map +1 -0
  353. package/dist/modules/rendering/xml.js +50 -0
  354. package/dist/modules/rendering/xml.js.map +1 -0
  355. package/dist/modules/rendering/zip.d.ts +7 -0
  356. package/dist/modules/rendering/zip.d.ts.map +1 -0
  357. package/dist/modules/rendering/zip.js +70 -0
  358. package/dist/modules/rendering/zip.js.map +1 -0
  359. package/dist/modules/scheduler/engine.d.ts +13 -0
  360. package/dist/modules/scheduler/engine.d.ts.map +1 -0
  361. package/dist/modules/scheduler/engine.js +26 -0
  362. package/dist/modules/scheduler/engine.js.map +1 -0
  363. package/dist/modules/scheduler/index.d.ts +4 -0
  364. package/dist/modules/scheduler/index.d.ts.map +1 -0
  365. package/dist/modules/scheduler/index.js +4 -0
  366. package/dist/modules/scheduler/index.js.map +1 -0
  367. package/dist/modules/scheduler/runner.d.ts +24 -0
  368. package/dist/modules/scheduler/runner.d.ts.map +1 -0
  369. package/dist/modules/scheduler/runner.js +128 -0
  370. package/dist/modules/scheduler/runner.js.map +1 -0
  371. package/dist/modules/scheduler/store.d.ts +21 -0
  372. package/dist/modules/scheduler/store.d.ts.map +1 -0
  373. package/dist/modules/scheduler/store.js +72 -0
  374. package/dist/modules/scheduler/store.js.map +1 -0
  375. package/dist/modules/transcript/attachments.d.ts +13 -0
  376. package/dist/modules/transcript/attachments.d.ts.map +1 -0
  377. package/dist/modules/transcript/attachments.js +50 -0
  378. package/dist/modules/transcript/attachments.js.map +1 -0
  379. package/dist/modules/transcript/delta.d.ts +17 -0
  380. package/dist/modules/transcript/delta.d.ts.map +1 -0
  381. package/dist/modules/transcript/delta.js +45 -0
  382. package/dist/modules/transcript/delta.js.map +1 -0
  383. package/dist/modules/transcript/filter-engine.d.ts +10 -0
  384. package/dist/modules/transcript/filter-engine.d.ts.map +1 -0
  385. package/dist/modules/transcript/filter-engine.js +131 -0
  386. package/dist/modules/transcript/filter-engine.js.map +1 -0
  387. package/dist/modules/transcript/hash.d.ts +6 -0
  388. package/dist/modules/transcript/hash.d.ts.map +1 -0
  389. package/dist/modules/transcript/hash.js +21 -0
  390. package/dist/modules/transcript/hash.js.map +1 -0
  391. package/dist/modules/transcript/index.d.ts +7 -0
  392. package/dist/modules/transcript/index.d.ts.map +1 -0
  393. package/dist/modules/transcript/index.js +7 -0
  394. package/dist/modules/transcript/index.js.map +1 -0
  395. package/dist/modules/transcript/normalize.d.ts +20 -0
  396. package/dist/modules/transcript/normalize.d.ts.map +1 -0
  397. package/dist/modules/transcript/normalize.js +123 -0
  398. package/dist/modules/transcript/normalize.js.map +1 -0
  399. package/dist/modules/transcript/redaction.d.ts +9 -0
  400. package/dist/modules/transcript/redaction.d.ts.map +1 -0
  401. package/dist/modules/transcript/redaction.js +82 -0
  402. package/dist/modules/transcript/redaction.js.map +1 -0
  403. package/dist/plugins/registry.d.ts +8 -0
  404. package/dist/plugins/registry.d.ts.map +1 -0
  405. package/dist/plugins/registry.js +13 -0
  406. package/dist/plugins/registry.js.map +1 -0
  407. package/dist/recorder/live-recorder.d.ts +3 -0
  408. package/dist/recorder/live-recorder.d.ts.map +1 -0
  409. package/dist/recorder/live-recorder.js +118 -0
  410. package/dist/recorder/live-recorder.js.map +1 -0
  411. package/dist/renderers/analytics.d.ts +3 -0
  412. package/dist/renderers/analytics.d.ts.map +1 -0
  413. package/dist/renderers/analytics.js +8 -0
  414. package/dist/renderers/analytics.js.map +1 -0
  415. package/dist/renderers/csv.d.ts +3 -0
  416. package/dist/renderers/csv.d.ts.map +1 -0
  417. package/dist/renderers/csv.js +39 -0
  418. package/dist/renderers/csv.js.map +1 -0
  419. package/dist/renderers/docx.d.ts +3 -0
  420. package/dist/renderers/docx.d.ts.map +1 -0
  421. package/dist/renderers/docx.js +65 -0
  422. package/dist/renderers/docx.js.map +1 -0
  423. package/dist/renderers/html.d.ts +4 -0
  424. package/dist/renderers/html.d.ts.map +1 -0
  425. package/dist/renderers/html.js +44 -0
  426. package/dist/renderers/html.js.map +1 -0
  427. package/dist/renderers/index.d.ts +12 -0
  428. package/dist/renderers/index.d.ts.map +1 -0
  429. package/dist/renderers/index.js +12 -0
  430. package/dist/renderers/index.js.map +1 -0
  431. package/dist/renderers/json.d.ts +4 -0
  432. package/dist/renderers/json.d.ts.map +1 -0
  433. package/dist/renderers/json.js +42 -0
  434. package/dist/renderers/json.js.map +1 -0
  435. package/dist/renderers/markdown.d.ts +3 -0
  436. package/dist/renderers/markdown.d.ts.map +1 -0
  437. package/dist/renderers/markdown.js +61 -0
  438. package/dist/renderers/markdown.js.map +1 -0
  439. package/dist/renderers/pdf.d.ts +3 -0
  440. package/dist/renderers/pdf.d.ts.map +1 -0
  441. package/dist/renderers/pdf.js +44 -0
  442. package/dist/renderers/pdf.js.map +1 -0
  443. package/dist/renderers/sqlite.d.ts +3 -0
  444. package/dist/renderers/sqlite.d.ts.map +1 -0
  445. package/dist/renderers/sqlite.js +136 -0
  446. package/dist/renderers/sqlite.js.map +1 -0
  447. package/dist/renderers/text.d.ts +3 -0
  448. package/dist/renderers/text.d.ts.map +1 -0
  449. package/dist/renderers/text.js +35 -0
  450. package/dist/renderers/text.js.map +1 -0
  451. package/dist/renderers/types.d.ts +3 -0
  452. package/dist/renderers/types.d.ts.map +1 -0
  453. package/dist/renderers/types.js +16 -0
  454. package/dist/renderers/types.js.map +1 -0
  455. package/dist/renderers/xml.d.ts +3 -0
  456. package/dist/renderers/xml.d.ts.map +1 -0
  457. package/dist/renderers/xml.js +50 -0
  458. package/dist/renderers/xml.js.map +1 -0
  459. package/dist/renderers/zip.d.ts +7 -0
  460. package/dist/renderers/zip.d.ts.map +1 -0
  461. package/dist/renderers/zip.js +70 -0
  462. package/dist/renderers/zip.js.map +1 -0
  463. package/dist/scheduler/engine.d.ts +13 -0
  464. package/dist/scheduler/engine.d.ts.map +1 -0
  465. package/dist/scheduler/engine.js +31 -0
  466. package/dist/scheduler/engine.js.map +1 -0
  467. package/dist/scheduler/index.d.ts +4 -0
  468. package/dist/scheduler/index.d.ts.map +1 -0
  469. package/dist/scheduler/index.js +4 -0
  470. package/dist/scheduler/index.js.map +1 -0
  471. package/dist/scheduler/runner.d.ts +24 -0
  472. package/dist/scheduler/runner.d.ts.map +1 -0
  473. package/dist/scheduler/runner.js +128 -0
  474. package/dist/scheduler/runner.js.map +1 -0
  475. package/dist/scheduler/store.d.ts +21 -0
  476. package/dist/scheduler/store.d.ts.map +1 -0
  477. package/dist/scheduler/store.js +72 -0
  478. package/dist/scheduler/store.js.map +1 -0
  479. package/dist/shared/async/concurrency.d.ts +4 -0
  480. package/dist/shared/async/concurrency.d.ts.map +1 -0
  481. package/dist/shared/async/concurrency.js +10 -0
  482. package/dist/shared/async/concurrency.js.map +1 -0
  483. package/dist/shared/constants.d.ts +7 -0
  484. package/dist/shared/constants.d.ts.map +1 -0
  485. package/dist/shared/constants.js +7 -0
  486. package/dist/shared/constants.js.map +1 -0
  487. package/dist/shared/errors/index.d.ts +16 -0
  488. package/dist/shared/errors/index.d.ts.map +1 -0
  489. package/dist/shared/errors/index.js +27 -0
  490. package/dist/shared/errors/index.js.map +1 -0
  491. package/dist/shared/json/safe-json.d.ts +5 -0
  492. package/dist/shared/json/safe-json.d.ts.map +1 -0
  493. package/dist/shared/json/safe-json.js +16 -0
  494. package/dist/shared/json/safe-json.js.map +1 -0
  495. package/dist/shared/optional-require.d.ts +6 -0
  496. package/dist/shared/optional-require.d.ts.map +1 -0
  497. package/dist/shared/optional-require.js +17 -0
  498. package/dist/shared/optional-require.js.map +1 -0
  499. package/dist/shared/utils/snowflake.d.ts +5 -0
  500. package/dist/shared/utils/snowflake.d.ts.map +1 -0
  501. package/dist/shared/utils/snowflake.js +35 -0
  502. package/dist/shared/utils/snowflake.js.map +1 -0
  503. package/dist/types/ai.d.ts +19 -0
  504. package/dist/types/ai.d.ts.map +1 -0
  505. package/dist/types/ai.js +2 -0
  506. package/dist/types/ai.js.map +1 -0
  507. package/dist/types/analytics.d.ts +69 -0
  508. package/dist/types/analytics.d.ts.map +1 -0
  509. package/dist/types/analytics.js +2 -0
  510. package/dist/types/analytics.js.map +1 -0
  511. package/dist/types/compliance.d.ts +41 -0
  512. package/dist/types/compliance.d.ts.map +1 -0
  513. package/dist/types/compliance.js +2 -0
  514. package/dist/types/compliance.js.map +1 -0
  515. package/dist/types/delta.d.ts +13 -0
  516. package/dist/types/delta.d.ts.map +1 -0
  517. package/dist/types/delta.js +2 -0
  518. package/dist/types/delta.js.map +1 -0
  519. package/dist/types/filters.d.ts +79 -0
  520. package/dist/types/filters.d.ts.map +1 -0
  521. package/dist/types/filters.js +2 -0
  522. package/dist/types/filters.js.map +1 -0
  523. package/dist/types/formats.d.ts +2 -0
  524. package/dist/types/formats.d.ts.map +1 -0
  525. package/dist/types/formats.js +2 -0
  526. package/dist/types/formats.js.map +1 -0
  527. package/dist/types/index.d.ts +17 -0
  528. package/dist/types/index.d.ts.map +1 -0
  529. package/dist/types/index.js +2 -0
  530. package/dist/types/index.js.map +1 -0
  531. package/dist/types/integrations.d.ts +19 -0
  532. package/dist/types/integrations.d.ts.map +1 -0
  533. package/dist/types/integrations.js +2 -0
  534. package/dist/types/integrations.js.map +1 -0
  535. package/dist/types/monitoring.d.ts +34 -0
  536. package/dist/types/monitoring.d.ts.map +1 -0
  537. package/dist/types/monitoring.js +2 -0
  538. package/dist/types/monitoring.js.map +1 -0
  539. package/dist/types/output.d.ts +146 -0
  540. package/dist/types/output.d.ts.map +1 -0
  541. package/dist/types/output.js +2 -0
  542. package/dist/types/output.js.map +1 -0
  543. package/dist/types/recorder.d.ts +14 -0
  544. package/dist/types/recorder.d.ts.map +1 -0
  545. package/dist/types/recorder.js +2 -0
  546. package/dist/types/recorder.js.map +1 -0
  547. package/dist/types/redaction.d.ts +23 -0
  548. package/dist/types/redaction.d.ts.map +1 -0
  549. package/dist/types/redaction.js +2 -0
  550. package/dist/types/redaction.js.map +1 -0
  551. package/dist/types/render.d.ts +25 -0
  552. package/dist/types/render.d.ts.map +1 -0
  553. package/dist/types/render.js +2 -0
  554. package/dist/types/render.js.map +1 -0
  555. package/dist/types/request.d.ts +41 -0
  556. package/dist/types/request.d.ts.map +1 -0
  557. package/dist/types/request.js +2 -0
  558. package/dist/types/request.js.map +1 -0
  559. package/dist/types/result.d.ts +90 -0
  560. package/dist/types/result.d.ts.map +1 -0
  561. package/dist/types/result.js +2 -0
  562. package/dist/types/result.js.map +1 -0
  563. package/dist/types/stats.d.ts +15 -0
  564. package/dist/types/stats.d.ts.map +1 -0
  565. package/dist/types/stats.js +2 -0
  566. package/dist/types/stats.js.map +1 -0
  567. package/dist/types/transcript.d.ts +123 -0
  568. package/dist/types/transcript.d.ts.map +1 -0
  569. package/dist/types/transcript.js +2 -0
  570. package/dist/types/transcript.js.map +1 -0
  571. package/dist/types.d.ts +3 -0
  572. package/dist/types.d.ts.map +1 -0
  573. package/dist/types.js +2 -0
  574. package/dist/types.js.map +1 -0
  575. package/package.json +94 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rayan Mustafa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,370 @@
1
+ # @rayanmustafa/discord-chat-exporter
2
+
3
+ High-fidelity Discord transcript exporter for bot-based workflows.
4
+
5
+ ## Full Documentation
6
+
7
+ Complete docs are available in `docs/README.md` and the full `docs/` index.
8
+
9
+ ## What is implemented now
10
+
11
+ - Bot-token-only export flow (Discord API compliant)
12
+ - Channel + thread history export with pagination and retry handling
13
+ - Canonical transcript model preserving raw Discord message payloads
14
+ - Advanced filters (`AND`/`OR`, nested groups, content/state/type/time/user filters)
15
+ - Attachment modes: `external-link`, `local-download`, `both`, `base64-inline`
16
+ - Output formats:
17
+ - `json-full`, `json-clean`
18
+ - `txt`, `md`, `csv`
19
+ - `html-single`, `html-bundle`
20
+ - `pdf` (optional dependency: `playwright`)
21
+ - `xml`
22
+ - `sqlite` (optional dependency: `better-sqlite3`)
23
+ - `docx` (optional dependency: `docx`)
24
+ - `zip` with optional AES-256 encryption (`archiver-zip-encrypted`)
25
+ - `analytics-json`
26
+ - Future-phase features now implemented:
27
+ - Incremental export state/checkpoints
28
+ - Split/chunk export policy by messages/bytes
29
+ - Watermark + read-only + TOC + accessibility HTML modes
30
+ - Custom HTML templates via `render.html.templatePath` / `--html-template`
31
+ - Analytics report module (counts, mentions, words, heatmap, response metrics, highlights)
32
+ - AI summary plugin system with built-in `heuristic` provider
33
+ - Google Gemini provider (`GoogleGeminiProvider`)
34
+ - Anthropic Claude provider (`AnthropicClaudeProvider`)
35
+ - OpenAI provider (`OpenAIProvider`)
36
+ - OpenAI-compatible provider adapter (`OpenAICompatibleProvider`)
37
+ - Live recorder for `create/update/delete/reaction` events (NDJSON)
38
+ - Ticket close helper for `discord.js` integrations
39
+ - Advanced ticket close helper (`createAdvancedTicketCloseHandler`) with post-actions
40
+ - Output delivery targets:
41
+ - `filesystem` (default)
42
+ - `discord-channel` (upload artifacts directly to a Discord channel)
43
+ - `both` (save locally and upload to Discord)
44
+ - Database sink (`output.database`) with built-in drivers:
45
+ - `sqlite`, `postgres`, `mysql`, `mongodb`, `mongoose`
46
+ - custom drivers via `exporter.registerDatabaseAdapter(...)`
47
+ - Batch export API (`exportBatch`) with per-channel isolation and master index
48
+ - Cloud storage sinks (`output.storage`): `s3` (S3/R2/MinIO), `gcs`, `azure-blob`
49
+ - Webhook delivery (`output.webhooks`): generic HTTP, Discord webhook, Slack webhook
50
+ - Redaction engine (`redaction`) for PII/token profiles + custom regex
51
+ - Delta export mode (`delta`) with checkpoint and recorder merge best-effort
52
+ - Compliance artifacts (`compliance`): manifest + optional Ed25519 signature
53
+ - Monitoring hooks (`monitoring.onEvent`) + CLI progress JSONL
54
+ - Scheduler commands: `schedule add/list/run/daemon`
55
+
56
+ ## Install
57
+
58
+ ```bash
59
+ npm i @rayanmustafa/discord-chat-exporter
60
+ ```
61
+
62
+ Optional format dependencies:
63
+
64
+ ```bash
65
+ npm i playwright better-sqlite3 docx archiver-zip-encrypted pg mysql2 mongodb mongoose \
66
+ @aws-sdk/client-s3 @google-cloud/storage @azure/storage-blob @slack/webhook \
67
+ node-cron json-canonicalize libphonenumber-js flexsearch
68
+ ```
69
+
70
+ ## API Example
71
+
72
+ ```ts
73
+ import {
74
+ createExporter,
75
+ GoogleGeminiProvider,
76
+ AnthropicClaudeProvider,
77
+ OpenAIProvider,
78
+ } from "@rayanmustafa/discord-chat-exporter";
79
+
80
+ const exporter = createExporter();
81
+
82
+ exporter.registerAIProvider(new OpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! }));
83
+ exporter.registerAIProvider(new GoogleGeminiProvider({ apiKey: process.env.GEMINI_API_KEY! }));
84
+ exporter.registerAIProvider(new AnthropicClaudeProvider({ apiKey: process.env.ANTHROPIC_API_KEY! }));
85
+
86
+ const result = await exporter.exportChannel({
87
+ token: process.env.DISCORD_BOT_TOKEN!,
88
+ channelId: "123456789012345678",
89
+ formats: ["html-single", "json-full", "analytics-json", "zip"],
90
+ attachments: {
91
+ mode: "both",
92
+ downloadConcurrency: 4,
93
+ },
94
+ render: {
95
+ watermark: "Internal Use",
96
+ readOnly: true,
97
+ includeTableOfContents: true,
98
+ splitPolicy: {
99
+ maxMessagesPerChunk: 50000,
100
+ },
101
+ },
102
+ output: {
103
+ dir: "./exports",
104
+ target: "both",
105
+ discord: {
106
+ channelId: "987654321098765432",
107
+ content: "Ticket transcript exported",
108
+ },
109
+ database: {
110
+ enabled: true,
111
+ driver: "postgres",
112
+ connectionString: "postgres://user:pass@localhost:5432/transcripts",
113
+ table: "exports_log",
114
+ },
115
+ storage: {
116
+ enabled: true,
117
+ providers: [
118
+ {
119
+ kind: "s3",
120
+ bucket: "my-transcripts",
121
+ region: "eu-central-1",
122
+ keyPrefix: "discord",
123
+ },
124
+ ],
125
+ },
126
+ webhooks: {
127
+ enabled: true,
128
+ targets: [
129
+ { kind: "generic", url: "https://example.com/webhooks/transcript" },
130
+ ],
131
+ },
132
+ basename: "ticket-1234",
133
+ incremental: {
134
+ enabled: true,
135
+ },
136
+ },
137
+ analytics: {
138
+ enabled: true,
139
+ includeHeatmap: true,
140
+ ai: {
141
+ enabled: true,
142
+ providerId: "gemini",
143
+ },
144
+ },
145
+ redaction: {
146
+ enabled: true,
147
+ profiles: ["email", "phone", "token"],
148
+ },
149
+ delta: {
150
+ enabled: true,
151
+ checkpointFile: "./exports/.dcexport/delta-123.json",
152
+ },
153
+ compliance: {
154
+ manifest: { enabled: true },
155
+ signature: {
156
+ enabled: true,
157
+ privateKeyPath: "./keys/ed25519-private.pem",
158
+ keyId: "key-2026-01",
159
+ },
160
+ },
161
+ monitoring: {
162
+ onEvent(event) {
163
+ console.log(event.kind, event);
164
+ },
165
+ },
166
+ });
167
+
168
+ console.log(result.stats, result.analyticsReport, result.aiResult);
169
+ ```
170
+
171
+ Batch export example:
172
+
173
+ ```ts
174
+ const batchResult = await exporter.exportBatch({
175
+ token: process.env.DISCORD_BOT_TOKEN!,
176
+ channelIds: ["111", "222", "333"],
177
+ formats: ["html-bundle", "json-full"],
178
+ output: { dir: "./exports" },
179
+ batch: {
180
+ concurrency: 3,
181
+ includeMasterIndex: true,
182
+ },
183
+ });
184
+
185
+ console.log(batchResult.stats, batchResult.masterIndex?.path);
186
+ ```
187
+
188
+ Custom database adapter example:
189
+
190
+ ```ts
191
+ exporter.registerDatabaseAdapter({
192
+ id: "firestore",
193
+ async persist(ctx) {
194
+ // write ctx.transcript / ctx.stats / ctx.request to your database
195
+ return {
196
+ driver: "firestore",
197
+ exportId: "doc_123",
198
+ location: "firestore.exports/doc_123",
199
+ };
200
+ },
201
+ });
202
+ ```
203
+
204
+ ## Popular AI Providers
205
+
206
+ - `openai`: register `OpenAIProvider` with `OPENAI_API_KEY`
207
+ - `gemini`: register `GoogleGeminiProvider` with `GEMINI_API_KEY` (or `GOOGLE_API_KEY`)
208
+ - `anthropic`: register `AnthropicClaudeProvider` with `ANTHROPIC_API_KEY`
209
+ - `openai-compatible`: use `OpenAICompatibleProvider` for providers with OpenAI-style APIs (for example Groq, Mistral, Together, xAI)
210
+
211
+ ## CLI Examples
212
+
213
+ ```bash
214
+ # Provider keys (CLI auto-registers when present)
215
+ export OPENAI_API_KEY="..."
216
+ export GEMINI_API_KEY="..."
217
+ export ANTHROPIC_API_KEY="..."
218
+
219
+ # Rich export with future features
220
+ npx dcexport export \
221
+ --token "$DISCORD_BOT_TOKEN" \
222
+ --channel 123456789012345678 \
223
+ --formats html-single,json-full,analytics-json,pdf,zip \
224
+ --attachments-mode both \
225
+ --watermark "Internal Use" \
226
+ --read-only \
227
+ --toc \
228
+ --split-max-messages 50000 \
229
+ --incremental \
230
+ --analytics \
231
+ --analytics-heatmap \
232
+ --ai \
233
+ --ai-provider gemini \
234
+ --output-target both \
235
+ --discord-output-channel 987654321098765432 \
236
+ --db-sqlite ./exports/transcripts.sqlite \
237
+ --out ./exports
238
+
239
+ # Custom HTML template
240
+ npx dcexport export \
241
+ --token "$DISCORD_BOT_TOKEN" \
242
+ --channel 123456789012345678 \
243
+ --formats html-single \
244
+ --html-template ./templates/discord-like.html \
245
+ --out ./exports
246
+
247
+ # PostgreSQL database sink
248
+ npx dcexport export \
249
+ --token "$DISCORD_BOT_TOKEN" \
250
+ --channel 123456789012345678 \
251
+ --formats html-single,json-full \
252
+ --db-driver postgres \
253
+ --db-connection "postgres://user:pass@localhost:5432/transcripts" \
254
+ --db-tls \
255
+ --db-table exports_log \
256
+ --out ./exports
257
+
258
+ # MongoDB / Mongoose sink
259
+ npx dcexport export \
260
+ --token "$DISCORD_BOT_TOKEN" \
261
+ --channel 123456789012345678 \
262
+ --formats json-full \
263
+ --db-driver mongodb \
264
+ --db-connection "mongodb://localhost:27017/transcripts" \
265
+ --db-collection exports_log \
266
+ --out ./exports
267
+
268
+ # Direct delivery to Discord channel with temporary local storage
269
+ npx dcexport export \
270
+ --token "$DISCORD_BOT_TOKEN" \
271
+ --channel 123456789012345678 \
272
+ --formats html-single,json-full \
273
+ --output-target discord-channel \
274
+ --discord-output-channel 987654321098765432 \
275
+ --discord-output-content "Transcript ready"
276
+
277
+ # Batch export with master index + merged transcript
278
+ npx dcexport export-batch \
279
+ --token "$DISCORD_BOT_TOKEN" \
280
+ --channels 111111111111111111,222222222222222222,333333333333333333 \
281
+ --formats html-bundle,json-full \
282
+ --out ./exports \
283
+ --batch-concurrency 3 \
284
+ --batch-merged
285
+
286
+ # Cloud storage + webhook + redaction + delta + compliance signature
287
+ npx dcexport export \
288
+ --token "$DISCORD_BOT_TOKEN" \
289
+ --channel 123456789012345678 \
290
+ --formats html-single,json-full,zip \
291
+ --storage-enable \
292
+ --storage-provider s3 \
293
+ --storage-bucket my-transcripts \
294
+ --storage-region eu-central-1 \
295
+ --storage-prefix discord \
296
+ --webhook-generic https://example.com/hook \
297
+ --redaction \
298
+ --redaction-profiles email,phone,token \
299
+ --delta \
300
+ --delta-checkpoint ./.dcexport/delta-123.json \
301
+ --manifest \
302
+ --sign-ed25519-key ./keys/ed25519-private.pem \
303
+ --sign-key-id key-2026-01 \
304
+ --progress-jsonl ./exports/progress.jsonl \
305
+ --out ./exports
306
+
307
+ # Doctor checks
308
+ npx dcexport doctor --token "$DISCORD_BOT_TOKEN" --channel 123456789012345678
309
+
310
+ # Start detached recorder
311
+ npx dcexport record start --token "$DISCORD_BOT_TOKEN" --out ./.dcexport/events.ndjson
312
+
313
+ # Stop recorder
314
+ npx dcexport record stop
315
+
316
+ # Scheduler
317
+ npx dcexport schedule add --job-file ./jobs.json --state ./.dcexport/scheduler-state.json
318
+ npx dcexport schedule list --state ./.dcexport/scheduler-state.json
319
+ npx dcexport schedule run --job-id daily-ticket-exports --state ./.dcexport/scheduler-state.json
320
+ npx dcexport schedule daemon --jobs ./jobs.json --state ./.dcexport/scheduler-state.json
321
+ ```
322
+
323
+ ## Important limits
324
+
325
+ - Historic edit/delete timelines cannot be reconstructed completely from Discord REST history.
326
+ - Message content access depends on `Message Content Intent` policies.
327
+ - Signed attachment URLs may expire; exporter retries best-effort.
328
+ - Some interaction/modal payload history is only available via live recording.
329
+
330
+ ## Internal architecture
331
+
332
+ - Feature-oriented modules under `src/features/*` with layered internals:
333
+ - `domain`: core contracts and invariants
334
+ - `application`: use-cases and orchestration
335
+ - `infrastructure`: adapters/IO integrations
336
+ - CLI surface in `src/modules/cli/*` (typed Commander parsing + Zod validation).
337
+ - Shared primitives in `src/shared/*`:
338
+ - `shared/utils/snowflake.ts`
339
+ - `shared/async/concurrency.ts` (via `p-limit`)
340
+ - `shared/json/safe-json.ts`
341
+ - `shared/errors/*`
342
+ - Public compatibility preserved through `src/index.ts` and `src/types.ts`.
343
+
344
+ ## Development
345
+
346
+ ```bash
347
+ npm run lint
348
+ npm run typecheck
349
+ npm run test
350
+ npm run test:coverage
351
+ npm run build
352
+ ```
353
+
354
+ ## Publishing to npm
355
+
356
+ 1. **Create an npm account** at [npmjs.com](https://www.npmjs.com/signup) if you don’t have one.
357
+
358
+ 2. **Log in** from the project root:
359
+ ```bash
360
+ npm login
361
+ ```
362
+ Enter your username, password, and email (and OTP if you use 2FA).
363
+
364
+ 3. **Build and publish** (scoped packages like `@rayanmustafa/...` are private by default; use `--access public` to publish for free):
365
+ ```bash
366
+ npm publish --access public
367
+ ```
368
+ Before publishing, `prepublishOnly` runs `typecheck`, `test`, and `build`. Only `dist/`, `README.md`, and `LICENSE` are included (see `files` in `package.json`).
369
+
370
+ 4. **Later versions:** bump `version` in `package.json`, then run `npm publish --access public` again.
@@ -0,0 +1,57 @@
1
+ import type { AIProvider, AIProviderContext, AIResult } from "../types.js";
2
+ export declare class HeuristicAIProvider implements AIProvider {
3
+ readonly id = "heuristic";
4
+ summarize(ctx: AIProviderContext): Promise<AIResult>;
5
+ }
6
+ export interface OpenAICompatibleProviderConfig {
7
+ id?: string;
8
+ apiKey: string;
9
+ baseUrl?: string;
10
+ model?: string;
11
+ }
12
+ export declare class OpenAICompatibleProvider implements AIProvider {
13
+ readonly id: string;
14
+ private readonly apiKey;
15
+ private readonly baseUrl;
16
+ private readonly model;
17
+ constructor(config: OpenAICompatibleProviderConfig);
18
+ summarize(ctx: AIProviderContext): Promise<AIResult>;
19
+ }
20
+ export interface OpenAIProviderConfig {
21
+ apiKey: string;
22
+ model?: string;
23
+ }
24
+ export declare class OpenAIProvider extends OpenAICompatibleProvider {
25
+ constructor(config: OpenAIProviderConfig);
26
+ }
27
+ export interface GoogleGeminiProviderConfig {
28
+ apiKey: string;
29
+ model?: string;
30
+ baseUrl?: string;
31
+ id?: string;
32
+ }
33
+ export declare class GoogleGeminiProvider implements AIProvider {
34
+ readonly id: string;
35
+ private readonly apiKey;
36
+ private readonly model;
37
+ private readonly baseUrl;
38
+ constructor(config: GoogleGeminiProviderConfig);
39
+ summarize(ctx: AIProviderContext): Promise<AIResult>;
40
+ }
41
+ export interface AnthropicClaudeProviderConfig {
42
+ apiKey: string;
43
+ model?: string;
44
+ baseUrl?: string;
45
+ id?: string;
46
+ anthropicVersion?: string;
47
+ }
48
+ export declare class AnthropicClaudeProvider implements AIProvider {
49
+ readonly id: string;
50
+ private readonly apiKey;
51
+ private readonly model;
52
+ private readonly baseUrl;
53
+ private readonly anthropicVersion;
54
+ constructor(config: AnthropicClaudeProviderConfig);
55
+ summarize(ctx: AIProviderContext): Promise<AIResult>;
56
+ }
57
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/ai/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK3E,qBAAa,mBAAoB,YAAW,UAAU;IACpD,SAAgB,EAAE,eAAe;IAEpB,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;CA+BlE;AAED,MAAM,WAAW,8BAA8B;IAC7C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,wBAAyB,YAAW,UAAU;IACzD,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAEZ,MAAM,EAAE,8BAA8B;IAO5C,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAuElE;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,cAAe,SAAQ,wBAAwB;gBACvC,MAAM,EAAE,oBAAoB;CAQhD;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,oBAAqB,YAAW,UAAU;IACrD,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAEd,MAAM,EAAE,0BAA0B;IAOxC,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAmDlE;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,uBAAwB,YAAW,UAAU;IACxD,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;gBAEvB,MAAM,EAAE,6BAA6B;IAQ3C,SAAS,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAwDlE"}