@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.
- package/AGENTS.md +194 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +634 -0
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/asset-associable.d.ts +115 -0
- package/dist/asset-associable.d.ts.map +1 -0
- package/dist/body-format.d.ts +29 -0
- package/dist/body-format.d.ts.map +1 -0
- package/dist/body-format.js +604 -0
- package/dist/body-format.js.map +1 -0
- package/dist/content-asset.d.ts +17 -0
- package/dist/content-asset.d.ts.map +1 -0
- package/dist/content-assets.d.ts +10 -0
- package/dist/content-assets.d.ts.map +1 -0
- package/dist/content-chat-handlers.d.ts +115 -0
- package/dist/content-chat-handlers.d.ts.map +1 -0
- package/dist/content-chat-prompts.d.ts +3 -0
- package/dist/content-chat-prompts.d.ts.map +1 -0
- package/dist/content-chat-session.d.ts +26 -0
- package/dist/content-chat-session.d.ts.map +1 -0
- package/dist/content-contribution-attachment.d.ts +42 -0
- package/dist/content-contribution-attachment.d.ts.map +1 -0
- package/dist/content-contribution-attachments.d.ts +8 -0
- package/dist/content-contribution-attachments.d.ts.map +1 -0
- package/dist/content-contribution-config.d.ts +84 -0
- package/dist/content-contribution-config.d.ts.map +1 -0
- package/dist/content-contribution-revision.d.ts +38 -0
- package/dist/content-contribution-revision.d.ts.map +1 -0
- package/dist/content-contribution-revisions.d.ts +8 -0
- package/dist/content-contribution-revisions.d.ts.map +1 -0
- package/dist/content-contribution-type.d.ts +51 -0
- package/dist/content-contribution-type.d.ts.map +1 -0
- package/dist/content-contribution-types.d.ts +7 -0
- package/dist/content-contribution-types.d.ts.map +1 -0
- package/dist/content-contribution.d.ts +161 -0
- package/dist/content-contribution.d.ts.map +1 -0
- package/dist/content-contributions.d.ts +53 -0
- package/dist/content-contributions.d.ts.map +1 -0
- package/dist/content-contributor.d.ts +30 -0
- package/dist/content-contributor.d.ts.map +1 -0
- package/dist/content-contributors.d.ts +13 -0
- package/dist/content-contributors.d.ts.map +1 -0
- package/dist/content-correction.d.ts +39 -0
- package/dist/content-correction.d.ts.map +1 -0
- package/dist/content-corrections.d.ts +9 -0
- package/dist/content-corrections.d.ts.map +1 -0
- package/dist/content-editor-assistant.d.ts +68 -0
- package/dist/content-editor-assistant.d.ts.map +1 -0
- package/dist/content-editor-assistant.js +97 -0
- package/dist/content-editor-assistant.js.map +1 -0
- package/dist/content-feed-parser.d.ts +19 -0
- package/dist/content-feed-parser.d.ts.map +1 -0
- package/dist/content-feed-source.d.ts +52 -0
- package/dist/content-feed-source.d.ts.map +1 -0
- package/dist/content-feed-sources.d.ts +11 -0
- package/dist/content-feed-sources.d.ts.map +1 -0
- package/dist/content-feed-sync.d.ts +23 -0
- package/dist/content-feed-sync.d.ts.map +1 -0
- package/dist/content-governance-assignment.d.ts +42 -0
- package/dist/content-governance-assignment.d.ts.map +1 -0
- package/dist/content-governance-assignments.d.ts +11 -0
- package/dist/content-governance-assignments.d.ts.map +1 -0
- package/dist/content-governance-policies.d.ts +7 -0
- package/dist/content-governance-policies.d.ts.map +1 -0
- package/dist/content-governance-policy.d.ts +29 -0
- package/dist/content-governance-policy.d.ts.map +1 -0
- package/dist/content-governance-profile.d.ts +31 -0
- package/dist/content-governance-profile.d.ts.map +1 -0
- package/dist/content-governance-profiles.d.ts +7 -0
- package/dist/content-governance-profiles.d.ts.map +1 -0
- package/dist/content-governance.d.ts +188 -0
- package/dist/content-governance.d.ts.map +1 -0
- package/dist/content-prompts.d.ts +10 -0
- package/dist/content-prompts.d.ts.map +1 -0
- package/dist/content-reference.d.ts +17 -0
- package/dist/content-reference.d.ts.map +1 -0
- package/dist/content-references.d.ts +55 -0
- package/dist/content-references.d.ts.map +1 -0
- package/dist/content-review.d.ts +34 -0
- package/dist/content-review.d.ts.map +1 -0
- package/dist/content-reviews.d.ts +21 -0
- package/dist/content-reviews.d.ts.map +1 -0
- package/dist/content-transparency.d.ts +72 -0
- package/dist/content-transparency.d.ts.map +1 -0
- package/dist/content-types.d.ts +51 -0
- package/dist/content-types.d.ts.map +1 -0
- package/dist/content-version.d.ts +38 -0
- package/dist/content-version.d.ts.map +1 -0
- package/dist/content-versions.d.ts +16 -0
- package/dist/content-versions.d.ts.map +1 -0
- package/dist/content.d.ts +736 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/contents.d.ts +292 -0
- package/dist/contents.d.ts.map +1 -0
- package/dist/database-utils.d.ts +3 -0
- package/dist/database-utils.d.ts.map +1 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11602 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +12308 -0
- package/dist/mock-smrt-client.d.ts +493 -0
- package/dist/mock-smrt-client.d.ts.map +1 -0
- package/dist/mock-smrt-client.js +390 -0
- package/dist/mock-smrt-client.js.map +1 -0
- package/dist/playground.d.ts +2 -0
- package/dist/playground.d.ts.map +1 -0
- package/dist/playground.js +454 -0
- package/dist/playground.js.map +1 -0
- package/dist/publish-readiness.d.ts +30 -0
- package/dist/publish-readiness.d.ts.map +1 -0
- package/dist/publish-readiness.js +74 -0
- package/dist/publish-readiness.js.map +1 -0
- package/dist/safe-remote-url.d.ts +52 -0
- package/dist/safe-remote-url.d.ts.map +1 -0
- package/dist/serialization.d.ts +78 -0
- package/dist/serialization.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +6130 -0
- package/dist/svelte/api.d.ts +3 -0
- package/dist/svelte/api.d.ts.map +1 -0
- package/dist/svelte/api.js +10 -0
- package/dist/svelte/components/ArticleCard.svelte +159 -0
- package/dist/svelte/components/ArticleCard.svelte.d.ts +17 -0
- package/dist/svelte/components/ArticleCard.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ArticleList.svelte +75 -0
- package/dist/svelte/components/ArticleList.svelte.d.ts +21 -0
- package/dist/svelte/components/ArticleList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentAgentChat.svelte +652 -0
- package/dist/svelte/components/ContentAgentChat.svelte.d.ts +17 -0
- package/dist/svelte/components/ContentAgentChat.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentBodyEditor.svelte +1446 -0
- package/dist/svelte/components/ContentBodyEditor.svelte.d.ts +25 -0
- package/dist/svelte/components/ContentBodyEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentBodyRenderer.svelte +152 -0
- package/dist/svelte/components/ContentBodyRenderer.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentBodyRenderer.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentClaimAuditTool.svelte +441 -0
- package/dist/svelte/components/ContentClaimAuditTool.svelte.d.ts +12 -0
- package/dist/svelte/components/ContentClaimAuditTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributionForm.svelte +226 -0
- package/dist/svelte/components/ContentContributionForm.svelte.d.ts +23 -0
- package/dist/svelte/components/ContentContributionForm.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributionInbox.svelte +322 -0
- package/dist/svelte/components/ContentContributionInbox.svelte.d.ts +22 -0
- package/dist/svelte/components/ContentContributionInbox.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributionPortal.svelte +182 -0
- package/dist/svelte/components/ContentContributionPortal.svelte.d.ts +12 -0
- package/dist/svelte/components/ContentContributionPortal.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributionTypeManager.svelte +281 -0
- package/dist/svelte/components/ContentContributionTypeManager.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentContributionTypeManager.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentContributorManager.svelte +140 -0
- package/dist/svelte/components/ContentContributorManager.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentContributorManager.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentCorrectionsTool.svelte +361 -0
- package/dist/svelte/components/ContentCorrectionsTool.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentCorrectionsTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentEditor.svelte +2166 -0
- package/dist/svelte/components/ContentEditor.svelte.d.ts +26 -0
- package/dist/svelte/components/ContentEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte +199 -0
- package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernanceManager.svelte +340 -0
- package/dist/svelte/components/ContentGovernanceManager.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentGovernanceManager.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernancePanel.svelte +2244 -0
- package/dist/svelte/components/ContentGovernancePanel.svelte.d.ts +26 -0
- package/dist/svelte/components/ContentGovernancePanel.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernancePolicyEditor.svelte +110 -0
- package/dist/svelte/components/ContentGovernancePolicyEditor.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentGovernancePolicyEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernanceProfileEditor.svelte +185 -0
- package/dist/svelte/components/ContentGovernanceProfileEditor.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentGovernanceProfileEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentGovernanceTool.svelte +56 -0
- package/dist/svelte/components/ContentGovernanceTool.svelte.d.ts +13 -0
- package/dist/svelte/components/ContentGovernanceTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentImageBrowser.svelte +243 -0
- package/dist/svelte/components/ContentImageBrowser.svelte.d.ts +18 -0
- package/dist/svelte/components/ContentImageBrowser.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentImageChooser.svelte +134 -0
- package/dist/svelte/components/ContentImageChooser.svelte.d.ts +11 -0
- package/dist/svelte/components/ContentImageChooser.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentList.svelte +906 -0
- package/dist/svelte/components/ContentList.svelte.d.ts +16 -0
- package/dist/svelte/components/ContentList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentMetadataFields.svelte +107 -0
- package/dist/svelte/components/ContentMetadataFields.svelte.d.ts +8 -0
- package/dist/svelte/components/ContentMetadataFields.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentReferencesPanel.svelte +221 -0
- package/dist/svelte/components/ContentReferencesPanel.svelte.d.ts +20 -0
- package/dist/svelte/components/ContentReferencesPanel.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentReviewStatusTray.svelte +151 -0
- package/dist/svelte/components/ContentReviewStatusTray.svelte.d.ts +20 -0
- package/dist/svelte/components/ContentReviewStatusTray.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentStatusFields.svelte +85 -0
- package/dist/svelte/components/ContentStatusFields.svelte.d.ts +8 -0
- package/dist/svelte/components/ContentStatusFields.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentTitleField.svelte +54 -0
- package/dist/svelte/components/ContentTitleField.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentTitleField.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentTransparencyReport.svelte +322 -0
- package/dist/svelte/components/ContentTransparencyReport.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentTransparencyReport.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentTransparencyTool.svelte +314 -0
- package/dist/svelte/components/ContentTransparencyTool.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentTransparencyTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ContentVersionsTool.svelte +291 -0
- package/dist/svelte/components/ContentVersionsTool.svelte.d.ts +10 -0
- package/dist/svelte/components/ContentVersionsTool.svelte.d.ts.map +1 -0
- package/dist/svelte/components/GovernedContentEditor.svelte +409 -0
- package/dist/svelte/components/GovernedContentEditor.svelte.d.ts +35 -0
- package/dist/svelte/components/GovernedContentEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ImageThumbnail.cache.d.ts +14 -0
- package/dist/svelte/components/ImageThumbnail.cache.d.ts.map +1 -0
- package/dist/svelte/components/ImageThumbnail.cache.js +36 -0
- package/dist/svelte/components/ImageThumbnail.svelte +159 -0
- package/dist/svelte/components/ImageThumbnail.svelte.d.ts +8 -0
- package/dist/svelte/components/ImageThumbnail.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Markdown.svelte +125 -0
- package/dist/svelte/components/Markdown.svelte.d.ts +11 -0
- package/dist/svelte/components/Markdown.svelte.d.ts.map +1 -0
- package/dist/svelte/content-editor-form.d.ts +63 -0
- package/dist/svelte/content-editor-form.d.ts.map +1 -0
- package/dist/svelte/content-editor-form.js +94 -0
- package/dist/svelte/content-editor-media.d.ts +12 -0
- package/dist/svelte/content-editor-media.d.ts.map +1 -0
- package/dist/svelte/content-editor-media.js +84 -0
- package/dist/svelte/content-editor-state.svelte.d.ts +35 -0
- package/dist/svelte/content-editor-state.svelte.d.ts.map +1 -0
- package/dist/svelte/content-editor-state.svelte.js +141 -0
- package/dist/svelte/governance-manager-client.d.ts +22 -0
- package/dist/svelte/governance-manager-client.d.ts.map +1 -0
- package/dist/svelte/governance-manager-client.js +1 -0
- package/dist/svelte/i18n.contribution.d.ts +57 -0
- package/dist/svelte/i18n.contribution.d.ts.map +1 -0
- package/dist/svelte/i18n.contribution.js +64 -0
- package/dist/svelte/i18n.editor.d.ts +71 -0
- package/dist/svelte/i18n.editor.d.ts.map +1 -0
- package/dist/svelte/i18n.editor.js +87 -0
- package/dist/svelte/i18n.governance.d.ts +66 -0
- package/dist/svelte/i18n.governance.d.ts.map +1 -0
- package/dist/svelte/i18n.governance.js +66 -0
- package/dist/svelte/i18n.routes.d.ts +66 -0
- package/dist/svelte/i18n.routes.d.ts.map +1 -0
- package/dist/svelte/i18n.routes.js +75 -0
- package/dist/svelte/i18n.tools.d.ts +81 -0
- package/dist/svelte/i18n.tools.d.ts.map +1 -0
- package/dist/svelte/i18n.tools.js +90 -0
- package/dist/svelte/index.d.ts +101 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +63 -0
- package/dist/svelte/playground.d.ts +281 -0
- package/dist/svelte/playground.d.ts.map +1 -0
- package/dist/svelte/playground.js +438 -0
- package/dist/svelte/routes/ContentContributionsRoute.svelte +809 -0
- package/dist/svelte/routes/ContentContributionsRoute.svelte.d.ts +10 -0
- package/dist/svelte/routes/ContentContributionsRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/ContentFactsRoute.svelte +612 -0
- package/dist/svelte/routes/ContentFactsRoute.svelte.d.ts +11 -0
- package/dist/svelte/routes/ContentFactsRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/ContentGovernanceRoute.svelte +218 -0
- package/dist/svelte/routes/ContentGovernanceRoute.svelte.d.ts +10 -0
- package/dist/svelte/routes/ContentGovernanceRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/ContentWorkspaceRoute.svelte +431 -0
- package/dist/svelte/routes/ContentWorkspaceRoute.svelte.d.ts +12 -0
- package/dist/svelte/routes/ContentWorkspaceRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/PublishedArticleRoute.svelte +194 -0
- package/dist/svelte/routes/PublishedArticleRoute.svelte.d.ts +10 -0
- package/dist/svelte/routes/PublishedArticleRoute.svelte.d.ts.map +1 -0
- package/dist/svelte/routes/index.d.ts +8 -0
- package/dist/svelte/routes/index.d.ts.map +1 -0
- package/dist/svelte/routes/index.js +6 -0
- package/dist/svelte/routes/shared.d.ts +90 -0
- package/dist/svelte/routes/shared.d.ts.map +1 -0
- package/dist/svelte/routes/shared.js +104 -0
- package/dist/svelte/types.d.ts +69 -0
- package/dist/svelte/types.d.ts.map +1 -0
- package/dist/svelte/types.js +6 -0
- package/dist/thumbnail-generator.d.ts +174 -0
- package/dist/thumbnail-generator.d.ts.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +42 -0
- package/dist/ui.js.map +1 -0
- package/dist/utils.d.ts +18 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +119 -0
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
import { Asset } from '@happyvertical/smrt-assets';
|
|
2
|
+
import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
|
|
3
|
+
import { Fact, FactClaimSupportStatus, FactContentRelationship, FactEvidenceStatus } from '@happyvertical/smrt-facts';
|
|
4
|
+
import { Image } from '@happyvertical/smrt-images';
|
|
5
|
+
import { AssetAssociable, MetadataAccessor } from './asset-associable';
|
|
6
|
+
import { ContentBodyFormat } from './body-format';
|
|
7
|
+
import { ContentGovernanceState, ContentReviewProfileEvaluation, CreateContentVersionOptions, IssueContentCorrectionOptions, ResolvedContentGovernance, RunContentReviewOptions } from './content-governance';
|
|
8
|
+
import { ContentReview } from './content-review';
|
|
9
|
+
import { ThumbnailOptions } from './thumbnail-generator';
|
|
10
|
+
type FactAuditSourceSelector = {
|
|
11
|
+
sourceKind: string;
|
|
12
|
+
sourceId: string;
|
|
13
|
+
};
|
|
14
|
+
type FactAuditResourceRepairOptions = {
|
|
15
|
+
sources?: FactAuditSourceSelector[];
|
|
16
|
+
maxFactsPerSource?: number;
|
|
17
|
+
context?: string;
|
|
18
|
+
};
|
|
19
|
+
type FactAuditClaimRecheckOptions = {
|
|
20
|
+
claimFactIds?: string[];
|
|
21
|
+
sourceIds?: string[];
|
|
22
|
+
sources?: FactAuditSourceSelector[];
|
|
23
|
+
maxCandidateEvidence?: number;
|
|
24
|
+
};
|
|
25
|
+
type FactEvidenceStatusUpdateOptions = {
|
|
26
|
+
evidenceIds?: string[];
|
|
27
|
+
status?: FactEvidenceStatus;
|
|
28
|
+
reason?: string;
|
|
29
|
+
};
|
|
30
|
+
type FactAuditClaim = {
|
|
31
|
+
id: string | null;
|
|
32
|
+
fact: Record<string, any>;
|
|
33
|
+
supportStatus: FactClaimSupportStatus;
|
|
34
|
+
claimQuote: string | null;
|
|
35
|
+
rationale: string | null;
|
|
36
|
+
confidence: number | null;
|
|
37
|
+
relationship: string | null;
|
|
38
|
+
linkMetadata: Record<string, any>;
|
|
39
|
+
evidence: Record<string, any>[];
|
|
40
|
+
matchedFacts: Array<{
|
|
41
|
+
fact: Record<string, any>;
|
|
42
|
+
evidence: Record<string, any>[];
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
type FactAuditResourceClaim = {
|
|
46
|
+
id: string | null;
|
|
47
|
+
fact: Record<string, any>;
|
|
48
|
+
sourceKind: string | null;
|
|
49
|
+
sourceId: string | null;
|
|
50
|
+
sourceUrl: string | null;
|
|
51
|
+
sourceTitle: string | null;
|
|
52
|
+
locator: string | null;
|
|
53
|
+
quote: string | null;
|
|
54
|
+
status: FactEvidenceStatus;
|
|
55
|
+
confidence: number | null;
|
|
56
|
+
evidence: Record<string, any>[];
|
|
57
|
+
};
|
|
58
|
+
type FactAuditState = {
|
|
59
|
+
counts: Record<FactClaimSupportStatus | 'total', number>;
|
|
60
|
+
claims: FactAuditClaim[];
|
|
61
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
62
|
+
warnings: string[];
|
|
63
|
+
generatedBy: string;
|
|
64
|
+
latestAuditRunId: string | null;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Options for Content initialization
|
|
68
|
+
*/
|
|
69
|
+
export interface ContentOptions extends SmrtObjectOptions {
|
|
70
|
+
/**
|
|
71
|
+
* Content type classification
|
|
72
|
+
*/
|
|
73
|
+
type?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* Content variant for namespaced classification within types
|
|
76
|
+
* Format: generator:domain:specific-type
|
|
77
|
+
* Example: "praeco:meeting:upcoming"
|
|
78
|
+
*/
|
|
79
|
+
variant?: string | null;
|
|
80
|
+
/**
|
|
81
|
+
* Reference to file storage key
|
|
82
|
+
*/
|
|
83
|
+
fileKey?: string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Author of the content
|
|
86
|
+
*/
|
|
87
|
+
author?: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* Content title
|
|
90
|
+
*/
|
|
91
|
+
title?: string | null;
|
|
92
|
+
/**
|
|
93
|
+
* Short description or summary
|
|
94
|
+
*/
|
|
95
|
+
description?: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Main content body text
|
|
98
|
+
*/
|
|
99
|
+
body?: string | null;
|
|
100
|
+
/**
|
|
101
|
+
* Stored body format.
|
|
102
|
+
*/
|
|
103
|
+
bodyFormat?: ContentBodyFormat | null;
|
|
104
|
+
/**
|
|
105
|
+
* Date when content was published
|
|
106
|
+
*/
|
|
107
|
+
publish_date?: Date | null;
|
|
108
|
+
/**
|
|
109
|
+
* URL source of the content
|
|
110
|
+
*/
|
|
111
|
+
url?: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Original source identifier
|
|
114
|
+
*/
|
|
115
|
+
source?: string | null;
|
|
116
|
+
/**
|
|
117
|
+
* Publication status
|
|
118
|
+
*/
|
|
119
|
+
status?: 'published' | 'draft' | 'review' | 'archived' | 'deleted' | null;
|
|
120
|
+
/**
|
|
121
|
+
* Content state flag
|
|
122
|
+
*/
|
|
123
|
+
state?: 'deprecated' | 'active' | 'highlighted' | null;
|
|
124
|
+
/**
|
|
125
|
+
* Original URL of the content
|
|
126
|
+
*/
|
|
127
|
+
original_url?: string | null;
|
|
128
|
+
/**
|
|
129
|
+
* Content language
|
|
130
|
+
*/
|
|
131
|
+
language?: string | null;
|
|
132
|
+
/**
|
|
133
|
+
* Content tags
|
|
134
|
+
*/
|
|
135
|
+
tags?: string[];
|
|
136
|
+
/**
|
|
137
|
+
* Hierarchical category path for URL routing
|
|
138
|
+
* Format: 'parent/child' (e.g., 'politics/local')
|
|
139
|
+
* Each content belongs to exactly ONE category
|
|
140
|
+
*/
|
|
141
|
+
category?: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* Additional metadata
|
|
144
|
+
*/
|
|
145
|
+
metadata?: Record<string, any>;
|
|
146
|
+
/**
|
|
147
|
+
* ID of the thumbnail asset for this content
|
|
148
|
+
*/
|
|
149
|
+
thumbnailAssetId?: string | null;
|
|
150
|
+
/**
|
|
151
|
+
* Transient reference IDs used by editors and API payloads.
|
|
152
|
+
* These are synchronized into ContentReference links during save.
|
|
153
|
+
*/
|
|
154
|
+
referenceIds?: string[];
|
|
155
|
+
/**
|
|
156
|
+
* Transient asset IDs used by editors and API payloads.
|
|
157
|
+
*/
|
|
158
|
+
assetIds?: string[];
|
|
159
|
+
/**
|
|
160
|
+
* Tenant ID for multi-tenant isolation
|
|
161
|
+
*/
|
|
162
|
+
tenantId?: string | null;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Structured content object with metadata and body text
|
|
166
|
+
*
|
|
167
|
+
* Content represents any text-based content with metadata such as
|
|
168
|
+
* title, author, description, and publishing information. It supports
|
|
169
|
+
* referencing related content objects.
|
|
170
|
+
*/
|
|
171
|
+
export declare class Content extends SmrtObject implements AssetAssociable, MetadataAccessor {
|
|
172
|
+
/**
|
|
173
|
+
* Tenant ID for multi-tenant isolation
|
|
174
|
+
* Nullable to support both tenant-scoped and global content
|
|
175
|
+
*/
|
|
176
|
+
tenantId: string | null;
|
|
177
|
+
/**
|
|
178
|
+
* Array of referenced content objects
|
|
179
|
+
*/
|
|
180
|
+
protected references: Content[];
|
|
181
|
+
/**
|
|
182
|
+
* Content type classification
|
|
183
|
+
*/
|
|
184
|
+
type: string | null;
|
|
185
|
+
/**
|
|
186
|
+
* Content variant for namespaced classification within types
|
|
187
|
+
* Format: generator:domain:specific-type
|
|
188
|
+
* Example: "praeco:meeting:upcoming"
|
|
189
|
+
*/
|
|
190
|
+
variant: string | null;
|
|
191
|
+
/**
|
|
192
|
+
* Reference to file storage key
|
|
193
|
+
*/
|
|
194
|
+
fileKey: string | null;
|
|
195
|
+
/**
|
|
196
|
+
* Author of the content
|
|
197
|
+
*/
|
|
198
|
+
author: string | null;
|
|
199
|
+
/**
|
|
200
|
+
* Human-readable name for SMRT framework compatibility
|
|
201
|
+
*/
|
|
202
|
+
name: string;
|
|
203
|
+
/**
|
|
204
|
+
* Content title
|
|
205
|
+
*/
|
|
206
|
+
title: string;
|
|
207
|
+
/**
|
|
208
|
+
* Short description or summary
|
|
209
|
+
*/
|
|
210
|
+
description: string | null;
|
|
211
|
+
/**
|
|
212
|
+
* Main content body text
|
|
213
|
+
*/
|
|
214
|
+
body: string;
|
|
215
|
+
/**
|
|
216
|
+
* Format used to persist the body field.
|
|
217
|
+
*/
|
|
218
|
+
bodyFormat: ContentBodyFormat | null;
|
|
219
|
+
/**
|
|
220
|
+
* Date when content was published
|
|
221
|
+
*/
|
|
222
|
+
publish_date: Date | null;
|
|
223
|
+
/**
|
|
224
|
+
* URL source of the content
|
|
225
|
+
*/
|
|
226
|
+
url: string | null;
|
|
227
|
+
/**
|
|
228
|
+
* Original source identifier
|
|
229
|
+
*/
|
|
230
|
+
source: string | null;
|
|
231
|
+
/**
|
|
232
|
+
* Original URL of the content
|
|
233
|
+
*/
|
|
234
|
+
original_url: string | null;
|
|
235
|
+
/**
|
|
236
|
+
* Content language
|
|
237
|
+
*/
|
|
238
|
+
language: string | null;
|
|
239
|
+
/**
|
|
240
|
+
* Content tags
|
|
241
|
+
*/
|
|
242
|
+
tags: string[];
|
|
243
|
+
/**
|
|
244
|
+
* Hierarchical category path for URL routing
|
|
245
|
+
* Format: 'parent/child' (e.g., 'politics/local')
|
|
246
|
+
* Each content belongs to exactly ONE category
|
|
247
|
+
*/
|
|
248
|
+
category: string | null;
|
|
249
|
+
/**
|
|
250
|
+
* Publication status
|
|
251
|
+
*/
|
|
252
|
+
status: 'published' | 'draft' | 'review' | 'archived' | 'deleted';
|
|
253
|
+
/**
|
|
254
|
+
* Content state flag
|
|
255
|
+
*/
|
|
256
|
+
state: 'deprecated' | 'active' | 'highlighted';
|
|
257
|
+
/**
|
|
258
|
+
* Additional JSON metadata for flexible schema extension
|
|
259
|
+
*/
|
|
260
|
+
metadata: Record<string, any>;
|
|
261
|
+
/**
|
|
262
|
+
* ID of the thumbnail asset for this content
|
|
263
|
+
*/
|
|
264
|
+
thumbnailAssetId: string | null;
|
|
265
|
+
/**
|
|
266
|
+
* Creates a new Content instance
|
|
267
|
+
*/
|
|
268
|
+
constructor(options?: ContentOptions);
|
|
269
|
+
/**
|
|
270
|
+
* Initializes this content object
|
|
271
|
+
*
|
|
272
|
+
* @returns Promise that resolves to this instance
|
|
273
|
+
*/
|
|
274
|
+
initialize(): Promise<this>;
|
|
275
|
+
protected validateBeforeSave(): Promise<void>;
|
|
276
|
+
save(): Promise<this>;
|
|
277
|
+
private getReferenceCollection;
|
|
278
|
+
private getFactCollection;
|
|
279
|
+
private getFactContentCollection;
|
|
280
|
+
private getFactSourceCollection;
|
|
281
|
+
private getFactEvidenceCollection;
|
|
282
|
+
private getContentVersionCollection;
|
|
283
|
+
private getContentReviewCollection;
|
|
284
|
+
private getContentCorrectionCollection;
|
|
285
|
+
private getContentsCollection;
|
|
286
|
+
private getConfiguredGovernance;
|
|
287
|
+
resolveGovernance(): Promise<ResolvedContentGovernance>;
|
|
288
|
+
private hasPersistedGovernanceAssignments;
|
|
289
|
+
private resolvePublicationGovernance;
|
|
290
|
+
private requireGovernance;
|
|
291
|
+
private requireFactLinking;
|
|
292
|
+
private getPersistedContent;
|
|
293
|
+
private buildReviewFingerprint;
|
|
294
|
+
private buildTransparencySnapshot;
|
|
295
|
+
private buildPublicationSnapshotFingerprint;
|
|
296
|
+
private getLatestPublicationSnapshotFingerprint;
|
|
297
|
+
private buildCorrectionDraftSnapshot;
|
|
298
|
+
private getAssetCollection;
|
|
299
|
+
private getContentAssetCollection;
|
|
300
|
+
private getContentAssetLinks;
|
|
301
|
+
private resolveAssetsForLinks;
|
|
302
|
+
private resolveReferenceTarget;
|
|
303
|
+
/**
|
|
304
|
+
* Loads referenced content objects
|
|
305
|
+
*
|
|
306
|
+
* @returns Promise that resolves when references are loaded
|
|
307
|
+
*/
|
|
308
|
+
loadReferences(): Promise<void>;
|
|
309
|
+
private getPendingReferenceIds;
|
|
310
|
+
private getPendingAssetIds;
|
|
311
|
+
private syncPendingReferenceIds;
|
|
312
|
+
private syncPendingAssetIds;
|
|
313
|
+
/**
|
|
314
|
+
* Adds a reference to another content object.
|
|
315
|
+
*
|
|
316
|
+
* @param content - Content object or URL to reference
|
|
317
|
+
* @param options.targetVersion - Optional ContentVersion.version to pin the
|
|
318
|
+
* citation to. Pass the target's current version (typically the latest
|
|
319
|
+
* publication) to enable drift detection later. Pass `null` or omit to
|
|
320
|
+
* leave the reference untracked.
|
|
321
|
+
* @returns Promise that resolves when the reference is added
|
|
322
|
+
*/
|
|
323
|
+
addReference(content: Content | string, options?: {
|
|
324
|
+
targetVersion?: number | null;
|
|
325
|
+
}): Promise<void>;
|
|
326
|
+
/**
|
|
327
|
+
* Removes a reference to another content object
|
|
328
|
+
*
|
|
329
|
+
* @param targetId - ID of the referenced content to remove
|
|
330
|
+
*/
|
|
331
|
+
removeReference(targetId: string): Promise<void>;
|
|
332
|
+
/**
|
|
333
|
+
* Gets all referenced content objects
|
|
334
|
+
*
|
|
335
|
+
* @returns Promise resolving to an array of referenced Content objects
|
|
336
|
+
*/
|
|
337
|
+
getReferences(): Promise<Content[]>;
|
|
338
|
+
/**
|
|
339
|
+
* Returns one entry per reference edge with the pinned `targetVersion` and
|
|
340
|
+
* the target's latest version. Drift exists when both are present and
|
|
341
|
+
* differ — callers can use this to surface "the source you cited has been
|
|
342
|
+
* updated" affordances in editors or review tools.
|
|
343
|
+
*
|
|
344
|
+
* `currentVersion` is sourced from `getLatestForContent`, which returns
|
|
345
|
+
* the most recent `ContentVersion` of **any kind** (manual or publication).
|
|
346
|
+
* Consumers that only care about published drift should filter the result
|
|
347
|
+
* by loading the matching `ContentVersion` and inspecting `kind`.
|
|
348
|
+
*
|
|
349
|
+
* Unpinned references (`citedVersion === null`) are included with
|
|
350
|
+
* `currentVersion` populated when available so callers can choose to
|
|
351
|
+
* surface them as "pinnable" suggestions.
|
|
352
|
+
*/
|
|
353
|
+
getReferenceDrift(): Promise<Array<{
|
|
354
|
+
targetId: string;
|
|
355
|
+
citedVersion: number | null;
|
|
356
|
+
currentVersion: number | null;
|
|
357
|
+
isDrifted: boolean;
|
|
358
|
+
}>>;
|
|
359
|
+
isGoverned(): boolean;
|
|
360
|
+
getFactLinks(options?: {
|
|
361
|
+
relationship?: FactContentRelationship;
|
|
362
|
+
}): Promise<import('@happyvertical/smrt-facts').FactContent[]>;
|
|
363
|
+
getFacts(options?: {
|
|
364
|
+
relationship?: FactContentRelationship;
|
|
365
|
+
includeSuperseded?: boolean;
|
|
366
|
+
latestOnly?: boolean;
|
|
367
|
+
}): Promise<Fact[]>;
|
|
368
|
+
addFact(fact: Fact | string, relationship?: FactContentRelationship, metadata?: Record<string, any>): Promise<import('@happyvertical/smrt-facts').FactContent>;
|
|
369
|
+
removeFact(factId: string, relationship?: FactContentRelationship): Promise<void>;
|
|
370
|
+
syncFacts(factIds: string[], relationship?: FactContentRelationship): Promise<{
|
|
371
|
+
added: string[];
|
|
372
|
+
kept: string[];
|
|
373
|
+
removed: string[];
|
|
374
|
+
}>;
|
|
375
|
+
browseFacts(query?: string, options?: {
|
|
376
|
+
limit?: number;
|
|
377
|
+
offset?: number;
|
|
378
|
+
minSimilarity?: number;
|
|
379
|
+
includeSuperseded?: boolean;
|
|
380
|
+
latestOnly?: boolean;
|
|
381
|
+
}): Promise<Fact[]>;
|
|
382
|
+
private getFactAuditSourceMaterials;
|
|
383
|
+
private factMatchesTenant;
|
|
384
|
+
private findExactArticleClaimFact;
|
|
385
|
+
private safeAuditLink;
|
|
386
|
+
private clearGeneratedFactAudit;
|
|
387
|
+
private clearGeneratedFactSourcesForSources;
|
|
388
|
+
private extractReferenceFactsForAudit;
|
|
389
|
+
private getCurrentFactAuditSupportCandidates;
|
|
390
|
+
repairFactAudit(options?: {
|
|
391
|
+
maxReferenceFactsPerSource?: number;
|
|
392
|
+
maxArticleClaims?: number;
|
|
393
|
+
context?: string;
|
|
394
|
+
}): Promise<{
|
|
395
|
+
repair: {
|
|
396
|
+
auditRunId: string;
|
|
397
|
+
claimsExtracted: number;
|
|
398
|
+
referenceFactsExtracted: number;
|
|
399
|
+
warnings: string[];
|
|
400
|
+
};
|
|
401
|
+
counts: Record<FactClaimSupportStatus | "total", number>;
|
|
402
|
+
claims: FactAuditClaim[];
|
|
403
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
404
|
+
warnings: string[];
|
|
405
|
+
generatedBy: string;
|
|
406
|
+
latestAuditRunId: string | null;
|
|
407
|
+
}>;
|
|
408
|
+
repairFactAuditAction(options?: {
|
|
409
|
+
maxReferenceFactsPerSource?: number;
|
|
410
|
+
maxArticleClaims?: number;
|
|
411
|
+
context?: string;
|
|
412
|
+
}): Promise<{
|
|
413
|
+
repair: {
|
|
414
|
+
auditRunId: string;
|
|
415
|
+
claimsExtracted: number;
|
|
416
|
+
referenceFactsExtracted: number;
|
|
417
|
+
warnings: string[];
|
|
418
|
+
};
|
|
419
|
+
counts: Record<FactClaimSupportStatus | "total", number>;
|
|
420
|
+
claims: FactAuditClaim[];
|
|
421
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
422
|
+
warnings: string[];
|
|
423
|
+
generatedBy: string;
|
|
424
|
+
latestAuditRunId: string | null;
|
|
425
|
+
}>;
|
|
426
|
+
repairFactEvidence(options?: FactAuditResourceRepairOptions): Promise<{
|
|
427
|
+
evidenceRepair: {
|
|
428
|
+
auditRunId: string;
|
|
429
|
+
referenceFactsExtracted: number;
|
|
430
|
+
repairedSources: {
|
|
431
|
+
sourceKind: string;
|
|
432
|
+
sourceId: string;
|
|
433
|
+
sourceTitle: string;
|
|
434
|
+
}[];
|
|
435
|
+
deletedEvidenceIds: string[];
|
|
436
|
+
deletedSourceIds: string[];
|
|
437
|
+
warnings: string[];
|
|
438
|
+
};
|
|
439
|
+
counts: Record<FactClaimSupportStatus | "total", number>;
|
|
440
|
+
claims: FactAuditClaim[];
|
|
441
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
442
|
+
warnings: string[];
|
|
443
|
+
generatedBy: string;
|
|
444
|
+
latestAuditRunId: string | null;
|
|
445
|
+
}>;
|
|
446
|
+
repairFactEvidenceAction(options?: FactAuditResourceRepairOptions): Promise<{
|
|
447
|
+
evidenceRepair: {
|
|
448
|
+
auditRunId: string;
|
|
449
|
+
referenceFactsExtracted: number;
|
|
450
|
+
repairedSources: {
|
|
451
|
+
sourceKind: string;
|
|
452
|
+
sourceId: string;
|
|
453
|
+
sourceTitle: string;
|
|
454
|
+
}[];
|
|
455
|
+
deletedEvidenceIds: string[];
|
|
456
|
+
deletedSourceIds: string[];
|
|
457
|
+
warnings: string[];
|
|
458
|
+
};
|
|
459
|
+
counts: Record<FactClaimSupportStatus | "total", number>;
|
|
460
|
+
claims: FactAuditClaim[];
|
|
461
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
462
|
+
warnings: string[];
|
|
463
|
+
generatedBy: string;
|
|
464
|
+
latestAuditRunId: string | null;
|
|
465
|
+
}>;
|
|
466
|
+
private clearGeneratedSupportLinksForClaim;
|
|
467
|
+
recheckFactClaims(options?: FactAuditClaimRecheckOptions): Promise<{
|
|
468
|
+
claimRecheck: {
|
|
469
|
+
auditRunId: string;
|
|
470
|
+
recheckedClaims: number;
|
|
471
|
+
candidateFacts: number;
|
|
472
|
+
candidateEvidence: number;
|
|
473
|
+
warnings: string[];
|
|
474
|
+
};
|
|
475
|
+
counts: Record<FactClaimSupportStatus | "total", number>;
|
|
476
|
+
claims: FactAuditClaim[];
|
|
477
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
478
|
+
warnings: string[];
|
|
479
|
+
generatedBy: string;
|
|
480
|
+
latestAuditRunId: string | null;
|
|
481
|
+
}>;
|
|
482
|
+
recheckFactClaimsAction(options?: FactAuditClaimRecheckOptions): Promise<{
|
|
483
|
+
claimRecheck: {
|
|
484
|
+
auditRunId: string;
|
|
485
|
+
recheckedClaims: number;
|
|
486
|
+
candidateFacts: number;
|
|
487
|
+
candidateEvidence: number;
|
|
488
|
+
warnings: string[];
|
|
489
|
+
};
|
|
490
|
+
counts: Record<FactClaimSupportStatus | "total", number>;
|
|
491
|
+
claims: FactAuditClaim[];
|
|
492
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
493
|
+
warnings: string[];
|
|
494
|
+
generatedBy: string;
|
|
495
|
+
latestAuditRunId: string | null;
|
|
496
|
+
}>;
|
|
497
|
+
updateFactEvidenceStatus(options?: FactEvidenceStatusUpdateOptions): Promise<{
|
|
498
|
+
evidenceStatusUpdate: {
|
|
499
|
+
status: FactEvidenceStatus;
|
|
500
|
+
requestedEvidenceIds: string[];
|
|
501
|
+
updatedEvidenceIds: string[];
|
|
502
|
+
skippedEvidenceIds: string[];
|
|
503
|
+
};
|
|
504
|
+
counts: Record<FactClaimSupportStatus | "total", number>;
|
|
505
|
+
claims: FactAuditClaim[];
|
|
506
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
507
|
+
warnings: string[];
|
|
508
|
+
generatedBy: string;
|
|
509
|
+
latestAuditRunId: string | null;
|
|
510
|
+
}>;
|
|
511
|
+
updateFactEvidenceStatusAction(options?: FactEvidenceStatusUpdateOptions): Promise<{
|
|
512
|
+
evidenceStatusUpdate: {
|
|
513
|
+
status: FactEvidenceStatus;
|
|
514
|
+
requestedEvidenceIds: string[];
|
|
515
|
+
updatedEvidenceIds: string[];
|
|
516
|
+
skippedEvidenceIds: string[];
|
|
517
|
+
};
|
|
518
|
+
counts: Record<FactClaimSupportStatus | "total", number>;
|
|
519
|
+
claims: FactAuditClaim[];
|
|
520
|
+
resourceClaims: FactAuditResourceClaim[];
|
|
521
|
+
warnings: string[];
|
|
522
|
+
generatedBy: string;
|
|
523
|
+
latestAuditRunId: string | null;
|
|
524
|
+
}>;
|
|
525
|
+
getFactAuditState(): Promise<FactAuditState>;
|
|
526
|
+
getFactAuditStateAction(): Promise<FactAuditState>;
|
|
527
|
+
getFactsState(options?: {
|
|
528
|
+
relationship?: FactContentRelationship;
|
|
529
|
+
}): Promise<{
|
|
530
|
+
factIds: any[];
|
|
531
|
+
facts: {
|
|
532
|
+
metadata: any;
|
|
533
|
+
}[];
|
|
534
|
+
factLinks: {
|
|
535
|
+
metadata: any;
|
|
536
|
+
}[];
|
|
537
|
+
}>;
|
|
538
|
+
syncFactsState(options?: {
|
|
539
|
+
factIds?: string[];
|
|
540
|
+
relationship?: FactContentRelationship;
|
|
541
|
+
}): Promise<{
|
|
542
|
+
sync: {
|
|
543
|
+
added: string[];
|
|
544
|
+
kept: string[];
|
|
545
|
+
removed: string[];
|
|
546
|
+
};
|
|
547
|
+
factIds: any[];
|
|
548
|
+
facts: {
|
|
549
|
+
metadata: any;
|
|
550
|
+
}[];
|
|
551
|
+
factLinks: {
|
|
552
|
+
metadata: any;
|
|
553
|
+
}[];
|
|
554
|
+
}>;
|
|
555
|
+
createVersion(options?: CreateContentVersionOptions): Promise<import('./content-version').ContentVersion>;
|
|
556
|
+
getVersions(): Promise<import('./content-version').ContentVersion[]>;
|
|
557
|
+
restoreFromVersion(versionNumber: number): Promise<Content>;
|
|
558
|
+
getReviews(kind?: RunContentReviewOptions['kind']): Promise<ContentReview[]>;
|
|
559
|
+
listReviews(options?: {
|
|
560
|
+
kind?: RunContentReviewOptions['kind'];
|
|
561
|
+
}): Promise<{
|
|
562
|
+
findings: any;
|
|
563
|
+
metadata: any;
|
|
564
|
+
}[]>;
|
|
565
|
+
getReviewRequirements(profileKey: string, governance?: ResolvedContentGovernance): Promise<import('./content-governance').ContentReviewRequirement[]>;
|
|
566
|
+
getGovernanceState(): Promise<ContentGovernanceState>;
|
|
567
|
+
getGovernanceStateAction(): Promise<ContentGovernanceState>;
|
|
568
|
+
listReviewProfilesAction(): Promise<ContentReviewProfileEvaluation[]>;
|
|
569
|
+
evaluateReviewProfile(profileKey: string): Promise<ContentReviewProfileEvaluation>;
|
|
570
|
+
evaluateReviewProfileAction(options?: {
|
|
571
|
+
profileKey?: string;
|
|
572
|
+
}): Promise<ContentReviewProfileEvaluation>;
|
|
573
|
+
isReadyForReviewProfile(profileKey: string): Promise<boolean>;
|
|
574
|
+
getPublishedTransparency(): Promise<import('./content-transparency').ContentTransparencyData | null>;
|
|
575
|
+
getPublishedTransparencyAction(): Promise<import('./content-transparency').ContentTransparencyData | null>;
|
|
576
|
+
previewTransparency(): Promise<import('./content-transparency').ContentTransparencyData | null>;
|
|
577
|
+
previewTransparencyAction(): Promise<import('./content-transparency').ContentTransparencyData | null>;
|
|
578
|
+
runReview(options?: RunContentReviewOptions): Promise<ContentReview>;
|
|
579
|
+
runReviewAction(options?: RunContentReviewOptions): Promise<{
|
|
580
|
+
findings: any;
|
|
581
|
+
metadata: any;
|
|
582
|
+
}>;
|
|
583
|
+
reviewFacts(options?: Omit<RunContentReviewOptions, 'kind'>): Promise<ContentReview>;
|
|
584
|
+
reviewSafety(options?: Omit<RunContentReviewOptions, 'kind'>): Promise<ContentReview>;
|
|
585
|
+
getCorrections(): Promise<import('./content-correction').ContentCorrection[]>;
|
|
586
|
+
listCorrections(): Promise<{
|
|
587
|
+
metadata: any;
|
|
588
|
+
}[]>;
|
|
589
|
+
issueCorrection(options: IssueContentCorrectionOptions): Promise<import('./content-correction').ContentCorrection>;
|
|
590
|
+
issueCorrectionAction(options: IssueContentCorrectionOptions): Promise<{
|
|
591
|
+
metadata: any;
|
|
592
|
+
}>;
|
|
593
|
+
listVersions(): Promise<{
|
|
594
|
+
snapshot: any;
|
|
595
|
+
metadata: any;
|
|
596
|
+
}[]>;
|
|
597
|
+
mutateVersionAction(options?: CreateContentVersionOptions & {
|
|
598
|
+
action?: string;
|
|
599
|
+
versionNumber?: number | string;
|
|
600
|
+
}): Promise<{
|
|
601
|
+
snapshot: any;
|
|
602
|
+
metadata: any;
|
|
603
|
+
} | {
|
|
604
|
+
referenceIds: any;
|
|
605
|
+
references: any;
|
|
606
|
+
assetIds: any;
|
|
607
|
+
assets: any;
|
|
608
|
+
}>;
|
|
609
|
+
/**
|
|
610
|
+
* Note: toJSON() is inherited from SmrtObject
|
|
611
|
+
*
|
|
612
|
+
* The parent implementation handles:
|
|
613
|
+
* - STI discriminator (_meta_type) for polymorphic queries
|
|
614
|
+
* - Meta field extraction (_meta_data) for child-specific fields
|
|
615
|
+
* - Automatic serialization of all fields from manifest
|
|
616
|
+
*
|
|
617
|
+
* DO NOT override toJSON() unless you call super.toJSON() first.
|
|
618
|
+
* See issue #377 for details on why this override was removed.
|
|
619
|
+
*/
|
|
620
|
+
/**
|
|
621
|
+
* Get category segments as array
|
|
622
|
+
* @example 'politics/local' -> ['politics', 'local']
|
|
623
|
+
*/
|
|
624
|
+
getCategorySegments(): string[];
|
|
625
|
+
/**
|
|
626
|
+
* Get parent category path
|
|
627
|
+
* @example 'politics/local/town' -> 'politics/local'
|
|
628
|
+
* @example 'politics' -> null
|
|
629
|
+
*/
|
|
630
|
+
getParentCategory(): string | null;
|
|
631
|
+
/**
|
|
632
|
+
* Get root (top-level) category
|
|
633
|
+
* @example 'politics/local/town' -> 'politics'
|
|
634
|
+
*/
|
|
635
|
+
getRootCategory(): string | null;
|
|
636
|
+
/**
|
|
637
|
+
* Get all ancestor category paths (for breadcrumbs)
|
|
638
|
+
* @example 'politics/local' -> ['politics', 'politics/local']
|
|
639
|
+
*/
|
|
640
|
+
getAncestorPaths(): string[];
|
|
641
|
+
/**
|
|
642
|
+
* Check if content belongs to a category (optionally including subcategories)
|
|
643
|
+
* @param categoryPath - Category to check
|
|
644
|
+
* @param includeChildren - If true, matches 'politics' for content in 'politics/local'
|
|
645
|
+
*/
|
|
646
|
+
isInCategory(categoryPath: string, includeChildren?: boolean): boolean;
|
|
647
|
+
/**
|
|
648
|
+
* Get all assets associated with this content
|
|
649
|
+
* @param relationship - Optional filter by relationship type (e.g., 'thumbnail', 'attachment')
|
|
650
|
+
* @returns Promise resolving to array of assets
|
|
651
|
+
*/
|
|
652
|
+
getAssets(relationship?: string): Promise<Asset[]>;
|
|
653
|
+
/**
|
|
654
|
+
* Add an asset to this content with a relationship type
|
|
655
|
+
* @param asset - The asset to associate
|
|
656
|
+
* @param relationship - Relationship type (e.g., 'thumbnail', 'attachment', 'inline')
|
|
657
|
+
* @param sortOrder - Optional sort order for display
|
|
658
|
+
*/
|
|
659
|
+
addAsset(asset: Asset, relationship?: string, sortOrder?: number): Promise<void>;
|
|
660
|
+
/**
|
|
661
|
+
* Remove an asset from this content
|
|
662
|
+
* @param assetId - ID of the asset to remove
|
|
663
|
+
* @param relationship - Optional specific relationship to remove (removes all if not specified)
|
|
664
|
+
*/
|
|
665
|
+
removeAsset(assetId: string, relationship?: string): Promise<void>;
|
|
666
|
+
/**
|
|
667
|
+
* Get the full metadata record. Always returns a plain object — never
|
|
668
|
+
* `null`, never an array — so callers can safely read nested keys without
|
|
669
|
+
* defensive checks.
|
|
670
|
+
*
|
|
671
|
+
* Pure read with no side-effect on `this.metadata`: if the field is
|
|
672
|
+
* currently `null` (e.g. fresh from the DB) or non-record-shaped, an
|
|
673
|
+
* empty object is returned but the field is **not** mutated. This avoids
|
|
674
|
+
* accidentally marking the object dirty during a read, which would
|
|
675
|
+
* otherwise cause SmrtObject's save lifecycle to write `{}` back over a
|
|
676
|
+
* NULL column on the next save. Callers that want to normalise the
|
|
677
|
+
* stored field should use {@link Content.setMetadata}.
|
|
678
|
+
*/
|
|
679
|
+
getMetadata(): Record<string, any>;
|
|
680
|
+
/**
|
|
681
|
+
* Replace the full metadata record. Passing `null`/`undefined` (or any
|
|
682
|
+
* non-record value such as an array) clears it to an empty object so
|
|
683
|
+
* downstream readers can rely on the field always being a plain object.
|
|
684
|
+
*/
|
|
685
|
+
setMetadata(metadata: Record<string, any> | null | undefined): void;
|
|
686
|
+
/**
|
|
687
|
+
* Shallow-merge a patch over the current metadata. Returns the resulting
|
|
688
|
+
* record so callers can chain reads without re-reading the field. Unlike
|
|
689
|
+
* {@link Content.getMetadata}, this method does intentionally write back
|
|
690
|
+
* to `this.metadata` because the merge is a write.
|
|
691
|
+
*/
|
|
692
|
+
updateMetadata(patch: Partial<Record<string, any>>): Record<string, any>;
|
|
693
|
+
/**
|
|
694
|
+
* Get the thumbnail image for this content
|
|
695
|
+
* @returns Promise resolving to the thumbnail Image or null
|
|
696
|
+
*/
|
|
697
|
+
getThumbnail(): Promise<Image | null>;
|
|
698
|
+
/**
|
|
699
|
+
* Set the thumbnail image for this content
|
|
700
|
+
* @param image - The image to set as thumbnail
|
|
701
|
+
*/
|
|
702
|
+
setThumbnail(image: Image): Promise<void>;
|
|
703
|
+
/**
|
|
704
|
+
* Generate a thumbnail for this content using the specified strategy
|
|
705
|
+
*
|
|
706
|
+
* @param options - Thumbnail generation options including strategy
|
|
707
|
+
* @returns Promise resolving to the generated Image
|
|
708
|
+
*
|
|
709
|
+
* @example Headline card thumbnail
|
|
710
|
+
* ```typescript
|
|
711
|
+
* const thumbnail = await content.generateThumbnail({
|
|
712
|
+
* strategy: 'headline-card',
|
|
713
|
+
* brandColor: '#1a56db',
|
|
714
|
+
* logoUrl: 'https://example.com/logo.png'
|
|
715
|
+
* });
|
|
716
|
+
* ```
|
|
717
|
+
*
|
|
718
|
+
* @example Static map thumbnail (requires metadata.latitude/longitude)
|
|
719
|
+
* ```typescript
|
|
720
|
+
* const thumbnail = await content.generateThumbnail({
|
|
721
|
+
* strategy: 'static-map',
|
|
722
|
+
* mapProvider: 'mapbox'
|
|
723
|
+
* });
|
|
724
|
+
* ```
|
|
725
|
+
*
|
|
726
|
+
* @example AI-generated thumbnail
|
|
727
|
+
* ```typescript
|
|
728
|
+
* const thumbnail = await content.generateThumbnail({
|
|
729
|
+
* strategy: 'ai-generate'
|
|
730
|
+
* });
|
|
731
|
+
* ```
|
|
732
|
+
*/
|
|
733
|
+
generateThumbnail(options: ThumbnailOptions): Promise<Image>;
|
|
734
|
+
}
|
|
735
|
+
export {};
|
|
736
|
+
//# sourceMappingURL=content.d.ts.map
|