@guardian/content-api-models 17.5.2 → 17.6.0-beta.1

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": "17.5.2",
4
+ "version": "17.6.0-beta.1",
5
5
  "description": "Typescript library built from the content api thrift definitions",
6
6
  "repository": {
7
7
  "type": "git",
package/v1/content.d.ts CHANGED
@@ -8,6 +8,7 @@ import { AliasPath } from './aliasPath';
8
8
  import { Atoms } from './atoms';
9
9
  import { Blocks } from './blocks';
10
10
  import { CapiDateTime } from './capiDateTime';
11
+ import { ContentChannel } from './contentChannel';
11
12
  import { ContentFields } from './contentFields';
12
13
  import { ContentStats } from './contentStats';
13
14
  import { ContentType } from './contentType';
@@ -44,6 +45,7 @@ export interface Content {
44
45
  pillarId?: string;
45
46
  pillarName?: string;
46
47
  aliasPaths?: AliasPath[];
48
+ channels?: ContentChannel[];
47
49
  }
48
50
  export declare class ContentSerde {
49
51
  static read(protocol: TProtocol): Content;
package/v1/content.js CHANGED
@@ -11,6 +11,7 @@ var aliasPath_1 = require("./aliasPath");
11
11
  var atoms_1 = require("./atoms");
12
12
  var blocks_1 = require("./blocks");
13
13
  var capiDateTime_1 = require("./capiDateTime");
14
+ var contentChannel_1 = require("./contentChannel");
14
15
  var contentFields_1 = require("./contentFields");
15
16
  var contentStats_1 = require("./contentStats");
16
17
  var contentType_1 = require("./contentType");
@@ -25,7 +26,7 @@ var ContentSerde = /** @class */ (function () {
25
26
  function ContentSerde() {
26
27
  }
27
28
  ContentSerde.read = function (protocol) {
28
- var _a, _b, _c, _d;
29
+ var _a, _b, _c, _d, _e;
29
30
  protocol.readStructBegin();
30
31
  var result = {
31
32
  type: contentType_1.ContentType.ARTICLE,
@@ -302,6 +303,24 @@ var ContentSerde = /** @class */ (function () {
302
303
  protocol.skip(ftype);
303
304
  }
304
305
  break;
306
+ case 28:
307
+ if (ftype === thrift_1.Thrift.Type.LIST) {
308
+ var listInfo1 = protocol.readListBegin();
309
+ var listSize1 = (_e = listInfo1.size) !== null && _e !== void 0 ? _e : 0;
310
+ var value1 = [];
311
+ if (listInfo1.etype === thrift_1.Thrift.Type.STRUCT) {
312
+ for (var i = 0; i < listSize1; i++) {
313
+ var value2 = contentChannel_1.ContentChannelSerde.read(protocol);
314
+ value1.push(value2);
315
+ }
316
+ }
317
+ protocol.readListEnd();
318
+ result.channels = value1;
319
+ }
320
+ else {
321
+ protocol.skip(ftype);
322
+ }
323
+ break;
305
324
  default:
306
325
  protocol.skip(ftype);
307
326
  }
@@ -479,6 +498,16 @@ var ContentSerde = /** @class */ (function () {
479
498
  protocol.writeListEnd();
480
499
  protocol.writeFieldEnd();
481
500
  }
501
+ if (value0.channels !== null && value0.channels !== undefined) {
502
+ var value1 = value0.channels;
503
+ protocol.writeFieldBegin('channels', thrift_1.Thrift.Type.LIST, 28);
504
+ protocol.writeListBegin(thrift_1.Thrift.Type.STRUCT, value1.length);
505
+ value1.forEach(function (value2) {
506
+ contentChannel_1.ContentChannelSerde.write(protocol, value2);
507
+ });
508
+ protocol.writeListEnd();
509
+ protocol.writeFieldEnd();
510
+ }
482
511
  protocol.writeFieldStop();
483
512
  protocol.writeStructEnd();
484
513
  };