@scalemule/news-publication 0.0.80 → 0.0.82

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.
@@ -3,6 +3,13 @@ import { A as ArticleFormat, b as ArticleLayout } from './article-presentation-0
3
3
  /** Check rendered image tags, not a URL mentioned only in serialized page data. */
4
4
  declare function articlePhotoHtmlMatches(html: string, lead: string | string[], social: string): boolean;
5
5
 
6
+ /** Requires visible body and actual card asides; serialized page data is not delivery. */
7
+ declare function articleEditHtmlMatches(html: string, expected: {
8
+ title: string;
9
+ content_html: string;
10
+ card_titles: string[];
11
+ }): boolean;
12
+
6
13
  type PhotoOperationCheckpoint = {
7
14
  version: 1;
8
15
  identity: string;
@@ -41,10 +48,51 @@ declare class ArticlePhotoOperationError extends Error {
41
48
  constructor(code: string, stage: string, message: string, fileId?: string | undefined, status?: number | undefined);
42
49
  }
43
50
 
51
+ type ArticleEditPatch = Partial<Pick<ArticleDocument, "title" | "subtitle" | "content_markdown" | "excerpt" | "section" | "community" | "format" | "layout" | "cards" | "citations">>;
52
+ type ArticleEditCheckpoint = {
53
+ version: 1;
54
+ identity: string;
55
+ articleId: string;
56
+ stage: string;
57
+ expectedGeneration?: number;
58
+ document?: ArticleDocument;
59
+ revisionId?: string;
60
+ savedGeneration?: number;
61
+ unchanged?: boolean;
62
+ sourceIdentity?: {
63
+ slug: string;
64
+ published_at: string | null;
65
+ canonical_url: string | null;
66
+ };
67
+ };
68
+ type ArticleEditInput = {
69
+ articleId: string;
70
+ operationKey: string;
71
+ patch: ArticleEditPatch;
72
+ expectedGeneration?: number;
73
+ /** Explicit legacy onboarding only. Existing policies are never changed. */
74
+ enableReviewPolicy?: "NONE" | "FACT_CHECK" | "CONTRIBUTOR_REVIEW" | "SUBJECT_APPROVAL_REQUIRED" | "SUBJECT_APPROVAL_PLUS_EDITOR";
75
+ /** Execute RELEASE under the caller's grants. Does not issue APPROVE. */
76
+ release?: boolean;
77
+ checkpoint?: ArticleEditCheckpoint;
78
+ saveCheckpoint: (checkpoint: ArticleEditCheckpoint) => Promise<void>;
79
+ timeoutMs?: number;
80
+ };
81
+ declare class ArticleEditOperationError extends Error {
82
+ code: string;
83
+ stage: string;
84
+ status?: number | undefined;
85
+ revisionId?: string | undefined;
86
+ constructor(code: string, stage: string, message: string, status?: number | undefined, revisionId?: string | undefined);
87
+ }
88
+
44
89
  type ArticleDocument = {
45
90
  title: string;
46
91
  subtitle?: string;
47
92
  content_markdown: string;
93
+ excerpt?: string;
94
+ cards?: unknown[];
95
+ citations?: unknown[];
48
96
  section: string;
49
97
  community?: string;
50
98
  format?: ArticleFormat;
@@ -64,13 +112,13 @@ type ArticleMedia = {
64
112
  position: "hero" | "inline" | "gallery" | "attachment";
65
113
  };
66
114
  type AssetMetadata = {
67
- caption: string;
68
- credit: string;
69
- alt: string;
70
- creator: string;
71
- who_is_pictured: string;
72
- when_taken: string;
73
- where_taken: string;
115
+ caption?: string;
116
+ credit?: string;
117
+ alt?: string;
118
+ creator?: string;
119
+ who_is_pictured?: string;
120
+ when_taken?: string;
121
+ where_taken?: string;
74
122
  rights_confirmed: boolean;
75
123
  private_preview_only?: boolean;
76
124
  };
@@ -146,6 +194,9 @@ type ArticleWorkflowOptions = {
146
194
  automatic_public_narration?: boolean;
147
195
  prioritized_narration_processing?: boolean;
148
196
  content_first_editor_document?: boolean;
197
+ versioned_editorial_fields?: boolean;
198
+ managed_submission_version?: number | null;
199
+ multipart_submission?: boolean;
149
200
  };
150
201
  };
151
202
  type ArticleOperation = {
@@ -175,6 +226,56 @@ type Record = {
175
226
  };
176
227
  }[];
177
228
  };
