@guardian/content-api-models 27.1.0 → 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/package.json
CHANGED
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 = {}));
|