@financial-times/cp-content-pipeline-schema 3.4.0 → 3.5.1
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 +33 -0
- package/lib/datasources/capi.d.ts +0 -2
- package/lib/datasources/capi.js +10 -23
- package/lib/datasources/capi.js.map +1 -1
- package/lib/datasources/instrumented.js +4 -1
- package/lib/datasources/instrumented.js.map +1 -1
- package/lib/datasources/origami-image.d.ts +0 -2
- package/lib/datasources/origami-image.js +5 -19
- package/lib/datasources/origami-image.js.map +1 -1
- package/lib/datasources/twitter.d.ts +0 -2
- package/lib/datasources/twitter.js +2 -16
- package/lib/datasources/twitter.js.map +1 -1
- package/lib/datasources/url-management.js +5 -3
- package/lib/datasources/url-management.js.map +1 -1
- package/lib/fixtures/dummyContext.js +1 -1
- package/lib/generated/index.d.ts +73 -22
- package/lib/index.d.ts +1 -0
- package/lib/index.js.map +1 -1
- package/lib/model/Byline.js +11 -14
- package/lib/model/Byline.js.map +1 -1
- package/lib/model/CapiList.js +2 -0
- package/lib/model/CapiList.js.map +1 -1
- package/lib/model/CapiResponse.d.ts +7 -3
- package/lib/model/CapiResponse.js +125 -57
- package/lib/model/CapiResponse.js.map +1 -1
- package/lib/model/CapiResponse.test.js +92 -7
- package/lib/model/CapiResponse.test.js.map +1 -1
- package/lib/model/Clip.js +2 -0
- package/lib/model/Clip.js.map +1 -1
- package/lib/model/Concept.js +4 -10
- package/lib/model/Concept.js.map +1 -1
- package/lib/model/FlourishSource.d.ts +12 -5
- package/lib/model/FlourishSource.js +37 -38
- package/lib/model/FlourishSource.js.map +1 -1
- package/lib/model/FlourishSource.test.js +5 -5
- package/lib/model/FlourishSource.test.js.map +1 -1
- package/lib/model/Image.js +22 -20
- package/lib/model/Image.js.map +1 -1
- package/lib/model/LeadFlourish.d.ts +1 -1
- package/lib/model/LeadFlourish.js +8 -11
- package/lib/model/LeadFlourish.js.map +1 -1
- package/lib/model/LeadFlourish.test.js +5 -7
- package/lib/model/LeadFlourish.test.js.map +1 -1
- package/lib/model/Person.js +5 -16
- package/lib/model/Person.js.map +1 -1
- package/lib/model/Picture.js +3 -0
- package/lib/model/Picture.js.map +1 -1
- package/lib/model/RichText.js +3 -0
- package/lib/model/RichText.js.map +1 -1
- package/lib/model/Topper.js +5 -16
- package/lib/model/Topper.js.map +1 -1
- package/lib/model/schemas/capi/article.d.ts +3 -3
- package/lib/model/schemas/capi/audio.d.ts +5 -5
- package/lib/model/schemas/capi/base-schema.d.ts +5 -5
- package/lib/model/schemas/capi/base-schema.js +1 -1
- package/lib/model/schemas/capi/base-schema.js.map +1 -1
- package/lib/model/schemas/capi/content-package.d.ts +3 -3
- package/lib/model/schemas/capi/custom-code-component.d.ts +3 -3
- package/lib/model/schemas/capi/index.d.ts +20 -20
- package/lib/model/schemas/capi/internal-content.d.ts +1 -1
- package/lib/model/schemas/capi/live-blog-package.d.ts +3 -3
- package/lib/model/schemas/capi/placeholder.d.ts +3 -3
- package/lib/model/schemas/capi/video.d.ts +3 -3
- package/lib/resolvers/content-tree/references/Flourish.d.ts +9 -19
- package/lib/resolvers/content-tree/references/Flourish.js +10 -32
- package/lib/resolvers/content-tree/references/Flourish.js.map +1 -1
- package/lib/resolvers/content-tree/references/Flourish.test.js +3 -3
- package/lib/resolvers/content-tree/references/Flourish.test.js.map +1 -1
- package/lib/resolvers/content-tree/references/RawImage.js +2 -0
- package/lib/resolvers/content-tree/references/RawImage.js.map +1 -1
- package/lib/resolvers/content-tree/references/index.d.ts +2 -2
- package/lib/resolvers/content-tree/references/index.js +1 -1
- package/lib/resolvers/content-tree/references/index.js.map +1 -1
- package/lib/resolvers/content.d.ts +26 -1
- package/lib/resolvers/content.js +21 -1
- package/lib/resolvers/content.js.map +1 -1
- package/lib/resolvers/index.d.ts +27 -3
- package/lib/resolvers/leadFlourish.d.ts +1 -1
- package/lib/resolvers/literal-union.js +1 -0
- package/lib/resolvers/literal-union.js.map +1 -1
- package/lib/types/connection.d.ts +21 -0
- package/lib/types/connection.js +5 -0
- package/lib/types/connection.js.map +1 -0
- package/package.json +1 -1
- package/queries/article.graphql +8 -2
- package/src/datasources/capi.ts +1 -14
- package/src/datasources/origami-image.ts +1 -13
- package/src/datasources/twitter.ts +1 -14
- package/src/fixtures/dummyContext.ts +1 -1
- package/src/generated/index.ts +75 -24
- package/src/index.ts +1 -0
- package/src/model/CapiResponse.test.ts +137 -7
- package/src/model/CapiResponse.ts +129 -37
- package/src/model/FlourishSource.test.ts +5 -5
- package/src/model/FlourishSource.ts +57 -39
- package/src/model/Image.ts +16 -0
- package/src/model/LeadFlourish.test.ts +6 -9
- package/src/model/LeadFlourish.ts +5 -1
- package/src/model/schemas/capi/base-schema.ts +1 -1
- package/src/model/schemas/capi/internal-content.ts +1 -1
- package/src/resolvers/content-tree/references/Flourish.test.ts +4 -3
- package/src/resolvers/content-tree/references/Flourish.ts +16 -32
- package/src/resolvers/content-tree/references/index.ts +4 -4
- package/src/resolvers/content.ts +31 -1
- package/src/types/connection.ts +28 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/typedefs/content.graphql +40 -2
- package/typedefs/leadFlourish.graphql +1 -1
- package/typedefs/references/flourish.graphql +1 -11
- package/lib/helpers/timeout-error.d.ts +0 -6
- package/lib/helpers/timeout-error.js +0 -15
- package/lib/helpers/timeout-error.js.map +0 -1
- package/src/helpers/timeout-error.ts +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.5.1](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-schema-v3.5.0...cp-content-pipeline-schema-v3.5.1) (2024-10-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* call image service once for FlourishSource ([1eb9122](https://github.com/Financial-Times/cp-content-pipeline/commit/1eb9122283d52968ce2baf2766d3180dd6927220))
|
|
9
|
+
* dataSource.filesize is optional ([bc3fba5](https://github.com/Financial-Times/cp-content-pipeline/commit/bc3fba574e551bf81a7864799691618321fe1366))
|
|
10
|
+
* don't call image service for graphics ([64064a0](https://github.com/Financial-Times/cp-content-pipeline/commit/64064a0999512d86d43eed3ff080ce4be446f76a))
|
|
11
|
+
* make LeadFlourish.fallbackImage nullable ([6ff7c96](https://github.com/Financial-Times/cp-content-pipeline/commit/6ff7c96d8d9873f8758c68b2a9094189d5ecb6d2))
|
|
12
|
+
|
|
13
|
+
## [3.5.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-schema-v3.4.0...cp-content-pipeline-schema-v3.5.0) (2024-10-24)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **api:** request how many live blog posts to fetch in query parameter ([bde0da2](https://github.com/Financial-Times/cp-content-pipeline/commit/bde0da2c58c575b4f1d2fe80d30beb1b36a696a3))
|
|
19
|
+
* **client:** return whether more blog posts can be requested ([4fc05d5](https://github.com/Financial-Times/cp-content-pipeline/commit/4fc05d536db53d33315abc7752e5d24649d28e64))
|
|
20
|
+
* **schema:** add GraphQL argument to request first x live blog posts ([8be94cc](https://github.com/Financial-Times/cp-content-pipeline/commit/8be94cca226cfcfe746ff6861b203db188943cd0))
|
|
21
|
+
* **schema:** add pagination support for live blog posts ([5b9aa4f](https://github.com/Financial-Times/cp-content-pipeline/commit/5b9aa4f26150a13645031b3de40d695cd5308cca))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* don't cache responses when CAPI timed out ([0a84a51](https://github.com/Financial-Times/cp-content-pipeline/commit/0a84a5168a15b4898204c48c19797ef496ccda87))
|
|
27
|
+
* **schema:** don't erroneously throw timeout errors ([54b8b41](https://github.com/Financial-Times/cp-content-pipeline/commit/54b8b415b1851b496c5eadcef9172c5960e73ac3))
|
|
28
|
+
* **schema:** sort live blog posts by published date after pagination ([7ed26f2](https://github.com/Financial-Times/cp-content-pipeline/commit/7ed26f24f64b7502c1e8610f4814c515dc046135))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Performance Improvements
|
|
32
|
+
|
|
33
|
+
* **schema:** only call CAPI once in pinnedPost resolver ([ea1b5be](https://github.com/Financial-Times/cp-content-pipeline/commit/ea1b5beee8e361050df4334a5e5592c7d6247103))
|
|
34
|
+
* **schema:** refactor connections logic into contains method ([022213e](https://github.com/Financial-Times/cp-content-pipeline/commit/022213ead8517d90d211a1d08541869485965618))
|
|
35
|
+
|
|
3
36
|
## [3.4.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-schema-v3.3.2...cp-content-pipeline-schema-v3.4.0) (2024-10-21)
|
|
4
37
|
|
|
5
38
|
|
|
@@ -9,8 +9,6 @@ export declare class CapiDataSource extends InstrumentedRESTDataSource {
|
|
|
9
9
|
articleCacheTTL: number;
|
|
10
10
|
peopleCacheTTL: number;
|
|
11
11
|
get backendSystemCode(): string;
|
|
12
|
-
abortController: AbortController;
|
|
13
|
-
timeout: ReturnType<typeof setTimeout> | undefined;
|
|
14
12
|
nextNotificationLink?: string;
|
|
15
13
|
willSendRequest(path: string, request: AugmentedRequest): void;
|
|
16
14
|
getContent(uuid: string, packageContainer?: CapiResponse): Promise<CapiResponse>;
|
package/lib/datasources/capi.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.CapiDataSource = void 0;
|
|
7
4
|
const CapiResponse_1 = require("../model/CapiResponse");
|
|
8
5
|
const instrumented_1 = require("./instrumented");
|
|
9
6
|
const CapiList_1 = require("../model/CapiList");
|
|
10
|
-
const timeout_error_1 = __importDefault(require("../helpers/timeout-error"));
|
|
11
7
|
const Person_1 = require("../model/Person");
|
|
12
8
|
const REQUEST_TIMEOUT = process.env.CAPI_DATASOURCE_REQUEST_TIMEOUT
|
|
13
9
|
? parseInt(process.env.CAPI_DATASOURCE_REQUEST_TIMEOUT)
|
|
@@ -20,27 +16,22 @@ function getWrappedCacheKey(cache) {
|
|
|
20
16
|
return '';
|
|
21
17
|
}
|
|
22
18
|
class CapiDataSource extends instrumented_1.InstrumentedRESTDataSource {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
? parseInt(process.env.PEOPLE_CACHE_TTL)
|
|
32
|
-
: 600; // 10 minutes
|
|
33
|
-
this.abortController = new AbortController();
|
|
34
|
-
this.timeout = undefined;
|
|
35
|
-
}
|
|
19
|
+
baseURL = process.env.CAPI_URL || 'https://api-t.ft.com/';
|
|
20
|
+
capiKey = process.env.CAPI_API_KEY || '';
|
|
21
|
+
articleCacheTTL = process.env.ARTICLE_CACHE_TTL
|
|
22
|
+
? parseInt(process.env.ARTICLE_CACHE_TTL)
|
|
23
|
+
: 60 * 60 * 24 * 7 * 4; // 4 weeks
|
|
24
|
+
peopleCacheTTL = process.env.PEOPLE_CACHE_TTL
|
|
25
|
+
? parseInt(process.env.PEOPLE_CACHE_TTL)
|
|
26
|
+
: 600; // 10 minutes
|
|
36
27
|
get backendSystemCode() {
|
|
37
28
|
return 'up-ica';
|
|
38
29
|
}
|
|
30
|
+
nextNotificationLink;
|
|
39
31
|
willSendRequest(path, request) {
|
|
40
32
|
super.willSendRequest(path, request);
|
|
33
|
+
request.signal = AbortSignal.timeout(REQUEST_TIMEOUT);
|
|
41
34
|
request.headers['x-api-key'] = this.capiKey;
|
|
42
|
-
request.signal = this.abortController.signal;
|
|
43
|
-
this.timeout = setTimeout(() => this.abortController.abort(new timeout_error_1.default(REQUEST_TIMEOUT)), REQUEST_TIMEOUT);
|
|
44
35
|
}
|
|
45
36
|
async getContent(uuid, packageContainer) {
|
|
46
37
|
this.context.addSurrogateKeys([
|
|
@@ -54,10 +45,6 @@ class CapiDataSource extends instrumented_1.InstrumentedRESTDataSource {
|
|
|
54
45
|
});
|
|
55
46
|
this.context.contentRequestedOnce = true;
|
|
56
47
|
this.calls.push(uuid);
|
|
57
|
-
if (this.timeout) {
|
|
58
|
-
clearTimeout(this.timeout);
|
|
59
|
-
this.timeout = undefined;
|
|
60
|
-
}
|
|
61
48
|
return CapiResponse_1.CapiResponse.fromJSON(content, this.context, packageContainer);
|
|
62
49
|
}
|
|
63
50
|
async getPerson(uuid) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capi.js","sourceRoot":"","sources":["../../src/datasources/capi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"capi.js","sourceRoot":"","sources":["../../src/datasources/capi.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AACpD,iDAA2D;AAM3D,gDAA4C;AAC5C,4CAAwC;AAExC,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,+BAA+B;IACjE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC;IACvD,CAAC,CAAC,GAAG,CAAA;AAEP,MAAM,WAAW,GAAG,CAAC,KAAoB,EAAmC,EAAE,CAC5E,QAAQ,IAAI,KAAK,CAAA;AAEnB,SAAS,kBAAkB,CAAC,KAAoB;IAC9C,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;IAC/D,CAAC;IAED,OAAO,EAAE,CAAA;AACX,CAAC;AAED,MAAa,cAAe,SAAQ,yCAA0B;IAC5D,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,uBAAuB,CAAA;IACzD,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,I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errors_1 = require("@dotcom-reliability-kit/errors");
|
|
9
9
|
class InstrumentedRESTDataSource extends datasource_rest_1.RESTDataSource {
|
|
10
|
+
startTime;
|
|
11
|
+
context;
|
|
12
|
+
calls = [];
|
|
13
|
+
errorHandler;
|
|
10
14
|
get backendSystemCode() {
|
|
11
15
|
return undefined;
|
|
12
16
|
}
|
|
@@ -17,7 +21,6 @@ class InstrumentedRESTDataSource extends datasource_rest_1.RESTDataSource {
|
|
|
17
21
|
cache: wrappedCache,
|
|
18
22
|
fetch: (url, init) => this.errorHandler(global.fetch(url, init)),
|
|
19
23
|
});
|
|
20
|
-
this.calls = [];
|
|
21
24
|
this.errorHandler = (0, fetch_error_handler_1.createFetchErrorHandler)({
|
|
22
25
|
upstreamSystemCode: this.backendSystemCode,
|
|
23
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumented.js","sourceRoot":"","sources":["../../src/datasources/instrumented.ts"],"names":[],"mappings":";;;AAAA,6DAMgC;AAChC,qEAAoE;AACpE,qFAGoD;AAEpD,0CAAmD;AAEnD,2DAA0D;AAE1D,MAAa,0BACX,SAAQ,gCAAc;
|
|
1
|
+
{"version":3,"file":"instrumented.js","sourceRoot":"","sources":["../../src/datasources/instrumented.ts"],"names":[],"mappings":";;;AAAA,6DAMgC;AAChC,qEAAoE;AACpE,qFAGoD;AAEpD,0CAAmD;AAEnD,2DAA0D;AAE1D,MAAa,0BACX,SAAQ,gCAAc;IAGtB,SAAS,CAAS;IAClB,OAAO,CAAc;IACrB,KAAK,GAAa,EAAE,CAAA;IACpB,YAAY,CAAmB;IAE/B,IAAI,iBAAiB;QACnB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,YAAY,EAAE,KAAK,EAAE,OAAO,EAAyB;QACnD,MAAM,YAAY,GAAG,IAAI,4CAAsB,CAC7C,IAAA,0BAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,C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GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;gBAEpE,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YAC3C,CAAC;YAED,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;CACF;AArGD,gEAqGC"}
|
|
@@ -3,8 +3,6 @@ import { AugmentedRequest, CacheOptions } from '@apollo/datasource-rest';
|
|
|
3
3
|
export declare class OrigamiImageDataSource extends InstrumentedRESTDataSource {
|
|
4
4
|
baseURL: string;
|
|
5
5
|
get backendSystemCode(): string;
|
|
6
|
-
abortController: AbortController;
|
|
7
|
-
timeout: ReturnType<typeof setTimeout> | undefined;
|
|
8
6
|
imageMetadataCacheTTL: number;
|
|
9
7
|
willSendRequest(path: string, request: AugmentedRequest): void;
|
|
10
8
|
protected cacheOptionsFor(): CacheOptions;
|
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.OrigamiImageDataSource = void 0;
|
|
7
|
-
const timeout_error_1 = __importDefault(require("../helpers/timeout-error"));
|
|
8
4
|
const instrumented_1 = require("./instrumented");
|
|
9
5
|
const REQUEST_TIMEOUT = process.env.ORIGAMI_DATASOURCE_REQUEST_TIMEOUT
|
|
10
6
|
? parseInt(process.env.ORIGAMI_DATASOURCE_REQUEST_TIMEOUT)
|
|
11
7
|
: 200;
|
|
12
8
|
class OrigamiImageDataSource extends instrumented_1.InstrumentedRESTDataSource {
|
|
13
|
-
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.baseURL = 'https://www.ft.com/__origami/service/image/v2/';
|
|
16
|
-
this.abortController = new AbortController();
|
|
17
|
-
this.timeout = undefined;
|
|
18
|
-
this.imageMetadataCacheTTL = process.env.IMAGE_METADATA_CACHE_TTL
|
|
19
|
-
? parseInt(process.env.IMAGE_METADATA_CACHE_TTL)
|
|
20
|
-
: 60 * 60 * 24 * 7; // 1 week
|
|
21
|
-
}
|
|
9
|
+
baseURL = 'https://www.ft.com/__origami/service/image/v2/';
|
|
22
10
|
get backendSystemCode() {
|
|
23
11
|
return 'origami-image-service-v2';
|
|
24
12
|
}
|
|
13
|
+
imageMetadataCacheTTL = process.env.IMAGE_METADATA_CACHE_TTL
|
|
14
|
+
? parseInt(process.env.IMAGE_METADATA_CACHE_TTL)
|
|
15
|
+
: 60 * 60 * 24 * 7; // 1 week
|
|
25
16
|
willSendRequest(path, request) {
|
|
26
17
|
super.willSendRequest(path, request);
|
|
27
|
-
request.signal =
|
|
28
|
-
this.timeout = setTimeout(() => this.abortController.abort(new timeout_error_1.default(REQUEST_TIMEOUT)), REQUEST_TIMEOUT);
|
|
18
|
+
request.signal = AbortSignal.timeout(REQUEST_TIMEOUT);
|
|
29
19
|
}
|
|
30
20
|
cacheOptionsFor() {
|
|
31
21
|
return { ttl: this.imageMetadataCacheTTL };
|
|
@@ -33,10 +23,6 @@ class OrigamiImageDataSource extends instrumented_1.InstrumentedRESTDataSource {
|
|
|
33
23
|
async getImageMetadata(url) {
|
|
34
24
|
const imageMetadata = await this.get(`images/metadata/${encodeURIComponent(url)}?source=next`);
|
|
35
25
|
this.calls.push(url);
|
|
36
|
-
if (this.timeout) {
|
|
37
|
-
clearTimeout(this.timeout);
|
|
38
|
-
this.timeout = undefined;
|
|
39
|
-
}
|
|
40
26
|
return imageMetadata;
|
|
41
27
|
}
|
|
42
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"origami-image.js","sourceRoot":"","sources":["../../src/datasources/origami-image.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"origami-image.js","sourceRoot":"","sources":["../../src/datasources/origami-image.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAG3D,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,kCAAkC;IACpE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC;IAC1D,CAAC,CAAC,GAAG,CAAA;AAEP,MAAa,sBAAuB,SAAQ,yCAA0B;IACpE,OAAO,GAAG,gDAAgD,CAAA;IAC1D,IAAI,iBAAiB;QACnB,OAAO,0BAA0B,CAAA;IACnC,CAAC;IAED,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB;QAC1D,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;QAChD,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,CAAC,SAAS;IAErB,eAAe,CAAC,IAAY,EAAE,OAAyB;QAC9D,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAEpC,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;IACvD,CAAC;IAES,eAAe;QACvB,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,qBAAqB,EAAE,CAAA;IAC5C,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,GAAW;QAEX,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,GAAG,CAClC,mBAAmB,kBAAkB,CAAC,GAAG,CAAC,cAAc,CACzD,CAAA;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEpB,OAAO,aAAa,CAAA;IACtB,CAAC;CACF;AA/BD,wDA+BC"}
|
|
@@ -3,8 +3,6 @@ import { InstrumentedRESTDataSource } from './instrumented';
|
|
|
3
3
|
export declare class TwitterDataSource extends InstrumentedRESTDataSource {
|
|
4
4
|
baseURL: string;
|
|
5
5
|
get backendSystemCode(): string;
|
|
6
|
-
abortController: AbortController;
|
|
7
|
-
timeout: ReturnType<typeof setTimeout> | undefined;
|
|
8
6
|
willSendRequest(path: string, request: AugmentedRequest): void;
|
|
9
7
|
getTweet(tweetUrl: string): Promise<{
|
|
10
8
|
html: string;
|
|
@@ -22,40 +22,26 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.TwitterDataSource = void 0;
|
|
30
27
|
const z = __importStar(require("zod"));
|
|
31
28
|
const instrumented_1 = require("./instrumented");
|
|
32
|
-
const timeout_error_1 = __importDefault(require("../helpers/timeout-error"));
|
|
33
29
|
const REQUEST_TIMEOUT = process.env.TWITTER_DATASOURCE_REQUEST_TIMEOUT
|
|
34
30
|
? parseInt(process.env.TWITTER_DATASOURCE_REQUEST_TIMEOUT)
|
|
35
31
|
: 1000;
|
|
36
32
|
const Tweet = z.object({ html: z.string() });
|
|
37
33
|
class TwitterDataSource extends instrumented_1.InstrumentedRESTDataSource {
|
|
38
|
-
|
|
39
|
-
super(...arguments);
|
|
40
|
-
this.baseURL = 'https://publish.twitter.com';
|
|
41
|
-
this.abortController = new AbortController();
|
|
42
|
-
this.timeout = undefined;
|
|
43
|
-
}
|
|
34
|
+
baseURL = 'https://publish.twitter.com';
|
|
44
35
|
get backendSystemCode() {
|
|
45
36
|
return 'twitter-oembed-api';
|
|
46
37
|
}
|
|
47
38
|
willSendRequest(path, request) {
|
|
48
39
|
super.willSendRequest(path, request);
|
|
49
|
-
request.signal =
|
|
50
|
-
this.timeout = setTimeout(() => this.abortController.abort(new timeout_error_1.default(REQUEST_TIMEOUT)), REQUEST_TIMEOUT);
|
|
40
|
+
request.signal = AbortSignal.timeout(REQUEST_TIMEOUT);
|
|
51
41
|
}
|
|
52
42
|
async getTweet(tweetUrl) {
|
|
53
43
|
const tweet = await this.get(`oembed?url=${tweetUrl}&omit_script=true`);
|
|
54
44
|
this.calls.push(tweetUrl);
|
|
55
|
-
if (this.timeout) {
|
|
56
|
-
clearTimeout(this.timeout);
|
|
57
|
-
this.timeout = undefined;
|
|
58
|
-
}
|
|
59
45
|
return Tweet.parse(tweet);
|
|
60
46
|
}
|
|
61
47
|
cacheOptionsFor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twitter.js","sourceRoot":"","sources":["../../src/datasources/twitter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"twitter.js","sourceRoot":"","sources":["../../src/datasources/twitter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAAwB;AAExB,iDAA2D;AAE3D,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,kCAAkC;IACpE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC;IAC1D,CAAC,CAAC,IAAI,CAAA;AAER,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAE5C,MAAa,iBAAkB,SAAQ,yCAA0B;IAC/D,OAAO,GAAG,6BAA6B,CAAA;IACvC,IAAI,iBAAiB;QACnB,OAAO,oBAAoB,CAAA;IAC7B,CAAC;IAEQ,eAAe,CAAC,IAAY,EAAE,OAAyB;QAC9D,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QAEpC,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;IACvD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB;QAC7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,cAAc,QAAQ,mBAAmB,CAAC,CAAA;QAEvE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAEzB,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC3B,CAAC;IAED,eAAe;QACb,iFAAiF;QACjF,oFAAoF;QACpF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;IACtB,CAAC;CACF;AAzBD,8CAyBC"}
|
|
@@ -9,9 +9,12 @@ const n_url_management_api_read_client_1 = __importDefault(require("@financial-t
|
|
|
9
9
|
const CACHE_PREFIX = 'nurlmgmtapi:';
|
|
10
10
|
const DEFAULT_TTL_IN_SECONDS = 60 * 60; // one hour
|
|
11
11
|
class URLManagementDataSource {
|
|
12
|
+
memoizedResults = new Map();
|
|
13
|
+
cache;
|
|
14
|
+
context;
|
|
15
|
+
calls = [];
|
|
16
|
+
static clientInitialised = false;
|
|
12
17
|
constructor({ context, cache }) {
|
|
13
|
-
this.memoizedResults = new Map();
|
|
14
|
-
this.calls = [];
|
|
15
18
|
if (!URLManagementDataSource.clientInitialised) {
|
|
16
19
|
// n-url-management-api-read-client uses next-metrics histograms
|
|
17
20
|
// but our custom Graphite client doesn't support that and also
|
|
@@ -48,5 +51,4 @@ class URLManagementDataSource {
|
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
exports.URLManagementDataSource = URLManagementDataSource;
|
|
51
|
-
URLManagementDataSource.clientInitialised = false;
|
|
52
54
|
//# sourceMappingURL=url-management.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-management.js","sourceRoot":"","sources":["../../src/datasources/url-management.ts"],"names":[],"mappings":";;;;;;AAAA,qEAGoC;AAEpC,yHAA2F;AAK3F,MAAM,YAAY,GAAG,cAAc,CAAA;AACnC,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,CAAA,CAAC,WAAW;AAElD,MAAa,uBAAuB;
|
|
1
|
+
{"version":3,"file":"url-management.js","sourceRoot":"","sources":["../../src/datasources/url-management.ts"],"names":[],"mappings":";;;;;;AAAA,qEAGoC;AAEpC,yHAA2F;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CAAC,KAAK,CAAA;QAC3B,CAAC,CAAA;QAED,IAAI,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAE/C,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,OAAO,GAAG,SAAS,EAAE,CAAA;QACrB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAE1C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACxB,OAAO,OAAO,CAAA;IAChB,CAAC;;AArDH,0DAsDC"}
|
|
@@ -21,7 +21,7 @@ exports.default = {
|
|
|
21
21
|
getContent: (id) => Promise.resolve(new CapiResponse_1.CapiResponse((0, clone_deep_1.default)({
|
|
22
22
|
...capiObject_1.baseCapiObject,
|
|
23
23
|
id,
|
|
24
|
-
publishedDate: new Date(now + parseInt(id.slice(-
|
|
24
|
+
publishedDate: new Date(now + parseInt(id.slice(-2), 10)).toISOString(),
|
|
25
25
|
}), { addSurrogateKeys })),
|
|
26
26
|
},
|
|
27
27
|
},
|
package/lib/generated/index.d.ts
CHANGED
|
@@ -542,6 +542,18 @@ export type ContentUrlArgs = {
|
|
|
542
542
|
relative?: InputMaybe<Scalars['Boolean']['input']>;
|
|
543
543
|
vanity?: InputMaybe<Scalars['Boolean']['input']>;
|
|
544
544
|
};
|
|
545
|
+
export type ContentConnection = {
|
|
546
|
+
/** A list of edges for the connection. */
|
|
547
|
+
readonly edges: ReadonlyArray<Maybe<ContentEdge>>;
|
|
548
|
+
/** Pagination data for the connection. */
|
|
549
|
+
readonly pageInfo: PageInfo;
|
|
550
|
+
};
|
|
551
|
+
export type ContentEdge = {
|
|
552
|
+
/** The opaque cursor for this edge that can be used for future requests. */
|
|
553
|
+
readonly cursor: Scalars['String']['output'];
|
|
554
|
+
/** The child article of this edge. */
|
|
555
|
+
readonly node?: Maybe<Content>;
|
|
556
|
+
};
|
|
545
557
|
export type ContentPackage = Content & {
|
|
546
558
|
/** A scalar representing the access level of the article, eg. 'free'. */
|
|
547
559
|
readonly accessLevel?: Maybe<Scalars['AccessLevel']['output']>;
|
|
@@ -696,18 +708,10 @@ export type Design = {
|
|
|
696
708
|
};
|
|
697
709
|
export type Flourish = Reference & {
|
|
698
710
|
/** The fallback image to be used if the flourish graphics cannot be loaded. */
|
|
699
|
-
readonly fallbackImage?: Maybe<
|
|
711
|
+
readonly fallbackImage?: Maybe<FlourishSource>;
|
|
700
712
|
/** The type of the reference, eg. 'flourish'. */
|
|
701
713
|
readonly type: Scalars['String']['output'];
|
|
702
714
|
};
|
|
703
|
-
export type FlourishFallback = {
|
|
704
|
-
/** The height in pixels of the fallback image. */
|
|
705
|
-
readonly height?: Maybe<Scalars['Int']['output']>;
|
|
706
|
-
/** The url of the fallback image. */
|
|
707
|
-
readonly url?: Maybe<Scalars['String']['output']>;
|
|
708
|
-
/** The width in pixels of the fallback image. */
|
|
709
|
-
readonly width?: Maybe<Scalars['Int']['output']>;
|
|
710
|
-
};
|
|
711
715
|
export type FlourishSource = {
|
|
712
716
|
/** The format of the source, eg. 'standard'. */
|
|
713
717
|
readonly format: Scalars['ImageFormat']['output'];
|
|
@@ -1039,7 +1043,7 @@ export type LayoutImage = Reference & {
|
|
|
1039
1043
|
export type LeadFlourish = {
|
|
1040
1044
|
/** The description of the Flourish chart. */
|
|
1041
1045
|
readonly description?: Maybe<Scalars['String']['output']>;
|
|
1042
|
-
readonly fallbackImage
|
|
1046
|
+
readonly fallbackImage?: Maybe<FlourishSource>;
|
|
1043
1047
|
/** The id of the Flourish chart. */
|
|
1044
1048
|
readonly id?: Maybe<Scalars['String']['output']>;
|
|
1045
1049
|
/** The type of the chart, eg. 'visualisation'. */
|
|
@@ -1096,6 +1100,8 @@ export type LiveBlogPackage = Content & {
|
|
|
1096
1100
|
readonly instantAlertConcept?: Maybe<Concept>;
|
|
1097
1101
|
/** The child articles of this live blog package. */
|
|
1098
1102
|
readonly liveBlogPosts?: Maybe<ReadonlyArray<Maybe<Content>>>;
|
|
1103
|
+
/** The child articles of this live blog package following the [Connections](https://relay.dev/graphql/connections.htm) spec. */
|
|
1104
|
+
readonly liveBlogPostsConnection?: Maybe<ContentConnection>;
|
|
1099
1105
|
/** An image object containing the url and the caption, to be displayed usually before the article content. */
|
|
1100
1106
|
readonly mainImage?: Maybe<Image>;
|
|
1101
1107
|
/** The number of milliseconds since the unix epoch the article was last changed, eg '1712140552443'. */
|
|
@@ -1131,6 +1137,15 @@ export type LiveBlogPackageAnnotationsArgs = {
|
|
|
1131
1137
|
export type LiveBlogPackageBylineArgs = {
|
|
1132
1138
|
vanity?: InputMaybe<Scalars['Boolean']['input']>;
|
|
1133
1139
|
};
|
|
1140
|
+
export type LiveBlogPackageLiveBlogPostsArgs = {
|
|
1141
|
+
count?: InputMaybe<Scalars['Int']['input']>;
|
|
1142
|
+
};
|
|
1143
|
+
export type LiveBlogPackageLiveBlogPostsConnectionArgs = {
|
|
1144
|
+
after?: InputMaybe<Scalars['String']['input']>;
|
|
1145
|
+
before?: InputMaybe<Scalars['String']['input']>;
|
|
1146
|
+
first?: InputMaybe<Scalars['Int']['input']>;
|
|
1147
|
+
last?: InputMaybe<Scalars['Int']['input']>;
|
|
1148
|
+
};
|
|
1134
1149
|
export type LiveBlogPackageUrlArgs = {
|
|
1135
1150
|
relative?: InputMaybe<Scalars['Boolean']['input']>;
|
|
1136
1151
|
vanity?: InputMaybe<Scalars['Boolean']['input']>;
|
|
@@ -1265,6 +1280,16 @@ export type OpinionTopperHeadshotArgs = {
|
|
|
1265
1280
|
url?: InputMaybe<Scalars['String']['input']>;
|
|
1266
1281
|
width?: InputMaybe<Scalars['Int']['input']>;
|
|
1267
1282
|
};
|
|
1283
|
+
export type PageInfo = {
|
|
1284
|
+
/** The cursor for the last edge. */
|
|
1285
|
+
readonly endCursor?: Maybe<Scalars['String']['output']>;
|
|
1286
|
+
/** Whether a subsequent page of edges is available on request. */
|
|
1287
|
+
readonly hasNextPage: Scalars['Boolean']['output'];
|
|
1288
|
+
/** Whether a previous page of edges is available on request. */
|
|
1289
|
+
readonly hasPreviousPage: Scalars['Boolean']['output'];
|
|
1290
|
+
/** The cursor for the first edge. */
|
|
1291
|
+
readonly startCursor?: Maybe<Scalars['String']['output']>;
|
|
1292
|
+
};
|
|
1268
1293
|
export type PartnerContentTopper = Topper & TopperWithImages & TopperWithTheme & {
|
|
1269
1294
|
/** Whether the topper should have a background box. */
|
|
1270
1295
|
readonly backgroundBox?: Maybe<Scalars['Boolean']['output']>;
|
|
@@ -1834,6 +1859,12 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1834
1859
|
Concept: ResolverTypeWrapper<ConceptModel>;
|
|
1835
1860
|
ConceptInterface: ResolverTypeWrapper<ConceptModel>;
|
|
1836
1861
|
Content: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['Content']>;
|
|
1862
|
+
ContentConnection: ResolverTypeWrapper<Omit<ContentConnection, 'edges'> & {
|
|
1863
|
+
edges: ReadonlyArray<Maybe<ResolversTypes['ContentEdge']>>;
|
|
1864
|
+
}>;
|
|
1865
|
+
ContentEdge: ResolverTypeWrapper<Omit<ContentEdge, 'node'> & {
|
|
1866
|
+
node: Maybe<ResolversTypes['Content']>;
|
|
1867
|
+
}>;
|
|
1837
1868
|
ContentPackage: ResolverTypeWrapper<CapiResponse>;
|
|
1838
1869
|
ContentType: ResolverTypeWrapper<Scalars['ContentType']['output']>;
|
|
1839
1870
|
CustomCodeComponent: ResolverTypeWrapper<ReferenceWithCAPIData<ContentTree.CustomCodeComponent>>;
|
|
@@ -1842,7 +1873,6 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1842
1873
|
Design: ResolverTypeWrapper<Design>;
|
|
1843
1874
|
Float: ResolverTypeWrapper<Scalars['Float']['output']>;
|
|
1844
1875
|
Flourish: ResolverTypeWrapper<ReferenceWithCAPIData<ContentTree.Flourish>>;
|
|
1845
|
-
FlourishFallback: ResolverTypeWrapper<FlourishFallback>;
|
|
1846
1876
|
FlourishSource: ResolverTypeWrapper<FlourishSourceModel>;
|
|
1847
1877
|
FollowButtonVariant: ResolverTypeWrapper<Scalars['FollowButtonVariant']['output']>;
|
|
1848
1878
|
FullBleedTopper: ResolverTypeWrapper<TopperModel>;
|
|
@@ -1877,6 +1907,7 @@ export type ResolversTypes = ResolversObject<{
|
|
|
1877
1907
|
Mutation: ResolverTypeWrapper<{}>;
|
|
1878
1908
|
OpinionTopper: ResolverTypeWrapper<TopperModel>;
|
|
1879
1909
|
PackageDesign: ResolverTypeWrapper<Scalars['PackageDesign']['output']>;
|
|
1910
|
+
PageInfo: ResolverTypeWrapper<PageInfo>;
|
|
1880
1911
|
PartnerContentTopper: ResolverTypeWrapper<TopperModel>;
|
|
1881
1912
|
Person: ResolverTypeWrapper<PersonModel>;
|
|
1882
1913
|
Picture: ResolverTypeWrapper<PictureModel>;
|
|
@@ -1936,6 +1967,12 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
1936
1967
|
Concept: ConceptModel;
|
|
1937
1968
|
ConceptInterface: ConceptModel;
|
|
1938
1969
|
Content: ResolversInterfaceTypes<ResolversParentTypes>['Content'];
|
|
1970
|
+
ContentConnection: Omit<ContentConnection, 'edges'> & {
|
|
1971
|
+
edges: ReadonlyArray<Maybe<ResolversParentTypes['ContentEdge']>>;
|
|
1972
|
+
};
|
|
1973
|
+
ContentEdge: Omit<ContentEdge, 'node'> & {
|
|
1974
|
+
node: Maybe<ResolversParentTypes['Content']>;
|
|
1975
|
+
};
|
|
1939
1976
|
ContentPackage: CapiResponse;
|
|
1940
1977
|
ContentType: Scalars['ContentType']['output'];
|
|
1941
1978
|
CustomCodeComponent: ReferenceWithCAPIData<ContentTree.CustomCodeComponent>;
|
|
@@ -1944,7 +1981,6 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
1944
1981
|
Design: Design;
|
|
1945
1982
|
Float: Scalars['Float']['output'];
|
|
1946
1983
|
Flourish: ReferenceWithCAPIData<ContentTree.Flourish>;
|
|
1947
|
-
FlourishFallback: FlourishFallback;
|
|
1948
1984
|
FlourishSource: FlourishSourceModel;
|
|
1949
1985
|
FollowButtonVariant: Scalars['FollowButtonVariant']['output'];
|
|
1950
1986
|
FullBleedTopper: TopperModel;
|
|
@@ -1979,6 +2015,7 @@ export type ResolversParentTypes = ResolversObject<{
|
|
|
1979
2015
|
Mutation: {};
|
|
1980
2016
|
OpinionTopper: TopperModel;
|
|
1981
2017
|
PackageDesign: Scalars['PackageDesign']['output'];
|
|
2018
|
+
PageInfo: PageInfo;
|
|
1982
2019
|
PartnerContentTopper: TopperModel;
|
|
1983
2020
|
Person: PersonModel;
|
|
1984
2021
|
Picture: PictureModel;
|
|
@@ -2239,6 +2276,16 @@ export type ContentResolvers<ContextType = QueryContext, ParentType extends Reso
|
|
|
2239
2276
|
type: Resolver<ResolversTypes['ContentType'], ParentType, ContextType>;
|
|
2240
2277
|
url: Resolver<ResolversTypes['String'], ParentType, ContextType, Partial<ContentUrlArgs>>;
|
|
2241
2278
|
}>;
|
|
2279
|
+
export type ContentConnectionResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['ContentConnection'] = ResolversParentTypes['ContentConnection']> = ResolversObject<{
|
|
2280
|
+
edges: Resolver<ReadonlyArray<Maybe<ResolversTypes['ContentEdge']>>, ParentType, ContextType>;
|
|
2281
|
+
pageInfo: Resolver<ResolversTypes['PageInfo'], ParentType, ContextType>;
|
|
2282
|
+
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
2283
|
+
}>;
|
|
2284
|
+
export type ContentEdgeResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['ContentEdge'] = ResolversParentTypes['ContentEdge']> = ResolversObject<{
|
|
2285
|
+
cursor: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
|
2286
|
+
node: Resolver<Maybe<ResolversTypes['Content']>, ParentType, ContextType>;
|
|
2287
|
+
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
2288
|
+
}>;
|
|
2242
2289
|
export type ContentPackageResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['ContentPackage'] = ResolversParentTypes['ContentPackage']> = ResolversObject<{
|
|
2243
2290
|
accessLevel: Resolver<Maybe<ResolversTypes['AccessLevel']>, ParentType, ContextType>;
|
|
2244
2291
|
altStandfirst: Resolver<Maybe<ResolversTypes['AltStandfirst']>, ParentType, ContextType>;
|
|
@@ -2322,16 +2369,10 @@ export type DesignResolvers<ContextType = QueryContext, ParentType extends Resol
|
|
|
2322
2369
|
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
2323
2370
|
}>;
|
|
2324
2371
|
export type FlourishResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['Flourish'] = ResolversParentTypes['Flourish']> = ResolversObject<{
|
|
2325
|
-
fallbackImage: Resolver<Maybe<ResolversTypes['
|
|
2372
|
+
fallbackImage: Resolver<Maybe<ResolversTypes['FlourishSource']>, ParentType, ContextType>;
|
|
2326
2373
|
type: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
|
2327
2374
|
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
2328
2375
|
}>;
|
|
2329
|
-
export type FlourishFallbackResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['FlourishFallback'] = ResolversParentTypes['FlourishFallback']> = ResolversObject<{
|
|
2330
|
-
height: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
|
|
2331
|
-
url: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2332
|
-
width: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
|
|
2333
|
-
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
2334
|
-
}>;
|
|
2335
2376
|
export type FlourishSourceResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['FlourishSource'] = ResolversParentTypes['FlourishSource']> = ResolversObject<{
|
|
2336
2377
|
format: Resolver<ResolversTypes['ImageFormat'], ParentType, ContextType>;
|
|
2337
2378
|
height: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
|
|
@@ -2525,7 +2566,7 @@ export type LayoutImageResolvers<ContextType = QueryContext, ParentType extends
|
|
|
2525
2566
|
}>;
|
|
2526
2567
|
export type LeadFlourishResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['LeadFlourish'] = ResolversParentTypes['LeadFlourish']> = ResolversObject<{
|
|
2527
2568
|
description: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2528
|
-
fallbackImage: Resolver<ResolversTypes['FlourishSource']
|
|
2569
|
+
fallbackImage: Resolver<Maybe<ResolversTypes['FlourishSource']>, ParentType, ContextType>;
|
|
2529
2570
|
id: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2530
2571
|
type: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2531
2572
|
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
@@ -2560,7 +2601,8 @@ export type LiveBlogPackageResolvers<ContextType = QueryContext, ParentType exte
|
|
|
2560
2601
|
firstPublishedDate: Resolver<ResolversTypes['String'], ParentType, ContextType>;
|
|
2561
2602
|
id: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
|
|
2562
2603
|
instantAlertConcept: Resolver<Maybe<ResolversTypes['Concept']>, ParentType, ContextType>;
|
|
2563
|
-
liveBlogPosts: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['Content']>>>, ParentType, ContextType
|
|
2604
|
+
liveBlogPosts: Resolver<Maybe<ReadonlyArray<Maybe<ResolversTypes['Content']>>>, ParentType, ContextType, Partial<LiveBlogPackageLiveBlogPostsArgs>>;
|
|
2605
|
+
liveBlogPostsConnection: Resolver<Maybe<ResolversTypes['ContentConnection']>, ParentType, ContextType, Partial<LiveBlogPackageLiveBlogPostsConnectionArgs>>;
|
|
2564
2606
|
mainImage: Resolver<Maybe<ResolversTypes['Image']>, ParentType, ContextType>;
|
|
2565
2607
|
modifiedTimestamp: Resolver<Maybe<ResolversTypes['Float']>, ParentType, ContextType>;
|
|
2566
2608
|
originatingParty: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
@@ -2646,6 +2688,13 @@ export type OpinionTopperResolvers<ContextType = QueryContext, ParentType extend
|
|
|
2646
2688
|
export interface PackageDesignScalarConfig extends GraphQLScalarTypeConfig<ResolversTypes['PackageDesign'], any> {
|
|
2647
2689
|
name: 'PackageDesign';
|
|
2648
2690
|
}
|
|
2691
|
+
export type PageInfoResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['PageInfo'] = ResolversParentTypes['PageInfo']> = ResolversObject<{
|
|
2692
|
+
endCursor: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2693
|
+
hasNextPage: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
|
|
2694
|
+
hasPreviousPage: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
|
|
2695
|
+
startCursor: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
|
2696
|
+
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
|
2697
|
+
}>;
|
|
2649
2698
|
export type PartnerContentTopperResolvers<ContextType = QueryContext, ParentType extends ResolversParentTypes['PartnerContentTopper'] = ResolversParentTypes['PartnerContentTopper']> = ResolversObject<{
|
|
2650
2699
|
backgroundBox: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
|
2651
2700
|
backgroundColour: Resolver<Maybe<ResolversTypes['TopperBackgroundColour']>, ParentType, ContextType>;
|
|
@@ -2955,6 +3004,8 @@ export type Resolvers<ContextType = QueryContext> = ResolversObject<{
|
|
|
2955
3004
|
Concept: ConceptResolvers<ContextType>;
|
|
2956
3005
|
ConceptInterface: ConceptInterfaceResolvers<ContextType>;
|
|
2957
3006
|
Content: ContentResolvers<ContextType>;
|
|
3007
|
+
ContentConnection: ContentConnectionResolvers<ContextType>;
|
|
3008
|
+
ContentEdge: ContentEdgeResolvers<ContextType>;
|
|
2958
3009
|
ContentPackage: ContentPackageResolvers<ContextType>;
|
|
2959
3010
|
ContentType: GraphQLScalarType;
|
|
2960
3011
|
CustomCodeComponent: CustomCodeComponentResolvers<ContextType>;
|
|
@@ -2962,7 +3013,6 @@ export type Resolvers<ContextType = QueryContext> = ResolversObject<{
|
|
|
2962
3013
|
DeepPortraitTopper: DeepPortraitTopperResolvers<ContextType>;
|
|
2963
3014
|
Design: DesignResolvers<ContextType>;
|
|
2964
3015
|
Flourish: FlourishResolvers<ContextType>;
|
|
2965
|
-
FlourishFallback: FlourishFallbackResolvers<ContextType>;
|
|
2966
3016
|
FlourishSource: FlourishSourceResolvers<ContextType>;
|
|
2967
3017
|
FollowButtonVariant: GraphQLScalarType;
|
|
2968
3018
|
FullBleedTopper: FullBleedTopperResolvers<ContextType>;
|
|
@@ -2995,6 +3045,7 @@ export type Resolvers<ContextType = QueryContext> = ResolversObject<{
|
|
|
2995
3045
|
Mutation: MutationResolvers<ContextType>;
|
|
2996
3046
|
OpinionTopper: OpinionTopperResolvers<ContextType>;
|
|
2997
3047
|
PackageDesign: GraphQLScalarType;
|
|
3048
|
+
PageInfo: PageInfoResolvers<ContextType>;
|
|
2998
3049
|
PartnerContentTopper: PartnerContentTopperResolvers<ContextType>;
|
|
2999
3050
|
Person: PersonResolvers<ContextType>;
|
|
3000
3051
|
Picture: PictureResolvers<ContextType>;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4D;AAkDnD,gGAlDA,6BAAe,OAkDA;AA/CxB,8CAAoD;AACpD,4EAAsE;AACtE,2CAA4B;AAC5B,2BAAiC;AAgCpB,QAAA,oBAAoB,GAAG,IAAA,iBAAY,EAC9C,OAAO,CAAC,OAAO,CAAC,4BAA4B,CAAC,EAC7C,OAAO,CACR,CAAA;AAEY,QAAA,QAAQ,GAAG,IAAA,qBAAc,EACpC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,0BAA0B,CAAC,EAChD;IACE,OAAO,EAAE,CAAC,IAAI,uCAAiB,EAAE,CAAC;CACnC,CACF,CAAA;AAGD,yCAAkD;AAAzC,uHAAA,OAAO,OAAa;AAC7B,+CAAwD;AAA/C,mHAAA,OAAO,OAAW;AAC3B,yCAA0C;AAAjC,+FAAA,OAAO,OAAA;AAEhB,+FAA8E"}
|