229
+ type ArticleSubmissionManifest = {
230
+ article: {
231
+ operation: "create";
232
+ author_profile_id: string;
233
+ document: ArticleDocument;
234
+ review_policy?: string;
235
+ celebration_type?: string;
236
+ } | {
237
+ operation: "save";
238
+ article_id: string;
239
+ expected_generation: number;
240
+ document: ArticleDocument;
241
+ reason: string;
242
+ };
243
+ intent?: "draft" | "review" | "publish";
244
+ approve_media?: boolean;
245
+ sensitivity_review?: {
246
+ policy_version: string;
247
+ rule_ids: string[];
248
+ reason: string;
249
+ };
250
+ assets?: {
251
+ slot: string;
252
+ position: "hero" | "gallery" | "attachment";
253
+ metadata: AssetMetadata;
254
+ }[];
255
+ };
256
+ type ArticleSubmissionReceipt = {
257
+ submission_id: string;
258
+ article_id: string | null;
259
+ revision_id: string | null;
260
+ status: "intake" | "queued" | "scanning" | "narrating" | "awaiting_review" | "held" | "complete" | "published";
261
+ error_code: string | null;
262
+ status_path: string;
263
+ permalink_path: string | null;
264
+ processing: ArticleProcessing | null;
265
+ progress: {
266
+ intent: string;
267
+ assets: {
268
+ [slot: string]: {
269
+ state: string;
270
+ contribution_id?: string;
271
+ file_id?: string;
272
+ };
273
+ };
274
+ };
275
+ accepted_is_not_published: true;
276
+ public_ready: boolean;
277
+ next_action: string;
278
+ };
178
279
  declare class ArticleWorkflowError extends Error {
179
280
  status: number;
180
281
  articleId?: string | undefined;
@@ -194,6 +295,7 @@ declare class PublicationArticleClient {
194
295
  });
195
296
  private request;
196
297
  options(articleId?: string): Promise<ArticleWorkflowOptions>;
298
+ publicArticle(slug: string, signal?: AbortSignal): Promise<any>;
197
299
  /** Explicit approver-authorized onboarding for a legacy article; never called by get().
198
300
  * Existing schedules are cancelled by the server; public content remains unchanged.
199
301
  * Missing immutable media identities must be resolved through newsroom media controls.
@@ -212,6 +314,15 @@ declare class PublicationArticleClient {
212
314
  state: string;
213
315
  elapsed_ms: number;
214
316
  }>;
317
+ /** Save one exact revision; release is explicit and never manufactures approval. */
318
+ editArticle(input: ArticleEditInput): Promise<{
319
+ article_id: string;
320
+ revision_id: any;
321
+ generation: any;
322
+ state: string;
323
+ editorial_status: any;
324
+ elapsed_ms: number;
325
+ }>;
215
326
  /** Replace a legacy publication cover using ready, measured public Photo renditions.
216
327
  * This never enrolls a story, publishes text, creates narration or retries a conflict.
217
328
  * Collaboration-managed stories retain their server-enforced immutable revision workflow.
@@ -244,22 +355,30 @@ declare class PublicationArticleClient {
244
355
  kind: "image";
245
356
  state: "OPEN";
246
357
  }>;
247
- /** One agent operation over existing owners. Stops at conflicts/unknown upload acknowledgement;
248
- * replay the same operation key to inspect/reuse staged contributions before another transfer.
249
- * Editorial approval and release are always separate explicit operations. */
358
+ /** One server-owned submission. No client-side Photo/TTS orchestration and no
359
+ * fallback to a different workflow. A 202 receipt is acceptance, not readiness.
360
+ * Replay the identical manifest/files/key after an uncertain acknowledgement.
361
+ */
362
+ submit(manifest: ArticleSubmissionManifest, operationKey: string, files?: {
363
+ slot: string;
364
+ file: Blob;
365
+ filename: string;
366
+ }[], signal?: AbortSignal): Promise<ArticleSubmissionReceipt>;
367
+ submission(submissionId: string, signal?: AbortSignal): Promise<ArticleSubmissionReceipt>;
250
368
  submitArticle(input: {
251
369
  operationKey: string;
252
370
  authorProfileId: string;
253
371
  document: ArticleDocument;
254
372
  reviewPolicy?: string;
373
+ intent?: "draft" | "review" | "publish";
255
374
  assets?: {
256
375
  file: Blob;
257
376
  filename: string;
258
377
  metadata: AssetMetadata;
259
- position: ArticleMedia["position"];
378
+ position: "hero" | "gallery" | "attachment";
260
379
  }[];
261
380
  approveMedia?: boolean;
262
- }): Promise<ArticleOperation>;
381
+ }): Promise<ArticleSubmissionReceipt>;
263
382
  }
