@financial-times/cp-content-pipeline-schema 1.0.0 → 1.1.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.
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.placeholderSchema = void 0;
4
+ const base_schema_1 = require("./base-schema");
5
+ const placeholderContentSchema = base_schema_1.baseContentSchema.pick({
6
+ title: true,
7
+ standfirst: true,
8
+ byline: true,
9
+ bodyXML: true,
10
+ alternativeTitles: true,
11
+ alternativeStandfirsts: true,
12
+ });
13
+ const placeholderMetadataSchema = base_schema_1.baseMetadataSchema.pick({
14
+ id: true,
15
+ annotations: true,
16
+ webUrl: true,
17
+ type: true,
18
+ types: true,
19
+ standout: true,
20
+ publishedDate: true,
21
+ firstPublishedDate: true,
22
+ accessLevel: true,
23
+ canBeSyndicated: true,
24
+ topper: true,
25
+ comments: true,
26
+ containedIn: true,
27
+ });
28
+ const placeholderMediaSchema = base_schema_1.baseMediaSchema.pick({
29
+ mainImage: true,
30
+ leadImages: true,
31
+ embeds: true,
32
+ });
33
+ exports.placeholderSchema = placeholderContentSchema
34
+ .merge(placeholderMetadataSchema)
35
+ .merge(placeholderMediaSchema);
36
+ //# sourceMappingURL=placeholder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder.js","sourceRoot":"","sources":["../../../../src/model/schemas/capi/placeholder.ts"],"names":[],"mappings":";;;AAAA,+CAIsB;AAEtB,MAAM,wBAAwB,GAAG,+BAAiB,CAAC,IAAI,CAAC;IACtD,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,iBAAiB,EAAE,IAAI;IACvB,sBAAsB,EAAE,IAAI;CAC7B,CAAC,CAAA;AAEF,MAAM,yBAAyB,GAAG,gCAAkB,CAAC,IAAI,CAAC;IACxD,EAAE,EAAE,IAAI;IACR,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,IAAI;IACnB,kBAAkB,EAAE,IAAI;IACxB,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;CAClB,CAAC,CAAA;AAEF,MAAM,sBAAsB,GAAG,6BAAe,CAAC,IAAI,CAAC;IAClD,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;CACb,CAAC,CAAA;AAEW,QAAA,iBAAiB,GAAG,wBAAwB;KACtD,KAAK,CAAC,yBAAyB,CAAC;KAChC,KAAK,CAAC,sBAAsB,CAAC,CAAA"}
@@ -2,7 +2,7 @@ import { Topper } from '../model/Topper';
2
2
  import { RichText } from '../model/RichText';
