@financial-times/cp-content-pipeline-schema 2.15.0 → 3.0.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.
Files changed (161) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/lib/datasources/capi.d.ts +2 -2
  3. package/lib/datasources/capi.js +4 -2
  4. package/lib/datasources/capi.js.map +1 -1
  5. package/lib/datasources/capi.test.js +2 -2
  6. package/lib/fixtures/capiObject.d.ts +2 -2
  7. package/lib/fixtures/capiObject.js +2 -0
  8. package/lib/fixtures/capiObject.js.map +1 -1
  9. package/lib/fixtures/capiPerson.d.ts +1 -1
  10. package/lib/generated/index.d.ts +296 -131
  11. package/lib/helpers/decorateHeadshotUrl.d.ts +1 -2
  12. package/lib/helpers/decorateHeadshotUrl.js +2 -3
  13. package/lib/helpers/decorateHeadshotUrl.js.map +1 -1
  14. package/lib/model/Byline.d.ts +8 -10
  15. package/lib/model/Byline.js +34 -33
  16. package/lib/model/Byline.js.map +1 -1
  17. package/lib/model/Byline.test.js +105 -52
  18. package/lib/model/Byline.test.js.map +1 -1
  19. package/lib/model/CapiResponse.d.ts +12 -16
  20. package/lib/model/CapiResponse.js +38 -41
  21. package/lib/model/CapiResponse.js.map +1 -1
  22. package/lib/model/CapiResponse.test.js +7 -18
  23. package/lib/model/CapiResponse.test.js.map +1 -1
  24. package/lib/model/Clip.d.ts +1 -1
  25. package/lib/model/Concept.d.ts +1 -1
  26. package/lib/model/Concept.js +1 -2
  27. package/lib/model/Concept.js.map +1 -1
  28. package/lib/model/FlourishSource.d.ts +1 -1
  29. package/lib/model/FlourishSource.js.map +1 -1
  30. package/lib/model/Image.d.ts +1 -1
  31. package/lib/model/LeadFlourish.test.js +1 -0
  32. package/lib/model/LeadFlourish.test.js.map +1 -1
  33. package/lib/model/Person.d.ts +6 -12
  34. package/lib/model/Person.js +39 -66
  35. package/lib/model/Person.js.map +1 -1
  36. package/lib/model/Person.test.js +7 -60
  37. package/lib/model/Person.test.js.map +1 -1
  38. package/lib/model/Picture.d.ts +1 -1
  39. package/lib/model/RichText.d.ts +1 -2
  40. package/lib/model/Topper.d.ts +1 -1
  41. package/lib/model/Topper.js +10 -8
  42. package/lib/model/Topper.js.map +1 -1
  43. package/lib/model/Topper.test.js +9 -10
  44. package/lib/model/Topper.test.js.map +1 -1
  45. package/lib/model/schemas/capi/article.d.ts +7 -4
  46. package/lib/model/schemas/capi/article.js +1 -0
  47. package/lib/model/schemas/capi/article.js.map +1 -1
  48. package/lib/model/schemas/capi/audio.d.ts +7 -4
  49. package/lib/model/schemas/capi/audio.js +1 -0
  50. package/lib/model/schemas/capi/audio.js.map +1 -1
  51. package/lib/model/schemas/capi/base-schema.d.ts +14 -123
  52. package/lib/model/schemas/capi/base-schema.js +7 -6
  53. package/lib/model/schemas/capi/base-schema.js.map +1 -1
  54. package/lib/model/schemas/capi/content-package.d.ts +10 -5
  55. package/lib/model/schemas/capi/content-package.js +2 -0
  56. package/lib/model/schemas/capi/content-package.js.map +1 -1
  57. package/lib/model/schemas/capi/index.d.ts +41 -22
  58. package/lib/model/schemas/capi/internal-content.d.ts +24 -0
  59. package/lib/model/schemas/capi/internal-content.js +3 -0
  60. package/lib/model/schemas/capi/internal-content.js.map +1 -0
  61. package/lib/model/schemas/capi/live-blog-package.d.ts +7 -4
  62. package/lib/model/schemas/capi/live-blog-package.js +1 -0
  63. package/lib/model/schemas/capi/live-blog-package.js.map +1 -1
  64. package/lib/model/schemas/capi/placeholder.d.ts +7 -4
  65. package/lib/model/schemas/capi/placeholder.js +1 -0
  66. package/lib/model/schemas/capi/placeholder.js.map +1 -1
  67. package/lib/model/schemas/capi/video.d.ts +10 -5
  68. package/lib/model/schemas/capi/video.js +2 -0
  69. package/lib/model/schemas/capi/video.js.map +1 -1
  70. package/lib/resolvers/concept.d.ts +37 -2
  71. package/lib/resolvers/concept.js +17 -10
  72. package/lib/resolvers/concept.js.map +1 -1
  73. package/lib/resolvers/content-tree/Workarounds.d.ts +19 -11
  74. package/lib/resolvers/content-tree/references/Author.d.ts +4 -0
  75. package/lib/resolvers/content-tree/references/Author.js +14 -0
  76. package/lib/resolvers/content-tree/references/Author.js.map +1 -0
  77. package/lib/resolvers/content-tree/references/ClipSet.d.ts +1 -1
  78. package/lib/resolvers/content-tree/references/ClipSet.js +1 -1
  79. package/lib/resolvers/content-tree/references/ClipSet.js.map +1 -1
  80. package/lib/resolvers/content-tree/references/Flourish.d.ts +1 -1
  81. package/lib/resolvers/content-tree/references/Reference.d.ts +1 -1
  82. package/lib/resolvers/content-tree/references/index.d.ts +4 -2
  83. package/lib/resolvers/content-tree/references/index.js +4 -1
  84. package/lib/resolvers/content-tree/references/index.js.map +1 -1
  85. package/lib/resolvers/content-tree/updateTreeWithReferenceIds.d.ts +3 -3
  86. package/lib/resolvers/content-tree/updateTreeWithReferenceIds.js +2 -3
  87. package/lib/resolvers/content-tree/updateTreeWithReferenceIds.js.map +1 -1
  88. package/lib/resolvers/content.d.ts +27 -18
  89. package/lib/resolvers/content.js +4 -2
  90. package/lib/resolvers/content.js.map +1 -1
  91. package/lib/resolvers/image.d.ts +12 -12
  92. package/lib/resolvers/index.d.ts +89 -42
  93. package/lib/resolvers/leadFlourish.d.ts +2 -1
  94. package/lib/resolvers/leadFlourish.js +1 -0
  95. package/lib/resolvers/leadFlourish.js.map +1 -1
  96. package/lib/resolvers/person.d.ts +1 -1
  97. package/lib/resolvers/person.js +1 -1
  98. package/lib/resolvers/person.js.map +1 -1
  99. package/lib/resolvers/picture.d.ts +4 -4
  100. package/lib/resolvers/richText.d.ts +1 -1
  101. package/lib/resolvers/teaser.d.ts +1 -1
  102. package/lib/resolvers/topper.d.ts +3 -3
  103. package/package.json +1 -1
  104. package/queries/article.graphql +35 -13
  105. package/src/datasources/capi.test.ts +3 -3
  106. package/src/datasources/capi.ts +5 -3
  107. package/src/fixtures/capiObject.ts +4 -2
  108. package/src/fixtures/capiPerson.ts +1 -1
  109. package/src/generated/index.ts +321 -132
  110. package/src/helpers/decorateHeadshotUrl.ts +2 -2
  111. package/src/model/Byline.test.ts +136 -55
  112. package/src/model/Byline.ts +49 -39
  113. package/src/model/CapiResponse.test.ts +9 -25
  114. package/src/model/CapiResponse.ts +83 -56
  115. package/src/model/Clip.ts +1 -1
  116. package/src/model/Concept.ts +3 -3
  117. package/src/model/FlourishSource.ts +1 -1
  118. package/src/model/Image.test.ts +1 -1
  119. package/src/model/Image.ts +1 -1
  120. package/src/model/LeadFlourish.test.ts +1 -0
  121. package/src/model/Person.test.ts +11 -62
  122. package/src/model/Person.ts +47 -51
  123. package/src/model/Picture.test.ts +1 -1
  124. package/src/model/Picture.ts +1 -1
  125. package/src/model/Topper.test.ts +22 -18
  126. package/src/model/Topper.ts +10 -9
  127. package/src/model/__snapshots__/Byline.test.ts.snap +166 -27
  128. package/src/model/schemas/capi/article.ts +1 -0
  129. package/src/model/schemas/capi/audio.ts +1 -0
  130. package/src/model/schemas/capi/base-schema.ts +5 -4
  131. package/src/model/schemas/capi/content-package.ts +2 -0
  132. package/src/model/schemas/capi/internal-content.ts +45 -0
  133. package/src/model/schemas/capi/live-blog-package.ts +1 -0
  134. package/src/model/schemas/capi/placeholder.ts +1 -0
  135. package/src/model/schemas/capi/video.ts +2 -0
  136. package/src/resolvers/concept.ts +29 -12
  137. package/src/resolvers/content-tree/Workarounds.ts +39 -20
  138. package/src/resolvers/content-tree/references/Author.ts +18 -0
  139. package/src/resolvers/content-tree/references/ClipSet.ts +6 -8
  140. package/src/resolvers/content-tree/references/ImageSet.ts +1 -1
  141. package/src/resolvers/content-tree/references/ScrollyImage.ts +1 -1
  142. package/src/resolvers/content-tree/references/index.ts +6 -1
  143. package/src/resolvers/content-tree/updateTreeWithReferenceIds.ts +6 -8
  144. package/src/resolvers/content.ts +4 -2
  145. package/src/resolvers/leadFlourish.ts +1 -0
  146. package/src/resolvers/person.ts +1 -1
  147. package/src/types/n-display-metadata.d.ts +1 -1
  148. package/tsconfig.tsbuildinfo +1 -1
  149. package/typedefs/clip.graphql +2 -2
  150. package/typedefs/concept.graphql +64 -2
  151. package/typedefs/content.graphql +63 -39
  152. package/typedefs/image.graphql +12 -12
  153. package/typedefs/leadFlourish.graphql +32 -0
  154. package/typedefs/person.graphql +2 -2
  155. package/typedefs/picture.graphql +6 -6
  156. package/typedefs/references/author.graphql +7 -0
  157. package/typedefs/references/clipSet.graphql +14 -2
  158. package/typedefs/references/tweet.graphql +1 -1
  159. package/typedefs/teaser.graphql +10 -10
  160. package/src/types/internal-content.d.ts +0 -55
  161. package/typedefs/leadFlouish.graphql +0 -29