264
383
 
265
- export { type ArticleDocument, type ArticleMedia, type ArticleOperation, type ArticlePhotoInput, ArticlePhotoOperationError, type ArticleProcessing, ArticleWorkflowError, type ArticleWorkflowOptions, type AssetMetadata, type PhotoOperationCheckpoint, PublicationArticleClient, type PublishedCoverReplacement, articlePhotoHtmlMatches };
384
+ export { type ArticleDocument, type ArticleEditCheckpoint, type ArticleEditInput, ArticleEditOperationError, type ArticleEditPatch, type ArticleMedia, type ArticleOperation, type ArticlePhotoInput, ArticlePhotoOperationError, type ArticleProcessing, type ArticleSubmissionManifest, type ArticleSubmissionReceipt, ArticleWorkflowError, type ArticleWorkflowOptions, type AssetMetadata, type PhotoOperationCheckpoint, PublicationArticleClient, type PublishedCoverReplacement, articleEditHtmlMatches, articlePhotoHtmlMatches };
@@ -3,6 +3,13 @@ import { A as ArticleFormat, b as ArticleLayout } from './article-presentation-0
3
3
  /** Check rendered image tags, not a URL mentioned only in serialized page data. */
4
4
  declare function articlePhotoHtmlMatches(html: string, lead: string | string[], social: string): boolean;
5
5
 
