@financial-times/cp-content-pipeline-schema 1.6.0 → 1.6.2

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.
@@ -49,10 +49,10 @@ export declare const placeholderSchema: import("zod").ZodObject<{
49
49
  scoop: boolean;
50
50
  }>>;
51
51
  firstPublishedDate: import("zod").ZodString;
52
- editorialDesk: import("zod").ZodString;
52
+ editorialDesk: import("zod").ZodOptional<import("zod").ZodString>;
53
53
  accessLevel: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"premium">, import("zod").ZodLiteral<"subscribed">, import("zod").ZodLiteral<"registered">, import("zod").ZodLiteral<"free">]>>;
54
54
  canBeSyndicated: import("zod").ZodUnion<[import("zod").ZodLiteral<"yes">, import("zod").ZodLiteral<"no">, import("zod").ZodLiteral<"verify">, import("zod").ZodLiteral<"withContributorPayment">, import("zod").ZodLiteral<"unknown">]>;
55
- canBeDistributed: import("zod").ZodUnion<[import("zod").ZodLiteral<"yes">, import("zod").ZodLiteral<"no">, import("zod").ZodLiteral<"verify">]>;
55
+ canBeDistributed: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"yes">, import("zod").ZodLiteral<"no">, import("zod").ZodLiteral<"verify">]>>;
56
56
  topper: import("zod").ZodOptional<import("zod").ZodObject<{
57
57
  headline: import("zod").ZodOptional<import("zod").ZodString>;
58
58
  standfirst: import("zod").ZodOptional<import("zod").ZodString>;
@@ -1069,31 +1069,31 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1069
1069
  source: import("zod").ZodOptional<import("zod").ZodString>;
1070
1070
  subtitle: import("zod").ZodOptional<import("zod").ZodString>;
1071
1071
  publishedDate: import("zod").ZodOptional<import("zod").ZodString>;
1072
- accessibility: import("zod").ZodObject<{
1073
- captions: import("zod").ZodArray<import("zod").ZodObject<{
1074
- mediaType: import("zod").ZodString;
1075
- url: import("zod").ZodString;
1072
+ accessibility: import("zod").ZodOptional<import("zod").ZodObject<{
1073
+ captions: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
1074
+ mediaType: import("zod").ZodOptional<import("zod").ZodString>;
1075
+ url: import("zod").ZodOptional<import("zod").ZodString>;
1076
1076
  }, "strip", import("zod").ZodTypeAny, {
1077
- mediaType: string;
1078
- url: string;
1077
+ mediaType?: string | undefined;
1078
+ url?: string | undefined;
1079
1079
  }, {
1080
- mediaType: string;
1081
- url: string;
1082
- }>, "many">;
1080
+ mediaType?: string | undefined;
1081
+ url?: string | undefined;
1082
+ }>, "many">>;
1083
1083
  transcript: import("zod").ZodOptional<import("zod").ZodString>;
1084
1084
  }, "strip", import("zod").ZodTypeAny, {
1085
- captions: {
1086
- mediaType: string;
1087
- url: string;
1088
- }[];
1085
+ captions?: {
1086
+ mediaType?: string | undefined;
1087
+ url?: string | undefined;
1088
+ }[] | undefined;
1089
1089
  transcript?: string | undefined;
1090
1090
  }, {
1091
- captions: {
1092
- mediaType: string;
1093
- url: string;
1094
- }[];
1091
+ captions?: {
1092
+ mediaType?: string | undefined;
1093
+ url?: string | undefined;
1094
+ }[] | undefined;
1095
1095
  transcript?: string | undefined;
1096
- }>;
1096
+ }>>;
1097
1097
  }, "strip", import("zod").ZodTypeAny, {
1098
1098
  id: string;
1099
1099
  type: "http://www.ft.com/ontology/content/ClipSet";
@@ -1145,13 +1145,6 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1145
1145
  description?: string | undefined;
1146
1146
  } | undefined;
1147
1147
  }[];
