@happyvertical/smrt-content 0.30.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.
Files changed (291) hide show
  1. package/AGENTS.md +194 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +634 -0
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/asset-associable.d.ts +115 -0
  8. package/dist/asset-associable.d.ts.map +1 -0
  9. package/dist/body-format.d.ts +29 -0
  10. package/dist/body-format.d.ts.map +1 -0
  11. package/dist/body-format.js +604 -0
  12. package/dist/body-format.js.map +1 -0
  13. package/dist/content-asset.d.ts +17 -0
  14. package/dist/content-asset.d.ts.map +1 -0
  15. package/dist/content-assets.d.ts +10 -0
  16. package/dist/content-assets.d.ts.map +1 -0
  17. package/dist/content-chat-handlers.d.ts +115 -0
  18. package/dist/content-chat-handlers.d.ts.map +1 -0
  19. package/dist/content-chat-prompts.d.ts +3 -0
  20. package/dist/content-chat-prompts.d.ts.map +1 -0
  21. package/dist/content-chat-session.d.ts +26 -0
  22. package/dist/content-chat-session.d.ts.map +1 -0
  23. package/dist/content-contribution-attachment.d.ts +42 -0
  24. package/dist/content-contribution-attachment.d.ts.map +1 -0
  25. package/dist/content-contribution-attachments.d.ts +8 -0
  26. package/dist/content-contribution-attachments.d.ts.map +1 -0
  27. package/dist/content-contribution-config.d.ts +84 -0
  28. package/dist/content-contribution-config.d.ts.map +1 -0
  29. package/dist/content-contribution-revision.d.ts +38 -0
  30. package/dist/content-contribution-revision.d.ts.map +1 -0
  31. package/dist/content-contribution-revisions.d.ts +8 -0
  32. package/dist/content-contribution-revisions.d.ts.map +1 -0
  33. package/dist/content-contribution-type.d.ts +51 -0
  34. package/dist/content-contribution-type.d.ts.map +1 -0
  35. package/dist/content-contribution-types.d.ts +7 -0
  36. package/dist/content-contribution-types.d.ts.map +1 -0
  37. package/dist/content-contribution.d.ts +161 -0
  38. package/dist/content-contribution.d.ts.map +1 -0
  39. package/dist/content-contributions.d.ts +53 -0
  40. package/dist/content-contributions.d.ts.map +1 -0
  41. package/dist/content-contributor.d.ts +30 -0
  42. package/dist/content-contributor.d.ts.map +1 -0
  43. package/dist/content-contributors.d.ts +13 -0
  44. package/dist/content-contributors.d.ts.map +1 -0
  45. package/dist/content-correction.d.ts +39 -0
  46. package/dist/content-correction.d.ts.map +1 -0
  47. package/dist/content-corrections.d.ts +9 -0
  48. package/dist/content-corrections.d.ts.map +1 -0
  49. package/dist/content-editor-assistant.d.ts +68 -0
  50. package/dist/content-editor-assistant.d.ts.map +1 -0
  51. package/dist/content-editor-assistant.js +97 -0
  52. package/dist/content-editor-assistant.js.map +1 -0
  53. package/dist/content-feed-parser.d.ts +19 -0
  54. package/dist/content-feed-parser.d.ts.map +1 -0
  55. package/dist/content-feed-source.d.ts +52 -0
  56. package/dist/content-feed-source.d.ts.map +1 -0
  57. package/dist/content-feed-sources.d.ts +11 -0
  58. package/dist/content-feed-sources.d.ts.map +1 -0
  59. package/dist/content-feed-sync.d.ts +23 -0
  60. package/dist/content-feed-sync.d.ts.map +1 -0
  61. package/dist/content-governance-assignment.d.ts +42 -0
  62. package/dist/content-governance-assignment.d.ts.map +1 -0
  63. package/dist/content-governance-assignments.d.ts +11 -0
  64. package/dist/content-governance-assignments.d.ts.map +1 -0
  65. package/dist/content-governance-policies.d.ts +7 -0
  66. package/dist/content-governance-policies.d.ts.map +1 -0
  67. package/dist/content-governance-policy.d.ts +29 -0
  68. package/dist/content-governance-policy.d.ts.map +1 -0
  69. package/dist/content-governance-profile.d.ts +31 -0
  70. package/dist/content-governance-profile.d.ts.map +1 -0
  71. package/dist/content-governance-profiles.d.ts +7 -0
  72. package/dist/content-governance-profiles.d.ts.map +1 -0
  73. package/dist/content-governance.d.ts +188 -0
  74. package/dist/content-governance.d.ts.map +1 -0
  75. package/dist/content-prompts.d.ts +10 -0
  76. package/dist/content-prompts.d.ts.map +1 -0
  77. package/dist/content-reference.d.ts +17 -0
  78. package/dist/content-reference.d.ts.map +1 -0
  79. package/dist/content-references.d.ts +55 -0
  80. package/dist/content-references.d.ts.map +1 -0
  81. package/dist/content-review.d.ts +34 -0
  82. package/dist/content-review.d.ts.map +1 -0
  83. package/dist/content-reviews.d.ts +21 -0
  84. package/dist/content-reviews.d.ts.map +1 -0
  85. package/dist/content-transparency.d.ts +72 -0
  86. package/dist/content-transparency.d.ts.map +1 -0
  87. package/dist/content-types.d.ts +51 -0
  88. package/dist/content-types.d.ts.map +1 -0
  89. package/dist/content-version.d.ts +38 -0
  90. package/dist/content-version.d.ts.map +1 -0
  91. package/dist/content-versions.d.ts +16 -0
  92. package/dist/content-versions.d.ts.map +1 -0
  93. package/dist/content.d.ts +736 -0
  94. package/dist/content.d.ts.map +1 -0
  95. package/dist/contents.d.ts +292 -0
  96. package/dist/contents.d.ts.map +1 -0
  97. package/dist/database-utils.d.ts +3 -0
  98. package/dist/database-utils.d.ts.map +1 -0
  99. package/dist/index.d.ts +78 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +11602 -0
  102. package/dist/index.js.map +1 -0
  103. package/dist/manifest.json +12308 -0
  104. package/dist/mock-smrt-client.d.ts +493 -0
  105. package/dist/mock-smrt-client.d.ts.map +1 -0
  106. package/dist/mock-smrt-client.js +390 -0
  107. package/dist/mock-smrt-client.js.map +1 -0
  108. package/dist/playground.d.ts +2 -0
  109. package/dist/playground.d.ts.map +1 -0
  110. package/dist/playground.js +454 -0
  111. package/dist/playground.js.map +1 -0
  112. package/dist/publish-readiness.d.ts +30 -0
  113. package/dist/publish-readiness.d.ts.map +1 -0
  114. package/dist/publish-readiness.js +74 -0
  115. package/dist/publish-readiness.js.map +1 -0
  116. package/dist/safe-remote-url.d.ts +52 -0
  117. package/dist/safe-remote-url.d.ts.map +1 -0
  118. package/dist/serialization.d.ts +78 -0
  119. package/dist/serialization.d.ts.map +1 -0
  120. package/dist/smrt-knowledge.json +6130 -0
  121. package/dist/svelte/api.d.ts +3 -0
  122. package/dist/svelte/api.d.ts.map +1 -0
  123. package/dist/svelte/api.js +10 -0
  124. package/dist/svelte/components/ArticleCard.svelte +159 -0
  125. package/dist/svelte/components/ArticleCard.svelte.d.ts +17 -0
  126. package/dist/svelte/components/ArticleCard.svelte.d.ts.map +1 -0
  127. package/dist/svelte/components/ArticleList.svelte +75 -0
  128. package/dist/svelte/components/ArticleList.svelte.d.ts +21 -0
  129. package/dist/svelte/components/ArticleList.svelte.d.ts.map +1 -0
  130. package/dist/svelte/components/ContentAgentChat.svelte +652 -0
  131. package/dist/svelte/components/ContentAgentChat.svelte.d.ts +17 -0
  132. package/dist/svelte/components/ContentAgentChat.svelte.d.ts.map +1 -0
  133. package/dist/svelte/components/ContentBodyEditor.svelte +1446 -0
  134. package/dist/svelte/components/ContentBodyEditor.svelte.d.ts +25 -0
  135. package/dist/svelte/components/ContentBodyEditor.svelte.d.ts.map +1 -0
  136. package/dist/svelte/components/ContentBodyRenderer.svelte +152 -0
  137. package/dist/svelte/components/ContentBodyRenderer.svelte.d.ts +10 -0
  138. package/dist/svelte/components/ContentBodyRenderer.svelte.d.ts.map +1 -0
  139. package/dist/svelte/components/ContentClaimAuditTool.svelte +441 -0
  140. package/dist/svelte/components/ContentClaimAuditTool.svelte.d.ts +12 -0
  141. package/dist/svelte/components/ContentClaimAuditTool.svelte.d.ts.map +1 -0
  142. package/dist/svelte/components/ContentContributionForm.svelte +226 -0
  143. package/dist/svelte/components/ContentContributionForm.svelte.d.ts +23 -0
  144. package/dist/svelte/components/ContentContributionForm.svelte.d.ts.map +1 -0
  145. package/dist/svelte/components/ContentContributionInbox.svelte +322 -0
  146. package/dist/svelte/components/ContentContributionInbox.svelte.d.ts +22 -0
  147. package/dist/svelte/components/ContentContributionInbox.svelte.d.ts.map +1 -0
  148. package/dist/svelte/components/ContentContributionPortal.svelte +182 -0
  149. package/dist/svelte/components/ContentContributionPortal.svelte.d.ts +12 -0
  150. package/dist/svelte/components/ContentContributionPortal.svelte.d.ts.map +1 -0
  151. package/dist/svelte/components/ContentContributionTypeManager.svelte +281 -0
  152. package/dist/svelte/components/ContentContributionTypeManager.svelte.d.ts +10 -0
  153. package/dist/svelte/components/ContentContributionTypeManager.svelte.d.ts.map +1 -0
  154. package/dist/svelte/components/ContentContributorManager.svelte +140 -0
  155. package/dist/svelte/components/ContentContributorManager.svelte.d.ts +10 -0
  156. package/dist/svelte/components/ContentContributorManager.svelte.d.ts.map +1 -0
  157. package/dist/svelte/components/ContentCorrectionsTool.svelte +361 -0
  158. package/dist/svelte/components/ContentCorrectionsTool.svelte.d.ts +11 -0
  159. package/dist/svelte/components/ContentCorrectionsTool.svelte.d.ts.map +1 -0
  160. package/dist/svelte/components/ContentEditor.svelte +2166 -0
  161. package/dist/svelte/components/ContentEditor.svelte.d.ts +26 -0
  162. package/dist/svelte/components/ContentEditor.svelte.d.ts.map +1 -0
  163. package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte +199 -0
  164. package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte.d.ts +11 -0
  165. package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte.d.ts.map +1 -0
  166. package/dist/svelte/components/ContentGovernanceManager.svelte +340 -0
  167. package/dist/svelte/components/ContentGovernanceManager.svelte.d.ts +11 -0
  168. package/dist/svelte/components/ContentGovernanceManager.svelte.d.ts.map +1 -0
  169. package/dist/svelte/components/ContentGovernancePanel.svelte +2244 -0
  170. package/dist/svelte/components/ContentGovernancePanel.svelte.d.ts +26 -0
  171. package/dist/svelte/components/ContentGovernancePanel.svelte.d.ts.map +1 -0
  172. package/dist/svelte/components/ContentGovernancePolicyEditor.svelte +110 -0
  173. package/dist/svelte/components/ContentGovernancePolicyEditor.svelte.d.ts +10 -0
  174. package/dist/svelte/components/ContentGovernancePolicyEditor.svelte.d.ts.map +1 -0
  175. package/dist/svelte/components/ContentGovernanceProfileEditor.svelte +185 -0
  176. package/dist/svelte/components/ContentGovernanceProfileEditor.svelte.d.ts +11 -0
  177. package/dist/svelte/components/ContentGovernanceProfileEditor.svelte.d.ts.map +1 -0
  178. package/dist/svelte/components/ContentGovernanceTool.svelte +56 -0
  179. package/dist/svelte/components/ContentGovernanceTool.svelte.d.ts +13 -0
  180. package/dist/svelte/components/ContentGovernanceTool.svelte.d.ts.map +1 -0
  181. package/dist/svelte/components/ContentImageBrowser.svelte +243 -0
  182. package/dist/svelte/components/ContentImageBrowser.svelte.d.ts +18 -0
  183. package/dist/svelte/components/ContentImageBrowser.svelte.d.ts.map +1 -0
  184. package/dist/svelte/components/ContentImageChooser.svelte +134 -0
  185. package/dist/svelte/components/ContentImageChooser.svelte.d.ts +11 -0
  186. package/dist/svelte/components/ContentImageChooser.svelte.d.ts.map +1 -0
  187. package/dist/svelte/components/ContentList.svelte +906 -0
  188. package/dist/svelte/components/ContentList.svelte.d.ts +16 -0
  189. package/dist/svelte/components/ContentList.svelte.d.ts.map +1 -0
  190. package/dist/svelte/components/ContentMetadataFields.svelte +107 -0
  191. package/dist/svelte/components/ContentMetadataFields.svelte.d.ts +8 -0
  192. package/dist/svelte/components/ContentMetadataFields.svelte.d.ts.map +1 -0
  193. package/dist/svelte/components/ContentReferencesPanel.svelte +221 -0
  194. package/dist/svelte/components/ContentReferencesPanel.svelte.d.ts +20 -0
  195. package/dist/svelte/components/ContentReferencesPanel.svelte.d.ts.map +1 -0
  196. package/dist/svelte/components/ContentReviewStatusTray.svelte +151 -0
  197. package/dist/svelte/components/ContentReviewStatusTray.svelte.d.ts +20 -0
  198. package/dist/svelte/components/ContentReviewStatusTray.svelte.d.ts.map +1 -0
  199. package/dist/svelte/components/ContentStatusFields.svelte +85 -0
  200. package/dist/svelte/components/ContentStatusFields.svelte.d.ts +8 -0
  201. package/dist/svelte/components/ContentStatusFields.svelte.d.ts.map +1 -0
  202. package/dist/svelte/components/ContentTitleField.svelte +54 -0
  203. package/dist/svelte/components/ContentTitleField.svelte.d.ts +10 -0
  204. package/dist/svelte/components/ContentTitleField.svelte.d.ts.map +1 -0
  205. package/dist/svelte/components/ContentTransparencyReport.svelte +322 -0
  206. package/dist/svelte/components/ContentTransparencyReport.svelte.d.ts +10 -0
  207. package/dist/svelte/components/ContentTransparencyReport.svelte.d.ts.map +1 -0
  208. package/dist/svelte/components/ContentTransparencyTool.svelte +314 -0
  209. package/dist/svelte/components/ContentTransparencyTool.svelte.d.ts +10 -0
  210. package/dist/svelte/components/ContentTransparencyTool.svelte.d.ts.map +1 -0
  211. package/dist/svelte/components/ContentVersionsTool.svelte +291 -0
  212. package/dist/svelte/components/ContentVersionsTool.svelte.d.ts +10 -0
  213. package/dist/svelte/components/ContentVersionsTool.svelte.d.ts.map +1 -0
  214. package/dist/svelte/components/GovernedContentEditor.svelte +409 -0
  215. package/dist/svelte/components/GovernedContentEditor.svelte.d.ts +35 -0
  216. package/dist/svelte/components/GovernedContentEditor.svelte.d.ts.map +1 -0
  217. package/dist/svelte/components/ImageThumbnail.cache.d.ts +14 -0
  218. package/dist/svelte/components/ImageThumbnail.cache.d.ts.map +1 -0
  219. package/dist/svelte/components/ImageThumbnail.cache.js +36 -0
  220. package/dist/svelte/components/ImageThumbnail.svelte +159 -0
  221. package/dist/svelte/components/ImageThumbnail.svelte.d.ts +8 -0
  222. package/dist/svelte/components/ImageThumbnail.svelte.d.ts.map +1 -0
  223. package/dist/svelte/components/Markdown.svelte +125 -0
  224. package/dist/svelte/components/Markdown.svelte.d.ts +11 -0
  225. package/dist/svelte/components/Markdown.svelte.d.ts.map +1 -0
  226. package/dist/svelte/content-editor-form.d.ts +63 -0
  227. package/dist/svelte/content-editor-form.d.ts.map +1 -0
  228. package/dist/svelte/content-editor-form.js +94 -0
  229. package/dist/svelte/content-editor-media.d.ts +12 -0
  230. package/dist/svelte/content-editor-media.d.ts.map +1 -0
  231. package/dist/svelte/content-editor-media.js +84 -0
  232. package/dist/svelte/content-editor-state.svelte.d.ts +35 -0
  233. package/dist/svelte/content-editor-state.svelte.d.ts.map +1 -0
  234. package/dist/svelte/content-editor-state.svelte.js +141 -0
  235. package/dist/svelte/governance-manager-client.d.ts +22 -0
  236. package/dist/svelte/governance-manager-client.d.ts.map +1 -0
  237. package/dist/svelte/governance-manager-client.js +1 -0
  238. package/dist/svelte/i18n.contribution.d.ts +57 -0
  239. package/dist/svelte/i18n.contribution.d.ts.map +1 -0
  240. package/dist/svelte/i18n.contribution.js +64 -0
  241. package/dist/svelte/i18n.editor.d.ts +71 -0
  242. package/dist/svelte/i18n.editor.d.ts.map +1 -0
  243. package/dist/svelte/i18n.editor.js +87 -0
  244. package/dist/svelte/i18n.governance.d.ts +66 -0
  245. package/dist/svelte/i18n.governance.d.ts.map +1 -0
  246. package/dist/svelte/i18n.governance.js +66 -0
  247. package/dist/svelte/i18n.routes.d.ts +66 -0
  248. package/dist/svelte/i18n.routes.d.ts.map +1 -0
  249. package/dist/svelte/i18n.routes.js +75 -0
  250. package/dist/svelte/i18n.tools.d.ts +81 -0
  251. package/dist/svelte/i18n.tools.d.ts.map +1 -0
  252. package/dist/svelte/i18n.tools.js +90 -0
  253. package/dist/svelte/index.d.ts +101 -0
  254. package/dist/svelte/index.d.ts.map +1 -0
  255. package/dist/svelte/index.js +63 -0
  256. package/dist/svelte/playground.d.ts +281 -0
  257. package/dist/svelte/playground.d.ts.map +1 -0
  258. package/dist/svelte/playground.js +438 -0
  259. package/dist/svelte/routes/ContentContributionsRoute.svelte +809 -0
  260. package/dist/svelte/routes/ContentContributionsRoute.svelte.d.ts +10 -0
  261. package/dist/svelte/routes/ContentContributionsRoute.svelte.d.ts.map +1 -0
  262. package/dist/svelte/routes/ContentFactsRoute.svelte +612 -0
  263. package/dist/svelte/routes/ContentFactsRoute.svelte.d.ts +11 -0
  264. package/dist/svelte/routes/ContentFactsRoute.svelte.d.ts.map +1 -0
  265. package/dist/svelte/routes/ContentGovernanceRoute.svelte +218 -0
  266. package/dist/svelte/routes/ContentGovernanceRoute.svelte.d.ts +10 -0
  267. package/dist/svelte/routes/ContentGovernanceRoute.svelte.d.ts.map +1 -0
  268. package/dist/svelte/routes/ContentWorkspaceRoute.svelte +431 -0
  269. package/dist/svelte/routes/ContentWorkspaceRoute.svelte.d.ts +12 -0
  270. package/dist/svelte/routes/ContentWorkspaceRoute.svelte.d.ts.map +1 -0
  271. package/dist/svelte/routes/PublishedArticleRoute.svelte +194 -0
  272. package/dist/svelte/routes/PublishedArticleRoute.svelte.d.ts +10 -0
  273. package/dist/svelte/routes/PublishedArticleRoute.svelte.d.ts.map +1 -0
  274. package/dist/svelte/routes/index.d.ts +8 -0
  275. package/dist/svelte/routes/index.d.ts.map +1 -0
  276. package/dist/svelte/routes/index.js +6 -0
  277. package/dist/svelte/routes/shared.d.ts +90 -0
  278. package/dist/svelte/routes/shared.d.ts.map +1 -0
  279. package/dist/svelte/routes/shared.js +104 -0
  280. package/dist/svelte/types.d.ts +69 -0
  281. package/dist/svelte/types.d.ts.map +1 -0
  282. package/dist/svelte/types.js +6 -0
  283. package/dist/thumbnail-generator.d.ts +174 -0
  284. package/dist/thumbnail-generator.d.ts.map +1 -0
  285. package/dist/ui.d.ts +10 -0
  286. package/dist/ui.d.ts.map +1 -0
  287. package/dist/ui.js +42 -0
  288. package/dist/ui.js.map +1 -0
  289. package/dist/utils.d.ts +18 -0
  290. package/dist/utils.d.ts.map +1 -0
  291. package/package.json +119 -0