6
+ /** Requires visible body and actual card asides; serialized page data is not delivery. */
7
+ declare function articleEditHtmlMatches(html: string, expected: {
8
+ title: string;
9
+ content_html: string;
10
+ card_titles: string[];
11
+ }): boolean;
12
+
6
13
  type PhotoOperationCheckpoint = {
7
14
  version: 1;
8
15
  identity: string;
@@ -41,10 +48,51 @@ declare class ArticlePhotoOperationError extends Error {
41
48
  constructor(code: string, stage: string, message: string, fileId?: string | undefined, status?: number | undefined);
42
49
  }
43
50
 
51
+ type ArticleEditPatch = Partial<Pick<ArticleDocument, "title" | "subtitle" | "content_markdown" | "excerpt" | "section" | "community" | "format" | "layout" | "cards" | "citations">>;
52
+ type ArticleEditCheckpoint = {
53
+ version: 1;
54
+ identity: string;
55
+ articleId: string;
56
+ stage: string;
57
+ expectedGeneration?: number;
58
+ document?: ArticleDocument;
59
+ revisionId?: string;
60
+ savedGeneration?: number;
61
+ unchanged?: boolean;
62
+ sourceIdentity?: {
63
+ slug: string;
64
+ published_at: string | null;
65
+ canonical_url: string | null;
66
+ };
67
+ };
68
+ type ArticleEditInput = {
69
+ articleId: string;
70
+ operationKey: string;
71
+ patch: ArticleEditPatch;
72
+ expectedGeneration?: number;
73
+ /** Explicit legacy onboarding only. Existing policies are never changed. */
74
+ enableReviewPolicy?: "NONE" | "FACT_CHECK" | "CONTRIBUTOR_REVIEW" | "SUBJECT_APPROVAL_REQUIRED" | "SUBJECT_APPROVAL_PLUS_EDITOR";
75
+ /** Execute RELEASE under the caller's grants. Does not issue APPROVE. */
76
+ release?: boolean;
77
+ checkpoint?: ArticleEditCheckpoint;
78
+ saveCheckpoint: (checkpoint: ArticleEditCheckpoint) => Promise<void>;
79
+ timeoutMs?: number;
80
+ };
81
+ declare class ArticleEditOperationError extends Error {
82
+ code: string;
83
+ stage: string;
84
+ status?: number | undefined;
85
+ revisionId?: string | undefined;
86
+ constructor(code: string, stage: string, message: string, status?: number | undefined, revisionId?: string | undefined);
87
+ }
88
+
44
89
  type ArticleDocument = {
45
90
  title: string;
46
91
  subtitle?: string;
47
92
  content_markdown: string;
93
+ excerpt?: string;
94
+ cards?: unknown[];
95
+ citations?: unknown[];
48
96
  section: string;
49
97
  community?: string;
50
98
  format?: ArticleFormat;
@@ -64,13 +112,13 @@ type ArticleMedia = {
64
112
  position: "hero" | "inline" | "gallery" | "attachment";
65
113
  };
66
114
  type AssetMetadata = {
67
- caption: string;
68
- credit: string;
69
- alt: string;
70
- creator: string;
71
- who_is_pictured: string;
72
- when_taken: string;
73
- where_taken: string;
115
+ caption?: string;
116
+ credit?: string;
117
+ alt?: string;
118
+ creator?: string;
119
+ who_is_pictured?: string;
120
+ when_taken?: string;
121
+ where_taken?: string;
74
122
  rights_confirmed: boolean;
75
123
  private_preview_only?: boolean;
76
124
  };
@@ -146,6 +194,9 @@ type ArticleWorkflowOptions = {
146
194
  automatic_public_narration?: boolean;
147
195
  prioritized_narration_processing?: boolean;
148
196
  content_first_editor_document?: boolean;
197
+ versioned_editorial_fields?: boolean;
198
+ managed_submission_version?: number | null;
199
+ multipart_submission?: boolean;
149
200
  };
150
201
  };
151
202
  type ArticleOperation = {
@@ -175,6 +226,56 @@ type Record = {
175
226
  };
176
227
  }[];
177
228
  };
229
+ type ArticleSubmissionManifest = {
230
+ article: {
231
+ operation: "create";
232
+ author_profile_id: string;
233
+ document: ArticleDocument;
234
+ review_policy?: string;
235
+ celebration_type?: string;
236
+ } | {
237
+ operation: "save";
238
+ article_id: string;
239
+ expected_generation: number;
240
+ document: ArticleDocument;
241
+ reason: string;
242
+ };
243
+ intent?: "draft" | "review" | "publish";
244
+ approve_media?: boolean;
245
+ sensitivity_review?: {
246
+ policy_version: string;
247
+ rule_ids: string[];
248
+ reason: string;
249
+ };
250
+ assets?: {
251
+ slot: string;
252
+ position: "hero" | "gallery" | "attachment";
253
+ metadata: AssetMetadata;
254
+ }[];
255
+ };
256
+ type ArticleSubmissionReceipt = {
257
+ submission_id: string;
258
+ article_id: string | null;
259
+ revision_id: string | null;
260
+ status: "intake" | "queued" | "scanning" | "narrating" | "awaiting_review" | "held" | "complete" | "published";
261
+ error_code: string | null;
262
+ status_path: string;
263
+ permalink_path: string | null;
264
+ processing: ArticleProcessing | null;
265
+ progress: {
266
+ intent: string;
267
+ assets: {
268
+ [slot: string]: {
269
+ state: string;
270
+ contribution_id?: string;
271
+ file_id?: string;
272
+ };
273
+ };
274
+ };
275
+ accepted_is_not_published: true;
276
+ public_ready: boolean;
277
+ next_action: string;
278
+ };
178
279
  declare class ArticleWorkflowError extends Error {
179
280
  status: number;
180
281
  articleId?: string | undefined;
@@ -194,6 +295,7 @@ declare class PublicationArticleClient {
194
295
  });
