@financial-times/cp-content-pipeline-schema 3.7.3 → 3.9.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.
- package/CHANGELOG.md +19 -0
- package/lib/datasources/capi.d.ts +4 -4
- package/lib/datasources/capi.js +4 -4
- package/lib/datasources/capi.js.map +1 -1
- package/lib/datasources/capi.test.js +3 -3
- package/lib/datasources/capi.test.js.map +1 -1
- package/lib/fixtures/dummyContext.js +2 -2
- package/lib/fixtures/dummyContext.js.map +1 -1
- package/lib/generated/index.d.ts +44 -23
- package/lib/model/Byline.d.ts +2 -2
- package/lib/model/Byline.js.map +1 -1
- package/lib/model/{CapiResponse.d.ts → Content.d.ts} +13 -12
- package/lib/model/{CapiResponse.js → Content.js} +14 -7
- package/lib/model/Content.js.map +1 -0
- package/lib/model/{CapiResponse.test.js → Content.test.js} +56 -15
- package/lib/model/Content.test.js.map +1 -0
- package/lib/model/LeadFlourish.d.ts +2 -2
- package/lib/model/LeadFlourish.js.map +1 -1
- package/lib/model/LeadFlourish.test.js +3 -3
- package/lib/model/LeadFlourish.test.js.map +1 -1
- package/lib/model/{CapiList.d.ts → List.d.ts} +5 -5
- package/lib/model/{CapiList.js → List.js} +5 -5
- package/lib/model/List.js.map +1 -0
- package/lib/model/RichText.d.ts +2 -2
- package/lib/model/RichText.js.map +1 -1
- package/lib/model/Topper.d.ts +2 -2
- package/lib/model/Topper.js.map +1 -1
- package/lib/model/Topper.test.js +22 -22
- package/lib/model/Topper.test.js.map +1 -1
- package/lib/model/schemas/capi/article.d.ts +5 -1
- package/lib/model/schemas/capi/article.js +1 -0
- package/lib/model/schemas/capi/article.js.map +1 -1
- package/lib/model/schemas/capi/audio.d.ts +5 -1
- package/lib/model/schemas/capi/audio.js +1 -0
- package/lib/model/schemas/capi/audio.js.map +1 -1
- package/lib/model/schemas/capi/base-schema.d.ts +5 -0
- package/lib/model/schemas/capi/base-schema.js +1 -0
- package/lib/model/schemas/capi/base-schema.js.map +1 -1
- package/lib/model/schemas/capi/content-package.d.ts +5 -1
- package/lib/model/schemas/capi/content-package.js +1 -0
- package/lib/model/schemas/capi/content-package.js.map +1 -1
- package/lib/model/schemas/capi/custom-code-component.d.ts +3 -0
- package/lib/model/schemas/capi/index.d.ts +28 -5
- package/lib/model/schemas/capi/live-blog-package.d.ts +5 -1
- package/lib/model/schemas/capi/live-blog-package.js +1 -0
- package/lib/model/schemas/capi/live-blog-package.js.map +1 -1
- package/lib/model/schemas/capi/placeholder.d.ts +5 -1
- package/lib/model/schemas/capi/placeholder.js +1 -0
- package/lib/model/schemas/capi/placeholder.js.map +1 -1
- package/lib/model/schemas/capi/video.d.ts +5 -1
- package/lib/model/schemas/capi/video.js +1 -0
- package/lib/model/schemas/capi/video.js.map +1 -1
- package/lib/resolvers/content-tree/references/CustomCodeComponent.js.map +1 -1
- package/lib/resolvers/content-tree/references/Recommended.d.ts +1 -1
- package/lib/resolvers/content-tree/references/index.d.ts +2 -2
- package/lib/resolvers/content-tree/tagMappings.d.ts +2 -2
- package/lib/resolvers/content-tree/tagMappings.js.map +1 -1
- package/lib/resolvers/content-tree/updateTreeWithReferenceIds.d.ts +2 -2
- package/lib/resolvers/content-tree/updateTreeWithReferenceIds.js.map +1 -1
- package/lib/resolvers/content.d.ts +251 -235
- package/lib/resolvers/content.js +27 -0
- package/lib/resolvers/content.js.map +1 -1
- package/lib/resolvers/core.d.ts +4 -4
- package/lib/resolvers/core.js +2 -2
- package/lib/resolvers/core.js.map +1 -1
- package/lib/resolvers/index.d.ts +278 -260
- package/lib/resolvers/list.d.ts +9 -9
- package/lib/resolvers/teaser.d.ts +15 -13
- package/lib/resolvers/teaser.js +2 -0
- package/lib/resolvers/teaser.js.map +1 -1
- package/package.json +1 -1
- package/queries/article.graphql +20 -0
- package/src/datasources/capi.test.ts +3 -3
- package/src/datasources/capi.ts +6 -9
- package/src/fixtures/dummyContext.ts +2 -2
- package/src/generated/index.ts +44 -23
- package/src/model/Byline.ts +2 -2
- package/src/model/{CapiResponse.test.ts → Content.test.ts} +65 -17
- package/src/model/{CapiResponse.ts → Content.ts} +24 -17
- package/src/model/LeadFlourish.test.ts +6 -5
- package/src/model/LeadFlourish.ts +2 -5
- package/src/model/{CapiList.ts → List.ts} +5 -5
- package/src/model/RichText.ts +2 -2
- package/src/model/Topper.test.ts +23 -26
- package/src/model/Topper.ts +2 -5
- package/src/model/schemas/capi/article.ts +1 -0
- package/src/model/schemas/capi/audio.ts +1 -0
- package/src/model/schemas/capi/base-schema.ts +1 -0
- package/src/model/schemas/capi/content-package.ts +1 -0
- package/src/model/schemas/capi/live-blog-package.ts +1 -0
- package/src/model/schemas/capi/placeholder.ts +1 -0
- package/src/model/schemas/capi/video.ts +1 -0
- package/src/resolvers/content-tree/references/CustomCodeComponent.ts +2 -2
- package/src/resolvers/content-tree/references/index.ts +2 -2
- package/src/resolvers/content-tree/tagMappings.ts +2 -2
- package/src/resolvers/content-tree/updateTreeWithReferenceIds.ts +2 -2
- package/src/resolvers/content.ts +27 -0
- package/src/resolvers/core.ts +2 -2
- package/src/resolvers/teaser.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/typedefs/content.graphql +19 -1
- package/typedefs/teaser.graphql +3 -0
- package/lib/model/CapiList.js.map +0 -1
- package/lib/model/CapiResponse.js.map +0 -1
- package/lib/model/CapiResponse.test.js.map +0 -1
- /package/lib/model/{CapiResponse.test.d.ts → Content.test.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.9.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-schema-v3.8.0...cp-content-pipeline-schema-v3.9.0) (2025-01-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add isFTEdit to TeaserIndicators ([e228090](https://github.com/Financial-Times/cp-content-pipeline/commit/e2280901e6e4c8009554613e8c4caef8fec2d9e2))
|
|
9
|
+
|
|
10
|
+
## [3.8.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-schema-v3.7.3...cp-content-pipeline-schema-v3.8.0) (2025-01-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add isFTEdit to Article query ([fc3bedb](https://github.com/Financial-Times/cp-content-pipeline/commit/fc3bedb1fac76345048c72d16537235867b535ba))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* move isFTEdit inside existing indicators property ([6f3b921](https://github.com/Financial-Times/cp-content-pipeline/commit/6f3b92159f68f6910d6a69c0025dd97dddfc7c22))
|
|
21
|
+
|
|
3
22
|
## [3.7.3](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-schema-v3.7.2...cp-content-pipeline-schema-v3.7.3) (2024-11-15)
|
|
4
23
|
|
|
5
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Content } from '../model/Content';
|
|
2
2
|
import { InstrumentedRESTDataSource } from './instrumented';
|
|
3
3
|
import { AugmentedRequest } from '@apollo/datasource-rest';
|
|
4
|
-
import {
|
|
4
|
+
import { List } from '../model/List';
|
|
5
5
|
import { Person } from '../model/Person';
|
|
6
6
|
export declare class CapiDataSource extends InstrumentedRESTDataSource {
|
|
7
7
|
baseURL: string;
|
|
@@ -11,8 +11,8 @@ export declare class CapiDataSource extends InstrumentedRESTDataSource {
|
|
|
11
11
|
get backendSystemCode(): string;
|
|
12
12
|
nextNotificationLink?: string;
|
|
13
13
|
willSendRequest(path: string, request: AugmentedRequest): void;
|
|
14
|
-
getContent(uuid: string, packageContainer?:
|
|
14
|
+
getContent(uuid: string, packageContainer?: Content): Promise<Content>;
|
|
15
15
|
getPerson(uuid: string): Promise<Person>;
|
|
16
|
-
getList(uuid: string): Promise<
|
|
16
|
+
getList(uuid: string): Promise<List>;
|
|
17
17
|
getHTTPCacheKeyForContent(uuid: string): Promise<string>;
|
|
18
18
|
}
|
package/lib/datasources/capi.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CapiDataSource = void 0;
|
|
4
|
-
const
|
|
4
|
+
const Content_1 = require("../model/Content");
|
|
5
5
|
const instrumented_1 = require("./instrumented");
|
|
6
|
-
const
|
|
6
|
+
const List_1 = require("../model/List");
|
|
7
7
|
const Person_1 = require("../model/Person");
|
|
8
8
|
const REQUEST_TIMEOUT = process.env.CAPI_DATASOURCE_REQUEST_TIMEOUT
|
|
9
9
|
? parseInt(process.env.CAPI_DATASOURCE_REQUEST_TIMEOUT)
|
|
@@ -45,7 +45,7 @@ class CapiDataSource extends instrumented_1.InstrumentedRESTDataSource {
|
|
|
45
45
|
});
|
|
46
46
|
this.context.contentRequestedOnce = true;
|
|
47
47
|
this.calls.push(uuid);
|
|
48
|
-
return
|
|
48
|
+
return Content_1.Content.fromJSON(content, this.context, packageContainer);
|
|
49
49
|
}
|
|
50
50
|
async getPerson(uuid) {
|
|
51
51
|
const person = await this.get(`people/${uuid}`, {
|
|
@@ -61,7 +61,7 @@ class CapiDataSource extends instrumented_1.InstrumentedRESTDataSource {
|
|
|
61
61
|
},
|
|
62
62
|
]);
|
|
63
63
|
const list = await this.get(`lists/${uuid}`);
|
|
64
|
-
return
|
|
64
|
+
return List_1.List.fromJSON(list, this.context);
|
|
65
65
|
}
|
|
66
66
|
// replicates the logic implicit in PrefixingKeyValueCache to
|
|
67
67
|
// construct a cache key for an article used to purge Redis
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capi.js","sourceRoot":"","sources":["../../src/datasources/capi.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"capi.js","sourceRoot":"","sources":["../../src/datasources/capi.ts"],"names":[],"mappings":";;;AAAA,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,IAAI,EAAE,CAAC,CAAA;QAC5C,OAAO,WAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAC1C,CAAC;IAED,6DAA6D;IAC7D,2DAA2D;IAC3D,KAAK,CAAC,yBAAyB,CAAC,IAAY;QAC1C,MAAM,YAAY,GAAqB;YACrC,MAAM,EAAE,IAAI,eAAe,EAAE;YAC7B,OAAO,EAAE,EAAE;SACZ,CAAA;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAC/B,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,IAAI,EAAE,EAAE,YAAY,CAAC,CAC/D,CAAA;QAED,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAA;IAC5E,CAAC;CACF;AAzED,wCAyEC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const logger_1 = require("@dotcom-reliability-kit/logger");
|
|
4
4
|
const capi_1 = require("./capi");
|
|
5
|
-
const
|
|
5
|
+
const Content_1 = require("../model/Content");
|
|
6
6
|
const logger = new logger_1.Logger();
|
|
7
7
|
const metrics = { count: jest.fn(), aggregate: jest.fn() };
|
|
8
8
|
const cache = {
|
|
@@ -27,8 +27,8 @@ describe('CapiDataSource', () => {
|
|
|
27
27
|
headers: new Headers([['content-type', 'application/json']]),
|
|
28
28
|
}));
|
|
29
29
|
jest
|
|
30
|
-
.spyOn(
|
|
31
|
-
.mockImplementation((content, context) => new
|
|
30
|
+
.spyOn(Content_1.Content, 'fromJSON')
|
|
31
|
+
.mockImplementation((content, context) => new Content_1.Content(content, context));
|
|
32
32
|
});
|
|
33
33
|
describe('cache keys', () => {
|
|
34
34
|
it('should return the same cache key that it actually stored in the cache', async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capi.test.js","sourceRoot":"","sources":["../../src/datasources/capi.test.ts"],"names":[],"mappings":";;AAAA,2DAAuD;AACvD,iCAAuC;AAGvC,
|
|
1
|
+
{"version":3,"file":"capi.test.js","sourceRoot":"","sources":["../../src/datasources/capi.test.ts"],"names":[],"mappings":";;AAAA,2DAAuD;AACvD,iCAAuC;AAGvC,8CAA0C;AAG1C,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAA;AAC3B,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,CAAA;AAE1D,MAAM,KAAK,GAAG;IACZ,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;IACd,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;IACd,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE;CACM,CAAA;AAEzB,MAAM,OAAO,GAAG;IACd,QAAQ,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;IAC3C,MAAM;IACN,OAAO;IACP,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;CACD,CAAA;AAE5B,MAAM,IAAI,GAAG,IAAI,qBAAc,CAAC;IAC9B,KAAK;IACL,OAAO;CACR,CAAC,CAAA;AAEF,MAAM,EAAE,GAAG,sCAAsC,CAAA;AAEjD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,kBAAkB,CAC5C,KAAK,IAAI,EAAE,CACT,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE;YACnC,OAAO,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAC;SAC7D,CAAC,CACL,CAAA;QAED,IAAI;aACD,KAAK,CAAC,iBAAO,EAAE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|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const Content_1 = require("../model/Content");
|
|
7
7
|
const capiObject_1 = require("./capiObject");
|
|
8
8
|
const clone_deep_1 = __importDefault(require("clone-deep"));
|
|
9
9
|
const now = Date.now();
|
|
@@ -18,7 +18,7 @@ exports.default = {
|
|
|
18
18
|
get: (url) => Promise.resolve(url),
|
|
19
19
|
},
|
|
20
20
|
capi: {
|
|
21
|
-
getContent: (id) => Promise.resolve(new
|
|
21
|
+
getContent: (id) => Promise.resolve(new Content_1.Content((0, clone_deep_1.default)({
|
|
22
22
|
...capiObject_1.baseCapiObject,
|
|
23
23
|
id,
|
|
24
24
|
publishedDate: new Date(now + parseInt(id.slice(-2), 10)).toISOString(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dummyContext.js","sourceRoot":"","sources":["../../src/fixtures/dummyContext.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"dummyContext.js","sourceRoot":"","sources":["../../src/fixtures/dummyContext.ts"],"names":[],"mappings":";;;;;AAAA,8CAA0C;AAC1C,6CAA6C;AAC7C,4DAAkC;AAElC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AAEtB,MAAM,gBAAgB,GAAG,CAAC,GAAqC,EAAE,EAAE;IACjE,MAAM,IAAI,GAAG,EAAE,CAAA;IACf,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAA;AACnB,CAAC,CAAA;AAED,kBAAe;IACb,gBAAgB;IAChB,WAAW,EAAE;QACX,UAAU,EAAE;YACV,GAAG,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;SAC3C;QACD,IAAI,EAAE;YACJ,UAAU,EAAE,CAAC,EAAU,EAAE,EAAE,CACzB,OAAO,CAAC,OAAO,CACb,IAAI,iBAAO,CACT,IAAA,oBAAS,EAAC;gBACR,GAAG,2BAAc;gBACjB,EAAE;gBACF,aAAa,EAAE,IAAI,IAAI,CACrB,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACjC,CAAC,WAAW,EAAE;aAChB,CAAC,EACF,EAAE,gBAAgB,EAAkB,CACrC,CACF;SACJ;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;QAChB,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;QAChB,KAAK,EAAE,IAAI,CAAC,EAAE,EAAE;QAChB,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;QACf,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE;KAChB;CACyB,CAAA"}
|
package/lib/generated/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql';
|
|
2
2
|
import type { Concept as ConceptModel } from '../model/Concept';
|
|
3
3
|
import type { Person as PersonModel } from '../model/Person';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
4
|
+
import type { List as ListModel } from '../model/List';
|
|
5
|
+
import type { Content as ContentModel } from '../model/Content';
|
|
6
6
|
import type { Image as ImageModel } from '../model/Image';
|
|
7
7
|
import type { Clip as ClipModel } from '../model/Clip';
|
|
8
8
|
import type { Picture as PictureModel } from '../model/Picture';
|
|
@@ -227,6 +227,8 @@ export type Audio = Content & {
|
|
|
227
227
|
readonly firstPublishedDate: Scalars['String']['output'];
|
|
228
228
|
/** The unique identifier of the article - a uuid or a url. */
|
|
229
229
|
readonly id: Scalars['ID']['output'];
|
|
230
|
+
/** An object of several flags indicating the nature of the content, eg. if it's in an FT Edit edition */
|
|
231
|
+
readonly indicators?: Maybe<Indicators>;
|
|
230
232
|
/** The concept to use for instant alert CTAs. */
|
|
231
233
|
readonly instantAlertConcept?: Maybe<Concept>;
|
|
232
234
|
/** An image object containing the url and the caption, to be displayed usually before the article content. */
|
|
@@ -585,6 +587,8 @@ export type ContentPackage = Content & {
|
|
|
585
587
|
readonly firstPublishedDate: Scalars['String']['output'];
|
|
586
588
|
/** The unique identifier of the article - a uuid or a url. */
|
|
587
589
|
readonly id: Scalars['ID']['output'];
|
|
590
|
+
/** An object of several flags indicating the nature of the content, eg. if it's in an FT Edit edition */
|
|
591
|
+
readonly indicators?: Maybe<Indicators>;
|
|
588
592
|
/** The concept to use for instant alert CTAs. */
|
|
589
593
|
readonly instantAlertConcept?: Maybe<Concept>;
|
|
590
594
|
/** An image object containing the url and the caption, to be displayed usually before the article content. */
|
|
@@ -1029,6 +1033,8 @@ export type ImageWideSourceSetArgs = {
|
|
|
1029
1033
|
width?: InputMaybe<Scalars['Int']['input']>;
|
|
1030
1034
|
};
|
|
1031
1035
|
export type Indicators = {
|
|
1036
|
+
/** Whether the article is included in an FT Edit editorial curation. */
|
|
1037
|
+
readonly isFTEdit?: Maybe<Scalars['Boolean']['output']>;
|
|
1032
1038
|
/** Whether the content is an opinion piece. */
|
|
1033
1039
|
readonly isOpinion?: Maybe<Scalars['Boolean']['output']>;
|
|
1034
1040
|
/** Whether the content is Commercial Partner Content. */
|
|
@@ -1096,6 +1102,8 @@ export type LiveBlogPackage = Content & {
|
|
|
1096
1102
|
readonly firstPublishedDate: Scalars['String']['output'];
|
|
1097
1103
|
/** The unique identifier of the article - a uuid or a url. */
|
|
1098
1104
|
readonly id: Scalars['ID']['output'];
|
|
1105
|
+
/** An object of flags indicating the nature of the content, eg. if it's in an FT Edit edition */
|
|
1106
|
+
readonly indicators?: Maybe<Indicators>;
|
|
1099
1107
|
/** The concept to use for instant alert CTAs. */
|
|
1100
1108
|
readonly instantAlertConcept?: Maybe<Concept>;
|
|
1101
1109
|
/** The child articles of this live blog package. */
|
|
@@ -1184,7 +1192,7 @@ export type LiveBlogPost = Content & {
|
|
|
1184
1192
|
readonly firstPublishedDate: Scalars['String']['output'];
|
|
1185
1193
|
/** The unique identifier of the article - a uuid or a url. */
|
|
1186
1194
|
readonly id: Scalars['ID']['output'];
|
|
1187
|
-
/** An object indicating
|
|
1195
|
+
/** An object of several flags indicating the nature of the content, eg. if it's in an FT Edit edition */
|
|
1188
1196
|
readonly indicators?: Maybe<Indicators>;
|
|
1189
1197
|
/** The concept to use for instant alert CTAs. */
|
|
1190
1198
|
readonly instantAlertConcept?: Maybe<Concept>;
|
|
@@ -1420,6 +1428,8 @@ export type Placeholder = Content & {
|
|
|
1420
1428
|
readonly firstPublishedDate: Scalars['String']['output'];
|
|
1421
1429
|
/** The unique identifier of the article - a uuid or a url. */
|
|
1422
1430
|
readonly id: Scalars['ID']['output'];
|
|
1431
|
+
/** An object of several flags indicating the nature of the content, eg. if it's in an FT Edit edition */
|
|
1432
|
+
readonly indicators?: Maybe<Indicators>;
|
|
1423
1433
|
/** The concept to use for instant alert CTAs. */
|
|
1424
1434
|
readonly instantAlertConcept?: Maybe<Concept>;
|
|
1425
1435
|
/** An image object containing the url and the caption, to be displayed usually before the article content. */
|
|
@@ -1629,6 +1639,8 @@ export type TeaserIndicators = {
|
|
|
1629
1639
|
readonly isEditorsChoice?: Maybe<Scalars['Boolean']['output']>;
|
|
1630
1640
|
/** Whether the teaser is exclusive. */
|
|
1631
1641
|
readonly isExclusive?: Maybe<Scalars['Boolean']['output']>;
|
|
1642
|
+
/** Whether the article is included in an FT Edit editorial curation. */
|
|
1643
|
+
readonly isFTEdit?: Maybe<Scalars['Boolean']['output']>;
|
|
1632
1644
|
/** Whether the teaser is an opinion piece. */
|
|
1633
1645
|
readonly isOpinion?: Maybe<Scalars['Boolean']['output']>;
|
|
1634
1646
|
/** Whether the teaser is a podcast. */
|
|
@@ -1744,6 +1756,8 @@ export type Video = Content & {
|
|
|
1744
1756
|
readonly firstPublishedDate: Scalars['String']['output'];
|
|
1745
1757
|
/** The unique identifier of the article - a uuid or a url. */
|
|
1746
1758
|
readonly id: Scalars['ID']['output'];
|
|
1759
|
+
/** An object of several flags indicating the nature of the content, eg. if it's in an FT Edit edition */
|
|
1760
|
+
readonly indicators?: Maybe<Indicators>;
|
|
1747
1761
|
/** The concept to use for instant alert CTAs. */
|
|
1748
1762
|
readonly instantAlertConcept?: Maybe<Concept>;
|
|
1749
1763
|
/** An image object containing the url and the caption, to be displayed usually before the article content. */
|
|
@@ -1819,12 +1833,12 @@ export type NextResolverFn<T> = () => Promise<T>;
|
|
|
1819
1833
|
export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = (next: NextResolverFn<TResult>, parent: TParent, args: TArgs, context: TContext, info: GraphQLResolveInfo) => TResult | Promise<TResult>;
|
|
1820
1834
|
/** Mapping of union types */
|
|
1821
1835
|
export type ResolversUnionTypes<RefType extends Record<string, unknown>> = ResolversObject<{
|
|
1822
|
-
MetaLink: (ConceptModel) | (
|
|
1836
|
+
MetaLink: (ConceptModel) | (ContentModel);
|
|
1823
1837
|
}>;
|
|
1824
1838
|
/** Mapping of interface types */
|
|
1825
1839
|
export type ResolversInterfaceTypes<RefType extends Record<string, unknown>> = ResolversObject<{
|
|
1826
1840
|
ConceptInterface: (ConceptModel) | (ConceptModel);
|
|
1827
|
-
Content: (
|
|
1841
|
+
Content: (ContentModel) | (ContentModel) | (ContentModel) | (ContentModel) | (ContentModel) | (ContentModel) | (ContentModel);
|
|
1828
1842
|
Image: (ImageModel) | (ImageModel) | (ImageModel) | (ImageModel) | (ImageModel) | (ImageModel) | (ImageModel) | (ImageModel) | (ImageModel);
|
|
1829
1843
|
Picture: (PictureModel) | (PictureModel) | (PictureModel);
|
|
1830
1844
|
Reference: (ReferenceWithCAPIData<AuthorNode>) | (ReferenceWithCAPIData<ClipSetNode | OldClipNode>) | (ReferenceWithCAPIData<ContentTree.CustomCodeComponent>) | (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>);
|
|
@@ -1843,8 +1857,8 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1843
1857
|
}>;
|
|
1844
1858
|
AltStandfirst: ResolverTypeWrapper<AltStandfirst>;
|
|
1845
1859
|
AltTitle: ResolverTypeWrapper<AltTitle>;
|
|
1846
|
-
Article: ResolverTypeWrapper<
|
|
1847
|
-
Audio: ResolverTypeWrapper<
|
|
1860
|
+
Article: ResolverTypeWrapper<ContentModel>;
|
|
1861
|
+
Audio: ResolverTypeWrapper<ContentModel>;
|
|
1848
1862
|
Author: ResolverTypeWrapper<ConceptModel>;
|
|
1849
1863
|
AuthorReference: ResolverTypeWrapper<ReferenceWithCAPIData<AuthorNode>>;
|
|
1850
1864
|
BasicTopper: ResolverTypeWrapper<TopperModel>;
|
|
@@ -1865,7 +1879,7 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1865
1879
|
ContentEdge: ResolverTypeWrapper<Omit<ContentEdge, 'node'> & {
|
|
1866
1880
|
node: Maybe<ResolversTypes['Content']>;
|
|
1867
1881
|
}>;
|
|
1868
|
-
ContentPackage: ResolverTypeWrapper<
|
|
1882
|
+
ContentPackage: ResolverTypeWrapper<ContentModel>;
|
|
1869
1883
|
ContentType: ResolverTypeWrapper<Scalars['ContentType']['output']>;
|
|
1870
1884
|
CustomCodeComponent: ResolverTypeWrapper<ReferenceWithCAPIData<ContentTree.CustomCodeComponent>>;
|
|
1871
1885
|
DeepLandscapeTopper: ResolverTypeWrapper<TopperModel>;
|
|
@@ -1897,10 +1911,10 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1897
1911
|
LayoutHint: ResolverTypeWrapper<Scalars['LayoutHint']['output']>;
|
|
1898
1912
|
LayoutImage: ResolverTypeWrapper<ReferenceWithCAPIData<ContentTree.LayoutImage>>;
|
|
1899
1913
|
LeadFlourish: ResolverTypeWrapper<LeadFlourishModel>;
|
|
1900
|
-
List: ResolverTypeWrapper<
|
|
1914
|
+
List: ResolverTypeWrapper<ListModel>;
|
|
1901
1915
|
ListType: ResolverTypeWrapper<Scalars['ListType']['output']>;
|
|
1902
|
-
LiveBlogPackage: ResolverTypeWrapper<
|
|
1903
|
-
LiveBlogPost: ResolverTypeWrapper<
|
|
1916
|
+
LiveBlogPackage: ResolverTypeWrapper<ContentModel>;
|
|
1917
|
+
LiveBlogPost: ResolverTypeWrapper<ContentModel>;
|
|
1904
1918
|
MainImage: ResolverTypeWrapper<ReferenceWithCAPIData<ContentTree.ImageSet>>;
|
|
1905
1919
|
Media: ResolverTypeWrapper<Media>;
|
|
1906
1920
|
MetaLink: ResolverTypeWrapper<ResolversUnionTypes<ResolversTypes>['MetaLink']>;
|
|
@@ -1914,7 +1928,7 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1914
1928
|
PictureFullBleed: ResolverTypeWrapper<PictureModel>;
|
|
1915
1929
|
PictureInline: ResolverTypeWrapper<PictureModel>;
|
|
1916
1930
|
PictureStandard: ResolverTypeWrapper<PictureModel>;
|
|
1917
|
-
Placeholder: ResolverTypeWrapper<
|
|
1931
|
+
Placeholder: ResolverTypeWrapper<ContentModel>;
|
|
1918
1932
|
PodcastTopper: ResolverTypeWrapper<TopperModel>;
|
|
1919
1933
|
Query: ResolverTypeWrapper<{}>;
|
|
1920
1934
|
RawImage: ResolverTypeWrapper<ReferenceWithCAPIData<RawImageNode>>;
|
|
@@ -1929,7 +1943,7 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1929
1943
|
references: ReadonlyArray<ResolversTypes['Reference']>;
|
|
1930
1944
|
}>;
|
|
1931
1945
|
TableOfContents: ResolverTypeWrapper<TableOfContents>;
|
|
1932
|
-
Teaser: ResolverTypeWrapper<
|
|
1946
|
+
Teaser: ResolverTypeWrapper<ContentModel>;
|
|
1933
1947
|
TeaserIndicators: ResolverTypeWrapper<TeaserIndicators>;
|
|
1934
1948
|
Topper: ResolverTypeWrapper<TopperModel>;
|
|
1935
1949
|
TopperBackgroundColour: ResolverTypeWrapper<Scalars['TopperBackgroundColour']['output']>;
|
|
@@ -1940,7 +1954,7 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1940
1954
|
TopperWithPackage: ResolverTypeWrapper<TopperModel>;
|
|
1941
1955
|
TopperWithTheme: ResolverTypeWrapper<TopperModel>;
|
|
1942
1956
|
Tweet: ResolverTypeWrapper<ReferenceWithCAPIData<ContentTree.Tweet>>;
|
|
1943
|
-
Video: ResolverTypeWrapper<
|
|
1957
|
+
Video: ResolverTypeWrapper<ContentModel>;
|
|
1944
1958
|
VideoReference: ResolverTypeWrapper<ReferenceWithCAPIData<VideoNode>>;
|
|
1945
1959
|
}>;
|
|
1946
1960
|
/** Mapping between all available schema types and the resolvers parents */
|
|
@@ -1951,8 +1965,8 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
1951
1965
|
};
|
|
1952
1966
|
AltStandfirst: AltStandfirst;
|
|
1953
1967
|
AltTitle: AltTitle;
|
|
1954
|
-
Article:
|
|
1955
|
-
Audio:
|
|
1968
|
+
Article: ContentModel;
|
|
1969
|
+
Audio: ContentModel;
|
|
1956
1970
|
Author: ConceptModel;
|
|
1957
1971
|
AuthorReference: ReferenceWithCAPIData<AuthorNode>;
|
|
1958
1972
|
BasicTopper: TopperModel;
|
|
@@ -1973,7 +1987,7 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
1973
1987
|
ContentEdge: Omit<ContentEdge, 'node'> & {
|
|
1974
1988
|
node: Maybe<ResolversParentTypes['Content']>;
|
|
1975
1989
|
};
|
|
1976
|
-
ContentPackage:
|
|
1990
|
+
ContentPackage: ContentModel;
|
|
1977
1991
|
ContentType: Scalars['ContentType']['output'];
|
|
1978
1992
|
CustomCodeComponent: ReferenceWithCAPIData<ContentTree.CustomCodeComponent>;
|
|
1979
1993
|
DeepLandscapeTopper: TopperModel;
|
|
@@ -2005,10 +2019,10 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
2005
2019
|
LayoutHint: Scalars['LayoutHint']['output'];
|
|
2006
2020
|
LayoutImage: ReferenceWithCAPIData<ContentTree.LayoutImage>;
|
|
2007
2021
|
LeadFlourish: LeadFlourishModel;
|
|
2008
|
-
List:
|
|
2022
|
+
List: ListModel;
|
|
2009
2023
|
ListType: Scalars['ListType']['output'];
|
|
2010
|
-
LiveBlogPackage:
|
|
2011
|
-
LiveBlogPost:
|
|
2024
|
+
LiveBlogPackage: ContentModel;
|
|
2025
|
+
LiveBlogPost: ContentModel;
|
|
2012
2026
|
MainImage: ReferenceWithCAPIData<ContentTree.ImageSet>;
|
|
2013
2027
|
Media: Media;
|
|
2014
2028
|
MetaLink: ResolversUnionTypes<ResolversParentTypes>['MetaLink'];
|
|
@@ -2022,7 +2036,7 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
2022
2036
|
PictureFullBleed: PictureModel;
|
|
2023
2037
|
PictureInline: PictureModel;
|
|
2024
2038
|
PictureStandard: PictureModel;
|
|
2025
|
-
Placeholder:
|
|
2039
|
+
Placeholder: ContentModel;
|
|
2026
2040
|
PodcastTopper: TopperModel;
|
|
2027
2041
|
Query: {};
|
|
2028
2042
|
RawImage: ReferenceWithCAPIData<RawImageNode>;
|
|
@@ -2037,7 +2051,7 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
2037
2051
|
references: ReadonlyArray<ResolversParentTypes['Reference']>;
|
|
2038
2052
|
};
|
|
2039
2053
|
TableOfContents: TableOfContents;
|
|
2040
|
-
Teaser:
|
|
2054
|
+
Teaser: ContentModel;
|
|
2041
2055
|
TeaserIndicators: TeaserIndicators;
|
|
2042
2056
|
Topper: TopperModel;
|
|
2043
2057
|
TopperBackgroundColour: Scalars['TopperBackgroundColour']['output'];
|
|
@@ -2048,7 +2062,7 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
2048
2062
|
TopperWithPackage: TopperModel;
|
|
2049
2063
|
TopperWithTheme: TopperModel;
|
|
2050
2064
|
Tweet: ReferenceWithCAPIData<ContentTree.Tweet>;
|
|
2051
|
-
Video:
|
|
2065
|
+
Video: ContentModel;
|
|
2052
2066
|
VideoReference: ReferenceWithCAPIData<VideoNode>;
|
|
2053
2067
|
}>;
|
|
2054
2068
|
export interface AccessLevelScalarConfig extends GraphQLScalarTypeConfig<ResolversTypes['AccessLevel'], any> {
|
|
@@ -2114,6 +2128,7 @@ export type AudioResolvers<ContextType = QueryContext, ParentType extends Resolv
|
|
|
2114
2128
|
editorialDesk: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2115
2129
|
firstPublishedDate: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
|
2116
2130
|
id: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
|
|
2131
|
+
indicators: Resolver<Maybe<ResolversTypes['Indicators']>, ParentType, ContextType>;
|
|
2117
2132
|
instantAlertConcept: Resolver<Maybe<ResolversTypes['Concept']>, ParentType, ContextType>;
|
|
2118
2133
|
mainImage: Resolver<Maybe<ResolversTypes['Image']>, ParentType, ContextType>;
|
|
2119
2134
|
media: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['Media']>>>, ParentType, ContextType>;
|
|
@@ -2302,6 +2317,7 @@ export type ContentPackageResolvers<ContextType = QueryContext, ParentType exten
|
|
|
2302
2317
|
editorialDesk: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2303
2318
|
firstPublishedDate: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
|
2304
2319
|
id: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
|
|
2320
|
+
indicators: Resolver<Maybe<ResolversTypes['Indicators']>, ParentType, ContextType>;
|
|
2305
2321
|
instantAlertConcept: Resolver<Maybe<ResolversTypes['Concept']>, ParentType, ContextType>;
|
|
2306
2322
|
mainImage: Resolver<Maybe<ResolversTypes['Image']>, ParentType, ContextType>;
|
|
2307
2323
|
modifiedTimestamp: Resolver<Maybe<ResolversTypes['Float']>, ParentType, ContextType>;
|
|
@@ -2549,6 +2565,7 @@ export type ImageWideResolvers<ContextType = QueryContext, ParentType extends Re
|
|
|
2549
2565
|
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
2550
2566
|
}>;
|
|
2551
2567
|
export type IndicatorsResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['Indicators'] = ResolversParentTypes['Indicators']> = ResolversObject<{
|
|
2568
|
+
isFTEdit: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2552
2569
|
isOpinion: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2553
2570
|
isPartnerContent: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2554
2571
|
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
@@ -2600,6 +2617,7 @@ export type LiveBlogPackageResolvers<ContextType = QueryContext, ParentType exte
|
|
|
2600
2617
|
editorialDesk: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2601
2618
|
firstPublishedDate: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
|
2602
2619
|
id: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
|
|
2620
|
+
indicators: Resolver<Maybe<ResolversTypes['Indicators']>, ParentType, ContextType>;
|
|
2603
2621
|
instantAlertConcept: Resolver<Maybe<ResolversTypes['Concept']>, ParentType, ContextType>;
|
|
2604
2622
|
liveBlogPosts: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['Content']>>>, ParentType, ContextType, Partial<LiveBlogPackageLiveBlogPostsArgs>>;
|
|
2605
2623
|
liveBlogPostsConnection: Resolver<Maybe<ResolversTypes['ContentConnection']>, ParentType, ContextType, Partial<LiveBlogPackageLiveBlogPostsConnectionArgs>>;
|
|
@@ -2771,6 +2789,7 @@ export type PlaceholderResolvers<ContextType = QueryContext, ParentType extends
|
|
|
2771
2789
|
editorialDesk: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2772
2790
|
firstPublishedDate: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
|
2773
2791
|
id: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
|
|
2792
|
+
indicators: Resolver<Maybe<ResolversTypes['Indicators']>, ParentType, ContextType>;
|
|
2774
2793
|
instantAlertConcept: Resolver<Maybe<ResolversTypes['Concept']>, ParentType, ContextType>;
|
|
2775
2794
|
mainImage: Resolver<Maybe<ResolversTypes['Image']>, ParentType, ContextType>;
|
|
2776
2795
|
modifiedTimestamp: Resolver<Maybe<ResolversTypes['Float']>, ParentType, ContextType>;
|
|
@@ -2887,6 +2906,7 @@ export type TeaserIndicatorsResolvers<ContextType = QueryContext, ParentType ext
|
|
|
2887
2906
|
isColumn: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2888
2907
|
isEditorsChoice: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2889
2908
|
isExclusive: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2909
|
+
isFTEdit: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2890
2910
|
isOpinion: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2891
2911
|
isPodcast: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2892
2912
|
isScoop: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
@@ -2963,6 +2983,7 @@ export type VideoResolvers<ContextType = QueryContext, ParentType extends Resolv
|
|
|
2963
2983
|
editorialDesk: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2964
2984
|
firstPublishedDate: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
|
2965
2985
|
id: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
|
|
2986
|
+
indicators: Resolver<Maybe<ResolversTypes['Indicators']>, ParentType, ContextType>;
|
|
2966
2987
|
instantAlertConcept: Resolver<Maybe<ResolversTypes['Concept']>, ParentType, ContextType>;
|
|
2967
2988
|
mainImage: Resolver<Maybe<ResolversTypes['Image']>, ParentType, ContextType>;
|
|
2968
2989
|
modifiedTimestamp: Resolver<Maybe<ResolversTypes['Float']>, ParentType, ContextType>;
|
package/lib/model/Byline.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContentTree } from '@financial-times/content-tree';
|
|
2
2
|
import { Concept } from './Concept';
|
|
3
|
-
import {
|
|
3
|
+
import { Content } from './Content';
|
|
4
4
|
export declare class Byline {
|
|
5
5
|
#private;
|
|
6
6
|
private byline;
|
|
@@ -8,7 +8,7 @@ export declare class Byline {
|
|
|
8
8
|
private authors;
|
|
9
9
|
private contentApiData?;
|
|
10
10
|
static normaliseQuotes(str: string): string;
|
|
11
|
-
constructor(byline: string, vanity: boolean, authors: Concept[], contentApiData?:
|
|
11
|
+
constructor(byline: string, vanity: boolean, authors: Concept[], contentApiData?: Content | undefined);
|
|
12
12
|
buildBylineTree(): Promise<{
|
|
13
13
|
tree: ContentTree.Parent;
|
|
14
14
|
references: import("../resolvers/content-tree/references").ReferenceWithCAPIData[];
|
package/lib/model/Byline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Byline.js","sourceRoot":"","sources":["../../src/model/Byline.ts"],"names":[],"mappings":";;;;;;AAMA,sHAA6F;AAG7F,MAAa,MAAM;IAMP;IACA;IACA;IACA;IARV,MAAM,CAAC,eAAe,CAAC,GAAW;QAChC,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACjC,CAAC;IAED,YACU,MAAc,EACd,MAAe,EACf,OAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"Byline.js","sourceRoot":"","sources":["../../src/model/Byline.ts"],"names":[],"mappings":";;;;;;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AAE;oBACjB,QAAQ,EAAE,CAAC,IAAI,CAAC;iBACjB;gBACH,CAAC,CAAC,IAAI,CAAA;QACV,CAAC,CAAC,CAAA;QAEF,OAAO,IAAA,oCAA0B,EAC/B;YACE,IAAI,EAAE,QAAQ;YACd,QAAQ;SACY,EACtB,IAAI,CAAC,cAAc,CACpB,CAAA;IACH,CAAC;IAED,kBAAkB,CAAC,MAAc,EAAE,KAAe;QAChD,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO,CAAC,MAAM,CAAC,CAAA;QAElC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACtD,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,CAAA;IAC9D,CAAC;CACF;AA1DD,wBA0DC"}
|
|
@@ -12,13 +12,13 @@ type Design = {
|
|
|
12
12
|
theme: LiteralUnionScalarValues<typeof PackageDesign>;
|
|
13
13
|
layout?: 'default' | 'wide';
|
|
14
14
|
};
|
|
15
|
-
export declare class
|
|
15
|
+
export declare class Content {
|
|
16
16
|
#private;
|
|
17
17
|
private capiData;
|
|
18
18
|
private context;
|
|
19
19
|
private packageContainer?;
|
|
20
|
-
constructor(capiData: ContentTypeSchemas, context: QueryContext, packageContainer?:
|
|
21
|
-
static fromJSON(content: unknown, context: QueryContext, packageContainer?:
|
|
20
|
+
constructor(capiData: ContentTypeSchemas, context: QueryContext, packageContainer?: Content | undefined);
|
|
21
|
+
static fromJSON(content: unknown, context: QueryContext, packageContainer?: Content): Content;
|
|
22
22
|
body(): RichText;
|
|
23
23
|
bodyXML(): string | null;
|
|
24
24
|
embeds(): (ImageSet | ClipSet | CustomCodeComponentReference)[];
|
|
@@ -103,12 +103,12 @@ export declare class CapiResponse {
|
|
|
103
103
|
alternativeStandfirst(): {
|
|
104
104
|
promotionalStandfirst?: string | undefined;
|
|
105
105
|
} | null;
|
|
106
|
-
overrideTitle(title: string):
|
|
107
|
-
containedIn(): Promise<
|
|
108
|
-
metaLink(): Promise<Concept |
|
|
106
|
+
overrideTitle(title: string): Content;
|
|
107
|
+
containedIn(): Promise<Content | null>;
|
|
108
|
+
metaLink(): Promise<Concept | Content | null>;
|
|
109
109
|
metaAltLink(): Promise<Concept | null>;
|
|
110
110
|
metaPrefixText(): Promise<string | null>;
|
|
111
|
-
teaser():
|
|
111
|
+
teaser(): Content;
|
|
112
112
|
isEditorsChoice(): boolean;
|
|
113
113
|
isExclusive(): boolean;
|
|
114
114
|
isScoop(): boolean;
|
|
@@ -131,18 +131,19 @@ export declare class CapiResponse {
|
|
|
131
131
|
isCentralBanking(): boolean;
|
|
132
132
|
isPlaceholder(): boolean;
|
|
133
133
|
isPodcast(): boolean;
|
|
134
|
-
contains({ surroundingArticles, fromId, }?: Partial<ContentPackageContainsArgs>): Promise<
|
|
135
|
-
containsConnection({ before, after, first, last }?: ConnectionArguments, transformer?: (contains: LiveBlogPackage['contains']) => LiveBlogPackage['contains']): Promise<Connection<
|
|
134
|
+
contains({ surroundingArticles, fromId, }?: Partial<ContentPackageContainsArgs>): Promise<Content[] | null>;
|
|
135
|
+
containsConnection({ before, after, first, last }?: ConnectionArguments, transformer?: (contains: LiveBlogPackage['contains']) => LiveBlogPackage['contains']): Promise<Connection<Content>>;
|
|
136
136
|
containsLength(): number | null;
|
|
137
137
|
tableOfContents(): Promise<TableOfContents | null>;
|
|
138
138
|
private handleLiveBlogPosts;
|
|
139
|
-
liveBlogPosts(args?: LiveBlogPackageLiveBlogPostsArgs): Promise<
|
|
140
|
-
liveBlogPostsConnection(args: ConnectionArguments): Promise<Connection<
|
|
139
|
+
liveBlogPosts(args?: LiveBlogPackageLiveBlogPostsArgs): Promise<Content[] | []>;
|
|
140
|
+
liveBlogPostsConnection(args: ConnectionArguments): Promise<Connection<Content>>;
|
|
141
141
|
isPinned(): boolean;
|
|
142
|
-
pinnedPost(): Promise<
|
|
142
|
+
pinnedPost(): Promise<Content | null>;
|
|
143
143
|
isContainedInPackage(): boolean;
|
|
144
144
|
realtime(): boolean | null;
|
|
145
145
|
commentsEnabled(): boolean;
|
|
146
|
+
isFTEdit(): boolean;
|
|
146
147
|
design(): Design;
|
|
147
148
|
media(): Media[] | null;
|
|
148
149
|
publication(): string[] | null;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.Content = void 0;
|
|
7
7
|
const n_concept_ids_1 = __importDefault(require("@financial-times/n-concept-ids"));
|
|
8
8
|
const n_display_metadata_1 = __importDefault(require("@financial-times/n-display-metadata"));
|
|
9
9
|
const clone_deep_1 = __importDefault(require("clone-deep"));
|
|
@@ -43,7 +43,7 @@ const baselineContentSchema = zod_1.z.object({
|
|
|
43
43
|
type: zod_1.z.string().optional(),
|
|
44
44
|
types: zod_1.z.array(zod_1.z.string()),
|
|
45
45
|
});
|
|
46
|
-
class
|
|
46
|
+
class Content {
|
|
47
47
|
capiData;
|
|
48
48
|
context;
|
|
49
49
|
packageContainer;
|
|
@@ -88,7 +88,7 @@ class CapiResponse {
|
|
|
88
88
|
}
|
|
89
89
|
// we can "safely" cast content to the schema return types here. if the type is
|
|
90
90
|
// incorrect, we've at least logged that error.
|
|
91
|
-
return new
|
|
91
|
+
return new Content(content, context, packageContainer);
|
|
92
92
|
}
|
|
93
93
|
body() {
|
|
94
94
|
if (this.type() === 'Video' && 'transcript' in this.capiData) {
|
|
@@ -332,7 +332,7 @@ class CapiResponse {
|
|
|
332
332
|
if ('title' in this.capiData) {
|
|
333
333
|
const clone = (0, clone_deep_1.default)(this.capiData);
|
|
334
334
|
clone.title = title;
|
|
335
|
-
return new
|
|
335
|
+
return new Content(clone, this.context, this.packageContainer);
|
|
336
336
|
}
|
|
337
337
|
return this;
|
|
338
338
|
}
|
|
@@ -399,7 +399,7 @@ class CapiResponse {
|
|
|
399
399
|
}
|
|
400
400
|
teaser() {
|
|
401
401
|
const clone = (0, clone_deep_1.default)(this.capiData);
|
|
402
|
-
return new
|
|
402
|
+
return new Content(clone, this.context, this.packageContainer);
|
|
403
403
|
}
|
|
404
404
|
isEditorsChoice() {
|
|
405
405
|
return Boolean('standout' in this.capiData && this.capiData.standout?.editorsChoice);
|
|
@@ -665,6 +665,13 @@ class CapiResponse {
|
|
|
665
665
|
}
|
|
666
666
|
return false;
|
|
667
667
|
}
|
|
668
|
+
isFTEdit() {
|
|
669
|
+
if ('internalAnalyticsTags' in this.capiData &&
|
|
670
|
+
this.capiData.internalAnalyticsTags) {
|
|
671
|
+
return this.capiData.internalAnalyticsTags.includes('ftedit');
|
|
672
|
+
}
|
|
673
|
+
return false;
|
|
674
|
+
}
|
|
668
675
|
design() {
|
|
669
676
|
if ('design' in this.capiData && this.capiData.design.theme) {
|
|
670
677
|
return { theme: this.capiData.design.theme };
|
|
@@ -697,5 +704,5 @@ class CapiResponse {
|
|
|
697
704
|
return null;
|
|
698
705
|
}
|
|
699
706
|
}
|
|
700
|
-
exports.
|
|
701
|
-
//# sourceMappingURL=
|
|
707
|
+
exports.Content = Content;
|
|
708
|
+
//# sourceMappingURL=Content.js.map
|