@@ -43,7 +43,7 @@ export declare const videoSchema: import("zod").ZodObject<import("zod").objectUt
43
43
  theme: "special-report" | "extra" | "basic" | "extra-wide";
44
44
  }>;
45
45
  transcript: import("zod").ZodOptional<import("zod").ZodString>;
46
- }, "title" | "transcript" | "alternativeTitles">, Pick<{
46
+ }, "title" | "transcript" | "byline" | "alternativeTitles">, Pick<{
47
47
  id: import("zod").ZodString;
48
48
  annotations: import("zod").ZodArray<import("zod").ZodObject<import("zod").objectUtil.extendShape<{
49
49
  id: import("zod").ZodString;
@@ -93,7 +93,8 @@ export declare const videoSchema: import("zod").ZodObject<import("zod").objectUt
93
93
  }>>;
94
94
  publishedDate: import("zod").ZodString;
95
95
  firstPublishedDate: import("zod").ZodString;
96
- publishReference: import("zod").ZodString;
96
+ publishReference: import("zod").ZodOptional<import("zod").ZodString>;
97
+ lastModified: import("zod").ZodString;
97
98
  realtime: import("zod").ZodBoolean;
98
99
  editorialDesk: import("zod").ZodOptional<import("zod").ZodString>;
99
100
  accessLevel: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"premium">, import("zod").ZodLiteral<"subscribed">, import("zod").ZodLiteral<"registered">, import("zod").ZodLiteral<"free">]>>;