195
296
  private request;
196
297
  options(articleId?: string): Promise<ArticleWorkflowOptions>;
298
+ publicArticle(slug: string, signal?: AbortSignal): Promise<any>;
197
299
  /** Explicit approver-authorized onboarding for a legacy article; never called by get().
198
300
  * Existing schedules are cancelled by the server; public content remains unchanged.
199
301
  * Missing immutable media identities must be resolved through newsroom media controls.
@@ -212,6 +314,15 @@ declare class PublicationArticleClient {
212
314
  state: string;
213
315
  elapsed_ms: number;
214
316
  }>;
317
+ /** Save one exact revision; release is explicit and never manufactures approval. */
318
+ editArticle(input: ArticleEditInput): Promise<{
319
+ article_id: string;
320
+ revision_id: any;
321
+ generation: any;
322
+ state: string;
323
+ editorial_status: any;
324
+ elapsed_ms: number;
325
+ }>;
215
326
  /** Replace a legacy publication cover using ready, measured public Photo renditions.
216
327
  * This never enrolls a story, publishes text, creates narration or retries a conflict.
217
328
  * Collaboration-managed stories retain their server-enforced immutable revision workflow.
@@ -244,22 +355,30 @@ declare class PublicationArticleClient {
244
355
  kind: "image";
245
356
  state: "OPEN";
246
357
  }>;
247
- /** One agent operation over existing owners. Stops at conflicts/unknown upload acknowledgement;
248
- * replay the same operation key to inspect/reuse staged contributions before another transfer.
249
- * Editorial approval and release are always separate explicit operations. */
358
+ /** One server-owned submission. No client-side Photo/TTS orchestration and no
359
+ * fallback to a different workflow. A 202 receipt is acceptance, not readiness.
360
+ * Replay the identical manifest/files/key after an uncertain acknowledgement.
361
+ */
362
+ submit(manifest: ArticleSubmissionManifest, operationKey: string, files?: {
363
+ slot: string;
364
+ file: Blob;
365
+ filename: string;
366
+ }[], signal?: AbortSignal): Promise<ArticleSubmissionReceipt>;
367
+ submission(submissionId: string, signal?: AbortSignal): Promise<ArticleSubmissionReceipt>;
250
368
  submitArticle(input: {
251
369
  operationKey: string;
252
370
  authorProfileId: string;
253
371
  document: ArticleDocument;
254
372
  reviewPolicy?: string;
373
+ intent?: "draft" | "review" | "publish";
255
374
  assets?: {
256
375
  file: Blob;
257
376
  filename: string;
258
377
  metadata: AssetMetadata;
259
- position: ArticleMedia["position"];
378
+ position: "hero" | "gallery" | "attachment";
260
379
  }[];
261
380
  approveMedia?: boolean;
262
- }): Promise<ArticleOperation>;
381
+ }): Promise<ArticleSubmissionReceipt>;
263
382
  }
264
383
 
265
- export { type ArticleDocument, type ArticleMedia, type ArticleOperation, type ArticlePhotoInput, ArticlePhotoOperationError, type ArticleProcessing, ArticleWorkflowError, type ArticleWorkflowOptions, type AssetMetadata, type PhotoOperationCheckpoint, PublicationArticleClient, type PublishedCoverReplacement, articlePhotoHtmlMatches };
384
+ export { type ArticleDocument, type ArticleEditCheckpoint, type ArticleEditInput, ArticleEditOperationError, type ArticleEditPatch, type ArticleMedia, type ArticleOperation, type ArticlePhotoInput, ArticlePhotoOperationError, type ArticleProcessing, type ArticleSubmissionManifest, type ArticleSubmissionReceipt, ArticleWorkflowError, type ArticleWorkflowOptions, type AssetMetadata, type PhotoOperationCheckpoint, PublicationArticleClient, type PublishedCoverReplacement, articleEditHtmlMatches, articlePhotoHtmlMatches };