@financial-times/cp-content-pipeline-schema 2.5.3 → 2.5.4
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 +7 -0
- package/README.md +187 -41
- package/lib/datasources/base.d.ts +1 -0
- package/lib/datasources/capi.js +1 -0
- package/lib/datasources/capi.js.map +1 -1
- package/lib/datasources/instrumented.d.ts +1 -0
- package/lib/datasources/instrumented.js +1 -9
- package/lib/datasources/instrumented.js.map +1 -1
- package/lib/datasources/origami-image.js +1 -0
- package/lib/datasources/origami-image.js.map +1 -1
- package/lib/datasources/twitter.js +1 -0
- package/lib/datasources/twitter.js.map +1 -1
- package/lib/datasources/url-management.d.ts +1 -0
- package/lib/datasources/url-management.js +2 -0
- package/lib/datasources/url-management.js.map +1 -1
- package/lib/generated/index.d.ts +546 -2
- package/package.json +1 -1
- package/src/datasources/base.ts +1 -0
- package/src/datasources/capi.ts +1 -0
- package/src/datasources/instrumented.ts +1 -11
- package/src/datasources/origami-image.ts +3 -0
- package/src/datasources/twitter.ts +2 -0
- package/src/datasources/url-management.ts +2 -0
- package/src/generated/index.ts +546 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/typedefs/clip.graphql +28 -0
- package/typedefs/concept.graphql +21 -2
- package/typedefs/content.graphql +441 -36
- package/typedefs/core.graphql +6 -0
- package/typedefs/image.graphql +210 -15
- package/typedefs/picture.graphql +54 -1
- package/typedefs/references/clipSet.graphql +34 -1
- package/typedefs/references/flourish.graphql +8 -0
- package/typedefs/references/imageSet.graphql +6 -0
- package/typedefs/references/layoutImage.graphql +3 -0
- package/typedefs/references/rawImage.graphql +3 -0
- package/typedefs/references/recommended.graphql +3 -0
- package/typedefs/references/reference.graphql +1 -0
- package/typedefs/references/scrollyImage.graphql +3 -0
- package/typedefs/references/tweet.graphql +3 -0
- package/typedefs/references/video.graphql +5 -0
- package/typedefs/richText.graphql +7 -4
- package/typedefs/teaser.graphql +42 -1
- package/typedefs/topper.graphql +219 -7
package/package.json
CHANGED
package/src/datasources/base.ts
CHANGED
package/src/datasources/capi.ts
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
AugmentedRequest,
|
|
7
7
|
} from '@apollo/datasource-rest'
|
|
8
8
|
import { PrefixingKeyValueCache } from '@apollo/utils.keyvaluecache'
|
|
9
|
-
import { SerializedRequest } from '@dotcom-reliability-kit/serialize-request'
|
|
10
9
|
import { UpstreamServiceError } from '@dotcom-reliability-kit/errors'
|
|
11
10
|
import { QueryContext } from '..'
|
|
12
11
|
import { isContextableCache } from '../types/cache'
|
|
@@ -19,6 +18,7 @@ export class InstrumentedRESTDataSource
|
|
|
19
18
|
startTime?: bigint
|
|
20
19
|
backendSystemCodes: string[] = []
|
|
21
20
|
context: QueryContext
|
|
21
|
+
calls: string[] = []
|
|
22
22
|
|
|
23
23
|
constructor({ cache, context }: BaseDataSourceOptions) {
|
|
24
24
|
const wrappedCache = new PrefixingKeyValueCache(
|
|
@@ -70,16 +70,6 @@ export class InstrumentedRESTDataSource
|
|
|
70
70
|
1
|
|
71
71
|
)
|
|
72
72
|
|
|
73
|
-
this.context.logger.info({
|
|
74
|
-
event: 'REQUEST_DATASOURCE',
|
|
75
|
-
datasource: this.constructor.name,
|
|
76
|
-
request: {
|
|
77
|
-
id: this.context.requestId,
|
|
78
|
-
url: new URL(path, this.baseURL).href,
|
|
79
|
-
method: incomingRequest?.method,
|
|
80
|
-
} as SerializedRequest,
|
|
81
|
-
})
|
|
82
|
-
|
|
83
73
|
try {
|
|
84
74
|
const result = await super.fetch<TResult>(path, incomingRequest)
|
|
85
75
|
const duration = (process.hrtime.bigint() - startTime) / BigInt(1e6)
|
|
@@ -36,6 +36,9 @@ export class OrigamiImageDataSource extends InstrumentedRESTDataSource {
|
|
|
36
36
|
const imageMetadata = await this.get(
|
|
37
37
|
`images/metadata/${encodeURIComponent(url)}?source=next`
|
|
38
38
|
)
|
|
39
|
+
|
|
40
|
+
this.calls.push(url)
|
|
41
|
+
|
|
39
42
|
if (this.timeout) {
|
|
40
43
|
clearTimeout(this.timeout)
|
|
41
44
|
this.timeout = undefined
|
|
@@ -24,6 +24,8 @@ export class TwitterDataSource extends InstrumentedRESTDataSource {
|
|
|
24
24
|
try {
|
|
25
25
|
const tweet = await this.get(`oembed?url=${tweetUrl}&omit_script=true`)
|
|
26
26
|
|
|
27
|
+
this.calls.push(tweetUrl)
|
|
28
|
+
|
|
27
29
|
if (this.timeout) {
|
|
28
30
|
clearTimeout(this.timeout)
|
|
29
31
|
this.timeout = undefined
|
|
@@ -15,6 +15,7 @@ export class URLManagementDataSource implements BaseDataSource {
|
|
|
15
15
|
memoizedResults = new Map<string, Promise<string>>()
|
|
16
16
|
cache: KeyValueCache
|
|
17
17
|
context: QueryContext
|
|
18
|
+
calls: string[] = []
|
|
18
19
|
|
|
19
20
|
static clientInitialised = false
|
|
20
21
|
|
|
@@ -61,6 +62,7 @@ export class URLManagementDataSource implements BaseDataSource {
|
|
|
61
62
|
promise = getVanity()
|
|
62
63
|
this.memoizedResults.set(fromURL, promise)
|
|
63
64
|
|
|
65
|
+
this.calls.push(fromURL)
|
|
64
66
|
return promise
|
|
65
67
|
}
|
|
66
68
|
}
|