@guardian/content-api-models 28.0.0-PREVIEW.add-episodic-artwork-fields.2025-06-17T0819.478ca91c → 28.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.
- package/package.json +1 -1
- package/v1/blockElement.d.ts +2 -0
- package/v1/blockElement.js +16 -0
- package/v1/elementType.d.ts +2 -1
- package/v1/elementType.js +1 -0
- package/v1/linkElementFields.d.ts +16 -0
- package/v1/linkElementFields.js +85 -0
- package/v1/linkType.d.ts +8 -0
- package/v1/linkType.js +12 -0
- package/v1/podcast.d.ts +0 -3
- package/v1/podcast.js +0 -31
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
{
|
|
3
3
|
"name": "@guardian/content-api-models",
|
|
4
|
-
"version": "28.0.0
|
|
4
|
+
"version": "28.0.0",
|
|
5
5
|
"description": "Typescript library built from the content api thrift definitions",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
package/v1/blockElement.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { EmbedTracking } from './embedTracking';
|
|
|
17
17
|
import { ImageElementFields } from './imageElementFields';
|
|
18
18
|
import { InstagramElementFields } from './instagramElementFields';
|
|
19
19
|
import { InteractiveElementFields } from './interactiveElementFields';
|
|
20
|
+
import { LinkElementFields } from './linkElementFields';
|
|
20
21
|
import { ListElementFields } from './listElementFields';
|
|
21
22
|
import { MembershipElementFields } from './membershipElementFields';
|
|
22
23
|
import { PullquoteElementFields } from './pullquoteElementFields';
|
|
@@ -57,6 +58,7 @@ export interface BlockElement {
|
|
|
57
58
|
recipeTypeData?: RecipeElementFields;
|
|
58
59
|
listTypeData?: ListElementFields;
|
|
59
60
|
timelineTypeData?: TimelineElementFields;
|
|
61
|
+
linkTypeData?: LinkElementFields;
|
|
60
62
|
}
|
|
61
63
|
export declare class BlockElementSerde {
|
|
62
64
|
static read(protocol: TProtocol): BlockElement;
|
package/v1/blockElement.js
CHANGED
|
@@ -19,6 +19,7 @@ var embedTracking_1 = require("./embedTracking");
|
|
|
19
19
|
var imageElementFields_1 = require("./imageElementFields");
|
|
20
20
|
var instagramElementFields_1 = require("./instagramElementFields");
|
|
21
21
|
var interactiveElementFields_1 = require("./interactiveElementFields");
|
|
22
|
+
var linkElementFields_1 = require("./linkElementFields");
|
|
22
23
|
var listElementFields_1 = require("./listElementFields");
|
|
23
24
|
var membershipElementFields_1 = require("./membershipElementFields");
|
|
24
25
|
var pullquoteElementFields_1 = require("./pullquoteElementFields");
|
|
@@ -298,6 +299,15 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
298
299
|
protocol.skip(ftype);
|
|
299
300
|
}
|
|
300
301
|
break;
|
|
302
|
+
case 28:
|
|
303
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
304
|
+
var value1 = linkElementFields_1.LinkElementFieldsSerde.read(protocol);
|
|
305
|
+
result.linkTypeData = value1;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
protocol.skip(ftype);
|
|
309
|
+
}
|
|
310
|
+
break;
|
|
301
311
|
default:
|
|
302
312
|
protocol.skip(ftype);
|
|
303
313
|
}
|
|
@@ -475,6 +485,12 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
475
485
|
timelineElementFields_1.TimelineElementFieldsSerde.write(protocol, value1);
|
|
476
486
|
protocol.writeFieldEnd();
|
|
477
487
|
}
|
|
488
|
+
if (value0.linkTypeData !== null && value0.linkTypeData !== undefined) {
|
|
489
|
+
var value1 = value0.linkTypeData;
|
|
490
|
+
protocol.writeFieldBegin('linkTypeData', thrift_1.Thrift.Type.STRUCT, 28);
|
|
491
|
+
linkElementFields_1.LinkElementFieldsSerde.write(protocol, value1);
|
|
492
|
+
protocol.writeFieldEnd();
|
|
493
|
+
}
|
|
478
494
|
protocol.writeFieldStop();
|
|
479
495
|
protocol.writeStructEnd();
|
|
480
496
|
};
|
package/v1/elementType.d.ts
CHANGED
package/v1/elementType.js
CHANGED
|
@@ -33,4 +33,5 @@ var ElementType;
|
|
|
33
33
|
ElementType[ElementType["RECIPE"] = 22] = "RECIPE";
|
|
34
34
|
ElementType[ElementType["LIST"] = 23] = "LIST";
|
|
35
35
|
ElementType[ElementType["TIMELINE"] = 24] = "TIMELINE";
|
|
36
|
+
ElementType[ElementType["LINK"] = 25] = "LINK";
|
|
36
37
|
})(ElementType || (exports.ElementType = ElementType = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autogenerated by scrooge-generator-extras
|
|
3
|
+
*
|
|
4
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
5
|
+
*/
|
|
6
|
+
import { TProtocol } from 'thrift';
|
|
7
|
+
import { LinkType } from './linkType';
|
|
8
|
+
export interface LinkElementFields {
|
|
9
|
+
label?: string;
|
|
10
|
+
url?: string;
|
|
11
|
+
linkType?: LinkType;
|
|
12
|
+
}
|
|
13
|
+
export declare class LinkElementFieldsSerde {
|
|
14
|
+
static read(protocol: TProtocol): LinkElementFields;
|
|
15
|
+
static write(protocol: TProtocol, value0: LinkElementFields): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Autogenerated by scrooge-generator-extras
|
|
4
|
+
*
|
|
5
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.LinkElementFieldsSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var LinkElementFieldsSerde = /** @class */ (function () {
|
|
11
|
+
function LinkElementFieldsSerde() {
|
|
12
|
+
}
|
|
13
|
+
LinkElementFieldsSerde.read = function (protocol) {
|
|
14
|
+
protocol.readStructBegin();
|
|
15
|
+
var result = {};
|
|
16
|
+
while (true) {
|
|
17
|
+
var ret = protocol.readFieldBegin();
|
|
18
|
+
var ftype = ret.ftype;
|
|
19
|
+
var fid = ret.fid;
|
|
20
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
switch (fid) {
|
|
24
|
+
case 1:
|
|
25
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
26
|
+
var value1 = protocol.readString();
|
|
27
|
+
result.label = value1;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
protocol.skip(ftype);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
case 2:
|
|
34
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
35
|
+
var value1 = protocol.readString();
|
|
36
|
+
result.url = value1;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
protocol.skip(ftype);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
case 3:
|
|
43
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
44
|
+
var value1 = protocol.readI32();
|
|
45
|
+
result.linkType = value1;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
protocol.skip(ftype);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
default:
|
|
52
|
+
protocol.skip(ftype);
|
|
53
|
+
}
|
|
54
|
+
protocol.readFieldEnd();
|
|
55
|
+
}
|
|
56
|
+
protocol.readStructEnd();
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
return result;
|
|
59
|
+
};
|
|
60
|
+
LinkElementFieldsSerde.write = function (protocol, value0) {
|
|
61
|
+
protocol.writeStructBegin('LinkElementFields');
|
|
62
|
+
if (value0.label !== null && value0.label !== undefined) {
|
|
63
|
+
var value1 = value0.label;
|
|
64
|
+
protocol.writeFieldBegin('label', thrift_1.Thrift.Type.STRING, 1);
|
|
65
|
+
protocol.writeString(value1);
|
|
66
|
+
protocol.writeFieldEnd();
|
|
67
|
+
}
|
|
68
|
+
if (value0.url !== null && value0.url !== undefined) {
|
|
69
|
+
var value1 = value0.url;
|
|
70
|
+
protocol.writeFieldBegin('url', thrift_1.Thrift.Type.STRING, 2);
|
|
71
|
+
protocol.writeString(value1);
|
|
72
|
+
protocol.writeFieldEnd();
|
|
73
|
+
}
|
|
74
|
+
if (value0.linkType !== null && value0.linkType !== undefined) {
|
|
75
|
+
var value1 = value0.linkType;
|
|
76
|
+
protocol.writeFieldBegin('linkType', thrift_1.Thrift.Type.I32, 3);
|
|
77
|
+
protocol.writeI32(value1);
|
|
78
|
+
protocol.writeFieldEnd();
|
|
79
|
+
}
|
|
80
|
+
protocol.writeFieldStop();
|
|
81
|
+
protocol.writeStructEnd();
|
|
82
|
+
};
|
|
83
|
+
return LinkElementFieldsSerde;
|
|
84
|
+
}());
|
|
85
|
+
exports.LinkElementFieldsSerde = LinkElementFieldsSerde;
|
package/v1/linkType.d.ts
ADDED
package/v1/linkType.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Autogenerated by scrooge-generator-extras
|
|
4
|
+
*
|
|
5
|
+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.LinkType = void 0;
|
|
9
|
+
var LinkType;
|
|
10
|
+
(function (LinkType) {
|
|
11
|
+
LinkType[LinkType["PRODUCT_BUTTON"] = 0] = "PRODUCT_BUTTON";
|
|
12
|
+
})(LinkType || (exports.LinkType = LinkType = {}));
|
package/v1/podcast.d.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
5
5
|
*/
|
|
6
6
|
import { TProtocol } from 'thrift';
|
|
7
|
-
import { CapiDateTime } from './capiDateTime';
|
|
8
7
|
import { PodcastCategory } from './podcastCategory';
|
|
9
8
|
export interface Podcast {
|
|
10
9
|
linkUrl: string;
|
|
@@ -19,8 +18,6 @@ export interface Podcast {
|
|
|
19
18
|
spotifyUrl?: string;
|
|
20
19
|
acastId?: string;
|
|
21
20
|
pocketCastsUrl?: string;
|
|
22
|
-
episodicArtworkEnabled?: boolean;
|
|
23
|
-
episodicArtworkEnabledFrom?: CapiDateTime;
|
|
24
21
|
}
|
|
25
22
|
export declare class PodcastSerde {
|
|
26
23
|
static read(protocol: TProtocol): Podcast;
|
package/v1/podcast.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.PodcastSerde = void 0;
|
|
9
9
|
var thrift_1 = require("thrift");
|
|
10
|
-
var capiDateTime_1 = require("./capiDateTime");
|
|
11
10
|
var podcastCategory_1 = require("./podcastCategory");
|
|
12
11
|
var PodcastSerde = /** @class */ (function () {
|
|
13
12
|
function PodcastSerde() {
|
|
@@ -141,24 +140,6 @@ var PodcastSerde = /** @class */ (function () {
|
|
|
141
140
|
protocol.skip(ftype);
|
|
142
141
|
}
|
|
143
142
|
break;
|
|
144
|
-
case 13:
|
|
145
|
-
if (ftype === thrift_1.Thrift.Type.BOOL) {
|
|
146
|
-
var value1 = protocol.readBool();
|
|
147
|
-
result.episodicArtworkEnabled = value1;
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
protocol.skip(ftype);
|
|
151
|
-
}
|
|
152
|
-
break;
|
|
153
|
-
case 14:
|
|
154
|
-
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
155
|
-
var value1 = capiDateTime_1.CapiDateTimeSerde.read(protocol);
|
|
156
|
-
result.episodicArtworkEnabledFrom = value1;
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
protocol.skip(ftype);
|
|
160
|
-
}
|
|
161
|
-
break;
|
|
162
143
|
default:
|
|
163
144
|
protocol.skip(ftype);
|
|
164
145
|
}
|
|
@@ -246,18 +227,6 @@ var PodcastSerde = /** @class */ (function () {
|
|
|
246
227
|
protocol.writeString(value1);
|
|
247
228
|
protocol.writeFieldEnd();
|
|
248
229
|
}
|
|
249
|
-
if (value0.episodicArtworkEnabled !== null && value0.episodicArtworkEnabled !== undefined) {
|
|
250
|
-
var value1 = value0.episodicArtworkEnabled;
|
|
251
|
-
protocol.writeFieldBegin('episodicArtworkEnabled', thrift_1.Thrift.Type.BOOL, 13);
|
|
252
|
-
protocol.writeBool(value1);
|
|
253
|
-
protocol.writeFieldEnd();
|
|
254
|
-
}
|
|
255
|
-
if (value0.episodicArtworkEnabledFrom !== null && value0.episodicArtworkEnabledFrom !== undefined) {
|
|
256
|
-
var value1 = value0.episodicArtworkEnabledFrom;
|
|
257
|
-
protocol.writeFieldBegin('episodicArtworkEnabledFrom', thrift_1.Thrift.Type.STRUCT, 14);
|
|
258
|
-
capiDateTime_1.CapiDateTimeSerde.write(protocol, value1);
|
|
259
|
-
protocol.writeFieldEnd();
|
|
260
|
-
}
|
|
261
230
|
protocol.writeFieldStop();
|
|
262
231
|
protocol.writeStructEnd();
|
|
263
232
|
};
|