1148
- accessibility: {
1149
- captions: {
1150
- mediaType: string;
1151
- url: string;
1152
- }[];
1153
- transcript?: string | undefined;
1154
- };
1155
1148
  caption?: string | undefined;
1156
1149
  dataCopyright?: string | undefined;
1157
1150
  description?: string | undefined;
@@ -1161,6 +1154,13 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1161
1154
  source?: string | undefined;
1162
1155
  subtitle?: string | undefined;
1163
1156
  publishedDate?: string | undefined;
1157
+ accessibility?: {
1158
+ captions?: {
1159
+ mediaType?: string | undefined;
1160
+ url?: string | undefined;
1161
+ }[] | undefined;
1162
+ transcript?: string | undefined;
1163
+ } | undefined;
1164
1164
  }, {
1165
1165
  id: string;
1166
1166
  type: "http://www.ft.com/ontology/content/ClipSet";
@@ -1212,13 +1212,6 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1212
1212
  description?: string | undefined;
1213
1213
  } | undefined;
1214
1214
  }[];
1215
- accessibility: {
1216
- captions: {
1217
- mediaType: string;
1218
- url: string;
1219
- }[];
1220
- transcript?: string | undefined;
1221
- };
1222
1215
  caption?: string | undefined;
1223
1216
  dataCopyright?: string | undefined;
1224
1217
  description?: string | undefined;
@@ -1228,6 +1221,13 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1228
1221
  source?: string | undefined;
1229
1222
  subtitle?: string | undefined;
1230
1223
  publishedDate?: string | undefined;
1224
+ accessibility?: {
1225
+ captions?: {
1226
+ mediaType?: string | undefined;
1227
+ url?: string | undefined;
1228
+ }[] | undefined;
1229
+ transcript?: string | undefined;
1230
+ } | undefined;
1231
1231
  }>]>, "many">>;
1232
1232
  }, "strip", import("zod").ZodTypeAny, {
1233
1233
  id: string;
@@ -1245,9 +1245,7 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1245
1245
  headshot?: string | undefined;
1246
1246
  }[];
1247
1247
  firstPublishedDate: string;
1248
- editorialDesk: string;
1249
1248
  canBeSyndicated: "unknown" | "yes" | "no" | "verify" | "withContributorPayment";
1250
- canBeDistributed: "yes" | "no" | "verify";
1251
1249
  bodyXML: string;
1252
1250
  type?: string | undefined;
1253
1251
  standfirst?: string | undefined;
@@ -1258,7 +1256,9 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1258
1256
  exclusive: boolean;
1259
1257
  scoop: boolean;
1260
1258
  } | undefined;
1259
+ editorialDesk?: string | undefined;
1261
1260
  accessLevel?: "premium" | "subscribed" | "registered" | "free" | undefined;
1261
+ canBeDistributed?: "yes" | "no" | "verify" | undefined;
1262
1262
  topper?: {
1263
1263
  backgroundColour: string;
1264
1264
  layout: string;
@@ -1477,13 +1477,6 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1477
1477
  description?: string | undefined;
1478
1478
  } | undefined;
1479
1479
  }[];
1480
- accessibility: {
1481
- captions: {
1482
- mediaType: string;
1483
- url: string;
1484
- }[];
1485
- transcript?: string | undefined;
1486
- };
1487
1480
  caption?: string | undefined;
1488
1481
  dataCopyright?: string | undefined;
1489
1482
  description?: string | undefined;
@@ -1493,6 +1486,13 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1493
1486
  source?: string | undefined;
1494
1487
  subtitle?: string | undefined;
1495
1488
  publishedDate?: string | undefined;
1489
+ accessibility?: {
1490
+ captions?: {
1491
+ mediaType?: string | undefined;
1492
+ url?: string | undefined;
1493
+ }[] | undefined;
1494
+ transcript?: string | undefined;
1495
+ } | undefined;
1496
1496
  })[] | undefined;
