@financial-times/cp-content-pipeline-schema 0.7.27 → 0.7.28

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.
@@ -1,12 +1,10 @@
1
- import { IResolvers } from '@graphql-tools/utils'
2
- import type { QueryContext } from '..'
3
- import { Concept, URLArguments } from '../model/Concept'
4
1
  import { ConceptResolvers } from '../generated'
5
2
 
6
3
  const resolvers: { Concept: ConceptResolvers } = {
7
4
  Concept: {
8
5
  apiUrl: (parent) => parent.apiUrl(),
9
6
  directType: (parent) => parent.directType(),
7
+ isPackageBrand: (parent) => parent.isPackageBrand(),
10
8
  id: (parent) => parent.uuid(),
11
9
  predicate: (parent) => parent.predicate(),
12
10
  prefLabel: (parent) => parent.prefLabel(),
@@ -26,12 +26,20 @@ const resolvers = {
26
26
  body(parent) {
27
27
  return new RichText('bodyXML', parent.bodyXML(), parent)
28
28
  },
29
- topper: (parent, args, context) => new Topper(parent, context),
30
- byline(parent) {
29
+ topper: (parent, _, context) => new Topper(parent, context),
30
+ byline(parent, args, context) {
31
+ const vanity = Boolean(args.vanity)
31
32
  const bylineText = parent.byline()
33
+
32
34
  if (!bylineText) return null
33
35
  const authorUrlMapping = parent.getAuthorUrlMapping()
34
- return new Byline(bylineText, authorUrlMapping).buildBylineTree()
36
+
37
+ return new Byline(
38
+ bylineText,
39
+ vanity,
40
+ authorUrlMapping,
41
+ context
42
+ ).buildBylineTree()
35
43
  },
36
44
  url: (parent, args) =>
37
45
  args.relative
@@ -37,3 +37,5 @@ type Image = z.infer<typeof Image>
37
37
  type LeadImage = z.infer<typeof LeadImage>
38
38
  type ImageSet = z.infer<typeof ImageSet>
39
39
  type MainImage = z.infer<typeof MainImage>
40
+
41
+ type ContentTypeSchemas = Article | LiveBlogPackage | ContentPackage | Audio
@@ -1,5 +1,5 @@
1
1
  declare module '@financial-times/n-display-metadata' {
2
- import { Annotation } from './internal-content'
2
+ import { Annotation, ContentTypeSchemas } from './internal-content'
3
3
 
4
4
  export interface FlagsMetadata {
5
5
  isOpinion: boolean
@@ -15,6 +15,7 @@ declare module '@financial-times/n-display-metadata' {
15
15
 
16
16
  export interface Content {
17
17
  annotations: Annotation[]
18
+ containedIn: ContentTypeSchemas | null
18
19
  }
19
20
 
20
21
  export function teaser(content: Content): TeaserMetadata