@guardian/content-api-models 19.0.1 → 20.1.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/crosswordType.d.ts +2 -1
- package/v1/crosswordType.js +1 -0
- package/v1/elementType.d.ts +2 -1
- package/v1/elementType.js +1 -0
- package/v1/listElementFields.d.ts +16 -0
- package/v1/listElementFields.js +85 -0
- package/v1/listItem.d.ts +15 -0
- package/v1/listItem.js +87 -0
- package/v1/listType.d.ts +9 -0
- package/v1/listType.js +13 -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 { ListElementFields } from './listElementFields';
|
|
20
21
|
import { MembershipElementFields } from './membershipElementFields';
|
|
21
22
|
import { PullquoteElementFields } from './pullquoteElementFields';
|
|
22
23
|
import { RecipeElementFields } from './recipeElementFields';
|
|
@@ -53,6 +54,7 @@ export interface BlockElement {
|
|
|
53
54
|
calloutTypeData?: CalloutElementFields;
|
|
54
55
|
cartoonTypeData?: CartoonElementFields;
|
|
55
56
|
recipeTypeData?: RecipeElementFields;
|
|
57
|
+
listTypeData?: ListElementFields;
|
|
56
58
|
}
|
|
57
59
|
export declare class BlockElementSerde {
|
|
58
60
|
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 listElementFields_1 = require("./listElementFields");
|
|
22
23
|
var membershipElementFields_1 = require("./membershipElementFields");
|
|
23
24
|
var pullquoteElementFields_1 = require("./pullquoteElementFields");
|
|
24
25
|
var recipeElementFields_1 = require("./recipeElementFields");
|
|
@@ -278,6 +279,15 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
278
279
|
protocol.skip(ftype);
|
|
279
280
|
}
|
|
280
281
|
break;
|
|
282
|
+
case 26:
|
|
283
|
+
if (ftype === thrift_1.Thrift.Type.STRUCT) {
|
|
284
|
+
var value1 = listElementFields_1.ListElementFieldsSerde.read(protocol);
|
|
285
|
+
result.listTypeData = value1;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
protocol.skip(ftype);
|
|
289
|
+
}
|
|
290
|
+
break;
|
|
281
291
|
default:
|
|
282
292
|
protocol.skip(ftype);
|
|
283
293
|
}
|
|
@@ -443,6 +453,12 @@ var BlockElementSerde = /** @class */ (function () {
|
|
|
443
453
|
recipeElementFields_1.RecipeElementFieldsSerde.write(protocol, value1);
|
|
444
454
|
protocol.writeFieldEnd();
|
|
445
455
|
}
|
|
456
|
+
if (value0.listTypeData !== null && value0.listTypeData !== undefined) {
|
|
457
|
+
var value1 = value0.listTypeData;
|
|
458
|
+
protocol.writeFieldBegin('listTypeData', thrift_1.Thrift.Type.STRUCT, 26);
|
|
459
|
+
listElementFields_1.ListElementFieldsSerde.write(protocol, value1);
|
|
460
|
+
protocol.writeFieldEnd();
|
|
461
|
+
}
|
|
446
462
|
protocol.writeFieldStop();
|
|
447
463
|
protocol.writeStructEnd();
|
|
448
464
|
};
|
package/v1/crosswordType.d.ts
CHANGED
package/v1/crosswordType.js
CHANGED
|
@@ -16,4 +16,5 @@ var CrosswordType;
|
|
|
16
16
|
CrosswordType[CrosswordType["EVERYMAN"] = 5] = "EVERYMAN";
|
|
17
17
|
CrosswordType[CrosswordType["DIAN_QUIPTIC_CROSSWORD"] = 6] = "DIAN_QUIPTIC_CROSSWORD";
|
|
18
18
|
CrosswordType[CrosswordType["WEEKEND"] = 7] = "WEEKEND";
|
|
19
|
+
CrosswordType[CrosswordType["QUICK_CRYPTIC"] = 8] = "QUICK_CRYPTIC";
|
|
19
20
|
})(CrosswordType || (exports.CrosswordType = CrosswordType = {}));
|
package/v1/elementType.d.ts
CHANGED
package/v1/elementType.js
CHANGED
|
@@ -31,4 +31,5 @@ var ElementType;
|
|
|
31
31
|
ElementType[ElementType["CALLOUT"] = 20] = "CALLOUT";
|
|
32
32
|
ElementType[ElementType["CARTOON"] = 21] = "CARTOON";
|
|
33
33
|
ElementType[ElementType["RECIPE"] = 22] = "RECIPE";
|
|
34
|
+
ElementType[ElementType["LIST"] = 23] = "LIST";
|
|
34
35
|
})(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 { ListItem } from './listItem';
|
|
8
|
+
import { ListType } from './listType';
|
|
9
|
+
export interface ListElementFields {
|
|
10
|
+
items: ListItem[];
|
|
11
|
+
type?: ListType;
|
|
12
|
+
}
|
|
13
|
+
export declare class ListElementFieldsSerde {
|
|
14
|
+
static read(protocol: TProtocol): ListElementFields;
|
|
15
|
+
static write(protocol: TProtocol, value0: ListElementFields): 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.ListElementFieldsSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var listItem_1 = require("./listItem");
|
|
11
|
+
var ListElementFieldsSerde = /** @class */ (function () {
|
|
12
|
+
function ListElementFieldsSerde() {
|
|
13
|
+
}
|
|
14
|
+
ListElementFieldsSerde.read = function (protocol) {
|
|
15
|
+
var _a;
|
|
16
|
+
protocol.readStructBegin();
|
|
17
|
+
var result = {};
|
|
18
|
+
while (true) {
|
|
19
|
+
var ret = protocol.readFieldBegin();
|
|
20
|
+
var ftype = ret.ftype;
|
|
21
|
+
var fid = ret.fid;
|
|
22
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
switch (fid) {
|
|
26
|
+
case 1:
|
|
27
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
28
|
+
var listInfo1 = protocol.readListBegin();
|
|
29
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
30
|
+
var value1 = [];
|
|
31
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
32
|
+
for (var i = 0; i < listSize1; i++) {
|
|
33
|
+
var value2 = listItem_1.ListItemSerde.read(protocol);
|
|
34
|
+
value1.push(value2);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
protocol.readListEnd();
|
|
38
|
+
result.items = value1;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
protocol.skip(ftype);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case 2:
|
|
45
|
+
if (ftype === thrift_1.Thrift.Type.I32) {
|
|
46
|
+
var value1 = protocol.readI32();
|
|
47
|
+
result.type = value1;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
protocol.skip(ftype);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
protocol.skip(ftype);
|
|
55
|
+
}
|
|
56
|
+
protocol.readFieldEnd();
|
|
57
|
+
}
|
|
58
|
+
protocol.readStructEnd();
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
ListElementFieldsSerde.write = function (protocol, value0) {
|
|
63
|
+
protocol.writeStructBegin('ListElementFields');
|
|
64
|
+
if (value0.items !== null && value0.items !== undefined) {
|
|
65
|
+
var value1 = value0.items;
|
|
66
|
+
protocol.writeFieldBegin('items', thrift_1.Thrift.Type.LIST, 1);
|
|
67
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
68
|
+
value1.forEach(function (value2) {
|
|
69
|
+
listItem_1.ListItemSerde.write(protocol, value2);
|
|
70
|
+
});
|
|
71
|
+
protocol.writeListEnd();
|
|
72
|
+
protocol.writeFieldEnd();
|
|
73
|
+
}
|
|
74
|
+
if (value0.type !== null && value0.type !== undefined) {
|
|
75
|
+
var value1 = value0.type;
|
|
76
|
+
protocol.writeFieldBegin('type', thrift_1.Thrift.Type.I32, 2);
|
|
77
|
+
protocol.writeI32(value1);
|
|
78
|
+
protocol.writeFieldEnd();
|
|
79
|
+
}
|
|
80
|
+
protocol.writeFieldStop();
|
|
81
|
+
protocol.writeStructEnd();
|
|
82
|
+
};
|
|
83
|
+
return ListElementFieldsSerde;
|
|
84
|
+
}());
|
|
85
|
+
exports.ListElementFieldsSerde = ListElementFieldsSerde;
|
package/v1/listItem.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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 { BlockElement } from './blockElement';
|
|
8
|
+
export interface ListItem {
|
|
9
|
+
elements: BlockElement[];
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class ListItemSerde {
|
|
13
|
+
static read(protocol: TProtocol): ListItem;
|
|
14
|
+
static write(protocol: TProtocol, value0: ListItem): void;
|
|
15
|
+
}
|
package/v1/listItem.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
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.ListItemSerde = void 0;
|
|
9
|
+
var thrift_1 = require("thrift");
|
|
10
|
+
var blockElement_1 = require("./blockElement");
|
|
11
|
+
var ListItemSerde = /** @class */ (function () {
|
|
12
|
+
function ListItemSerde() {
|
|
13
|
+
}
|
|
14
|
+
ListItemSerde.read = function (protocol) {
|
|
15
|
+
var _a;
|
|
16
|
+
protocol.readStructBegin();
|
|
17
|
+
var result = {
|
|
18
|
+
elements: [],
|
|
19
|
+
};
|
|
20
|
+
while (true) {
|
|
21
|
+
var ret = protocol.readFieldBegin();
|
|
22
|
+
var ftype = ret.ftype;
|
|
23
|
+
var fid = ret.fid;
|
|
24
|
+
if (ftype === thrift_1.Thrift.Type.STOP) {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
switch (fid) {
|
|
28
|
+
case 1:
|
|
29
|
+
if (ftype === thrift_1.Thrift.Type.LIST) {
|
|
30
|
+
var listInfo1 = protocol.readListBegin();
|
|
31
|
+
var listSize1 = (_a = listInfo1.size) !== null && _a !== void 0 ? _a : 0;
|
|
32
|
+
var value1 = [];
|
|
33
|
+
if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
|
|
34
|
+
for (var i = 0; i < listSize1; i++) {
|
|
35
|
+
var value2 = blockElement_1.BlockElementSerde.read(protocol);
|
|
36
|
+
value1.push(value2);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
protocol.readListEnd();
|
|
40
|
+
result.elements = value1;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
protocol.skip(ftype);
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
case 2:
|
|
47
|
+
if (ftype === thrift_1.Thrift.Type.STRING) {
|
|
48
|
+
var value1 = protocol.readString();
|
|
49
|
+
result.title = value1;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
protocol.skip(ftype);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
protocol.skip(ftype);
|
|
57
|
+
}
|
|
58
|
+
protocol.readFieldEnd();
|
|
59
|
+
}
|
|
60
|
+
protocol.readStructEnd();
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
ListItemSerde.write = function (protocol, value0) {
|
|
65
|
+
protocol.writeStructBegin('ListItem');
|
|
66
|
+
if (value0.elements !== null && value0.elements !== undefined) {
|
|
67
|
+
var value1 = value0.elements;
|
|
68
|
+
protocol.writeFieldBegin('elements', thrift_1.Thrift.Type.LIST, 1);
|
|
69
|
+
protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
|
|
70
|
+
value1.forEach(function (value2) {
|
|
71
|
+
blockElement_1.BlockElementSerde.write(protocol, value2);
|
|
72
|
+
});
|
|
73
|
+
protocol.writeListEnd();
|
|
74
|
+
protocol.writeFieldEnd();
|
|
75
|
+
}
|
|
76
|
+
if (value0.title !== null && value0.title !== undefined) {
|
|
77
|
+
var value1 = value0.title;
|
|
78
|
+
protocol.writeFieldBegin('title', thrift_1.Thrift.Type.STRING, 2);
|
|
79
|
+
protocol.writeString(value1);
|
|
80
|
+
protocol.writeFieldEnd();
|
|
81
|
+
}
|
|
82
|
+
protocol.writeFieldStop();
|
|
83
|
+
protocol.writeStructEnd();
|
|
84
|
+
};
|
|
85
|
+
return ListItemSerde;
|
|
86
|
+
}());
|
|
87
|
+
exports.ListItemSerde = ListItemSerde;
|
package/v1/listType.d.ts
ADDED
package/v1/listType.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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.ListType = void 0;
|
|
9
|
+
var ListType;
|
|
10
|
+
(function (ListType) {
|
|
11
|
+
ListType[ListType["KEY_TAKEAWAYS"] = 1] = "KEY_TAKEAWAYS";
|
|
12
|
+
ListType[ListType["Q_AND_A_EXPLAINER"] = 2] = "Q_AND_A_EXPLAINER";
|
|
13
|
+
})(ListType || (exports.ListType = ListType = {}));
|