@guardian/content-api-models 17.5.0-beta.0 → 17.5.2-beta.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": "17.5.0-beta.0",
4
+ "version": "17.5.2-beta.0",
5
5
  "description": "Typescript library built from the content api thrift definitions",
6
6
  "repository": {
7
7
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "@guardian/content-entity-model": "^2.2.1",
18
18
  "@types/thrift": "^0.10.11",
19
19
  "thrift": "^0.15.0",
20
- "@guardian/content-atom-model": "^3.4.0",
20
+ "@guardian/content-atom-model": "^3.4.2",
21
21
  "@types/node-int64": "^0.4.29",
22
22
  "node-int64": "^0.4.0"
23
23
  }
@@ -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 { 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
+ }
@@ -0,0 +1,71 @@
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;
@@ -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 { 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
+ }
@@ -0,0 +1,71 @@
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.ContentChannelSerde = void 0;
9
+ var thrift_1 = require("thrift");
10
+ var channelFields_1 = require("./channelFields");
11
+ var ContentChannelSerde = /** @class */ (function () {
12
+ function ContentChannelSerde() {
13
+ }
14
+ ContentChannelSerde.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.STRING) {
27
+ var value1 = protocol.readString();
28
+ result.channelId = 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 = channelFields_1.ChannelFieldsSerde.read(protocol);
37
+ result.fields = 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
+ 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);
57
+ protocol.writeString(value1);
58
+ protocol.writeFieldEnd();
59
+ }
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);
64
+ protocol.writeFieldEnd();
65
+ }
66
+ protocol.writeFieldStop();
67
+ protocol.writeStructEnd();
68
+ };
69
+ return ContentChannelSerde;
70
+ }());
71
+ exports.ContentChannelSerde = ContentChannelSerde;
@@ -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
  };
package/v1/podcast.d.ts CHANGED
@@ -17,6 +17,7 @@ export interface Podcast {
17
17
  googlePodcastsUrl?: string;
18
18
  spotifyUrl?: string;
19
19
  acastId?: string;
20
+ pocketCastsUrl?: string;
20
21
  }
21
22
  export declare class PodcastSerde {
22
23
  static read(protocol: TProtocol): Podcast;
package/v1/podcast.js CHANGED
@@ -131,6 +131,15 @@ var PodcastSerde = /** @class */ (function () {
131
131
  protocol.skip(ftype);
132
132
  }
133
133
  break;
134
+ case 12:
135
+ if (ftype === thrift_1.Thrift.Type.STRING) {
136
+ var value1 = protocol.readString();
137
+ result.pocketCastsUrl = value1;
138
+ }
139
+ else {
140
+ protocol.skip(ftype);
141
+ }
142
+ break;
134
143
  default:
135
144
  protocol.skip(ftype);
136
145
  }
@@ -212,6 +221,12 @@ var PodcastSerde = /** @class */ (function () {
212
221
  protocol.writeString(value1);
213
222
  protocol.writeFieldEnd();
214
223
  }
224
+ if (value0.pocketCastsUrl !== null && value0.pocketCastsUrl !== undefined) {
225
+ var value1 = value0.pocketCastsUrl;
226
+ protocol.writeFieldBegin('pocketCastsUrl', thrift_1.Thrift.Type.STRING, 12);
227
+ protocol.writeString(value1);
228
+ protocol.writeFieldEnd();
229
+ }
215
230
  protocol.writeFieldStop();
216
231
  protocol.writeStructEnd();
217
232
  };