@@ -151,7 +152,7 @@ export declare const videoSchema: import("zod").ZodObject<import("zod").objectUt
151
152
  labelType: string;
152
153
  sequence: string;
153
154
  }>>;
154
- }, "id" | "types" | "publishedDate" | "annotations" | "webUrl" | "canonicalWebUrl" | "firstPublishedDate" | "publishReference" | "editorialDesk" | "accessLevel" | "canBeSyndicated" | "canBeDistributed">>, Pick<{
155
+ }, "id" | "types" | "publishedDate" | "annotations" | "webUrl" | "canonicalWebUrl" | "firstPublishedDate" | "publishReference" | "lastModified" | "editorialDesk" | "accessLevel" | "canBeSyndicated" | "canBeDistributed">>, Pick<{
155
156
  mainImage: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<"type", [import("zod").ZodObject<{
156
157
  id: import("zod").ZodString;
157
158
  type: import("zod").ZodLiteral<"http://www.ft.com/ontology/content/ImageSet">;
@@ -1328,14 +1329,16 @@ export declare const videoSchema: import("zod").ZodObject<import("zod").objectUt
1328
1329
  headshot?: string | undefined;
1329
1330
  }[];
1330
1331
  firstPublishedDate: string;
1331
- publishReference: string;
1332
+ lastModified: string;
1332
1333
  canBeSyndicated: "unknown" | "yes" | "no" | "verify" | "withContributorPayment";
1333
1334
  transcript?: string | undefined;
1334
1335
  webUrl?: string | undefined;
1335
1336
  canonicalWebUrl?: string | undefined;
1337
+ publishReference?: string | undefined;
1336
1338
  editorialDesk?: string | undefined;
1337
1339
  accessLevel?: "premium" | "subscribed" | "registered" | "free" | undefined;
1338
1340
  canBeDistributed?: "yes" | "no" | "verify" | undefined;
1341
+ byline?: string | undefined;
1339
1342
  alternativeTitles?: {
1340
1343
  promotionalTitle: string;
1341
1344
  } | undefined;
@@ -1417,14 +1420,16 @@ export declare const videoSchema: import("zod").ZodObject<import("zod").objectUt
1417
1420
  headshot?: string | undefined;
1418
1421
  }[];
1419
1422
  firstPublishedDate: string;
1420
- publishReference: string;
1423
+ lastModified: string;
1421
1424
  canBeSyndicated: "unknown" | "yes" | "no" | "verify" | "withContributorPayment";
1422
1425
  transcript?: string | undefined;
1423
1426
  webUrl?: string | undefined;
1424
1427
  canonicalWebUrl?: string | undefined;
1428
+ publishReference?: string | undefined;
1425
1429
  editorialDesk?: string | undefined;
1426
1430
  accessLevel?: "premium" | "subscribed" | "registered" | "free" | undefined;
1427
1431
  canBeDistributed?: "yes" | "no" | "verify" | undefined;
1432
+ byline?: string | undefined;
1428
1433
  alternativeTitles?: {
1429
1434
  promotionalTitle: string;
1430
1435
  } | undefined;
@@ -6,6 +6,7 @@ const videoContentSchema = base_schema_1.baseContentSchema.pick({
6
6
  title: true,
7
7
  transcript: true,
8
8
  alternativeTitles: true,
9
+ byline: true,
9
10
  });
10
11
  const videoMetadataSchema = base_schema_1.baseMetadataSchema.pick({
11
12
  id: true,
@@ -15,6 +16,7 @@ const videoMetadataSchema = base_schema_1.baseMetadataSchema.pick({
15
16
  types: true,
16
17
  publishedDate: true,
17
18
  firstPublishedDate: true,
19
+ lastModified: true,
18
20
  publishReference: true,
19
21
  accessLevel: true,
20
22
  editorialDesk: true,
@@ -1 +1 @@
1
- {"version":3,"file":"video.js","sourceRoot":"","sources":["../../../../src/model/schemas/capi/video.ts"],"names":[],"mappings":";;;AAAA,+CAIsB;AAEtB,MAAM,kBAAkB,GAAG,+BAAiB,CAAC,IAAI,CAAC;IAChD,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,IAAI;IAChB,iBAAiB,EAAE,IAAI;CACxB,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,gCAAkB,CAAC,IAAI,CAAC;IAClD,EAAE,EAAE,IAAI;IACR,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,eAAe,EAAE,IAAI;IACrB,KAAK,EAAE,IAAI;IACX,aAAa,EAAE,IAAI;IACnB,kBAAkB,EAAE,IAAI;IACxB,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,6BAAe,CAAC,IAAI,CAAC;IAC5C,SAAS,EAAE,IAAI;CAChB,CAAC,CAAA;AAEW,QAAA,WAAW,GAAG,kBAAkB;KAC1C,KAAK,CAAC,mBAAmB,CAAC;KAC1B,KAAK,CAAC,gBAAgB,CAAC,CAAA"}
1
+ {"version":3,"file":"video.js","sourceRoot":"","sources":["../../../../src/model/schemas/capi/video.ts"],"names":[],"mappings":";;;AAAA,+CAIsB;AAEtB,MAAM,kBAAkB,GAAG,+BAAiB,CAAC,IAAI,CAAC;IAChD,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,IAAI;IAChB,iBAAiB,EAAE,IAAI;IACvB,MAAM,EAAE,IAAI;CACb,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,gCAAkB,CAAC,IAAI,CAAC;IAClD,EAAE,EAAE,IAAI;IACR,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,eAAe,EAAE,IAAI;IACrB,KAAK,EAAE,IAAI;IACX,aAAa,EAAE,IAAI;IACnB,kBAAkB,EAAE,IAAI;IACxB,YAAY,EAAE,IAAI;IAClB,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,6BAAe,CAAC,IAAI,CAAC;IAC5C,SAAS,EAAE,IAAI;CAChB,CAAC,CAAA;AAEW,QAAA,WAAW,GAAG,kBAAkB;KAC1C,KAAK,CAAC,mBAAmB,CAAC;KAC1B,KAAK,CAAC,gBAAgB,CAAC,CAAA"}
@@ -1,5 +1,40 @@
1
- import { ConceptResolvers } from '../generated';
2
1
  declare const resolvers: {
3
- Concept: ConceptResolvers;
2
+ ConceptInterface: {
3
+ __resolveType: (parent: import("../model/Concept").Concept) => "Concept" | "Author";
4
+ apiUrl: (parent: import("../model/Concept").Concept) => string;
5
+ directType: (parent: import("../model/Concept").Concept) => string;
6
+ isPackageBrand: (parent: import("../model/Concept").Concept) => boolean;
7
+ id: (parent: import("../model/Concept").Concept) => string;
8
+ predicate: (parent: import("../model/Concept").Concept) => string;
9
+ prefLabel: (parent: import("../model/Concept").Concept) => string;
10
+ type: (parent: import("../model/Concept").Concept) => string | null;
11
+ types: (parent: import("../model/Concept").Concept) => string[];
12
+ url: (parent: import("../model/Concept").Concept, args: Partial<import("../generated").ConceptInterfaceUrlArgs>) => Promise<string>;
13
+ };
14
+ Concept: {
15
+ __resolveType: (parent: import("../model/Concept").Concept) => "Concept" | "Author";
16
+ apiUrl: (parent: import("../model/Concept").Concept) => string;
17
+ directType: (parent: import("../model/Concept").Concept) => string;
18
+ isPackageBrand: (parent: import("../model/Concept").Concept) => boolean;
19
+ id: (parent: import("../model/Concept").Concept) => string;
20
+ predicate: (parent: import("../model/Concept").Concept) => string;
21
+ prefLabel: (parent: import("../model/Concept").Concept) => string;
22
+ type: (parent: import("../model/Concept").Concept) => string | null;
23
+ types: (parent: import("../model/Concept").Concept) => string[];
24
+ url: (parent: import("../model/Concept").Concept, args: Partial<import("../generated").ConceptInterfaceUrlArgs>) => Promise<string>;
25
+ };
26
+ Author: {
27
+ person: (parent: import("../model/Concept").Concept, _: {}, context: import("..").QueryContext) => Promise<import("../model/Person").Person>;
28
+ __resolveType: (parent: import("../model/Concept").Concept) => "Concept" | "Author";
29
+ apiUrl: (parent: import("../model/Concept").Concept) => string;
30
+ directType: (parent: import("../model/Concept").Concept) => string;
31
+ isPackageBrand: (parent: import("../model/Concept").Concept) => boolean;
32
+ id: (parent: import("../model/Concept").Concept) => string;
33
+ predicate: (parent: import("../model/Concept").Concept) => string;
34
+ prefLabel: (parent: import("../model/Concept").Concept) => string;
35
+ type: (parent: import("../model/Concept").Concept) => string | null;
36
+ types: (parent: import("../model/Concept").Concept) => string[];
37
+ url: (parent: import("../model/Concept").Concept, args: Partial<import("../generated").ConceptInterfaceUrlArgs>) => Promise<string>;
38
+ };
4
39
  };
5
40
  export default resolvers;
@@ -1,16 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const conceptResolvers = {
4
+ __resolveType: (parent) => (parent.isAuthor() ? 'Author' : 'Concept'),
5
+ apiUrl: (parent) => parent.apiUrl(),
6
+ directType: (parent) => parent.directType(),
7
+ isPackageBrand: (parent) => parent.isPackageBrand(),
8
+ id: (parent) => parent.uuid(),
9
+ predicate: (parent) => parent.predicate(),
10
+ prefLabel: (parent) => parent.prefLabel(),
11
+ type: (parent) => parent.type(),
12
+ types: (parent) => parent.types(),
13
+ url: async (parent, args) => parent.url(args),
14
+ };
3
15
  const resolvers = {
4
- Concept: {
5
- apiUrl: (parent) => parent.apiUrl(),
6
- directType: (parent) => parent.directType(),
7
- isPackageBrand: (parent) => parent.isPackageBrand(),
8
- id: (parent) => parent.uuid(),
9
- predicate: (parent) => parent.predicate(),
10
- prefLabel: (parent) => parent.prefLabel(),
11
- type: (parent) => parent.type(),
12
- types: (parent) => parent.types(),
13
- url: async (parent, args) => parent.url(args),
16
+ ConceptInterface: conceptResolvers,
17
+ Concept: conceptResolvers,
18
+ Author: {
19
+ ...conceptResolvers,
20
+ person: (parent, _, context) => context.dataSources.capi.getPerson(parent.uuid()),
14
21
  },
15
22
  };
16
23
  exports.default = resolvers;
@@ -1 +1 @@
1
- {"version":3,"file":"concept.js","sourceRoot":"","sources":["../../src/resolvers/concept.ts"],"names":[],"mappings":";;AAEA,MAAM,SAAS,GAAkC;IAC/C,OAAO,EAAE;QACP,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE;QACnC,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE;QAC3C,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE;QACnD,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE;QAC7B,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE;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,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;CACV,CAAA;AAErC,MAAM,SAAS,GAAG;IAChB,gBAAgB,EAAE,gBAAgB;IAClC,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE;QACN,GAAG,gBAAgB;QACnB,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAC7B,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KACpD;CAKF,CAAA;AAED,kBAAe,SAAS,CAAA"}
@@ -1,9 +1,13 @@
1
1
  import { ContentTree as ContentTreeNamespace } from '@financial-times/content-tree';
2
2
  import ContentTree = ContentTreeNamespace.transit;
3
- export interface AuthorLink extends ContentTree.Parent {
4
- type: 'author-link';
5
- href: string;
6
- children: ContentTree.Text[];
3
+ export interface Byline extends ContentTree.Parent {
4
+ type: 'byline';
5
+ children: (ContentTree.Text | Author)[];
6
+ }
7
+ export interface Author extends ContentTree.Parent {
8
+ type: 'author';
9
+ id: string;
10
+ children: [ContentTree.Text];
7
11
  }
8
12
  export interface Cite extends ContentTree.Node {
9
13
  type: 'cite';
@@ -19,7 +23,7 @@ export interface RawImage extends ContentTree.Node {
19
23
  height?: number;
20
24
  width?: number;
21
25
  }
22
- export interface ContentTreePullquote extends ContentTree.Pullquote {
26
+ export interface Pullquote extends ContentTree.Pullquote {
23
27
  children: ContentTree.ImageSet[];
24
28
  }
25
29
  export type MainImage = Omit<ContentTree.ImageSet, 'type'> & {
@@ -31,12 +35,9 @@ export type MainImageRaw = Omit<RawImage, 'type'> & {
31
35
  export interface Video extends ContentTree.Node {
32
36
  type: 'video';
33
37
  id: string;
38
+ title?: string;
34
39
  embedded: boolean;
35
40
  }
36
- export interface YoutubeVideo extends ContentTree.Node {
37
- type: 'youtube-video';
38
- url: string;
39
- }
40
41
  export interface OldClip extends ContentTree.Node {
41
42
  type: 'clip';
42
43
  url: string;
@@ -104,5 +105,12 @@ export interface Body extends ContentTree.Parent {
104
105
  version: number;
105
106
  children: BodyBlock[];
106
107
  }
107
- export type BodyBlock = ContentTree.Paragraph | ContentTree.Heading | ContentTree.ImageSet | ContentTree.BigNumber | ContentTree.CustomCodeComponent | ContentTree.Layout | ContentTree.List | ContentTree.Blockquote | ContentTree.Pullquote | ContentTree.ScrollyBlock | ContentTree.ThematicBreak | Table | Recommended | ContentTree.Tweet | Video | YoutubeVideo;
108
- export type AnyNode = ContentTree.Text | ContentTree.Break | ContentTree.ThematicBreak | ContentTree.Paragraph | ContentTree.Heading | ContentTree.Strong | ContentTree.Emphasis | ContentTree.Strikethrough | ContentTree.Link | ContentTree.List | ContentTree.ListItem | ContentTree.Blockquote | ContentTree.Pullquote | ContentTree.ImageSet | ContentTree.CustomCodeComponent | ContentTree.Root | Body | ClipSet | OldClip | Recommended | ContentTree.Tweet | ContentTree.Flourish | ContentTree.BigNumber | ContentTree.ScrollyBlock | ContentTree.ScrollySection | ContentTree.ScrollyCopy | ContentTree.ScrollyHeading | ContentTree.ScrollyImage | ContentTree.Layout | ContentTree.LayoutSlot | ContentTree.LayoutImage | Table | TableCaption | TableFooter | TableBody | TableRow | TableCell | Video | YoutubeVideo | MainImage | MainImageRaw | RawImage | AuthorLink | Cite;
108
+ export type Image = Omit<ContentTree.Image, 'format'> & {
109
+ format: 'standard' | 'standard-inline' | 'desktop' | 'mobile' | 'wide' | 'square' | 'square-ftedit' | 'portrait' | 'landscape';
110
+ };
111
+ export type Flourish = Omit<ContentTree.Flourish, 'layoutWidth' | 'fallbackImage'> & {
112
+ layoutWidth?: string;
113
+ fallbackImage?: Image;
114
+ };
115
+ export type BodyBlock = ContentTree.Paragraph | ContentTree.Heading | ContentTree.ImageSet | ContentTree.BigNumber | ContentTree.CustomCodeComponent | ContentTree.Layout | ContentTree.List | ContentTree.Blockquote | Pullquote | ContentTree.ScrollyBlock | ContentTree.ThematicBreak | Table | Recommended | ContentTree.Tweet | Video | ContentTree.YoutubeVideo;
116
+ export type AnyNode = ContentTree.Text | ContentTree.Break | ContentTree.ThematicBreak | ContentTree.Paragraph | ContentTree.Heading | ContentTree.Strong | ContentTree.Emphasis | ContentTree.Strikethrough | ContentTree.Link | ContentTree.List | ContentTree.ListItem | ContentTree.Blockquote | Pullquote | ContentTree.ImageSet | ContentTree.CustomCodeComponent | ContentTree.Root | Body | ClipSet | OldClip | Recommended | ContentTree.Tweet | Flourish | ContentTree.BigNumber | ContentTree.ScrollyBlock | ContentTree.ScrollySection | ContentTree.ScrollyCopy | ContentTree.ScrollyHeading | ContentTree.ScrollyImage | ContentTree.Layout | ContentTree.LayoutSlot | ContentTree.LayoutImage | Table | TableCaption | TableFooter | TableBody | TableRow | TableCell | Video | ContentTree.YoutubeVideo | MainImage | MainImageRaw | RawImage | Byline | Author | Cite;
@@ -0,0 +1,4 @@
1
+ export declare const Author: {
2
+ type: (parent: import(".").ReferenceWithCAPIData<import("../Workarounds").Author>) => "author";
3
+ concept: (parent: import(".").ReferenceWithCAPIData<import("../Workarounds").Author>) => import("../../../model/Concept").Concept | null;
4
+ };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Author = void 0;
4
+ const Concept_1 = require("../../../model/Concept");
5
+ exports.Author = {
6
+ type: (parent) => parent.reference.type,
7
+ concept: (parent) => {
8
+ const authorAnnotations = parent.contentApiData?.annotations({
9
+ byPredicate: Concept_1.predicates.hasAuthor,
10
+ }) ?? [];
11
+ return (authorAnnotations.find((concept) => concept.uuid() === parent.reference.id) ?? null);
12
+ },
13
+ };
14
+ //# sourceMappingURL=Author.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Author.js","sourceRoot":"","sources":["../../../../src/resolvers/content-tree/references/Author.ts"],"names":[],"mappings":";;;AACA,oDAAmD;AAEtC,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI;IACvC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE;QAClB,MAAM,iBAAiB,GACrB,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC;YACjC,WAAW,EAAE,oBAAU,CAAC,SAAS;SAClC,CAAC,IAAI,EAAE,CAAA;QAEV,OAAO,CACL,iBAAiB,CAAC,IAAI,CACpB,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC,SAAS,CAAC,EAAE,CACpD,IAAI,IAAI,CACV,CAAA;IACH,CAAC;CACiC,CAAA"}
@@ -30,7 +30,7 @@ export declare const ClipSet: {
30
30
  export declare const Accessibility: {
31
31
  captions: (parent: import("../../../generated").Omit<import("../../../generated").Accessibility, "transcript"> & {
32
32
  transcript: import("../../../generated").Maybe<import("../../../generated").ResolversParentTypes["RichText"]>;
33
- }) => readonly import("../../../generated").Maybe<import("../../../generated").Caption>[] | null;
33
+ }) => readonly import("../../../generated").Caption[] | null;
34
34
  transcript: (parent: import("../../../generated").Omit<import("../../../generated").Accessibility, "transcript"> & {
35
35
  transcript: import("../../../generated").Maybe<import("../../../generated").ResolversParentTypes["RichText"]>;
36
36
  }) => import("../../../generated").Maybe<RichText>;
@@ -7,7 +7,7 @@ const RichText_1 = require("../../../model/RichText");
7
7
  function getClipSet(parent) {
8
8
  const clipSets = parent.contentApiData
9
9
  ?.embeds()
10
- ?.filter((embedded) => embedded.type?.includes('ClipSet'));
10
+ ?.filter((embedded) => embedded.type === 'http://www.ft.com/ontology/content/ClipSet');
11
11
  const uuid = (0, metadata_1.uuidFromUrl)(parent.reference.type === 'clip-set'
12
12
  ? parent.reference.id
13
13
  : parent.reference.url);
@@ -1 +1 @@
1
- {"version":3,"file":"ClipSet.js","sourceRoot":"","sources":["../../../../src/resolvers/content-tree/references/ClipSet.ts"],"names":[],"mappings":";;;AAKA,wDAAuD;AACvD,8CAA0C;AAC1C,sDAAkD;AAQlD,SAAS,UAAU,CACjB,MAEC;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ED,IAAI;QACF,OAAO,UAAU,CAAA;IACnB,CAAC;CACyB,CAAA;AAEf,QAAA,aAAa,GAAG;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,IAAI;IAC7C,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU;CACT,CAAA;AAErB,QAAA,OAAO,GAAG;IACrB,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI;IAC/C,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,IAAI;CACT,CAAA"}
@@ -9,7 +9,7 @@ export declare const Flourish: {
9
9
  } | {
10
10
  url: string;
11
11
  type: string;
12
- format: string;
12
+ format: "standard";
13
13
  sourceSet: never[];
14
14
  width: number;
15
15
  height: number;
@@ -1,4 +1,4 @@
1
1
  export declare const Reference: {
2
- __resolveType(parent: import(".").ReferenceWithCAPIData): "Recommended" | "Tweet" | "ImageSet" | "ClipSet" | "VideoReference" | "Flourish" | "LayoutImage" | "RawImage" | "ScrollyImage";
2
+ __resolveType(parent: import(".").ReferenceWithCAPIData): "Recommended" | "Tweet" | "ImageSet" | "ClipSet" | "VideoReference" | "Flourish" | "LayoutImage" | "RawImage" | "ScrollyImage" | "MainImage" | "AuthorReference";
3
3
  type: (parent: import(".").ReferenceWithCAPIData) => string;
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import type { ContentTree } from '@financial-times/content-tree';
2
2
  import type { CapiResponse } from '../../../model/CapiResponse';
3
- import { FlourishResolvers, ImageSetResolvers, ClipSetResolvers, LayoutImageResolvers, RawImageResolvers, RecommendedResolvers, ReferenceResolvers, ScrollyImageResolvers, TweetResolvers, VideoReferenceResolvers, CaptionResolvers, AccessibilityResolvers, FlourishFallbackResolvers } from '../../../generated';
3
+ import { FlourishResolvers, ImageSetResolvers, ClipSetResolvers, LayoutImageResolvers, RawImageResolvers, RecommendedResolvers, ReferenceResolvers, ScrollyImageResolvers, TweetResolvers, VideoReferenceResolvers, CaptionResolvers, AccessibilityResolvers, FlourishFallbackResolvers, AuthorReferenceResolvers } from '../../../generated';
4
4
  export type ReferenceWithCAPIData<ReferenceType = ContentTree.Node> = {
5
5
  reference: ReferenceType;
6
6
  contentApiData?: CapiResponse;
@@ -20,6 +20,7 @@ export declare const resolvers: {
20
20
  Caption: CaptionResolvers;
21
21
  Accessibility: AccessibilityResolvers;
22
22
  FlourishFallback: FlourishFallbackResolvers;
23
+ AuthorReference: AuthorReferenceResolvers;
23
24
  };
24
25
  export declare const mapNodeToReference: {
25
26
  readonly flourish: "Flourish";
@@ -32,6 +33,7 @@ export declare const mapNodeToReference: {
32
33
  readonly 'layout-image': "LayoutImage";
33
34
  readonly 'scrolly-image': "ScrollyImage";
34
35
  readonly 'raw-image': "RawImage";
35
- readonly 'main-image': "ImageSet";
36
+ readonly 'main-image': "MainImage";
36
37
  readonly 'main-image-raw': "RawImage";
38
+ readonly author: "AuthorReference";
37
39
  };
@@ -11,6 +11,7 @@ const Recommended_1 = require("./Recommended");
11
11
  const LayoutImage_1 = require("./LayoutImage");
12
12
  const RawImage_1 = require("./RawImage");
13
13
  const ScrollyImage_1 = require("./ScrollyImage");
14
+ const Author_1 = require("./Author");
14
15
  exports.resolvers = {
15
16
  Reference: Reference_1.Reference,
16
17
  Tweet: Tweet_1.Tweet,
@@ -26,6 +27,7 @@ exports.resolvers = {
26
27
  Caption: ClipSet_1.Caption,
27
28
  Accessibility: ClipSet_1.Accessibility,
28
29
  FlourishFallback: Flourish_1.FlourishFallback,
30
+ AuthorReference: Author_1.Author,
29
31
  };
30
32
  exports.mapNodeToReference = {
31
33
  flourish: 'Flourish',
@@ -38,7 +40,8 @@ exports.mapNodeToReference = {
38
40
  'layout-image': 'LayoutImage',
39
41
  'scrolly-image': 'ScrollyImage',
40
42
  'raw-image': 'RawImage',
41
- 'main-image': 'ImageSet',
43
+ 'main-image': 'MainImage',
42
44
  'main-image-raw': 'RawImage',
45
+ author: 'AuthorReference',
43
46
  };
44
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resolvers/content-tree/references/index.ts"],"names":[],"mappings":";;;AAGA,2CAAuC;AAEvC,mCAA+B;AAC/B,yCAAqC;AACrC,uCAA2D;AAC3D,mCAA+B;AAC/B,yCAAuD;AACvD,+CAA2C;AAC3C,+CAA2C;AAC3C,yCAAqC;AACrC,iDAA6C;AAuBhC,QAAA,SAAS,GAelB;IACF,SAAS,EAAT,qBAAS;IACT,KAAK,EAAL,aAAK;IACL,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAP,iBAAO;IACP,cAAc,EAAE,aAAK;IACrB,QAAQ,EAAR,mBAAQ;IACR,WAAW,EAAX,yBAAW;IACX,WAAW,EAAX,yBAAW;IACX,QAAQ,EAAR,mBAAQ;IACR,YAAY,EAAZ,2BAAY;IACZ,SAAS,EAAE,mBAAQ;IACnB,OAAO,EAAP,iBAAO;IACP,aAAa,EAAb,uBAAa;IACb,gBAAgB,EAAhB,2BAAgB;CACjB,CAAA;AAEY,QAAA,kBAAkB,GAAG;IAChC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,UAAU;IACvB,UAAU,EAAE,SAAS;IACrB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,aAAa;IAC1B,cAAc,EAAE,aAAa;IAC7B,eAAe,EAAE,cAAc;IAC/B,WAAW,EAAE,UAAU;IACvB,YAAY,EAAE,UAAU;IACxB,gBAAgB,EAAE,UAAU;CAC+C,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resolvers/content-tree/references/index.ts"],"names":[],"mappings":";;;AAGA,2CAAuC;AAEvC,mCAA+B;AAC/B,yCAAqC;AACrC,uCAA2D;AAC3D,mCAA+B;AAC/B,yCAAuD;AACvD,+CAA2C;AAC3C,+CAA2C;AAC3C,yCAAqC;AACrC,iDAA6C;AAkB7C,qCAAiC;AAOpB,QAAA,SAAS,GAgBlB;IACF,SAAS,EAAT,qBAAS;IACT,KAAK,EAAL,aAAK;IACL,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAP,iBAAO;IACP,cAAc,EAAE,aAAK;IACrB,QAAQ,EAAR,mBAAQ;IACR,WAAW,EAAX,yBAAW;IACX,WAAW,EAAX,yBAAW;IACX,QAAQ,EAAR,mBAAQ;IACR,YAAY,EAAZ,2BAAY;IACZ,SAAS,EAAE,mBAAQ;IACnB,OAAO,EAAP,iBAAO;IACP,aAAa,EAAb,uBAAa;IACb,gBAAgB,EAAhB,2BAAgB;IAChB,eAAe,EAAE,eAAM;CACxB,CAAA;AAEY,QAAA,kBAAkB,GAAG;IAChC,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,UAAU;IACvB,UAAU,EAAE,SAAS;IACrB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,aAAa;IAC1B,cAAc,EAAE,aAAa;IAC7B,eAAe,EAAE,cAAc;IAC/B,WAAW,EAAE,UAAU;IACvB,YAAY,EAAE,WAAW;IACzB,gBAAgB,EAAE,UAAU;IAC5B,MAAM,EAAE,iBAAiB;CACkD,CAAA"}
@@ -1,7 +1,7 @@
1
+ import { ContentTree } from '@financial-times/content-tree';
1
2
  import { CapiResponse } from '../../model/CapiResponse';
2
3
  import { ReferenceWithCAPIData } from './references';
3
- import { Body } from './Workarounds';
4
- export default function updateTreeWithReferenceIds(tree: Body, contentApiData?: CapiResponse): {
5
- tree: Body;
4
+ export default function updateTreeWithReferenceIds(tree: ContentTree.Parent, contentApiData?: CapiResponse): {
5
+ tree: ContentTree.Parent;
6
6
  references: ReferenceWithCAPIData[];
7
7
  };
@@ -8,15 +8,14 @@ function isParent(node) {
8
8
  const isValidReferenceType = (type) => type in references_1.mapNodeToReference;
9
9
  function updateTreeWithReferenceIds(tree, contentApiData) {
10
10
  const references = [];
11
- let index = 0;
12
11
  function traverse(node) {
13
12
  if (isValidReferenceType(node.type)) {
14
- references.push({
13
+ const referencesLength = references.push({
15
14
  reference: node,
16
15
  contentApiData,
17
16
  });
18
17
  node.data = node.data || {};
19
- node.data.referenceIndex = index++;
18
+ node.data.referenceIndex = referencesLength - 1;
20
19
  }
21
20
  if (isParent(node)) {
22
21
  node.children.forEach((node) => traverse(node));
@@ -1 +1 @@
1
- {"version":3,"file":"updateTreeWithReferenceIds.js","sourceRoot":"","sources":["../../../src/resolvers/content-tree/updateTreeWithReferenceIds.ts"],"names":[],"mappings":";;AAaA,6CA8BC;AAzCD,6CAAwE;AAGxE,SAAS,QAAQ,CAAC,IAAsB;IACtC,OAAO,UAAU,IAAI,IAAI,CAAA;AAC3B,CAAC;AAED,MAAM,oBAAoB,GAAG,CAC3B,IAAY,EAC6B,EAAE,CAAC,IAAI,IAAI,+BAAkB,CAAA;AAExE,SAAwB,0BAA0B,CAChD,IAAU,EACV,cAA6B;IAK7B,MAAM,UAAU,GAA4B,EAAE,CAAA;IAC9C,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,SAAS,QAAQ,CAAC,IAAa;QAC7B,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,UAAU,CAAC,IAAI,CAAC;gBACd,SAAS,EAAE,IAAI;gBACf,cAAc;aACf,CAAC,CAAA;YACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;YAC3B,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,KAAK,EAAE,CAAA;QACpC,CAAC;QACD,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAe,CAAC,CAAC,CAAA;QAC5D,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEd,OAAO;QACL,IAAI;QACJ,UAAU;KACX,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"updateTreeWithReferenceIds.js","sourceRoot":"","sources":["../../../src/resolvers/content-tree/updateTreeWithReferenceIds.ts"],"names":[],"mappings":";;AAYA,6CA6BC;AAvCD,6CAAwE;AAExE,SAAS,QAAQ,CAAC,IAAsB;IACtC,OAAO,UAAU,IAAI,IAAI,CAAA;AAC3B,CAAC;AAED,MAAM,oBAAoB,GAAG,CAC3B,IAAY,EAC6B,EAAE,CAAC,IAAI,IAAI,+BAAkB,CAAA;AAExE,SAAwB,0BAA0B,CAChD,IAAwB,EACxB,cAA6B;IAK7B,MAAM,UAAU,GAA4B,EAAE,CAAA;IAE9C,SAAS,QAAQ,CAAC,IAAsB;QACtC,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,gBAAgB,GAAG,UAAU,CAAC,IAAI,CAAC;gBACvC,SAAS,EAAE,IAAI;gBACf,cAAc;aACf,CAAC,CAAA;YACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAA;YAC3B,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,gBAAgB,GAAG,CAAC,CAAA;QACjD,CAAC;QACD,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;QACjD,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,CAAA;IAEd,OAAO;QACL,IAAI;QACJ,UAAU;KACX,CAAA;AACH,CAAC"}