@guardian/content-api-models 17.4.0-beta.0 → 17.4.2

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.
@@ -8,7 +8,7 @@ import { Content } from '../../../v1/content';
8
8
  import { DeletedContent } from './deletedContent';
9
9
  import { RetrievableContent } from './retrievableContent';
10
10
  import { Atom } from '@guardian/content-atom-model/atom';
11
- export declare type EventPayload = {
11
+ export type EventPayload = {
12
12
  kind: "content";
13
13
  content: Content;
14
14
  } | {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  {
3
3
  "name": "@guardian/content-api-models",
4
- "version": "17.4.0-beta.0",
4
+ "version": "v17.4.2",
5
5
  "description": "Typescript library built from the content api thrift definitions",
6
6
  "repository": {
7
7
  "type": "git",
@@ -6,6 +6,7 @@
6
6
  import { TProtocol } from 'thrift';
7
7
  import { Asset } from './asset';
8
8
  import { AudioElementFields } from './audioElementFields';
9
+ import { CalloutElementFields } from './calloutElementFields';
9
10
  import { CodeElementFields } from './codeElementFields';
10
11
  import { CommentElementFields } from './commentElementFields';
11
12
  import { ContentAtomElementFields } from './contentAtomElementFields';
@@ -47,6 +48,7 @@ export interface BlockElement {
47
48
  contentAtomTypeData?: ContentAtomElementFields;
48
49
  tracking?: EmbedTracking;
49
50
  codeTypeData?: CodeElementFields;
51
+ calloutTypeData?: CalloutElementFields;
50
52
  }
51
53
  export declare class BlockElementSerde {
52
54
  static read(protocol: TProtocol): BlockElement;
@@ -9,6 +9,7 @@ exports.BlockElementSerde = void 0;
9
9
  var thrift_1 = require("thrift");
10
10
  var asset_1 = require("./asset");
11
11
  var audioElementFields_1 = require("./audioElementFields");
12
+ var calloutElementFields_1 = require("./calloutElementFields");
12
13
  var codeElementFields_1 = require("./codeElementFields");
13
14
  var commentElementFields_1 = require("./commentElementFields");
14
15
  var contentAtomElementFields_1 = require("./contentAtomElementFields");
@@ -248,6 +249,15 @@ var BlockElementSerde = /** @class */ (function () {
248
249
  protocol.skip(ftype);
249
250
  }
250
251
  break;
252
+ case 23:
253
+ if (ftype === thrift_1.Thrift.Type.STRUCT) {
254
+ var value1 = calloutElementFields_1.CalloutElementFieldsSerde.read(protocol);
255
+ result.calloutTypeData = value1;
256
+ }
257
+ else {
258
+ protocol.skip(ftype);
259
+ }
260
+ break;
251
261
  default:
252
262
  protocol.skip(ftype);
253
263
  }
@@ -395,6 +405,12 @@ var BlockElementSerde = /** @class */ (function () {
395
405
  codeElementFields_1.CodeElementFieldsSerde.write(protocol, value1);
396
406
  protocol.writeFieldEnd();
397
407
  }
408
+ if (value0.calloutTypeData !== null && value0.calloutTypeData !== undefined) {
409
+ var value1 = value0.calloutTypeData;
410
+ protocol.writeFieldBegin('calloutTypeData', thrift_1.Thrift.Type.STRUCT, 23);
411
+ calloutElementFields_1.CalloutElementFieldsSerde.write(protocol, value1);
412
+ protocol.writeFieldEnd();
413
+ }
398
414
  protocol.writeFieldStop();
399
415
  protocol.writeStructEnd();
400
416
  };
@@ -0,0 +1,14 @@
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
+ export interface CalloutElementFields {
8
+ campaignId?: string;
9
+ isNonCollapsible?: boolean;
10
+ }
11
+ export declare class CalloutElementFieldsSerde {
12
+ static read(protocol: TProtocol): CalloutElementFields;
13
+ static write(protocol: TProtocol, value0: CalloutElementFields): void;
14
+ }
@@ -5,13 +5,12 @@
5
5
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ContentChannelSerde = void 0;
8
+ exports.CalloutElementFieldsSerde = void 0;
9
9
  var thrift_1 = require("thrift");
10
- var channelFields_1 = require("./channelFields");
11
- var ContentChannelSerde = /** @class */ (function () {
12
- function ContentChannelSerde() {
10
+ var CalloutElementFieldsSerde = /** @class */ (function () {
11
+ function CalloutElementFieldsSerde() {
13
12
  }
14
- ContentChannelSerde.read = function (protocol) {
13
+ CalloutElementFieldsSerde.read = function (protocol) {
15
14
  protocol.readStructBegin();
16
15
  var result = {};
17
16
  while (true) {
@@ -25,16 +24,16 @@ var ContentChannelSerde = /** @class */ (function () {
25
24
  case 1:
26
25
  if (ftype === thrift_1.Thrift.Type.STRING) {
27
26
  var value1 = protocol.readString();
28
- result.channelId = value1;
27
+ result.campaignId = value1;
29
28
  }
30
29
  else {
31
30
  protocol.skip(ftype);
32
31
  }
33
32
  break;
34
33
  case 2:
35
- if (ftype === thrift_1.Thrift.Type.STRUCT) {
36
- var value1 = channelFields_1.ChannelFieldsSerde.read(protocol);
37
- result.fields = value1;
34
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
35
+ var value1 = protocol.readBool();
36
+ result.isNonCollapsible = value1;
38
37
  }
39
38
  else {
40
39
  protocol.skip(ftype);
@@ -49,23 +48,23 @@ var ContentChannelSerde = /** @class */ (function () {
49
48
  // @ts-ignore
50
49
  return result;
51
50
  };
52
- ContentChannelSerde.write = function (protocol, value0) {
53
- protocol.writeStructBegin('ContentChannel');
54
- if (value0.channelId !== null && value0.channelId !== undefined) {
55
- var value1 = value0.channelId;
56
- protocol.writeFieldBegin('channelId', thrift_1.Thrift.Type.STRING, 1);
51
+ CalloutElementFieldsSerde.write = function (protocol, value0) {
52
+ protocol.writeStructBegin('CalloutElementFields');
53
+ if (value0.campaignId !== null && value0.campaignId !== undefined) {
54
+ var value1 = value0.campaignId;
55
+ protocol.writeFieldBegin('campaignId', thrift_1.Thrift.Type.STRING, 1);
57
56
  protocol.writeString(value1);
58
57
  protocol.writeFieldEnd();
59
58
  }
60
- if (value0.fields !== null && value0.fields !== undefined) {
61
- var value1 = value0.fields;
62
- protocol.writeFieldBegin('fields', thrift_1.Thrift.Type.STRUCT, 2);
63
- channelFields_1.ChannelFieldsSerde.write(protocol, value1);
59
+ if (value0.isNonCollapsible !== null && value0.isNonCollapsible !== undefined) {
60
+ var value1 = value0.isNonCollapsible;
61
+ protocol.writeFieldBegin('isNonCollapsible', thrift_1.Thrift.Type.BOOL, 2);
62
+ protocol.writeBool(value1);
64
63
  protocol.writeFieldEnd();
65
64
  }
66
65
  protocol.writeFieldStop();
67
66
  protocol.writeStructEnd();
68
67
  };
69
- return ContentChannelSerde;
68
+ return CalloutElementFieldsSerde;
70
69
  }());
71
- exports.ContentChannelSerde = ContentChannelSerde;
70
+ exports.CalloutElementFieldsSerde = CalloutElementFieldsSerde;
package/v1/content.d.ts CHANGED
@@ -8,7 +8,6 @@ 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';
12
11
  import { ContentFields } from './contentFields';
13
12
  import { ContentStats } from './contentStats';
14
13
  import { ContentType } from './contentType';
@@ -45,7 +44,6 @@ export interface Content {
45
44
  pillarId?: string;
46
45
  pillarName?: string;
47
46
  aliasPaths?: AliasPath[];
48
- channels?: ContentChannel[];
49
47
  }
50
48
  export declare class ContentSerde {
51
49
  static read(protocol: TProtocol): Content;
package/v1/content.js CHANGED
@@ -11,7 +11,6 @@ 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");
15
14
  var contentFields_1 = require("./contentFields");
16
15
  var contentStats_1 = require("./contentStats");
17
16
  var contentType_1 = require("./contentType");
@@ -26,7 +25,7 @@ var ContentSerde = /** @class */ (function () {
26
25
  function ContentSerde() {
27
26
  }
28
27
  ContentSerde.read = function (protocol) {
29
- var _a, _b, _c, _d, _e;
28
+ var _a, _b, _c, _d;
30
29
  protocol.readStructBegin();
31
30
  var result = {
32
31
  type: contentType_1.ContentType.ARTICLE,
@@ -303,24 +302,6 @@ var ContentSerde = /** @class */ (function () {
303
302
  protocol.skip(ftype);
304
303
  }
305
304
  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;
324
305
  default:
325
306
  protocol.skip(ftype);
326
307
  }
@@ -498,16 +479,6 @@ var ContentSerde = /** @class */ (function () {
498
479
  protocol.writeListEnd();
499
480
  protocol.writeFieldEnd();
500
481
  }
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
- }
511
482
  protocol.writeFieldStop();
512
483
  protocol.writeStructEnd();
513
484
  };
@@ -59,6 +59,7 @@ export interface ContentFields {
59
59
  internalCommissionedWordcount?: number;
60
60
  showAffiliateLinks?: boolean;
61
61
  bylineHtml?: string;
62
+ showTableOfContents?: boolean;
62
63
  }
63
64
  export declare class ContentFieldsSerde {
64
65
  static read(protocol: TProtocol): ContentFields;
@@ -481,6 +481,15 @@ var ContentFieldsSerde = /** @class */ (function () {
481
481
  protocol.skip(ftype);
482
482
  }
483
483
  break;
484
+ case 52:
485
+ if (ftype === thrift_1.Thrift.Type.BOOL) {
486
+ var value1 = protocol.readBool();
487
+ result.showTableOfContents = value1;
488
+ }
489
+ else {
490
+ protocol.skip(ftype);
491
+ }
492
+ break;
484
493
  default:
485
494
  protocol.skip(ftype);
486
495
  }
@@ -798,6 +807,12 @@ var ContentFieldsSerde = /** @class */ (function () {
798
807
  protocol.writeString(value1);
799
808
  protocol.writeFieldEnd();
800
809
  }
810
+ if (value0.showTableOfContents !== null && value0.showTableOfContents !== undefined) {
811
+ var value1 = value0.showTableOfContents;
812
+ protocol.writeFieldBegin('showTableOfContents', thrift_1.Thrift.Type.BOOL, 52);
813
+ protocol.writeBool(value1);
814
+ protocol.writeFieldEnd();
815
+ }
801
816
  protocol.writeFieldStop();
802
817
  protocol.writeStructEnd();
803
818
  };
@@ -19,6 +19,7 @@ export interface ContentStats {
19
19
  comments: number;
20
20
  instagram: number;
21
21
  vines: number;
22
+ callouts: number;
22
23
  }
23
24
  export declare class ContentStatsSerde {
24
25
  static read(protocol: TProtocol): ContentStats;
@@ -147,6 +147,15 @@ var ContentStatsSerde = /** @class */ (function () {
147
147
  protocol.skip(ftype);
148
148
  }
149
149
  break;
150
+ case 15:
151
+ if (ftype === thrift_1.Thrift.Type.I32) {
152
+ var value1 = protocol.readI32();
153
+ result.callouts = value1;
154
+ }
155
+ else {
156
+ protocol.skip(ftype);
157
+ }
158
+ break;
150
159
  default:
151
160
  protocol.skip(ftype);
152
161
  }
@@ -242,6 +251,12 @@ var ContentStatsSerde = /** @class */ (function () {
242
251
  protocol.writeI32(value1);
243
252
  protocol.writeFieldEnd();
244
253
  }
254
+ if (value0.callouts !== null && value0.callouts !== undefined) {
255
+ var value1 = value0.callouts;
256
+ protocol.writeFieldBegin('callouts', thrift_1.Thrift.Type.I32, 15);
257
+ protocol.writeI32(value1);
258
+ protocol.writeFieldEnd();
259
+ }
245
260
  protocol.writeFieldStop();
246
261
  protocol.writeStructEnd();
247
262
  };
@@ -23,5 +23,6 @@ export declare enum ElementType {
23
23
  MEMBERSHIP = 16,
24
24
  INSTAGRAM = 17,
25
25
  CONTENTATOM = 18,
26
- VINE = 19
26
+ VINE = 19,
27
+ CALLOUT = 20
27
28
  }
package/v1/elementType.js CHANGED
@@ -28,4 +28,5 @@ var ElementType;
28
28
  ElementType[ElementType["INSTAGRAM"] = 17] = "INSTAGRAM";
29
29
  ElementType[ElementType["CONTENTATOM"] = 18] = "CONTENTATOM";
30
30
  ElementType[ElementType["VINE"] = 19] = "VINE";
31
+ ElementType[ElementType["CALLOUT"] = 20] = "CALLOUT";
31
32
  })(ElementType = exports.ElementType || (exports.ElementType = {}));
@@ -1,15 +0,0 @@
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 { CapiDateTime } from './capiDateTime';
8
- export interface ChannelFields {
9
- isAvailable: boolean;
10
- publicationDate?: CapiDateTime;
11
- }
12
- export declare class ChannelFieldsSerde {
13
- static read(protocol: TProtocol): ChannelFields;
14
- static write(protocol: TProtocol, value0: ChannelFields): void;
15
- }
@@ -1,71 +0,0 @@
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.ChannelFieldsSerde = void 0;
9
- var thrift_1 = require("thrift");
10
- var capiDateTime_1 = require("./capiDateTime");
11
- var ChannelFieldsSerde = /** @class */ (function () {
12
- function ChannelFieldsSerde() {
13
- }
14
- ChannelFieldsSerde.read = function (protocol) {
15
- protocol.readStructBegin();
16
- var result = {};
17
- while (true) {
18
- var ret = protocol.readFieldBegin();
19
- var ftype = ret.ftype;
20
- var fid = ret.fid;
21
- if (ftype === thrift_1.Thrift.Type.STOP) {
22
- break;
23
- }
24
- switch (fid) {
25
- case 1:
26
- if (ftype === thrift_1.Thrift.Type.BOOL) {
27
- var value1 = protocol.readBool();
28
- result.isAvailable = value1;
29
- }
30
- else {
31
- protocol.skip(ftype);
32
- }
33
- break;
34
- case 2:
35
- if (ftype === thrift_1.Thrift.Type.STRUCT) {
36
- var value1 = capiDateTime_1.CapiDateTimeSerde.read(protocol);
37
- result.publicationDate = value1;
38
- }
39
- else {
40
- protocol.skip(ftype);
41
- }
42
- break;
43
- default:
44
- protocol.skip(ftype);
45
- }
46
- protocol.readFieldEnd();
47
- }
48
- protocol.readStructEnd();
49
- // @ts-ignore
50
- return result;
51
- };
52
- ChannelFieldsSerde.write = function (protocol, value0) {
53
- protocol.writeStructBegin('ChannelFields');
54
- if (value0.isAvailable !== null && value0.isAvailable !== undefined) {
55
- var value1 = value0.isAvailable;
56
- protocol.writeFieldBegin('isAvailable', thrift_1.Thrift.Type.BOOL, 1);
57
- protocol.writeBool(value1);
58
- protocol.writeFieldEnd();
59
- }
60
- if (value0.publicationDate !== null && value0.publicationDate !== undefined) {
61
- var value1 = value0.publicationDate;
62
- protocol.writeFieldBegin('publicationDate', thrift_1.Thrift.Type.STRUCT, 2);
63
- capiDateTime_1.CapiDateTimeSerde.write(protocol, value1);
64
- protocol.writeFieldEnd();
65
- }
66
- protocol.writeFieldStop();
67
- protocol.writeStructEnd();
68
- };
69
- return ChannelFieldsSerde;
70
- }());
71
- exports.ChannelFieldsSerde = ChannelFieldsSerde;
@@ -1,15 +0,0 @@
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 { ChannelFields } from './channelFields';
8
- export interface ContentChannel {
9
- channelId: string;
10
- fields: ChannelFields;
11
- }
12
- export declare class ContentChannelSerde {
13
- static read(protocol: TProtocol): ContentChannel;
14
- static write(protocol: TProtocol, value0: ContentChannel): void;
15
- }