@guardian/content-api-models 24.0.0 → 25.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 CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  {
3
3
  "name": "@guardian/content-api-models",
4
- "version": "24.0.0",
4
+ "version": "25.0.0",
5
5
  "description": "Typescript library built from the content api thrift definitions",
6
6
  "repository": {
7
7
  "type": "git",
package/v1/listItem.d.ts CHANGED
@@ -5,9 +5,16 @@
5
5
  */
6
6
  import { TProtocol } from 'thrift';
7
7
  import { BlockElement } from './blockElement';
8
+ import { Tag } from './tag';
8
9
  export interface ListItem {
9
10
  elements: BlockElement[];
10
11
  title?: string;
12
+ contributors?: Tag[];
13
+ bio?: string;
14
+ contributorImageOverrideUrl?: string;
15
+ endNote?: string;
16
+ byline?: string;
17
+ bylineHtml?: string;
11
18
  }
12
19
  export declare class ListItemSerde {
13
20
  static read(protocol: TProtocol): ListItem;
package/v1/listItem.js CHANGED
@@ -8,11 +8,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ListItemSerde = void 0;
9
9
  var thrift_1 = require("thrift");
10
10
  var blockElement_1 = require("./blockElement");
11
+ var tag_1 = require("./tag");
11
12
  var ListItemSerde = /** @class */ (function () {
12
13
  function ListItemSerde() {
13
14
  }
14
15
  ListItemSerde.read = function (protocol) {
15
- var _a;
16
+ var _a, _b;
16
17
  protocol.readStructBegin();
17
18
  var result = {
18
19
  elements: [],
@@ -52,6 +53,69 @@ var ListItemSerde = /** @class */ (function () {
52
53
  protocol.skip(ftype);
53
54
  }
54
55
  break;
56
+ case 3:
57
+ if (ftype === thrift_1.Thrift.Type.LIST) {
58
+ var listInfo1 = protocol.readListBegin();
59
+ var listSize1 = (_b = listInfo1.size) !== null && _b !== void 0 ? _b : 0;
60
+ var value1 = [];
61
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
62
+ for (var i = 0; i < listSize1; i++) {
63
+ var value2 = tag_1.TagSerde.read(protocol);
64
+ value1.push(value2);
65
+ }
66
+ }
67
+ protocol.readListEnd();
68
+ result.contributors = value1;
69
+ }
70
+ else {
71
+ protocol.skip(ftype);
72
+ }
73
+ break;
74
+ case 4:
75
+ if (ftype === thrift_1.Thrift.Type.STRING) {
76
+ var value1 = protocol.readString();
77
+ result.bio = value1;
78
+ }
79
+ else {
80
+ protocol.skip(ftype);
81
+ }
82
+ break;
83
+ case 5:
84
+ if (ftype === thrift_1.Thrift.Type.STRING) {
85
+ var value1 = protocol.readString();
86
+ result.contributorImageOverrideUrl = value1;
87
+ }
88
+ else {
89
+ protocol.skip(ftype);
90
+ }
91
+ break;
92
+ case 6:
93
+ if (ftype === thrift_1.Thrift.Type.STRING) {
94
+ var value1 = protocol.readString();
95
+ result.endNote = value1;
96
+ }
97
+ else {
98
+ protocol.skip(ftype);
99
+ }
100
+ break;
101
+ case 7:
102
+ if (ftype === thrift_1.Thrift.Type.STRING) {
103
+ var value1 = protocol.readString();
104
+ result.byline = value1;
105
+ }
106
+ else {
107
+ protocol.skip(ftype);
108
+ }
109
+ break;
110
+ case 8:
111
+ if (ftype === thrift_1.Thrift.Type.STRING) {
112
+ var value1 = protocol.readString();
113
+ result.bylineHtml = value1;
114
+ }
115
+ else {
116
+ protocol.skip(ftype);
117
+ }
118
+ break;
55
119
  default:
56
120
  protocol.skip(ftype);
57
121
  }
@@ -79,6 +143,46 @@ var ListItemSerde = /** @class */ (function () {
79
143
  protocol.writeString(value1);
80
144
  protocol.writeFieldEnd();
81
145
  }
146
+ if (value0.contributors !== null && value0.contributors !== undefined) {
147
+ var value1 = value0.contributors;
148
+ protocol.writeFieldBegin('contributors', thrift_1.Thrift.Type.LIST, 3);
149
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
150
+ value1.forEach(function (value2) {
151
+ tag_1.TagSerde.write(protocol, value2);
152
+ });
153
+ protocol.writeListEnd();
154
+ protocol.writeFieldEnd();
155
+ }
156
+ if (value0.bio !== null && value0.bio !== undefined) {
157
+ var value1 = value0.bio;
158
+ protocol.writeFieldBegin('bio', thrift_1.Thrift.Type.STRING, 4);
159
+ protocol.writeString(value1);
160
+ protocol.writeFieldEnd();
161
+ }
162
+ if (value0.contributorImageOverrideUrl !== null && value0.contributorImageOverrideUrl !== undefined) {
163
+ var value1 = value0.contributorImageOverrideUrl;
164
+ protocol.writeFieldBegin('contributorImageOverrideUrl', thrift_1.Thrift.Type.STRING, 5);
165
+ protocol.writeString(value1);
166
+ protocol.writeFieldEnd();
167
+ }
168
+ if (value0.endNote !== null && value0.endNote !== undefined) {
169
+ var value1 = value0.endNote;
170
+ protocol.writeFieldBegin('endNote', thrift_1.Thrift.Type.STRING, 6);
171
+ protocol.writeString(value1);
172
+ protocol.writeFieldEnd();
173
+ }
174
+ if (value0.byline !== null && value0.byline !== undefined) {
175
+ var value1 = value0.byline;
176
+ protocol.writeFieldBegin('byline', thrift_1.Thrift.Type.STRING, 7);
177
+ protocol.writeString(value1);
178
+ protocol.writeFieldEnd();
179
+ }
180
+ if (value0.bylineHtml !== null && value0.bylineHtml !== undefined) {
181
+ var value1 = value0.bylineHtml;
182
+ protocol.writeFieldBegin('bylineHtml', thrift_1.Thrift.Type.STRING, 8);
183
+ protocol.writeString(value1);
184
+ protocol.writeFieldEnd();
185
+ }
82
186
  protocol.writeFieldStop();
83
187
  protocol.writeStructEnd();
84
188
  };
package/v1/listType.d.ts CHANGED
@@ -5,5 +5,7 @@
5
5
  */
6
6
  export declare enum ListType {
7
7
  KEY_TAKEAWAYS = 1,
8
- Q_AND_A_EXPLAINER = 2
8
+ Q_AND_A_EXPLAINER = 2,
9
+ MINI_PROFILES = 3,
10
+ MULTI_BYLINE = 4
9
11
  }
package/v1/listType.js CHANGED
@@ -10,4 +10,6 @@ var ListType;
10
10
  (function (ListType) {
11
11
  ListType[ListType["KEY_TAKEAWAYS"] = 1] = "KEY_TAKEAWAYS";
12
12
  ListType[ListType["Q_AND_A_EXPLAINER"] = 2] = "Q_AND_A_EXPLAINER";
13
+ ListType[ListType["MINI_PROFILES"] = 3] = "MINI_PROFILES";
14
+ ListType[ListType["MULTI_BYLINE"] = 4] = "MULTI_BYLINE";
13
15
  })(ListType || (exports.ListType = ListType = {}));