3
3
  declare const resolvers: {
4
4
  Content: {
5
- __resolveType: (parent: import("../model/CapiResponse").CapiResponse) => "Article" | "Video" | "Audio" | "LiveBlogPackage" | "LiveBlogPost" | "ContentPackage";
5
+ __resolveType: (parent: import("../model/CapiResponse").CapiResponse) => "Article" | "Placeholder" | "Video" | "Audio" | "LiveBlogPackage" | "LiveBlogPost" | "ContentPackage";
6
6
  body(parent: import("../model/CapiResponse").CapiResponse): RichText;
7
7
  topper: (parent: import("../model/CapiResponse").CapiResponse, _: {}, context: import("..").QueryContext) => Topper;
8
8
  byline(parent: import("../model/CapiResponse").CapiResponse, args: Partial<import("../generated").ContentBylineArgs>, context: import("..").QueryContext): Promise<{
@@ -13,7 +13,7 @@ declare const resolvers: {
13
13
  references: never[];
14
14
  }> | null;
15
15
  url: (parent: import("../model/CapiResponse").CapiResponse, args: Partial<import("../generated").ContentUrlArgs>) => Promise<string>;
16
- type: (parent: import("../model/CapiResponse").CapiResponse) => "Article" | "Video" | "Audio" | "LiveBlogPackage" | "LiveBlogPost" | "ContentPackage" | "Content" | "MediaResource";
16
+ type: (parent: import("../model/CapiResponse").CapiResponse) => "Article" | "Placeholder" | "Video" | "Audio" | "LiveBlogPackage" | "LiveBlogPost" | "ContentPackage" | "Content" | "MediaResource";
17
17
  mainImage: (parent: import("../model/CapiResponse").CapiResponse) => import("../model/Image").CAPIImage | null;
18
18
  altTitle: (parent: import("../model/CapiResponse").CapiResponse) => {
19
19
  promotionalTitle: string;
@@ -34,12 +34,16 @@ declare const resolvers: {
34
34
  Article: {
35
35
  containedIn: (parent: import("../model/CapiResponse").CapiResponse) => Promise<import("../model/CapiResponse").CapiResponse | null>;
36
36
  };
37
+ Placeholder: {
38
+ containedIn: (parent: import("../model/CapiResponse").CapiResponse) => Promise<import("../model/CapiResponse").CapiResponse | null>;
39
+ };
37
40
  LiveBlogPackage: {
38
41
  liveBlogPosts: (parent: import("../model/CapiResponse").CapiResponse) => Promise<[] | import("../model/CapiResponse").CapiResponse[]>;
39
42
  realtime: (parent: import("../model/CapiResponse").CapiResponse) => boolean | null;
40
43
  };
41
44
  ContentPackage: {
42
- contains: (parent: import("../model/CapiResponse").CapiResponse) => Promise<import("../model/CapiResponse").CapiResponse[] | null>;
45
+ contains: (parent: import("../model/CapiResponse").CapiResponse, args: Partial<import("../generated").ContentPackageContainsArgs>) => Promise<import("../model/CapiResponse").CapiResponse[] | null>;
46
+ containsLength: (parent: import("../model/CapiResponse").CapiResponse) => number | null;
43
47
  };
44
48
  Audio: {
45
49
  media: (parent: import("../model/CapiResponse").CapiResponse) => import("../generated").Media[] | null;
@@ -8,7 +8,7 @@ const resolvers = {
8
8
  __resolveType: (parent) => {
9
9
  const type = parent.type();
10
10
  if (type === 'Content') {
11
- return 'Article';
11
+ return parent.isPlaceholder() ? 'Placeholder' : 'Article';
12
12
  }
13
13
  if (type === 'MediaResource') {
14
14
  return 'Video';
@@ -44,12 +44,16 @@ const resolvers = {
44
44
  Article: {
45
45
  containedIn: (parent) => parent.containedIn(),
46
46
  },
47
+ Placeholder: {
48
+ containedIn: (parent) => parent.containedIn(),
49
+ },
47
50
  LiveBlogPackage: {
48
51
  liveBlogPosts: (parent) => parent.liveBlogPosts(),
49
52
  realtime: (parent) => parent.realtime(),
50
53
  },
51
54
  ContentPackage: {
52
- contains: (parent) => parent.contains(),
55
+ contains: (parent, args) => parent.contains(args),
56
+ containsLength: (parent) => parent.containsLength(),
53
57
  },
54
58
  Audio: {
55
59
  media: (parent) =>
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/resolvers/content.ts"],"names":[],"mappings":";;AAAA,4CAAwC;AACxC,4CAAwC;AAQxC,gDAA4C;AAE5C,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE;QACP,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE;YACxB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAA;YAC1B,IAAI,IAAI,KAAK,SAAS,EAAE;gBACtB,OAAO,SAAS,CAAA;aACjB;YAED,IAAI,IAAI,KAAK,eAAe,EAAE;gBAC5B,OAAO,OAAO,CAAA;aACf;YAED,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,CAAC,MAAM;YACT,OAAO,IAAI,mBAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAA;QAC1D,CAAC;QACD,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,eAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QAC3D,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO;YAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACnC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,CAAA;YAElC,IAAI,CAAC,UAAU;gBAAE,OAAO,IAAI,CAAA;YAC5B,MAAM,gBAAgB,GAAG,MAAM,CAAC,m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,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE;KACpC;IAED,OAAO,EAAE;QACP,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE;KAC9C;IAED,WAAW,EAAE;QACX,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE;KAC9C;IAED,eAAe,EAAE;QACf,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE;QACjD,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE;KACxC;IAED,cAAc,EAAE;QACd,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjD,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE;KACpD;IAED,KAAK,EAAE;QACL,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE;QAChB,uDAAuD;QACvD,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,YAAY,CAAC;YACrE,IAAI;KACP;CAQF,CAAA;AAED,kBAAe,SAAS,CAAA"}
@@ -65,7 +65,7 @@ declare const resolvers: {
65
65
  CanBeSyndicated: import("./literal-union").LiteralUnionScalar<["yes", "no", "verify", "withContributorPayment", "unknown"]>;
66
66
  ImageType: import("./literal-union").LiteralUnionScalar<["image", "graphic"]>;
67
67
  RichTextSource: import("./literal-union").LiteralUnionScalar<["standfirst", "summary", "bodyXML"]>;
68
- ContentType: import("./literal-union").LiteralUnionScalar<["Article", "Video", "Audio", "LiveBlogPackage", "LiveBlogPost", "ContentPackage", "Content", "MediaResource"]>;
68
+ ContentType: import("./literal-union").LiteralUnionScalar<["Article", "Placeholder", "Video", "Audio", "LiveBlogPackage", "LiveBlogPost", "ContentPackage", "Content", "MediaResource"]>;
69
69
  RichText: {
70
70
  raw(parent: import("../model/RichText").RichText): string | null;
71
71
  structured(parent: import("../model/RichText").RichText, args: {}, context: import("..").QueryContext): Promise<{
@@ -106,7 +106,7 @@ declare const resolvers: {
106
106
  invalidateRedisCache: (_: {}, args: import("../generated").RequireFields<import("../generated").MutationInvalidateRedisCacheArgs, "uuid">, context: import("..").QueryContext) => Promise<string>;
107
107
  };
108
108
  Content: {
109
- __resolveType: (parent: import("../model/CapiResponse").CapiResponse) => "Article" | "Video" | "Audio" | "LiveBlogPackage" | "LiveBlogPost" | "ContentPackage";
109
+ __resolveType: (parent: import("../model/CapiResponse").CapiResponse) => "Article" | "Placeholder" | "Video" | "Audio" | "LiveBlogPackage" | "LiveBlogPost" | "ContentPackage";
110
110
  body(parent: import("../model/CapiResponse").CapiResponse): import("../model/RichText").RichText;
111
111
  topper: (parent: import("../model/CapiResponse").CapiResponse, _: {}, context: import("..").QueryContext) => import("../model/Topper").Topper;
112
112
  byline(parent: import("../model/CapiResponse").CapiResponse, args: Partial<import("../generated").ContentBylineArgs>, context: import("..").QueryContext): Promise<{
@@ -117,7 +117,7 @@ declare const resolvers: {
117
117
  references: never[];
118
118
  }> | null;
119
119
  url: (parent: import("../model/CapiResponse").CapiResponse, args: Partial<import("../generated").ContentUrlArgs>) => Promise<string>;
120
- type: (parent: import("../model/CapiResponse").CapiResponse) => "Article" | "Video" | "Audio" | "LiveBlogPackage" | "LiveBlogPost" | "ContentPackage" | "Content" | "MediaResource";
120
+ type: (parent: import("../model/CapiResponse").CapiResponse) => "Article" | "Placeholder" | "Video" | "Audio" | "LiveBlogPackage" | "LiveBlogPost" | "ContentPackage" | "Content" | "MediaResource";
121
121
  mainImage: (parent: import("../model/CapiResponse").CapiResponse) => import("../model/Image").CAPIImage | null;
122
122
  altTitle: (parent: import("../model/CapiResponse").CapiResponse) => {
123
123
  promotionalTitle: string;
@@ -138,12 +138,16 @@ declare const resolvers: {
138
138
  Article: {
139
139
  containedIn: (parent: import("../model/CapiResponse").CapiResponse) => Promise<import("../model/CapiResponse").CapiResponse | null>;
140
140
  };
141
+ Placeholder: {
142
+ containedIn: (parent: import("../model/CapiResponse").CapiResponse) => Promise<import("../model/CapiResponse").CapiResponse | null>;
143
+ };
141
144
  LiveBlogPackage: {
142
145
  liveBlogPosts: (parent: import("../model/CapiResponse").CapiResponse) => Promise<[] | import("../model/CapiResponse").CapiResponse[]>;
143
146
  realtime: (parent: import("../model/CapiResponse").CapiResponse) => boolean | null;
144
147
  };
145
148
  ContentPackage: {
146
- contains: (parent: import("../model/CapiResponse").CapiResponse) => Promise<import("../model/CapiResponse").CapiResponse[] | null>;
149
+ contains: (parent: import("../model/CapiResponse").CapiResponse, args: Partial<import("../generated").ContentPackageContainsArgs>) => Promise<import("../model/CapiResponse").CapiResponse[] | null>;
150
+ containsLength: (parent: import("../model/CapiResponse").CapiResponse) => number | null;
147
151
  };
148
152
  Audio: {
149
153
  media: (parent: import("../model/CapiResponse").CapiResponse) => import("../generated").Media[] | null;
@@ -7,7 +7,7 @@ export declare const AccessLevel: LiteralUnionScalar<["premium", "subscribed", "
7
7
  export declare const CanBeSyndicated: LiteralUnionScalar<["yes", "no", "verify", "withContributorPayment", "unknown"]>;
8
8
  export declare const ImageType: LiteralUnionScalar<["image", "graphic"]>;
9
9
  export declare const RichTextSource: LiteralUnionScalar<["standfirst", "summary", "bodyXML"]>;
10
- export declare const ContentType: LiteralUnionScalar<["Article", "Video", "Audio", "LiveBlogPackage", "LiveBlogPost", "ContentPackage", "Content", "MediaResource"]>;
10
+ export declare const ContentType: LiteralUnionScalar<["Article", "Placeholder", "Video", "Audio", "LiveBlogPackage", "LiveBlogPost", "ContentPackage", "Content", "MediaResource"]>;
11
11
  declare const resolvers: {
12
12
  ImageFormat: LiteralUnionScalar<["standard", "standard-inline", "desktop", "mobile", "wide", "square", "square-ftedit", "portrait", "landscape"]>;
13
13
  PackageDesign: LiteralUnionScalar<["special-report", "extra", "basic"]>;
@@ -17,6 +17,6 @@ declare const resolvers: {
17
17
  CanBeSyndicated: LiteralUnionScalar<["yes", "no", "verify", "withContributorPayment", "unknown"]>;
18
18
  ImageType: LiteralUnionScalar<["image", "graphic"]>;
19
19
  RichTextSource: LiteralUnionScalar<["standfirst", "summary", "bodyXML"]>;
20
- ContentType: LiteralUnionScalar<["Article", "Video", "Audio", "LiveBlogPackage", "LiveBlogPost", "ContentPackage", "Content", "MediaResource"]>;
20
+ ContentType: LiteralUnionScalar<["Article", "Placeholder", "Video", "Audio", "LiveBlogPackage", "LiveBlogPost", "ContentPackage", "Content", "MediaResource"]>;
21
21
  };
22
22
  export default resolvers;
@@ -63,6 +63,7 @@ exports.ContentType = new literal_union_1.LiteralUnionScalar({
63
63
  name: 'ContentType',
64
64
  values: [
65
65
  'Article',
66
+ 'Placeholder',
66
67
  'Video',
67
68
  'Audio',
68
69
  'LiveBlogPackage',
@@ -1 +1 @@
1
- {"version":3,"file":"scalars.js","sourceRoot":"","sources":["../../src/resolvers/scalars.ts"],"names":[],"mappings":";;;AAAA,mDAAoD;AAEvC,QAAA,WAAW,GAAG,IAAI,kCAAkB,CAY/C;IACA,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE;QACN,UAAU;QACV,iBAAiB;QACjB,SAAS;QACT,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,eAAe;QACf,UAAU;QACV,WAAW;KACZ;CACF,CAAC,CAAA;AAEW,QAAA,aAAa,GAAG,IAAI,kCAAkB,CAEjD,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;AAE7D,QAAA,sBAAsB,GAAG,IAAI,kCAAkB,CAa1D;IACA,IAAI,EAAE,wBAAwB;IAC9B,MAAM,EAAE;QACN,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,OAAO;QACP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,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,wBAAwB,EAAE,SAAS,CAAC;CACrE,CAAC,CAAA;AAEW,QAAA,SAAS,GAAG,IAAI,kCAAkB,CAAuB;IACpE,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;CAC7B,CAAC,CAAA;AAEW,QAAA,cAAc,GAAG,IAAI,kCAAkB,CAElD;IACA,IAAI,EAAE,gBAAgB;IACtB,MAAM,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,CAAC;CAC7C,CAAC,CAAA;AAEW,QAAA,WAAW,GAAG,IAAI,kCAAkB,CAY/C;IACA,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE;QACN,SAAS;QACT,aAAa;QACb,OAAO;QACP,OAAO;QACP,iBAAiB;QACjB,cAAc;QACd,gBAAgB;QAChB,SAAS;QACT,eAAe;KAChB;CACF,CAAC,CAAA;AAEF,MAAM,SAAS,GAAG;IAChB,WAAW,EAAX,mBAAW;IACX,aAAa,EAAb,qBAAa;IACb,sBAAsB,EAAtB,8BAAsB;IACtB,mBAAmB,EAAnB,2BAAmB;IACnB,WAAW,EAAX,mBAAW;IACX,eAAe,EAAf,uBAAe;IACf,SAAS,EAAT,iBAAS;IACT,cAAc,EAAd,sBAAc;IACd,WAAW,EAAX,mBAAW;CACZ,CAAA;AAED,kBAAe,SAAS,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/cp-content-pipeline-schema",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@ export type Scalars = {
27
27
  Float: { input: number; output: number; }
28
28
  AccessLevel: { input: 'premium' | 'subscribed' | 'registered' | 'free'; output: 'premium' | 'subscribed' | 'registered' | 'free'; }
29
29
  CanBeSyndicated: { input: 'yes' | 'no' | 'verify' | 'withContributorPayment' | 'unknown'; output: 'yes' | 'no' | 'verify' | 'withContributorPayment' | 'unknown'; }
30
- ContentType: { input: 'Article' | 'Video' | 'Audio' | 'LiveBlogPackage' | 'LiveBlogPost' | 'ContentPackage' | 'Content' | 'MediaResource'; output: 'Article' | 'Video' | 'Audio' | 'LiveBlogPackage' | 'LiveBlogPost' | 'ContentPackage' | 'Content' | 'MediaResource'; }
30
+ ContentType: { input: 'Article' | 'Placeholder' | 'Video' | 'Audio' | 'LiveBlogPackage' | 'LiveBlogPost' | 'ContentPackage' | 'Content' | 'MediaResource'; output: 'Article' | 'Placeholder' | 'Video' | 'Audio' | 'LiveBlogPackage' | 'LiveBlogPost' | 'ContentPackage' | 'Content' | 'MediaResource'; }
31
31
  FollowButtonVariant: { input: 'standard' | 'inverse' | 'opinion' | 'alphaville' | 'monochrome' | 'inverse-monochrome'; output: 'standard' | 'inverse' | 'opinion' | 'alphaville' | 'monochrome' | 'inverse-monochrome'; }
32
32
  ImageFormat: { input: 'standard' | 'standard-inline' | 'desktop' | 'mobile' | 'wide' | 'square' | 'square-ftedit' | 'portrait' | 'landscape'; output: 'standard' | 'standard-inline' | 'desktop' | 'mobile' | 'wide' | 'square' | 'square-ftedit' | 'portrait' | 'landscape'; }
33
33
  ImageType: { input: 'image' | 'graphic'; output: 'image' | 'graphic'; }
@@ -202,6 +202,7 @@ export type ContentPackage = Content & {
202
202
  readonly canBeSyndicated?: Maybe<Scalars['CanBeSyndicated']['output']>;
203
203
  readonly commentsEnabled?: Maybe<Scalars['Boolean']['output']>;
204
204
  readonly contains?: Maybe<ReadonlyArray<Maybe<Teaser>>>;
205
+ readonly containsLength?: Maybe<Scalars['Int']['output']>;
205
206
  readonly design?: Maybe<Design>;
206
207
  readonly firstPublishedDate: Scalars['String']['output'];
207
208
  readonly id: Scalars['String']['output'];
@@ -222,6 +223,12 @@ export type ContentPackageBylineArgs = {
222
223
  };
223
224
 
224
225
 
226
+ export type ContentPackageContainsArgs = {
227
+ fromId?: InputMaybe<Scalars['String']['input']>;
228
+ surroundingArticles?: InputMaybe<Scalars['Int']['input']>;
229
+ };
230
+
231
+
225
232
  export type ContentPackageUrlArgs = {
226
233
  relative?: InputMaybe<Scalars['Boolean']['input']>;
227
234
  vanity?: InputMaybe<Scalars['Boolean']['input']>;
@@ -658,6 +665,41 @@ export type PictureStandard = Picture & {
658
665
  readonly layoutWidth?: Maybe<Scalars['String']['output']>;
659
666
  };
660
667
 
668
+ export type Placeholder = Content & {
669
+ readonly accessLevel?: Maybe<Scalars['AccessLevel']['output']>;
670
+ readonly altStandfirst?: Maybe<AltStandfirst>;
671
+ readonly altTitle?: Maybe<AltTitle>;
672
+ readonly annotations?: Maybe<ReadonlyArray<Maybe<Concept>>>;
673
+ readonly body?: Maybe<RichText>;
674
+ readonly bodyXML?: Maybe<Scalars['String']['output']>;
675
+ readonly byline?: Maybe<StructuredContent>;
676
+ readonly canBeSyndicated?: Maybe<Scalars['CanBeSyndicated']['output']>;
677
+ readonly commentsEnabled?: Maybe<Scalars['Boolean']['output']>;
678
+ readonly containedIn?: Maybe<Content>;
679
+ readonly design?: Maybe<Design>;
680
+ readonly firstPublishedDate: Scalars['String']['output'];
681
+ readonly id: Scalars['String']['output'];
682
+ readonly mainImage?: Maybe<Image>;
683
+ readonly publishedDate: Scalars['String']['output'];
684
+ readonly standfirst?: Maybe<Scalars['String']['output']>;
685
+ readonly teaser?: Maybe<Teaser>;
686
+ readonly title: Scalars['String']['output'];
687
+ readonly topper?: Maybe<Topper>;
688
+ readonly type: Scalars['ContentType']['output'];
689
+ readonly url: Scalars['String']['output'];
690
+ };
691
+
692
+
693
+ export type PlaceholderBylineArgs = {
694
+ vanity?: InputMaybe<Scalars['Boolean']['input']>;
695
+ };
696
+
697
+
698
+ export type PlaceholderUrlArgs = {
699
+ relative?: InputMaybe<Scalars['Boolean']['input']>;
700
+ vanity?: InputMaybe<Scalars['Boolean']['input']>;
701
+ };
702
+
661
703
  export type PodcastTopper = Topper & TopperWithBrand & TopperWithHeadshot & TopperWithTheme & {
662
704
  readonly backgroundBox?: Maybe<Scalars['Boolean']['output']>;
663
705
  readonly backgroundColour?: Maybe<Scalars['TopperBackgroundColour']['output']>;
@@ -926,7 +968,7 @@ export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs
926
968
 
927
969
  /** Mapping of interface types */
928
970
  export type ResolversInterfaceTypes<RefType extends Record<string, unknown>> = ResolversObject<{
929
- Content: ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse );
971
+ Content: ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse ) | ( CapiResponse );
930
972
  Image: ( ImageDesktop ) | ( ImageLandscape ) | ( ImageMobile ) | ( ImagePortrait ) | ( ImageSquare ) | ( ImageSquareFtEdit ) | ( ImageStandard ) | ( ImageStandardInline ) | ( ImageWide );
931
973
  Picture: ( Omit<PictureFullBleed, 'fallbackImage' | 'images'> & { fallbackImage: RefType['Image'], images: ReadonlyArray<RefType['Image']> } ) | ( Omit<PictureInline, 'fallbackImage' | 'images'> & { fallbackImage: RefType['Image'], images: ReadonlyArray<RefType['Image']> } ) | ( Omit<PictureStandard, 'fallbackImage' | 'images'> & { fallbackImage: RefType['Image'], images: ReadonlyArray<RefType['Image']> } );
932
974
  Reference: ( ReferenceWithCAPIData<ContentTree.Flourish> ) | ( ReferenceWithCAPIData<ContentTree.ImageSet> ) | ( ReferenceWithCAPIData<ContentTree.LayoutImage> ) | ( ReferenceWithCAPIData<ContentTree.ImageSet> ) | ( ReferenceWithCAPIData<RawImageNode> ) | ( ReferenceWithCAPIData<ContentTree.Recommended> ) | ( ReferenceWithCAPIData<ContentTree.ScrollyImage> ) | ( ReferenceWithCAPIData<ContentTree.Tweet> ) | ( ReferenceWithCAPIData<VideoNode> );
@@ -990,6 +1032,7 @@ export type ResolversTypes = ResolversObject<{
990
1032
  PictureFullBleed: ResolverTypeWrapper<Omit<PictureFullBleed, 'fallbackImage' | 'images'> & { fallbackImage: ResolversTypes['Image'], images: ReadonlyArray<ResolversTypes['Image']> }>;
991
1033
  PictureInline: ResolverTypeWrapper<Omit<PictureInline, 'fallbackImage' | 'images'> & { fallbackImage: ResolversTypes['Image'], images: ReadonlyArray<ResolversTypes['Image']> }>;
992
1034
  PictureStandard: ResolverTypeWrapper<Omit<PictureStandard, 'fallbackImage' | 'images'> & { fallbackImage: ResolversTypes['Image'], images: ReadonlyArray<ResolversTypes['Image']> }>;
1035
+ Placeholder: ResolverTypeWrapper<CapiResponse>;
993
1036
  PodcastTopper: ResolverTypeWrapper<TopperModel>;
994
1037
  Query: ResolverTypeWrapper<{}>;
995
1038
  RawImage: ResolverTypeWrapper<ReferenceWithCAPIData<RawImageNode>>;
@@ -1067,6 +1110,7 @@ export type ResolversParentTypes = ResolversObject<{
1067
1110
  PictureFullBleed: Omit<PictureFullBleed, 'fallbackImage' | 'images'> & { fallbackImage: ResolversParentTypes['Image'], images: ReadonlyArray<ResolversParentTypes['Image']> };
1068
1111
  PictureInline: Omit<PictureInline, 'fallbackImage' | 'images'> & { fallbackImage: ResolversParentTypes['Image'], images: ReadonlyArray<ResolversParentTypes['Image']> };
1069
1112
  PictureStandard: Omit<PictureStandard, 'fallbackImage' | 'images'> & { fallbackImage: ResolversParentTypes['Image'], images: ReadonlyArray<ResolversParentTypes['Image']> };
1113
+ Placeholder: CapiResponse;
1070
1114
  PodcastTopper: TopperModel;
1071
1115
  Query: {};
1072
1116
  RawImage: ReferenceWithCAPIData<RawImageNode>;
@@ -1200,7 +1244,7 @@ export type ConceptResolvers<ContextType = QueryContext, ParentType extends Reso
1200
1244
  }>;
1201
1245
 
1202
1246
  export type ContentResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['Content'] = ResolversParentTypes['Content']> = ResolversObject<{
1203
- __resolveType?: TypeResolveFn<'Article' | 'Audio' | 'ContentPackage' | 'LiveBlogPackage' | 'LiveBlogPost' | 'Video', ParentType, ContextType>;
1247
+ __resolveType?: TypeResolveFn<'Article' | 'Audio' | 'ContentPackage' | 'LiveBlogPackage' | 'LiveBlogPost' | 'Placeholder' | 'Video', ParentType, ContextType>;
1204
1248
  accessLevel?: Resolver<Maybe<ResolversTypes['AccessLevel']>, ParentType, ContextType>;
1205
1249
  altStandfirst?: Resolver<Maybe<ResolversTypes['AltStandfirst']>, ParentType, ContextType>;
1206
1250
  altTitle?: Resolver<Maybe<ResolversTypes['AltTitle']>, ParentType, ContextType>;
@@ -1233,7 +1277,8 @@ export type ContentPackageResolvers<ContextType = QueryContext, ParentType exten
1233
1277
  byline?: Resolver<Maybe<ResolversTypes['StructuredContent']>, ParentType, ContextType, Partial<ContentPackageBylineArgs>>;
1234
1278
  canBeSyndicated?: Resolver<Maybe<ResolversTypes['CanBeSyndicated']>, ParentType, ContextType>;
1235
1279
  commentsEnabled?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
1236
- contains?: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['Teaser']>>>, ParentType, ContextType>;
1280
+ contains?: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['Teaser']>>>, ParentType, ContextType, Partial<ContentPackageContainsArgs>>;
1281
+ containsLength?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
1237
1282
  design?: Resolver<Maybe<ResolversTypes['Design']>, ParentType, ContextType>;
1238
1283
  firstPublishedDate?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
1239
1284
  id?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
@@ -1640,6 +1685,31 @@ export type PictureStandardResolvers<ContextType = QueryContext, ParentType exte
1640
1685
  __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
1641
1686
  }>;
1642
1687
 
1688
+ export type PlaceholderResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['Placeholder'] = ResolversParentTypes['Placeholder']> = ResolversObject<{
1689
+ accessLevel?: Resolver<Maybe<ResolversTypes['AccessLevel']>, ParentType, ContextType>;
1690
+ altStandfirst?: Resolver<Maybe<ResolversTypes['AltStandfirst']>, ParentType, ContextType>;
1691
+ altTitle?: Resolver<Maybe<ResolversTypes['AltTitle']>, ParentType, ContextType>;
1692
+ annotations?: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['Concept']>>>, ParentType, ContextType>;
1693
+ body?: Resolver<Maybe<ResolversTypes['RichText']>, ParentType, ContextType>;
1694
+ bodyXML?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
1695
+ byline?: Resolver<Maybe<ResolversTypes['StructuredContent']>, ParentType, ContextType, Partial<PlaceholderBylineArgs>>;
1696
+ canBeSyndicated?: Resolver<Maybe<ResolversTypes['CanBeSyndicated']>, ParentType, ContextType>;
1697
+ commentsEnabled?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
1698
+ containedIn?: Resolver<Maybe<ResolversTypes['Content']>, ParentType, ContextType>;
1699
+ design?: Resolver<Maybe<ResolversTypes['Design']>, ParentType, ContextType>;
1700
+ firstPublishedDate?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
1701
+ id?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
1702
+ mainImage?: Resolver<Maybe<ResolversTypes['Image']>, ParentType, ContextType>;
1703
+ publishedDate?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
1704
+ standfirst?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
1705
+ teaser?: Resolver<Maybe<ResolversTypes['Teaser']>, ParentType, ContextType>;
1706
+ title?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
1707
+ topper?: Resolver<Maybe<ResolversTypes['Topper']>, ParentType, ContextType>;
1708
+ type?: Resolver<ResolversTypes['ContentType'], ParentType, ContextType>;
1709
+ url?: Resolver<ResolversTypes['String'], ParentType, ContextType, Partial<PlaceholderUrlArgs>>;
1710
+ __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
1711
+ }>;
1712
+
1643
1713
  export type PodcastTopperResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['PodcastTopper'] = ResolversParentTypes['PodcastTopper']> = ResolversObject<{
1644
1714
  backgroundBox?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
1645
1715
  backgroundColour?: Resolver<Maybe<ResolversTypes['TopperBackgroundColour']>, ParentType, ContextType>;
@@ -1874,6 +1944,7 @@ export type Resolvers<ContextType = QueryContext> = ResolversObject<{
1874
1944
  PictureFullBleed?: PictureFullBleedResolvers<ContextType>;
1875
1945
  PictureInline?: PictureInlineResolvers<ContextType>;
1876
1946
  PictureStandard?: PictureStandardResolvers<ContextType>;
1947
+ Placeholder?: PlaceholderResolvers<ContextType>;
1877
1948
  PodcastTopper?: PodcastTopperResolvers<ContextType>;
1878
1949
  Query?: QueryResolvers<ContextType>;
1879
1950
  RawImage?: RawImageResolvers<ContextType>;
@@ -29,7 +29,7 @@ import {
29
29
  validLiteralUnionValue,
30
30
  } from '../resolvers/literal-union'
31
31
 
32
- import { Media } from '../generated'
32
+ import { ContentPackageContainsArgs, Media } from '../generated'
33
33
 
34
34
  type Design = {
35
35
  theme: LiteralUnionScalarValues<typeof PackageDesign>
@@ -257,7 +257,7 @@ export class CapiResponse {
257
257
  return this.capiData.publishedDate
258
258
  }
259
259
  firstPublishedDate() {
260
- return this.capiData.firstPublishedDate
260
+ return this.capiData.firstPublishedDate || this.capiData.publishedDate
261
261
  }
262
262
  alternativeTitle() {
263
263
  return this.capiData.alternativeTitles ?? null
@@ -461,16 +461,42 @@ export class CapiResponse {
461
461
  return this.getBrandConcept()?.uuid() === conceptIds.brand.alphaville
462
462
  }
463
463
 
464
+ isPlaceholder() {
465
+ const isArticle = this.capiData.types.includes(
466
+ 'http://www.ft.com/ontology/content/Article'
467
+ )
468
+ const isContent = this.capiData.types.includes(
469
+ 'http://www.ft.com/ontology/content/Content'
470
+ )
471
+
472
+ return !isArticle && isContent
473
+ }
474
+
464
475
  isPodcast() {
465
476
  return this.capiData.types.includes(
466
477
  'http://www.ft.com/ontology/content/Audio'
467
478
  )
468
479
  }
469
480
 
470
- async contains(): Promise<CapiResponse[] | null> {
481
+ async contains({
482
+ surroundingArticles,
483
+ fromId,
484
+ }: Partial<ContentPackageContainsArgs> = {}): Promise<CapiResponse[] | null> {
471
485
  if ('contains' in this.capiData) {
486
+ const fromIndex = this.capiData.contains.findIndex(
487
+ (contains) => contains.id === `http://api.ft.com/things/${fromId}`
488
+ )
489
+
490
+ const contains =
491
+ fromId && surroundingArticles
492
+ ? this.capiData.contains.slice(
493
+ Math.max(0, fromIndex - surroundingArticles),
494
+ fromIndex + surroundingArticles
495
+ )
496
+ : this.capiData.contains
497
+
472
498
  return Promise.all(
473
- this.capiData.contains.map(({ id }) =>
499
+ contains.map(({ id }) =>
474
500
  this.context.dataSources.capi.getContent(uuidFromUrl(id), this)
475
501
  )
476
502
  )
@@ -479,6 +505,14 @@ export class CapiResponse {
479
505
  return null
480
506
  }
481
507
 
508
+ containsLength() {
509
+ if ('contains' in this.capiData) {
510
+ return this.capiData.contains.length
511
+ }
512
+
513
+ return null
514
+ }
515
+
482
516
  async tableOfContents() {
483
517
  return 'tableOfContents' in this.capiData
484
518
  ? this.capiData.tableOfContents
@@ -1,4 +1,5 @@
1
1
  import { articleSchema } from './article'
2
+ import { placeholderSchema } from './placeholder'
2
3
  import { liveBlogPackageSchema } from './live-blog-package'
3
4
  import { contentPackageSchema } from './content-package'
4
5
  import { audioSchema } from './audio'
@@ -10,6 +11,8 @@ export const schemas = (
10
11
  contentType: LiteralUnionScalarValues<typeof ContentType>
11
12
  ) => {
12
13
  switch (contentType) {
14
+ case 'Placeholder':
15
+ return placeholderSchema
13
16
  case 'Article':
14
17
  return articleSchema
15
18
  case 'LiveBlogPackage':
@@ -0,0 +1,40 @@
1
+ import {
2
+ baseContentSchema,
3
+ baseMetadataSchema,
4
+ baseMediaSchema,
5
+ } from './base-schema'
6
+
7
+ const placeholderContentSchema = baseContentSchema.pick({
8
+ title: true,
9
+ standfirst: true,
10
+ byline: true,
11
+ bodyXML: true,
12
+ alternativeTitles: true,
13
+ alternativeStandfirsts: true,
14
+ })
15
+
16
+ const placeholderMetadataSchema = baseMetadataSchema.pick({
17
+ id: true,
18
+ annotations: true,
19
+ webUrl: true,
20
+ type: true,
21
+ types: true,
22
+ standout: true,
23
+ publishedDate: true,
24
+ firstPublishedDate: true,
25
+ accessLevel: true,
26
+ canBeSyndicated: true,
27
+ topper: true,
28
+ comments: true,
29
+ containedIn: true,
30
+ })
31
+
32
+ const placeholderMediaSchema = baseMediaSchema.pick({
33
+ mainImage: true,
34
+ leadImages: true,
35
+ embeds: true,
36
+ })
37
+
38
+ export const placeholderSchema = placeholderContentSchema
39
+ .merge(placeholderMetadataSchema)
40
+ .merge(placeholderMediaSchema)
@@ -2,6 +2,7 @@ import { Topper } from '../model/Topper'
2
2
  import { Byline } from '../model/Byline'
3
3
  import {
4
4
  ArticleResolvers,
5
+ PlaceholderResolvers,
5
6
  AudioResolvers,
6
7
  ContentPackageResolvers,
7
8
  ContentResolvers,
@@ -13,8 +14,9 @@ const resolvers = {
13
14
  Content: {
14
15
  __resolveType: (parent) => {
15
16
  const type = parent.type()
17
+
16
18
  if (type === 'Content') {
17
- return 'Article'
19
+ return parent.isPlaceholder() ? 'Placeholder' : 'Article'
18
20
  }
19
21
 
20
22
  if (type === 'MediaResource') {
@@ -61,13 +63,18 @@ const resolvers = {
61
63
  containedIn: (parent) => parent.containedIn(),
62
64
  },
63
65
 
66
+ Placeholder: {
67
+ containedIn: (parent) => parent.containedIn(),
68
+ },
69
+
64
70
  LiveBlogPackage: {
65
71
  liveBlogPosts: (parent) => parent.liveBlogPosts(),
66
72
  realtime: (parent) => parent.realtime(),
67
73
  },
68
74
 
69
75
  ContentPackage: {
70
- contains: (parent) => parent.contains(),
76
+ contains: (parent, args) => parent.contains(args),
77
+ containsLength: (parent) => parent.containsLength(),
71
78
  },
72
79
 
73
80
  Audio: {
@@ -78,6 +85,7 @@ const resolvers = {
78
85
  },
79
86
  } satisfies {
80
87
  Article: ArticleResolvers
88
+ Placeholder: PlaceholderResolvers
81
89
  Content: ContentResolvers
82
90
  LiveBlogPackage: LiveBlogPackageResolvers
83
91
  ContentPackage: ContentPackageResolvers
@@ -110,6 +110,7 @@ export const RichTextSource = new LiteralUnionScalar<
110
110
  export const ContentType = new LiteralUnionScalar<
111
111
  [
112
112
  'Article',
113
+ 'Placeholder',
113
114
  'Video',
114
115
  'Audio',
115
116
  'LiveBlogPackage',
@@ -122,6 +123,7 @@ export const ContentType = new LiteralUnionScalar<
122
123
  name: 'ContentType',
123
124
  values: [
124
125
  'Article',
126
+ 'Placeholder',
125
127
  'Video',
126
128
  'Audio',
127
129
  'LiveBlogPackage',
@@ -13,6 +13,7 @@ import {
13
13
  } from '../model/schemas/capi/base-schema'
14
14
 
15
15
  import { articleSchema } from '../model/schemas/capi/article'
16
+ import { placeholderSchema } from '../model/schemas/capi/placeholder'
16
17
 
17
18
  import { liveBlogPackageSchema } from '../model/schemas/capi/live-blog-package'
18
19
  import { audioSchema } from '../model/schemas/capi/audio'
@@ -21,6 +22,7 @@ import { videoSchema } from '../model/schemas/capi/video'
21
22
  import { contentPackageSchema } from '../model/schemas/capi/content-package'
22
23
 
23
24
  type Article = z.infer<typeof articleSchema>
25
+ type Placeholder = z.infer<typeof placeholderSchema>
24
26
  type LiveBlogPackage = z.infer<typeof liveBlogPackageSchema>
25
27
  type ContentPackage = z.infer<typeof contentPackageSchema>
26
28
  type Audio = z.infer<typeof audioSchema>
@@ -38,4 +40,9 @@ type LeadImage = z.infer<typeof LeadImage>
38
40
  type ImageSet = z.infer<typeof ImageSet>
39
41
  type MainImage = z.infer<typeof MainImage>
40
42
 
41
- type ContentTypeSchemas = Article | LiveBlogPackage | ContentPackage | Audio
43
+ type ContentTypeSchemas =
44
+ | Article
45
+ | Placeholder
46
+ | LiveBlogPackage
47
+ | ContentPackage
48
+ | Audio