@scalemule/news-publication 0.0.18 → 0.0.19

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/dist/index.cjs CHANGED
@@ -320,11 +320,16 @@ function newsArticleJsonLd(publication, article, canonical, authorName) {
320
320
  headline: article.title,
321
321
  description: article.excerpt ?? void 0,
322
322
  datePublished: article.published_at,
323
- dateModified: article.updated_at,
323
+ // updated_at also changes for media/operational maintenance. A trusted
324
+ // editorial modification timestamp is required before emitting dateModified.
324
325
  image: image ? [image] : void 0,
325
- mainEntityOfPage: canonicalUrl,
326
+ mainEntityOfPage: url,
326
327
  url,
327
- author: { "@type": "Organization", name: authorName || publication.name },
328
+ ...canonicalUrl !== url ? { isBasedOn: canonicalUrl } : {},
329
+ articleSection: article.section || void 0,
330
+ // The publication byline is known to be an organization. Do not infer a
331
+ // person's identity or classify an untyped external byline as a newsroom.
332
+ author: { ...!authorName || authorName === publication.name ? { "@type": "Organization" } : {}, name: authorName || publication.name },
328
333
  publisher: { "@type": "NewsMediaOrganization", name: publication.name, url: canonical }
329
334
  };
330
335
  }
@@ -359,17 +364,17 @@ function articleMeta(publication, article, canonical, indexable) {
359
364
  const canonicalUrl = publicHttps(article.canonical_url) ?? url;
360
365
  const image = publicHttps(article.og_image_url) ?? publicHttps(article.cover_image_url);
361
366
  return {
362
- title: article.seo_title ?? article.title,
367
+ title: article.title,
363
368
  description: article.seo_description ?? article.excerpt ?? publication.description,
364
369
  canonical: canonicalUrl,
365
370
  indexable: indexable && !article.no_index,
366
371
  openGraph: {
367
372
  type: "article",
373
+ siteName: publication.name,
368
374
  title: article.title,
369
375
  description: article.excerpt ?? void 0,
370
376
  url,
371
377
  publishedTime: article.published_at,
372
- modifiedTime: article.updated_at,
373
378
  images: image ? [image] : []
374
379
  }
375
380
  };
package/dist/index.d.cts CHANGED
@@ -146,26 +146,27 @@ declare function storyDate(value: string): string | null;
146
146
  /** https URL with no userinfo. Anything else is dropped from public markup. */
147
147
  declare function publicHttps(value?: string | null): string | undefined;
148
148
  declare function articleUrl(canonical: string, slug: string): string;
149
- /** Same NewsArticle graph Walnut Creek Times emits on an indexable story. */
149
+ /** Describe the local edition while retaining the designated reporting source. */
150
150
  declare function newsArticleJsonLd(publication: NewsPublication, article: NewsArticle, canonical: string, authorName?: string | null): {
151
- "@context": string;
152
- "@type": string;
153
- headline: string;
154
- description: string | undefined;
155
- datePublished: string;
156
- dateModified: string;
157
- image: string[] | undefined;
158
- mainEntityOfPage: string;
159
- url: string;
151
+ articleSection: string | undefined;
160
152
  author: {
161
- "@type": string;
162
153
  name: string;
154
+ "@type"?: string | undefined;
163
155
  };
164
156
  publisher: {
165
157
  "@type": string;
166
158
  name: string;
167
159
  url: string;
168
160
  };
161
+ isBasedOn?: string | undefined;
162
+ "@context": string;
163
+ "@type": string;
164
+ headline: string;
165
+ description: string | undefined;
166
+ datePublished: string;
167
+ image: string[] | undefined;
168
+ mainEntityOfPage: string;
169
+ url: string;
169
170
  };
170
171
  declare function publicationJsonLd(publication: NewsPublication, canonical: string): {
171
172
  "@context": string;
@@ -199,11 +200,11 @@ declare function articleMeta(publication: NewsPublication, article: NewsArticle,
199
200
  indexable: boolean;
200
201
  openGraph: {
201
202
  type: "article";
203
+ siteName: string;
202
204
  title: string;
203
205
  description: string | undefined;
204
206
  url: string;
205
207
  publishedTime: string;
206
- modifiedTime: string;
207
208
  images: string[];
208
209
  };
209
210
  };
package/dist/index.d.ts CHANGED
@@ -146,26 +146,27 @@ declare function storyDate(value: string): string | null;
146
146
  /** https URL with no userinfo. Anything else is dropped from public markup. */
147
147
  declare function publicHttps(value?: string | null): string | undefined;
148
148
  declare function articleUrl(canonical: string, slug: string): string;
149
- /** Same NewsArticle graph Walnut Creek Times emits on an indexable story. */
149
+ /** Describe the local edition while retaining the designated reporting source. */
150
150
  declare function newsArticleJsonLd(publication: NewsPublication, article: NewsArticle, canonical: string, authorName?: string | null): {
151
- "@context": string;
152
- "@type": string;
153
- headline: string;
154
- description: string | undefined;
155
- datePublished: string;
156
- dateModified: string;
157
- image: string[] | undefined;
158
- mainEntityOfPage: string;
159
- url: string;
151
+ articleSection: string | undefined;
160
152
  author: {
161
- "@type": string;
162
153
  name: string;
154
+ "@type"?: string | undefined;
163
155
  };
164
156
  publisher: {
165
157
  "@type": string;
166
158
  name: string;
167
159
  url: string;
168
160
  };
161
+ isBasedOn?: string | undefined;
162
+ "@context": string;
163
+ "@type": string;
164
+ headline: string;
165
+ description: string | undefined;
166
+ datePublished: string;
167
+ image: string[] | undefined;
168
+ mainEntityOfPage: string;
169
+ url: string;
169
170
  };
170
171
  declare function publicationJsonLd(publication: NewsPublication, canonical: string): {
171
172
  "@context": string;
@@ -199,11 +200,11 @@ declare function articleMeta(publication: NewsPublication, article: NewsArticle,
199
200
  indexable: boolean;
200
201
  openGraph: {
201
202
  type: "article";
203
+ siteName: string;
202
204
  title: string;
203
205
  description: string | undefined;
204
206
  url: string;
205
207
  publishedTime: string;
206
- modifiedTime: string;
207
208
  images: string[];
208
209
  };
209
210
  };
package/dist/index.js CHANGED
@@ -256,11 +256,16 @@ function newsArticleJsonLd(publication, article, canonical, authorName) {
256
256
  headline: article.title,
257
257
  description: article.excerpt ?? void 0,
258
258
  datePublished: article.published_at,
259
- dateModified: article.updated_at,
259
+ // updated_at also changes for media/operational maintenance. A trusted
260
+ // editorial modification timestamp is required before emitting dateModified.
260
261
  image: image ? [image] : void 0,
261
- mainEntityOfPage: canonicalUrl,
262
+ mainEntityOfPage: url,
262
263
  url,
263
- author: { "@type": "Organization", name: authorName || publication.name },
264
+ ...canonicalUrl !== url ? { isBasedOn: canonicalUrl } : {},
265
+ articleSection: article.section || void 0,
266
+ // The publication byline is known to be an organization. Do not infer a
267
+ // person's identity or classify an untyped external byline as a newsroom.
268
+ author: { ...!authorName || authorName === publication.name ? { "@type": "Organization" } : {}, name: authorName || publication.name },
264
269
  publisher: { "@type": "NewsMediaOrganization", name: publication.name, url: canonical }
265
270
  };
266
271
  }
@@ -295,17 +300,17 @@ function articleMeta(publication, article, canonical, indexable) {
295
300
  const canonicalUrl = publicHttps(article.canonical_url) ?? url;
296
301
  const image = publicHttps(article.og_image_url) ?? publicHttps(article.cover_image_url);
297
302
  return {
298
- title: article.seo_title ?? article.title,
303
+ title: article.title,
299
304
  description: article.seo_description ?? article.excerpt ?? publication.description,
300
305
  canonical: canonicalUrl,
301
306
  indexable: indexable && !article.no_index,
302
307
  openGraph: {
303
308
  type: "article",
309
+ siteName: publication.name,
304
310
  title: article.title,
305
311
  description: article.excerpt ?? void 0,
306
312
  url,
307
313
  publishedTime: article.published_at,
308
- modifiedTime: article.updated_at,
309
314
  images: image ? [image] : []
310
315
  }
311
316
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/news-publication",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Shared server framework for ScaleMule local news publications. Walnut Creek Times is the broadsheet default; each paper supplies its own identity and feature flags.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",