1497
1497
  }, {
1498
1498
  id: string;
@@ -1510,9 +1510,7 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1510
1510
  headshot?: string | undefined;
1511
1511
  }[];
1512
1512
  firstPublishedDate: string;
1513
- editorialDesk: string;
1514
1513
  canBeSyndicated: "unknown" | "yes" | "no" | "verify" | "withContributorPayment";
1515
- canBeDistributed: "yes" | "no" | "verify";
1516
1514
  bodyXML: string;
1517
1515
  type?: string | undefined;
1518
1516
  standfirst?: string | undefined;
@@ -1523,7 +1521,9 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1523
1521
  exclusive: boolean;
1524
1522
  scoop: boolean;
1525
1523
  } | undefined;
1524
+ editorialDesk?: string | undefined;
1526
1525
  accessLevel?: "premium" | "subscribed" | "registered" | "free" | undefined;
1526
+ canBeDistributed?: "yes" | "no" | "verify" | undefined;
1527
1527
  topper?: {
1528
1528
  backgroundColour: string;
1529
1529
  layout: string;
@@ -1742,13 +1742,6 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1742
1742
  description?: string | undefined;
1743
1743
  } | undefined;
1744
1744
  }[];
1745
- accessibility: {
1746
- captions: {
1747
- mediaType: string;
1748
- url: string;
1749
- }[];
1750
- transcript?: string | undefined;
1751
- };
1752
1745
  caption?: string | undefined;
1753
1746
  dataCopyright?: string | undefined;
1754
1747
  description?: string | undefined;
@@ -1758,5 +1751,12 @@ export declare const placeholderSchema: import("zod").ZodObject<{
1758
1751
  source?: string | undefined;
1759
1752
  subtitle?: string | undefined;
1760
1753
  publishedDate?: string | undefined;
1754
+ accessibility?: {
1755
+ captions?: {
1756
+ mediaType?: string | undefined;
1757
+ url?: string | undefined;
1758
+ }[] | undefined;
1759
+ transcript?: string | undefined;
1760
+ } | undefined;
1761
1761
  })[] | undefined;
1762
1762
  }>;
@@ -10,12 +10,12 @@ export declare const ClipSet: {
10
10
  dataLayout: (parent: ReferenceWithCAPIData<OldClipContentTree | ClipSetWorkaroundContentTree>) => string;
11
11
  caption: (parent: ReferenceWithCAPIData<OldClipContentTree | ClipSetWorkaroundContentTree>) => string;
12
12
  accessibility: (parent: ReferenceWithCAPIData<OldClipContentTree | ClipSetWorkaroundContentTree>) => {
13
- captions: {
14
- mediaType: string;
15
- url: string;
16
- }[];
13
+ captions?: {
14
+ mediaType?: string | undefined;
15
+ url?: string | undefined;
16
+ }[] | undefined;
17
17
  transcript?: string | undefined;
18
- };
18
+ } | null;
19
19
  description: (parent: ReferenceWithCAPIData<OldClipContentTree | ClipSetWorkaroundContentTree>) => string;
20
20
  credits: (parent: ReferenceWithCAPIData<OldClipContentTree | ClipSetWorkaroundContentTree>) => string;
21
21
  displayTitle: (parent: ReferenceWithCAPIData<OldClipContentTree | ClipSetWorkaroundContentTree>) => string | null;