@@ -0,0 +1,17 @@
1
+ import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
+ export interface ContentAssetOptions extends SmrtObjectOptions {
3
+ contentId?: string;
4
+ assetId?: string;
5
+ relationship?: string;
6
+ sortOrder?: number;
7
+ tenantId?: string | null;
8
+ }
9
+ export declare class ContentAsset extends SmrtObject {
10
+ tenantId: string | null;
11
+ contentId: string;
12
+ assetId: string;
13
+ relationship: string;
14
+ sortOrder: number;
15
+ constructor(options?: ContentAssetOptions);
16
+ }
17
+ //# sourceMappingURL=content-asset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-asset.d.ts","sourceRoot":"","sources":["../src/content-asset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAIL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,qBAQa,YAAa,SAAQ,UAAU;IAE1C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAG/B,SAAS,SAAM;IAGf,OAAO,SAAM;IAGb,YAAY,SAAgB;IAG5B,SAAS,SAAK;gBAEF,OAAO,GAAE,mBAAwB;CAQ9C"}
@@ -0,0 +1,10 @@
1
+ import { SmrtCollectionOptions, SmrtJunction } from '@happyvertical/smrt-core';
2
+ import { ContentAsset } from './content-asset';
3
+ export interface ContentAssetCollectionOptions extends SmrtCollectionOptions {
4
+ }
5
+ export declare class ContentAssetCollection extends SmrtJunction<ContentAsset> {
6
+ static readonly _itemClass: typeof ContentAsset;
7
+ protected leftField: string;
8
+ protected rightField: string;
9
+ }
10
+ //# sourceMappingURL=content-assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-assets.d.ts","sourceRoot":"","sources":["../src/content-assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAQ,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;CAAG;AAE/E,qBAKa,sBAAuB,SAAQ,YAAY,CAAC,YAAY,CAAC;IACpE,MAAM,CAAC,QAAQ,CAAC,UAAU,sBAAgB;IAC1C,SAAS,CAAC,SAAS,SAAe;IAClC,SAAS,CAAC,UAAU,SAAa;CAClC"}
@@ -0,0 +1,115 @@
1
+ import { AIClientOptions, getAI } from '@happyvertical/ai';
2
+ import { ChatService } from '@happyvertical/smrt-chat';
3
+ import { ResolvedPrompt, resolvePrompt } from '@happyvertical/smrt-prompts';
4
+ import { DatabaseInterface } from '@happyvertical/sql';
5
+ export type ContentChatAIConfig = AIClientOptions & {
6
+ apiKey?: string;
7
+ allowedModels?: string[];
8
+ model?: string;
9
+ defaultModel?: string;
10
+ provider?: string;
11
+ type?: string;
12
+ };
13
+ export interface ContentChatCollectionLike {
14
+ db: DatabaseInterface;
15
+ get(filter: string | Record<string, unknown>): Promise<unknown>;
16
+ }
17
+ export interface ContentChatSessionInput {
18
+ db: DatabaseInterface;
19
+ contents?: ContentChatCollectionLike;
20
+ tenantId?: string | null;
21
+ profileId?: string | null;
22
+ contentId: string;
23
+ resolvePromptFn?: typeof resolvePrompt;
24
+ }
25
+ export interface CreateContentChatThreadInput extends ContentChatSessionInput {
26
+ title: string;
27
+ sessionId: string;
28
+ model?: string | null;
29
+ initializeChatCollections?: () => Promise<void>;
30
+ }
31
+ export interface ListContentChatThreadMessagesInput {
32
+ db: DatabaseInterface;
33
+ contents?: ContentChatCollectionLike;
34
+ tenantId?: string | null;
35
+ profileId?: string | null;
36
+ contentId: string;
37
+ threadId: string;
38
+ }
39
+ export interface SendContentChatThreadMessageInput {
40
+ contents: ContentChatCollectionLike;
41
+ tenantId?: string | null;
42
+ profileId?: string | null;
43
+ contentId: string;
44
+ threadId: string;
45
+ content: string;
46
+ sessionId: string;
47
+ model?: string | null;
48
+ currentEditorState?: unknown;
49
+ referenceIds?: unknown;
50
+ formFields?: Record<string, unknown> | null;
51
+ aiConfig?: ContentChatAIConfig | null;
52
+ env?: Record<string, string | undefined>;
53
+ resolvePromptFn?: typeof resolvePrompt;
54
+ getAIClient?: typeof getAI;
55
+ resolveAI?: (input: ResolveContentChatAIInput) => Promise<ResolvedContentChatAI | null> | ResolvedContentChatAI | null;
56
+ }
57
+ export interface ResolveContentChatAIInput {
58
+ aiConfig: ContentChatAIConfig;
59
+ env: Record<string, string | undefined>;
60
+ sessionContext: Record<string, unknown>;
61
+ requestedModel?: string | null;
62
+ interactionPrompt: ResolvedPrompt;
63
+ }
64
+ export interface ResolvedContentChatAI {
65
+ clientOptions: ContentChatAIConfig;
66
+ model: string;
67
+ provider?: string | null;
68
+ profile?: string | null;
69
+ temperature?: number | null;
70
+ maxTokens?: number | null;
71
+ }
72
+ export declare function contentChatSessionMatchesContent(session: unknown, contentId: string): boolean;
73
+ /**
74
+ * Stable agent-session key scoping a content-editor session to its content
75
+ * (S5 #1392).
76
+ *
77
+ * `createAgentSession` reuses ANY active session for the same
78
+ * agent/profile/tenant unless a `sessionKey` is supplied. The content-editor
79
+ * agent (`content_editor`) opens a distinct conversation per content, so a
80
+ * keyless create would reuse — and the handler would then REWRITE — a session
81
+ * created for a different content, returning the other content's room/threads.
82
+ * Keying the session on the content id makes a new content always create a
83
+ * distinct session/room.
84
+ */
85
+ export declare function contentChatSessionKey(contentId: string): string;
86
+ export declare function contentChatSessionIsAuthorized(session: unknown, input: {
87
+ profileId: string;
88
+ contentId: string;
89
+ }): boolean;
90
+ export declare function contentChatMessageToJSON(message: unknown): Record<string, unknown>;
91
+ export declare function serializeContentChatMessageForUI(message: unknown): Record<string, unknown>;
92
+ export declare function getOrCreateContentEditorChatSession(input: ContentChatSessionInput): Promise<{
93
+ chatService: ChatService;
94
+ session: import('@happyvertical/smrt-chat').AgentSession;
95
+ threads: unknown[];
96
+ }>;
97
+ export declare function createContentEditorChatThread(input: CreateContentChatThreadInput): Promise<{
98
+ chatService: ChatService;
99
+ session: import('@happyvertical/smrt-chat').AgentSession | null;
100
+ thread: import('@happyvertical/smrt-chat').ChatThread;
101
+ }>;
102
+ export declare function listContentEditorChatThreadMessages(input: ListContentChatThreadMessagesInput): Promise<{
103
+ chatService: ChatService;
104
+ thread: import('@happyvertical/smrt-chat').ChatThread;
105
+ messages: import('@happyvertical/smrt-chat').ChatMessage[];
106
+ }>;
107
+ export declare function resolveDefaultContentChatAI(input: ResolveContentChatAIInput): ResolvedContentChatAI;
108
+ export declare function sendContentEditorChatThreadMessage(input: SendContentChatThreadMessageInput): Promise<{
109
+ chatService: ChatService;
110
+ session: import('@happyvertical/smrt-chat').AgentSession | null;
111
+ thread: import('@happyvertical/smrt-chat').ChatThread;
112
+ userMessage: import('@happyvertical/smrt-chat').ChatMessage;
113
+ agentMessage: import('packages/chat/dist').ChatMessage;
114
+ }>;
115
+ //# sourceMappingURL=content-chat-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-chat-handlers.d.ts","sourceRoot":"","sources":["../src/content-chat-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EACL,KAAK,cAAc,EACnB,aAAa,EACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAmB5D,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,iBAAiB,CAAC;IAKtB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,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AC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,GACA,OAAO,CAYT;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOzB;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,OAAO,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOzB;AAED,wBAAsB,mCAAmC,CACvD,KAAK,EAAE,uBAAuB;;;;GAmF/B;AAED,wBAAsB,6BAA6B,CACjD,KAAK,EAAE,4BAA4B;;;;GAmEpC;AAED,wBAAsB,mCAAmC,CACvD,KAAK,EAAE,kCAAkC;;;;GAoD1C;AAiBD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,yBAAyB,GAC/B,qBAAqB,CA0CvB;AAsFD,wBAAsB,kCAAkC,CACtD,KAAK,EAAE,iCAAiC;;;;;;GAuKzC"}
@@ -0,0 +1,3 @@
1
+ export declare const contentEditorSessionPrompt: import('@happyvertical/smrt-prompts').PromptDefinition;
2
+ export declare const contentEditorInteractionPrompt: import('@happyvertical/smrt-prompts').PromptDefinition;
3
+ //# sourceMappingURL=content-chat-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-chat-prompts.d.ts","sourceRoot":"","sources":["../src/content-chat-prompts.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,wDAcrC,CAAC;AAEH,eAAO,MAAM,8BAA8B,wDAuCzC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { ResolvedPrompt } from '@happyvertical/smrt-prompts';
2
+ type SessionContext = Record<string, unknown>;
3
+ export interface ContentChatAISelection {
4
+ profile: string | null;
5
+ provider: string | null;
6
+ model: string | null;
7
+ allowedModels: string[] | null;
8
+ temperature: number | null;
9
+ maxTokens: number | null;
10
+ }
11
+ export interface ContentEditorInteractionInput {
12
+ fields?: Record<string, unknown> | null;
13
+ currentEditorState?: unknown;
14
+ references?: string | null;
15
+ }
16
+ export declare function inferProviderFromModel(model: string): string;
17
+ export declare function getContentChatAISelection(context: SessionContext): ContentChatAISelection;
18
+ export declare function resolveContentChatModelSelection(context: SessionContext, requestedModel: string | null | undefined, fallbackModel: string): {
19
+ model: string;
20
+ provider: string;
21
+ };
22
+ export declare function buildContentChatModelUpdates(context: SessionContext, requestedModel: string | null | undefined, fallbackModel: string): Record<string, string | null>;
23
+ export declare function buildContentEditorSessionContext(contentId: string, prompt: ResolvedPrompt): SessionContext;
24
+ export declare function buildContentEditorInteractionVariables(input: ContentEditorInteractionInput): Record<string, string>;
25
+ export {};
26
+ //# sourceMappingURL=content-chat-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-chat-session.d.ts","sourceRoot":"","sources":["../src/content-chat-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9C,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAoBD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA+B5D;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,cAAc,GACtB,sBAAsB,CAcxB;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,cAAc,EACvB,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,aAAa,EAAE,MAAM,GACpB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CASrC;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,cAAc,EACvB,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,aAAa,EAAE,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAe/B;AAED,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,cAAc,GACrB,cAAc,CAgBhB;AAmBD,wBAAgB,sCAAsC,CACpD,KAAK,EAAE,6BAA6B,GACnC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxB"}
@@ -0,0 +1,42 @@
1
+ import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
+ import { ContentContributionChannel } from './content-contribution-config';
3
+ export interface ContentContributionAttachmentOptions extends SmrtObjectOptions {
4
+ contributionId?: string;
5
+ revisionId?: string | null;
6
+ filename?: string;
7
+ mimeType?: string;
8
+ size?: number;
9
+ fileKey?: string | null;
10
+ sourceUri?: string | null;
11
+ channel?: ContentContributionChannel;
12
+ promotedAssetId?: string | null;
13
+ metadata?: Record<string, any> | string;
14
+ tenantId?: string | null;
15
+ createdAt?: Date;
16
+ updatedAt?: Date;
17
+ }
18
+ export declare class ContentContributionAttachment extends SmrtObject {
19
+ contributionId: string;
20
+ revisionId: string;
21
+ filename: string;
22
+ mimeType: string;
23
+ size: number;
24
+ fileKey: string;
25
+ sourceUri: string;
26
+ channel: ContentContributionChannel;
27
+ promotedAssetId: string;
28
+ metadata: string;
29
+ tenantId: string | null;
30
+ createdAt: Date;
31
+ updatedAt: Date;
32
+ constructor(options?: ContentContributionAttachmentOptions);
33
+ getMetadata(): Record<string, any>;
34
+ protected transformJSON(json: Record<string, any>): {
35
+ revisionId: string | null;
36
+ fileKey: string | null;
37
+ sourceUri: string | null;
38
+ promotedAssetId: string | null;
39
+ metadata: Record<string, any>;
40
+ };
41
+ }
42
+ //# sourceMappingURL=content-contribution-attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-contribution-attachment.d.ts","sourceRoot":"","sources":["../src/content-contribution-attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAGL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,MAAM,WAAW,oCACf,SAAQ,iBAAiB;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,0BAA0B,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAyBD,qBAQa,6BAA8B,SAAQ,UAAU;IAE3D,cAAc,SAAM;IAGpB,UAAU,SAAM;IAEhB,QAAQ,SAAM;IACd,QAAQ,SAAM;IACd,IAAI,SAAK;IACT,OAAO,SAAM;IACb,SAAS,SAAM;IACf,OAAO,EAAE,0BAA0B,CAAS;IAG5C,eAAe,SAAM;IAErB,QAAQ,SAAM;IAGd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,SAAS,OAAc;IACvB,SAAS,OAAc;gBAEX,OAAO,GAAE,oCAAyC;IA0B9D,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;cAIf,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;;CAU3D"}
@@ -0,0 +1,8 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { ContentContributionAttachment } from './content-contribution-attachment';
3
+ export declare class ContentContributionAttachmentCollection extends SmrtCollection<ContentContributionAttachment> {
4
+ static readonly _itemClass: typeof ContentContributionAttachment;
5
+ listForContribution(contributionId: string): Promise<ContentContributionAttachment[]>;
6
+ listForRevision(revisionId: string): Promise<ContentContributionAttachment[]>;
7
+ }
8
+ //# sourceMappingURL=content-contribution-attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-contribution-attachments.d.ts","sourceRoot":"","sources":["../src/content-contribution-attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAElF,qBAAa,uCAAwC,SAAQ,cAAc,CAAC,6BAA6B,CAAC;IACxG,MAAM,CAAC,QAAQ,CAAC,UAAU,uCAAiC;IAErD,mBAAmB,CACvB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,6BAA6B,EAAE,CAAC;IAOrC,eAAe,CACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,6BAA6B,EAAE,CAAC;CAM5C"}
@@ -0,0 +1,84 @@
1
+ import { DatabaseInterface } from '@happyvertical/sql';
2
+ export type ContentContributionChannel = 'web' | 'email';
3
+ export type ContentContributionStatus = 'submitted' | 'quarantined' | 'needs_changes' | 'approved' | 'promoted' | 'rejected' | 'withdrawn';
4
+ export type ContentContributionIntakeDecision = 'accepted' | 'quarantined' | 'rejected';
5
+ export type ContentContributorTrustLevel = 'standard' | 'trusted' | 'blocked';
6
+ export interface ContentContributionIntakeRules {
7
+ maxFiles?: number | null;
8
+ maxTotalBytes?: number | null;
9
+ allowedMimePatterns?: string[];
10
+ blockedMimePatterns?: string[];
11
+ quarantineMimePatterns?: string[];
12
+ blockedTextPatterns?: string[];
13
+ quarantineTextPatterns?: string[];
14
+ trustedOnly?: boolean;
15
+ }
16
+ export interface ContentContributionPromotionMapping {
17
+ targetContentType?: string | null;
18
+ targetContentVariant?: string | null;
19
+ targetContentStatus?: 'draft' | 'review';
20
+ autoPromoteTrusted?: boolean;
21
+ createAssets?: boolean;
22
+ assetRelationship?: string;
23
+ }
24
+ export interface ContentContributionTypeDefinition {
25
+ key: string;
26
+ label: string;
27
+ enabled?: boolean;
28
+ allowedChannels?: ContentContributionChannel[];
29
+ allowText?: boolean;
30
+ allowFiles?: boolean;
31
+ allowEmptyText?: boolean;
32
+ intakeRules?: ContentContributionIntakeRules;
33
+ promotion?: ContentContributionPromotionMapping;
34
+ metadata?: Record<string, any>;
35
+ }
36
+ export interface PersistedContentContributionTypeRecord extends ContentContributionTypeDefinition {
37
+ id?: string;
38
+ tenantId?: string | null;
39
+ createdAt?: string | null;
40
+ updatedAt?: string | null;
41
+ }
42
+ export interface ContentContributionConfig {
43
+ types: ContentContributionTypeDefinition[];
44
+ }
45
+ export interface ResolvedContentContributionType extends ContentContributionTypeDefinition {
46
+ }
47
+ export interface ContentContributionTypeConfigState {
48
+ effective: ContentContributionTypeDefinition[];
49
+ persisted: PersistedContentContributionTypeRecord[];
50
+ }
51
+ export interface EvaluateContributionIntakeOptions {
52
+ contributionType: ContentContributionTypeDefinition;
53
+ trustLevel?: ContentContributorTrustLevel;
54
+ channel: ContentContributionChannel;
55
+ title?: string | null;
56
+ description?: string | null;
57
+ body?: string | null;
58
+ attachments?: Array<{
59
+ mimeType?: string | null;
60
+ size?: number | null;
61
+ }>;
62
+ }
63
+ export interface EvaluateContributionIntakeResult {
64
+ decision: ContentContributionIntakeDecision;
65
+ reasons: string[];
66
+ }
67
+ export declare function getContentContributionConfig(): ContentContributionConfig;
68
+ export declare function configureContentContributions(config: Partial<ContentContributionConfig>): ContentContributionConfig;
69
+ export declare function resetContentContributionConfig(): ContentContributionConfig;
70
+ export declare function hasStaticContentContributionType(key: string): boolean;
71
+ export declare function loadPersistedContentContributionTypes(options?: {
72
+ db?: DatabaseInterface | null;
73
+ }): Promise<PersistedContentContributionTypeRecord[]>;
74
+ export declare function getEffectiveContentContributionConfig(options?: {
75
+ db?: DatabaseInterface | null;
76
+ }): Promise<ContentContributionConfig>;
77
+ export declare function getContentContributionTypeConfigState(options?: {
78
+ db?: DatabaseInterface | null;
79
+ }): Promise<ContentContributionTypeConfigState>;
80
+ export declare function resolveEffectiveContentContributionType(key: string, options?: {
81
+ db?: DatabaseInterface | null;
82
+ }): Promise<ResolvedContentContributionType | null>;
83
+ export declare function evaluateContributionIntake(options: EvaluateContributionIntakeOptions): EvaluateContributionIntakeResult;
84
+ //# sourceMappingURL=content-contribution-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-contribution-config.d.ts","sourceRoot":"","sources":["../src/content-contribution-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,0BAA0B,GAAG,KAAK,GAAG,OAAO,CAAC;AAEzD,MAAM,MAAM,yBAAyB,GACjC,WAAW,GACX,aAAa,GACb,eAAe,GACf,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,MAAM,iCAAiC,GACzC,UAAU,GACV,aAAa,GACb,UAAU,CAAC;AAEf,MAAM,MAAM,4BAA4B,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS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C9C,OAAO,CAAC,sCAAsC,EAAE,CAAC,CAoBnD;AAED,wBAAsB,qCAAqC,CACzD,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAO,GAC9C,OAAO,CAAC,yBAAyB,CAAC,CAcpC;AAED,wBAAsB,qCAAqC,CACzD,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAO,GAC9C,OAAO,CAAC,kCAAkC,CAAC,CAU7C;AAED,wBAAsB,uCAAuC,CAC3D,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAAO,GAC9C,OAAO,CAAC,+BAA+B,GAAG,IAAI,CAAC,CAIjD;AAuBD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,iCAAiC,GACzC,gCAAgC,CAgKlC"}
@@ -0,0 +1,38 @@
1
+ import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
+ import { ContentContributionChannel } from './content-contribution-config';
3
+ export interface ContentContributionRevisionOptions extends SmrtObjectOptions {
4
+ contributionId?: string;
5
+ revisionNumber?: number;
6
+ channel?: ContentContributionChannel;
7
+ title?: string;
8
+ description?: string | null;
9
+ body?: string | null;
10
+ sourceMessageId?: string | null;
11
+ sourceThreadKey?: string | null;
12
+ metadata?: Record<string, any> | string;
13
+ tenantId?: string | null;
14
+ createdAt?: Date;
15
+ updatedAt?: Date;
16
+ }
17
+ export declare class ContentContributionRevision extends SmrtObject {
18
+ contributionId: string;
19
+ revisionNumber: number;
20
+ channel: ContentContributionChannel;
21
+ title: string;
22
+ description: string;
23
+ body: string;
24
+ sourceMessageId: string;
25
+ sourceThreadKey: string;
26
+ metadata: string;
27
+ tenantId: string | null;
28
+ createdAt: Date;
29
+ updatedAt: Date;
30
+ constructor(options?: ContentContributionRevisionOptions);
31
+ getMetadata(): Record<string, any>;
32
+ protected transformJSON(json: Record<string, any>): {
33
+ sourceMessageId: string | null;
34
+ sourceThreadKey: string | null;
35
+ metadata: Record<string, any>;
36
+ };
37
+ }
38
+ //# sourceMappingURL=content-contribution-revision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-contribution-revision.d.ts","sourceRoot":"","sources":["../src/content-contribution-revision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAGL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,MAAM,WAAW,kCAAmC,SAAQ,iBAAiB;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,0BAA0B,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAyBD,qBAQa,2BAA4B,SAAQ,UAAU;IAEzD,cAAc,SAAM;IAEpB,cAAc,SAAK;IACnB,OAAO,EAAE,0BAA0B,CAAS;IAC5C,KAAK,SAAM;IACX,WAAW,SAAM;IACjB,IAAI,SAAM;IAGV,eAAe,SAAM;IAErB,eAAe,SAAM;IACrB,QAAQ,SAAM;IAGd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B,SAAS,OAAc;IACvB,SAAS,OAAc;gBAEX,OAAO,GAAE,kCAAuC;IA0B5D,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;cAIf,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;CAQ3D"}
@@ -0,0 +1,8 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { ContentContributionRevision } from './content-contribution-revision';
3
+ export declare class ContentContributionRevisionCollection extends SmrtCollection<ContentContributionRevision> {
4
+ static readonly _itemClass: typeof ContentContributionRevision;
5
+ listForContribution(contributionId: string): Promise<ContentContributionRevision[]>;
6
+ getLatestForContribution(contributionId: string): Promise<ContentContributionRevision | null>;
7
+ }
8
+ //# sourceMappingURL=content-contribution-revisions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-contribution-revisions.d.ts","sourceRoot":"","sources":["../src/content-contribution-revisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,qBAAa,qCAAsC,SAAQ,cAAc,CAAC,2BAA2B,CAAC;IACpG,MAAM,CAAC,QAAQ,CAAC,UAAU,qCAA+B;IAEnD,mBAAmB,CACvB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,2BAA2B,EAAE,CAAC;IAOnC,wBAAwB,CAC5B,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC;CAS/C"}
@@ -0,0 +1,51 @@
1
+ import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
+ import { ContentContributionChannel, ContentContributionIntakeRules, ContentContributionPromotionMapping, ContentContributionTypeDefinition } from './content-contribution-config';
3
+ export interface ContentContributionTypeOptions extends SmrtObjectOptions {
4
+ key?: string;
5
+ label?: string;
6
+ enabled?: boolean;
7
+ allowedChannels?: ContentContributionChannel[] | string;
8
+ allowText?: boolean;
9
+ allowFiles?: boolean;
10
+ allowEmptyText?: boolean;
11
+ intakeRules?: ContentContributionIntakeRules | string;
12
+ promotion?: ContentContributionPromotionMapping | string;
13
+ metadata?: Record<string, any> | string;
14
+ tenantId?: string | null;
15
+ createdAt?: Date;
16
+ updatedAt?: Date;
17
+ }
18
+ export declare class ContentContributionType extends SmrtObject {
19
+ key: string;
20
+ label: string;
21
+ enabled: boolean;
22
+ allowedChannels: string;
23
+ allowText: boolean;
24
+ allowFiles: boolean;
25
+ allowEmptyText: boolean;
26
+ intakeRules: string;
27
+ promotion: string;
28
+ metadata: string;
29
+ tenantId: string | null;
30
+ createdAt: Date;
31
+ updatedAt: Date;
32
+ constructor(options?: ContentContributionTypeOptions);
33
+ getAllowedChannels(): ContentContributionChannel[];
34
+ setAllowedChannels(channels: ContentContributionChannel[]): void;
35
+ getIntakeRules(): ContentContributionIntakeRules;
36
+ setIntakeRules(rules: ContentContributionIntakeRules): void;
37
+ getPromotion(): ContentContributionPromotionMapping;
38
+ setPromotion(promotion: ContentContributionPromotionMapping): void;
39
+ getMetadata(): Record<string, any>;
40
+ setMetadata(metadata: Record<string, any>): void;
41
+ toDefinition(): ContentContributionTypeDefinition;
42
+ protected transformJSON(json: Record<string, any>): {
43
+ allowedChannels: ContentContributionChannel[];
44
+ intakeRules: ContentContributionIntakeRules;
45
+ promotion: ContentContributionPromotionMapping;
46
+ metadata: Record<string, any>;
47
+ };
48
+ protected validateBeforeSave(): Promise<void>;
49
+ delete(): Promise<void>;
50
+ }
51
+ //# sourceMappingURL=content-contribution-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-contribution-type.d.ts","sourceRoot":"","sources":["../src/content-contribution-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAS,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAEn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AAG,IAAI;IAI3D,YAAY,IAAI,mCAAmC;IAInD,YAAY,CAAC,SAAS,EAAE,mCAAmC,GAAG,IAAI;IAIlE,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAIlC,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIhD,YAAY,IAAI,iCAAiC;cAe9B,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;cAUjC,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAe7C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAmCvC"}
@@ -0,0 +1,7 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { ContentContributionType } from './content-contribution-type';
3
+ export declare class ContentContributionTypeCollection extends SmrtCollection<ContentContributionType> {
4
+ static readonly _itemClass: typeof ContentContributionType;
5
+ getByKey(key: string): Promise<ContentContributionType | null>;
6
+ }
7
+ //# sourceMappingURL=content-contribution-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-contribution-types.d.ts","sourceRoot":"","sources":["../src/content-contribution-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,qBAAa,iCAAkC,SAAQ,cAAc,CAAC,uBAAuB,CAAC;IAC5F,MAAM,CAAC,QAAQ,CAAC,UAAU,iCAA2B;IAE/C,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;CAGrE"}
@@ -0,0 +1,161 @@
1
+ import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
2
+ import { ContentContributionAttachment } from './content-contribution-attachment';
3
+ import { ContentContributionChannel, ContentContributionIntakeDecision, ContentContributionStatus, ContentContributionTypeDefinition } from './content-contribution-config';
4
+ import { ContentContributionRevision } from './content-contribution-revision';
5
+ import { ContentContributor } from './content-contributor';
6
+ export interface ContentContributionAttachmentInput {
7
+ filename: string;
8
+ mimeType?: string | null;
9
+ size?: number | null;
10
+ fileKey?: string | null;
11
+ sourceUri?: string | null;
12
+ metadata?: Record<string, any>;
13
+ }
14
+ export interface AppendContentContributionRevisionOptions {
15
+ title?: string | null;
16
+ description?: string | null;
17
+ body?: string | null;
18
+ channel?: ContentContributionChannel;
19
+ sourceMessageId?: string | null;
20
+ sourceThreadKey?: string | null;
21
+ attachments?: ContentContributionAttachmentInput[];
22
+ metadata?: Record<string, any>;
23
+ }
24
+ export interface ApproveContentContributionOptions {
25
+ editorNote?: string | null;
26
+ promote?: boolean;
27
+ targetStatus?: 'draft' | 'review';
28
+ }
29
+ export interface RejectContentContributionOptions {
30
+ editorNote?: string | null;
31
+ }
32
+ export interface RequestChangesContentContributionOptions {
33
+ editorNote?: string | null;
34
+ }
35
+ export interface WithdrawContentContributionOptions {
36
+ reason?: string | null;
37
+ }
38
+ export interface PromoteContentContributionOptions {
39
+ editorNote?: string | null;
40
+ targetStatus?: 'draft' | 'review';
41
+ }
42
+ export interface ContentContributionOptions extends SmrtObjectOptions {
43
+ contributorId?: string;
44
+ contributionTypeKey?: string;
45
+ status?: ContentContributionStatus;
46
+ intakeDecision?: ContentContributionIntakeDecision;
47
+ channel?: ContentContributionChannel;
48
+ title?: string | null;
49
+ description?: string | null;
50
+ body?: string | null;
51
+ contributorEmail?: string | null;
52
+ contributorName?: string | null;
53
+ threadKey?: string | null;
54
+ sourceMessageId?: string | null;
55
+ editorNotes?: string | null;
56
+ promotedContentId?: string | null;
57
+ revisionCount?: number;
58
+ approvedAt?: Date | null;
59
+ promotedAt?: Date | null;
60
+ rejectedAt?: Date | null;
61
+ withdrawnAt?: Date | null;
62
+ requestedChangesAt?: Date | null;
63
+ metadata?: Record<string, any> | string;
64
+ tenantId?: string | null;
65
+ createdAt?: Date;
66
+ updatedAt?: Date;
67
+ }
68
+ export declare class ContentContribution extends SmrtObject {
69
+ contributorId: string;
70
+ contributionTypeKey: string;
71
+ status: ContentContributionStatus;
72
+ intakeDecision: ContentContributionIntakeDecision;
73
+ channel: ContentContributionChannel;
74
+ title: string;
75
+ description: string;
76
+ body: string;
77
+ contributorEmail: string;
78
+ contributorName: string;
79
+ threadKey: string;
80
+ sourceMessageId: string;
81
+ editorNotes: string;
82
+ promotedContentId: string;
83
+ revisionCount: number;
84
+ approvedAt: Date | null;
85
+ promotedAt: Date | null;
86
+ rejectedAt: Date | null;
87
+ withdrawnAt: Date | null;
88
+ requestedChangesAt: Date | null;
89
+ metadata: string;
90
+ tenantId: string | null;
91
+ createdAt: Date;
92
+ updatedAt: Date;
93
+ constructor(options?: ContentContributionOptions);
94
+ getMetadata(): Record<string, any>;
95
+ setMetadata(metadata: Record<string, any>): void;
96
+ protected transformJSON(json: Record<string, any>): {
97
+ description: string | null;
98
+ body: string | null;
99
+ contributorEmail: string | null;
100
+ contributorName: string | null;
101
+ threadKey: string | null;
102
+ sourceMessageId: string | null;
103
+ editorNotes: string | null;
104
+ promotedContentId: string | null;
105
+ metadata: Record<string, any>;
106
+ };
107
+ private getRevisionCollection;
108
+ private getAttachmentCollection;
109
+ private getContributorCollection;
110
+ private getContentsCollection;
111
+ private getAssetCollection;
112
+ private getAssetStatusCollection;
113
+ private getAssetTypeCollection;
114
+ getContributor(): Promise<ContentContributor | null>;
115
+ getRevisions(): Promise<ContentContributionRevision[]>;
116
+ getLatestRevision(): Promise<ContentContributionRevision | null>;
117
+ getAttachments(): Promise<ContentContributionAttachment[]>;
118
+ resolveContributionType(): Promise<ContentContributionTypeDefinition | null>;
119
+ private ensureEditable;
120
+ private createRevision;
121
+ private createHeldAttachments;
122
+ appendRevisionAction(options?: AppendContentContributionRevisionOptions): Promise<{
123
+ contribution: any;
124
+ revision: any;
125
+ attachments: any[];
126
+ }>;
127
+ requestChangesAction(options?: RequestChangesContentContributionOptions): Promise<any>;
128
+ rejectAction(options?: RejectContentContributionOptions): Promise<any>;
129
+ withdrawAction(options?: WithdrawContentContributionOptions): Promise<any>;
130
+ approveAction(options?: ApproveContentContributionOptions): Promise<{
131
+ contribution: any;
132
+ content: any;
133
+ assets: {
134
+ attachmentId: string | null | undefined;
135
+ assetId: string;
136
+ }[];
137
+ } | {
138
+ contribution: any;
139
+ content: any;
140
+ assets: {
141
+ attachmentId: string | null;
142
+ assetId: string | null;
143
+ }[];
144
+ }>;
145
+ promoteAction(options?: PromoteContentContributionOptions): Promise<{
146
+ contribution: any;
147
+ content: any;
148
+ assets: {
149
+ attachmentId: string | null | undefined;
150
+ assetId: string;
151
+ }[];
152
+ } | {
153
+ contribution: any;
154
+ content: any;
155
+ assets: {
156
+ attachmentId: string | null;
157
+ assetId: string | null;
158
+ }[];
159
+ }>;
160
+ }
161
+ //# sourceMappingURL=content-contribution.d.ts.map