@@ -24,7 +24,7 @@ declare const resolvers: {
24
24
  publishedDate: (parent: import("../model/CapiResponse").CapiResponse) => string;
25
25
  annotations: (parent: import("../model/CapiResponse").CapiResponse) => import("../model/Concept").Concept[];
26
26
  accessLevel: (parent: import("../model/CapiResponse").CapiResponse) => "premium" | "subscribed" | "registered" | "free";
27
- editorialDesk: (parent: import("../model/CapiResponse").CapiResponse) => string;
27
+ editorialDesk: (parent: import("../model/CapiResponse").CapiResponse) => string | null;
28
28
  canBeSyndicated: (parent: import("../model/CapiResponse").CapiResponse) => "unknown" | "yes" | "no" | "verify" | "withContributorPayment";
29
29
  originatingParty: (parent: import("../model/CapiResponse").CapiResponse) => string | null;
30
30
  commentsEnabled: (parent: import("../model/CapiResponse").CapiResponse) => boolean;
@@ -139,7 +139,7 @@ declare const resolvers: {
139
139
  publishedDate: (parent: import("../model/CapiResponse").CapiResponse) => string;
140
140
  annotations: (parent: import("../model/CapiResponse").CapiResponse) => import("../model/Concept").Concept[];
141
141
  accessLevel: (parent: import("../model/CapiResponse").CapiResponse) => "premium" | "subscribed" | "registered" | "free";
142
- editorialDesk: (parent: import("../model/CapiResponse").CapiResponse) => string;
142
+ editorialDesk: (parent: import("../model/CapiResponse").CapiResponse) => string | null;
143
143
  canBeSyndicated: (parent: import("../model/CapiResponse").CapiResponse) => "unknown" | "yes" | "no" | "verify" | "withContributorPayment";
144
144
  originatingParty: (parent: import("../model/CapiResponse").CapiResponse) => string | null;
145
145
  commentsEnabled: (parent: import("../model/CapiResponse").CapiResponse) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/cp-content-pipeline-schema",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -238,7 +238,7 @@ export class CapiResponse {
238
238
  return this.capiData.accessLevel ?? 'subscribed'
239
239
  }
240
240
  editorialDesk() {
241
- return this.capiData.editorialDesk
241
+ return this.capiData.editorialDesk ?? null
242
242
  }
243
243
  canBeSyndicated(): LiteralUnionScalarValues<typeof CanBeSyndicated> {
244
244
  return this.capiData.canBeSyndicated
@@ -249,8 +249,12 @@ export class Topper {
249
249
  return 'inverse'
250
250
  }
251
251
 
252
- if (this.capiResponse.isOpinion() && this.backgroundColour() === 'sky') {
253
- return 'opinion'
252
+ if (this.capiResponse.isOpinion()) {
253
+ if (this.backgroundColour() === 'sky') {
254
+ return 'opinion'
255
+ } else {
256
+ return 'standard'
257
+ }
254
258
  }
255
259
 
256
260
  if (this.capiResponse.isAlphaville()) {
@@ -124,12 +124,12 @@ export const ClipSet = z.object({
124
124
  accessibility: z.object({
125
125
  captions: z.array(
126
126
  z.object({
127
- mediaType: z.string(),
128
- url: z.string(),
127
+ mediaType: z.string().optional(),
128
+ url: z.string().optional(),
129
129
  })
130
- ),
130
+ ).optional(),
131
131
  transcript: z.string().optional(),
132
- }),
132
+ }).optional(),
133
133
  })
134
134
 
135
135
  export const DataSource = z.object({
@@ -183,7 +183,7 @@ export const baseMetadataSchema = z.object({
183
183
  publishedDate: z.string(),
184
184
  firstPublishedDate: z.string(),
185
185
  realtime: z.boolean(),
186
- editorialDesk: z.string(),
186
+ editorialDesk: z.string().optional(),
187
187
  accessLevel: z
188
188
  .union([
189
189
  z.literal('premium'),
@@ -199,11 +199,9 @@ export const baseMetadataSchema = z.object({
199
199
  z.literal('withContributorPayment'),
200
200
  z.literal('unknown'),
201
201
  ]),
202
- canBeDistributed: z.union([
203
- z.literal('yes'),
204
- z.literal('no'),
205
- z.literal('verify'),
206
- ]),
202
+ canBeDistributed: z
203
+ .union([z.literal('yes'), z.literal('no'), z.literal('verify')])
204
+ .optional(),
207
205
  topper: Topper.optional(),
208
206
  comments: z
209
207
  .object({